Repository navigation
fix(workflow-code): keep js template escapes verbatim, add table agent tool form, pin create fingerprint - #10528
Conversation
…ledge/file agent tool forms, pin create fingerprint
- js/py/sh/json/md tagged templates now store the raw text written between the
backticks (only \` and \${ are escapes), so js`/\s+/` stores /\s+/ instead of
silently dropping the backslash. The printer writes code back so compile
reads exactly the stored text, using ${'...'} for what raw text cannot hold.
- The catalog marks the built-in blocks the agent tool picker offers
(agentTool), so table.tool.queryRows(...), knowledge.tool.search(...) and
file.tool.read(...) compile and print instead of requiring raw().
- A source write now prints its answer with the workspace's resource keys for
any resource the source wrote by id, so the returned fingerprint matches the
next read and a pinned deploy (create --deploy no longer fails with a
draft-changed conflict).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
[Medium impact] The PR appears safe to merge, with the earlier renamed-tag issue fixed and no new actionable findings. SummaryThe PR preserves backslashes in code templates, adds built-in agent tool builders, and makes write responses use the same resource keys as later reads.
Reviews (2) · Last reviewed commit: "docs(workflow-sdk): show a table operati..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 29 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
… in the character check A cooked t imported as js skipped the NUL/lone-surrogate check while compile still read it cooked. Also documents that agentTool marks hidden legacy versions.
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
Three fixes found while solving benchmark tasks with the CLI.
1.
js/py/sh/json/mdtemplates dropped backslashes. These templates used to be read as cooked text, sojs`/\s+/`was stored as/s+/and the regex stopped matching with no error. They are now read raw, likeString.raw. The only escapes left are\`and\${. The printer writes code back so that compiling it gives the same text. A backtick and${get a backslash. Anything raw text cannot hold (CR, invisible characters, and a backslash that would otherwise escape a backtick,${or the end of the template) is written as a${'…'}interpolation.ttemplates are prose and stay cooked. The storable-literal check no longer reads cooked escapes in verbatim templates.2.
table.tool.queryRows(...)was refused withE_UNKNOWN_BUILDER. The editor's agent tool picker offers Table, Knowledge and File beside integrations, and stores them in the same{ type, operation, params }shape. The catalog now marks those blocksagentTool, andhasToolFormaccepts them. As a result, compile, print, SDK codegen and the v2 catalog contract all havetable.tool.*,knowledge.tool.*andfile.tool.*, and a picker-stored Table tool prints back through the builder instead ofraw(). The core agent tool type list moved from the tool-input UI utils toblocks/agent-tools.tsso the catalog projection can use it.3.
source create --deployfailed with a "draft changed" conflict. The write printed its answer with the plan's resource resolver. That resolver only knows resources the source named by key. A table the source wrote by id, such as thetableIdof araw()tool, therefore printed and fingerprinted differently from the next read and from the pinned deploy's draft check. A write now resolves the ids the plan resolver misses through the workspace's resource keys. A commit allocates missing keys; a dry run only reads existing ones.Test plan
print/verbatim-templates.test.ts: a rawjstemplate keeps its backslashes and still runs correctly, escaped backtick and${work, a NUL escape stays text, and a regex prints undoubled.real-catalog.test.ts: a picker-stored Table tool prints astable.tool.queryRows, type-checks against the generated SDK and compiles back.apply-workflow-source.integration.ts: create, then a deploy pinned to the returned fingerprint, succeeds, and the next read has the same fingerprint (keyed and unkeyed tables).generate;lint;check:audits;check:test-types; the block-registry check.