@fluidgrids/cli 2026.1107.1 → 2026.1109.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/README.md +98 -6
  2. package/dist/cli.js +9705 -33
  3. package/package.json +42 -35
  4. package/dist/auth/device-login.d.ts +0 -31
  5. package/dist/auth/device-login.d.ts.map +0 -1
  6. package/dist/auth/device-login.js +0 -75
  7. package/dist/auth/device-login.js.map +0 -1
  8. package/dist/auth/token-auth.d.ts +0 -49
  9. package/dist/auth/token-auth.d.ts.map +0 -1
  10. package/dist/auth/token-auth.js +0 -279
  11. package/dist/auth/token-auth.js.map +0 -1
  12. package/dist/cli.d.ts +0 -10
  13. package/dist/cli.d.ts.map +0 -1
  14. package/dist/cli.js.map +0 -1
  15. package/dist/code-first/api.d.ts +0 -601
  16. package/dist/code-first/api.d.ts.map +0 -1
  17. package/dist/code-first/api.js +0 -432
  18. package/dist/code-first/api.js.map +0 -1
  19. package/dist/code-first/code-upload.d.ts +0 -53
  20. package/dist/code-first/code-upload.d.ts.map +0 -1
  21. package/dist/code-first/code-upload.js +0 -165
  22. package/dist/code-first/code-upload.js.map +0 -1
  23. package/dist/code-first/commands/codegen.d.ts +0 -20
  24. package/dist/code-first/commands/codegen.d.ts.map +0 -1
  25. package/dist/code-first/commands/codegen.js +0 -50
  26. package/dist/code-first/commands/codegen.js.map +0 -1
  27. package/dist/code-first/commands/diff.d.ts +0 -28
  28. package/dist/code-first/commands/diff.d.ts.map +0 -1
  29. package/dist/code-first/commands/diff.js +0 -73
  30. package/dist/code-first/commands/diff.js.map +0 -1
  31. package/dist/code-first/commands/hotfix.d.ts +0 -54
  32. package/dist/code-first/commands/hotfix.d.ts.map +0 -1
  33. package/dist/code-first/commands/hotfix.js +0 -225
  34. package/dist/code-first/commands/hotfix.js.map +0 -1
  35. package/dist/code-first/commands/import.d.ts +0 -40
  36. package/dist/code-first/commands/import.d.ts.map +0 -1
  37. package/dist/code-first/commands/import.js +0 -235
  38. package/dist/code-first/commands/import.js.map +0 -1
  39. package/dist/code-first/commands/init.d.ts +0 -33
  40. package/dist/code-first/commands/init.d.ts.map +0 -1
  41. package/dist/code-first/commands/init.js +0 -177
  42. package/dist/code-first/commands/init.js.map +0 -1
  43. package/dist/code-first/commands/interface.d.ts +0 -12
  44. package/dist/code-first/commands/interface.d.ts.map +0 -1
  45. package/dist/code-first/commands/interface.js +0 -21
  46. package/dist/code-first/commands/interface.js.map +0 -1
  47. package/dist/code-first/commands/pull.d.ts +0 -63
  48. package/dist/code-first/commands/pull.d.ts.map +0 -1
  49. package/dist/code-first/commands/pull.js +0 -266
  50. package/dist/code-first/commands/pull.js.map +0 -1
  51. package/dist/code-first/commands/push.d.ts +0 -97
  52. package/dist/code-first/commands/push.d.ts.map +0 -1
  53. package/dist/code-first/commands/push.js +0 -313
  54. package/dist/code-first/commands/push.js.map +0 -1
  55. package/dist/code-first/commands/replay.d.ts +0 -44
  56. package/dist/code-first/commands/replay.d.ts.map +0 -1
  57. package/dist/code-first/commands/replay.js +0 -238
  58. package/dist/code-first/commands/replay.js.map +0 -1
  59. package/dist/code-first/commands/runs.d.ts +0 -160
  60. package/dist/code-first/commands/runs.d.ts.map +0 -1
  61. package/dist/code-first/commands/runs.js +0 -565
  62. package/dist/code-first/commands/runs.js.map +0 -1
  63. package/dist/code-first/commands/suite.d.ts +0 -57
  64. package/dist/code-first/commands/suite.d.ts.map +0 -1
  65. package/dist/code-first/commands/suite.js +0 -197
  66. package/dist/code-first/commands/suite.js.map +0 -1
  67. package/dist/code-first/commands/validate.d.ts +0 -38
  68. package/dist/code-first/commands/validate.d.ts.map +0 -1
  69. package/dist/code-first/commands/validate.js +0 -140
  70. package/dist/code-first/commands/validate.js.map +0 -1
  71. package/dist/code-first/commands/versions.d.ts +0 -63
  72. package/dist/code-first/commands/versions.d.ts.map +0 -1
  73. package/dist/code-first/commands/versions.js +0 -204
  74. package/dist/code-first/commands/versions.js.map +0 -1
  75. package/dist/code-first/connections.d.ts +0 -55
  76. package/dist/code-first/connections.d.ts.map +0 -1
  77. package/dist/code-first/connections.js +0 -180
  78. package/dist/code-first/connections.js.map +0 -1
  79. package/dist/code-first/durable-operations.d.ts +0 -41
  80. package/dist/code-first/durable-operations.d.ts.map +0 -1
  81. package/dist/code-first/durable-operations.js +0 -135
  82. package/dist/code-first/durable-operations.js.map +0 -1
  83. package/dist/code-first/history.d.ts +0 -30
  84. package/dist/code-first/history.d.ts.map +0 -1
  85. package/dist/code-first/history.js +0 -139
  86. package/dist/code-first/history.js.map +0 -1
  87. package/dist/code-first/imports.d.ts +0 -22
  88. package/dist/code-first/imports.d.ts.map +0 -1
  89. package/dist/code-first/imports.js +0 -67
  90. package/dist/code-first/imports.js.map +0 -1
  91. package/dist/code-first/index.d.ts +0 -18
  92. package/dist/code-first/index.d.ts.map +0 -1
  93. package/dist/code-first/index.js +0 -36
  94. package/dist/code-first/index.js.map +0 -1
  95. package/dist/code-first/junit.d.ts +0 -24
  96. package/dist/code-first/junit.d.ts.map +0 -1
  97. package/dist/code-first/junit.js +0 -163
  98. package/dist/code-first/junit.js.map +0 -1
  99. package/dist/code-first/lowering.d.ts +0 -94
  100. package/dist/code-first/lowering.d.ts.map +0 -1
  101. package/dist/code-first/lowering.js +0 -248
  102. package/dist/code-first/lowering.js.map +0 -1
  103. package/dist/code-first/operations.d.ts +0 -55
  104. package/dist/code-first/operations.d.ts.map +0 -1
  105. package/dist/code-first/operations.js +0 -165
  106. package/dist/code-first/operations.js.map +0 -1
  107. package/dist/code-first/parity-operations.d.ts +0 -44
  108. package/dist/code-first/parity-operations.d.ts.map +0 -1
  109. package/dist/code-first/parity-operations.js +0 -211
  110. package/dist/code-first/parity-operations.js.map +0 -1
  111. package/dist/code-first/parity.d.ts +0 -83
  112. package/dist/code-first/parity.d.ts.map +0 -1
  113. package/dist/code-first/parity.js +0 -301
  114. package/dist/code-first/parity.js.map +0 -1
  115. package/dist/code-first/presigned.d.ts +0 -21
  116. package/dist/code-first/presigned.d.ts.map +0 -1
  117. package/dist/code-first/presigned.js +0 -85
  118. package/dist/code-first/presigned.js.map +0 -1
  119. package/dist/code-first/project.d.ts +0 -123
  120. package/dist/code-first/project.d.ts.map +0 -1
  121. package/dist/code-first/project.js +0 -301
  122. package/dist/code-first/project.js.map +0 -1
  123. package/dist/code-first/python.d.ts +0 -81
  124. package/dist/code-first/python.d.ts.map +0 -1
  125. package/dist/code-first/python.js +0 -249
  126. package/dist/code-first/python.js.map +0 -1
  127. package/dist/code-first/redact.d.ts +0 -31
  128. package/dist/code-first/redact.d.ts.map +0 -1
  129. package/dist/code-first/redact.js +0 -159
  130. package/dist/code-first/redact.js.map +0 -1
  131. package/dist/code-first/register.d.ts +0 -35
  132. package/dist/code-first/register.d.ts.map +0 -1
  133. package/dist/code-first/register.js +0 -415
  134. package/dist/code-first/register.js.map +0 -1
  135. package/dist/code-first/remote.d.ts +0 -58
  136. package/dist/code-first/remote.d.ts.map +0 -1
  137. package/dist/code-first/remote.js +0 -126
  138. package/dist/code-first/remote.js.map +0 -1
  139. package/dist/code-first/replay.d.ts +0 -36
  140. package/dist/code-first/replay.d.ts.map +0 -1
  141. package/dist/code-first/replay.js +0 -52
  142. package/dist/code-first/replay.js.map +0 -1
  143. package/dist/code-first/shared.d.ts +0 -53
  144. package/dist/code-first/shared.d.ts.map +0 -1
  145. package/dist/code-first/shared.js +0 -94
  146. package/dist/code-first/shared.js.map +0 -1
  147. package/dist/code-first/test-suite-operations.d.ts +0 -16
  148. package/dist/code-first/test-suite-operations.d.ts.map +0 -1
  149. package/dist/code-first/test-suite-operations.js +0 -44
  150. package/dist/code-first/test-suite-operations.js.map +0 -1
  151. package/dist/modules.d.ts +0 -15
  152. package/dist/modules.d.ts.map +0 -1
  153. package/dist/modules.js +0 -61
  154. package/dist/modules.js.map +0 -1
  155. package/dist/product-defaults.d.ts +0 -11
  156. package/dist/product-defaults.d.ts.map +0 -1
  157. package/dist/product-defaults.js +0 -25
  158. package/dist/product-defaults.js.map +0 -1
  159. package/dist/program.d.ts +0 -20
  160. package/dist/program.d.ts.map +0 -1
  161. package/dist/program.js +0 -44
  162. package/dist/program.js.map +0 -1
@@ -1,97 +0,0 @@
1
- /**
2
- * `fluidgrids push [key…] [--dry-run]`: lower the project locally and create a
3
- * version for every workflow whose IR changed (spec 07 §4, Phase A).
4
- *
5
- * - An existing key gets `createWorkflowVersion`; a new key gets `importWorkflow`
6
- * (a DRAFT, with the installed-node check and the workflow-count quota).
7
- * - Unchanged workflows (same `irHash` as the latest version) get no version.
8
- * - The result prints `workflowVersionDiff` between the previous latest version
9
- * and the new one.
10
- * - Connection names resolve in the target workspace; a name that does not
11
- * resolve fails the push before anything is written.
12
- * - Every workflow is validated locally first, so a push is all-or-nothing up
13
- * to the first service-side refusal.
14
- * - A workflow whose latest stored version is newer than the one `lock.json`
15
- * records (changed on the canvas or pushed from elsewhere since the pull) is
16
- * refused, unless `--force` is given, so a push never silently reverts it.
17
- *
18
- * Durable functions (Phase B, BOFF-9905):
19
- * - A workflow whose definition carries a `code` block (tier-2 `workflow()`
20
- * functions, or a tier-1 graph with `wf.codeWorkflow`) gets its version with
21
- * `codeBundle`: the bundle is uploaded through `prepareWorkflowCodeUpload`
22
- * (see `code-upload.ts`). One bundle serves every version of the push.
23
- * - Findings in the sources (`durable.phaseC`, `durable.activityTypeNotAllowed`)
24
- * refuse the push before anything is written. Python durable functions are
25
- * Phase C.
26
- * - `--hotfix <version>` replaces the bundle of an existing version instead
27
- * (see `hotfix.ts`).
28
- * - `lock.json` records `{buildId, sourceHash, sdkVersion}` of the bundle and
29
- * the `buildId` of each version that references it.
30
- */
31
- import { type DurableIssue, type LocalWorkflow, type LoweredProject } from '../lowering.js';
32
- import { type Project } from '../project.js';
33
- import { RemoteWorkflows } from '../remote.js';
34
- import { type CommandEnv, type ProjectOptions } from '../shared.js';
35
- export interface PushOptions extends ProjectOptions {
36
- dryRun?: boolean;
37
- message?: string;
38
- /** Push even over versions created in the workspace after the project pulled the workflow. */
39
- force?: boolean;
40
- /** Replace the code bundle of this existing version instead of creating a version. */
41
- hotfix?: string;
42
- /** With `--hotfix`: replay this many recent runs of the version locally first. */
43
- replaySample?: string;
44
- /** With `--hotfix`: false skips the service's replay verification (audited). */
45
- verifyReplay?: boolean;
46
- /** With `--hotfix`: how long to wait for the replacement job, in milliseconds. */
47
- timeout?: string;
48
- }
49
- export type PushAction = 'created' | 'versioned' | 'unchanged' | 'would-create' | 'would-version';
50
- export interface PushItem {
51
- key: string;
52
- action: PushAction;
53
- fromVersion: string | null;
54
- toVersion: string | null;
55
- irHash: string;
56
- /** `workflowVersionDiff` entries after a push; the local diff on a dry run. */
57
- changes: Array<{
58
- path: string;
59
- kind: string;
60
- before?: unknown;
61
- after?: unknown;
62
- }>;
63
- truncated: boolean;
64
- warnings: string[];
65
- /** The code bundle the version references; null for a graph-only workflow. */
66
- bundle: {
67
- buildId: string;
68
- uploaded: boolean;
69
- } | null;
70
- }
71
- export interface PushResult {
72
- dryRun: boolean;
73
- buildId: string | null;
74
- sourceHash: string | null;
75
- workflows: PushItem[];
76
- }
77
- /** The sentence `push` and `validate` give for durable-function findings. */
78
- export declare function durableSummary(issues: readonly DurableIssue[]): string;
79
- /** Refuse a project with durable-function findings, before anything is written. */
80
- export declare function assertNoDurableIssues(issues: readonly DurableIssue[]): void;
81
- /** The `buildId` a definition's `code` block records. */
82
- export declare function codeBuildId(workflow: LocalWorkflow): string | undefined;
83
- /** What a push works from: the project, its lowering and the selected workflows. */
84
- export interface PushInputs {
85
- project: Project;
86
- lowered: LoweredProject;
87
- selected: LocalWorkflow[];
88
- remote: RemoteWorkflows;
89
- }
90
- /**
91
- * Load, lower and validate the project for a push (and a hotfix): connection
92
- * names resolve in the workspace, the named keys must exist, every selected
93
- * workflow must validate, and durable-function findings refuse the push.
94
- */
95
- export declare function loadPushInputs(env: CommandEnv, keys: readonly string[], options: PushOptions): Promise<PushInputs>;
96
- export declare function runPush(env: CommandEnv, keys: readonly string[], options: PushOptions): Promise<PushResult>;
97
- //# sourceMappingURL=push.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../../src/code-first/commands/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAcH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,eAAe,EAEhB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA0B,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAE5F,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gFAAgF;IAChF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,CAAC;AAElG,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC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
1
- /**
2
- * `fluidgrids push [key…] [--dry-run]`: lower the project locally and create a
3
- * version for every workflow whose IR changed (spec 07 §4, Phase A).
4
- *
5
- * - An existing key gets `createWorkflowVersion`; a new key gets `importWorkflow`
6
- * (a DRAFT, with the installed-node check and the workflow-count quota).
7
- * - Unchanged workflows (same `irHash` as the latest version) get no version.
8
- * - The result prints `workflowVersionDiff` between the previous latest version
9
- * and the new one.
10
- * - Connection names resolve in the target workspace; a name that does not
11
- * resolve fails the push before anything is written.
12
- * - Every workflow is validated locally first, so a push is all-or-nothing up
13
- * to the first service-side refusal.
14
- * - A workflow whose latest stored version is newer than the one `lock.json`
15
- * records (changed on the canvas or pushed from elsewhere since the pull) is
16
- * refused, unless `--force` is given, so a push never silently reverts it.
17
- *
18
- * Durable functions (Phase B, BOFF-9905):
19
- * - A workflow whose definition carries a `code` block (tier-2 `workflow()`
20
- * functions, or a tier-1 graph with `wf.codeWorkflow`) gets its version with
21
- * `codeBundle`: the bundle is uploaded through `prepareWorkflowCodeUpload`
22
- * (see `code-upload.ts`). One bundle serves every version of the push.
23
- * - Findings in the sources (`durable.phaseC`, `durable.activityTypeNotAllowed`)
24
- * refuse the push before anything is written. Python durable functions are
25
- * Phase C.
26
- * - `--hotfix <version>` replaces the bundle of an existing version instead
27
- * (see `hotfix.ts`).
28
- * - `lock.json` records `{buildId, sourceHash, sdkVersion}` of the bundle and
29
- * the `buildId` of each version that references it.
30
- */
31
- import { diffDefinitions, irHash, validate } from '@fluidgrids/workflows/ir';
32
- import { CliUserError } from '@burdenoff/cli-sdk/core';
33
- import { bundleCodeBlock, codeBundleInput, prepareBundle, uploadBundle, } from '../code-upload.js';
34
- import { explainUnresolved } from '../connections.js';
35
- import { lowerProject, } from '../lowering.js';
36
- import { assertProjectWorkspace, loadProject, writeLock, } from '../project.js';
37
- import { comparableRemote, outgoingDefinition, projectConnectionIndex, RemoteWorkflows, sameContent, } from '../remote.js';
38
- import { emit, requireKnownKeys } from '../shared.js';
39
- /** The sentence `push` and `validate` give for durable-function findings. */
40
- export function durableSummary(issues) {
41
- return issues.some((issue) => issue.code === 'durable.phaseC')
42
- ? 'The project uses durable-function features that arrive in Phase C'
43
- : 'The project uses durable-function features this release refuses';
44
- }
45
- /** Refuse a project with durable-function findings, before anything is written. */
46
- export function assertNoDurableIssues(issues) {
47
- if (issues.length === 0)
48
- return;
49
- const lines = issues.map((issue) => `${issue.key ? `${issue.key}: ` : ''}${issue.code}: ${issue.message}`);
50
- throw new CliUserError(`${durableSummary(issues)}; nothing was pushed.`, {
51
- hint: lines.join('\n'),
52
- });
53
- }
54
- function localChanges(changes) {
55
- return changes.map((change) => ({
56
- path: change.path,
57
- kind: change.kind.toUpperCase(),
58
- ...(change.before !== undefined ? { before: change.before } : {}),
59
- ...(change.after !== undefined ? { after: change.after } : {}),
60
- }));
61
- }
62
- function lockEntry(workflow, version, hash) {
63
- const buildId = workflow.durable ? codeBuildId(workflow) : undefined;
64
- return {
65
- version,
66
- irHash: hash,
67
- format: workflow.format,
68
- path: workflow.path,
69
- ...(buildId ? { buildId } : {}),
70
- };
71
- }
72
- function isRecord(value) {
73
- return typeof value === 'object' && value !== null && !Array.isArray(value);
74
- }
75
- /** The `buildId` a definition's `code` block records. */
76
- export function codeBuildId(workflow) {
77
- const code = workflow.definition['code'];
78
- if (!isRecord(code))
79
- return undefined;
80
- const buildId = code['buildId'];
81
- return typeof buildId === 'string' ? buildId : undefined;
82
- }
83
- function validationErrors(workflows) {
84
- const errors = [];
85
- for (const workflow of workflows) {
86
- const result = validate(workflow.definition);
87
- for (const issue of result.errors) {
88
- const where = [issue.nodeId, issue.path].filter(Boolean).join(' ');
89
- errors.push(`${workflow.key}: ${issue.code}${where ? ` (${where})` : ''}: ${issue.message}`);
90
- }
91
- }
92
- return errors;
93
- }
94
- /**
95
- * Load, lower and validate the project for a push (and a hotfix): connection
96
- * names resolve in the workspace, the named keys must exist, every selected
97
- * workflow must validate, and durable-function findings refuse the push.
98
- */
99
- export async function loadPushInputs(env, keys, options) {
100
- const project = loadProject(options.project, env.cwd());
101
- assertProjectWorkspace(env, project);
102
- const remote = new RemoteWorkflows(env.api, 'latest');
103
- const index = await projectConnectionIndex(env.api, project, keys, remote);
104
- const lowered = await lowerProject(project, {
105
- connections: (name) => (Object.hasOwn(index.refs, name) ? index.refs[name] : undefined),
106
- connectionNames: Object.keys(index.refs),
107
- explainUnresolved: (names) => explainUnresolved(names, index),
108
- });
109
- const defined = lowered.workflows.map((workflow) => workflow.key);
110
- requireKnownKeys(keys, defined);
111
- const selected = keys.length > 0
112
- ? lowered.workflows.filter((workflow) => keys.includes(workflow.key))
113
- : lowered.workflows;
114
- if (selected.length === 0) {
115
- throw new CliUserError('The project defines no workflows to push.', {
116
- hint: 'Add workflows/<key>.ts|.py, or pull one with `fluidgrids pull <key>`.',
117
- });
118
- }
119
- // Phase C features first: their definitions may not validate in this release.
120
- assertNoDurableIssues(lowered.issues);
121
- const errors = validationErrors(selected);
122
- if (errors.length > 0) {
123
- throw new CliUserError(`Validation failed; nothing was pushed.`, { hint: errors.join('\n') });
124
- }
125
- return { project, lowered, selected, remote };
126
- }
127
- export async function runPush(env, keys, options) {
128
- if (options.hotfix !== undefined) {
129
- throw new CliUserError('`--hotfix` is handled by runHotfix.');
130
- }
131
- const { project, lowered, selected, remote } = await loadPushInputs(env, keys, options);
132
- // A workflow that changed in the workspace after the project pulled it (a
133
- // canvas edit, someone else's push) would get a version built from the local
134
- // code alone, silently reverting those changes. Refuse before anything is
135
- // written, unless --force says to push over them.
136
- const stale = new Map();
137
- for (const workflow of selected) {
138
- const tracked = project.lock.workflows[workflow.key];
139
- const base = (await remote.get(workflow.key)).export;
140
- if (!tracked || !base || tracked.version === base.version)
141
- continue;
142
- const baseDefinition = comparableRemote(base.definitionJson, workflow.key);
143
- if (sameContent(outgoingDefinition(workflow.definition, baseDefinition), baseDefinition)) {
144
- continue;
145
- }
146
- stale.set(workflow.key, `${workflow.key} was pulled as ${tracked.version}, but the workspace now has ${base.version}`);
147
- }
148
- if (stale.size > 0 && !options.force && !options.dryRun) {
149
- throw new CliUserError('The workspace changed since the last pull; nothing was pushed.', {
150
- hint: [
151
- ...stale.values(),
152
- 'Run `fluidgrids pull <key>` and re-apply the local edits, or pass --force to push over the newer versions.',
153
- ].join('\n'),
154
- });
155
- }
156
- const bundleOf = (workflow, uploaded) => workflow.durable && lowered.buildId ? { buildId: lowered.buildId, uploaded } : null;
157
- // Decide every workflow's action first, so the local refusals (bundle and
158
- // source-archive caps, a missing bundle, a buildId mismatch) happen before
159
- // the first version is written, and on a dry run too.
160
- const plans = [];
161
- for (const workflow of selected) {
162
- const base = (await remote.get(workflow.key)).export;
163
- const baseDefinition = base ? comparableRemote(base.definitionJson, workflow.key) : undefined;
164
- const outgoing = outgoingDefinition(workflow.definition, baseDefinition);
165
- plans.push({
166
- workflow,
167
- base,
168
- baseDefinition,
169
- outgoing,
170
- unchanged: baseDefinition !== undefined && sameContent(outgoing, baseDefinition),
171
- });
172
- }
173
- const toWrite = plans.filter((plan) => !plan.unchanged && plan.workflow.durable);
174
- const prepared = toWrite.length > 0 ? prepareBundle(project, lowered) : undefined;
175
- if (prepared) {
176
- for (const plan of toWrite)
177
- bundleCodeBlock(plan.workflow, prepared);
178
- }
179
- const items = [];
180
- for (const { workflow, base, baseDefinition, outgoing, unchanged } of plans) {
181
- const hash = irHash(outgoing);
182
- const staleness = stale.get(workflow.key);
183
- const warnings = staleness
184
- ? [options.force ? `${staleness}; pushed over it (--force)` : staleness]
185
- : [];
186
- if (unchanged) {
187
- items.push({
188
- key: workflow.key,
189
- action: 'unchanged',
190
- fromVersion: base?.version ?? null,
191
- toVersion: base?.version ?? null,
192
- irHash: hash,
193
- changes: [],
194
- truncated: false,
195
- warnings,
196
- bundle: bundleOf(workflow, false),
197
- });
198
- continue;
199
- }
200
- if (options.dryRun) {
201
- items.push({
202
- key: workflow.key,
203
- action: base ? 'would-version' : 'would-create',
204
- fromVersion: base?.version ?? null,
205
- toVersion: null,
206
- irHash: hash,
207
- changes: baseDefinition ? localChanges(diffDefinitions(baseDefinition, outgoing)) : [],
208
- truncated: false,
209
- warnings,
210
- bundle: bundleOf(workflow, false),
211
- });
212
- continue;
213
- }
214
- const description = options.message;
215
- let codeBundle;
216
- let uploaded = false;
217
- if (workflow.durable && prepared) {
218
- const upload = await uploadBundle(env, prepared, workflow.key);
219
- uploaded = upload.bundleSent;
220
- codeBundle = codeBundleInput(upload.uploadId, workflow, prepared);
221
- }
222
- if (base) {
223
- const saved = await env.api.createWorkflowVersion(workflow.key, {
224
- definitionJson: outgoing,
225
- ...(description ? { description } : {}),
226
- ...(codeBundle ? { codeBundle } : {}),
227
- });
228
- warnings.push(...saved.validationWarnings);
229
- const diff = await env.api.workflowVersionDiff(workflow.key, base.version, saved.version);
230
- items.push({
231
- key: workflow.key,
232
- action: 'versioned',
233
- fromVersion: base.version,
234
- toVersion: saved.version,
235
- irHash: hash,
236
- changes: diff.entries,
237
- truncated: diff.truncated,
238
- warnings,
239
- bundle: bundleOf(workflow, uploaded),
240
- });
241
- project.lock.workflows[workflow.key] = lockEntry(workflow, saved.version, hash);
242
- }
243
- else {
244
- const name = typeof workflow.definition['name'] === 'string' && workflow.definition['name'] !== ''
245
- ? workflow.definition['name']
246
- : workflow.key;
247
- const saved = await env.api.importWorkflow({
248
- definitionJson: outgoing,
249
- name,
250
- workflowKey: workflow.key,
251
- ...(description ? { description } : {}),
252
- ...(codeBundle ? { codeBundle } : {}),
253
- });
254
- warnings.push(...saved.validationWarnings);
255
- items.push({
256
- key: workflow.key,
257
- action: 'created',
258
- fromVersion: null,
259
- toVersion: saved.version,
260
- irHash: hash,
261
- changes: [],
262
- truncated: false,
263
- warnings,
264
- bundle: bundleOf(workflow, uploaded),
265
- });
266
- project.lock.workflows[workflow.key] = lockEntry(workflow, saved.version, hash);
267
- }
268
- if (prepared && workflow.durable) {
269
- project.lock.bundle = {
270
- buildId: prepared.buildId,
271
- sourceHash: prepared.sourceHash,
272
- sdkVersion: prepared.sdkVersion,
273
- };
274
- }
275
- // Written after every version, so a later failure leaves the lock true to the workspace.
276
- writeLock(project);
277
- }
278
- const result = {
279
- dryRun: options.dryRun === true,
280
- buildId: lowered.buildId ?? null,
281
- sourceHash: lowered.sourceHash ?? null,
282
- workflows: items,
283
- };
284
- const details = [];
285
- for (const item of items) {
286
- for (const change of item.changes)
287
- details.push(`${item.key}: ${change.kind} ${change.path}`);
288
- if (item.truncated)
289
- details.push(`${item.key}: the diff was truncated by the service`);
290
- for (const warning of item.warnings)
291
- details.push(`${item.key}: warning: ${warning}`);
292
- }
293
- details.push(...lowered.warnings);
294
- if (result.buildId)
295
- details.push(`buildId ${result.buildId}`);
296
- for (const item of items) {
297
- if (item.bundle) {
298
- details.push(`${item.key}: code bundle ${item.bundle.buildId}${item.bundle.uploaded ? ' (uploaded)' : ''}`);
299
- }
300
- }
301
- emit(env, options, result, {
302
- headers: ['Workflow', 'Action', 'From', 'To', 'Changes'],
303
- rows: items.map((item) => [
304
- item.key,
305
- item.action,
306
- item.fromVersion ?? '-',
307
- item.toVersion ?? '-',
308
- String(item.changes.length),
309
- ]),
310
- }, details);
311
- return result;
312
- }
313
- //# sourceMappingURL=push.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/code-first/commands/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAyB,MAAM,0BAA0B,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,OAAO,EACL,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,GAEb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,YAAY,GAIb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX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AC"}
@@ -1,44 +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 { 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
@@ -1 +0,0 @@
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"}