Skip to content

Commit 0b331c7

Browse files
committed
fix(workflow-code): keep the test-resource warning on --allow, concrete table commands in the chat help
1 parent d09d2e0 commit 0b331c7

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎packages/sim-cli/src/commands/protocol/source-loop-help.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ function statusLine(group: string, dir: string): string {
3030
export function workflowSourceScopeHelp(surface: PrimerSurface): string {
3131
const tables =
3232
surface === 'chat'
33-
? `change a table's columns with
34-
\`sim tables columns create|update\` before the get (the table types it writes miss a later
35-
change), its rows with \`sim tables rows\``
33+
? `change a table's columns before the get, whose
34+
table types miss a later change: \`sim tables columns create <table> --column '{…}'\` or \`sim
35+
tables columns update <table> --column-name <column> --updates '{…}'\`; its rows with \`sim tables
36+
rows update <table> <row> --data '{…}'\``
3637
: `edit a table's columns and rows with
3738
\`sim workspaces source get --dir <dir>\` (tables/<key>.ts), read rows with \`sim tables rows
3839
list <table>\``

‎packages/sim-cli/src/commands/protocol/source-primer.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ${PATTERNS_HEADING} (\`.sim/examples/\`, indexed atop \`cookbook.ts\`; any build
6868
- Tables: \`table.queryRows\` outputs \`rows\` (\`recent.rows[0].data.status\`), not \`row\`; \`table.upsertRow\` takes \`conflictColumn: 'orderId'\`.
6969
- Rejoin: before one \`response\`, a Function picks the branch that ran with \`??\`.${extra.patterns ?? ''}
7070
- **Credentials**: \`sim credentials connect <provider> --name "<Name>"\`, send the owner its link, then \`credential('<key>')\`.
71-
- **Run**: \`sim workflows run <workflowId>\` runs the active deployment; \`--draft\` runs the draft for real (use test resources); \`--dry\` runs it stubbing writes and MCP tools (even read-only: \`mcp-read-only\`), listed in \`sideEffects\` (\`dry_run_*\` placeholders); GET \`api\` calls and plain-JS GET fetches run; sandboxed code (Python, shell, imports): \`unchecked\`. \`--allow <block>\` sends its writes; \`--mock <block>='{…}'\` fixes its output (bare, with \`--mock-from <runId>\`: that run's); a child's block: \`<workflow>.<block>\`.
71+
- **Run**: \`sim workflows run <workflowId>\` runs the active deployment; \`--draft\` runs the draft for real and \`--allow <block>\` sends that block's writes (use test resources); \`--dry\` runs it stubbing writes and MCP tools (even read-only: \`mcp-read-only\`), listed in \`sideEffects\` (\`dry_run_*\` placeholders); GET \`api\` calls and plain-JS GET fetches run; sandboxed code (Python, shell, imports): \`unchecked\`. \`--mock <block>='{…}'\` fixes its output (bare, with \`--mock-from <runId>\`: that run's); a child's block: \`<workflow>.<block>\`.
7272
- **Debug**: \`--dir <dir>\` maps a failure to file:line; \`sim logs get <runId> --trace --no-include-workflow-state\`; rows: \`sim tables rows list <table>\`; rerun: \`--from-block <block> --source-run <runId>\`; \`--stop-after <block>\`.
7373
- **Exit codes**: 0 ok, 1 errors, ${SOURCE_STALE_EXIT_CODE} stale (redo in a fresh get), ${RATE_LIMITED_EXIT_CODE} rate limited, ${SOURCE_BUSY_EXIT_CODE} busy, ${SOURCE_LOCAL_CHANGES_EXIT_CODE}/${SOURCE_DRIFT_EXIT_CODE} \`status\`: your edits / the server changed.`
7474
}
@@ -93,7 +93,7 @@ const APPLY_REWRITES = `\`check\` also type-checks (no \`tsc\`). Apply re-checks
9393
*/
9494
const WORKFLOW_EDIT_LOOP: Record<PrimerSurface, string> = {
9595
cli: `${EDIT_LOOP_LEAD}; fix what it reports: \`${WORKFLOW_LOOP}${RUN_AND_DEPLOY}\` applies, dry-runs that input, and deploys only if it completed (no \`--deploy\`: stays a draft). ${APPLY_REWRITES}`,
96-
chat: `${EDIT_LOOP_LEAD} in run_code's shell; fix what it reports: \`${WORKFLOW_LOOP}\`. ${APPLY_REWRITES} Test the draft with sim_cli (the shell refuses sync runs): \`workflows run <workflowId> --dry --input '{…}' --dir <dir>\` (from /home/user); once it passes, \`workflows deploy <workflowId> --expected-draft-fingerprint <fingerprint>\` (from \`.sim/base.json\`).`,
96+
chat: `${EDIT_LOOP_LEAD} in run_code's shell; fix what it reports: \`${WORKFLOW_LOOP}\`. ${APPLY_REWRITES} Test the draft with sim_cli, as the shell refuses runs: \`workflows run <workflowId> --dry --input '{…}' --dir <dir>\` (from /home/user), then \`workflows deploy <workflowId> --expected-draft-fingerprint <fingerprint>\` (from \`.sim/base.json\`).`,
9797
}
9898

9999
function workflowPrimer(surface: PrimerSurface): string {

0 commit comments

Comments
 (0)