@fluidgrids/cli 2026.1021.1 → 2026.1028.2

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 (134) hide show
  1. package/README.md +157 -5
  2. package/dist/auth/device-login.d.ts +31 -0
  3. package/dist/auth/device-login.d.ts.map +1 -0
  4. package/dist/auth/device-login.js +75 -0
  5. package/dist/auth/device-login.js.map +1 -0
  6. package/dist/auth/token-auth.d.ts +49 -0
  7. package/dist/auth/token-auth.d.ts.map +1 -0
  8. package/dist/auth/token-auth.js +279 -0
  9. package/dist/auth/token-auth.js.map +1 -0
  10. package/dist/cli.d.ts +4 -5
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +18 -32
  13. package/dist/cli.js.map +1 -1
  14. package/dist/code-first/api.d.ts +357 -0
  15. package/dist/code-first/api.d.ts.map +1 -0
  16. package/dist/code-first/api.js +288 -0
  17. package/dist/code-first/api.js.map +1 -0
  18. package/dist/code-first/code-upload.d.ts +52 -0
  19. package/dist/code-first/code-upload.d.ts.map +1 -0
  20. package/dist/code-first/code-upload.js +161 -0
  21. package/dist/code-first/code-upload.js.map +1 -0
  22. package/dist/code-first/commands/codegen.d.ts +20 -0
  23. package/dist/code-first/commands/codegen.d.ts.map +1 -0
  24. package/dist/code-first/commands/codegen.js +50 -0
  25. package/dist/code-first/commands/codegen.js.map +1 -0
  26. package/dist/code-first/commands/diff.d.ts +28 -0
  27. package/dist/code-first/commands/diff.d.ts.map +1 -0
  28. package/dist/code-first/commands/diff.js +73 -0
  29. package/dist/code-first/commands/diff.js.map +1 -0
  30. package/dist/code-first/commands/hotfix.d.ts +54 -0
  31. package/dist/code-first/commands/hotfix.d.ts.map +1 -0
  32. package/dist/code-first/commands/hotfix.js +225 -0
  33. package/dist/code-first/commands/hotfix.js.map +1 -0
  34. package/dist/code-first/commands/import.d.ts +40 -0
  35. package/dist/code-first/commands/import.d.ts.map +1 -0
  36. package/dist/code-first/commands/import.js +235 -0
  37. package/dist/code-first/commands/import.js.map +1 -0
  38. package/dist/code-first/commands/init.d.ts +33 -0
  39. package/dist/code-first/commands/init.d.ts.map +1 -0
  40. package/dist/code-first/commands/init.js +177 -0
  41. package/dist/code-first/commands/init.js.map +1 -0
  42. package/dist/code-first/commands/interface.d.ts +12 -0
  43. package/dist/code-first/commands/interface.d.ts.map +1 -0
  44. package/dist/code-first/commands/interface.js +21 -0
  45. package/dist/code-first/commands/interface.js.map +1 -0
  46. package/dist/code-first/commands/pull.d.ts +63 -0
  47. package/dist/code-first/commands/pull.d.ts.map +1 -0
  48. package/dist/code-first/commands/pull.js +266 -0
  49. package/dist/code-first/commands/pull.js.map +1 -0
  50. package/dist/code-first/commands/push.d.ts +97 -0
  51. package/dist/code-first/commands/push.d.ts.map +1 -0
  52. package/dist/code-first/commands/push.js +313 -0
  53. package/dist/code-first/commands/push.js.map +1 -0
  54. package/dist/code-first/commands/replay.d.ts +44 -0
  55. package/dist/code-first/commands/replay.d.ts.map +1 -0
  56. package/dist/code-first/commands/replay.js +238 -0
  57. package/dist/code-first/commands/replay.js.map +1 -0
  58. package/dist/code-first/commands/runs.d.ts +94 -0
  59. package/dist/code-first/commands/runs.d.ts.map +1 -0
  60. package/dist/code-first/commands/runs.js +304 -0
  61. package/dist/code-first/commands/runs.js.map +1 -0
  62. package/dist/code-first/commands/validate.d.ts +38 -0
  63. package/dist/code-first/commands/validate.d.ts.map +1 -0
  64. package/dist/code-first/commands/validate.js +140 -0
  65. package/dist/code-first/commands/validate.js.map +1 -0
  66. package/dist/code-first/commands/versions.d.ts +14 -0
  67. package/dist/code-first/commands/versions.d.ts.map +1 -0
  68. package/dist/code-first/commands/versions.js +30 -0
  69. package/dist/code-first/commands/versions.js.map +1 -0
  70. package/dist/code-first/connections.d.ts +55 -0
  71. package/dist/code-first/connections.d.ts.map +1 -0
  72. package/dist/code-first/connections.js +180 -0
  73. package/dist/code-first/connections.js.map +1 -0
  74. package/dist/code-first/durable-operations.d.ts +42 -0
  75. package/dist/code-first/durable-operations.d.ts.map +1 -0
  76. package/dist/code-first/durable-operations.js +136 -0
  77. package/dist/code-first/durable-operations.js.map +1 -0
  78. package/dist/code-first/history.d.ts +30 -0
  79. package/dist/code-first/history.d.ts.map +1 -0
  80. package/dist/code-first/history.js +139 -0
  81. package/dist/code-first/history.js.map +1 -0
  82. package/dist/code-first/imports.d.ts +22 -0
  83. package/dist/code-first/imports.d.ts.map +1 -0
  84. package/dist/code-first/imports.js +67 -0
  85. package/dist/code-first/imports.js.map +1 -0
  86. package/dist/code-first/index.d.ts +17 -0
  87. package/dist/code-first/index.d.ts.map +1 -0
  88. package/dist/code-first/index.js +35 -0
  89. package/dist/code-first/index.js.map +1 -0
  90. package/dist/code-first/lowering.d.ts +81 -0
  91. package/dist/code-first/lowering.d.ts.map +1 -0
  92. package/dist/code-first/lowering.js +225 -0
  93. package/dist/code-first/lowering.js.map +1 -0
  94. package/dist/code-first/operations.d.ts +57 -0
  95. package/dist/code-first/operations.d.ts.map +1 -0
  96. package/dist/code-first/operations.js +167 -0
  97. package/dist/code-first/operations.js.map +1 -0
  98. package/dist/code-first/presigned.d.ts +21 -0
  99. package/dist/code-first/presigned.d.ts.map +1 -0
  100. package/dist/code-first/presigned.js +85 -0
  101. package/dist/code-first/presigned.js.map +1 -0
  102. package/dist/code-first/project.d.ts +123 -0
  103. package/dist/code-first/project.d.ts.map +1 -0
  104. package/dist/code-first/project.js +301 -0
  105. package/dist/code-first/project.js.map +1 -0
  106. package/dist/code-first/python.d.ts +81 -0
  107. package/dist/code-first/python.d.ts.map +1 -0
  108. package/dist/code-first/python.js +249 -0
  109. package/dist/code-first/python.js.map +1 -0
  110. package/dist/code-first/register.d.ts +27 -0
  111. package/dist/code-first/register.d.ts.map +1 -0
  112. package/dist/code-first/register.js +270 -0
  113. package/dist/code-first/register.js.map +1 -0
  114. package/dist/code-first/remote.d.ts +58 -0
  115. package/dist/code-first/remote.d.ts.map +1 -0
  116. package/dist/code-first/remote.js +126 -0
  117. package/dist/code-first/remote.js.map +1 -0
  118. package/dist/code-first/replay.d.ts +36 -0
  119. package/dist/code-first/replay.d.ts.map +1 -0
  120. package/dist/code-first/replay.js +52 -0
  121. package/dist/code-first/replay.js.map +1 -0
  122. package/dist/code-first/shared.d.ts +51 -0
  123. package/dist/code-first/shared.d.ts.map +1 -0
  124. package/dist/code-first/shared.js +93 -0
  125. package/dist/code-first/shared.js.map +1 -0
  126. package/dist/modules.d.ts +4 -0
  127. package/dist/modules.d.ts.map +1 -1
  128. package/dist/modules.js +6 -0
  129. package/dist/modules.js.map +1 -1
  130. package/dist/program.d.ts +20 -0
  131. package/dist/program.d.ts.map +1 -0
  132. package/dist/program.js +43 -0
  133. package/dist/program.js.map +1 -0
  134. package/package.json +3 -1
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Replaying histories against the project's code bundle (spec 10 §1, C-ABI).
3
+ *
4
+ * - Default engine: a fresh Node `vm` context with the SDK's task prelude
5
+ * (`runWorkflowTaskInVm`), fast and good for development.
6
+ * - `--isolate`: the QuickJS runner the managed workers and the service use
7
+ * (`createWorkflowTaskRunner`), so a pass here is a pass there.
8
+ *
9
+ * Both run a `verify` task request over the whole history and report
10
+ * `NON_DETERMINISM` when the code no longer produces the recorded commands.
11
+ */
12
+ import { createWorkflowTaskRunner } from '@fluidgrids/workflows/quickjs';
13
+ import { bundleToScript, replayRequest, runWorkflowTaskInVm } from '@fluidgrids/workflows/testing';
14
+ /** A replayer for `bundle` (verified against `buildId` in the isolate). */
15
+ export async function createReplayer(bundle, buildId, engine) {
16
+ const toOutcome = (file, name, result) => ({
17
+ name,
18
+ workflowFn: file.workflowFn,
19
+ events: file.events.length,
20
+ engine,
21
+ ok: result.outcome !== 'failed',
22
+ cause: result.outcome === 'failed' ? (result.failure?.cause ?? 'INTERNAL') : null,
23
+ message: result.outcome === 'failed' ? (result.failure?.message ?? '') : null,
24
+ seq: result.failure?.seq ?? null,
25
+ result,
26
+ });
27
+ const request = (file) => replayRequest(file.workflowFn, file.events, file.info ?? {}, file.nowMs);
28
+ if (engine === 'quickjs') {
29
+ const runner = createWorkflowTaskRunner({ poolSize: 1 });
30
+ return {
31
+ async replay(file, name) {
32
+ return toOutcome(file, name, await runner.run({ code: bundle, buildId }, request(file)));
33
+ },
34
+ close: () => runner.close(),
35
+ };
36
+ }
37
+ const script = await bundleToScript(bundle);
38
+ return {
39
+ async replay(file, name) {
40
+ return toOutcome(file, name, await runWorkflowTaskInVm(script, request(file)));
41
+ },
42
+ close: () => Promise.resolve(),
43
+ };
44
+ }
45
+ /** One line per failed replay, for hints and details. */
46
+ export function describeOutcome(outcome) {
47
+ if (outcome.ok)
48
+ return `${outcome.name}: ok (${outcome.events} events, ${outcome.engine})`;
49
+ const at = outcome.seq !== null ? ` at event ${outcome.seq}` : '';
50
+ return `${outcome.name}: ${outcome.cause ?? 'INTERNAL'}${at}: ${outcome.message ?? ''}`;
51
+ }
52
+ //# sourceMappingURL=replay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay.js","sourceRoot":"","sources":["../../src/code-first/replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAwBnG,2EAA2E;AAC3E,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,OAAe,EACf,MAAoB;IAEpB,MAAM,SAAS,GAAG,CAChB,IAAiB,EACjB,IAAY,EACZ,MAA0B,EACX,EAAE,CAAC,CAAC;QACnB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;QAC1B,MAAM;QACN,EAAE,EAAE,MAAM,CAAC,OAAO,KAAK,QAAQ;QAC/B,KAAK,EAAE,MAAM,CAAC,OAAO,KAAK,QAAQ,CAAC,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AG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,eAAe,CAAC,OAAsB;IACpD,IAAI,OAAO,CAAC,EAAE;QAAE,OAAO,GAAG,OAAO,CAAC,IAAI,SAAS,OAAO,CAAC,MAAM,YAAY,OAAO,CAAC,MAAM,GAAG,CAAC;IAC3F,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,OAAO,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,KAAK,IAAI,UAAU,GAAG,EAAE,KAAK,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,51 @@
1
+ /** Helpers shared by the code-first commands. */
2
+ import { type CLIContext, type TableConfig } from '@burdenoff/cli-sdk/core';
3
+ import type { Command } from 'commander';
4
+ import { type DeviceLoginResult } from '../auth/device-login.js';
5
+ import { type CodeFirstApi } from './api.js';
6
+ export interface OutputOptions {
7
+ format?: string;
8
+ }
9
+ export interface ProjectOptions extends OutputOptions {
10
+ project?: string;
11
+ }
12
+ /** Dependencies a command needs; tests substitute them. */
13
+ export interface CommandEnv {
14
+ ctx: CLIContext;
15
+ api: CodeFirstApi;
16
+ cwd: () => string;
17
+ /** True when a person can answer the device-code prompt (stdin and stdout are terminals). */
18
+ interactive: () => boolean;
19
+ /** The device-code login (`fluidgrids auth login`'s flow, without prompts). */
20
+ login: (workspaceId?: string) => Promise<DeviceLoginResult>;
21
+ /** HTTP for presigned code uploads and offloaded history payloads (never the gateway). */
22
+ fetch: (url: string, init?: Parameters<typeof fetch>[1]) => Promise<Response>;
23
+ /** Run a program with the terminal's stdio in `cwd`; resolves its exit status. */
24
+ exec: (command: string, args: readonly string[], cwd: string) => Promise<number>;
25
+ /** Wait between polls. */
26
+ sleep: (ms: number) => Promise<void>;
27
+ }
28
+ /** Run a program with inherited stdio; a missing program is a user error. */
29
+ export declare function execInherited(command: string, args: readonly string[], cwd: string): Promise<number>;
30
+ export declare function createCommandEnv(ctx: CLIContext): CommandEnv;
31
+ /**
32
+ * Print a result: the table plus detail lines for people, the data itself for
33
+ * `--format json|yaml` (where the details are already part of the data).
34
+ */
35
+ export declare function emit(env: CommandEnv, options: OutputOptions, data: unknown, table: TableConfig, details?: readonly string[]): void;
36
+ /**
37
+ * The command's options with the CLI-wide `-f/--format` filled in. Commander
38
+ * lets the program claim `-f` wherever it appears on the line, so a command's
39
+ * own `format` option can stay undefined; this reads the program's value then.
40
+ */
41
+ export declare function withGlobalFormat<T extends OutputOptions>(options: T, command: Command): T;
42
+ /** A closed-set option value; undefined passes through. */
43
+ export declare function parseChoice<T extends string>(raw: string | undefined, flag: string, allowed: readonly T[]): T | undefined;
44
+ /** Keys named on the command line that the local project does not define. */
45
+ export declare function requireKnownKeys(requested: readonly string[], known: readonly string[]): void;
46
+ /** A JSON option value (`--input`, `--payload`); any JSON value. */
47
+ export declare function parseJsonOption(raw: string | undefined, flag: string): unknown;
48
+ /** A positive integer option value. */
49
+ export declare function parsePositiveInt(raw: string | undefined, flag: string): number | undefined;
50
+ export declare function describeError(error: unknown): string;
51
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/code-first/shared.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAIjD,OAAO,EAAgB,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAEjE,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC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AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,CAIzF;AAED,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,SAAS,CAAC,EAAE,GACpB,CAAC,GAAG,SAAS,CAOf;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAQ7F;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAO9E;AAED,uCAAuC;AACvC,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM1F;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,93 @@
1
+ /** Helpers shared by the code-first commands. */
2
+ import { spawn } from 'child_process';
3
+ import { CliUserError } from '@burdenoff/cli-sdk/core';
4
+ import { deviceCodeLogin } from '../auth/device-login.js';
5
+ import { createCodeFirstApi } from './api.js';
6
+ /** Run a program with inherited stdio; a missing program is a user error. */
7
+ export function execInherited(command, args, cwd) {
8
+ return new Promise((resolve, reject) => {
9
+ const child = spawn(command, [...args], { cwd, stdio: 'inherit' });
10
+ child.on('error', (error) => {
11
+ reject(error.code === 'ENOENT'
12
+ ? new CliUserError(`${command} was not found on PATH.`)
13
+ : new CliUserError(`Could not start ${command}: ${error.message}`));
14
+ });
15
+ child.on('close', (code, signal) => resolve(code ?? (signal ? 1 : 0)));
16
+ });
17
+ }
18
+ export function createCommandEnv(ctx) {
19
+ return {
20
+ ctx,
21
+ api: createCodeFirstApi(ctx),
22
+ cwd: () => process.cwd(),
23
+ interactive: () => process.stdin.isTTY === true && process.stdout.isTTY === true,
24
+ login: (workspaceId) => deviceCodeLogin(ctx, workspaceId ? { workspaceId } : {}),
25
+ fetch: (url, init) => fetch(url, init),
26
+ exec: execInherited,
27
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
28
+ };
29
+ }
30
+ /**
31
+ * Print a result: the table plus detail lines for people, the data itself for
32
+ * `--format json|yaml` (where the details are already part of the data).
33
+ */
34
+ export function emit(env, options, data, table, details = []) {
35
+ const { output } = env.ctx;
36
+ output.formatAndOutput(options, data, table);
37
+ if (output.getFormat(options) === 'table') {
38
+ for (const line of details)
39
+ console.log(line);
40
+ }
41
+ }
42
+ /**
43
+ * The command's options with the CLI-wide `-f/--format` filled in. Commander
44
+ * lets the program claim `-f` wherever it appears on the line, so a command's
45
+ * own `format` option can stay undefined; this reads the program's value then.
46
+ */
47
+ export function withGlobalFormat(options, command) {
48
+ if (options.format !== undefined)
49
+ return options;
50
+ const format = command.optsWithGlobals()['format'];
51
+ return typeof format === 'string' ? { ...options, format } : options;
52
+ }
53
+ /** A closed-set option value; undefined passes through. */
54
+ export function parseChoice(raw, flag, allowed) {
55
+ if (raw === undefined)
56
+ return undefined;
57
+ const match = allowed.find((value) => value === raw);
58
+ if (match === undefined) {
59
+ throw new CliUserError(`Invalid value '${raw}' for ${flag}. Allowed: ${allowed.join(', ')}`);
60
+ }
61
+ return match;
62
+ }
63
+ /** Keys named on the command line that the local project does not define. */
64
+ export function requireKnownKeys(requested, known) {
65
+ const missing = requested.filter((key) => !known.includes(key));
66
+ if (missing.length > 0) {
67
+ throw new CliUserError(`Not defined in this project: ${missing.join(', ')}`, known.length > 0 ? { hint: `Defined here: ${known.join(', ')}` } : undefined);
68
+ }
69
+ }
70
+ /** A JSON option value (`--input`, `--payload`); any JSON value. */
71
+ export function parseJsonOption(raw, flag) {
72
+ if (raw === undefined)
73
+ return undefined;
74
+ try {
75
+ return JSON.parse(raw);
76
+ }
77
+ catch {
78
+ throw new CliUserError(`${flag} must be valid JSON.`);
79
+ }
80
+ }
81
+ /** A positive integer option value. */
82
+ export function parsePositiveInt(raw, flag) {
83
+ if (raw === undefined)
84
+ return undefined;
85
+ if (!/^\d+$/.test(raw) || Number(raw) <= 0 || !Number.isSafeInteger(Number(raw))) {
86
+ throw new CliUserError(`Invalid value '${raw}' for ${flag}: expected a positive integer.`);
87
+ }
88
+ return Number(raw);
89
+ }
90
+ export function describeError(error) {
91
+ return error instanceof Error ? error.message : String(error);
92
+ }
93
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/code-first/shared.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAqC,MAAM,yBAAyB,CAAC;AAG1F,OAAO,EAAE,eAAe,EAA0B,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAqB,MAAM,UAAU,CAAC;AA2BjE,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,IAAuB,EACvB,GAAW;IAEX,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACnE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAgC,EAAE,EAAE;YACrD,MAAM,CACJ,KAAK,CAAC,IAAI,KAAK,QAAQ;gBACrB,CAAC,CAAC,IAAI,YAAY,CAAC,GAAG,OAAO,yBAAyB,CAAC;gBACvD,CAAC,CAAC,IAAI,YAAY,CAAC,mBAAmB,OAAO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3
  * shared platform modules. Kept in one list so the shell and its tests mount
4
4
  * exactly the same surface.
5
5
  *
6
+ * `codeFirstModule` is product-local (src/code-first/): the code-first workflow
7
+ * commands depend on @fluidgrids/workflows, which other product CLIs must not
8
+ * pull in through cli-sdk.
9
+ *
6
10
  * Not mounted: `vibecontrols` (another product; it also owns a top-level
7
11
  * `webhooks` group) and `sandbox` (VibeControls dev environments).
8
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAwBzD,eAAO,MAAM,OAAO,EAAE,SAAS,SAAS,EAuBvC,CAAC"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AA0BzD,eAAO,MAAM,OAAO,EAAE,SAAS,SAAS,EAwBvC,CAAC"}
package/dist/modules.js CHANGED
@@ -3,6 +3,10 @@
3
3
  * shared platform modules. Kept in one list so the shell and its tests mount
4
4
  * exactly the same surface.
5
5
  *
6
+ * `codeFirstModule` is product-local (src/code-first/): the code-first workflow
7
+ * commands depend on @fluidgrids/workflows, which other product CLIs must not
8
+ * pull in through cli-sdk.
9
+ *
6
10
  * Not mounted: `vibecontrols` (another product; it also owns a top-level
7
11
  * `webhooks` group) and `sandbox` (VibeControls dev environments).
8
12
  */
@@ -28,6 +32,7 @@ import billingModule from '@burdenoff/cli-sdk/modules/billing';
28
32
  import storeModule from '@burdenoff/cli-sdk/modules/store';
29
33
  import devportalModule from '@burdenoff/cli-sdk/modules/devportal';
30
34
  import healthModule from '@burdenoff/cli-sdk/modules/health';
35
+ import codeFirstModule from './code-first/index.js';
31
36
  export const modules = [
32
37
  authModule,
33
38
  workspacesModule,
@@ -51,5 +56,6 @@ export const modules = [
51
56
  storeModule,
52
57
  devportalModule,
53
58
  healthModule,
59
+ codeFirstModule,
54
60
  ];
55
61
  //# sourceMappingURL=modules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,OAAO,gBAAgB,MAAM,uCAAuC,CAAC;AACrE,OAAO,mBAAmB,MAAM,0CAA0C,CAAC;AAC3E,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,OAAO,gBAAgB,MAAM,uCAAuC,CAAC;AACrE,OAAO,UAAU,MAAM,iCAAiC,CAAC;AACzD,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,YAAY,MAAM,mCAAmC,CAAC;AAC7D,OAAO,mBAAmB,MAAM,0CAA0C,CAAC;AAC3E,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,kBAAkB,MAAM,yCAAyC,CAAC;AACzE,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,eAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,YAAY,MAAM,mCAAmC,CAAC;AAC7D,OAAO,mBAAmB,MAAM,0CAA0C,CAAC;AAC3E,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,aAAa,MAAM,oCAAoC,CAAC;AAC/D,OAAO,WAAW,MAAM,kCAAkC,CAAC;AAC3D,OAAO,eAAe,MAAM,sCAAsC,CAAC;AACnE,OAAO,YAAY,MAAM,mCAAmC,CAAC;AAE7D,MAAM,CAAC,MAAM,OAAO,GAAyB;IAC3C,UAAU;IACV,gBAAgB;IAChB,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,YAAY;IACZ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B,mBAAmB;IACnB,WAAW;IACX,UAAU;IACV,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,YAAY;IACZ,mBAAmB;IACnB,cAAc;IACd,kBAAkB;IAClB,cAAc;IACd,eAAe;IACf,YAAY;IACZ,mBAAmB;IACnB,aAAa;IACb,cAAc;IACd,aAAa;IACb,WAAW;IACX,eAAe;IACf,YAAY;IACZ,eAAe;CAChB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Builds the FluidGrids CLI program: the CLIContext with product defaults
3
+ * (switched to token mode when FLUIDGRIDS_TOKEN / --token is set), the mounted
4
+ * modules, and the global options. `cli.ts` runs it; tests build it directly.
5
+ */
6
+ import { type CLIContext, type OutputAdapter, type ProgramFactoryResult } from '@burdenoff/cli-sdk/core';
7
+ export interface CreateCliOptions {
8
+ argv: readonly string[];
9
+ env: Readonly<Record<string, string | undefined>>;
10
+ version: string;
11
+ output?: OutputAdapter;
12
+ }
13
+ export interface FluidgridsCli extends ProgramFactoryResult {
14
+ ctx: CLIContext;
15
+ /** True when FLUIDGRIDS_TOKEN or --token supplied the credentials. */
16
+ tokenMode: boolean;
17
+ }
18
+ export declare const HELP_EXAMPLES: readonly string[];
19
+ export declare function createCli(options: CreateCliOptions): FluidgridsCli;
20
+ //# sourceMappingURL=program.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAMjC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACzD,GAAG,EAAE,UAAU,CAAC;IAChB,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAa1C,CAAC;AAEF,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAqBlE"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Builds the FluidGrids CLI program: the CLIContext with product defaults
3
+ * (switched to token mode when FLUIDGRIDS_TOKEN / --token is set), the mounted
4
+ * modules, and the global options. `cli.ts` runs it; tests build it directly.
5
+ */
6
+ import { buildContext, createProgram, } from '@burdenoff/cli-sdk/core';
7
+ import { applyTokenAuth, readTokenAuthSettings, TOKEN_FLAG } from './auth/token-auth.js';
8
+ import { modules } from './modules.js';
9
+ import { productDefaults } from './product-defaults.js';
10
+ export const HELP_EXAMPLES = [
11
+ '$ fluidgrids auth login # OAuth2 Device Code login',
12
+ '$ fluidgrids workspace set <id> # Pick workspace',
13
+ '$ fluidgrids workflows list --status ACTIVE # Workflow definitions',
14
+ '$ fluidgrids workflows trigger <key> --wf-version 1.0.0 --trigger-node start',
15
+ '$ fluidgrids runs wait <runId> # Block until a run finishes',
16
+ '$ fluidgrids init --lang ts # Code-first project',
17
+ '$ fluidgrids pull lead-enrichment --as ts # Workflow as TypeScript',
18
+ '$ fluidgrids push --dry-run # What a push would change',
19
+ '$ FLUIDGRIDS_TOKEN=... fluidgrids diff --exit-code # CI: non-interactive auth',
20
+ '',
21
+ 'Configuration: ~/.config/fluidgrids-cli/ (FLUIDGRIDS_TOKEN skips the stored login)',
22
+ 'Documentation: https://docs.fluidgrids.ai/developers/cli-reference',
23
+ ];
24
+ export function createCli(options) {
25
+ const settings = readTokenAuthSettings(options.argv, options.env);
26
+ const base = buildContext({
27
+ productName: 'fluidgrids',
28
+ productVersion: options.version,
29
+ defaults: productDefaults,
30
+ ...(options.output ? { output: options.output } : {}),
31
+ });
32
+ const ctx = settings ? applyTokenAuth(base, settings) : base;
33
+ const factory = createProgram(ctx, modules, {
34
+ name: 'fluidgrids',
35
+ description: 'FluidGrids CLI — workflow automation from the terminal',
36
+ version: options.version,
37
+ helpExamples: [...HELP_EXAMPLES],
38
+ });
39
+ // Read before the program parses (see readTokenAuthSettings); declared so commander accepts it.
40
+ factory.program.option(`${TOKEN_FLAG} <token>`, 'Platform access token for non-interactive use (prefer the FLUIDGRIDS_TOKEN variable)');
41
+ return { ...factory, ctx, tokenMode: settings !== null };
42
+ }
43
+ //# sourceMappingURL=program.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,YAAY,EACZ,aAAa,GAId,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAexD,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,iFAAiF;IACjF,uEAAuE;IACvE,6EAA6E;IAC7E,8EAA8E;IAC9E,mFAAmF;IACnF,2EAA2E;IAC3E,+EAA+E;IAC/E,iFAAiF;IACjF,iFAAiF;IACjF,EAAE;IACF,oFAAoF;IACpF,oEAAoE;CACrE,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAClE,MAAM,IAAI,GAAG,YAAY,CAAC;QACxB,WAAW,EAAE,YAAY;QACzB,cAAc,EAAE,OAAO,CAAC,OAAO;QAC/B,QAAQ,EAAE,eAAe;QACzB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtD,CAAC,CAAC;IACH,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE;QAC1C,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,CAAC,GAAG,aAAa,CAAC;KACjC,CAAC,CAAC;IACH,gGAAgG;IAChG,OAAO,CAAC,OAAO,CAAC,MAAM,CACpB,GAAG,UAAU,UAAU,EACvB,sFAAsF,CACvF,CAAC;IACF,OAAO,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,KAAK,IAAI,EAAE,CAAC;AAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidgrids/cli",
3
- "version": "2026.1021.1",
3
+ "version": "2026.1028.2",
4
4
  "description": "CLI tool for FluidGrids — workflow automation management (thin shell over @burdenoff/cli-sdk)",
5
5
  "type": "module",
6
6
  "private": false,
@@ -24,6 +24,7 @@
24
24
  "format": "prettier --write \"src/**/*.{ts,js,json,md}\" \"tests/**/*.{ts,js,json,md}\"",
25
25
  "format:check": "prettier --check \"src/**/*.{ts,js,json,md}\" \"tests/**/*.{ts,js,json,md}\"",
26
26
  "type-check": "bash scripts/build-limits.sh tsc --noEmit",
27
+ "schema:pull": "bash scripts/schema-pull.sh",
27
28
  "clean": "rimraf dist",
28
29
  "sanity": "bash scripts/build-limits.sh --gate bash -c 'bun run format:check && bun run lint:sanity && bun run type-check && bun run test && bun run build'",
29
30
  "prepublishOnly": "bun run clean && bun run build",
@@ -55,6 +56,7 @@
55
56
  },
56
57
  "dependencies": {
57
58
  "@burdenoff/cli-sdk": "^2026.1021.2",
59
+ "@fluidgrids/workflows": "2026.1028.2",
58
60
  "commander": "^14.0.3",
59
61
  "graphql": "^16.13.2",
60
62
  "graphql-request": "^7.4.0"