Skip to content

Commit db1e3ad

Browse files
authored
fix(workflow-code): json-text input mappings, wiring beside blocks, source find (#10442)
* fix(workflow-code): decode JSON-text input mappings, keep wiring beside its blocks, add source find - A Workflow block's inputMapping (and any native object/list field) stored as JSON text by the operations route printed as a t`` template that never type-checks; an untouched directory passed only because check suppresses errors in files still as get wrote them. Canonicalize now decodes the container and materialize keeps the stored text encoding. Deploy-change detection treats the two encodings as one value. - The printer emits each wiring statement under the last-declared block it names, so a block's edges sit next to it instead of ~1000 lines away in a 192-block workflow. - New `sim workflows source find <block>`: a block's code with line numbers, function file, incoming/outgoing wiring and readers, offline. - The operations batch cap error says how to split a larger edit. * fix(workflow-code): exact JSON-text equivalence, per-edge find locations, layout-aware tests - Decode JSON text, and treat it as unchanged in deploy-change detection, only for input-mapping fields, whose runtime parses both forms (JSON_TEXT_CONTAINER_TYPES). Other container fields such as a checkbox list compare as stored again. - Compile records where each edge is written (edgeSpans), and `source find` reports every edge at its own statement. - `source find` reads function-file references the way compile does (codeFileRefs: parsed chains plus stored tags) in the file's own language. - Integration edits follow the interleaved wiring layout; docs baseline takes the new CLI reference code examples.
1 parent 212567b commit db1e3ad

53 files changed

Lines changed: 1697 additions & 1000 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8837,6 +8837,38 @@ Prints a builder in brief (an example call, the required params with types, the
88378837

88388838
Exit codes: 0 printed; 1 no builder or namespace of that name (the closest one is named), or no cached catalog (run a get once).
88398839

8840+
### sim workflows source find
8841+
8842+
Print a block's code, edges and readers with line numbers (offline)
8843+
8844+
```bash
8845+
sim workflows source find <block> [options]
8846+
```
8847+
8848+
**Arguments**
8849+
8850+
<CommandTable>
8851+
8852+
| Argument | Required | Description |
8853+
| --- | --- | --- |
8854+
| `block` | Yes | Block name, key or identifier; a part of a name matches every block |
8855+
8856+
</CommandTable>
8857+
8858+
**Options**
8859+
8860+
<CommandTable>
8861+
8862+
| Option | Required | Description |
8863+
| --- | --- | --- |
8864+
| `--dir <dir>` | No | Workflow source directory to read. Defaults to `.`. |
8865+
8866+
</CommandTable>
8867+
8868+
Prints each block the name matches, read from the directory alone (no request is made): its declaration in workflow.ts with line numbers, its function file, the wiring statements of its incoming and outgoing edges, and every block that reads its outputs (a param, a branch, or a function file's $ref), each as file:line. &lt;block&gt; is a block name (Security Score), its key (securityscore) or its identifier (securityScore); with no exact match, every block whose name contains it is printed (at most 20). Run it from a workflow source directory, or pass --dir.
8869+
8870+
Exit codes: 0 printed; 1 no block matches (the closest name is suggested), or the directory is not a workflow source directory.
8871+
88408872
### sim workflows get
88418873

88428874
Get workflow

‎apps/docs/content/docs/cli/workflows.mdx‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,38 @@ Without --server, each file created, edited or deleted since the directory was r
15691569

15701570
API request and response schemas: [getWorkflowSource](/api-reference/workflows/getWorkflowSource).
15711571

1572+
### Print a block's code, edges and readers with line numbers
1573+
1574+
Offline.
1575+
1576+
```bash
1577+
sim workflows source find <block> [options]
1578+
```
1579+
1580+
**Arguments**
1581+
1582+
<CommandTable>
1583+
1584+
| Argument | Required | Description |
1585+
| --- | --- | --- |
1586+
| `block` | Yes | Block name, key or identifier; a part of a name matches every block |
1587+
1588+
</CommandTable>
1589+
1590+
**Options**
1591+
1592+
<CommandTable>
1593+
1594+
| Option | Required | Description |
1595+
| --- | --- | --- |
1596+
| `--dir <dir>` | No | Workflow source directory to read. Defaults to `.`. |
1597+
1598+
</CommandTable>
1599+
1600+
Prints each block the name matches, read from the directory alone (no request is made): its declaration in workflow.ts with line numbers, its function file, the wiring statements of its incoming and outgoing edges, and every block that reads its outputs (a param, a branch, or a function file's $ref), each as file:line. &lt;block&gt; is a block name (Security Score), its key (securityscore) or its identifier (securityScore); with no exact match, every block whose name contains it is printed (at most 20). Run it from a workflow source directory, or pass --dir.
1601+
1602+
Exit codes: 0 printed; 1 no block matches (the closest name is suggested), or the directory is not a workflow source directory.
1603+
15721604
### Print a builder's params and outputs from the cached block catalog
15731605

15741606
Offline.

‎apps/docs/content/docs/workflows/code/coding-agents.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ For a whole workspace, use `sim workspaces source` with the same steps; see [Man
3232

3333
## Look things up
3434

35+
- `sim workflows source find <block>` prints one block of the workflow by name, key or identifier, from the directory without a request: its declaration with line numbers, its function file, its incoming and outgoing wiring and every block that reads its outputs, each as `file:line`. A part of a name prints every block it matches.
3536
- `sim workflows source params <builder>` prints a builder in brief (an example call, the required params with types, the optional ones by name and the outputs) from the cached block catalog without a request. `--full` prints every param with its type, options, default and doc. A legacy builder names the one that replaces it, and a namespace such as `gmail` lists its builders.
3637
- `sim workflows source resources` lists the tables, knowledge bases, credentials, workflows, skills, custom tools, MCP servers and environment variable names the file can name.
3738
- `sim workflows source catalog` shows the block catalog the source is checked against.

0 commit comments

Comments
 (0)