@fluidgrids/cli 2026.1108.1 → 2026.1110.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 (238) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +9708 -33
  3. package/package.json +37 -33
  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 -607
  16. package/dist/code-first/api.d.ts.map +0 -1
  17. package/dist/code-first/api.js +0 -438
  18. package/dist/code-first/api.js.map +0 -1
  19. package/dist/code-first/code-upload.d.ts +0 -68
  20. package/dist/code-first/code-upload.d.ts.map +0 -1
  21. package/dist/code-first/code-upload.js +0 -223
  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 -55
  32. package/dist/code-first/commands/hotfix.d.ts.map +0 -1
  33. package/dist/code-first/commands/hotfix.js +0 -231
  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 -104
  52. package/dist/code-first/commands/push.d.ts.map +0 -1
  53. package/dist/code-first/commands/push.js +0 -320
  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 -271
  58. package/dist/code-first/commands/replay.js.map +0 -1
  59. package/dist/code-first/commands/runs.d.ts +0 -168
  60. package/dist/code-first/commands/runs.d.ts.map +0 -1
  61. package/dist/code-first/commands/runs.js +0 -598
  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 -104
  100. package/dist/code-first/lowering.d.ts.map +0 -1
  101. package/dist/code-first/lowering.js +0 -254
  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 -130
  120. package/dist/code-first/project.d.ts.map +0 -1
  121. package/dist/code-first/project.js +0 -308
  122. package/dist/code-first/project.js.map +0 -1
  123. package/dist/code-first/python-build.d.ts +0 -78
  124. package/dist/code-first/python-build.d.ts.map +0 -1
  125. package/dist/code-first/python-build.js +0 -268
  126. package/dist/code-first/python-build.js.map +0 -1
  127. package/dist/code-first/python.d.ts +0 -103
  128. package/dist/code-first/python.d.ts.map +0 -1
  129. package/dist/code-first/python.js +0 -260
  130. package/dist/code-first/python.js.map +0 -1
  131. package/dist/code-first/redact.d.ts +0 -31
  132. package/dist/code-first/redact.d.ts.map +0 -1
  133. package/dist/code-first/redact.js +0 -159
  134. package/dist/code-first/redact.js.map +0 -1
  135. package/dist/code-first/register.d.ts +0 -35
  136. package/dist/code-first/register.d.ts.map +0 -1
  137. package/dist/code-first/register.js +0 -420
  138. package/dist/code-first/register.js.map +0 -1
  139. package/dist/code-first/remote.d.ts +0 -58
  140. package/dist/code-first/remote.d.ts.map +0 -1
  141. package/dist/code-first/remote.js +0 -126
  142. package/dist/code-first/remote.js.map +0 -1
  143. package/dist/code-first/replay.d.ts +0 -36
  144. package/dist/code-first/replay.d.ts.map +0 -1
  145. package/dist/code-first/replay.js +0 -52
  146. package/dist/code-first/replay.js.map +0 -1
  147. package/dist/code-first/shared.d.ts +0 -53
  148. package/dist/code-first/shared.d.ts.map +0 -1
  149. package/dist/code-first/shared.js +0 -94
  150. package/dist/code-first/shared.js.map +0 -1
  151. package/dist/code-first/test-suite-operations.d.ts +0 -16
  152. package/dist/code-first/test-suite-operations.d.ts.map +0 -1
  153. package/dist/code-first/test-suite-operations.js +0 -44
  154. package/dist/code-first/test-suite-operations.js.map +0 -1
  155. package/dist/config/apply.d.ts +0 -51
  156. package/dist/config/apply.d.ts.map +0 -1
  157. package/dist/config/apply.js +0 -121
  158. package/dist/config/apply.js.map +0 -1
  159. package/dist/config/commands.d.ts +0 -58
  160. package/dist/config/commands.d.ts.map +0 -1
  161. package/dist/config/commands.js +0 -252
  162. package/dist/config/commands.js.map +0 -1
  163. package/dist/config/profiles.d.ts +0 -108
  164. package/dist/config/profiles.d.ts.map +0 -1
  165. package/dist/config/profiles.js +0 -339
  166. package/dist/config/profiles.js.map +0 -1
  167. package/dist/flag-hint.d.ts +0 -46
  168. package/dist/flag-hint.d.ts.map +0 -1
  169. package/dist/flag-hint.js +0 -114
  170. package/dist/flag-hint.js.map +0 -1
  171. package/dist/modules.d.ts +0 -17
  172. package/dist/modules.d.ts.map +0 -1
  173. package/dist/modules.js +0 -65
  174. package/dist/modules.js.map +0 -1
  175. package/dist/phase-c/api.d.ts +0 -433
  176. package/dist/phase-c/api.d.ts.map +0 -1
  177. package/dist/phase-c/api.js +0 -334
  178. package/dist/phase-c/api.js.map +0 -1
  179. package/dist/phase-c/commands/activities.d.ts +0 -119
  180. package/dist/phase-c/commands/activities.d.ts.map +0 -1
  181. package/dist/phase-c/commands/activities.js +0 -287
  182. package/dist/phase-c/commands/activities.js.map +0 -1
  183. package/dist/phase-c/commands/batch.d.ts +0 -90
  184. package/dist/phase-c/commands/batch.d.ts.map +0 -1
  185. package/dist/phase-c/commands/batch.js +0 -296
  186. package/dist/phase-c/commands/batch.js.map +0 -1
  187. package/dist/phase-c/commands/queues.d.ts +0 -67
  188. package/dist/phase-c/commands/queues.d.ts.map +0 -1
  189. package/dist/phase-c/commands/queues.js +0 -183
  190. package/dist/phase-c/commands/queues.js.map +0 -1
  191. package/dist/phase-c/commands/run-control.d.ts +0 -76
  192. package/dist/phase-c/commands/run-control.d.ts.map +0 -1
  193. package/dist/phase-c/commands/run-control.js +0 -245
  194. package/dist/phase-c/commands/run-control.js.map +0 -1
  195. package/dist/phase-c/commands/schedules.d.ts +0 -63
  196. package/dist/phase-c/commands/schedules.d.ts.map +0 -1
  197. package/dist/phase-c/commands/schedules.js +0 -198
  198. package/dist/phase-c/commands/schedules.js.map +0 -1
  199. package/dist/phase-c/commands/search-attributes.d.ts +0 -30
  200. package/dist/phase-c/commands/search-attributes.d.ts.map +0 -1
  201. package/dist/phase-c/commands/search-attributes.js +0 -70
  202. package/dist/phase-c/commands/search-attributes.js.map +0 -1
  203. package/dist/phase-c/commands/signal-tokens.d.ts +0 -27
  204. package/dist/phase-c/commands/signal-tokens.d.ts.map +0 -1
  205. package/dist/phase-c/commands/signal-tokens.js +0 -68
  206. package/dist/phase-c/commands/signal-tokens.js.map +0 -1
  207. package/dist/phase-c/commands/worker-run.d.ts +0 -109
  208. package/dist/phase-c/commands/worker-run.d.ts.map +0 -1
  209. package/dist/phase-c/commands/worker-run.js +0 -484
  210. package/dist/phase-c/commands/worker-run.js.map +0 -1
  211. package/dist/phase-c/commands/workers.d.ts +0 -46
  212. package/dist/phase-c/commands/workers.d.ts.map +0 -1
  213. package/dist/phase-c/commands/workers.js +0 -140
  214. package/dist/phase-c/commands/workers.js.map +0 -1
  215. package/dist/phase-c/index.d.ts +0 -16
  216. package/dist/phase-c/index.d.ts.map +0 -1
  217. package/dist/phase-c/index.js +0 -25
  218. package/dist/phase-c/index.js.map +0 -1
  219. package/dist/phase-c/operations.d.ts +0 -67
  220. package/dist/phase-c/operations.d.ts.map +0 -1
  221. package/dist/phase-c/operations.js +0 -559
  222. package/dist/phase-c/operations.js.map +0 -1
  223. package/dist/phase-c/register.d.ts +0 -39
  224. package/dist/phase-c/register.d.ts.map +0 -1
  225. package/dist/phase-c/register.js +0 -678
  226. package/dist/phase-c/register.js.map +0 -1
  227. package/dist/phase-c/shared.d.ts +0 -44
  228. package/dist/phase-c/shared.d.ts.map +0 -1
  229. package/dist/phase-c/shared.js +0 -146
  230. package/dist/phase-c/shared.js.map +0 -1
  231. package/dist/product-defaults.d.ts +0 -11
  232. package/dist/product-defaults.d.ts.map +0 -1
  233. package/dist/product-defaults.js +0 -25
  234. package/dist/product-defaults.js.map +0 -1
  235. package/dist/program.d.ts +0 -25
  236. package/dist/program.d.ts.map +0 -1
  237. package/dist/program.js +0 -60
  238. package/dist/program.js.map +0 -1
@@ -1,271 +0,0 @@
1
- /**
2
- * `fluidgrids replay <file|runId>` and `fluidgrids test [--replay dir]`:
3
- * determinism checks of the project's durable functions against recorded
4
- * histories (spec 10 §1).
5
- *
6
- * - `replay` takes a history file (from `fluidgrids history --out`, a test
7
- * run, or a fixture) or a run id, whose history it downloads first, and
8
- * replays it against the bundle built from the local code. `--isolate` uses
9
- * the QuickJS runner the managed workers use; the default is a Node `vm`.
10
- * `--debug` prints the full task result (commands, logs, stack). The
11
- * inspector that breaks at the first mismatch is the Phase D replay
12
- * debugger (spec 11 §2.21).
13
- * - `test` runs the project's own `test` script, then replays every
14
- * `*.history.json` under `--replay <dir>`, so CI fails on a code change that
15
- * breaks a recorded run.
16
- *
17
- * Lowering here needs no workspace: connection names get placeholder ids,
18
- * which never reach the bundle, so `buildId` is the one a push would upload.
19
- */
20
- import { existsSync, readdirSync, readFileSync, statSync } from 'fs';
21
- import { join, relative, resolve, sep } from 'path';
22
- import { CliUserError } from '@burdenoff/cli-sdk/core';
23
- import { placeholderRef } from '../connections.js';
24
- import { fetchHistory, parseHistoryText } from '../history.js';
25
- import { lowerProject } from '../lowering.js';
26
- import { loadProject } from '../project.js';
27
- import { createPythonReplayer } from '../python-build.js';
28
- import { PYTHON_MODULE, resolvePythonInterpreter } from '../python.js';
29
- import { createReplayer, describeOutcome } from '../replay.js';
30
- import { emit } from '../shared.js';
31
- function isRecord(value) {
32
- return typeof value === 'object' && value !== null && !Array.isArray(value);
33
- }
34
- async function lowerOffline(project) {
35
- return lowerProject(project, {
36
- connections: placeholderRef,
37
- connectionNames: [],
38
- explainUnresolved: (names) => [...names],
39
- });
40
- }
41
- /** Export names of the durable functions in the project's bundle. */
42
- export function durableExportNames(lowered) {
43
- const names = new Set();
44
- for (const workflow of lowered.workflows) {
45
- const code = workflow.definition['code'];
46
- if (!isRecord(code) || !isRecord(code['exports']))
47
- continue;
48
- const workflows = code['exports']['workflows'];
49
- if (isRecord(workflows))
50
- for (const name of Object.keys(workflows))
51
- names.add(name);
52
- }
53
- return [...names].sort();
54
- }
55
- function requireBundle(lowered) {
56
- if (!lowered.bundle || !lowered.buildId || durableExportNames(lowered).length === 0) {
57
- throw new CliUserError('The project defines no durable functions to replay.', {
58
- hint: 'Durable functions are `workflow()` exports in workflows/*.ts.',
59
- });
60
- }
61
- return { bundle: lowered.bundle, buildId: lowered.buildId };
62
- }
63
- /**
64
- * The replayer for the project: the Python SDK for a Python project (Phase C;
65
- * `--isolate` does not apply), else the bundle in a Node `vm` or the QuickJS
66
- * isolate.
67
- */
68
- async function openReplayer(project, lowered, isolate) {
69
- if (project.config.language === 'py') {
70
- if (!lowered.buildId || durableExportNames(lowered).length === 0) {
71
- throw new CliUserError('The project defines no durable functions to replay.', {
72
- hint: 'Durable functions are `@workflow` functions in workflows/*.py.',
73
- });
74
- }
75
- return {
76
- replayer: createPythonReplayer(lowered.python ?? 'python3', project.root),
77
- buildId: lowered.buildId,
78
- };
79
- }
80
- const { bundle, buildId } = requireBundle(lowered);
81
- return { replayer: await createReplayer(bundle, buildId, isolate ? 'quickjs' : 'vm'), buildId };
82
- }
83
- function requireExport(file, exported, name) {
84
- if (!exported.includes(file.workflowFn)) {
85
- throw new CliUserError(`${name} runs ${file.workflowFn}, which this project does not export.`, {
86
- hint: `Exported durable functions: ${exported.join(', ')}`,
87
- });
88
- }
89
- }
90
- function outcomeSummary(outcome, debug) {
91
- return {
92
- name: outcome.name,
93
- workflowFn: outcome.workflowFn,
94
- events: outcome.events,
95
- engine: outcome.engine,
96
- ok: outcome.ok,
97
- cause: outcome.cause,
98
- message: outcome.message,
99
- seq: outcome.seq,
100
- ...(debug ? { result: outcome.result } : {}),
101
- };
102
- }
103
- export async function runReplay(env, target, options) {
104
- const project = loadProject(options.project, env.cwd());
105
- const path = resolve(env.cwd(), target);
106
- let file;
107
- let name;
108
- if (existsSync(path) && statSync(path).isFile()) {
109
- file = parseHistoryText(readFileSync(path, 'utf8'), target);
110
- name = target;
111
- }
112
- else if (/[\\/]|\.json$/.test(target)) {
113
- throw new CliUserError(`History file not found: ${target}`);
114
- }
115
- else {
116
- file = (await fetchHistory(env, target)).file;
117
- name = target;
118
- }
119
- const lowered = await lowerOffline(project);
120
- if (project.config.language !== 'py')
121
- requireBundle(lowered);
122
- requireExport(file, durableExportNames(lowered), name);
123
- if (file.replay === false) {
124
- throw new CliUserError(`${name} is marked "replay": false (it uses Phase C features).`);
125
- }
126
- const { replayer, buildId } = await openReplayer(project, lowered, options.isolate);
127
- let outcome;
128
- try {
129
- outcome = await replayer.replay(file, name);
130
- }
131
- finally {
132
- await replayer.close();
133
- }
134
- const details = [describeOutcome(outcome), `buildId ${buildId}`];
135
- if (options.debug) {
136
- details.push(`Commands: ${JSON.stringify(outcome.result.commands, null, 2)}`);
137
- for (const log of outcome.result.logs)
138
- details.push(`log ${log.level}: ${log.message}`);
139
- if (outcome.result.failure?.stackTrace)
140
- details.push(outcome.result.failure.stackTrace);
141
- }
142
- emit(env, options, outcomeSummary(outcome, options.debug === true), {
143
- headers: ['History', 'Function', 'Events', 'Engine', 'Result'],
144
- rows: [
145
- [
146
- name,
147
- outcome.workflowFn,
148
- String(outcome.events),
149
- outcome.engine,
150
- outcome.ok ? 'ok' : (outcome.cause ?? 'failed'),
151
- ],
152
- ],
153
- }, details);
154
- if (!outcome.ok) {
155
- throw new CliUserError(outcome.cause === 'NON_DETERMINISM'
156
- ? `The local code does not replay ${name}: determinism violation.`
157
- : `Replaying ${name} failed (${outcome.cause ?? 'INTERNAL'}).`, { hint: describeOutcome(outcome) });
158
- }
159
- return outcome;
160
- }
161
- function historyFiles(dir) {
162
- const out = [];
163
- const walk = (current) => {
164
- for (const entry of readdirSync(current, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
165
- const full = join(current, entry.name);
166
- if (entry.isDirectory()) {
167
- if (entry.name !== 'node_modules' && !entry.name.startsWith('.'))
168
- walk(full);
169
- }
170
- else if (entry.isFile() && entry.name.endsWith('.history.json')) {
171
- out.push(full);
172
- }
173
- }
174
- };
175
- walk(dir);
176
- return out;
177
- }
178
- function testScript(root) {
179
- const manifestPath = join(root, 'package.json');
180
- if (!existsSync(manifestPath))
181
- return null;
182
- let manifest;
183
- try {
184
- manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
185
- }
186
- catch {
187
- throw new CliUserError('package.json is not valid JSON.');
188
- }
189
- const scripts = isRecord(manifest) ? manifest['scripts'] : undefined;
190
- if (!isRecord(scripts) || typeof scripts['test'] !== 'string')
191
- return null;
192
- const runner = existsSync(join(root, 'bun.lock')) || existsSync(join(root, 'bun.lockb')) ? 'bun' : 'npm';
193
- return { command: runner, args: ['run', 'test'] };
194
- }
195
- /** A Python project's tests: `<python> -m fluidgrids_workflows test <root>` (pytest over tests/). */
196
- function pythonTestScript(project) {
197
- if (!existsSync(join(project.root, 'tests')))
198
- return null;
199
- return {
200
- command: resolvePythonInterpreter(project.root, project.config.python),
201
- args: ['-m', PYTHON_MODULE, 'test', project.root],
202
- };
203
- }
204
- export async function runTest(env, options) {
205
- const project = loadProject(options.project, env.cwd());
206
- const result = { script: null, replays: [] };
207
- const details = [];
208
- if (options.script !== false) {
209
- const script = project.config.language === 'py' ? pythonTestScript(project) : testScript(project.root);
210
- if (script) {
211
- const exitCode = await env.exec(script.command, script.args, project.root);
212
- result.script = { command: `${script.command} ${script.args.join(' ')}`, exitCode };
213
- if (exitCode !== 0) {
214
- throw new CliUserError(`The project tests failed (\`${result.script.command}\` exited ${exitCode}).`);
215
- }
216
- }
217
- else {
218
- details.push(project.config.language === 'py'
219
- ? 'No tests/ directory; skipped.'
220
- : 'No "test" script in package.json; skipped.');
221
- }
222
- }
223
- const outcomes = [];
224
- if (options.replay !== undefined) {
225
- const dir = resolve(env.cwd(), options.replay);
226
- if (!existsSync(dir) || !statSync(dir).isDirectory()) {
227
- throw new CliUserError(`--replay: ${options.replay} is not a directory.`);
228
- }
229
- const files = historyFiles(dir);
230
- if (files.length === 0) {
231
- throw new CliUserError(`--replay: no *.history.json files under ${options.replay}.`);
232
- }
233
- const lowered = await lowerOffline(project);
234
- const exported = durableExportNames(lowered);
235
- const { replayer } = await openReplayer(project, lowered, options.isolate);
236
- try {
237
- for (const path of files) {
238
- const name = relative(env.cwd(), path).split(sep).join('/');
239
- const file = parseHistoryText(readFileSync(path, 'utf8'), name);
240
- if (file.replay === false) {
241
- details.push(`${name}: skipped ("replay": false)`);
242
- continue;
243
- }
244
- requireExport(file, exported, name);
245
- outcomes.push(await replayer.replay(file, name));
246
- }
247
- }
248
- finally {
249
- await replayer.close();
250
- }
251
- result.replays = outcomes.map((outcome) => outcomeSummary(outcome, false));
252
- details.push(...outcomes.filter((outcome) => !outcome.ok).map(describeOutcome));
253
- }
254
- emit(env, options, result, {
255
- headers: ['History', 'Function', 'Events', 'Result'],
256
- rows: outcomes.map((outcome) => [
257
- outcome.name,
258
- outcome.workflowFn,
259
- String(outcome.events),
260
- outcome.ok ? 'ok' : (outcome.cause ?? 'failed'),
261
- ]),
262
- }, details);
263
- const failed = outcomes.filter((outcome) => !outcome.ok);
264
- if (failed.length > 0) {
265
- throw new CliUserError(`${failed.length} of ${outcomes.length} histories failed to replay.`, {
266
- hint: failed.map(describeOutcome).join('\n'),
267
- });
268
- }
269
- return result;
270
- }
271
- //# sourceMappingURL=replay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"replay.js","sourceRoot":"","sources":["../../../src/code-first/commands/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEpD,O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,CAAC,MAAM,OAAO,QAAQ,CAAC,MAAM,8BAA8B,EAAE;YAC3F,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,168 +0,0 @@
1
- /**
2
- * Run commands for durable functions (Phase B, spec 07 §7 and 11 §2.36):
3
- *
4
- * | Command | Operation |
5
- * |---|---|
6
- * | `runs start <key>` | `startWorkflow` (a root DURABLE_FN run, DB18) |
7
- * | `runs describe <runId>` | `workflowRun` with the durable fields |
8
- * | `runs history <runId>` / `history <runId>` | paged `workflowRunHistory` as a history file |
9
- * | `runs signal <runId> <name>` / `signal …` | `signalWorkflowRun` |
10
- * | `runs terminate <runId>` | `terminateWorkflowRun` (either kind) |
11
- * | `runs stack <runId>` | `workflowRunStackTrace` (`__stack_trace`) |
12
- * | `run <key>` | `triggerWorkflow` from the version's trigger node, then wait |
13
- *
14
- * `runs cancel` (`cancelWorkflowRun`): for a durable run the service records
15
- * `WORKFLOW_CANCEL_REQUESTED` and the code's cancellation scopes decide what
16
- * happens. It replaces the cli-sdk command of the same name so it can take a
17
- * run target.
18
- *
19
- * Durable-function parity (BOFF-9905 B19, spec code-first 11; every option
20
- * needs fluidgrids.durable-parity, which the service checks):
21
- *
22
- * | Command | Operation |
23
- * |---|---|
24
- * | `runs start --workflow-id … --id-reuse … --id-conflict …` and the other start options | `startWorkflow` (`startWorkflowTerminateExisting` for terminate-existing) |
25
- * | `runs describe|history|signal|cancel|terminate|stack --workflow-id <id> --key <key>` | the run target forms |
26
- * | `runs describe --pending` | `WorkflowRun.pending` |
27
- * | `runs result [--follow-runs]` | waits, then the closing event (following continue-as-new and run retries) |
28
- * | `runs count [--group-by]` | `workflowRunsCount` |
29
- * | `runs stack --metadata` | `workflowRunStackTrace(metadata: true)` |
30
- */
31
- import type { DurableRun, RunCount, RunPendingState, SignalResult, StartWorkflowInput, StartWorkflowResult, TriggerResult } from '../api.js';
32
- import { type ParityStartOptions, type TargetOptions } from '../parity.js';
33
- import { type CommandEnv, type OutputOptions } from '../shared.js';
34
- export declare const TERMINAL_STATUSES: readonly string[];
35
- export declare const DEFAULT_WAIT_TIMEOUT_MS = 300000;
36
- export declare const DEFAULT_POLL_INTERVAL_MS = 1000;
37
- export interface WaitOptions {
38
- wait?: boolean;
39
- timeout?: string;
40
- pollInterval?: string;
41
- }
42
- /** How a finished durable run ended, from its last history event. */
43
- export interface RunOutcome {
44
- status: string;
45
- output?: unknown;
46
- failure?: unknown;
47
- }
48
- /** Poll a run until it reaches a terminal status. */
49
- export declare function waitForRun(env: CommandEnv, runId: string, options: WaitOptions): Promise<DurableRun>;
50
- /** The result of a finished durable run: the payload of its closing event. */
51
- export declare function durableOutcome(env: CommandEnv, run: DurableRun): Promise<RunOutcome>;
52
- export interface StartOptions extends OutputOptions, WaitOptions, ParityStartOptions {
53
- wfVersion?: string;
54
- fn?: string;
55
- input?: string;
56
- signal?: string[];
57
- idempotencyKey?: string;
58
- /** With `--id-conflict terminate-existing`: skip the confirmation prompt. */
59
- force?: boolean;
60
- /** Phase C: the run's task queue (a self-hosted queue needs fluidgrids.self-hosted-workers). */
61
- taskQueue?: string;
62
- fairnessKey?: string;
63
- fairnessWeight?: string;
64
- /** Phase C: the run's search attributes, a JSON object (needs fluidgrids.search-attributes). */
65
- searchAttributes?: string;
66
- }
67
- /** The Phase C fields of a StartWorkflowInput from `runs start` options; empty without any. */
68
- export declare function phaseCStartFields(options: StartOptions): Partial<StartWorkflowInput>;
69
- /** `--signal name` or `--signal name=<json>`. */
70
- export declare function parseStartSignal(raw: string): {
71
- name: string;
72
- payload?: unknown;
73
- };
74
- export interface StartCommandResult extends StartWorkflowResult {
75
- outcome?: RunOutcome;
76
- }
77
- export declare function runStart(env: CommandEnv, workflowKey: string, options: StartOptions): Promise<StartCommandResult>;
78
- export interface DescribeOptions extends OutputOptions, TargetOptions {
79
- /** Also read what the run is waiting on (parity). */
80
- pending?: boolean;
81
- }
82
- export interface DescribeResult extends DurableRun {
83
- pending?: RunPendingState | null;
84
- }
85
- export declare function runDescribe(env: CommandEnv, runId: string | undefined, options: DescribeOptions): Promise<DescribeResult>;
86
- export interface HistoryOptions extends OutputOptions, TargetOptions {
87
- out?: string;
88
- }
89
- export interface HistoryCommandResult {
90
- runId: string;
91
- workflowFn: string;
92
- events: number;
93
- historyBytes: number;
94
- out: string | null;
95
- }
96
- export declare function runHistory(env: CommandEnv, runIdArg: string | undefined, options: HistoryOptions): Promise<HistoryCommandResult>;
97
- export interface SignalOptions extends OutputOptions, TargetOptions {
98
- payload?: string;
99
- idempotencyKey?: string;
100
- }
101
- /**
102
- * `signal <runId> <name>`, or `signal <name> --workflow-id <id> --key <key>`:
103
- * with a target the only positional argument is the signal name.
104
- */
105
- export declare function runSignal(env: CommandEnv, first: string, second: string | undefined, options: SignalOptions): Promise<SignalResult>;
106
- export interface TerminateOptions extends OutputOptions, TargetOptions {
107
- reason?: string;
108
- force?: boolean;
109
- }
110
- export declare function runTerminate(env: CommandEnv, runIdArg: string | undefined, options: TerminateOptions): Promise<unknown>;
111
- export type CancelOptions = OutputOptions & TargetOptions;
112
- /**
113
- * `runs cancel <runId>` behaves as the cli-sdk command it replaces
114
- * (`cancelWorkflowRun`, an info line plus the result); the target form is
115
- * `cancelWorkflowRunByTarget` (parity).
116
- */
117
- export declare function runCancel(env: CommandEnv, runIdArg: string | undefined, options: CancelOptions): Promise<unknown>;
118
- export interface StackOptions extends OutputOptions, TargetOptions {
119
- enhanced?: boolean;
120
- /** Also answer `__metadata` (parity). */
121
- metadata?: boolean;
122
- }
123
- export declare function runStack(env: CommandEnv, runIdArg: string | undefined, options: StackOptions): Promise<unknown>;
124
- export interface ResultOptions extends OutputOptions, WaitOptions, TargetOptions {
125
- /** Follow continue-as-new and run retries to the run that ends the chain (parity). */
126
- followRuns?: boolean;
127
- }
128
- export interface ResultCommandResult {
129
- run: DurableRun;
130
- outcome: RunOutcome;
131
- /** The runs waited for, first to last (more than one with --follow-runs). */
132
- chain: string[];
133
- }
134
- /**
135
- * Wait for a run (a target: the latest run of the workflow id) and print how it
136
- * ended: the output, or the failure. With `--follow-runs` a run that continued
137
- * as new or was retried is followed to the run that continues it; the timeout
138
- * covers the whole chain.
139
- */
140
- export declare function runResult(env: CommandEnv, runIdArg: string | undefined, options: ResultOptions): Promise<ResultCommandResult>;
141
- export interface CountOptions extends OutputOptions {
142
- key?: string;
143
- status?: string;
144
- kind?: string;
145
- /** The workflow id (businessId) filter. */
146
- workflowId?: string;
147
- firstRunId?: string;
148
- rootRunId?: string;
149
- memo?: string;
150
- groupBy?: string;
151
- }
152
- /** How many runs the list returns for the filter, in total and per group. */
153
- export declare function runCount(env: CommandEnv, options: CountOptions): Promise<RunCount>;
154
- export interface RunOptions extends OutputOptions, WaitOptions {
155
- wfVersion?: string;
156
- triggerNode?: string;
157
- input?: string;
158
- test?: boolean;
159
- }
160
- export interface RunCommandResult {
161
- trigger: TriggerResult;
162
- run?: DurableRun;
163
- outcome?: RunOutcome;
164
- }
165
- /** The node ids of a definition that have no incoming edge (its triggers). */
166
- export declare function triggerNodeIds(definition: unknown): string[];
167
- export declare function runRun(env: CommandEnv, workflowKey: string, options: RunOptions): Promise<RunCommandResult>;
168
- //# sourceMappingURL=runs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../../src/code-first/commands/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AASH,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EAER,eAAe,EAIf,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAQL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,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