@nodetool-ai/cli 0.8.3 → 0.8.4-a24.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 (252) hide show
  1. package/dist/.nodetool-build-stamp +1 -1
  2. package/dist/app-debug/harness.js +1 -1
  3. package/dist/app-debug/harness.js.map +1 -1
  4. package/dist/command-errors.d.ts +7 -9
  5. package/dist/command-errors.d.ts.map +1 -1
  6. package/dist/command-errors.js +36 -2
  7. package/dist/command-errors.js.map +1 -1
  8. package/dist/commands/__tests__/jtbd.test.js +1 -1
  9. package/dist/commands/__tests__/jtbd.test.js.map +1 -1
  10. package/dist/commands/__tests__/runtime.test.d.ts +2 -0
  11. package/dist/commands/__tests__/runtime.test.d.ts.map +1 -0
  12. package/dist/commands/__tests__/runtime.test.js +128 -0
  13. package/dist/commands/__tests__/runtime.test.js.map +1 -0
  14. package/dist/commands/agent.js +1 -1
  15. package/dist/commands/agent.js.map +1 -1
  16. package/dist/commands/app.d.ts.map +1 -1
  17. package/dist/commands/app.js +3 -5
  18. package/dist/commands/app.js.map +1 -1
  19. package/dist/commands/apps.d.ts.map +1 -1
  20. package/dist/commands/apps.js +20 -20
  21. package/dist/commands/apps.js.map +1 -1
  22. package/dist/commands/authorized-pack-install.d.ts +7 -0
  23. package/dist/commands/authorized-pack-install.d.ts.map +1 -0
  24. package/dist/commands/authorized-pack-install.js +20 -0
  25. package/dist/commands/authorized-pack-install.js.map +1 -0
  26. package/dist/commands/debug.d.ts.map +1 -1
  27. package/dist/commands/debug.js +15 -3
  28. package/dist/commands/debug.js.map +1 -1
  29. package/dist/commands/eval.js +2 -2
  30. package/dist/commands/eval.js.map +1 -1
  31. package/dist/commands/game-benchmark.d.ts +4 -0
  32. package/dist/commands/game-benchmark.d.ts.map +1 -1
  33. package/dist/commands/game-benchmark.js +8 -0
  34. package/dist/commands/game-benchmark.js.map +1 -1
  35. package/dist/commands/game-smoke.d.ts.map +1 -1
  36. package/dist/commands/game-smoke.js +3 -3
  37. package/dist/commands/game-smoke.js.map +1 -1
  38. package/dist/commands/game.d.ts.map +1 -1
  39. package/dist/commands/game.js +72 -25
  40. package/dist/commands/game.js.map +1 -1
  41. package/dist/commands/harness.d.ts +21 -0
  42. package/dist/commands/harness.d.ts.map +1 -1
  43. package/dist/commands/harness.js +198 -10
  44. package/dist/commands/harness.js.map +1 -1
  45. package/dist/commands/install-missing-packs.d.ts +21 -0
  46. package/dist/commands/install-missing-packs.d.ts.map +1 -0
  47. package/dist/commands/install-missing-packs.js +48 -0
  48. package/dist/commands/install-missing-packs.js.map +1 -0
  49. package/dist/commands/js-script.d.ts.map +1 -1
  50. package/dist/commands/js-script.js +11 -9
  51. package/dist/commands/js-script.js.map +1 -1
  52. package/dist/commands/node.d.ts.map +1 -1
  53. package/dist/commands/node.js +15 -3
  54. package/dist/commands/node.js.map +1 -1
  55. package/dist/commands/pack-install-authorization.d.ts +40 -0
  56. package/dist/commands/pack-install-authorization.d.ts.map +1 -0
  57. package/dist/commands/pack-install-authorization.js +131 -0
  58. package/dist/commands/pack-install-authorization.js.map +1 -0
  59. package/dist/commands/pack-management.d.ts +26 -0
  60. package/dist/commands/pack-management.d.ts.map +1 -0
  61. package/dist/commands/pack-management.js +74 -0
  62. package/dist/commands/pack-management.js.map +1 -0
  63. package/dist/commands/packs.d.ts +2 -1
  64. package/dist/commands/packs.d.ts.map +1 -1
  65. package/dist/commands/packs.js +7 -2
  66. package/dist/commands/packs.js.map +1 -1
  67. package/dist/commands/projects.d.ts +11 -0
  68. package/dist/commands/projects.d.ts.map +1 -0
  69. package/dist/commands/projects.js +145 -0
  70. package/dist/commands/projects.js.map +1 -0
  71. package/dist/commands/resource-read.d.ts.map +1 -1
  72. package/dist/commands/resource-read.js +6 -12
  73. package/dist/commands/resource-read.js.map +1 -1
  74. package/dist/commands/runs.js +1 -1
  75. package/dist/commands/runs.js.map +1 -1
  76. package/dist/commands/runtime.d.ts +3 -0
  77. package/dist/commands/runtime.d.ts.map +1 -0
  78. package/dist/commands/runtime.js +122 -0
  79. package/dist/commands/runtime.js.map +1 -0
  80. package/dist/commands/sketch.d.ts.map +1 -1
  81. package/dist/commands/sketch.js +2 -4
  82. package/dist/commands/sketch.js.map +1 -1
  83. package/dist/commands/timeline-render.d.ts +0 -10
  84. package/dist/commands/timeline-render.d.ts.map +1 -1
  85. package/dist/commands/timeline-render.js +18 -8
  86. package/dist/commands/timeline-render.js.map +1 -1
  87. package/dist/commands/timeline-score.d.ts.map +1 -1
  88. package/dist/commands/timeline-score.js +1 -2
  89. package/dist/commands/timeline-score.js.map +1 -1
  90. package/dist/commands/timeline.d.ts.map +1 -1
  91. package/dist/commands/timeline.js +2 -4
  92. package/dist/commands/timeline.js.map +1 -1
  93. package/dist/commands/validate.d.ts +2 -0
  94. package/dist/commands/validate.d.ts.map +1 -1
  95. package/dist/commands/validate.js +8 -3
  96. package/dist/commands/validate.js.map +1 -1
  97. package/dist/commands/version-commands.d.ts.map +1 -1
  98. package/dist/commands/version-commands.js +5 -10
  99. package/dist/commands/version-commands.js.map +1 -1
  100. package/dist/debug/server-runner.d.ts.map +1 -1
  101. package/dist/debug/server-runner.js +7 -1
  102. package/dist/debug/server-runner.js.map +1 -1
  103. package/dist/debug/target.d.ts.map +1 -1
  104. package/dist/debug/target.js +2 -11
  105. package/dist/debug/target.js.map +1 -1
  106. package/dist/evals/graph-runner.d.ts +1 -1
  107. package/dist/evals/graph-runner.d.ts.map +1 -1
  108. package/dist/evals/graph-runner.js +2 -2
  109. package/dist/evals/graph-runner.js.map +1 -1
  110. package/dist/harness/capability-table.d.ts.map +1 -1
  111. package/dist/harness/capability-table.js +17 -9
  112. package/dist/harness/capability-table.js.map +1 -1
  113. package/dist/harness/registry.d.ts.map +1 -1
  114. package/dist/harness/registry.js +131 -2
  115. package/dist/harness/registry.js.map +1 -1
  116. package/dist/index.js +10 -3
  117. package/dist/index.js.map +1 -1
  118. package/dist/install-lock.d.ts +12 -0
  119. package/dist/install-lock.d.ts.map +1 -0
  120. package/dist/install-lock.js +139 -0
  121. package/dist/install-lock.js.map +1 -0
  122. package/dist/js-script-debug/harness.d.ts +4 -0
  123. package/dist/js-script-debug/harness.d.ts.map +1 -1
  124. package/dist/js-script-debug/harness.js.map +1 -1
  125. package/dist/node/run-node.d.ts +3 -0
  126. package/dist/node/run-node.d.ts.map +1 -1
  127. package/dist/node/run-node.js +18 -2
  128. package/dist/node/run-node.js.map +1 -1
  129. package/dist/node-registry.d.ts +6 -4
  130. package/dist/node-registry.d.ts.map +1 -1
  131. package/dist/node-registry.js +10 -5
  132. package/dist/node-registry.js.map +1 -1
  133. package/dist/nodetool-main.js +57 -62
  134. package/dist/nodetool-main.js.map +1 -1
  135. package/dist/nodetool.js +8 -1
  136. package/dist/nodetool.js.map +1 -1
  137. package/dist/npm-runner.d.ts +23 -0
  138. package/dist/npm-runner.d.ts.map +1 -0
  139. package/dist/npm-runner.js +159 -0
  140. package/dist/npm-runner.js.map +1 -0
  141. package/dist/optional-node-root.d.ts +10 -0
  142. package/dist/optional-node-root.d.ts.map +1 -0
  143. package/dist/optional-node-root.js +26 -0
  144. package/dist/optional-node-root.js.map +1 -0
  145. package/dist/packs/command-service.d.ts +14 -0
  146. package/dist/packs/command-service.d.ts.map +1 -0
  147. package/dist/packs/command-service.js +190 -0
  148. package/dist/packs/command-service.js.map +1 -0
  149. package/dist/packs/doctor-lock.d.ts +8 -0
  150. package/dist/packs/doctor-lock.d.ts.map +1 -0
  151. package/dist/packs/doctor-lock.js +50 -0
  152. package/dist/packs/doctor-lock.js.map +1 -0
  153. package/dist/packs/doctor.d.ts +25 -0
  154. package/dist/packs/doctor.d.ts.map +1 -0
  155. package/dist/packs/doctor.js +12 -0
  156. package/dist/packs/doctor.js.map +1 -0
  157. package/dist/packs/global-bootstrap.d.ts +11 -0
  158. package/dist/packs/global-bootstrap.d.ts.map +1 -0
  159. package/dist/packs/global-bootstrap.js +72 -0
  160. package/dist/packs/global-bootstrap.js.map +1 -0
  161. package/dist/packs/host.d.ts +17 -0
  162. package/dist/packs/host.d.ts.map +1 -0
  163. package/dist/packs/host.js +79 -0
  164. package/dist/packs/host.js.map +1 -0
  165. package/dist/packs/install-manifests.d.ts +2 -0
  166. package/dist/packs/install-manifests.d.ts.map +1 -0
  167. package/dist/packs/install-manifests.js +30 -0
  168. package/dist/packs/install-manifests.js.map +1 -0
  169. package/dist/packs/install-process.d.ts +4 -0
  170. package/dist/packs/install-process.d.ts.map +1 -0
  171. package/dist/packs/install-process.js +11 -0
  172. package/dist/packs/install-process.js.map +1 -0
  173. package/dist/packs/install-selection.d.ts +39 -0
  174. package/dist/packs/install-selection.d.ts.map +1 -0
  175. package/dist/packs/install-selection.js +67 -0
  176. package/dist/packs/install-selection.js.map +1 -0
  177. package/dist/packs/install-state.d.ts +21 -0
  178. package/dist/packs/install-state.d.ts.map +1 -0
  179. package/dist/packs/install-state.js +44 -0
  180. package/dist/packs/install-state.js.map +1 -0
  181. package/dist/packs/install-tree.d.ts +35 -0
  182. package/dist/packs/install-tree.d.ts.map +1 -0
  183. package/dist/packs/install-tree.js +253 -0
  184. package/dist/packs/install-tree.js.map +1 -0
  185. package/dist/packs/install-verification.d.ts +12 -0
  186. package/dist/packs/install-verification.d.ts.map +1 -0
  187. package/dist/packs/install-verification.js +76 -0
  188. package/dist/packs/install-verification.js.map +1 -0
  189. package/dist/packs/installed.d.ts +36 -0
  190. package/dist/packs/installed.d.ts.map +1 -0
  191. package/dist/packs/installed.js +87 -0
  192. package/dist/packs/installed.js.map +1 -0
  193. package/dist/packs/installer-load-check.d.ts +4 -0
  194. package/dist/packs/installer-load-check.d.ts.map +1 -0
  195. package/dist/packs/installer-load-check.js +52 -0
  196. package/dist/packs/installer-load-check.js.map +1 -0
  197. package/dist/packs/installer.d.ts +16 -0
  198. package/dist/packs/installer.d.ts.map +1 -0
  199. package/dist/packs/installer.js +142 -0
  200. package/dist/packs/installer.js.map +1 -0
  201. package/dist/packs/management.d.ts +51 -0
  202. package/dist/packs/management.d.ts.map +1 -0
  203. package/dist/packs/management.js +81 -0
  204. package/dist/packs/management.js.map +1 -0
  205. package/dist/packs/mode.d.ts +42 -0
  206. package/dist/packs/mode.d.ts.map +1 -0
  207. package/dist/packs/mode.js +215 -0
  208. package/dist/packs/mode.js.map +1 -0
  209. package/dist/packs/owned-replay-plan.d.ts +5 -0
  210. package/dist/packs/owned-replay-plan.d.ts.map +1 -0
  211. package/dist/packs/owned-replay-plan.js +68 -0
  212. package/dist/packs/owned-replay-plan.js.map +1 -0
  213. package/dist/packs/removal-selection.d.ts +12 -0
  214. package/dist/packs/removal-selection.d.ts.map +1 -0
  215. package/dist/packs/removal-selection.js +169 -0
  216. package/dist/packs/removal-selection.js.map +1 -0
  217. package/dist/packs/removal.d.ts +12 -0
  218. package/dist/packs/removal.d.ts.map +1 -0
  219. package/dist/packs/removal.js +138 -0
  220. package/dist/packs/removal.js.map +1 -0
  221. package/dist/packs/repair.d.ts +2 -0
  222. package/dist/packs/repair.d.ts.map +1 -0
  223. package/dist/packs/repair.js +2 -0
  224. package/dist/packs/repair.js.map +1 -0
  225. package/dist/packs/serve.d.ts +2 -0
  226. package/dist/packs/serve.d.ts.map +1 -0
  227. package/dist/packs/serve.js +14 -0
  228. package/dist/packs/serve.js.map +1 -0
  229. package/dist/providers.d.ts +1 -1
  230. package/dist/providers.d.ts.map +1 -1
  231. package/dist/providers.js +42 -6
  232. package/dist/providers.js.map +1 -1
  233. package/dist/run-dsl-supervised.d.ts.map +1 -1
  234. package/dist/run-dsl-supervised.js +8 -1
  235. package/dist/run-dsl-supervised.js.map +1 -1
  236. package/dist/runtime-env.d.ts +4 -0
  237. package/dist/runtime-env.d.ts.map +1 -0
  238. package/dist/runtime-env.js +31 -0
  239. package/dist/runtime-env.js.map +1 -0
  240. package/dist/sketch-debug/harness.d.ts +1 -1
  241. package/dist/sketch-debug/harness.d.ts.map +1 -1
  242. package/dist/sketch-debug/harness.js +2 -7
  243. package/dist/sketch-debug/harness.js.map +1 -1
  244. package/dist/validate/index.d.ts +3 -2
  245. package/dist/validate/index.d.ts.map +1 -1
  246. package/dist/validate/index.js +30 -2
  247. package/dist/validate/index.js.map +1 -1
  248. package/dist/workflow-file.d.ts +3 -0
  249. package/dist/workflow-file.d.ts.map +1 -0
  250. package/dist/workflow-file.js +176 -0
  251. package/dist/workflow-file.js.map +1 -0
  252. package/package.json +34 -41
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Builds a NodeRegistry populated with every TypeScript node pack the CLI
3
- * ships. Shared by the debug, validate, and single-node-run harnesses so they
2
+ * Builds a NodeRegistry with installed TypeScript packs and catalog metadata
3
+ * for missing enabled packs. Shared by the debug, validate, and single-node-run harnesses so they
4
4
  * all resolve node types against the same set.
5
5
  *
6
6
  * Python-only node packs (huggingface worker nodes, mlx, etc.) are not
@@ -8,7 +8,9 @@
8
8
  * Python bridge at execution time. Static tools (validate) therefore treat
9
9
  * unknown types as "not in the local TS registry".
10
10
  */
11
- import { NodeRegistry } from "@nodetool-ai/node-sdk";
11
+ import { NodeRegistry, type BuiltinPackPolicy } from "@nodetool-ai/node-sdk";
12
+ /** CLI harnesses expose optional packs independently of user toggles. */
13
+ export declare const CLI_BUILTIN_PACK_POLICY: BuiltinPackPolicy;
12
14
  /** Workflow JSON runs and local MCP historically omit AtlasCloud too. */
13
15
  export declare const CLI_LOCAL_BUILTIN_PACK_POLICY: {
14
16
  includeOptionalPacks?: boolean;
@@ -23,5 +25,5 @@ export declare const CLI_DSL_BUILTIN_PACK_POLICY: {
23
25
  [k: string]: boolean;
24
26
  };
25
27
  };
26
- export declare function buildFullRegistry(): NodeRegistry;
28
+ export declare function buildFullRegistry(): Promise<NodeRegistry>;
27
29
  //# sourceMappingURL=node-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-registry.d.ts","sourceRoot":"","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAQrD,yEAAyE;AACzE,eAAO,MAAM,6BAA6B;;;;;;CAMzC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,2BAA2B;IACtC,gBAAgB;;;CAGjB,CAAC;AAEF,wBAAgB,iBAAiB,IAAI,YAAY,CAKhD"}
1
+ {"version":3,"file":"node-registry.d.ts","sourceRoot":"","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAM7E,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,EAAE,iBAGrC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,6BAA6B;;;;;;CAMzC,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,2BAA2B;IACtC,gBAAgB;;;CAGjB,CAAC;AAEF,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,CAK/D"}
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Builds a NodeRegistry populated with every TypeScript node pack the CLI
3
- * ships. Shared by the debug, validate, and single-node-run harnesses so they
2
+ * Builds a NodeRegistry with installed TypeScript packs and catalog metadata
3
+ * for missing enabled packs. Shared by the debug, validate, and single-node-run harnesses so they
4
4
  * all resolve node types against the same set.
5
5
  *
6
6
  * Python-only node packs (huggingface worker nodes, mlx, etc.) are not
@@ -9,9 +9,14 @@
9
9
  * unknown types as "not in the local TS registry".
10
10
  */
11
11
  import { NodeRegistry } from "@nodetool-ai/node-sdk";
12
- import { registerBuiltinPacks, CLI_BUILTIN_PACK_POLICY } from "@nodetool-ai/base-nodes/builtin-packs";
12
+ import { registerCliPacks } from "./packs/host.js";
13
13
  import { BUILTIN_NODE_PACKS } from "@nodetool-ai/protocol";
14
14
  import { installSandboxCatalog } from "./sandbox-catalog.js";
15
+ /** CLI harnesses expose optional packs independently of user toggles. */
16
+ export const CLI_BUILTIN_PACK_POLICY = {
17
+ includeOptionalPacks: true,
18
+ excludedPackIds: ["kie", "topaz", "higgsfield", "together"]
19
+ };
15
20
  /** Workflow JSON runs and local MCP historically omit AtlasCloud too. */
16
21
  export const CLI_LOCAL_BUILTIN_PACK_POLICY = {
17
22
  ...CLI_BUILTIN_PACK_POLICY,
@@ -24,10 +29,10 @@ export const CLI_LOCAL_BUILTIN_PACK_POLICY = {
24
29
  export const CLI_DSL_BUILTIN_PACK_POLICY = {
25
30
  enabledOverrides: Object.fromEntries(BUILTIN_NODE_PACKS.map((pack) => [pack.id, false]))
26
31
  };
27
- export function buildFullRegistry() {
32
+ export async function buildFullRegistry() {
28
33
  installSandboxCatalog();
29
34
  const registry = new NodeRegistry();
30
- registerBuiltinPacks(registry, CLI_BUILTIN_PACK_POLICY);
35
+ await registerCliPacks(registry, CLI_BUILTIN_PACK_POLICY);
31
36
  return registry;
32
37
  }
33
38
  //# sourceMappingURL=node-registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node-registry.js","sourceRoot":"","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,yEAAyE;AACzE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,GAAG,uBAAuB;IAC1B,eAAe,EAAE;QACf,GAAG,CAAC,uBAAuB,CAAC,eAAe,IAAI,EAAE,CAAC;QAClD,YAAY;KACb;CACF,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAClC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CACnD;CACF,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,qBAAqB,EAAE,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;IACpC,oBAAoB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
1
+ {"version":3,"file":"node-registry.js","sourceRoot":"","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAA0B,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,yEAAyE;AACzE,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC;CAC5D,CAAC;AAEF,yEAAyE;AACzE,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,GAAG,uBAAuB;IAC1B,eAAe,EAAE;QACf,GAAG,CAAC,uBAAuB,CAAC,eAAe,IAAI,EAAE,CAAC;QAClD,YAAY;KACb;CACF,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAClC,kBAAkB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CACnD;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,qBAAqB,EAAE,CAAC;IACxB,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;IACpC,MAAM,gBAAgB,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;IAC1D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -22,9 +22,10 @@ import { readCachedHfModels, searchCachedHfModels } from "@nodetool-ai/huggingfa
22
22
  import { initMasterKey } from "@nodetool-ai/security";
23
23
  import { installLocalModelInterfaces } from "./local-model-interfaces.js";
24
24
  import { getDefaultDbPath, getDefaultAssetsPath } from "@nodetool-ai/config";
25
- import { ExecutionSession, isExecutionPreflightError } from "@nodetool-ai/execution";
25
+ import { ExecutionSession } from "@nodetool-ai/execution";
26
26
  import { NodeRegistry, createGraphNodeTypeResolver } from "@nodetool-ai/node-sdk";
27
- import { registerBuiltinPacks } from "@nodetool-ai/base-nodes/builtin-packs";
27
+ import { registerCliPacks } from "./packs/host.js";
28
+ import { refusePackInstallsInProcess } from "./packs/install-process.js";
28
29
  import { CLI_LOCAL_BUILTIN_PACK_POLICY, CLI_DSL_BUILTIN_PACK_POLICY } from "./node-registry.js";
29
30
  import { ProcessingContext, createLocalWorkspace, initTelemetry, onPythonBridgeCreated } from "@nodetool-ai/runtime";
30
31
  import { FileStorageAdapter } from "@nodetool-ai/storage";
@@ -32,6 +33,8 @@ import { mkdirSync } from "node:fs";
32
33
  import { addSupervisorOptions, createSupervisorHandle, parseSupervisorFlags, printSupervisedSummary, recordSupervisorCost, streamInterventionLines } from "./supervisor.js";
33
34
  import { registerPackageCommands } from "./commands/package.js";
34
35
  import { registerPackCommands } from "./commands/packs.js";
36
+ import { installMissingPacksAndReexec } from "./commands/install-missing-packs.js";
37
+ import { registerRuntimeCommands } from "./commands/runtime.js";
35
38
  import { registerDeployCommands } from "./commands/deploy.js";
36
39
  import { registerHfCommands } from "./commands/models-hf.js";
37
40
  import { registerWorkerCommands } from "./commands/worker.js";
@@ -60,6 +63,7 @@ import { registerCostsCommands } from "./commands/costs.js";
60
63
  import { registerErrorsCommands } from "./commands/errors.js";
61
64
  import { registerGenerationsCommands } from "./commands/generations.js";
62
65
  import { registerRunsCommands } from "./commands/runs.js";
66
+ import { registerProjectCommands } from "./commands/projects.js";
63
67
  import { registerGameCommands } from "./commands/game.js";
64
68
  import { registerAuthCommands } from "./commands/auth.js";
65
69
  import { registerTelegramCommands } from "./commands/telegram.js";
@@ -68,7 +72,7 @@ import { createApiClient } from "./api-client.js";
68
72
  import { listAllModels, listConfiguredProviderInfo, listOllamaModels, listProviderModels } from "./providers.js";
69
73
  import { isString } from "./predicates.js";
70
74
  import { printTable, asJson, readSecretValue } from "./commands/output.js";
71
- import { printCommandError } from "./command-errors.js";
75
+ import { printCommandError, commandMissingRuntime, commandMissingPack } from "./command-errors.js";
72
76
  import { childExitCode } from "./child-exit.js";
73
77
  const __filename = fileURLToPath(import.meta.url);
74
78
  const __dirname = dirname(__filename);
@@ -93,7 +97,9 @@ function ensureDb() {
93
97
  initDb(getDefaultDbPath());
94
98
  }
95
99
  async function setupDb() {
96
- ensureDb();
100
+ const dbPath = getDefaultDbPath();
101
+ await migrateSqliteDb(dbPath);
102
+ initDb(dbPath);
97
103
  // Resolve the master encryption key from keychain / env / AWS so that
98
104
  // both encryption (Secret.upsert) and decryption (Secret.getDecryptedValue)
99
105
  // use the same persistent key. Without this, a fresh process would
@@ -211,14 +217,6 @@ async function makeLocalAssetFetcher() {
211
217
  // other. The interfaces touch the database only when a node calls them, so
212
218
  // installing them before `setupDb()` is safe.
213
219
  await installLocalModelInterfaces();
214
- /**
215
- * What to print when a run command fails. A preflight refusal already reads as
216
- * a complete explanation — printing the error class in front of it only buries
217
- * the secret name the user has to go set.
218
- */
219
- function describeRunFailure(error) {
220
- return isExecutionPreflightError(error) ? error.message : String(error);
221
- }
222
220
  // ---------------------------------------------------------------------------
223
221
  // info
224
222
  // ---------------------------------------------------------------------------
@@ -267,12 +265,13 @@ function parseTraceStdout(v) {
267
265
  addSupervisorOptions(program
268
266
  .command("run <dsl-file>")
269
267
  .description("Run a TypeScript/JavaScript DSL workflow file")
270
- .option("--json", "Output results as JSON (default: pretty-print)")).action(async (dslFile, opts) => {
268
+ .option("--json", "Output results as JSON (default: pretty-print)")
269
+ .option("--install-missing", "Authorize missing node pack installation, then re-execute once")).action(async (dslFile, opts) => {
271
270
  try {
272
271
  const { resolve } = await import("node:path");
273
272
  const { runDslFile } = await import("./run-dsl.js");
274
273
  const { NodeRegistry } = await import("@nodetool-ai/node-sdk");
275
- registerBuiltinPacks(NodeRegistry.global, CLI_DSL_BUILTIN_PACK_POLICY);
274
+ await registerCliPacks(NodeRegistry.global, CLI_DSL_BUILTIN_PACK_POLICY);
276
275
  const supervisorConfig = parseSupervisorFlags(opts);
277
276
  const absolutePath = resolve(dslFile);
278
277
  let results;
@@ -305,8 +304,11 @@ addSupervisorOptions(program
305
304
  }
306
305
  }
307
306
  catch (e) {
308
- console.error(describeRunFailure(e));
309
- process.exit(1);
307
+ const exit = await installMissingPacksAndReexec(e, { command: "run", installMissing: opts.installMissing });
308
+ if (exit !== null) {
309
+ process.exit(exit);
310
+ }
311
+ process.exit(printCommandError(e, opts.json));
310
312
  }
311
313
  });
312
314
  program
@@ -364,10 +366,11 @@ program
364
366
  .option("--host <host>", "Host to bind", "127.0.0.1")
365
367
  .option("--port <port>", "Port to listen on", "7777")
366
368
  .action((opts) => {
367
- const serverPath = resolve(__dirname, "../../websocket/dist/server.js");
369
+ refusePackInstallsInProcess("serve");
370
+ const serverPath = resolve(__dirname, "../dist/packs/serve.js");
368
371
  process.env["HOST"] = opts.host;
369
372
  process.env["PORT"] = opts.port;
370
- const result = spawnSync("node", [serverPath], {
373
+ const result = spawnSync(process.execPath, [serverPath], {
371
374
  stdio: "inherit",
372
375
  env: { ...process.env }
373
376
  });
@@ -413,6 +416,7 @@ addSupervisorOptions(workflows
413
416
  .description("Run a workflow by ID, JSON file, or TypeScript DSL file")
414
417
  .option("--params <json>", "JSON params string")
415
418
  .option("--json", "Output as JSON")
419
+ .option("--install-missing", "Authorize missing node pack installation, then re-execute once")
416
420
  .option("--asset-output-mode <mode>", "How media outputs are materialized: native | raw | data_uri | workspace | storage_url | temp_url", "native")
417
421
  .option("--workspace <dir>", "Workspace directory for workspace-mode asset output (default: ./nodetool-output)")
418
422
  .option("--trigger-event <json>", 'Wake a trigger node as the scheduler/webhook adapter would: \'{"node_id":"watch","payload":{"path":"/tmp/a.csv","event":"created"}}\'. ' +
@@ -455,14 +459,8 @@ addSupervisorOptions(workflows
455
459
  /** A DSL/JSON workflow file: the graph, optionally wrapped. */
456
460
  let raw;
457
461
  if (idOrFile.endsWith(".ts") || idOrFile.endsWith(".tsx")) {
458
- // Execute DSL file via tsx and capture JSON output
459
- const { execFileSync } = await import("node:child_process");
460
- const output = execFileSync("npx", ["tsx", resolve(idOrFile)], {
461
- encoding: "utf8",
462
- cwd: dirname(resolve(idOrFile)),
463
- timeout: 30000
464
- });
465
- raw = JSON.parse(output.trim());
462
+ const { readFileTarget } = await import("./debug/target.js");
463
+ raw = (await readFileTarget(idOrFile)).raw;
466
464
  }
467
465
  else {
468
466
  const { readFileSync } = await import("node:fs");
@@ -488,7 +486,7 @@ addSupervisorOptions(workflows
488
486
  // the graph through `normalizeGraph` (@nodetool-ai/execution) — no
489
487
  // need to duplicate that here.
490
488
  const registry = new NodeRegistry();
491
- registerBuiltinPacks(registry, CLI_LOCAL_BUILTIN_PACK_POLICY);
489
+ await registerCliPacks(registry, CLI_LOCAL_BUILTIN_PACK_POLICY);
492
490
  const jobId = `job-${Date.now()}`;
493
491
  // Resolve asset URIs (e.g. /api/storage/<key>) against the local
494
492
  // assets directory, so workflows referencing stored assets run the
@@ -584,6 +582,13 @@ addSupervisorOptions(workflows
584
582
  ? streamInterventionLines(session.messages)
585
583
  : Promise.resolve();
586
584
  const result = await session.result;
585
+ if (result.status === "failed" && (commandMissingRuntime(result) || commandMissingPack(result))) {
586
+ const exit = await installMissingPacksAndReexec(result, { command: "workflows-run", installMissing: opts.installMissing });
587
+ if (exit !== null) {
588
+ process.exit(exit);
589
+ }
590
+ process.exit(printCommandError(result, opts.json));
591
+ }
587
592
  await interventionLines;
588
593
  supervisor?.handle.close();
589
594
  const interventions = result.interventions ?? [];
@@ -620,8 +625,11 @@ addSupervisorOptions(workflows
620
625
  process.exit(result.status === "completed" ? 0 : 1);
621
626
  }
622
627
  catch (e) {
623
- console.error(describeRunFailure(e));
624
- process.exit(1);
628
+ const exit = await installMissingPacksAndReexec(e, { command: "workflows-run", installMissing: opts.installMissing });
629
+ if (exit !== null) {
630
+ process.exit(exit);
631
+ }
632
+ process.exit(printCommandError(e, opts.json));
625
633
  }
626
634
  });
627
635
  workflows
@@ -668,8 +676,7 @@ workflows
668
676
  console.log(script.code);
669
677
  }
670
678
  catch (e) {
671
- printCommandError(e);
672
- process.exit(1);
679
+ process.exit(printCommandError(e));
673
680
  }
674
681
  });
675
682
  workflows
@@ -712,8 +719,7 @@ workflows
712
719
  console.log(source);
713
720
  }
714
721
  catch (e) {
715
- printCommandError(e);
716
- process.exit(1);
722
+ process.exit(printCommandError(e));
717
723
  }
718
724
  });
719
725
  workflows
@@ -824,8 +830,7 @@ workflows
824
830
  console.log(outPath);
825
831
  }
826
832
  catch (e) {
827
- printCommandError(e);
828
- process.exit(1);
833
+ process.exit(printCommandError(e));
829
834
  }
830
835
  });
831
836
  workflows
@@ -906,8 +911,7 @@ workflows
906
911
  console.log(outPath);
907
912
  }
908
913
  catch (e) {
909
- printCommandError(e);
910
- process.exit(1);
914
+ process.exit(printCommandError(e));
911
915
  }
912
916
  });
913
917
  workflows
@@ -962,8 +966,7 @@ workflows
962
966
  }
963
967
  }
964
968
  catch (e) {
965
- printCommandError(e, opts.json);
966
- process.exit(1);
969
+ process.exit(printCommandError(e, opts.json));
967
970
  }
968
971
  });
969
972
  // ---------------------------------------------------------------------------
@@ -1013,8 +1016,7 @@ models
1013
1016
  printTable(rows.map(modelRow));
1014
1017
  }
1015
1018
  catch (e) {
1016
- printCommandError(e, opts.json);
1017
- process.exit(1);
1019
+ process.exit(printCommandError(e, opts.json));
1018
1020
  }
1019
1021
  });
1020
1022
  models
@@ -1035,8 +1037,7 @@ models
1035
1037
  })));
1036
1038
  }
1037
1039
  catch (e) {
1038
- printCommandError(e, opts.json);
1039
- process.exit(1);
1040
+ process.exit(printCommandError(e, opts.json));
1040
1041
  }
1041
1042
  });
1042
1043
  registerRecommendedCommand(models);
@@ -1064,8 +1065,7 @@ models
1064
1065
  printTable(rows.map(modelRow));
1065
1066
  }
1066
1067
  catch (e) {
1067
- printCommandError(e, opts.json);
1068
- process.exit(1);
1068
+ process.exit(printCommandError(e, opts.json));
1069
1069
  }
1070
1070
  });
1071
1071
  models
@@ -1111,8 +1111,7 @@ models
1111
1111
  printTable(rows.map(modelRow));
1112
1112
  }
1113
1113
  catch (e) {
1114
- printCommandError(e, opts.json);
1115
- process.exit(1);
1114
+ process.exit(printCommandError(e, opts.json));
1116
1115
  }
1117
1116
  });
1118
1117
  models
@@ -1136,8 +1135,7 @@ models
1136
1135
  printTable(rows.map(modelRow));
1137
1136
  }
1138
1137
  catch (e) {
1139
- printCommandError(e, opts.json);
1140
- process.exit(1);
1138
+ process.exit(printCommandError(e, opts.json));
1141
1139
  }
1142
1140
  });
1143
1141
  // ---------------------------------------------------------------------------
@@ -1173,8 +1171,7 @@ storage
1173
1171
  process.exit(1);
1174
1172
  }
1175
1173
  catch (e) {
1176
- printCommandError(e, opts.json);
1177
- process.exit(1);
1174
+ process.exit(printCommandError(e, opts.json));
1178
1175
  }
1179
1176
  });
1180
1177
  workflows
@@ -1204,8 +1201,7 @@ workflows
1204
1201
  process.exit(1);
1205
1202
  }
1206
1203
  catch (e) {
1207
- printCommandError(e, opts.json);
1208
- process.exit(1);
1204
+ process.exit(printCommandError(e, opts.json));
1209
1205
  }
1210
1206
  });
1211
1207
  // ---------------------------------------------------------------------------
@@ -1229,8 +1225,7 @@ secrets
1229
1225
  printTable(items.map((s) => ({ key: s.key, updated_at: s.updated_at ?? "" })));
1230
1226
  }
1231
1227
  catch (e) {
1232
- printCommandError(e);
1233
- process.exit(1);
1228
+ process.exit(printCommandError(e));
1234
1229
  }
1235
1230
  });
1236
1231
  secrets
@@ -1254,8 +1249,7 @@ secrets
1254
1249
  console.log(`Secret '${key}' stored.`);
1255
1250
  }
1256
1251
  catch (e) {
1257
- printCommandError(e);
1258
- process.exit(1);
1252
+ process.exit(printCommandError(e));
1259
1253
  }
1260
1254
  });
1261
1255
  secrets
@@ -1273,8 +1267,7 @@ secrets
1273
1267
  console.log(value);
1274
1268
  }
1275
1269
  catch (e) {
1276
- printCommandError(e);
1277
- process.exit(1);
1270
+ process.exit(printCommandError(e));
1278
1271
  }
1279
1272
  });
1280
1273
  // ---------------------------------------------------------------------------
@@ -1335,6 +1328,7 @@ mcp
1335
1328
  "MCP protocol channel.")
1336
1329
  .action(async () => {
1337
1330
  try {
1331
+ refusePackInstallsInProcess("mcp serve");
1338
1332
  const { createMcpServer, createMcpStdioTransport, forwardMcpStdioToLocalServer } = await import("@nodetool-ai/websocket");
1339
1333
  if (await forwardMcpStdioToLocalServer()) {
1340
1334
  process.stderr.write("NodeTool MCP forwarding to the local API server.\n");
@@ -1344,7 +1338,7 @@ mcp
1344
1338
  // A local TS-node registry powers list_nodes / search_nodes /
1345
1339
  // validate_workflow without spinning up a Python worker.
1346
1340
  const registry = new NodeRegistry();
1347
- registerBuiltinPacks(registry, CLI_LOCAL_BUILTIN_PACK_POLICY);
1341
+ await registerCliPacks(registry, CLI_LOCAL_BUILTIN_PACK_POLICY);
1348
1342
  // stdio serves exactly one local user; "1" is the local single-user id.
1349
1343
  const server = createMcpServer({
1350
1344
  registry,
@@ -1357,15 +1351,16 @@ mcp
1357
1351
  // closes the connection.
1358
1352
  }
1359
1353
  catch (e) {
1360
- printCommandError(e);
1361
- process.exit(1);
1354
+ process.exit(printCommandError(e));
1362
1355
  }
1363
1356
  });
1364
1357
  // ---------------------------------------------------------------------------
1365
1358
  // package
1366
1359
  // ---------------------------------------------------------------------------
1360
+ registerProjectCommands(program);
1367
1361
  registerPackageCommands(program);
1368
1362
  registerPackCommands(program);
1363
+ registerRuntimeCommands(program);
1369
1364
  registerWorkerCommands(program);
1370
1365
  // Any command that opens a remote Python bridge keeps the attached worker's
1371
1366
  // idle clock fresh, so the reaper doesn't pause a GPU that is mid-job.