You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce74554
Browse filesBrowse the repository at this point in the historyBrowse files
fix(workflow-code): name workspace files by path in file() references (#10545)
* fix(workflow-code): name workspace files by path in file() references
file('<folder>/<name>') now resolves the workspace file at that path and
writes the object the editor's file picker stores (storage key and file
id), a stored workspace file prints back as file('<path>'), and the source
resources manifest and workspace.d.ts list file paths.
* fix(workflow-code): resolve file() paths as written and keep them from withheld callers
* fix(workflow-code): report a malformed file() path as an unknown file
* fix(workflow-code): gate file() paths on files.use, match names as written, and report truncation exactly
- a path the stored workflow does not already hold resolves only for a caller whose group allows Files; any other caller gets the unknown-file finding a missing path gets
- resolve file() paths by exact name and folder path instead of the VFS reference parser, so files named content or meta.json inside a folder resolve
- read file pages until the manifest cap is filled so files no path names cannot hide a truncated list
- document the quoted file('docs/report.pdf') form in the manifest description
* chore(workflow-sdk): regenerate core text after rebase
Copy file name to clipboardExpand all lines: apps/docs/content/docs/workflows/code/directory.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ A resource's key is its file or folder name, and a workflow names it by that key
61
61
-`mcp/<key>.ts`: `export default defineMcpServer({ name?, url, headers?, auth?, timeout?, retries?, enabled? })`. A credential header holds `env.NAME` or `'Bearer {{NAME}}'`, never a literal secret; `stored()` keeps the value the server holds. A new host or path in `url` replaces the server; a new query string updates it in place. A workflow: `mcp('<key>').tool('<name>')`.
62
62
-`tables/<key>.ts`: `export default defineTable({ name, description?, folder?, columns: { … } })` with `column.string()`, `column.number()`, `column.select({ options: [...] })`, … from `@sim/workflow-sdk/workspace`. Rows stay out of source unless `rows` opts in: `{ mode: 'managed', key: '<unique column>' }` keeps the rows equal to `tables/<key>.rows.jsonl` (one JSON object per line, keyed by column key), `{ mode: 'seed' }` writes them once into a new table. A workflow: `table('<key>')`.
63
63
-`knowledge/<key>/knowledge.ts` (`defineKnowledgeBase({ name, description?, folder?, chunking?, embeddingModel? })`) and `knowledge/<key>/docs/`, one file per document, flat. A workflow: `knowledgeBase('<key>')`. Connector-synced documents are never part of source.
64
-
-`files/<path>`: every file is one workspace file at that folder path; no declaration.
64
+
-`files/<path>`: every file is one workspace file at that folder path; no declaration. A workflow: `file('<path>')` (the path under `files/`), as a file-upload field's value.
65
65
-`workflows/<key>/`: one workflow each, exactly a `sim workflows source get --dir` directory (`workflow.ts`, `functions/*`, `.sim/lock.json`, `.sim/base.json`).
66
66
-`deployments/<workflow key>.ts`: `defineDeployment({ live: 'draft' | 'pinned', api?: { public? }, chat? })` deploys `workflows/<workflow key>/`, so its schedule, webhook, API and chat triggers run. `live: 'draft'` publishes the draft whenever it differs from the live version; `'pinned'` never redeploys and says when the draft differs. A chat password is `env.NAME` (or `stored()` to keep the stored one); chat outputs name a block by its name. Removing the file undeploys the workflow (needs `--allow-delete`). Deploying needs workspace admin, never a workspace API key. MCP publishing is not part of source.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/workflows/code/syntax.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,14 +165,14 @@ The optional third argument holds what belongs to the block, not to its settings
165
165
166
166
### Resource helpers
167
167
168
-
A key is the resource's stable key in the workspace; `.sim/sdk/workspace.d.ts` lists them. A key with no live resource is `E_MAT_UNKNOWN_RESOURCE` on apply.
168
+
A key is the resource's stable key in the workspace; `.sim/sdk/workspace.d.ts` lists them. A file's key is its folder path and name, so the same source names the file at that path in any workspace it is applied to. A key with no live resource is `E_MAT_UNKNOWN_RESOURCE` on apply.
169
169
170
170
| Form | Stands for |
171
171
| --- | --- |
172
172
|`credential('key')`| A saved credential |
173
173
|`table('key')`| A workspace table |
174
174
|`knowledgeBase('key')`| A knowledge base |
175
-
|`file('path')`| A workspace file |
175
+
|`file('folder/name.pdf')`| A workspace file, by its folder path and name; a file field's value, or an item of a multi-file field's list|
176
176
|`folder('key')`| A workspace folder |
177
177
|`childWorkflow('key')`| A workflow, for `runWorkflow`; `.asTool()` in a `tools` list |
178
178
|`customTool('key')`| A custom tool, in a `tools` list |
0 commit comments