@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,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A durable run's history as a `fluidgrids.history` file (C-HIST,
|
|
3
|
+
* `schema/history-file.schema.json` of `@fluidgrids/workflows`): every page of
|
|
4
|
+
* `workflowRunHistory`, with offloaded payloads fetched through their
|
|
5
|
+
* presigned `payloadUrl` and inlined, so the file replays on its own.
|
|
6
|
+
*/
|
|
7
|
+
import { CliUserError } from '@burdenoff/cli-sdk/core';
|
|
8
|
+
import { createHistoryFile, HistoryFileError, parseHistoryFile, } from '@fluidgrids/workflows/history';
|
|
9
|
+
import { MAX_PAGES } from './api.js';
|
|
10
|
+
import { presignedUrl, readCapped } from './presigned.js';
|
|
11
|
+
import { describeError } from './shared.js';
|
|
12
|
+
/** Events per `workflowRunHistory` page (the service's default and maximum). */
|
|
13
|
+
export const HISTORY_PAGE_SIZE = 500;
|
|
14
|
+
/** Largest offloaded payload the CLI reads (the service's resolved-bytes cap). */
|
|
15
|
+
export const MAX_OFFLOADED_PAYLOAD_BYTES = 64 * 1024 * 1024;
|
|
16
|
+
function isRecord(value) {
|
|
17
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
+
}
|
|
19
|
+
/** A JSON object from a parsed value; the history contract has object payloads only. */
|
|
20
|
+
function objectPayload(value, where) {
|
|
21
|
+
if (value === null || value === undefined)
|
|
22
|
+
return {};
|
|
23
|
+
if (!isRecord(value))
|
|
24
|
+
throw new CliUserError(`${where}: the payload is not a JSON object.`);
|
|
25
|
+
// Parsed JSON (from the gateway or the payload object) is JSON by construction.
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
async function offloadedPayload(env, event, runId) {
|
|
29
|
+
const where = `Run ${runId} event ${event.seq}`;
|
|
30
|
+
const raw = event.payloadUrl ?? '';
|
|
31
|
+
presignedUrl(raw, `offloaded payload of event ${event.seq}`);
|
|
32
|
+
let response;
|
|
33
|
+
try {
|
|
34
|
+
response = await env.fetch(raw, { method: 'GET' });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// The presigned URL carries a signature; it is never printed.
|
|
38
|
+
throw new CliUserError(`${where}: fetching the offloaded payload failed: ${describeError(error)}`);
|
|
39
|
+
}
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw new CliUserError(`${where}: fetching the offloaded payload failed with HTTP ${response.status}.`);
|
|
42
|
+
}
|
|
43
|
+
const tooLarge = () => new CliUserError(`${where}: the offloaded payload is larger than the history cap (${MAX_OFFLOADED_PAYLOAD_BYTES} bytes).`);
|
|
44
|
+
const text = new TextDecoder().decode(await readCapped(response, MAX_OFFLOADED_PAYLOAD_BYTES, tooLarge));
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = JSON.parse(text);
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw new CliUserError(`${where}: the offloaded payload is not JSON.`);
|
|
51
|
+
}
|
|
52
|
+
return objectPayload(parsed, where);
|
|
53
|
+
}
|
|
54
|
+
/** The run's events, every page, offloaded payloads inlined. */
|
|
55
|
+
export async function fetchRunEvents(env, runId) {
|
|
56
|
+
const events = [];
|
|
57
|
+
let after = 0;
|
|
58
|
+
let historyBytes = 0;
|
|
59
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
60
|
+
const result = await env.api.runHistoryPage(runId, after, HISTORY_PAGE_SIZE);
|
|
61
|
+
historyBytes = result.historyBytes;
|
|
62
|
+
for (const event of result.events) {
|
|
63
|
+
const payload = event.payloadUrl
|
|
64
|
+
? await offloadedPayload(env, event, runId)
|
|
65
|
+
: objectPayload(event.payload, `Run ${runId} event ${event.seq}`);
|
|
66
|
+
events.push({
|
|
67
|
+
seq: event.seq,
|
|
68
|
+
// Validated against the event enum by parseHistoryFile below.
|
|
69
|
+
type: event.type,
|
|
70
|
+
...(event.taskId ? { taskId: event.taskId } : {}),
|
|
71
|
+
payload,
|
|
72
|
+
createdAt: event.createdAt,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const last = result.events[result.events.length - 1];
|
|
76
|
+
if (!result.hasMore || !last)
|
|
77
|
+
return { events, historyBytes };
|
|
78
|
+
after = result.nextAfter ?? last.seq;
|
|
79
|
+
}
|
|
80
|
+
throw new CliUserError(`The history of run ${runId} did not end after ${MAX_PAGES} pages; refusing to continue.`);
|
|
81
|
+
}
|
|
82
|
+
/** Refuse a run that has no event history (a canvas run). */
|
|
83
|
+
export function assertDurable(run) {
|
|
84
|
+
if (run.executionKind !== 'DURABLE_FN') {
|
|
85
|
+
throw new CliUserError(`Run ${run.id} is a ${run.executionKind} run; only durable-function runs have an event history.`, { hint: `Use \`fluidgrids runs logs ${run.id}\` for a canvas run.` });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Download a durable run's history as a validated history file. */
|
|
89
|
+
export async function fetchHistory(env, runId) {
|
|
90
|
+
const run = await env.api.describeRun(runId);
|
|
91
|
+
assertDurable(run);
|
|
92
|
+
const { events, historyBytes } = await fetchRunEvents(env, runId);
|
|
93
|
+
const started = events[0]?.type === 'WORKFLOW_STARTED' ? events[0].payload : undefined;
|
|
94
|
+
const workflowFn = run.workflowFn ??
|
|
95
|
+
(started && typeof started['workflowFn'] === 'string' ? started['workflowFn'] : undefined);
|
|
96
|
+
if (!workflowFn) {
|
|
97
|
+
throw new CliUserError(`Run ${runId} records no workflow function.`);
|
|
98
|
+
}
|
|
99
|
+
const workspaceId = env.ctx.auth.read()?.workspaceId ?? 'unknown';
|
|
100
|
+
const file = createHistoryFile(workflowFn, events, {
|
|
101
|
+
name: run.id,
|
|
102
|
+
info: {
|
|
103
|
+
runId: run.id,
|
|
104
|
+
workspaceId,
|
|
105
|
+
workflowKey: run.workflowKey,
|
|
106
|
+
version: run.version,
|
|
107
|
+
...(run.buildId ? { buildId: run.buildId } : {}),
|
|
108
|
+
...(run.taskQueue ? { taskQueue: run.taskQueue } : {}),
|
|
109
|
+
parentRunId: run.parentRunId,
|
|
110
|
+
rootRunId: run.rootRunId,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
try {
|
|
114
|
+
return { run, file: parseHistoryFile(file), historyBytes };
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (error instanceof HistoryFileError) {
|
|
118
|
+
throw new CliUserError(`The history of run ${runId} is not a valid history file.`, {
|
|
119
|
+
hint: [error.message, ...error.issues].join('\n'),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** Read and validate a history file from disk. */
|
|
126
|
+
export function parseHistoryText(text, path) {
|
|
127
|
+
try {
|
|
128
|
+
return parseHistoryFile(text);
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (error instanceof HistoryFileError) {
|
|
132
|
+
throw new CliUserError(`${path} is not a valid history file: ${error.message}`, {
|
|
133
|
+
...(error.issues.length > 0 ? { hint: error.issues.join('\n') } : {}),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/code-first/history.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;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CAAC;QACL,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project files a set of TypeScript entry modules reaches through
|
|
3
|
+
* relative imports, found by a static scan of the import statements.
|
|
4
|
+
*
|
|
5
|
+
* A durable project's code bundle is built from exactly these files (plus the
|
|
6
|
+
* sidecars), and the source archive carries exactly these files, so the
|
|
7
|
+
* service's rebuild (`buildBundle` over the archive with the SDK's default
|
|
8
|
+
* entries) sees the same modules the CLI bundled. Files no workflow imports,
|
|
9
|
+
* such as co-located `*.spec.ts` tests or Node-only scripts under
|
|
10
|
+
* `activities/`, stay out of both.
|
|
11
|
+
*
|
|
12
|
+
* The scan errs on the side of including a file: a commented-out import adds
|
|
13
|
+
* a file the bundle does not need, which is harmless. A missed import cannot
|
|
14
|
+
* produce a wrong bundle silently: the bundler then fails to resolve it.
|
|
15
|
+
*/
|
|
16
|
+
/** The relative specifiers a module imports at runtime (type-only imports excluded). */
|
|
17
|
+
export declare function relativeImports(source: string): string[];
|
|
18
|
+
/** The project file a relative specifier names, the way the bundler resolves it. */
|
|
19
|
+
export declare function resolveRelative(importer: string, specifier: string, files: ReadonlySet<string>): string | undefined;
|
|
20
|
+
/** Every file in `sources` the entries reach, the entries included. */
|
|
21
|
+
export declare function importClosure(sources: ReadonlyMap<string, string>, entries: readonly string[]): Set<string>;
|
|
22
|
+
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/code-first/imports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAaxD;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GACzB,MAAM,GAAG,SAAS,CAMpB;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAC3B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,OAAO,EAAE,SAAS,MAAM,EAAE,GACzB,GAAG,CAAC,MAAM,CAAC,CAab"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project files a set of TypeScript entry modules reaches through
|
|
3
|
+
* relative imports, found by a static scan of the import statements.
|
|
4
|
+
*
|
|
5
|
+
* A durable project's code bundle is built from exactly these files (plus the
|
|
6
|
+
* sidecars), and the source archive carries exactly these files, so the
|
|
7
|
+
* service's rebuild (`buildBundle` over the archive with the SDK's default
|
|
8
|
+
* entries) sees the same modules the CLI bundled. Files no workflow imports,
|
|
9
|
+
* such as co-located `*.spec.ts` tests or Node-only scripts under
|
|
10
|
+
* `activities/`, stay out of both.
|
|
11
|
+
*
|
|
12
|
+
* The scan errs on the side of including a file: a commented-out import adds
|
|
13
|
+
* a file the bundle does not need, which is harmless. A missed import cannot
|
|
14
|
+
* produce a wrong bundle silently: the bundler then fails to resolve it.
|
|
15
|
+
*/
|
|
16
|
+
import { posix } from 'path';
|
|
17
|
+
/** `import … from '…'` and `export … from '…'`, with an optional `type` modifier. */
|
|
18
|
+
const FROM_CLAUSE = /\b(import|export)(\s+type\b)?[^'"`;]*?\bfrom\s*(['"])([^'"\r\n]+)\3/g;
|
|
19
|
+
/** `import '…'` (side effects only). */
|
|
20
|
+
const BARE_IMPORT = /\bimport\s*(['"])([^'"\r\n]+)\1/g;
|
|
21
|
+
/** `import('…')`. */
|
|
22
|
+
const DYNAMIC_IMPORT = /\bimport\s*\(\s*(['"])([^'"\r\n]+)\1\s*\)/g;
|
|
23
|
+
/** The relative specifiers a module imports at runtime (type-only imports excluded). */
|
|
24
|
+
export function relativeImports(source) {
|
|
25
|
+
const found = [];
|
|
26
|
+
for (const match of source.matchAll(FROM_CLAUSE)) {
|
|
27
|
+
const specifier = match[4];
|
|
28
|
+
if (match[2] === undefined && specifier !== undefined)
|
|
29
|
+
found.push(specifier);
|
|
30
|
+
}
|
|
31
|
+
for (const match of source.matchAll(BARE_IMPORT)) {
|
|
32
|
+
if (match[2] !== undefined)
|
|
33
|
+
found.push(match[2]);
|
|
34
|
+
}
|
|
35
|
+
for (const match of source.matchAll(DYNAMIC_IMPORT)) {
|
|
36
|
+
if (match[2] !== undefined)
|
|
37
|
+
found.push(match[2]);
|
|
38
|
+
}
|
|
39
|
+
return found.filter((specifier) => specifier.startsWith('./') || specifier.startsWith('../'));
|
|
40
|
+
}
|
|
41
|
+
/** The project file a relative specifier names, the way the bundler resolves it. */
|
|
42
|
+
export function resolveRelative(importer, specifier, files) {
|
|
43
|
+
const base = posix.normalize(posix.join(posix.dirname(importer), specifier));
|
|
44
|
+
const candidates = [base];
|
|
45
|
+
if (/\.m?js$/.test(base))
|
|
46
|
+
candidates.push(base.replace(/\.(m?)js$/, '.$1ts'));
|
|
47
|
+
candidates.push(`${base}.ts`, `${base}/index.ts`);
|
|
48
|
+
return candidates.find((candidate) => files.has(candidate));
|
|
49
|
+
}
|
|
50
|
+
/** Every file in `sources` the entries reach, the entries included. */
|
|
51
|
+
export function importClosure(sources, entries) {
|
|
52
|
+
const paths = new Set(sources.keys());
|
|
53
|
+
const reached = new Set();
|
|
54
|
+
const pending = entries.filter((entry) => paths.has(entry));
|
|
55
|
+
for (let path = pending.pop(); path !== undefined; path = pending.pop()) {
|
|
56
|
+
if (reached.has(path))
|
|
57
|
+
continue;
|
|
58
|
+
reached.add(path);
|
|
59
|
+
for (const specifier of relativeImports(sources.get(path) ?? '')) {
|
|
60
|
+
const target = resolveRelative(path, specifier, paths);
|
|
61
|
+
if (target !== undefined && !reached.has(target))
|
|
62
|
+
pending.push(target);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return reached;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=im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ClB,KAAK,MAAM,SAAS,IAAI,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;YACjE,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YACvD,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The code-first commands (spec 07 §7, Phase A): `init`, `codegen`, `pull`,
|
|
3
3
|
* `push`, `diff`, `validate`, plus `import` (a new workflow from one file,
|
|
4
|
-
* through the service's import path) and `interface
|
|
4
|
+
* through the service's import path) and `interface`; and the durable-function
|
|
5
|
+
* commands of Phase B (`push --hotfix`, `runs start|describe|history|signal|
|
|
6
|
+
* terminate|stack`, `history`, `signal`, `replay`, `test`, `run`,
|
|
7
|
+
* `versions list`).
|
|
5
8
|
*
|
|
6
9
|
* Product-local rather than in `@burdenoff/cli-sdk`: they depend on
|
|
7
10
|
* `@fluidgrids/workflows` (esbuild, Prettier, QuickJS), which the other product
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-first/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-first/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAezD,QAAA,MAAM,eAAe,EAAE,SAiBtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/code-first/index.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The code-first commands (spec 07 §7, Phase A): `init`, `codegen`, `pull`,
|
|
3
3
|
* `push`, `diff`, `validate`, plus `import` (a new workflow from one file,
|
|
4
|
-
* through the service's import path) and `interface
|
|
4
|
+
* through the service's import path) and `interface`; and the durable-function
|
|
5
|
+
* commands of Phase B (`push --hotfix`, `runs start|describe|history|signal|
|
|
6
|
+
* terminate|stack`, `history`, `signal`, `replay`, `test`, `run`,
|
|
7
|
+
* `versions list`).
|
|
5
8
|
*
|
|
6
9
|
* Product-local rather than in `@burdenoff/cli-sdk`: they depend on
|
|
7
10
|
* `@fluidgrids/workflows` (esbuild, Prettier, QuickJS), which the other product
|
|
8
11
|
* CLIs built on cli-sdk must not pull in. The implementations load on first
|
|
9
12
|
* use (see `register.ts`), so the other commands do not pay for them.
|
|
10
13
|
*/
|
|
11
|
-
import { registerCodegen, registerDiff, registerImport, registerInit, registerInterface, registerPull, registerPush, registerValidate, } from './register.js';
|
|
14
|
+
import { registerCodegen, registerDiff, registerDurable, registerImport, registerInit, registerInterface, registerPull, registerPush, registerValidate, } from './register.js';
|
|
12
15
|
import { createCommandEnv } from './shared.js';
|
|
13
16
|
const codeFirstModule = {
|
|
14
17
|
id: 'fluidgrids-code-first',
|
|
@@ -25,6 +28,7 @@ const codeFirstModule = {
|
|
|
25
28
|
registerValidate(program, env);
|
|
26
29
|
registerImport(program, env);
|
|
27
30
|
registerInterface(program, env);
|
|
31
|
+
registerDurable(program, env);
|
|
28
32
|
},
|
|
29
33
|
};
|
|
30
34
|
export default codeFirstModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-first/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-first/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,eAAe,GAAc;IACjC,EAAE,EAAE,uBAAuB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iCAAiC;IAC9C,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,GAAG;QACnB,MAAM,GAAG,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAClC,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC9B,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,YAAY,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC3B,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC7B,iBAAiB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAChC,CAAC;CACF,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -7,14 +7,29 @@
|
|
|
7
7
|
* - JSON: canvas workflows kept as the export envelope are read as they are.
|
|
8
8
|
*/
|
|
9
9
|
import type { ConnectionRef } from '@fluidgrids/workflows/ir';
|
|
10
|
-
import { type
|
|
10
|
+
import { type VendoredDeps } from '@fluidgrids/workflows/roundtrip';
|
|
11
|
+
import { type Project, type ProjectFile, type WorkflowFormat } from './project.js';
|
|
11
12
|
export interface LocalWorkflow {
|
|
12
13
|
key: string;
|
|
13
14
|
format: WorkflowFormat;
|
|
14
15
|
/** Project-relative file the workflow is defined in. */
|
|
15
16
|
path: string;
|
|
16
17
|
definition: Record<string, unknown>;
|
|
18
|
+
/** True when the definition runs code (a `code` block: tier-2 functions or `wf.codeWorkflow`). */
|
|
19
|
+
durable: boolean;
|
|
17
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* A finding in durable-function sources that `push` refuses: `durable.phaseC`
|
|
23
|
+
* (a feature that arrives in Phase C) or `durable.activityTypeNotAllowed`.
|
|
24
|
+
*/
|
|
25
|
+
export interface DurableIssue {
|
|
26
|
+
code: string;
|
|
27
|
+
message: string;
|
|
28
|
+
module: string;
|
|
29
|
+
key?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Largest code bundle the service accepts (C-S3, spec 01 §5). */
|
|
32
|
+
export declare const MAX_BUNDLE_BYTES: number;
|
|
18
33
|
export interface LoweredProject {
|
|
19
34
|
/** `buildId` of the TypeScript bundle, when the project has TypeScript workflows. */
|
|
20
35
|
buildId?: string;
|
|
@@ -23,6 +38,19 @@ export interface LoweredProject {
|
|
|
23
38
|
workflows: LocalWorkflow[];
|
|
24
39
|
/** Notes about the lowering (for example SDK disagreements), one line each. */
|
|
25
40
|
warnings: string[];
|
|
41
|
+
/** The TypeScript bundle (one ES module that serves every code workflow of the push). */
|
|
42
|
+
bundle?: string;
|
|
43
|
+
/** The project files the bundle was built from, by path (the source archive's `files`). */
|
|
44
|
+
sourceFiles?: Record<string, string>;
|
|
45
|
+
/** Pure-ESM packages vendored from the project's `node_modules`. */
|
|
46
|
+
vendored?: VendoredDeps;
|
|
47
|
+
/**
|
|
48
|
+
* The bundle's source map (C-SOURCEMAP, SDK R2), uploaded inside the source
|
|
49
|
+
* archive so the service maps `__stack_trace` locations back to the sources.
|
|
50
|
+
*/
|
|
51
|
+
map?: string;
|
|
52
|
+
/** Durable-function findings; `push` refuses a project that has any. */
|
|
53
|
+
issues: DurableIssue[];
|
|
26
54
|
}
|
|
27
55
|
export interface LowerProjectOptions {
|
|
28
56
|
/** How connection names resolve. A function is called once per name. */
|
|
@@ -36,6 +64,30 @@ export interface LowerProjectOptions {
|
|
|
36
64
|
* anything else is rethrown as it is.
|
|
37
65
|
*/
|
|
38
66
|
export declare function lowerFailure(error: unknown, what: string): unknown;
|
|
67
|
+
/** True when a definition carries a `code` block, so a version of it needs a code bundle. */
|
|
68
|
+
export declare function runsCode(definition: Record<string, unknown>): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* The project's runtime dependencies, vendored for the bundle: only when
|
|
71
|
+
* `package.json` lists `dependencies` besides the SDK itself (which the bundle
|
|
72
|
+
* embeds). Returns undefined when there is nothing to vendor.
|
|
73
|
+
*/
|
|
74
|
+
export declare function vendorProjectDependencies(root: string): VendoredDeps | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The files a durable project's bundle and source archive are built from: the
|
|
77
|
+
* workflow modules, the TypeScript files they import (transitively) and the
|
|
78
|
+
* sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
|
|
79
|
+
* workflow imports, is neither bundled nor archived, so the service's rebuild
|
|
80
|
+
* with the SDK's default entries sees exactly the modules the CLI bundled.
|
|
81
|
+
*/
|
|
82
|
+
export declare function durableBundleFiles(files: readonly ProjectFile[], entries: readonly string[]): ProjectFile[];
|
|
83
|
+
/**
|
|
84
|
+
* The source map of a durable bundle (C-SOURCEMAP): the same build as
|
|
85
|
+
* `lower()`'s (the SDK's default entries over the archived files), with an
|
|
86
|
+
* external map. The bundle bytes are the same with or without a map; a build
|
|
87
|
+
* whose `buildId` differs anyway gives no map, so a map never describes
|
|
88
|
+
* another bundle.
|
|
89
|
+
*/
|
|
90
|
+
export declare function bundleSourceMap(files: readonly ProjectFile[], buildId: string, deps: VendoredDeps | undefined): Promise<string | undefined>;
|
|
39
91
|
export declare function lowerProject(project: Project, options: LowerProjectOptions & {
|
|
40
92
|
connectionNames: readonly string[];
|
|
41
93
|
}): Promise<LoweredProject>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowering.d.ts","sourceRoot":"","sources":["../../src/code-first/lowering.ts"],"names":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edConnectionsError } from '@fluidgrids/workflows';
|
|
11
11
|
import { parseWorkflowDocument } from '@fluidgrids/workflows/ir';
|
|
12
|
-
import { lower, LowerError } from '@fluidgrids/workflows/roundtrip';
|
|
13
|
-
import {
|
|
12
|
+
import { buildBundle, defaultEntries, lower, LowerError, vendorDependencies, } from '@fluidgrids/workflows/roundtrip';
|
|
13
|
+
import { existsSync, readFileSync } from 'fs';
|
|
14
|
+
import { join, posix } from 'path';
|
|
14
15
|
import { isJsonWorkflow, isLoweringInput, isWorkflowModule, listSourcePaths, readProjectFiles, } from './project.js';
|
|
16
|
+
import { importClosure } from './imports.js';
|
|
15
17
|
import { lowerPython, PythonUnresolvedConnectionsError, resolvePythonInterpreter, } from './python.js';
|
|
18
|
+
/** Largest code bundle the service accepts (C-S3, spec 01 §5). */
|
|
19
|
+
export const MAX_BUNDLE_BYTES = 8 * 1024 * 1024;
|
|
16
20
|
function isBuildFailure(error) {
|
|
17
21
|
return error instanceof Error && 'errors' in error && Array.isArray(error.errors);
|
|
18
22
|
}
|
|
@@ -30,6 +34,57 @@ export function lowerFailure(error, what) {
|
|
|
30
34
|
function unresolvedError(names, explain) {
|
|
31
35
|
return new CliUserError(`The code names connections that do not resolve in this workspace: ${[...names].sort().join(', ')}`, { hint: explain(names).join('\n') });
|
|
32
36
|
}
|
|
37
|
+
function isRecord(value) {
|
|
38
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
/** True when a definition carries a `code` block, so a version of it needs a code bundle. */
|
|
41
|
+
export function runsCode(definition) {
|
|
42
|
+
return isRecord(definition['code']);
|
|
43
|
+
}
|
|
44
|
+
const SDK_PACKAGE = '@fluidgrids/workflows';
|
|
45
|
+
/**
|
|
46
|
+
* The project's runtime dependencies, vendored for the bundle: only when
|
|
47
|
+
* `package.json` lists `dependencies` besides the SDK itself (which the bundle
|
|
48
|
+
* embeds). Returns undefined when there is nothing to vendor.
|
|
49
|
+
*/
|
|
50
|
+
export function vendorProjectDependencies(root) {
|
|
51
|
+
const manifestPath = join(root, 'package.json');
|
|
52
|
+
if (!existsSync(manifestPath))
|
|
53
|
+
return undefined;
|
|
54
|
+
let manifest;
|
|
55
|
+
try {
|
|
56
|
+
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
throw new CliUserError('package.json is not valid JSON.');
|
|
60
|
+
}
|
|
61
|
+
const dependencies = isRecord(manifest) ? manifest['dependencies'] : undefined;
|
|
62
|
+
if (!isRecord(dependencies))
|
|
63
|
+
return undefined;
|
|
64
|
+
if (!Object.keys(dependencies).some((name) => name !== SDK_PACKAGE))
|
|
65
|
+
return undefined;
|
|
66
|
+
try {
|
|
67
|
+
return vendorDependencies(root);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
throw lowerFailure(error, 'the project dependencies');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The files a durable project's bundle and source archive are built from: the
|
|
75
|
+
* workflow modules, the TypeScript files they import (transitively) and the
|
|
76
|
+
* sidecars. A co-located `*.spec.ts` test, or an `activities/` module no
|
|
77
|
+
* workflow imports, is neither bundled nor archived, so the service's rebuild
|
|
78
|
+
* with the SDK's default entries sees exactly the modules the CLI bundled.
|
|
79
|
+
*/
|
|
80
|
+
export function durableBundleFiles(files, entries) {
|
|
81
|
+
const sources = new Map(files.filter((file) => file.path.endsWith('.ts')).map((file) => [file.path, file.content]));
|
|
82
|
+
const reached = importClosure(sources, entries);
|
|
83
|
+
return files.filter((file) => !file.path.endsWith('.ts') || reached.has(file.path));
|
|
84
|
+
}
|
|
85
|
+
function sameList(a, b) {
|
|
86
|
+
return a.length === b.length && a.every((value, index) => value === b[index]);
|
|
87
|
+
}
|
|
33
88
|
function jsonWorkflows(project, paths) {
|
|
34
89
|
return readProjectFiles(project.root, paths).map((file) => {
|
|
35
90
|
const parsed = parseWorkflowDocument(file.content);
|
|
@@ -39,7 +94,8 @@ function jsonWorkflows(project, paths) {
|
|
|
39
94
|
const stem = posix.basename(file.path, '.json');
|
|
40
95
|
const declared = typeof parsed.definitionJson['key'] === 'string' ? parsed.definitionJson['key'] : null;
|
|
41
96
|
const key = parsed.workflowKey ?? declared ?? stem;
|
|
42
|
-
|
|
97
|
+
const definition = parsed.definitionJson;
|
|
98
|
+
return { key, format: 'json', path: file.path, definition, durable: runsCode(definition) };
|
|
43
99
|
});
|
|
44
100
|
}
|
|
45
101
|
/** The full name → reference map a Python lowering receives. */
|
|
@@ -58,25 +114,76 @@ function connectionMap(names, resolve) {
|
|
|
58
114
|
}
|
|
59
115
|
return out;
|
|
60
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* The source map of a durable bundle (C-SOURCEMAP): the same build as
|
|
119
|
+
* `lower()`'s (the SDK's default entries over the archived files), with an
|
|
120
|
+
* external map. The bundle bytes are the same with or without a map; a build
|
|
121
|
+
* whose `buildId` differs anyway gives no map, so a map never describes
|
|
122
|
+
* another bundle.
|
|
123
|
+
*/
|
|
124
|
+
export async function bundleSourceMap(files, buildId, deps) {
|
|
125
|
+
const built = await buildBundle(new Map(files.map((file) => [file.path, file.content])), {
|
|
126
|
+
maxBundleBytes: MAX_BUNDLE_BYTES,
|
|
127
|
+
sourcemap: 'external',
|
|
128
|
+
...(deps ? { deps } : {}),
|
|
129
|
+
});
|
|
130
|
+
return built.buildId === buildId ? built.map : undefined;
|
|
131
|
+
}
|
|
61
132
|
export async function lowerProject(project, options) {
|
|
62
133
|
const paths = listSourcePaths(project.root);
|
|
63
134
|
const language = project.config.language;
|
|
64
135
|
const entries = paths.filter((path) => isWorkflowModule(path, language));
|
|
65
136
|
const workflows = jsonWorkflows(project, paths.filter(isJsonWorkflow));
|
|
66
|
-
const result = { workflows, warnings: [] };
|
|
137
|
+
const result = { workflows, warnings: [], issues: [] };
|
|
67
138
|
if (entries.length > 0) {
|
|
68
139
|
if (language === 'ts') {
|
|
69
140
|
const files = readProjectFiles(project.root, paths.filter((path) => isLoweringInput(path, language)));
|
|
141
|
+
const deps = vendorProjectDependencies(project.root);
|
|
142
|
+
const run = (input, only) => lower(input, {
|
|
143
|
+
...(only ? { entries: only } : {}),
|
|
144
|
+
connections: options.connections,
|
|
145
|
+
maxBundleBytes: MAX_BUNDLE_BYTES,
|
|
146
|
+
...(deps ? { deps } : {}),
|
|
147
|
+
});
|
|
70
148
|
try {
|
|
71
|
-
|
|
149
|
+
let lowered = await run(files, entries);
|
|
150
|
+
let bundleFiles = files;
|
|
151
|
+
const durable = lowered.workflows.some((workflow) => runsCode(workflow.definition));
|
|
152
|
+
if (durable) {
|
|
153
|
+
bundleFiles = durableBundleFiles(files, entries);
|
|
154
|
+
// The service rebuilds a code bundle from the source archive with
|
|
155
|
+
// the SDK's default entries (`buildWorkflowCode`), so an uploaded
|
|
156
|
+
// bundle must come from those entries over the archived files, or
|
|
157
|
+
// the service's build would get another buildId. Graph-only
|
|
158
|
+
// projects keep their entries and files.
|
|
159
|
+
const paths = bundleFiles.map((file) => file.path);
|
|
160
|
+
if (bundleFiles.length !== files.length || !sameList(defaultEntries(paths), entries)) {
|
|
161
|
+
lowered = await run(bundleFiles);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
72
164
|
result.buildId = lowered.buildId;
|
|
73
165
|
result.sourceHash = lowered.sourceHash;
|
|
166
|
+
result.bundle = lowered.bundle;
|
|
167
|
+
if (durable) {
|
|
168
|
+
const map = await bundleSourceMap(bundleFiles, lowered.buildId, deps);
|
|
169
|
+
if (map !== undefined)
|
|
170
|
+
result.map = map;
|
|
171
|
+
else {
|
|
172
|
+
result.warnings.push('The source map build did not reproduce the bundle; the push uploads no source map (stack traces show bundle locations).');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
result.sourceFiles = Object.fromEntries(bundleFiles.map((file) => [file.path, file.content]));
|
|
176
|
+
if (deps)
|
|
177
|
+
result.vendored = deps;
|
|
178
|
+
result.issues.push(...lowered.issues);
|
|
74
179
|
for (const workflow of lowered.workflows) {
|
|
180
|
+
const definition = workflow.definition;
|
|
75
181
|
workflows.push({
|
|
76
182
|
key: workflow.key,
|
|
77
183
|
format: 'ts',
|
|
78
184
|
path: workflow.module,
|
|
79
|
-
definition
|
|
185
|
+
definition,
|
|
186
|
+
durable: runsCode(definition),
|
|
80
187
|
});
|
|
81
188
|
}
|
|
82
189
|
}
|
|
@@ -97,12 +204,25 @@ export async function lowerProject(project, options) {
|
|
|
97
204
|
});
|
|
98
205
|
result.sourceHash = lowered.sourceHash;
|
|
99
206
|
result.warnings.push(...lowered.warnings);
|
|
207
|
+
result.issues.push(...lowered.issues);
|
|
100
208
|
for (const workflow of lowered.workflows) {
|
|
209
|
+
const durable = runsCode(workflow.definition);
|
|
210
|
+
if (durable) {
|
|
211
|
+
// A Python definition with a code block needs a Python bundle and
|
|
212
|
+
// the Python durable worker, both Phase C (BOFF-9906).
|
|
213
|
+
result.issues.push({
|
|
214
|
+
code: 'durable.phaseC',
|
|
215
|
+
message: `${workflow.module}: Python durable functions (tier 2) arrive in Phase C`,
|
|
216
|
+
module: workflow.module,
|
|
217
|
+
key: workflow.key,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
101
220
|
workflows.push({
|
|
102
221
|
key: workflow.key,
|
|
103
222
|
format: 'py',
|
|
104
223
|
path: workflow.module,
|
|
105
224
|
definition: workflow.definition,
|
|
225
|
+
durable,
|
|
106
226
|
});
|
|
107
227
|
}
|
|
108
228
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lowering.js","sourceRoot":"","sources":["../../src/code-first/lowering.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"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AM,CAAC;AAChB,CAAC"}
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
* (BOFF-9904): `exportWorkflow(format:, options:)` with the additive
|
|
17
17
|
* `exportFormat` / `files` / `fidelity` / `irHash` fields, `importWorkflow`
|
|
18
18
|
* with `source`, `validateWorkflowDefinition` and `workflowInterface`. They
|
|
19
|
-
* are validated against the supergraph
|
|
20
|
-
* in, and until then against `schema/code-first.pending.graphql`, which mirrors
|
|
21
|
-
* the service's `code-first.gql`.
|
|
19
|
+
* are validated against the vendored supergraph, which carries them.
|
|
22
20
|
*
|
|
23
21
|
* Every code-first operation is gated on the service by the
|
|
24
22
|
* `fluidgrids.code-first` feature flag; a workspace without it gets a GraphQL
|