@fluidgrids/cli 2026.1108.1 → 2026.1110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +9708 -33
  3. package/package.json +37 -33
  4. package/dist/auth/device-login.d.ts +0 -31
  5. package/dist/auth/device-login.d.ts.map +0 -1
  6. package/dist/auth/device-login.js +0 -75
  7. package/dist/auth/device-login.js.map +0 -1
  8. package/dist/auth/token-auth.d.ts +0 -49
  9. package/dist/auth/token-auth.d.ts.map +0 -1
  10. package/dist/auth/token-auth.js +0 -279
  11. package/dist/auth/token-auth.js.map +0 -1
  12. package/dist/cli.d.ts +0 -10
  13. package/dist/cli.d.ts.map +0 -1
  14. package/dist/cli.js.map +0 -1
  15. package/dist/code-first/api.d.ts +0 -607
  16. package/dist/code-first/api.d.ts.map +0 -1
  17. package/dist/code-first/api.js +0 -438
  18. package/dist/code-first/api.js.map +0 -1
  19. package/dist/code-first/code-upload.d.ts +0 -68
  20. package/dist/code-first/code-upload.d.ts.map +0 -1
  21. package/dist/code-first/code-upload.js +0 -223
  22. package/dist/code-first/code-upload.js.map +0 -1
  23. package/dist/code-first/commands/codegen.d.ts +0 -20
  24. package/dist/code-first/commands/codegen.d.ts.map +0 -1
  25. package/dist/code-first/commands/codegen.js +0 -50
  26. package/dist/code-first/commands/codegen.js.map +0 -1
  27. package/dist/code-first/commands/diff.d.ts +0 -28
  28. package/dist/code-first/commands/diff.d.ts.map +0 -1
  29. package/dist/code-first/commands/diff.js +0 -73
  30. package/dist/code-first/commands/diff.js.map +0 -1
  31. package/dist/code-first/commands/hotfix.d.ts +0 -55
  32. package/dist/code-first/commands/hotfix.d.ts.map +0 -1
  33. package/dist/code-first/commands/hotfix.js +0 -231
  34. package/dist/code-first/commands/hotfix.js.map +0 -1
  35. package/dist/code-first/commands/import.d.ts +0 -40
  36. package/dist/code-first/commands/import.d.ts.map +0 -1
  37. package/dist/code-first/commands/import.js +0 -235
  38. package/dist/code-first/commands/import.js.map +0 -1
  39. package/dist/code-first/commands/init.d.ts +0 -33
  40. package/dist/code-first/commands/init.d.ts.map +0 -1
  41. package/dist/code-first/commands/init.js +0 -177
  42. package/dist/code-first/commands/init.js.map +0 -1
  43. package/dist/code-first/commands/interface.d.ts +0 -12
  44. package/dist/code-first/commands/interface.d.ts.map +0 -1
  45. package/dist/code-first/commands/interface.js +0 -21
  46. package/dist/code-first/commands/interface.js.map +0 -1
  47. package/dist/code-first/commands/pull.d.ts +0 -63
  48. package/dist/code-first/commands/pull.d.ts.map +0 -1
  49. package/dist/code-first/commands/pull.js +0 -266
  50. package/dist/code-first/commands/pull.js.map +0 -1
  51. package/dist/code-first/commands/push.d.ts +0 -104
  52. package/dist/code-first/commands/push.d.ts.map +0 -1
  53. package/dist/code-first/commands/push.js +0 -320
  54. package/dist/code-first/commands/push.js.map +0 -1
  55. package/dist/code-first/commands/replay.d.ts +0 -44
  56. package/dist/code-first/commands/replay.d.ts.map +0 -1
  57. package/dist/code-first/commands/replay.js +0 -271
  58. package/dist/code-first/commands/replay.js.map +0 -1
  59. package/dist/code-first/commands/runs.d.ts +0 -168
  60. package/dist/code-first/commands/runs.d.ts.map +0 -1
  61. package/dist/code-first/commands/runs.js +0 -598
  62. package/dist/code-first/commands/runs.js.map +0 -1
  63. package/dist/code-first/commands/suite.d.ts +0 -57
  64. package/dist/code-first/commands/suite.d.ts.map +0 -1
  65. package/dist/code-first/commands/suite.js +0 -197
  66. package/dist/code-first/commands/suite.js.map +0 -1
  67. package/dist/code-first/commands/validate.d.ts +0 -38
  68. package/dist/code-first/commands/validate.d.ts.map +0 -1
  69. package/dist/code-first/commands/validate.js +0 -140
  70. package/dist/code-first/commands/validate.js.map +0 -1
  71. package/dist/code-first/commands/versions.d.ts +0 -63
  72. package/dist/code-first/commands/versions.d.ts.map +0 -1
  73. package/dist/code-first/commands/versions.js +0 -204
  74. package/dist/code-first/commands/versions.js.map +0 -1
  75. package/dist/code-first/connections.d.ts +0 -55
  76. package/dist/code-first/connections.d.ts.map +0 -1
  77. package/dist/code-first/connections.js +0 -180
  78. package/dist/code-first/connections.js.map +0 -1
  79. package/dist/code-first/durable-operations.d.ts +0 -41
  80. package/dist/code-first/durable-operations.d.ts.map +0 -1
  81. package/dist/code-first/durable-operations.js +0 -135
  82. package/dist/code-first/durable-operations.js.map +0 -1
  83. package/dist/code-first/history.d.ts +0 -30
  84. package/dist/code-first/history.d.ts.map +0 -1
  85. package/dist/code-first/history.js +0 -139
  86. package/dist/code-first/history.js.map +0 -1
  87. package/dist/code-first/imports.d.ts +0 -22
  88. package/dist/code-first/imports.d.ts.map +0 -1
  89. package/dist/code-first/imports.js +0 -67
  90. package/dist/code-first/imports.js.map +0 -1
  91. package/dist/code-first/index.d.ts +0 -18
  92. package/dist/code-first/index.d.ts.map +0 -1
  93. package/dist/code-first/index.js +0 -36
  94. package/dist/code-first/index.js.map +0 -1
  95. package/dist/code-first/junit.d.ts +0 -24
  96. package/dist/code-first/junit.d.ts.map +0 -1
  97. package/dist/code-first/junit.js +0 -163
  98. package/dist/code-first/junit.js.map +0 -1
  99. package/dist/code-first/lowering.d.ts +0 -104
  100. package/dist/code-first/lowering.d.ts.map +0 -1
  101. package/dist/code-first/lowering.js +0 -254
  102. package/dist/code-first/lowering.js.map +0 -1
  103. package/dist/code-first/operations.d.ts +0 -55
  104. package/dist/code-first/operations.d.ts.map +0 -1
  105. package/dist/code-first/operations.js +0 -165
  106. package/dist/code-first/operations.js.map +0 -1
  107. package/dist/code-first/parity-operations.d.ts +0 -44
  108. package/dist/code-first/parity-operations.d.ts.map +0 -1
  109. package/dist/code-first/parity-operations.js +0 -211
  110. package/dist/code-first/parity-operations.js.map +0 -1
  111. package/dist/code-first/parity.d.ts +0 -83
  112. package/dist/code-first/parity.d.ts.map +0 -1
  113. package/dist/code-first/parity.js +0 -301
  114. package/dist/code-first/parity.js.map +0 -1
  115. package/dist/code-first/presigned.d.ts +0 -21
  116. package/dist/code-first/presigned.d.ts.map +0 -1
  117. package/dist/code-first/presigned.js +0 -85
  118. package/dist/code-first/presigned.js.map +0 -1
  119. package/dist/code-first/project.d.ts +0 -130
  120. package/dist/code-first/project.d.ts.map +0 -1
  121. package/dist/code-first/project.js +0 -308
  122. package/dist/code-first/project.js.map +0 -1
  123. package/dist/code-first/python-build.d.ts +0 -78
  124. package/dist/code-first/python-build.d.ts.map +0 -1
  125. package/dist/code-first/python-build.js +0 -268
  126. package/dist/code-first/python-build.js.map +0 -1
  127. package/dist/code-first/python.d.ts +0 -103
  128. package/dist/code-first/python.d.ts.map +0 -1
  129. package/dist/code-first/python.js +0 -260
  130. package/dist/code-first/python.js.map +0 -1
  131. package/dist/code-first/redact.d.ts +0 -31
  132. package/dist/code-first/redact.d.ts.map +0 -1
  133. package/dist/code-first/redact.js +0 -159
  134. package/dist/code-first/redact.js.map +0 -1
  135. package/dist/code-first/register.d.ts +0 -35
  136. package/dist/code-first/register.d.ts.map +0 -1
  137. package/dist/code-first/register.js +0 -420
  138. package/dist/code-first/register.js.map +0 -1
  139. package/dist/code-first/remote.d.ts +0 -58
  140. package/dist/code-first/remote.d.ts.map +0 -1
  141. package/dist/code-first/remote.js +0 -126
  142. package/dist/code-first/remote.js.map +0 -1
  143. package/dist/code-first/replay.d.ts +0 -36
  144. package/dist/code-first/replay.d.ts.map +0 -1
  145. package/dist/code-first/replay.js +0 -52
  146. package/dist/code-first/replay.js.map +0 -1
  147. package/dist/code-first/shared.d.ts +0 -53
  148. package/dist/code-first/shared.d.ts.map +0 -1
  149. package/dist/code-first/shared.js +0 -94
  150. package/dist/code-first/shared.js.map +0 -1
  151. package/dist/code-first/test-suite-operations.d.ts +0 -16
  152. package/dist/code-first/test-suite-operations.d.ts.map +0 -1
  153. package/dist/code-first/test-suite-operations.js +0 -44
  154. package/dist/code-first/test-suite-operations.js.map +0 -1
  155. package/dist/config/apply.d.ts +0 -51
  156. package/dist/config/apply.d.ts.map +0 -1
  157. package/dist/config/apply.js +0 -121
  158. package/dist/config/apply.js.map +0 -1
  159. package/dist/config/commands.d.ts +0 -58
  160. package/dist/config/commands.d.ts.map +0 -1
  161. package/dist/config/commands.js +0 -252
  162. package/dist/config/commands.js.map +0 -1
  163. package/dist/config/profiles.d.ts +0 -108
  164. package/dist/config/profiles.d.ts.map +0 -1
  165. package/dist/config/profiles.js +0 -339
  166. package/dist/config/profiles.js.map +0 -1
  167. package/dist/flag-hint.d.ts +0 -46
  168. package/dist/flag-hint.d.ts.map +0 -1
  169. package/dist/flag-hint.js +0 -114
  170. package/dist/flag-hint.js.map +0 -1
  171. package/dist/modules.d.ts +0 -17
  172. package/dist/modules.d.ts.map +0 -1
  173. package/dist/modules.js +0 -65
  174. package/dist/modules.js.map +0 -1
  175. package/dist/phase-c/api.d.ts +0 -433
  176. package/dist/phase-c/api.d.ts.map +0 -1
  177. package/dist/phase-c/api.js +0 -334
  178. package/dist/phase-c/api.js.map +0 -1
  179. package/dist/phase-c/commands/activities.d.ts +0 -119
  180. package/dist/phase-c/commands/activities.d.ts.map +0 -1
  181. package/dist/phase-c/commands/activities.js +0 -287
  182. package/dist/phase-c/commands/activities.js.map +0 -1
  183. package/dist/phase-c/commands/batch.d.ts +0 -90
  184. package/dist/phase-c/commands/batch.d.ts.map +0 -1
  185. package/dist/phase-c/commands/batch.js +0 -296
  186. package/dist/phase-c/commands/batch.js.map +0 -1
  187. package/dist/phase-c/commands/queues.d.ts +0 -67
  188. package/dist/phase-c/commands/queues.d.ts.map +0 -1
  189. package/dist/phase-c/commands/queues.js +0 -183
  190. package/dist/phase-c/commands/queues.js.map +0 -1
  191. package/dist/phase-c/commands/run-control.d.ts +0 -76
  192. package/dist/phase-c/commands/run-control.d.ts.map +0 -1
  193. package/dist/phase-c/commands/run-control.js +0 -245
  194. package/dist/phase-c/commands/run-control.js.map +0 -1
  195. package/dist/phase-c/commands/schedules.d.ts +0 -63
  196. package/dist/phase-c/commands/schedules.d.ts.map +0 -1
  197. package/dist/phase-c/commands/schedules.js +0 -198
  198. package/dist/phase-c/commands/schedules.js.map +0 -1
  199. package/dist/phase-c/commands/search-attributes.d.ts +0 -30
  200. package/dist/phase-c/commands/search-attributes.d.ts.map +0 -1
  201. package/dist/phase-c/commands/search-attributes.js +0 -70
  202. package/dist/phase-c/commands/search-attributes.js.map +0 -1
  203. package/dist/phase-c/commands/signal-tokens.d.ts +0 -27
  204. package/dist/phase-c/commands/signal-tokens.d.ts.map +0 -1
  205. package/dist/phase-c/commands/signal-tokens.js +0 -68
  206. package/dist/phase-c/commands/signal-tokens.js.map +0 -1
  207. package/dist/phase-c/commands/worker-run.d.ts +0 -109
  208. package/dist/phase-c/commands/worker-run.d.ts.map +0 -1
  209. package/dist/phase-c/commands/worker-run.js +0 -484
  210. package/dist/phase-c/commands/worker-run.js.map +0 -1
  211. package/dist/phase-c/commands/workers.d.ts +0 -46
  212. package/dist/phase-c/commands/workers.d.ts.map +0 -1
  213. package/dist/phase-c/commands/workers.js +0 -140
  214. package/dist/phase-c/commands/workers.js.map +0 -1
  215. package/dist/phase-c/index.d.ts +0 -16
  216. package/dist/phase-c/index.d.ts.map +0 -1
  217. package/dist/phase-c/index.js +0 -25
  218. package/dist/phase-c/index.js.map +0 -1
  219. package/dist/phase-c/operations.d.ts +0 -67
  220. package/dist/phase-c/operations.d.ts.map +0 -1
  221. package/dist/phase-c/operations.js +0 -559
  222. package/dist/phase-c/operations.js.map +0 -1
  223. package/dist/phase-c/register.d.ts +0 -39
  224. package/dist/phase-c/register.d.ts.map +0 -1
  225. package/dist/phase-c/register.js +0 -678
  226. package/dist/phase-c/register.js.map +0 -1
  227. package/dist/phase-c/shared.d.ts +0 -44
  228. package/dist/phase-c/shared.d.ts.map +0 -1
  229. package/dist/phase-c/shared.js +0 -146
  230. package/dist/phase-c/shared.js.map +0 -1
  231. package/dist/product-defaults.d.ts +0 -11
  232. package/dist/product-defaults.d.ts.map +0 -1
  233. package/dist/product-defaults.js +0 -25
  234. package/dist/product-defaults.js.map +0 -1
  235. package/dist/program.d.ts +0 -25
  236. package/dist/program.d.ts.map +0 -1
  237. package/dist/program.js +0 -60
  238. package/dist/program.js.map +0 -1
@@ -1,231 +0,0 @@
1
- /**
2
- * `fluidgrids push --hotfix <version> [key]`: replace the code bundle of an
3
- * existing version (spec 06 §2, decision DB10) instead of creating a version.
4
- *
5
- * 1. The local lowering of the workflow must equal the stored version except
6
- * for its code: a hotfix fixes code, it never changes the graph, the
7
- * exported functions or their interfaces.
8
- * 2. `--replay-sample N` first replays the N most recent durable runs of that
9
- * version locally (in the QuickJS isolate, or with the Python SDK for a
10
- * Python project), and refuses on a violation. It
11
- * scans the newest runs of the key up to a bound, warns when it found fewer
12
- * than N and refuses when it found none.
13
- * 3. The bundle is uploaded as for a push, `replaceWorkflowVersionCode` starts
14
- * the service's job, and the CLI polls `workflowCodeReplace` until the job
15
- * ends REPLACED or REJECTED (the service replays up to 50 open and 50
16
- * completed runs; `--no-verify-replay` skips that and is audited). The
17
- * result is emitted before a REJECTED job or a timeout exits non-zero.
18
- */
19
- import { CliUserError } from '@burdenoff/cli-sdk/core';
20
- import { canonicalJson } from '@fluidgrids/workflows/ir';
21
- import { bundleCodeBlock, codeBundleInput, prepareProjectBundle, uploadBundle, } from '../code-upload.js';
22
- import { fetchHistory } from '../history.js';
23
- import { writeLock } from '../project.js';
24
- import { comparableRemote, outgoingDefinition, sameContent } from '../remote.js';
25
- import { createPythonReplayer } from '../python-build.js';
26
- import { createReplayer, describeOutcome } from '../replay.js';
27
- import { emit, parsePositiveInt } from '../shared.js';
28
- import { loadPushInputs } from './push.js';
29
- /** Poll interval of the replacement job. */
30
- export const HOTFIX_POLL_MS = 2_000;
31
- /** Default wait for the replacement job (the service replays up to 100 runs). */
32
- export const HOTFIX_DEFAULT_TIMEOUT_MS = 10 * 60_000;
33
- function isRecord(value) {
34
- return typeof value === 'object' && value !== null && !Array.isArray(value);
35
- }
36
- /** The definition without the parts a hotfix may change (`code.buildId`, provenance). */
37
- function withoutCode(definition) {
38
- const copy = { ...definition };
39
- delete copy['code'];
40
- delete copy['authoring'];
41
- return copy;
42
- }
43
- function exportsOf(definition) {
44
- const code = definition['code'];
45
- return canonicalJson(isRecord(code) ? (code['exports'] ?? null) : null);
46
- }
47
- function pickWorkflow(selected, keys) {
48
- const durable = selected.filter((workflow) => workflow.durable);
49
- if (keys.length > 1) {
50
- throw new CliUserError('`--hotfix` replaces the code of one version; name one workflow key.');
51
- }
52
- const [only, ...rest] = keys.length === 1 ? selected : durable;
53
- if (!only || rest.length > 0) {
54
- throw new CliUserError(durable.length === 0
55
- ? 'The project defines no durable-function workflow to hotfix.'
56
- : '`--hotfix` replaces the code of one version; name the workflow key.', durable.length > 1
57
- ? { hint: `Durable workflows: ${durable.map((w) => w.key).join(', ')}` }
58
- : undefined);
59
- }
60
- if (!only.durable) {
61
- throw new CliUserError(`${only.key} does not run code; there is no bundle to hotfix.`);
62
- }
63
- return only;
64
- }
65
- /** An outcome without the raw task result, for output. */
66
- function summarize(outcome) {
67
- return {
68
- name: outcome.name,
69
- workflowFn: outcome.workflowFn,
70
- events: outcome.events,
71
- engine: outcome.engine,
72
- ok: outcome.ok,
73
- cause: outcome.cause,
74
- message: outcome.message,
75
- seq: outcome.seq,
76
- };
77
- }
78
- /** Runs of the key scanned for a `--replay-sample` (newest first). */
79
- export const HOTFIX_SAMPLE_SCAN_LIMIT = 500;
80
- async function localReplays(env, key, version, sample, openReplayer) {
81
- // Newest first. The list has no version or kind filter, so it is scanned up
82
- // to a bound: other versions and canvas runs of the same key are skipped.
83
- const scanned = await env.api.listRuns(key, Math.max(HOTFIX_SAMPLE_SCAN_LIMIT, sample));
84
- const runs = scanned
85
- .filter((run) => run.version === version && run.executionKind === 'DURABLE_FN')
86
- .slice(0, sample);
87
- const found = { requested: sample, found: runs.length, scanned: scanned.length };
88
- if (runs.length === 0) {
89
- throw new CliUserError(`--replay-sample ${sample} found no durable runs of ${key} ${version} among the newest ${scanned.length} runs; nothing was replaced.`, { hint: "Drop --replay-sample to rely on the service's replay verification alone." });
90
- }
91
- const replayer = await openReplayer();
92
- try {
93
- const outcomes = [];
94
- for (const run of runs) {
95
- const { file } = await fetchHistory(env, run.id);
96
- outcomes.push(await replayer.replay(file, run.id));
97
- }
98
- return { outcomes, sample: found };
99
- }
100
- finally {
101
- await replayer.close();
102
- }
103
- }
104
- /** The job once it ended, or its last state when the wait timed out. */
105
- async function waitForJob(env, started, timeoutMs) {
106
- const deadline = Date.now() + timeoutMs;
107
- let job = started;
108
- while (job.status === 'PENDING' || job.status === 'VERIFYING') {
109
- if (Date.now() > deadline)
110
- return { job, timedOut: true };
111
- await env.sleep(HOTFIX_POLL_MS);
112
- job = await env.api.codeReplace(job.id);
113
- }
114
- return { job, timedOut: false };
115
- }
116
- export async function runHotfix(env, keys, options) {
117
- const version = options.hotfix;
118
- if (version === undefined || version.trim() === '') {
119
- throw new CliUserError('`--hotfix` needs the version to replace, for example `--hotfix v3`.');
120
- }
121
- if (options.dryRun)
122
- throw new CliUserError('`--hotfix` and `--dry-run` cannot be combined.');
123
- const sample = parsePositiveInt(options.replaySample, '--replay-sample') ?? 0;
124
- const timeoutMs = parsePositiveInt(options.timeout, '--timeout') ?? HOTFIX_DEFAULT_TIMEOUT_MS;
125
- const inputs = await loadPushInputs(env, keys, options);
126
- return hotfixWorkflow(env, inputs.project, inputs.lowered, pickWorkflow(inputs.selected, keys), {
127
- version,
128
- sample,
129
- timeoutMs,
130
- verifyReplay: options.verifyReplay !== false,
131
- format: options.format,
132
- });
133
- }
134
- async function hotfixWorkflow(env, project, lowered, workflow, settings) {
135
- const { version } = settings;
136
- // The local refusals (no bundle, size caps, a buildId mismatch) come first.
137
- const prepared = await prepareProjectBundle(project, lowered);
138
- bundleCodeBlock(workflow, prepared);
139
- const stored = await env.api.exportWorkflow(workflow.key, version);
140
- const storedDefinition = comparableRemote(stored.definitionJson, workflow.key);
141
- if (!isRecord(storedDefinition['code'])) {
142
- throw new CliUserError(`${workflow.key} ${version} has no code bundle; push a new version.`);
143
- }
144
- // Aligned the way push compares, so data pinned on the canvas is no change.
145
- const outgoing = outgoingDefinition(workflow.definition, storedDefinition);
146
- if (!sameContent(withoutCode(outgoing), withoutCode(storedDefinition))) {
147
- throw new CliUserError(`The workflow graph of ${workflow.key} differs from ${version}; a hotfix replaces only code.`, { hint: 'Push a new version instead (`fluidgrids push`).' });
148
- }
149
- if (exportsOf(workflow.definition) !== exportsOf(storedDefinition)) {
150
- throw new CliUserError(`The exported functions or interfaces of ${workflow.key} differ from ${version}; a hotfix replaces only code.`, { hint: 'Push a new version instead (`fluidgrids push`).' });
151
- }
152
- const previous = storedDefinition['code']['buildId'];
153
- if (previous === prepared.buildId) {
154
- throw new CliUserError(`${workflow.key} ${version} already runs ${prepared.buildId}.`);
155
- }
156
- const sampled = settings.sample > 0
157
- ? await localReplays(env, workflow.key, version, settings.sample, () =>
158
- // Python code replays in the Python SDK; TypeScript in the QuickJS isolate.
159
- prepared.language === 'python'
160
- ? Promise.resolve(createPythonReplayer(lowered.python ?? 'python3', project.root))
161
- : createReplayer(lowered.bundle ?? '', prepared.buildId, 'quickjs'))
162
- : undefined;
163
- const outcomes = sampled?.outcomes ?? [];
164
- const failed = outcomes.filter((outcome) => !outcome.ok);
165
- if (failed.length > 0) {
166
- throw new CliUserError(`The new code fails to replay ${failed.length} of ${outcomes.length} sampled runs; nothing was replaced.`, { hint: failed.map(describeOutcome).join('\n') });
167
- }
168
- const upload = await uploadBundle(env, prepared, workflow.key);
169
- const started = await env.api.replaceVersionCode(workflow.key, version, codeBundleInput(upload.uploadId, workflow, prepared), settings.verifyReplay);
170
- const { job, timedOut } = await waitForJob(env, started, settings.timeoutMs);
171
- const result = {
172
- key: workflow.key,
173
- version,
174
- buildId: job.buildId,
175
- previousBuildId: job.previousBuildId,
176
- status: job.status,
177
- timedOut,
178
- jobId: job.id,
179
- verifiedRuns: job.verifiedRuns,
180
- bundleUploaded: upload.bundleSent,
181
- verifyReplay: settings.verifyReplay,
182
- replaySample: sampled?.sample ?? null,
183
- localReplays: outcomes.map(summarize),
184
- violations: job.violations,
185
- };
186
- const replaced = job.status === 'REPLACED';
187
- if (replaced) {
188
- const tracked = project.lock.workflows[workflow.key];
189
- if (tracked && tracked.version === version) {
190
- project.lock.workflows[workflow.key] = { ...tracked, buildId: prepared.buildId };
191
- }
192
- project.lock.bundle = {
193
- buildId: prepared.buildId,
194
- sourceHash: prepared.sourceHash,
195
- sdkVersion: prepared.sdkVersion,
196
- };
197
- writeLock(project);
198
- }
199
- const details = [
200
- `${workflow.key} ${version}: ${result.previousBuildId} -> ${result.buildId}`,
201
- ...outcomes.map(describeOutcome),
202
- ];
203
- const sample = sampled?.sample;
204
- if (sample && sample.found < sample.requested) {
205
- const warning = `--replay-sample ${sample.requested}: only ${sample.found} durable run(s) of ${version} among the newest ${sample.scanned} runs were replayed locally.`;
206
- // stderr, so a `--format json` caller's stdout stays one document.
207
- env.ctx.output.printWarning(warning);
208
- }
209
- if (!settings.verifyReplay)
210
- details.push('Replay verification was skipped (audited).');
211
- // The result goes out first, so `--format json` gets the job even when it failed.
212
- emit(env, { ...(settings.format !== undefined ? { format: settings.format } : {}) }, result, {
213
- headers: ['Workflow', 'Version', 'Status', 'Verified runs', 'Build'],
214
- rows: [[result.key, version, result.status, String(result.verifiedRuns), result.buildId]],
215
- }, details);
216
- if (timedOut) {
217
- throw new CliUserError(`The code replacement ${job.id} is still ${job.status} after ${settings.timeoutMs} ms.`, { hint: 'It keeps running on the service; check it again with `fluidgrids versions list`.' });
218
- }
219
- if (job.status === 'REJECTED') {
220
- throw new CliUserError(`The service rejected the new code for ${workflow.key} ${version}: ${job.violations.length} replay violation(s).`, {
221
- hint: job.violations
222
- .map((v) => `run ${v.runId}${v.seq !== null ? ` event ${v.seq}` : ''}: ${v.message}`)
223
- .join('\n'),
224
- });
225
- }
226
- if (!replaced) {
227
- throw new CliUserError(`The code replacement ${job.id} ended ${job.status}; the version keeps its code.`);
228
- }
229
- return result;
230
- }
231
- //# sourceMappingURL=hotfix.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hotfix.js","sourceRoot":"","sources":["../../../src/code-first/commands/hotfix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGzD,OAAO,EACL,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAgB,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAqC,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAmB,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,cAAc,EAAoB,MAAM,WAAW,CAAC;AAE7D,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC;AACpC,iFAAiF;AACjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,MAAM,CAAC;AAoBrD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,yFAAyF;AACzF,SAAS,WAAW,CAAC,UAAmC;IACtD,MAAM,IAAI,GAA4B,EAAE,GAAG,UAAU,EAAE,CAAC;IACxD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,IAAI,CAAC,WAAW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AAE,kFAAkF,EAAE,CAC7F,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;QAC9B,MAAM,IAAI,YAAY,CACpB,yCAAyC,QAAQ,CAAC,GAAG,IAAI,OAAO,KAAK,GAAG,CAAC,UAAU,CAAC,MAAM,uBAAuB,EACjH;YACE,IAAI,EAAE,GAAG,CAAC,UAAU;iBACjB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;iBACpF,IAAI,CAAC,IAAI,CAAC;SACd,CACF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,YAAY,CACpB,wBAAwB,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,+BAA+B,CAClF,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,40 +0,0 @@
1
- /**
2
- * `fluidgrids import <file> [--key k] [--name n]`: create a NEW workflow (a
3
- * DRAFT) from one file, the way the builder's import dialog does (spec 07 §1,
4
- * §8), through `importWorkflow`:
5
- *
6
- * - `.json`: an export envelope or a bare definition, sent as
7
- * `source: { format: JSON }` so the service reads it exactly as Git restore does;
8
- * - `.ts`: a tier-1 module of a project, sent as `source: { format: TYPESCRIPT }`
9
- * with the files it imports and the connection names resolved, so the service
10
- * lowers it in its own isolate;
11
- * - `.py`: lowered by the installed `fluidgrids-workflows` Python package and sent
12
- * as `definitionJson` (the service does not run Python).
13
- *
14
- * The file is lowered locally first as well, and the stored version's `irHash`
15
- * is compared with the local one, so a disagreement between the CLI and the
16
- * service's lowering shows up immediately. An existing workflow key is refused
17
- * by the service; `fluidgrids push` creates new versions of existing workflows.
18
- */
19
- import { type CommandEnv, type OutputOptions } from '../shared.js';
20
- export interface ImportOptions extends OutputOptions {
21
- key?: string;
22
- name?: string;
23
- description?: string;
24
- allowMissingNodes?: boolean;
25
- }
26
- export interface ImportResult {
27
- file: string;
28
- format: 'JSON' | 'TYPESCRIPT' | 'PYTHON';
29
- workflowKey: string;
30
- version: string;
31
- status: string;
32
- /** `irHash` of the local reading or lowering of the file. */
33
- irHash: string;
34
- /** `irHash` of the version the service stored. */
35
- storedIrHash: string;
36
- matches: boolean;
37
- warnings: string[];
38
- }
39
- export declare function runImport(env: CommandEnv, file: string, options: ImportOptions): Promise<ImportResult>;
40
- //# sourceMappingURL=import.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/code-first/commands/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AA+BH,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEzE,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAuMD,wBAAsB,SAAS,CAC7B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,YAAY,CAAC,CA6DvB"}
@@ -1,235 +0,0 @@
1
- /**
2
- * `fluidgrids import <file> [--key k] [--name n]`: create a NEW workflow (a
3
- * DRAFT) from one file, the way the builder's import dialog does (spec 07 §1,
4
- * §8), through `importWorkflow`:
5
- *
6
- * - `.json`: an export envelope or a bare definition, sent as
7
- * `source: { format: JSON }` so the service reads it exactly as Git restore does;
8
- * - `.ts`: a tier-1 module of a project, sent as `source: { format: TYPESCRIPT }`
9
- * with the files it imports and the connection names resolved, so the service
10
- * lowers it in its own isolate;
11
- * - `.py`: lowered by the installed `fluidgrids-workflows` Python package and sent
12
- * as `definitionJson` (the service does not run Python).
13
- *
14
- * The file is lowered locally first as well, and the stored version's `irHash`
15
- * is compared with the local one, so a disagreement between the CLI and the
16
- * service's lowering shows up immediately. An existing workflow key is refused
17
- * by the service; `fluidgrids push` creates new versions of existing workflows.
18
- */
19
- import { existsSync, readFileSync } from 'fs';
20
- import { basename, dirname, extname, relative, resolve, sep } from 'path';
21
- import { CliUserError } from '@burdenoff/cli-sdk/core';
22
- import { irHash, parseWorkflowDocument } from '@fluidgrids/workflows/ir';
23
- import { lower } from '@fluidgrids/workflows/roundtrip';
24
- import { UnresolvedConnectionsError } from '@fluidgrids/workflows';
25
- import { explainUnresolved, refsForNames } from '../connections.js';
26
- import { lowerFailure } from '../lowering.js';
27
- import { assertProjectWorkspace, ACTIVITIES_DIR, GENERATED_DIR, findProjectRoot, isLoweringInput, listSourcePaths, loadProject, readProjectFiles, WORKFLOWS_DIR, } from '../project.js';
28
- import { lowerPython, PythonUnresolvedConnectionsError, resolvePythonInterpreter, } from '../python.js';
29
- import { projectConnectionIndex } from '../remote.js';
30
- import { emit } from '../shared.js';
31
- function nameOf(definition, fallback) {
32
- const name = definition['name'];
33
- return typeof name === 'string' && name.trim() !== '' ? name : fallback;
34
- }
35
- function common(options) {
36
- return {
37
- ...(options.description ? { description: options.description } : {}),
38
- ...(options.allowMissingNodes ? { allowMissingNodes: true } : {}),
39
- };
40
- }
41
- function prepareJson(path, absolute, text, options) {
42
- const parsed = parseWorkflowDocument(text);
43
- if (!parsed)
44
- throw new CliUserError(`${path} is not a workflow export or definition.`);
45
- const declared = parsed.definitionJson['key'];
46
- const key = options.key ??
47
- parsed.workflowKey ??
48
- (typeof declared === 'string' && declared !== '' ? declared : undefined);
49
- if (!key) {
50
- throw new CliUserError(`${path} names no workflow key.`, { hint: 'Pass --key <key>.' });
51
- }
52
- const name = options.name ?? nameOf(parsed.definitionJson, key);
53
- const source = {
54
- format: 'JSON',
55
- files: [{ path: `${WORKFLOWS_DIR}/${basename(absolute)}`, content: text }],
56
- };
57
- return {
58
- format: 'JSON',
59
- key,
60
- name,
61
- definition: parsed.definitionJson,
62
- input: { name, workflowKey: key, source, ...common(options) },
63
- warnings: [],
64
- };
65
- }
66
- /** A resolver over the index that records every name it resolved. */
67
- function recordingResolver(index) {
68
- const used = new Set();
69
- return {
70
- used,
71
- resolve: (name) => {
72
- if (!Object.hasOwn(index.refs, name))
73
- return undefined;
74
- used.add(name);
75
- return index.refs[name];
76
- },
77
- };
78
- }
79
- function unresolved(names, index) {
80
- return new CliUserError(`The code names connections that do not resolve in this workspace: ${[...names].sort().join(', ')}`, { hint: explainUnresolved(names, index).join('\n') });
81
- }
82
- /**
83
- * The workflow among `found` that the import is for, as the service chooses:
84
- * the only one (which `--key` then renames), or among several the one `--key` names.
85
- */
86
- function chooseWorkflow(found, file, key) {
87
- const chosen = found.length === 1 ? found[0] : found.find((item) => item.key === key);
88
- if (!chosen) {
89
- throw new CliUserError(found.length === 0
90
- ? `${file} defines no workflow.`
91
- : key
92
- ? `${file} defines no workflow "${key}" (found: ${found.map((item) => item.key).join(', ')}).`
93
- : `${file} defines ${found.length} workflows (${found.map((item) => item.key).join(', ')}); pass --key to choose one.`);
94
- }
95
- return chosen;
96
- }
97
- async function prepareTypeScript(env, project, path, options) {
98
- const index = await projectConnectionIndex(env.api, project, options.key ? [options.key] : []);
99
- const inputs = readProjectFiles(project.root, listSourcePaths(project.root).filter((candidate) => isLoweringInput(candidate, 'ts')));
100
- const resolver = recordingResolver(index);
101
- let lowered;
102
- try {
103
- lowered = await lower(inputs, { entries: [path], connections: resolver.resolve });
104
- }
105
- catch (error) {
106
- if (error instanceof UnresolvedConnectionsError)
107
- throw unresolved(error.names, index);
108
- throw lowerFailure(error, path);
109
- }
110
- const workflow = chooseWorkflow(lowered.workflows, path, options.key);
111
- // The module itself, the code it may import (activities and the generated
112
- // clients) and the workflow's own sidecars; other workflow modules stay out.
113
- // `lower()` has already refused sources over its limit (1 MiB, the service's too).
114
- const files = inputs.filter((file) => file.path === path ||
115
- file.path.startsWith(`${ACTIVITIES_DIR}/`) ||
116
- file.path.startsWith(`${GENERATED_DIR}/`) ||
117
- file.path === `${WORKFLOWS_DIR}/${workflow.key}.layout.json` ||
118
- file.path === `${WORKFLOWS_DIR}/${workflow.key}.pinned.json`);
119
- const definition = workflow.definition;
120
- const key = options.key ?? workflow.key;
121
- const name = options.name ?? nameOf(definition, key);
122
- // Only the names the code uses: the service caps the map (500 names), and the
123
- // rest of the workspace's connections are none of this import's business.
124
- const source = {
125
- format: 'TYPESCRIPT',
126
- files,
127
- connections: refsForNames(index.refs, resolver.used),
128
- };
129
- return {
130
- format: 'TYPESCRIPT',
131
- key,
132
- name,
133
- definition: { ...definition, key },
134
- input: { name, workflowKey: key, source, ...common(options) },
135
- warnings: [],
136
- };
137
- }
138
- async function preparePython(env, project, path, options) {
139
- const index = await projectConnectionIndex(env.api, project, options.key ? [options.key] : []);
140
- let lowered;
141
- try {
142
- lowered = await lowerPython({
143
- python: resolvePythonInterpreter(project.root, project.config.python),
144
- root: project.root,
145
- entries: [path],
146
- connections: { ...index.refs },
147
- });
148
- }
149
- catch (error) {
150
- if (error instanceof PythonUnresolvedConnectionsError)
151
- throw unresolved(error.names, index);
152
- throw error;
153
- }
154
- const workflow = chooseWorkflow(lowered.workflows, path, options.key);
155
- const key = options.key ?? workflow.key;
156
- const name = options.name ?? nameOf(workflow.definition, key);
157
- const definition = { ...workflow.definition, key };
158
- return {
159
- format: 'PYTHON',
160
- key,
161
- name,
162
- definition,
163
- input: { name, workflowKey: key, definitionJson: definition, ...common(options) },
164
- warnings: lowered.warnings,
165
- };
166
- }
167
- /** The project a `.ts` / `.py` file belongs to, and the file's project path. */
168
- function projectOf(absolute) {
169
- const root = findProjectRoot(dirname(absolute));
170
- if (!root) {
171
- throw new CliUserError(`${absolute} is not inside a code-first project.`, {
172
- hint: 'Run `fluidgrids init` in the project directory first.',
173
- });
174
- }
175
- const project = loadProject(root, root);
176
- const path = relative(root, absolute).split(sep).join('/');
177
- if (!path.startsWith(`${WORKFLOWS_DIR}/`)) {
178
- throw new CliUserError(`${path} is not under ${WORKFLOWS_DIR}/ of the project at ${root}.`);
179
- }
180
- return { project, path };
181
- }
182
- export async function runImport(env, file, options) {
183
- const absolute = resolve(env.cwd(), file);
184
- if (!existsSync(absolute))
185
- throw new CliUserError(`${file} does not exist.`);
186
- const extension = extname(absolute).toLowerCase();
187
- let prepared;
188
- if (extension === '.json') {
189
- prepared = prepareJson(file, absolute, readFileSync(absolute, 'utf8'), options);
190
- }
191
- else if (extension === '.ts' || extension === '.py') {
192
- const { project, path } = projectOf(absolute);
193
- assertProjectWorkspace(env, project);
194
- if ((extension === '.ts') !== (project.config.language === 'ts')) {
195
- throw new CliUserError(`${path} is ${extension === '.ts' ? 'TypeScript' : 'Python'}, but the project language is ${project.config.language}.`);
196
- }
197
- prepared =
198
- extension === '.ts'
199
- ? await prepareTypeScript(env, project, path, options)
200
- : await preparePython(env, project, path, options);
201
- }
202
- else {
203
- throw new CliUserError(`Cannot import ${file}: expected a .json, .ts or .py file.`);
204
- }
205
- const saved = await env.api.importWorkflow(prepared.input);
206
- const stored = await env.api.exportWorkflow(saved.workflowKey, saved.version);
207
- const local = irHash(prepared.definition);
208
- const storedHash = irHash(stored.definitionJson);
209
- const warnings = [...prepared.warnings, ...saved.validationWarnings];
210
- // The service may rename the stored definition's key; compare the content with the key aligned.
211
- const matches = storedHash === local ||
212
- irHash({ ...stored.definitionJson, key: prepared.definition['key'] }) === local;
213
- if (!matches) {
214
- warnings.push(`the stored version's irHash ${storedHash} differs from the local ${local}; run \`fluidgrids diff ${saved.workflowKey}\` to see how`);
215
- }
216
- const result = {
217
- file,
218
- format: prepared.format,
219
- workflowKey: saved.workflowKey,
220
- version: saved.version,
221
- status: saved.status,
222
- irHash: local,
223
- storedIrHash: storedHash,
224
- matches,
225
- warnings,
226
- };
227
- emit(env, options, result, {
228
- headers: ['Workflow', 'Version', 'Status', 'From', 'Matches local'],
229
- rows: [
230
- [saved.workflowKey, saved.version, saved.status, prepared.format, matches ? 'yes' : 'no'],
231
- ],
232
- }, warnings.map((warning) => `warning: ${warning}`));
233
- return result;
234
- }
235
- //# sourceMappingURL=import.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"import.js","sourceRoot":"","sources":["../../../src/code-first/commands/import.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1E,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAwB,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACt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CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAiB;QAC3B,IAAI;QACJ,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,UAAU;QACxB,OAAO;QACP,QAAQ;KACT,CAAC;IACF,IAAI,CACF,GAAG,EACH,OAAO,EACP,MAAM,EACN;QACE,OAAO,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC;QACnE,IAAI,EAAE;YACJ,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;SAC1F;KACF,EACD,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,OAAO,EAAE,CAAC,CACjD,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * `fluidgrids init [dir] [--lang ts|py]`: scaffold a code-first project
3
- * (spec 07 §7), sign in with the device-code flow when the CLI is not signed in
4
- * and a person is at the terminal, and run codegen.
5
- *
6
- * In CI (no terminal, or `--no-login`) init never waits for a login: it
7
- * scaffolds and prints the next steps. `FLUIDGRIDS_TOKEN` counts as signed in.
8
- */
9
- import { type ProjectConfig, type ProjectLanguage } from '../project.js';
10
- import { type CommandEnv, type OutputOptions } from '../shared.js';
11
- export interface InitOptions extends OutputOptions {
12
- lang?: string;
13
- workspace?: string;
14
- force?: boolean;
15
- codegen?: boolean;
16
- login?: boolean;
17
- }
18
- export interface InitResult {
19
- root: string;
20
- language: ProjectLanguage;
21
- files: string[];
22
- login: 'existing' | 'signed-in' | 'skipped' | 'needs-workspace';
23
- codegen: 'written' | 'skipped' | 'needs-login' | 'needs-workspace' | 'failed';
24
- next: string[];
25
- }
26
- /** An npm package name from a directory name. */
27
- export declare function packageName(dir: string): string;
28
- export declare function scaffoldFiles(dir: string, language: ProjectLanguage, config: ProjectConfig, productVersion: string): Array<{
29
- path: string;
30
- content: string;
31
- }>;
32
- export declare function runInit(env: CommandEnv, dir: string | undefined, options: InitOptions): Promise<InitResult>;
33
- //# sourceMappingURL=init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/code-first/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,OAAO,EAWL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAGtB,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,iBAAiB,CAAC;IAChE,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,iBAAiB,GAAG,QAAQ,CAAC;IAC9E,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,iDAAiD;AACjD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM/C;AAMD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,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