@fluidgrids/cli 2026.1028.1 → 2026.1029.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.
- package/README.md +100 -3
- package/dist/code-first/api.d.ts +380 -0
- package/dist/code-first/api.d.ts.map +1 -1
- package/dist/code-first/api.js +256 -1
- package/dist/code-first/api.js.map +1 -1
- package/dist/code-first/code-upload.d.ts +53 -0
- package/dist/code-first/code-upload.d.ts.map +1 -0
- package/dist/code-first/code-upload.js +165 -0
- package/dist/code-first/code-upload.js.map +1 -0
- package/dist/code-first/commands/hotfix.d.ts +54 -0
- package/dist/code-first/commands/hotfix.d.ts.map +1 -0
- package/dist/code-first/commands/hotfix.js +225 -0
- package/dist/code-first/commands/hotfix.js.map +1 -0
- package/dist/code-first/commands/push.d.ts +47 -1
- package/dist/code-first/commands/push.d.ts.map +1 -1
- package/dist/code-first/commands/push.js +115 -19
- package/dist/code-first/commands/push.js.map +1 -1
- package/dist/code-first/commands/replay.d.ts +44 -0
- package/dist/code-first/commands/replay.d.ts.map +1 -0
- package/dist/code-first/commands/replay.js +238 -0
- package/dist/code-first/commands/replay.js.map +1 -0
- package/dist/code-first/commands/runs.d.ts +160 -0
- package/dist/code-first/commands/runs.d.ts.map +1 -0
- package/dist/code-first/commands/runs.js +565 -0
- package/dist/code-first/commands/runs.js.map +1 -0
- package/dist/code-first/commands/validate.d.ts +4 -0
- package/dist/code-first/commands/validate.d.ts.map +1 -1
- package/dist/code-first/commands/validate.js +31 -6
- package/dist/code-first/commands/validate.js.map +1 -1
- package/dist/code-first/commands/versions.d.ts +63 -0
- package/dist/code-first/commands/versions.d.ts.map +1 -0
- package/dist/code-first/commands/versions.js +204 -0
- package/dist/code-first/commands/versions.js.map +1 -0
- package/dist/code-first/durable-operations.d.ts +41 -0
- package/dist/code-first/durable-operations.d.ts.map +1 -0
- package/dist/code-first/durable-operations.js +135 -0
- package/dist/code-first/durable-operations.js.map +1 -0
- package/dist/code-first/history.d.ts +30 -0
- package/dist/code-first/history.d.ts.map +1 -0
- package/dist/code-first/history.js +139 -0
- package/dist/code-first/history.js.map +1 -0
- package/dist/code-first/imports.d.ts +22 -0
- package/dist/code-first/imports.d.ts.map +1 -0
- package/dist/code-first/imports.js +67 -0
- package/dist/code-first/imports.js.map +1 -0
- package/dist/code-first/index.d.ts +4 -1
- package/dist/code-first/index.d.ts.map +1 -1
- package/dist/code-first/index.js +6 -2
- package/dist/code-first/index.js.map +1 -1
- package/dist/code-first/lowering.d.ts +53 -1
- package/dist/code-first/lowering.d.ts.map +1 -1
- package/dist/code-first/lowering.js +126 -6
- package/dist/code-first/lowering.js.map +1 -1
- package/dist/code-first/operations.d.ts +1 -3
- package/dist/code-first/operations.d.ts.map +1 -1
- package/dist/code-first/operations.js +1 -3
- package/dist/code-first/operations.js.map +1 -1
- package/dist/code-first/parity-operations.d.ts +44 -0
- package/dist/code-first/parity-operations.d.ts.map +1 -0
- package/dist/code-first/parity-operations.js +211 -0
- package/dist/code-first/parity-operations.js.map +1 -0
- package/dist/code-first/parity.d.ts +83 -0
- package/dist/code-first/parity.d.ts.map +1 -0
- package/dist/code-first/parity.js +301 -0
- package/dist/code-first/parity.js.map +1 -0
- package/dist/code-first/presigned.d.ts +21 -0
- package/dist/code-first/presigned.d.ts.map +1 -0
- package/dist/code-first/presigned.js +85 -0
- package/dist/code-first/presigned.js.map +1 -0
- package/dist/code-first/project.d.ts +9 -0
- package/dist/code-first/project.d.ts.map +1 -1
- package/dist/code-first/project.js +22 -0
- package/dist/code-first/project.js.map +1 -1
- package/dist/code-first/python.d.ts +11 -0
- package/dist/code-first/python.d.ts.map +1 -1
- package/dist/code-first/python.js +31 -1
- package/dist/code-first/python.js.map +1 -1
- package/dist/code-first/redact.d.ts +31 -0
- package/dist/code-first/redact.d.ts.map +1 -0
- package/dist/code-first/redact.js +150 -0
- package/dist/code-first/redact.js.map +1 -0
- package/dist/code-first/register.d.ts +13 -0
- package/dist/code-first/register.d.ts.map +1 -1
- package/dist/code-first/register.js +275 -2
- package/dist/code-first/register.js.map +1 -1
- package/dist/code-first/remote.d.ts.map +1 -1
- package/dist/code-first/remote.js +6 -0
- package/dist/code-first/remote.js.map +1 -1
- package/dist/code-first/replay.d.ts +36 -0
- package/dist/code-first/replay.d.ts.map +1 -0
- package/dist/code-first/replay.js +52 -0
- package/dist/code-first/replay.js.map +1 -0
- package/dist/code-first/shared.d.ts +14 -0
- package/dist/code-first/shared.d.ts.map +1 -1
- package/dist/code-first/shared.js +37 -0
- package/dist/code-first/shared.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
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 { type LoweredProject } from '../lowering.js';
|
|
21
|
+
import { type ReplayOutcome } from '../replay.js';
|
|
22
|
+
import { type CommandEnv, type ProjectOptions } from '../shared.js';
|
|
23
|
+
export interface ReplayOptions extends ProjectOptions {
|
|
24
|
+
isolate?: boolean;
|
|
25
|
+
debug?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Export names of the durable functions in the project's bundle. */
|
|
28
|
+
export declare function durableExportNames(lowered: LoweredProject): string[];
|
|
29
|
+
export declare function runReplay(env: CommandEnv, target: string, options: ReplayOptions): Promise<ReplayOutcome>;
|
|
30
|
+
export interface TestOptions extends ProjectOptions {
|
|
31
|
+
replay?: string;
|
|
32
|
+
isolate?: boolean;
|
|
33
|
+
/** False skips the project's own test script (`--no-script`). */
|
|
34
|
+
script?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface TestResult {
|
|
37
|
+
script: {
|
|
38
|
+
command: string;
|
|
39
|
+
exitCode: number;
|
|
40
|
+
} | null;
|
|
41
|
+
replays: Array<Record<string, unknown>>;
|
|
42
|
+
}
|
|
43
|
+
export declare function runTest(env: CommandEnv, options: TestOptions): Promise<TestResult>;
|
|
44
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../../../src/code-first/commands/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAmC,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAcD,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,EAAE,CASpE;AAiCD,wBAAsB,SAAS,CAC7B,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,aAAa,CAAC,CA4DxB;AAID,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACrD,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACzC;AAoCD,wBAAsB,OAAO,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA0ExF"}
|
|
@@ -0,0 +1,238 @@
|
|
|
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 { createReplayer, describeOutcome } from '../replay.js';
|
|
28
|
+
import { emit } from '../shared.js';
|
|
29
|
+
function isRecord(value) {
|
|
30
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
31
|
+
}
|
|
32
|
+
async function lowerOffline(project) {
|
|
33
|
+
return lowerProject(project, {
|
|
34
|
+
connections: placeholderRef,
|
|
35
|
+
connectionNames: [],
|
|
36
|
+
explainUnresolved: (names) => [...names],
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/** Export names of the durable functions in the project's bundle. */
|
|
40
|
+
export function durableExportNames(lowered) {
|
|
41
|
+
const names = new Set();
|
|
42
|
+
for (const workflow of lowered.workflows) {
|
|
43
|
+
const code = workflow.definition['code'];
|
|
44
|
+
if (!isRecord(code) || !isRecord(code['exports']))
|
|
45
|
+
continue;
|
|
46
|
+
const workflows = code['exports']['workflows'];
|
|
47
|
+
if (isRecord(workflows))
|
|
48
|
+
for (const name of Object.keys(workflows))
|
|
49
|
+
names.add(name);
|
|
50
|
+
}
|
|
51
|
+
return [...names].sort();
|
|
52
|
+
}
|
|
53
|
+
function requireBundle(lowered) {
|
|
54
|
+
if (!lowered.bundle || !lowered.buildId || durableExportNames(lowered).length === 0) {
|
|
55
|
+
throw new CliUserError('The project defines no durable functions to replay.', {
|
|
56
|
+
hint: 'Durable functions are `workflow()` exports in workflows/*.ts.',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return { bundle: lowered.bundle, buildId: lowered.buildId };
|
|
60
|
+
}
|
|
61
|
+
function requireExport(file, exported, name) {
|
|
62
|
+
if (!exported.includes(file.workflowFn)) {
|
|
63
|
+
throw new CliUserError(`${name} runs ${file.workflowFn}, which this project does not export.`, {
|
|
64
|
+
hint: `Exported durable functions: ${exported.join(', ')}`,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function outcomeSummary(outcome, debug) {
|
|
69
|
+
return {
|
|
70
|
+
name: outcome.name,
|
|
71
|
+
workflowFn: outcome.workflowFn,
|
|
72
|
+
events: outcome.events,
|
|
73
|
+
engine: outcome.engine,
|
|
74
|
+
ok: outcome.ok,
|
|
75
|
+
cause: outcome.cause,
|
|
76
|
+
message: outcome.message,
|
|
77
|
+
seq: outcome.seq,
|
|
78
|
+
...(debug ? { result: outcome.result } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export async function runReplay(env, target, options) {
|
|
82
|
+
const project = loadProject(options.project, env.cwd());
|
|
83
|
+
const path = resolve(env.cwd(), target);
|
|
84
|
+
let file;
|
|
85
|
+
let name;
|
|
86
|
+
if (existsSync(path) && statSync(path).isFile()) {
|
|
87
|
+
file = parseHistoryText(readFileSync(path, 'utf8'), target);
|
|
88
|
+
name = target;
|
|
89
|
+
}
|
|
90
|
+
else if (/[\\/]|\.json$/.test(target)) {
|
|
91
|
+
throw new CliUserError(`History file not found: ${target}`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
file = (await fetchHistory(env, target)).file;
|
|
95
|
+
name = target;
|
|
96
|
+
}
|
|
97
|
+
const lowered = await lowerOffline(project);
|
|
98
|
+
const { bundle, buildId } = requireBundle(lowered);
|
|
99
|
+
requireExport(file, durableExportNames(lowered), name);
|
|
100
|
+
if (file.replay === false) {
|
|
101
|
+
throw new CliUserError(`${name} is marked "replay": false (it uses Phase C features).`);
|
|
102
|
+
}
|
|
103
|
+
const replayer = await createReplayer(bundle, buildId, options.isolate ? 'quickjs' : 'vm');
|
|
104
|
+
let outcome;
|
|
105
|
+
try {
|
|
106
|
+
outcome = await replayer.replay(file, name);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
await replayer.close();
|
|
110
|
+
}
|
|
111
|
+
const details = [describeOutcome(outcome), `buildId ${buildId}`];
|
|
112
|
+
if (options.debug) {
|
|
113
|
+
details.push(`Commands: ${JSON.stringify(outcome.result.commands, null, 2)}`);
|
|
114
|
+
for (const log of outcome.result.logs)
|
|
115
|
+
details.push(`log ${log.level}: ${log.message}`);
|
|
116
|
+
if (outcome.result.failure?.stackTrace)
|
|
117
|
+
details.push(outcome.result.failure.stackTrace);
|
|
118
|
+
}
|
|
119
|
+
emit(env, options, outcomeSummary(outcome, options.debug === true), {
|
|
120
|
+
headers: ['History', 'Function', 'Events', 'Engine', 'Result'],
|
|
121
|
+
rows: [
|
|
122
|
+
[
|
|
123
|
+
name,
|
|
124
|
+
outcome.workflowFn,
|
|
125
|
+
String(outcome.events),
|
|
126
|
+
outcome.engine,
|
|
127
|
+
outcome.ok ? 'ok' : (outcome.cause ?? 'failed'),
|
|
128
|
+
],
|
|
129
|
+
],
|
|
130
|
+
}, details);
|
|
131
|
+
if (!outcome.ok) {
|
|
132
|
+
throw new CliUserError(outcome.cause === 'NON_DETERMINISM'
|
|
133
|
+
? `The local code does not replay ${name}: determinism violation.`
|
|
134
|
+
: `Replaying ${name} failed (${outcome.cause ?? 'INTERNAL'}).`, { hint: describeOutcome(outcome) });
|
|
135
|
+
}
|
|
136
|
+
return outcome;
|
|
137
|
+
}
|
|
138
|
+
function historyFiles(dir) {
|
|
139
|
+
const out = [];
|
|
140
|
+
const walk = (current) => {
|
|
141
|
+
for (const entry of readdirSync(current, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
142
|
+
const full = join(current, entry.name);
|
|
143
|
+
if (entry.isDirectory()) {
|
|
144
|
+
if (entry.name !== 'node_modules' && !entry.name.startsWith('.'))
|
|
145
|
+
walk(full);
|
|
146
|
+
}
|
|
147
|
+
else if (entry.isFile() && entry.name.endsWith('.history.json')) {
|
|
148
|
+
out.push(full);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
walk(dir);
|
|
153
|
+
return out;
|
|
154
|
+
}
|
|
155
|
+
function testScript(root) {
|
|
156
|
+
const manifestPath = join(root, 'package.json');
|
|
157
|
+
if (!existsSync(manifestPath))
|
|
158
|
+
return null;
|
|
159
|
+
let manifest;
|
|
160
|
+
try {
|
|
161
|
+
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
throw new CliUserError('package.json is not valid JSON.');
|
|
165
|
+
}
|
|
166
|
+
const scripts = isRecord(manifest) ? manifest['scripts'] : undefined;
|
|
167
|
+
if (!isRecord(scripts) || typeof scripts['test'] !== 'string')
|
|
168
|
+
return null;
|
|
169
|
+
const runner = existsSync(join(root, 'bun.lock')) || existsSync(join(root, 'bun.lockb')) ? 'bun' : 'npm';
|
|
170
|
+
return { command: runner, args: ['run', 'test'] };
|
|
171
|
+
}
|
|
172
|
+
export async function runTest(env, options) {
|
|
173
|
+
const project = loadProject(options.project, env.cwd());
|
|
174
|
+
const result = { script: null, replays: [] };
|
|
175
|
+
const details = [];
|
|
176
|
+
if (options.script !== false) {
|
|
177
|
+
const script = testScript(project.root);
|
|
178
|
+
if (script) {
|
|
179
|
+
const exitCode = await env.exec(script.command, script.args, project.root);
|
|
180
|
+
result.script = { command: `${script.command} ${script.args.join(' ')}`, exitCode };
|
|
181
|
+
if (exitCode !== 0) {
|
|
182
|
+
throw new CliUserError(`The project tests failed (\`${result.script.command}\` exited ${exitCode}).`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
details.push('No "test" script in package.json; skipped.');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const outcomes = [];
|
|
190
|
+
if (options.replay !== undefined) {
|
|
191
|
+
const dir = resolve(env.cwd(), options.replay);
|
|
192
|
+
if (!existsSync(dir) || !statSync(dir).isDirectory()) {
|
|
193
|
+
throw new CliUserError(`--replay: ${options.replay} is not a directory.`);
|
|
194
|
+
}
|
|
195
|
+
const files = historyFiles(dir);
|
|
196
|
+
if (files.length === 0) {
|
|
197
|
+
throw new CliUserError(`--replay: no *.history.json files under ${options.replay}.`);
|
|
198
|
+
}
|
|
199
|
+
const lowered = await lowerOffline(project);
|
|
200
|
+
const { bundle, buildId } = requireBundle(lowered);
|
|
201
|
+
const exported = durableExportNames(lowered);
|
|
202
|
+
const replayer = await createReplayer(bundle, buildId, options.isolate ? 'quickjs' : 'vm');
|
|
203
|
+
try {
|
|
204
|
+
for (const path of files) {
|
|
205
|
+
const name = relative(env.cwd(), path).split(sep).join('/');
|
|
206
|
+
const file = parseHistoryText(readFileSync(path, 'utf8'), name);
|
|
207
|
+
if (file.replay === false) {
|
|
208
|
+
details.push(`${name}: skipped ("replay": false)`);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
requireExport(file, exported, name);
|
|
212
|
+
outcomes.push(await replayer.replay(file, name));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
finally {
|
|
216
|
+
await replayer.close();
|
|
217
|
+
}
|
|
218
|
+
result.replays = outcomes.map((outcome) => outcomeSummary(outcome, false));
|
|
219
|
+
details.push(...outcomes.filter((outcome) => !outcome.ok).map(describeOutcome));
|
|
220
|
+
}
|
|
221
|
+
emit(env, options, result, {
|
|
222
|
+
headers: ['History', 'Function', 'Events', 'Result'],
|
|
223
|
+
rows: outcomes.map((outcome) => [
|
|
224
|
+
outcome.name,
|
|
225
|
+
outcome.workflowFn,
|
|
226
|
+
String(outcome.events),
|
|
227
|
+
outcome.ok ? 'ok' : (outcome.cause ?? 'failed'),
|
|
228
|
+
]),
|
|
229
|
+
}, details);
|
|
230
|
+
const failed = outcomes.filter((outcome) => !outcome.ok);
|
|
231
|
+
if (failed.length > 0) {
|
|
232
|
+
throw new CliUserError(`${failed.length} of ${outcomes.length} histories failed to replay.`, {
|
|
233
|
+
hint: failed.map(describeOutcome).join('\n'),
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAuB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAgB,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAsB,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,IAAI,EAAwC,MAAM,cAAc,CAAC;AAO1E,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,OAAgB;IAC1C,OAAO,YAAY,CAAC,OAAO,EAAE;QAC3B,WAAW,EAAE,cAAc;QAC3B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC;KACzC,CAAC,CAAC;AACL,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,kBAAkB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,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;SAChD,CAAC;KACH,EACD,OAAO,CACR,CAAC;IACF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,YAAY,CAAC,GAAG,MAAM,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"}
|
|
@@ -0,0 +1,160 @@
|
|
|
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, 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
|
+
}
|
|
61
|
+
/** `--signal name` or `--signal name=<json>`. */
|
|
62
|
+
export declare function parseStartSignal(raw: string): {
|
|
63
|
+
name: string;
|
|
64
|
+
payload?: unknown;
|
|
65
|
+
};
|
|
66
|
+
export interface StartCommandResult extends StartWorkflowResult {
|
|
67
|
+
outcome?: RunOutcome;
|
|
68
|
+
}
|
|
69
|
+
export declare function runStart(env: CommandEnv, workflowKey: string, options: StartOptions): Promise<StartCommandResult>;
|
|
70
|
+
export interface DescribeOptions extends OutputOptions, TargetOptions {
|
|
71
|
+
/** Also read what the run is waiting on (parity). */
|
|
72
|
+
pending?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface DescribeResult extends DurableRun {
|
|
75
|
+
pending?: RunPendingState | null;
|
|
76
|
+
}
|
|
77
|
+
export declare function runDescribe(env: CommandEnv, runId: string | undefined, options: DescribeOptions): Promise<DescribeResult>;
|
|
78
|
+
export interface HistoryOptions extends OutputOptions, TargetOptions {
|
|
79
|
+
out?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface HistoryCommandResult {
|
|
82
|
+
runId: string;
|
|
83
|
+
workflowFn: string;
|
|
84
|
+
events: number;
|
|
85
|
+
historyBytes: number;
|
|
86
|
+
out: string | null;
|
|
87
|
+
}
|
|
88
|
+
export declare function runHistory(env: CommandEnv, runIdArg: string | undefined, options: HistoryOptions): Promise<HistoryCommandResult>;
|
|
89
|
+
export interface SignalOptions extends OutputOptions, TargetOptions {
|
|
90
|
+
payload?: string;
|
|
91
|
+
idempotencyKey?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* `signal <runId> <name>`, or `signal <name> --workflow-id <id> --key <key>`:
|
|
95
|
+
* with a target the only positional argument is the signal name.
|
|
96
|
+
*/
|
|
97
|
+
export declare function runSignal(env: CommandEnv, first: string, second: string | undefined, options: SignalOptions): Promise<SignalResult>;
|
|
98
|
+
export interface TerminateOptions extends OutputOptions, TargetOptions {
|
|
99
|
+
reason?: string;
|
|
100
|
+
force?: boolean;
|
|
101
|
+
}
|
|
102
|
+
export declare function runTerminate(env: CommandEnv, runIdArg: string | undefined, options: TerminateOptions): Promise<unknown>;
|
|
103
|
+
export type CancelOptions = OutputOptions & TargetOptions;
|
|
104
|
+
/**
|
|
105
|
+
* `runs cancel <runId>` behaves as the cli-sdk command it replaces
|
|
106
|
+
* (`cancelWorkflowRun`, an info line plus the result); the target form is
|
|
107
|
+
* `cancelWorkflowRunByTarget` (parity).
|
|
108
|
+
*/
|
|
109
|
+
export declare function runCancel(env: CommandEnv, runIdArg: string | undefined, options: CancelOptions): Promise<unknown>;
|
|
110
|
+
export interface StackOptions extends OutputOptions, TargetOptions {
|
|
111
|
+
enhanced?: boolean;
|
|
112
|
+
/** Also answer `__metadata` (parity). */
|
|
113
|
+
metadata?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare function runStack(env: CommandEnv, runIdArg: string | undefined, options: StackOptions): Promise<unknown>;
|
|
116
|
+
export interface ResultOptions extends OutputOptions, WaitOptions, TargetOptions {
|
|
117
|
+
/** Follow continue-as-new and run retries to the run that ends the chain (parity). */
|
|
118
|
+
followRuns?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface ResultCommandResult {
|
|
121
|
+
run: DurableRun;
|
|
122
|
+
outcome: RunOutcome;
|
|
123
|
+
/** The runs waited for, first to last (more than one with --follow-runs). */
|
|
124
|
+
chain: string[];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Wait for a run (a target: the latest run of the workflow id) and print how it
|
|
128
|
+
* ended: the output, or the failure. With `--follow-runs` a run that continued
|
|
129
|
+
* as new or was retried is followed to the run that continues it; the timeout
|
|
130
|
+
* covers the whole chain.
|
|
131
|
+
*/
|
|
132
|
+
export declare function runResult(env: CommandEnv, runIdArg: string | undefined, options: ResultOptions): Promise<ResultCommandResult>;
|
|
133
|
+
export interface CountOptions extends OutputOptions {
|
|
134
|
+
key?: string;
|
|
135
|
+
status?: string;
|
|
136
|
+
kind?: string;
|
|
137
|
+
/** The workflow id (businessId) filter. */
|
|
138
|
+
workflowId?: string;
|
|
139
|
+
firstRunId?: string;
|
|
140
|
+
rootRunId?: string;
|
|
141
|
+
memo?: string;
|
|
142
|
+
groupBy?: string;
|
|
143
|
+
}
|
|
144
|
+
/** How many runs the list returns for the filter, in total and per group. */
|
|
145
|
+
export declare function runCount(env: CommandEnv, options: CountOptions): Promise<RunCount>;
|
|
146
|
+
export interface RunOptions extends OutputOptions, WaitOptions {
|
|
147
|
+
wfVersion?: string;
|
|
148
|
+
triggerNode?: string;
|
|
149
|
+
input?: string;
|
|
150
|
+
test?: boolean;
|
|
151
|
+
}
|
|
152
|
+
export interface RunCommandResult {
|
|
153
|
+
trigger: TriggerResult;
|
|
154
|
+
run?: DurableRun;
|
|
155
|
+
outcome?: RunOutcome;
|
|
156
|
+
}
|
|
157
|
+
/** The node ids of a definition that have no incoming edge (its triggers). */
|
|
158
|
+
export declare function triggerNodeIds(definition: unknown): string[];
|
|
159
|
+
export declare function runRun(env: CommandEnv, workflowKey: string, options: RunOptions): Promise<RunCommandResult>;
|
|
160
|
+
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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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