@fluidgrids/cli 2026.1107.1 → 2026.1109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +98 -6
  2. package/dist/cli.js +9705 -33
  3. package/package.json +42 -35
  4. package/dist/auth/device-login.d.ts +0 -31
  5. package/dist/auth/device-login.d.ts.map +0 -1
  6. package/dist/auth/device-login.js +0 -75
  7. package/dist/auth/device-login.js.map +0 -1
  8. package/dist/auth/token-auth.d.ts +0 -49
  9. package/dist/auth/token-auth.d.ts.map +0 -1
  10. package/dist/auth/token-auth.js +0 -279
  11. package/dist/auth/token-auth.js.map +0 -1
  12. package/dist/cli.d.ts +0 -10
  13. package/dist/cli.d.ts.map +0 -1
  14. package/dist/cli.js.map +0 -1
  15. package/dist/code-first/api.d.ts +0 -601
  16. package/dist/code-first/api.d.ts.map +0 -1
  17. package/dist/code-first/api.js +0 -432
  18. package/dist/code-first/api.js.map +0 -1
  19. package/dist/code-first/code-upload.d.ts +0 -53
  20. package/dist/code-first/code-upload.d.ts.map +0 -1
  21. package/dist/code-first/code-upload.js +0 -165
  22. package/dist/code-first/code-upload.js.map +0 -1
  23. package/dist/code-first/commands/codegen.d.ts +0 -20
  24. package/dist/code-first/commands/codegen.d.ts.map +0 -1
  25. package/dist/code-first/commands/codegen.js +0 -50
  26. package/dist/code-first/commands/codegen.js.map +0 -1
  27. package/dist/code-first/commands/diff.d.ts +0 -28
  28. package/dist/code-first/commands/diff.d.ts.map +0 -1
  29. package/dist/code-first/commands/diff.js +0 -73
  30. package/dist/code-first/commands/diff.js.map +0 -1
  31. package/dist/code-first/commands/hotfix.d.ts +0 -54
  32. package/dist/code-first/commands/hotfix.d.ts.map +0 -1
  33. package/dist/code-first/commands/hotfix.js +0 -225
  34. package/dist/code-first/commands/hotfix.js.map +0 -1
  35. package/dist/code-first/commands/import.d.ts +0 -40
  36. package/dist/code-first/commands/import.d.ts.map +0 -1
  37. package/dist/code-first/commands/import.js +0 -235
  38. package/dist/code-first/commands/import.js.map +0 -1
  39. package/dist/code-first/commands/init.d.ts +0 -33
  40. package/dist/code-first/commands/init.d.ts.map +0 -1
  41. package/dist/code-first/commands/init.js +0 -177
  42. package/dist/code-first/commands/init.js.map +0 -1
  43. package/dist/code-first/commands/interface.d.ts +0 -12
  44. package/dist/code-first/commands/interface.d.ts.map +0 -1
  45. package/dist/code-first/commands/interface.js +0 -21
  46. package/dist/code-first/commands/interface.js.map +0 -1
  47. package/dist/code-first/commands/pull.d.ts +0 -63
  48. package/dist/code-first/commands/pull.d.ts.map +0 -1
  49. package/dist/code-first/commands/pull.js +0 -266
  50. package/dist/code-first/commands/pull.js.map +0 -1
  51. package/dist/code-first/commands/push.d.ts +0 -97
  52. package/dist/code-first/commands/push.d.ts.map +0 -1
  53. package/dist/code-first/commands/push.js +0 -313
  54. package/dist/code-first/commands/push.js.map +0 -1
  55. package/dist/code-first/commands/replay.d.ts +0 -44
  56. package/dist/code-first/commands/replay.d.ts.map +0 -1
  57. package/dist/code-first/commands/replay.js +0 -238
  58. package/dist/code-first/commands/replay.js.map +0 -1
  59. package/dist/code-first/commands/runs.d.ts +0 -160
  60. package/dist/code-first/commands/runs.d.ts.map +0 -1
  61. package/dist/code-first/commands/runs.js +0 -565
  62. package/dist/code-first/commands/runs.js.map +0 -1
  63. package/dist/code-first/commands/suite.d.ts +0 -57
  64. package/dist/code-first/commands/suite.d.ts.map +0 -1
  65. package/dist/code-first/commands/suite.js +0 -197
  66. package/dist/code-first/commands/suite.js.map +0 -1
  67. package/dist/code-first/commands/validate.d.ts +0 -38
  68. package/dist/code-first/commands/validate.d.ts.map +0 -1
  69. package/dist/code-first/commands/validate.js +0 -140
  70. package/dist/code-first/commands/validate.js.map +0 -1
  71. package/dist/code-first/commands/versions.d.ts +0 -63
  72. package/dist/code-first/commands/versions.d.ts.map +0 -1
  73. package/dist/code-first/commands/versions.js +0 -204
  74. package/dist/code-first/commands/versions.js.map +0 -1
  75. package/dist/code-first/connections.d.ts +0 -55
  76. package/dist/code-first/connections.d.ts.map +0 -1
  77. package/dist/code-first/connections.js +0 -180
  78. package/dist/code-first/connections.js.map +0 -1
  79. package/dist/code-first/durable-operations.d.ts +0 -41
  80. package/dist/code-first/durable-operations.d.ts.map +0 -1
  81. package/dist/code-first/durable-operations.js +0 -135
  82. package/dist/code-first/durable-operations.js.map +0 -1
  83. package/dist/code-first/history.d.ts +0 -30
  84. package/dist/code-first/history.d.ts.map +0 -1
  85. package/dist/code-first/history.js +0 -139
  86. package/dist/code-first/history.js.map +0 -1
  87. package/dist/code-first/imports.d.ts +0 -22
  88. package/dist/code-first/imports.d.ts.map +0 -1
  89. package/dist/code-first/imports.js +0 -67
  90. package/dist/code-first/imports.js.map +0 -1
  91. package/dist/code-first/index.d.ts +0 -18
  92. package/dist/code-first/index.d.ts.map +0 -1
  93. package/dist/code-first/index.js +0 -36
  94. package/dist/code-first/index.js.map +0 -1
  95. package/dist/code-first/junit.d.ts +0 -24
  96. package/dist/code-first/junit.d.ts.map +0 -1
  97. package/dist/code-first/junit.js +0 -163
  98. package/dist/code-first/junit.js.map +0 -1
  99. package/dist/code-first/lowering.d.ts +0 -94
  100. package/dist/code-first/lowering.d.ts.map +0 -1
  101. package/dist/code-first/lowering.js +0 -248
  102. package/dist/code-first/lowering.js.map +0 -1
  103. package/dist/code-first/operations.d.ts +0 -55
  104. package/dist/code-first/operations.d.ts.map +0 -1
  105. package/dist/code-first/operations.js +0 -165
  106. package/dist/code-first/operations.js.map +0 -1
  107. package/dist/code-first/parity-operations.d.ts +0 -44
  108. package/dist/code-first/parity-operations.d.ts.map +0 -1
  109. package/dist/code-first/parity-operations.js +0 -211
  110. package/dist/code-first/parity-operations.js.map +0 -1
  111. package/dist/code-first/parity.d.ts +0 -83
  112. package/dist/code-first/parity.d.ts.map +0 -1
  113. package/dist/code-first/parity.js +0 -301
  114. package/dist/code-first/parity.js.map +0 -1
  115. package/dist/code-first/presigned.d.ts +0 -21
  116. package/dist/code-first/presigned.d.ts.map +0 -1
  117. package/dist/code-first/presigned.js +0 -85
  118. package/dist/code-first/presigned.js.map +0 -1
  119. package/dist/code-first/project.d.ts +0 -123
  120. package/dist/code-first/project.d.ts.map +0 -1
  121. package/dist/code-first/project.js +0 -301
  122. package/dist/code-first/project.js.map +0 -1
  123. package/dist/code-first/python.d.ts +0 -81
  124. package/dist/code-first/python.d.ts.map +0 -1
  125. package/dist/code-first/python.js +0 -249
  126. package/dist/code-first/python.js.map +0 -1
  127. package/dist/code-first/redact.d.ts +0 -31
  128. package/dist/code-first/redact.d.ts.map +0 -1
  129. package/dist/code-first/redact.js +0 -159
  130. package/dist/code-first/redact.js.map +0 -1
  131. package/dist/code-first/register.d.ts +0 -35
  132. package/dist/code-first/register.d.ts.map +0 -1
  133. package/dist/code-first/register.js +0 -415
  134. package/dist/code-first/register.js.map +0 -1
  135. package/dist/code-first/remote.d.ts +0 -58
  136. package/dist/code-first/remote.d.ts.map +0 -1
  137. package/dist/code-first/remote.js +0 -126
  138. package/dist/code-first/remote.js.map +0 -1
  139. package/dist/code-first/replay.d.ts +0 -36
  140. package/dist/code-first/replay.d.ts.map +0 -1
  141. package/dist/code-first/replay.js +0 -52
  142. package/dist/code-first/replay.js.map +0 -1
  143. package/dist/code-first/shared.d.ts +0 -53
  144. package/dist/code-first/shared.d.ts.map +0 -1
  145. package/dist/code-first/shared.js +0 -94
  146. package/dist/code-first/shared.js.map +0 -1
  147. package/dist/code-first/test-suite-operations.d.ts +0 -16
  148. package/dist/code-first/test-suite-operations.d.ts.map +0 -1
  149. package/dist/code-first/test-suite-operations.js +0 -44
  150. package/dist/code-first/test-suite-operations.js.map +0 -1
  151. package/dist/modules.d.ts +0 -15
  152. package/dist/modules.d.ts.map +0 -1
  153. package/dist/modules.js +0 -61
  154. package/dist/modules.js.map +0 -1
  155. package/dist/product-defaults.d.ts +0 -11
  156. package/dist/product-defaults.d.ts.map +0 -1
  157. package/dist/product-defaults.js +0 -25
  158. package/dist/product-defaults.js.map +0 -1
  159. package/dist/program.d.ts +0 -20
  160. package/dist/program.d.ts.map +0 -1
  161. package/dist/program.js +0 -44
  162. package/dist/program.js.map +0 -1
@@ -1,415 +0,0 @@
1
- /**
2
- * Commander registrations of the code-first commands.
3
- *
4
- * The command implementations under `./commands/` load `@fluidgrids/workflows`
5
- * (the IR library, esbuild, Prettier and QuickJS), which costs hundreds of
6
- * milliseconds. Every action therefore imports its implementation on demand,
7
- * so the rest of the CLI (`fluidgrids workflows list`, `fluidgrids runs wait`,
8
- * …) starts as fast as it did before the code-first commands existed. Only
9
- * types are imported statically here; keep it that way.
10
- */
11
- import { withGlobalFormat, } from './shared.js';
12
- const PROJECT_OPTION = [
13
- '--project <dir>',
14
- 'Project directory (default: nearest fluidgrids.config.json)',
15
- ];
16
- const OUTPUT_OPTION = ['-f, --format <format>', 'Output format (json, table, yaml)'];
17
- export function registerInit(program, env) {
18
- program
19
- .command('init [dir]')
20
- .description('Scaffold a code-first workflow project (fluidgrids.config.json, workflows/, lock.json)')
21
- .option('--lang <lang>', 'Project language: ts or py', 'ts')
22
- .option('--workspace <id>', 'Workspace to sign in to and record in fluidgrids.config.json')
23
- .option('--force', 'Overwrite existing scaffold files')
24
- .option('--no-codegen', 'Do not generate the node clients now')
25
- .option('--no-login', 'Do not start the device-code login when signed out')
26
- .option(...OUTPUT_OPTION)
27
- .action(async (dir, options, command) => {
28
- const { runInit } = await import('./commands/init.js');
29
- await runInit(env, dir, withGlobalFormat(options, command));
30
- });
31
- }
32
- export function registerCodegen(program, env) {
33
- program
34
- .command('codegen')
35
- .description('Regenerate the typed node clients (.fluidgrids/nodes.ts|py) from the workspace registry')
36
- .option('--lang <lang>', 'Client language: ts or py (default: the project language)')
37
- .option(...PROJECT_OPTION)
38
- .option(...OUTPUT_OPTION)
39
- .action(async (options, command) => {
40
- const { runCodegen } = await import('./commands/codegen.js');
41
- await runCodegen(env, withGlobalFormat(options, command));
42
- });
43
- }
44
- export function registerPull(program, env) {
45
- program
46
- .command('pull [keys...]')
47
- .description('Export workflows into the project as TypeScript, Python or JSON')
48
- .option('--as <format>', 'Code format: ts, py or json (default: as tracked in lock.json, else the project language); `--format ts|py` also works')
49
- .option('--check', 'Write nothing; print the fidelity report and fail when an export is lossy')
50
- .option('--wf-version <version>', 'Pull this version instead of the latest (one key only)')
51
- .option('--server', 'Render the code on the service instead of locally')
52
- .option('--pinned-data', 'Also write pinned TEST data to workflows/<key>.pinned.json')
53
- .option(...PROJECT_OPTION)
54
- .option(...OUTPUT_OPTION)
55
- .action(async (keys, options, command) => {
56
- const { runPull } = await import('./commands/pull.js');
57
- await runPull(env, keys, withGlobalFormat(options, command));
58
- });
59
- }
60
- export function registerPush(program, env) {
61
- program
62
- .command('push [keys...]')
63
- .description('Lower the project and create a version for every workflow that changed')
64
- .option('--dry-run', 'Lower, validate and diff against the latest version; create nothing')
65
- .option('-m, --message <text>', 'Description for the new versions')
66
- .option('--force', 'Push even when the workspace has versions newer than the one the project pulled')
67
- .option('--hotfix <version>', 'Replace the code bundle of this existing version instead (durable functions; replay-verified by the service)')
68
- .option('--replay-sample <n>', 'With --hotfix: replay the n latest runs of the version locally first')
69
- .option('--no-verify-replay', 'With --hotfix: skip the service replay verification (audited)')
70
- .option('--timeout <ms>', 'With --hotfix: how long to wait for the replacement job', '600000')
71
- .option(...PROJECT_OPTION)
72
- .option(...OUTPUT_OPTION)
73
- .action(async (keys, options, command) => {
74
- const resolved = withGlobalFormat(options, command);
75
- if (resolved.hotfix !== undefined) {
76
- const { runHotfix } = await import('./commands/hotfix.js');
77
- await runHotfix(env, keys, resolved);
78
- return;
79
- }
80
- const { runPush } = await import('./commands/push.js');
81
- await runPush(env, keys, resolved);
82
- });
83
- }
84
- export function registerDiff(program, env) {
85
- program
86
- .command('diff [keys...]')
87
- .description('IR diff of the local workflows against a stored version')
88
- .option('--against <version>', 'latest, active or a version such as v3', 'latest')
89
- .option('--exit-code', 'Exit with status 1 when any workflow differs')
90
- .option(...PROJECT_OPTION)
91
- .option(...OUTPUT_OPTION)
92
- .action(async (keys, options, command) => {
93
- const { runDiff } = await import('./commands/diff.js');
94
- await runDiff(env, keys, withGlobalFormat(options, command));
95
- });
96
- }
97
- export function registerValidate(program, env) {
98
- program
99
- .command('validate [keys...]')
100
- .description('Validate the local workflows as IR v2 (lowered from code where needed)')
101
- .option('--strict', 'Also apply the strict rules: no legacy mirrors, no ${...} templates, slug node ids')
102
- .option('--remote', 'Also validate on the service (task queues, installed nodes)')
103
- .option('--offline', 'Do not contact the workspace; connection names are not resolved')
104
- .option(...PROJECT_OPTION)
105
- .option(...OUTPUT_OPTION)
106
- .action(async (keys, options, command) => {
107
- const { runValidate } = await import('./commands/validate.js');
108
- await runValidate(env, keys, withGlobalFormat(options, command));
109
- });
110
- }
111
- export function registerImport(program, env) {
112
- program
113
- .command('import <file>')
114
- .description('Create a new workflow (DRAFT) from a .json, .ts or .py file; the service lowers TypeScript itself')
115
- .option('--key <key>', 'Workflow key (default: the key the file declares)')
116
- .option('--name <name>', 'Workflow name (default: the name the file declares, else the key)')
117
- .option('--description <text>', 'Description of the new workflow')
118
- .option('--allow-missing-nodes', 'Create it even when nodes it uses are not installed')
119
- .option(...OUTPUT_OPTION)
120
- .action(async (file, options, command) => {
121
- const { runImport } = await import('./commands/import.js');
122
- await runImport(env, file, withGlobalFormat(options, command));
123
- });
124
- }
125
- export function registerInterface(program, env) {
126
- program
127
- .command('interface <key>')
128
- .description("Print a stored workflow's interface (inputs, outputs, signals)")
129
- .option('--wf-version <version>', 'Version (default: the ACTIVE version, else the newest)')
130
- .option('-f, --format <format>', 'Output format (json, yaml)')
131
- .action(async (key, options, command) => {
132
- const { runInterface } = await import('./commands/interface.js');
133
- await runInterface(env, key, withGlobalFormat(options, command));
134
- });
135
- }
136
- const WAIT_OPTIONS = {
137
- timeout: ['--timeout <ms>', 'With --wait: give up after this many milliseconds', '300000'],
138
- poll: ['--poll-interval <ms>', 'With --wait: delay between polls in milliseconds', '1000'],
139
- };
140
- function collect(value, previous = []) {
141
- return [...previous, value];
142
- }
143
- /**
144
- * The run-target options (durable-function parity): act on the latest run of a
145
- * workflow id instead of a run id.
146
- */
147
- function addTargetOptions(command) {
148
- return command
149
- .option('--workflow-id <id>', 'The latest run of this workflow id instead of a run id (with --key; needs durable-function parity)')
150
- .option('--key <workflowKey>', 'With --workflow-id: the workflow key')
151
- .option('--first-run-id <id>', 'With --workflow-id: only the chain that started with this run');
152
- }
153
- function addHistory(parent, env, name) {
154
- addTargetOptions(parent
155
- .command(`${name} [runId]`)
156
- .description("Download a durable run's event history (a fluidgrids.history file for replay)")
157
- .option('--out <file>', 'Write the history file here instead of printing the events'))
158
- .option(...OUTPUT_OPTION)
159
- .action(async (runId, options, command) => {
160
- const { runHistory } = await import('./commands/runs.js');
161
- await runHistory(env, runId, withGlobalFormat(options, command));
162
- });
163
- }
164
- function addSignal(parent, env, name) {
165
- addTargetOptions(parent
166
- .command(`${name} <runIdOrSignal> [signal]`)
167
- .description('Send a signal to a run (a durable run, or a canvas run waiting for it): `<runId> <signal>`, or `<signal> --workflow-id <id> --key <key>`')
168
- .option('--payload <json>', 'Signal payload (JSON)')
169
- .option('--idempotency-key <key>', 'Deliver at most once for this key'))
170
- .option(...OUTPUT_OPTION)
171
- .action(async (first, second, options, command) => {
172
- const { runSignal } = await import('./commands/runs.js');
173
- await runSignal(env, first, second, withGlobalFormat(options, command));
174
- });
175
- }
176
- /**
177
- * Durable-function commands (Phase B): `runs start|describe|history|signal|
178
- * terminate|stack` on the cli-sdk `runs` group, plus the top-level `history`,
179
- * `signal`, `replay`, `test`, `run` and `versions list`. `test <workflowKey>`
180
- * runs a workflow's saved test cases on the service instead (BOFF-9960).
181
- *
182
- * Durable-function parity (BOFF-9905 B19): the parity options of `runs start`,
183
- * run targets (`--workflow-id --key`) on `runs describe|history|signal|cancel|
184
- * terminate|stack|result`, `runs describe --pending`, `runs result
185
- * --follow-runs`, `runs count`, `runs stack --metadata`, and `versions
186
- * rollout|rollout delete|drainage|override`. `runs cancel` replaces the cli-sdk
187
- * command of the same name.
188
- */
189
- export function registerDurable(program, env) {
190
- const runs = program.commands.find((command) => command.name() === 'runs') ??
191
- program.command('runs').description('FluidGrids workflow runs');
192
- runs
193
- .command('start <workflowKey>')
194
- .description('Start a durable-function run of a workflow (startWorkflow)')
195
- .option('--wf-version <version>', 'Version (default: the active version)')
196
- .option('--fn <name>', 'Workflow function (default: the single exported one)')
197
- .option('-i, --input <json>', 'Input (JSON)')
198
- .option('--signal <name[=json]>', 'Signal delivered with the start (repeatable)', collect)
199
- .option('--idempotency-key <key>', 'Return the existing run for a repeated key')
200
- // Durable-function parity (BOFF-9905 B19): each needs fluidgrids.durable-parity.
201
- .option('--workflow-id <id>', 'Workflow id: unique among the open runs of the key')
202
- .option('--id-reuse <policy>', 'When a closed run has the workflow id: allow-duplicate, allow-duplicate-failed-only or reject-duplicate')
203
- .option('--id-conflict <policy>', 'When an open run has the workflow id: fail, use-existing or terminate-existing')
204
- .option('--delay <duration>', 'Start delay (ms, or 1.5s, 5m, 2h, 2w, PT2H; at most 30 days)')
205
- .option('--run-timeout <duration>', 'Bounds this run; restarts on continue-as-new and retries')
206
- .option('--execution-timeout <duration>', 'Bounds the whole chain under the workflow id')
207
- .option('--task-timeout <duration>', 'Workflow-task budget (at most 120 s)')
208
- .option('--summary <text>', 'One line shown in run lists (at most 200 characters)')
209
- .option('--details-file <file>', 'Markdown shown on the run page (at most 20 KiB)')
210
- .option('--memo <json>', "The run's memo (a JSON object)")
211
- .option('--callback <url>', 'POSTed to with the outcome once the run (its chain) closes')
212
- .option('--callback-header <name: value>', 'Extra callback request header (repeatable); prefer --callback-header-env for credentials', collect)
213
- .option('--callback-header-env <name=ENV_VAR>', 'Extra callback request header whose value is read from an environment variable (repeatable)', collect)
214
- .option('--callback-secret-env <name>', 'Environment variable holding the callback signing secret (never given on the command line)')
215
- .option('--priority <n>', '1 (highest) to 5 (default 3)')
216
- .option('--versioning-behavior <behavior>', 'pinned or auto-upgrade')
217
- .option('--force', 'With --id-conflict terminate-existing: skip the confirmation prompt')
218
- .option('--wait', 'Wait for the run to finish and print its output')
219
- .option(...WAIT_OPTIONS.timeout)
220
- .option(...WAIT_OPTIONS.poll)
221
- .option(...OUTPUT_OPTION)
222
- .action(async (workflowKey, options, command) => {
223
- const { runStart } = await import('./commands/runs.js');
224
- await runStart(env, workflowKey, withGlobalFormat(options, command));
225
- });
226
- addTargetOptions(runs
227
- .command('describe [runId]')
228
- .description('A run with its durable fields (kind, function, build, history length, task state)')
229
- .option('--pending', 'Also show what the run is waiting on (durable-function parity)'))
230
- .option(...OUTPUT_OPTION)
231
- .action(async (runId, options, command) => {
232
- const { runDescribe } = await import('./commands/runs.js');
233
- await runDescribe(env, runId, withGlobalFormat(options, command));
234
- });
235
- addHistory(runs, env, 'history');
236
- addSignal(runs, env, 'signal');
237
- // The cli-sdk `runs cancel <id>` is replaced so the command can take a run
238
- // target; a plain run id behaves as before.
239
- const sdkCancel = runs.commands.findIndex((command) => command.name() === 'cancel');
240
- // Commander exposes `commands` read-only, but it is the group's own mutable
241
- // array and has no removal API; dropping the entry is how a command is replaced.
242
- if (sdkCancel >= 0)
243
- runs.commands.splice(sdkCancel, 1);
244
- addTargetOptions(runs
245
- .command('cancel [runId]')
246
- .description('Cancel a run (a durable run records WORKFLOW_CANCEL_REQUESTED; its code decides)'))
247
- .option(...OUTPUT_OPTION)
248
- .action(async (runId, options, command) => {
249
- const { runCancel } = await import('./commands/runs.js');
250
- await runCancel(env, runId, withGlobalFormat(options, command));
251
- });
252
- addTargetOptions(runs
253
- .command('terminate [runId]')
254
- .description('Terminate a run now: no further code or node runs (both kinds)')
255
- .option('--reason <text>', 'Reason recorded on the run')
256
- .option('--force', 'Skip the confirmation prompt'))
257
- .option(...OUTPUT_OPTION)
258
- .action(async (runId, options, command) => {
259
- const { runTerminate } = await import('./commands/runs.js');
260
- await runTerminate(env, runId, withGlobalFormat(options, command));
261
- });
262
- addTargetOptions(runs
263
- .command('stack [runId]')
264
- .description("Where a durable run's code is waiting (the __stack_trace query)")
265
- .option('--enhanced', 'Structured trace with source locations (__enhanced_stack_trace)')
266
- .option('--metadata', "Also the run's __metadata (durable-function parity)"))
267
- .option(...OUTPUT_OPTION)
268
- .action(async (runId, options, command) => {
269
- const { runStack } = await import('./commands/runs.js');
270
- await runStack(env, runId, withGlobalFormat(options, command));
271
- });
272
- addTargetOptions(runs
273
- .command('result [runId]')
274
- .description('Wait for a run and print its output (or how it ended)')
275
- .option('--follow-runs', 'Follow continue-as-new and run retries to the run that ends the chain (durable-function parity)')
276
- .option(...WAIT_OPTIONS.timeout)
277
- .option(...WAIT_OPTIONS.poll))
278
- .option(...OUTPUT_OPTION)
279
- .action(async (runId, options, command) => {
280
- const { runResult } = await import('./commands/runs.js');
281
- await runResult(env, runId, withGlobalFormat(options, command));
282
- });
283
- runs
284
- .command('count')
285
- .description('How many runs match, in total and per group (durable-function parity)')
286
- .option('--key <workflowKey>', 'Only runs of this workflow key')
287
- .option('--status <status>', 'Only runs with this status')
288
- .option('--kind <kind>', 'Only GRAPH or DURABLE_FN runs')
289
- .option('--workflow-id <id>', 'Only runs with this workflow id')
290
- .option('--first-run-id <id>', 'Only the chain that started with this run')
291
- .option('--root-run-id <id>', 'Only runs under this root run')
292
- .option('--memo <json>', 'Only runs whose memo contains this JSON object')
293
- .option('--group-by <columns>', 'Up to two of status, workflow-key, execution-kind, task-queue (comma separated)')
294
- .option(...OUTPUT_OPTION)
295
- .action(async (options, command) => {
296
- const { runCount } = await import('./commands/runs.js');
297
- await runCount(env, withGlobalFormat(options, command));
298
- });
299
- addHistory(program, env, 'history');
300
- addSignal(program, env, 'signal');
301
- program
302
- .command('replay <history>')
303
- .description('Replay a history file (or a run id) against the local code; fails on non-determinism')
304
- .option('--isolate', 'Replay in the QuickJS isolate the managed workers use')
305
- .option('--debug', 'Print the full task result (commands, logs, stack)')
306
- .option(...PROJECT_OPTION)
307
- .option(...OUTPUT_OPTION)
308
- .action(async (history, options, command) => {
309
- const { runReplay } = await import('./commands/replay.js');
310
- await runReplay(env, history, withGlobalFormat(options, command));
311
- });
312
- // Two meanings, chosen by the key: `test <workflowKey>` runs the workflow's
313
- // saved test cases on the service (BOFF-9960); plain `test` keeps the
314
- // code-first project tests. Each refuses the other's options.
315
- program
316
- .command('test [workflowKey]')
317
- .description("Run a workflow's saved test cases on the service (CI: exit 1 on a failure); without a key, the code-first project's test script and history replays")
318
- .option('--wf-version <version>', 'With a key: version or alias (default: ACTIVE, else newest)')
319
- .option('--case <id>', 'With a key: run only this test case (repeatable)', collect)
320
- .option('--junit <file>', 'With a key: write a JUnit XML report')
321
- .option('--timeout <ms>', 'With a key: exit 3 if the suite is not done by then (default 1800000)')
322
- .option('--poll-interval <ms>', 'With a key: delay between polls (default 2000)')
323
- .option('--replay <dir>', 'Without a key: directory of history files to replay locally')
324
- .option('--isolate', 'Without a key: replay in the QuickJS isolate the managed workers use')
325
- .option('--no-script', 'Without a key: do not run the package.json test script')
326
- .option(...PROJECT_OPTION)
327
- .option(...OUTPUT_OPTION)
328
- .action(async (workflowKey, options, command) => {
329
- const resolved = withGlobalFormat(options, command);
330
- const { codeFirstTestOptions, runTestSuite, testSuiteOptions } = await import('./commands/suite.js');
331
- if (workflowKey !== undefined) {
332
- await runTestSuite(env, workflowKey, testSuiteOptions(resolved));
333
- return;
334
- }
335
- const codeFirst = codeFirstTestOptions(resolved);
336
- const { runTest } = await import('./commands/replay.js');
337
- await runTest(env, codeFirst);
338
- });
339
- program
340
- .command('run <workflowKey>')
341
- .description("Trigger a workflow from its version's trigger node, optionally waiting for the result")
342
- .option('--wf-version <version>', 'Version (default: the active version, else the newest)')
343
- .option('--trigger-node <id>', 'Trigger node (default: the only one)')
344
- .option('-i, --input <json>', 'Trigger data (a JSON object)')
345
- .option('--test', 'Run in TEST mode instead of PRODUCTION')
346
- .option('--wait', 'Wait for the run to finish')
347
- .option(...WAIT_OPTIONS.timeout)
348
- .option(...WAIT_OPTIONS.poll)
349
- .option(...OUTPUT_OPTION)
350
- .action(async (workflowKey, options, command) => {
351
- const { runRun } = await import('./commands/runs.js');
352
- await runRun(env, workflowKey, withGlobalFormat(options, command));
353
- });
354
- const versions = program
355
- .command('versions')
356
- .description('Workflow versions, their code bundles, rollouts and drainage');
357
- versions
358
- .command('list <workflowKey>')
359
- .description('Every stored version with the code bundle it runs')
360
- .option(...OUTPUT_OPTION)
361
- .action(async (workflowKey, options, command) => {
362
- const { runVersionsList } = await import('./commands/versions.js');
363
- await runVersionsList(env, workflowKey, withGlobalFormat(options, command));
364
- });
365
- // Durable-function parity (BOFF-9905 B19, spec code-first 11 §2.27).
366
- const rollout = versions
367
- .command('rollout')
368
- .description('Show the rollouts of a workflow, or send --percent of its new starts to --to (durable-function parity)')
369
- .argument('<workflowKey>', 'Workflow key')
370
- .option('--to <version>', 'The version a share of new starts runs')
371
- .option('--percent <n>', '0 to 100; 100 promotes --to (activates it after its check)')
372
- .option('--from <version>', 'The ACTIVE version the rollout starts from (the default)')
373
- .option('--environment <env>', 'PROD (the only one in this release)')
374
- .option(...OUTPUT_OPTION)
375
- // The parent and `delete` both declare --environment. Without positional options Commander
376
- // lets the parent take it from anywhere in argv, so `rollout delete k --environment STAGING`
377
- // reached `delete` with no environment and the service removed the PROD rollout. With them,
378
- // every option after `delete` belongs to `delete`.
379
- .enablePositionalOptions()
380
- .action(async (workflowKey, options, command) => {
381
- const { runRollout } = await import('./commands/versions.js');
382
- await runRollout(env, workflowKey, withGlobalFormat(options, command));
383
- });
384
- rollout
385
- .command('delete <workflowKey>')
386
- .description('Remove a rollout: new starts run the ACTIVE version again')
387
- .option('--environment <env>', 'PROD (the default)')
388
- .option('--force', 'Skip the confirmation prompt')
389
- .option(...OUTPUT_OPTION)
390
- .action(async (workflowKey, options, command) => {
391
- const { runRolloutDelete, rolloutDeleteOptions } = await import('./commands/versions.js');
392
- await runRolloutDelete(env, workflowKey, withGlobalFormat(rolloutDeleteOptions(options, command.parent?.opts() ?? {}), command));
393
- });
394
- versions
395
- .command('drainage <workflowKey> <version>')
396
- .description("Whether a version's bundle still serves open runs (durable-function parity)")
397
- .option(...OUTPUT_OPTION)
398
- .action(async (workflowKey, version, options, command) => {
399
- const { runDrainage } = await import('./commands/versions.js');
400
- await runDrainage(env, workflowKey, version, withGlobalFormat(options, command));
401
- });
402
- addTargetOptions(versions
403
- .command('override [runId]')
404
- .description("Set or clear a run's versioning override (durable-function parity); a move to another bundle is replay-checked first")
405
- .option('--pin <version>', "Pin the run to this version's bundle")
406
- .option('--auto-upgrade', "Move the run to the ACTIVE version's bundle at each task")
407
- .option('--clear', 'Remove the override')
408
- .option('--reason <text>', 'Reason recorded on the run'))
409
- .option(...OUTPUT_OPTION)
410
- .action(async (runId, options, command) => {
411
- const { runOverride } = await import('./commands/versions.js');
412
- await runOverride(env, runId, withGlobalFormat(options, command));
413
- });
414
- }
415
- //# sourceMappingURL=register.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/code-first/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH,OAAO,EACL,gBAAgB,GAIjB,MAAM,aAAa,CAAC;AAErB,MAAM,cAAc,GAAG;IACrB,iBAAiB;IACjB,6DAA6D;CACrD,CAAC;AACX,MAAM,aAAa,GAAG,CAAC,uBAAuB,EAAE,mCAAmC,CAAU,CAAC;AAE9F,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,GAAe;IAC5D,OAAO;SACJ,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CACV,wFAAwF,CACzF;SACA,MAAM,CAAC,eAAe,EAAE,4BAA4B,EAAE,IAAI,CAAC;SAC3D,MAAM,CAAC,kBAAkB,EAAE,8DAA8D,CAAC;SAC1F,MAAM,CAAC,SAAS,EAAE,mCAAmC,CAAC;SACtD,MAAM,CAAC,cAAc,EAAE,sCAAsC,CAAC;SAC9D,MAAM,CAAC,YAAY,EAAE,oDAAoD,CAAC;SA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G,EAAE,KAAK,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,58 +0,0 @@
1
- /**
2
- * Comparing local workflows with stored versions.
3
- *
4
- * A stored canvas definition has no `key` (the key lives on the row), and code
5
- * never carries pinned TEST data unless a `workflows/<key>.pinned.json` sidecar
6
- * exists (spec 07 §3 rule 10). Both are therefore aligned before hashing, and
7
- * a push keeps the stored pinned data instead of silently dropping it.
8
- */
9
- import type { NodeManifest } from '@fluidgrids/workflows/ir';
10
- import type { CodeFirstApi, RemoteExport, RemoteVersion } from './api.js';
11
- import { type Project } from './project.js';
12
- import { type ConnectionIndex } from './connections.js';
13
- /** Versions oldest first. */
14
- export declare function sortVersions(versions: readonly RemoteVersion[]): RemoteVersion[];
15
- /** `latest` (newest), `active` (the ACTIVE version) or an exact version string. */
16
- export declare function pickVersion(versions: readonly RemoteVersion[], against: string): RemoteVersion | undefined;
17
- /** The stored definition normalised, with its workflow key, as lowering would produce it. */
18
- export declare function comparableRemote(definition: unknown, workflowKey: string): Record<string, unknown>;
19
- /** The local definition as it would be stored: stored pinned data is kept when code has none. */
20
- export declare function outgoingDefinition(local: Record<string, unknown>, remote: Record<string, unknown> | undefined): Record<string, unknown>;
21
- export declare function sameContent(a: unknown, b: unknown): boolean;
22
- /** One workflow key's stored state. */
23
- export interface RemoteWorkflow {
24
- key: string;
25
- versions: RemoteVersion[];
26
- /** The export of the compared version; undefined when the key does not exist. */
27
- export?: RemoteExport;
28
- }
29
- /** Fetches each key's versions and the export of the requested version once. */
30
- export declare class RemoteWorkflows {
31
- private readonly api;
32
- private readonly against;
33
- private readonly cache;
34
- constructor(api: CodeFirstApi, against?: string);
35
- get(key: string): Promise<RemoteWorkflow>;
36
- private load;
37
- }
38
- /**
39
- * The workspace's connections indexed by name. The node registry is fetched
40
- * only when some connection is not already bound by one of `remoteDefinitions`.
41
- */
42
- export declare function loadConnectionIndex(api: CodeFirstApi, remoteDefinitions: readonly unknown[], registry?: readonly NodeManifest[]): Promise<{
43
- index: ConnectionIndex;
44
- registry?: readonly NodeManifest[];
45
- }>;
46
- /**
47
- * Keys the project probably defines, before lowering tells for sure: named
48
- * keys, tracked keys and workflow file stems (a Python stem `lead_enrichment`
49
- * also as `lead-enrichment`). Fetching a key that does not exist is harmless.
50
- */
51
- export declare function likelyKeys(project: Project, requested: readonly string[]): string[];
52
- /**
53
- * The connection index for lowering this project: the latest stored version of
54
- * every key the project probably defines is read first, because those say
55
- * which adapter each connection is bound to.
56
- */
57
- export declare function projectConnectionIndex(api: CodeFirstApi, project: Project, keys: readonly string[], latest?: RemoteWorkflows): Promise<ConnectionIndex>;
58
- //# sourceMappingURL=remote.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/code-first/remote.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAkC,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAM1B,6BAA6B;AAC7B,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,GAAG,aAAa,EAAE,CAIhF;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CACzB,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,OAAO,EAAE,MAAM,GACd,aAAa,GAAG,SAAS,CAK3B;AAED,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,OAAO,EACnB,WAAW,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBzB;AAED,iGAAiG;AACjG,wBAAgB,kBAAkB,CA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AAoD,GAC3D,OAAO,CAAC,eAAe,CAAC,CAO1B"}
@@ -1,126 +0,0 @@
1
- /**
2
- * Comparing local workflows with stored versions.
3
- *
4
- * A stored canvas definition has no `key` (the key lives on the row), and code
5
- * never carries pinned TEST data unless a `workflows/<key>.pinned.json` sidecar
6
- * exists (spec 07 §3 rule 10). Both are therefore aligned before hashing, and
7
- * a push keeps the stored pinned data instead of silently dropping it.
8
- */
9
- import { CliUserError } from '@burdenoff/cli-sdk/core';
10
- import { irHash, normalizeDefinition } from '@fluidgrids/workflows/ir';
11
- import { listSourcePaths, WORKFLOWS_DIR } from './project.js';
12
- import { buildConnectionIndex, adaptersInDefinitions, } from './connections.js';
13
- function isRecord(value) {
14
- return typeof value === 'object' && value !== null && !Array.isArray(value);
15
- }
16
- /** Versions oldest first. */
17
- export function sortVersions(versions) {
18
- return [...versions].sort((a, b) => a.createdAt < b.createdAt ? -1 : a.createdAt > b.createdAt ? 1 : 0);
19
- }
20
- /** `latest` (newest), `active` (the ACTIVE version) or an exact version string. */
21
- export function pickVersion(versions, against) {
22
- const sorted = sortVersions(versions);
23
- if (against === 'latest')
24
- return sorted[sorted.length - 1];
25
- if (against === 'active')
26
- return sorted.filter((version) => version.isActive).pop();
27
- return sorted.find((version) => version.version === against);
28
- }
29
- /** The stored definition normalised, with its workflow key, as lowering would produce it. */
30
- export function comparableRemote(definition, workflowKey) {
31
- const normalized = normalizeDefinition(definition);
32
- if (!isRecord(normalized)) {
33
- throw new CliUserError(`The stored definition of ${workflowKey} is not an object.`);
34
- }
35
- const copy = { ...normalized };
36
- if (typeof copy['key'] !== 'string' || copy['key'] === '')
37
- copy['key'] = workflowKey;
38
- // `code.bundleRef` and `code.sourceRef` are informational copies the service
39
- // writes when it stores a bundle (spec 01 §5); code never carries them.
40
- const code = copy['code'];
41
- if (isRecord(code) && ('bundleRef' in code || 'sourceRef' in code)) {
42
- copy['code'] = Object.fromEntries(Object.entries(code).filter(([name]) => name !== 'bundleRef' && name !== 'sourceRef'));
43
- }
44
- return copy;
45
- }
46
- /** The local definition as it would be stored: stored pinned data is kept when code has none. */
47
- export function outgoingDefinition(local, remote) {
48
- if (!remote || local['pinnedData'] !== undefined || remote['pinnedData'] === undefined) {
49
- return local;
50
- }
51
- return { ...local, pinnedData: remote['pinnedData'] };
52
- }
53
- export function sameContent(a, b) {
54
- return irHash(a) === irHash(b);
55
- }
56
- /** Fetches each key's versions and the export of the requested version once. */
57
- export class RemoteWorkflows {
58
- api;
59
- against;
60
- cache = new Map();
61
- constructor(api, against = 'latest') {
62
- this.api = api;
63
- this.against = against;
64
- }
65
- get(key) {
66
- let entry = this.cache.get(key);
67
- if (!entry) {
68
- entry = this.load(key);
69
- this.cache.set(key, entry);
70
- }
71
- return entry;
72
- }
73
- async load(key) {
74
- const versions = sortVersions(await this.api.workflowVersions(key));
75
- if (versions.length === 0)
76
- return { key, versions };
77
- const target = pickVersion(versions, this.against);
78
- if (!target) {
79
- throw new CliUserError(this.against === 'active'
80
- ? `${key} has no ACTIVE version.`
81
- : `${key} has no version "${this.against}".`, { hint: `Stored versions: ${versions.map((version) => version.version).join(', ')}` });
82
- }
83
- return { key, versions, export: await this.api.exportWorkflow(key, target.version) };
84
- }
85
- }
86
- /**
87
- * The workspace's connections indexed by name. The node registry is fetched
88
- * only when some connection is not already bound by one of `remoteDefinitions`.
89
- */
90
- export async function loadConnectionIndex(api, remoteDefinitions, registry) {
91
- const connections = await api.connections();
92
- const bound = adaptersInDefinitions(remoteDefinitions);
93
- const needsRegistry = connections.some((connection) => !bound.has(connection.id));
94
- const manifests = registry ?? (needsRegistry ? await api.nodeManifests() : undefined);
95
- return {
96
- index: buildConnectionIndex(connections, {
97
- remoteDefinitions,
98
- ...(manifests ? { registry: manifests } : {}),
99
- }),
100
- ...(manifests ? { registry: manifests } : {}),
101
- };
102
- }
103
- /**
104
- * Keys the project probably defines, before lowering tells for sure: named
105
- * keys, tracked keys and workflow file stems (a Python stem `lead_enrichment`
106
- * also as `lead-enrichment`). Fetching a key that does not exist is harmless.
107
- */
108
- export function likelyKeys(project, requested) {
109
- const stems = listSourcePaths(project.root)
110
- .filter((path) => path.startsWith(`${WORKFLOWS_DIR}/`))
111
- .map((path) => path.slice(path.lastIndexOf('/') + 1).split('.')[0] ?? '')
112
- .filter((stem) => stem !== '' && !stem.startsWith('_'))
113
- .flatMap((stem) => (stem.includes('_') ? [stem, stem.replace(/_/g, '-')] : [stem]));
114
- return [...new Set([...requested, ...Object.keys(project.lock.workflows), ...stems])].sort();
115
- }
116
- /**
117
- * The connection index for lowering this project: the latest stored version of
118
- * every key the project probably defines is read first, because those say
119
- * which adapter each connection is bound to.
120
- */
121
- export async function projectConnectionIndex(api, project, keys, latest = new RemoteWorkflows(api, 'latest')) {
122
- const prefetched = await Promise.all(likelyKeys(project, keys).map((key) => latest.get(key)));
123
- const { index } = await loadConnectionIndex(api, prefetched.flatMap((entry) => (entry.export ? [entry.export.definitionJson] : [])));
124
- return index;
125
- }
126
- //# sourceMappingURL=remote.js.map