@fluidgrids/cli 2026.1108.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 (238) hide show
  1. package/README.md +1 -1
  2. package/dist/cli.js +9705 -33
  3. package/package.json +36 -32
  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,268 +0,0 @@
1
- /**
2
- * Python durable functions in the CLI (Phase C release C-S6, plan C-CLI and
3
- * C-PYBUNDLE): building the bundle a push uploads, the source archive the
4
- * service keeps, and replays against the local Python code.
5
- *
6
- * - Build: `<python> -m fluidgrids_workflows build <root> --out
7
- * .fluidgrids/build/bundle.pyz --connections -` runs the Python SDK's
8
- * `build_project`, the same function the service's build VM runs, so the
9
- * `buildId` (the sha256 of the deterministic `.pyz`) is the one the service
10
- * would build. The CLI checks the bytes against it.
11
- * - Source archive (D-S6-4): the gzipped JSON `{files}` of the files the
12
- * Python SDK hashes (`workflows/**` `.py`/`.json` outside `__pycache__`,
13
- * and `.fluidgrids/nodes.py`), so the service recomputes the same
14
- * `sourceHash`. The CLI vendors no packages for Python.
15
- * - Replay: `<python> -m fluidgrids_workflows replay <history> --project
16
- * <root>` replays one history with the project's tier-2 functions.
17
- */
18
- import { createHash } from 'crypto';
19
- import { mkdtempSync, readFileSync, rmSync, writeFileSync } from 'fs';
20
- import { tmpdir } from 'os';
21
- import { join, posix } from 'path';
22
- import { CliUserError } from '@burdenoff/cli-sdk/core';
23
- import { serializeHistoryFile, } from '@fluidgrids/workflows/history';
24
- import { BUILD_DIR, listSourcePaths } from './project.js';
25
- import { PYTHON_MODULE, PYTHON_PACKAGE, pythonCliFailure, runPythonCli, } from './python.js';
26
- export const BUILD_RESULT_FORMAT = 'fluidgrids.python-build-result';
27
- /** Where `push` writes the Python bundle (CWD8). */
28
- export const PYTHON_BUNDLE_PATH = `${BUILD_DIR}/bundle.pyz`;
29
- /** A build lowers, imports and lints the project; it may take longer than a lowering. */
30
- export const DEFAULT_PYTHON_BUILD_TIMEOUT_MS = 300_000;
31
- function isRecord(value) {
32
- return typeof value === 'object' && value !== null && !Array.isArray(value);
33
- }
34
- const UPGRADE_HINT = `Upgrade the ${PYTHON_PACKAGE} package to a version that matches this CLI.`;
35
- function unexpected(what) {
36
- return new CliUserError(`python -m ${PYTHON_MODULE} build returned ${what}.`, {
37
- hint: UPGRADE_HINT,
38
- });
39
- }
40
- function stringList(value, what) {
41
- if (!Array.isArray(value) || !value.every((item) => typeof item === 'string')) {
42
- throw unexpected(`malformed ${what}`);
43
- }
44
- return value.filter((item) => typeof item === 'string');
45
- }
46
- /** Parse a `fluidgrids.python-build-result` (printed without `bundleBytes` because of `--out`). */
47
- export function parseBuildResult(stdout) {
48
- let value;
49
- try {
50
- value = JSON.parse(stdout);
51
- }
52
- catch {
53
- throw unexpected('output that is not JSON');
54
- }
55
- if (!isRecord(value) ||
56
- value['format'] !== BUILD_RESULT_FORMAT ||
57
- typeof value['sourceHash'] !== 'string' ||
58
- !Array.isArray(value['workflows'])) {
59
- throw unexpected(`an unexpected result (expected ${BUILD_RESULT_FORMAT})`);
60
- }
61
- const buildId = value['buildId'];
62
- if (typeof buildId !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(buildId)) {
63
- throw new CliUserError('The Python project has no tier-2 functions, so there is no bundle.', {
64
- hint: 'Durable functions are `@workflow` functions in workflows/*.py.',
65
- });
66
- }
67
- const workflows = value['workflows'].map((item, index) => {
68
- if (!isRecord(item) ||
69
- typeof item['key'] !== 'string' ||
70
- typeof item['module'] !== 'string' ||
71
- typeof item['exportName'] !== 'string' ||
72
- !isRecord(item['definition'])) {
73
- throw unexpected(`a malformed workflow at index ${index}`);
74
- }
75
- return {
76
- key: item['key'],
77
- module: item['module'],
78
- exportName: item['exportName'],
79
- definition: item['definition'],
80
- };
81
- });
82
- const issues = (Array.isArray(value['issues']) ? value['issues'] : []).map((item, index) => {
83
- if (!isRecord(item) ||
84
- typeof item['code'] !== 'string' ||
85
- typeof item['message'] !== 'string' ||
86
- typeof item['module'] !== 'string') {
87
- throw unexpected(`a malformed issue at index ${index}`);
88
- }
89
- return {
90
- code: item['code'],
91
- message: item['message'],
92
- module: item['module'],
93
- ...(typeof item['key'] === 'string' ? { key: item['key'] } : {}),
94
- };
95
- });
96
- const diagnostics = (Array.isArray(value['diagnostics']) ? value['diagnostics'] : []).flatMap((item) => {
97
- if (!isRecord(item) || typeof item['message'] !== 'string')
98
- return [];
99
- return [
100
- {
101
- path: typeof item['path'] === 'string' ? item['path'] : '',
102
- code: typeof item['code'] === 'string' ? item['code'] : null,
103
- message: item['message'],
104
- severity: typeof item['severity'] === 'string' ? item['severity'] : 'warning',
105
- ...(typeof item['line'] === 'number' ? { line: item['line'] } : {}),
106
- ...(typeof item['column'] === 'number' ? { column: item['column'] } : {}),
107
- },
108
- ];
109
- });
110
- return {
111
- sdkVersion: typeof value['sdkVersion'] === 'string' ? value['sdkVersion'] : 'unknown',
112
- sourceHash: value['sourceHash'],
113
- buildId,
114
- bundleSize: typeof value['bundleSize'] === 'number' ? value['bundleSize'] : 0,
115
- entries: stringList(value['entries'] ?? [], 'entries'),
116
- workflows,
117
- issues,
118
- diagnostics,
119
- };
120
- }
121
- export function sha256Id(bytes) {
122
- return `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
123
- }
124
- /** Build the Python bundle into `.fluidgrids/build/bundle.pyz` and return it with its IR. */
125
- export async function buildPython(options) {
126
- const out = join(options.root, ...PYTHON_BUNDLE_PATH.split('/'));
127
- const args = ['build', options.root, '--out', out, '--connections', '-'];
128
- for (const entry of options.entries)
129
- args.push('--entry', entry);
130
- const { stdout } = await runPythonCli({
131
- python: options.python,
132
- root: options.root,
133
- command: 'build',
134
- args,
135
- stdin: JSON.stringify(options.connections),
136
- timeoutMs: options.timeoutMs ?? DEFAULT_PYTHON_BUILD_TIMEOUT_MS,
137
- });
138
- const parsed = parseBuildResult(stdout);
139
- let bundle;
140
- try {
141
- bundle = new Uint8Array(readFileSync(out));
142
- }
143
- catch {
144
- throw new CliUserError(`python -m ${PYTHON_MODULE} build wrote no bundle to ${PYTHON_BUNDLE_PATH}.`);
145
- }
146
- if (sha256Id(bundle) !== parsed.buildId) {
147
- throw new CliUserError(`The Python bundle in ${PYTHON_BUNDLE_PATH} is not ${parsed.buildId}; the build is not reproducible.`);
148
- }
149
- return {
150
- sdkVersion: parsed.sdkVersion,
151
- sourceHash: parsed.sourceHash,
152
- buildId: parsed.buildId,
153
- bundle,
154
- entries: parsed.entries,
155
- workflows: parsed.workflows,
156
- issues: parsed.issues,
157
- diagnostics: parsed.diagnostics,
158
- };
159
- }
160
- /**
161
- * The files the Python SDK hashes into `sourceHash` (and the service checks):
162
- * `.py` and `.json` files under `workflows/` outside `__pycache__` (Python's
163
- * `Path.suffix` rule: a name whose only dot is its first character has no
164
- * suffix), plus `.fluidgrids/nodes.py`.
165
- */
166
- export function isPythonSourcePath(path) {
167
- if (path === '.fluidgrids/nodes.py')
168
- return true;
169
- if (!path.startsWith('workflows/'))
170
- return false;
171
- const segments = path.split('/');
172
- if (segments.includes('__pycache__'))
173
- return false;
174
- const name = posix.basename(path);
175
- const dot = name.lastIndexOf('.');
176
- if (dot <= 0)
177
- return false;
178
- const suffix = name.slice(dot);
179
- return suffix === '.py' || suffix === '.json';
180
- }
181
- /** The source archive's `files` of a Python project. */
182
- export function pythonSourceFiles(root) {
183
- const files = {};
184
- for (const path of listSourcePaths(root)) {
185
- if (!isPythonSourcePath(path))
186
- continue;
187
- Object.defineProperty(files, path, {
188
- value: readFileSync(join(root, ...path.split('/')), 'utf8'),
189
- enumerable: true,
190
- writable: true,
191
- configurable: true,
192
- });
193
- }
194
- return files;
195
- }
196
- function isTaskResult(value) {
197
- return (isRecord(value) &&
198
- typeof value['protocol'] === 'number' &&
199
- typeof value['outcome'] === 'string' &&
200
- Array.isArray(value['commands']) &&
201
- Array.isArray(value['logs']));
202
- }
203
- /** Parse `fluidgrids_workflows replay` output into a replay outcome. */
204
- export function pythonReplayOutcome(stdout, file, name) {
205
- let value;
206
- try {
207
- value = JSON.parse(stdout);
208
- }
209
- catch {
210
- throw new CliUserError(`python -m ${PYTHON_MODULE} replay returned output that is not JSON.`, {
211
- hint: UPGRADE_HINT,
212
- });
213
- }
214
- if (!isRecord(value) || typeof value['ok'] !== 'boolean') {
215
- throw new CliUserError(`python -m ${PYTHON_MODULE} replay returned an unexpected result.`, {
216
- hint: UPGRADE_HINT,
217
- });
218
- }
219
- const result = isTaskResult(value['result'])
220
- ? value['result']
221
- : { protocol: 1, outcome: value['ok'] ? 'commands' : 'failed', commands: [], logs: [] };
222
- const problems = Array.isArray(value['problems'])
223
- ? value['problems'].filter((item) => typeof item === 'string')
224
- : [];
225
- const failure = result.failure;
226
- const ok = value['ok'] && result.outcome !== 'failed';
227
- return {
228
- name,
229
- workflowFn: file.workflowFn,
230
- events: file.events.length,
231
- engine: 'python',
232
- ok,
233
- cause: ok ? null : (failure?.cause ?? (problems.length > 0 ? 'NON_DETERMINISM' : 'INTERNAL')),
234
- message: ok ? null : (failure?.message ?? problems.join('; ')),
235
- seq: failure?.seq ?? null,
236
- result,
237
- };
238
- }
239
- /** Replays histories with the project's Python code, one process per history. */
240
- export function createPythonReplayer(python, root, timeoutMs) {
241
- const scratch = mkdtempSync(join(tmpdir(), 'fluidgrids-py-replay-'));
242
- let next = 0;
243
- return {
244
- async replay(file, name) {
245
- const path = join(scratch, `history-${next++}.json`);
246
- writeFileSync(path, serializeHistoryFile(file), 'utf8');
247
- const { stdout, stderr, code } = await runPythonCli({
248
- python,
249
- root,
250
- command: 'replay',
251
- args: ['replay', path, '--project', root],
252
- stdin: '',
253
- okStatuses: [0, 1],
254
- ...(timeoutMs !== undefined ? { timeoutMs } : {}),
255
- });
256
- // Exit status 1 with no result is an error, not a diverging history.
257
- if (code !== 0 && stdout.trim() === '') {
258
- throw pythonCliFailure(code, null, stderr, python, 'replay');
259
- }
260
- return pythonReplayOutcome(stdout, file, name);
261
- },
262
- close: () => {
263
- rmSync(scratch, { recursive: true, force: true });
264
- return Promise.resolve();
265
- },
266
- };
267
- }
268
- //# sourceMappingURL=python-build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file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AAE,CAAC;aAClD,CAAC,CAAC;YACH,qEAAqE;YACrE,IAAI,IAAI,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;gBACvC,MAAM,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,mBAAmB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC;QACD,KAAK,EAAE,GAAkB,EAAE;YACzB,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAClD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,103 +0,0 @@
1
- /**
2
- * Lowering a Python project. The Python tier-1 builder lives in the
3
- * `fluidgrids-workflows` package (module `fluidgrids_workflows`), so the CLI runs
4
- * that package's command line in the project directory:
5
- *
6
- * <python> -m fluidgrids_workflows lower <project> --connections - --entry workflows/a.py …
7
- *
8
- * - stdin: a JSON object of connection name to `{ "connectionId", "adapter" }`;
9
- * - stdout (exit status 0):
10
- * `{ "format": "fluidgrids.python-lower-result", "sdkVersion", "sourceHash",
11
- * "workflows": [{ "key", "module", "exportName", "irHash", "definition" }] }`;
12
- * - stderr (exit status 1): `fluidgrids-workflows: <message>[ (<reason>)]` when the
13
- * project cannot be lowered; exit status 2 for a usage problem.
14
- *
15
- * The Python package reads the project files itself, so the `sourceHash` it
16
- * reports covers what it lowered. Its definitions must be byte-identical to
17
- * what the TypeScript builder produces for the same graph (spec 03 §2), so the
18
- * CLI recomputes each `irHash` with `@fluidgrids/workflows` and warns when the
19
- * two SDKs disagree.
20
- */
21
- import { CliUserError } from '@burdenoff/cli-sdk/core';
22
- import { type ConnectionRef } from '@fluidgrids/workflows/ir';
23
- export declare const PYTHON_MODULE = "fluidgrids_workflows";
24
- export declare const PYTHON_PACKAGE = "fluidgrids-workflows";
25
- export declare const LOWER_RESULT_FORMAT = "fluidgrids.python-lower-result";
26
- /** Largest stdout plus stderr the CLI reads from the lowering process. */
27
- export declare const MAX_PYTHON_OUTPUT_BYTES: number;
28
- export declare const DEFAULT_PYTHON_TIMEOUT_MS = 120000;
29
- export interface PythonLoweredWorkflow {
30
- key: string;
31
- module: string;
32
- exportName: string;
33
- definition: Record<string, unknown>;
34
- }
35
- export interface PythonLowerResult {
36
- sdkVersion: string;
37
- sourceHash: string;
38
- workflows: PythonLoweredWorkflow[];
39
- /** Disagreements between the Python and TypeScript SDKs, one line each. */
40
- warnings: string[];
41
- /** Durable-function findings (`durable.phaseC`) that `push` refuses. */
42
- issues: PythonLowerIssue[];
43
- }
44
- /** A finding the Python lowering reports (`LowerResult.issues` of `fluidgrids_workflows`). */
45
- export interface PythonLowerIssue {
46
- code: string;
47
- message: string;
48
- module: string;
49
- key?: string;
50
- }
51
- /** Raised when the Python side reports connection names it could not resolve. */
52
- export declare class PythonUnresolvedConnectionsError extends CliUserError {
53
- readonly names: string[];
54
- constructor(message: string, names: string[]);
55
- }
56
- export interface PythonLowerOptions {
57
- /** Interpreter to run; see {@link resolvePythonInterpreter}. */
58
- python: string;
59
- /** The project root; also the working directory. */
60
- root: string;
61
- /** `workflows/*.py` modules to lower. */
62
- entries: readonly string[];
63
- connections: Readonly<Record<string, ConnectionRef>>;
64
- timeoutMs?: number;
65
- /** Largest stdout plus stderr to read; default {@link MAX_PYTHON_OUTPUT_BYTES}. */
66
- maxOutputBytes?: number;
67
- }
68
- /**
69
- * The interpreter for a Python project: `FLUIDGRIDS_PYTHON`, then the config's
70
- * `python`, then the project's `.venv`, then `python3` (`python` on Windows).
71
- */
72
- export declare function resolvePythonInterpreter(root: string, configured: string | undefined, env?: Readonly<Record<string, string | undefined>>): string;
73
- /** Parse the lowering result; `irHash` values are checked against this CLI's SDK. */
74
- export declare function parseLowerResult(stdout: string): PythonLowerResult;
75
- /** The optional `issues` of a lowering result (present only when there are some). */
76
- export declare function parseIssues(value: unknown): PythonLowerIssue[];
77
- /** The connection names in an "unresolved connections" message, or null. */
78
- export declare function unresolvedNames(message: string): string[] | null;
79
- /** The error for a failed `fluidgrids_workflows` command, from its exit and stderr. */
80
- export declare function pythonCliFailure(code: number | null, signal: string | null, stderr: string, python: string, command: string): CliUserError;
81
- export interface PythonCliOptions {
82
- python: string;
83
- /** The working directory. */
84
- root: string;
85
- /** The `fluidgrids_workflows` subcommand (for messages), first of `args`. */
86
- command: string;
87
- args: readonly string[];
88
- /** Written to the process's stdin. */
89
- stdin: string;
90
- timeoutMs?: number;
91
- maxOutputBytes?: number;
92
- /** Exit statuses that still answer on stdout (`replay` exits 1 when a history diverges). */
93
- okStatuses?: readonly number[];
94
- }
95
- /** Run `<python> -m fluidgrids_workflows <args>` and resolve its stdout (and exit status). */
96
- export declare function runPythonCli(options: PythonCliOptions): Promise<{
97
- stdout: string;
98
- stderr: string;
99
- code: number;
100
- }>;
101
- /** Run the Python lowering and return its workflows. */
102
- export declare function lowerPython(options: PythonLowerOptions): Promise<PythonLowerResult>;
103
- //# sourceMappingURL=python.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../src/code-first/python.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEtE,eAAO,MAAM,aAAa,yBAAyB,CAAC;AACpD,eAAO,MAAM,cAAc,yBAAyB,CAAC;AACrD,eAAO,MAAM,mBAAmB,mCAAmC,CAAC;AAEpE,0EAA0E;AAC1E,eAAO,MAAM,uBAAuB,QAAmB,CAAC;AACxD,eAAO,MAAM,yBAAyB,SAAU,CAAC;AAKjD,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM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AUR;AAqBD,qFAAqF;AACrF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAiDlE;AAED,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,EAAE,CA0B9D;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAUhE;AAWD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,YAAY,CA+Bd;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA4E3D;AAED,wDAAwD;AACxD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAazF"}
@@ -1,260 +0,0 @@
1
- /**
2
- * Lowering a Python project. The Python tier-1 builder lives in the
3
- * `fluidgrids-workflows` package (module `fluidgrids_workflows`), so the CLI runs
4
- * that package's command line in the project directory:
5
- *
6
- * <python> -m fluidgrids_workflows lower <project> --connections - --entry workflows/a.py …
7
- *
8
- * - stdin: a JSON object of connection name to `{ "connectionId", "adapter" }`;
9
- * - stdout (exit status 0):
10
- * `{ "format": "fluidgrids.python-lower-result", "sdkVersion", "sourceHash",
11
- * "workflows": [{ "key", "module", "exportName", "irHash", "definition" }] }`;
12
- * - stderr (exit status 1): `fluidgrids-workflows: <message>[ (<reason>)]` when the
13
- * project cannot be lowered; exit status 2 for a usage problem.
14
- *
15
- * The Python package reads the project files itself, so the `sourceHash` it
16
- * reports covers what it lowered. Its definitions must be byte-identical to
17
- * what the TypeScript builder produces for the same graph (spec 03 §2), so the
18
- * CLI recomputes each `irHash` with `@fluidgrids/workflows` and warns when the
19
- * two SDKs disagree.
20
- */
21
- import { spawn } from 'child_process';
22
- import { existsSync } from 'fs';
23
- import { join } from 'path';
24
- import { CliUserError } from '@burdenoff/cli-sdk/core';
25
- import { irHash } from '@fluidgrids/workflows/ir';
26
- export const PYTHON_MODULE = 'fluidgrids_workflows';
27
- export const PYTHON_PACKAGE = 'fluidgrids-workflows';
28
- export const LOWER_RESULT_FORMAT = 'fluidgrids.python-lower-result';
29
- /** Largest stdout plus stderr the CLI reads from the lowering process. */
30
- export const MAX_PYTHON_OUTPUT_BYTES = 64 * 1024 * 1024;
31
- export const DEFAULT_PYTHON_TIMEOUT_MS = 120_000;
32
- /** The message prefix `fluidgrids_workflows` uses for connection names it cannot resolve. */
33
- const UNRESOLVED_PREFIX = 'Create these connections in the workspace first: ';
34
- /** Raised when the Python side reports connection names it could not resolve. */
35
- export class PythonUnresolvedConnectionsError extends CliUserError {
36
- names;
37
- constructor(message, names) {
38
- super(message);
39
- this.names = names;
40
- this.name = 'PythonUnresolvedConnectionsError';
41
- }
42
- }
43
- /**
44
- * The interpreter for a Python project: `FLUIDGRIDS_PYTHON`, then the config's
45
- * `python`, then the project's `.venv`, then `python3` (`python` on Windows).
46
- */
47
- export function resolvePythonInterpreter(root, configured, env = process.env) {
48
- const fromEnv = env['FLUIDGRIDS_PYTHON'];
49
- if (fromEnv && fromEnv.trim() !== '')
50
- return fromEnv.trim();
51
- if (configured)
52
- return configured;
53
- const venv = process.platform === 'win32'
54
- ? join(root, '.venv', 'Scripts', 'python.exe')
55
- : join(root, '.venv', 'bin', 'python');
56
- if (existsSync(venv))
57
- return venv;
58
- return process.platform === 'win32' ? 'python' : 'python3';
59
- }
60
- function isRecord(value) {
61
- return typeof value === 'object' && value !== null && !Array.isArray(value);
62
- }
63
- function parseJsonObject(text) {
64
- try {
65
- const value = JSON.parse(text);
66
- return isRecord(value) ? value : null;
67
- }
68
- catch {
69
- return null;
70
- }
71
- }
72
- function lastLines(text, count) {
73
- return text.trim().split(/\r?\n/).slice(-count).join('\n');
74
- }
75
- const UPGRADE_HINT = `Upgrade the ${PYTHON_PACKAGE} package to a version that matches this CLI.`;
76
- /** Parse the lowering result; `irHash` values are checked against this CLI's SDK. */
77
- export function parseLowerResult(stdout) {
78
- const value = parseJsonObject(stdout);
79
- if (!value ||
80
- value['format'] !== LOWER_RESULT_FORMAT ||
81
- typeof value['sourceHash'] !== 'string' ||
82
- !Array.isArray(value['workflows'])) {
83
- throw new CliUserError(`python -m ${PYTHON_MODULE} lower returned an unexpected result (expected ${LOWER_RESULT_FORMAT}).`, { hint: UPGRADE_HINT });
84
- }
85
- const sdkVersion = typeof value['sdkVersion'] === 'string' ? value['sdkVersion'] : 'unknown';
86
- const warnings = [];
87
- const workflows = value['workflows'].map((item, index) => {
88
- if (!isRecord(item) ||
89
- typeof item['key'] !== 'string' ||
90
- typeof item['module'] !== 'string' ||
91
- typeof item['exportName'] !== 'string' ||
92
- !isRecord(item['definition'])) {
93
- throw new CliUserError(`python -m ${PYTHON_MODULE} lower returned a malformed workflow at index ${index}.`, { hint: UPGRADE_HINT });
94
- }
95
- const reported = item['irHash'];
96
- const computed = irHash(item['definition']);
97
- if (typeof reported === 'string' && reported !== computed) {
98
- warnings.push(`${item['key']}: ${PYTHON_PACKAGE} ${sdkVersion} reports irHash ${reported}, this CLI computes ${computed}; align the two SDK versions`);
99
- }
100
- return {
101
- key: item['key'],
102
- module: item['module'],
103
- exportName: item['exportName'],
104
- definition: item['definition'],
105
- };
106
- });
107
- return {
108
- sdkVersion,
109
- sourceHash: value['sourceHash'],
110
- workflows,
111
- warnings,
112
- issues: parseIssues(value['issues']),
113
- };
114
- }
115
- /** The optional `issues` of a lowering result (present only when there are some). */
116
- export function parseIssues(value) {
117
- if (value === undefined)
118
- return [];
119
- if (!Array.isArray(value)) {
120
- throw new CliUserError(`python -m ${PYTHON_MODULE} lower returned malformed issues.`, {
121
- hint: UPGRADE_HINT,
122
- });
123
- }
124
- return value.map((item, index) => {
125
- if (!isRecord(item) ||
126
- typeof item['code'] !== 'string' ||
127
- typeof item['message'] !== 'string' ||
128
- typeof item['module'] !== 'string') {
129
- throw new CliUserError(`python -m ${PYTHON_MODULE} lower returned a malformed issue at index ${index}.`, { hint: UPGRADE_HINT });
130
- }
131
- return {
132
- code: item['code'],
133
- message: item['message'],
134
- module: item['module'],
135
- ...(typeof item['key'] === 'string' ? { key: item['key'] } : {}),
136
- };
137
- });
138
- }
139
- /** The connection names in an "unresolved connections" message, or null. */
140
- export function unresolvedNames(message) {
141
- const at = message.indexOf(UNRESOLVED_PREFIX);
142
- if (at < 0)
143
- return null;
144
- const names = message
145
- .slice(at + UNRESOLVED_PREFIX.length)
146
- .split(/\r?\n/)[0]
147
- ?.split(',')
148
- .map((name) => name.trim())
149
- .filter((name) => name !== '');
150
- return names && names.length > 0 ? names : null;
151
- }
152
- /** The message the package wrote, without its program-name prefix. */
153
- function reportedMessage(stderr) {
154
- const lines = stderr
155
- .split(/\r?\n/)
156
- .filter((line) => line.startsWith('fluidgrids-workflows: '))
157
- .map((line) => line.slice('fluidgrids-workflows: '.length).trim());
158
- return lines.length > 0 ? lines.join('\n') : null;
159
- }
160
- /** The error for a failed `fluidgrids_workflows` command, from its exit and stderr. */
161
- export function pythonCliFailure(code, signal, stderr, python, command) {
162
- if (/No module named '?fluidgrids_workflows'?/.test(stderr)) {
163
- return new CliUserError(`The ${PYTHON_PACKAGE} Python package is not installed for ${python}.`, {
164
- hint: `Install it with \`${python} -m pip install ${PYTHON_PACKAGE}\`, or point FLUIDGRIDS_PYTHON (or "python" in fluidgrids.config.json) at an interpreter that has it.`,
165
- });
166
- }
167
- if (code === 2 &&
168
- (stderr.includes(`invalid choice: '${command}'`) || /unrecognized arguments/.test(stderr))) {
169
- return new CliUserError(`The installed ${PYTHON_PACKAGE} package cannot ${command === 'lower' ? 'lower' : command} projects.`, { hint: UPGRADE_HINT });
170
- }
171
- const message = reportedMessage(stderr);
172
- if (message) {
173
- const names = unresolvedNames(message);
174
- if (names)
175
- return new PythonUnresolvedConnectionsError(message, names);
176
- const what = command === 'lower' ? 'Lowering' : command === 'build' ? 'Building' : 'Running';
177
- return new CliUserError(`${what} the Python workflows failed: ${message}`);
178
- }
179
- const how = signal ? `was stopped by ${signal}` : `exited with status ${String(code)}`;
180
- const detail = lastLines(stderr, 20);
181
- return new CliUserError(`${python} -m ${PYTHON_MODULE} ${command} ${how}.`, detail ? { hint: detail } : undefined);
182
- }
183
- /** Run `<python> -m fluidgrids_workflows <args>` and resolve its stdout (and exit status). */
184
- export function runPythonCli(options) {
185
- const args = ['-m', PYTHON_MODULE, ...options.args];
186
- const okStatuses = options.okStatuses ?? [0];
187
- return new Promise((resolve, reject) => {
188
- const child = spawn(options.python, args, {
189
- cwd: options.root,
190
- stdio: ['pipe', 'pipe', 'pipe'],
191
- env: { ...process.env, PYTHONDONTWRITEBYTECODE: '1', PYTHONIOENCODING: 'utf-8' },
192
- });
193
- const stdout = [];
194
- const stderr = [];
195
- let bytes = 0;
196
- const maxOutputBytes = options.maxOutputBytes ?? MAX_PYTHON_OUTPUT_BYTES;
197
- const timeoutMs = options.timeoutMs ?? DEFAULT_PYTHON_TIMEOUT_MS;
198
- let settled = false;
199
- const settle = (fn) => {
200
- if (settled)
201
- return;
202
- settled = true;
203
- clearTimeout(timer);
204
- fn();
205
- };
206
- const timer = setTimeout(() => {
207
- child.kill('SIGKILL');
208
- settle(() => reject(new CliUserError(`python -m ${PYTHON_MODULE} ${options.command} did not finish within ${timeoutMs} ms.`)));
209
- }, timeoutMs);
210
- const collect = (into) => (chunk) => {
211
- bytes += chunk.length;
212
- if (bytes > maxOutputBytes) {
213
- child.kill('SIGKILL');
214
- settle(() => reject(new CliUserError(`python -m ${PYTHON_MODULE} ${options.command} wrote more than ${maxOutputBytes} bytes; stopped it.`)));
215
- return;
216
- }
217
- into.push(chunk);
218
- };
219
- child.stdout.on('data', collect(stdout));
220
- child.stderr.on('data', collect(stderr));
221
- child.on('error', (error) => {
222
- settle(() => reject(error.code === 'ENOENT'
223
- ? new CliUserError(`Python interpreter "${options.python}" was not found.`, {
224
- hint: `Install Python 3.11 or later with the ${PYTHON_PACKAGE} package, or set FLUIDGRIDS_PYTHON.`,
225
- })
226
- : new CliUserError(`Could not start ${options.python}: ${error.message}`)));
227
- });
228
- child.on('close', (code, signal) => {
229
- const out = Buffer.concat(stdout).toString('utf8');
230
- const err = Buffer.concat(stderr).toString('utf8');
231
- settle(() => {
232
- if (code === null || !okStatuses.includes(code)) {
233
- reject(pythonCliFailure(code, signal, err, options.python, options.command));
234
- return;
235
- }
236
- resolve({ stdout: out, stderr: err, code });
237
- });
238
- });
239
- // A child that exits before reading stdin raises EPIPE here; the close handler reports it.
240
- child.stdin.on('error', () => undefined);
241
- child.stdin.end(options.stdin, 'utf8');
242
- });
243
- }
244
- /** Run the Python lowering and return its workflows. */
245
- export async function lowerPython(options) {
246
- const args = ['lower', options.root, '--connections', '-'];
247
- for (const entry of options.entries)
248
- args.push('--entry', entry);
249
- const { stdout } = await runPythonCli({
250
- python: options.python,
251
- root: options.root,
252
- command: 'lower',
253
- args,
254
- stdin: JSON.stringify(options.connections),
255
- ...(options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),
256
- ...(options.maxOutputBytes !== undefined ? { maxOutputBytes: options.maxOutputBytes } : {}),
257
- });
258
- return parseLowerResult(stdout);
259
- }
260
- //# sourceMappingURL=python.js.map