@nodetool-ai/cli 0.7.0-rc.23 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/ExecutionTree.d.ts +2 -1
- package/dist/ExecutionTree.d.ts.map +1 -1
- package/dist/ExecutionTree.js +1 -1
- package/dist/ExecutionTree.js.map +1 -1
- package/dist/affected/affected.d.ts +45 -0
- package/dist/affected/affected.d.ts.map +1 -0
- package/dist/affected/affected.js +160 -0
- package/dist/affected/affected.js.map +1 -0
- package/dist/agent-toolbelt.d.ts +15 -0
- package/dist/agent-toolbelt.d.ts.map +1 -0
- package/dist/agent-toolbelt.js +28 -0
- package/dist/agent-toolbelt.js.map +1 -0
- package/dist/api-client.d.ts +12 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +21 -0
- package/dist/api-client.js.map +1 -0
- package/dist/app-build/bundle.d.ts +15 -0
- package/dist/app-build/bundle.d.ts.map +1 -0
- package/dist/app-build/bundle.js +45 -0
- package/dist/app-build/bundle.js.map +1 -0
- package/dist/app-build/watch.d.ts +13 -0
- package/dist/app-build/watch.d.ts.map +1 -0
- package/dist/app-build/watch.js +25 -0
- package/dist/app-build/watch.js.map +1 -0
- package/dist/app-debug/app-target.d.ts +14 -0
- package/dist/app-debug/app-target.d.ts.map +1 -0
- package/dist/app-debug/app-target.js +120 -0
- package/dist/app-debug/app-target.js.map +1 -0
- package/dist/app-debug/harness.d.ts +29 -0
- package/dist/app-debug/harness.d.ts.map +1 -0
- package/dist/app-debug/harness.js +116 -0
- package/dist/app-debug/harness.js.map +1 -0
- package/dist/app-debug/index.d.ts +12 -0
- package/dist/app-debug/index.d.ts.map +1 -0
- package/dist/app-debug/index.js +9 -0
- package/dist/app-debug/index.js.map +1 -0
- package/dist/app.d.ts +38 -48
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +980 -677
- package/dist/app.js.map +1 -1
- package/dist/bash-tool.d.ts +13 -0
- package/dist/bash-tool.d.ts.map +1 -0
- package/dist/bash-tool.js +85 -0
- package/dist/bash-tool.js.map +1 -0
- package/dist/chat-codeact.d.ts +93 -0
- package/dist/chat-codeact.d.ts.map +1 -0
- package/dist/chat-codeact.js +179 -0
- package/dist/chat-codeact.js.map +1 -0
- package/dist/chat-context.d.ts +18 -0
- package/dist/chat-context.d.ts.map +1 -0
- package/dist/chat-context.js +32 -0
- package/dist/chat-context.js.map +1 -0
- package/dist/chat-media.d.ts +3 -0
- package/dist/chat-media.d.ts.map +1 -0
- package/dist/chat-media.js +46 -0
- package/dist/chat-media.js.map +1 -0
- package/dist/chat-prompts.d.ts +20 -0
- package/dist/chat-prompts.d.ts.map +1 -0
- package/dist/chat-prompts.js +42 -0
- package/dist/chat-prompts.js.map +1 -0
- package/dist/chat-sessions.d.ts +25 -0
- package/dist/chat-sessions.d.ts.map +1 -0
- package/dist/chat-sessions.js +153 -0
- package/dist/chat-sessions.js.map +1 -0
- package/dist/command-errors.d.ts +10 -0
- package/dist/command-errors.d.ts.map +1 -0
- package/dist/command-errors.js +15 -0
- package/dist/command-errors.js.map +1 -0
- package/dist/commands/__tests__/jtbd.test.d.ts +2 -0
- package/dist/commands/__tests__/jtbd.test.d.ts.map +1 -0
- package/dist/commands/__tests__/jtbd.test.js +120 -0
- package/dist/commands/__tests__/jtbd.test.js.map +1 -0
- package/dist/commands/__tests__/timeline-render-audio.test.d.ts +2 -0
- package/dist/commands/__tests__/timeline-render-audio.test.d.ts.map +1 -0
- package/dist/commands/__tests__/timeline-render-audio.test.js +53 -0
- package/dist/commands/__tests__/timeline-render-audio.test.js.map +1 -0
- package/dist/commands/__tests__/timeline-render-completeness.test.d.ts +2 -0
- package/dist/commands/__tests__/timeline-render-completeness.test.d.ts.map +1 -0
- package/dist/commands/__tests__/timeline-render-completeness.test.js +117 -0
- package/dist/commands/__tests__/timeline-render-completeness.test.js.map +1 -0
- package/dist/commands/__tests__/timeline-render.test.d.ts +2 -0
- package/dist/commands/__tests__/timeline-render.test.d.ts.map +1 -0
- package/dist/commands/__tests__/timeline-render.test.js +115 -0
- package/dist/commands/__tests__/timeline-render.test.js.map +1 -0
- package/dist/commands/__tests__/timeline-score.test.d.ts +2 -0
- package/dist/commands/__tests__/timeline-score.test.d.ts.map +1 -0
- package/dist/commands/__tests__/timeline-score.test.js +100 -0
- package/dist/commands/__tests__/timeline-score.test.js.map +1 -0
- package/dist/commands/affected.d.ts +9 -0
- package/dist/commands/affected.d.ts.map +1 -0
- package/dist/commands/affected.js +122 -0
- package/dist/commands/affected.js.map +1 -0
- package/dist/commands/agent.d.ts +26 -4
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +328 -306
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/app.d.ts +3 -0
- package/dist/commands/app.d.ts.map +1 -0
- package/dist/commands/app.js +405 -0
- package/dist/commands/app.js.map +1 -0
- package/dist/commands/apps.d.ts +15 -0
- package/dist/commands/apps.d.ts.map +1 -0
- package/dist/commands/apps.js +180 -0
- package/dist/commands/apps.js.map +1 -0
- package/dist/commands/auth.d.ts +12 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +154 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/collections.d.ts +10 -0
- package/dist/commands/collections.d.ts.map +1 -0
- package/dist/commands/collections.js +257 -0
- package/dist/commands/collections.js.map +1 -0
- package/dist/commands/costs.d.ts +15 -0
- package/dist/commands/costs.d.ts.map +1 -0
- package/dist/commands/costs.js +201 -0
- package/dist/commands/costs.js.map +1 -0
- package/dist/commands/db.d.ts +3 -0
- package/dist/commands/db.d.ts.map +1 -0
- package/dist/commands/db.js +176 -0
- package/dist/commands/db.js.map +1 -0
- package/dist/commands/debug-summary-output.d.ts +22 -0
- package/dist/commands/debug-summary-output.d.ts.map +1 -0
- package/dist/commands/debug-summary-output.js +28 -0
- package/dist/commands/debug-summary-output.js.map +1 -0
- package/dist/commands/debug.d.ts +13 -0
- package/dist/commands/debug.d.ts.map +1 -0
- package/dist/commands/debug.js +138 -0
- package/dist/commands/debug.js.map +1 -0
- package/dist/commands/deploy-helpers.d.ts +49 -18
- package/dist/commands/deploy-helpers.d.ts.map +1 -1
- package/dist/commands/deploy-helpers.js +10 -276
- package/dist/commands/deploy-helpers.js.map +1 -1
- package/dist/commands/deploy.d.ts +0 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +21 -217
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/errors.d.ts +11 -0
- package/dist/commands/errors.d.ts.map +1 -0
- package/dist/commands/errors.js +177 -0
- package/dist/commands/errors.js.map +1 -0
- package/dist/commands/eval.d.ts +152 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/eval.js +690 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/extension.d.ts +12 -0
- package/dist/commands/extension.d.ts.map +1 -0
- package/dist/commands/extension.js +30 -0
- package/dist/commands/extension.js.map +1 -0
- package/dist/commands/game-benchmark.d.ts +34 -0
- package/dist/commands/game-benchmark.d.ts.map +1 -0
- package/dist/commands/game-benchmark.js +95 -0
- package/dist/commands/game-benchmark.js.map +1 -0
- package/dist/commands/game-smoke.d.ts +3 -0
- package/dist/commands/game-smoke.d.ts.map +1 -0
- package/dist/commands/game-smoke.js +23 -0
- package/dist/commands/game-smoke.js.map +1 -0
- package/dist/commands/game.d.ts +4 -0
- package/dist/commands/game.d.ts.map +1 -0
- package/dist/commands/game.js +624 -0
- package/dist/commands/game.js.map +1 -0
- package/dist/commands/generate.d.ts +17 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +324 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/generations.d.ts +17 -0
- package/dist/commands/generations.d.ts.map +1 -0
- package/dist/commands/generations.js +408 -0
- package/dist/commands/generations.js.map +1 -0
- package/dist/commands/harness.d.ts +69 -0
- package/dist/commands/harness.d.ts.map +1 -0
- package/dist/commands/harness.js +575 -0
- package/dist/commands/harness.js.map +1 -0
- package/dist/commands/js-script-validation-output.d.ts +7 -0
- package/dist/commands/js-script-validation-output.d.ts.map +1 -0
- package/dist/commands/js-script-validation-output.js +5 -0
- package/dist/commands/js-script-validation-output.js.map +1 -0
- package/dist/commands/js-script-versions.d.ts +53 -0
- package/dist/commands/js-script-versions.d.ts.map +1 -0
- package/dist/commands/js-script-versions.js +89 -0
- package/dist/commands/js-script-versions.js.map +1 -0
- package/dist/commands/js-script.d.ts +29 -0
- package/dist/commands/js-script.d.ts.map +1 -0
- package/dist/commands/js-script.js +211 -0
- package/dist/commands/js-script.js.map +1 -0
- package/dist/commands/jtbd.d.ts +38 -0
- package/dist/commands/jtbd.d.ts.map +1 -0
- package/dist/commands/jtbd.js +261 -0
- package/dist/commands/jtbd.js.map +1 -0
- package/dist/commands/local-db.d.ts +16 -0
- package/dist/commands/local-db.d.ts.map +1 -0
- package/dist/commands/local-db.js +33 -0
- package/dist/commands/local-db.js.map +1 -0
- package/dist/commands/mcp.d.ts +21 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +164 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/migrate-code-inputs.d.ts +24 -0
- package/dist/commands/migrate-code-inputs.d.ts.map +1 -0
- package/dist/commands/migrate-code-inputs.js +120 -0
- package/dist/commands/migrate-code-inputs.js.map +1 -0
- package/dist/commands/models-hf.js +4 -4
- package/dist/commands/models-hf.js.map +1 -1
- package/dist/commands/models-recommended.d.ts.map +1 -1
- package/dist/commands/models-recommended.js +16 -24
- package/dist/commands/models-recommended.js.map +1 -1
- package/dist/commands/node.d.ts +10 -0
- package/dist/commands/node.d.ts.map +1 -0
- package/dist/commands/node.js +72 -0
- package/dist/commands/node.js.map +1 -0
- package/dist/commands/output.d.ts +24 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +132 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/package-helpers.d.ts +1 -7
- package/dist/commands/package-helpers.d.ts.map +1 -1
- package/dist/commands/package-helpers.js +3 -26
- package/dist/commands/package-helpers.js.map +1 -1
- package/dist/commands/package.d.ts.map +1 -1
- package/dist/commands/package.js +14 -14
- package/dist/commands/package.js.map +1 -1
- package/dist/commands/packs.d.ts +13 -0
- package/dist/commands/packs.d.ts.map +1 -0
- package/dist/commands/packs.js +60 -0
- package/dist/commands/packs.js.map +1 -0
- package/dist/commands/reliability.d.ts +14 -0
- package/dist/commands/reliability.d.ts.map +1 -0
- package/dist/commands/reliability.js +80 -0
- package/dist/commands/reliability.js.map +1 -0
- package/dist/commands/resource-read.d.ts +28 -0
- package/dist/commands/resource-read.d.ts.map +1 -0
- package/dist/commands/resource-read.js +316 -0
- package/dist/commands/resource-read.js.map +1 -0
- package/dist/commands/runs.d.ts +7 -0
- package/dist/commands/runs.d.ts.map +1 -0
- package/dist/commands/runs.js +302 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/sketch-validation-output.d.ts +7 -0
- package/dist/commands/sketch-validation-output.d.ts.map +1 -0
- package/dist/commands/sketch-validation-output.js +5 -0
- package/dist/commands/sketch-validation-output.js.map +1 -0
- package/dist/commands/sketch-versions.d.ts +66 -0
- package/dist/commands/sketch-versions.d.ts.map +1 -0
- package/dist/commands/sketch-versions.js +108 -0
- package/dist/commands/sketch-versions.js.map +1 -0
- package/dist/commands/sketch.d.ts +21 -0
- package/dist/commands/sketch.d.ts.map +1 -0
- package/dist/commands/sketch.js +101 -0
- package/dist/commands/sketch.js.map +1 -0
- package/dist/commands/storage.d.ts +24 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +112 -0
- package/dist/commands/storage.js.map +1 -0
- package/dist/commands/telegram.d.ts +11 -0
- package/dist/commands/telegram.d.ts.map +1 -0
- package/dist/commands/telegram.js +66 -0
- package/dist/commands/telegram.js.map +1 -0
- package/dist/commands/timeline-render.d.ts +85 -0
- package/dist/commands/timeline-render.d.ts.map +1 -0
- package/dist/commands/timeline-render.js +474 -0
- package/dist/commands/timeline-render.js.map +1 -0
- package/dist/commands/timeline-score.d.ts +16 -0
- package/dist/commands/timeline-score.d.ts.map +1 -0
- package/dist/commands/timeline-score.js +89 -0
- package/dist/commands/timeline-score.js.map +1 -0
- package/dist/commands/timeline-validation-output.d.ts +7 -0
- package/dist/commands/timeline-validation-output.d.ts.map +1 -0
- package/dist/commands/timeline-validation-output.js +9 -0
- package/dist/commands/timeline-validation-output.js.map +1 -0
- package/dist/commands/timeline-versions.d.ts +72 -0
- package/dist/commands/timeline-versions.d.ts.map +1 -0
- package/dist/commands/timeline-versions.js +108 -0
- package/dist/commands/timeline-versions.js.map +1 -0
- package/dist/commands/timeline.d.ts +22 -0
- package/dist/commands/timeline.d.ts.map +1 -0
- package/dist/commands/timeline.js +105 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/commands/validate.d.ts +22 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +127 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/validation-output.d.ts +25 -0
- package/dist/commands/validation-output.d.ts.map +1 -0
- package/dist/commands/validation-output.js +29 -0
- package/dist/commands/validation-output.js.map +1 -0
- package/dist/commands/version-commands.d.ts +94 -0
- package/dist/commands/version-commands.d.ts.map +1 -0
- package/dist/commands/version-commands.js +227 -0
- package/dist/commands/version-commands.js.map +1 -0
- package/dist/commands/worker-models.d.ts +13 -0
- package/dist/commands/worker-models.d.ts.map +1 -0
- package/dist/commands/worker-models.js +207 -0
- package/dist/commands/worker-models.js.map +1 -0
- package/dist/commands/worker.d.ts +23 -0
- package/dist/commands/worker.d.ts.map +1 -0
- package/dist/commands/worker.js +374 -0
- package/dist/commands/worker.js.map +1 -0
- package/dist/debug/browser-runner.d.ts +21 -0
- package/dist/debug/browser-runner.d.ts.map +1 -0
- package/dist/debug/browser-runner.js +196 -0
- package/dist/debug/browser-runner.js.map +1 -0
- package/dist/debug/collector.d.ts +9 -0
- package/dist/debug/collector.d.ts.map +1 -0
- package/dist/debug/collector.js +9 -0
- package/dist/debug/collector.js.map +1 -0
- package/dist/debug/diff.d.ts +48 -0
- package/dist/debug/diff.d.ts.map +1 -0
- package/dist/debug/diff.js +68 -0
- package/dist/debug/diff.js.map +1 -0
- package/dist/debug/harness.d.ts +11 -0
- package/dist/debug/harness.d.ts.map +1 -0
- package/dist/debug/harness.js +103 -0
- package/dist/debug/harness.js.map +1 -0
- package/dist/debug/index.d.ts +17 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +16 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/markdown.d.ts +3 -0
- package/dist/debug/markdown.d.ts.map +1 -0
- package/dist/debug/markdown.js +127 -0
- package/dist/debug/markdown.js.map +1 -0
- package/dist/debug/server-runner.d.ts +24 -0
- package/dist/debug/server-runner.d.ts.map +1 -0
- package/dist/debug/server-runner.js +197 -0
- package/dist/debug/server-runner.js.map +1 -0
- package/dist/debug/target.d.ts +34 -0
- package/dist/debug/target.d.ts.map +1 -0
- package/dist/debug/target.js +104 -0
- package/dist/debug/target.js.map +1 -0
- package/dist/debug/trace.d.ts +30 -0
- package/dist/debug/trace.d.ts.map +1 -0
- package/dist/debug/trace.js +87 -0
- package/dist/debug/trace.js.map +1 -0
- package/dist/debug/types.d.ts +82 -0
- package/dist/debug/types.d.ts.map +1 -0
- package/dist/debug/types.js +13 -0
- package/dist/debug/types.js.map +1 -0
- package/dist/debug/verdict.d.ts +3 -0
- package/dist/debug/verdict.d.ts.map +1 -0
- package/dist/debug/verdict.js +78 -0
- package/dist/debug/verdict.js.map +1 -0
- package/dist/debug/watch.d.ts +23 -0
- package/dist/debug/watch.d.ts.map +1 -0
- package/dist/debug/watch.js +68 -0
- package/dist/debug/watch.js.map +1 -0
- package/dist/diagnose.d.ts +139 -0
- package/dist/diagnose.d.ts.map +1 -0
- package/dist/diagnose.js +418 -0
- package/dist/diagnose.js.map +1 -0
- package/dist/evals/graph-runner.d.ts +8 -0
- package/dist/evals/graph-runner.d.ts.map +1 -0
- package/dist/evals/graph-runner.js +136 -0
- package/dist/evals/graph-runner.js.map +1 -0
- package/dist/harness/capability-coverage.d.ts +161 -0
- package/dist/harness/capability-coverage.d.ts.map +1 -0
- package/dist/harness/capability-coverage.js +266 -0
- package/dist/harness/capability-coverage.js.map +1 -0
- package/dist/harness/capability-table.d.ts +17 -0
- package/dist/harness/capability-table.d.ts.map +1 -0
- package/dist/harness/capability-table.js +3844 -0
- package/dist/harness/capability-table.js.map +1 -0
- package/dist/harness/changed-files.d.ts +20 -0
- package/dist/harness/changed-files.d.ts.map +1 -0
- package/dist/harness/changed-files.js +90 -0
- package/dist/harness/changed-files.js.map +1 -0
- package/dist/harness/declared-capabilities.d.ts +12 -0
- package/dist/harness/declared-capabilities.d.ts.map +1 -0
- package/dist/harness/declared-capabilities.js +21 -0
- package/dist/harness/declared-capabilities.js.map +1 -0
- package/dist/harness/registry.d.ts +190 -0
- package/dist/harness/registry.d.ts.map +1 -0
- package/dist/harness/registry.js +2034 -0
- package/dist/harness/registry.js.map +1 -0
- package/dist/index.js +122 -131
- package/dist/index.js.map +1 -1
- package/dist/interaction-script.d.ts +40 -0
- package/dist/interaction-script.d.ts.map +1 -0
- package/dist/interaction-script.js +96 -0
- package/dist/interaction-script.js.map +1 -0
- package/dist/js-script-debug/harness.d.ts +124 -0
- package/dist/js-script-debug/harness.d.ts.map +1 -0
- package/dist/js-script-debug/harness.js +230 -0
- package/dist/js-script-debug/harness.js.map +1 -0
- package/dist/js-script-debug/index.d.ts +9 -0
- package/dist/js-script-debug/index.d.ts.map +1 -0
- package/dist/js-script-debug/index.js +9 -0
- package/dist/js-script-debug/index.js.map +1 -0
- package/dist/js-script-debug/interactions.d.ts +19 -0
- package/dist/js-script-debug/interactions.d.ts.map +1 -0
- package/dist/js-script-debug/interactions.js +17 -0
- package/dist/js-script-debug/interactions.js.map +1 -0
- package/dist/js-script-debug/target.d.ts +20 -0
- package/dist/js-script-debug/target.d.ts.map +1 -0
- package/dist/js-script-debug/target.js +78 -0
- package/dist/js-script-debug/target.js.map +1 -0
- package/dist/local-model-interfaces.d.ts +20 -0
- package/dist/local-model-interfaces.d.ts.map +1 -0
- package/dist/local-model-interfaces.js +41 -0
- package/dist/local-model-interfaces.js.map +1 -0
- package/dist/local-secrets.d.ts +3 -0
- package/dist/local-secrets.d.ts.map +1 -0
- package/dist/local-secrets.js +16 -0
- package/dist/local-secrets.js.map +1 -0
- package/dist/markdown.d.ts.map +1 -1
- package/dist/markdown.js +7 -2
- package/dist/markdown.js.map +1 -1
- package/dist/node/run-node.d.ts +28 -0
- package/dist/node/run-node.d.ts.map +1 -0
- package/dist/node/run-node.js +76 -0
- package/dist/node/run-node.js.map +1 -0
- package/dist/node-registry.d.ts +27 -0
- package/dist/node-registry.d.ts.map +1 -0
- package/dist/node-registry.js +33 -0
- package/dist/node-registry.js.map +1 -0
- package/dist/nodetool-main.d.ts +15 -0
- package/dist/nodetool-main.d.ts.map +1 -0
- package/dist/nodetool-main.js +1368 -0
- package/dist/nodetool-main.js.map +1 -0
- package/dist/nodetool.d.ts +0 -13
- package/dist/nodetool.d.ts.map +1 -1
- package/dist/nodetool.js +17 -1147
- package/dist/nodetool.js.map +1 -1
- package/dist/numeric-options.d.ts +22 -0
- package/dist/numeric-options.d.ts.map +1 -0
- package/dist/numeric-options.js +45 -0
- package/dist/numeric-options.js.map +1 -0
- package/dist/permission-gate.d.ts +55 -0
- package/dist/permission-gate.d.ts.map +1 -0
- package/dist/permission-gate.js +118 -0
- package/dist/permission-gate.js.map +1 -0
- package/dist/predicates.d.ts +6 -0
- package/dist/predicates.d.ts.map +1 -0
- package/dist/predicates.js +6 -0
- package/dist/predicates.js.map +1 -0
- package/dist/providers.d.ts +73 -10
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +339 -97
- package/dist/providers.js.map +1 -1
- package/dist/readline-input.d.ts +13 -19
- package/dist/readline-input.d.ts.map +1 -1
- package/dist/readline-input.js +201 -190
- package/dist/readline-input.js.map +1 -1
- package/dist/run-budget.d.ts +40 -0
- package/dist/run-budget.d.ts.map +1 -0
- package/dist/run-budget.js +119 -0
- package/dist/run-budget.js.map +1 -0
- package/dist/run-dsl-supervised.d.ts +11 -0
- package/dist/run-dsl-supervised.d.ts.map +1 -0
- package/dist/run-dsl-supervised.js +82 -0
- package/dist/run-dsl-supervised.js.map +1 -0
- package/dist/run-dsl.d.ts +29 -0
- package/dist/run-dsl.d.ts.map +1 -1
- package/dist/run-dsl.js +44 -10
- package/dist/run-dsl.js.map +1 -1
- package/dist/run-json.d.ts +24 -0
- package/dist/run-json.d.ts.map +1 -0
- package/dist/run-json.js +132 -0
- package/dist/run-json.js.map +1 -0
- package/dist/sandbox-catalog.d.ts +24 -0
- package/dist/sandbox-catalog.d.ts.map +1 -0
- package/dist/sandbox-catalog.js +78 -0
- package/dist/sandbox-catalog.js.map +1 -0
- package/dist/settings.d.ts +11 -10
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +71 -13
- package/dist/settings.js.map +1 -1
- package/dist/sketch-debug/harness.d.ts +87 -0
- package/dist/sketch-debug/harness.d.ts.map +1 -0
- package/dist/sketch-debug/harness.js +145 -0
- package/dist/sketch-debug/harness.js.map +1 -0
- package/dist/sketch-debug/index.d.ts +9 -0
- package/dist/sketch-debug/index.d.ts.map +1 -0
- package/dist/sketch-debug/index.js +9 -0
- package/dist/sketch-debug/index.js.map +1 -0
- package/dist/sketch-debug/interactions.d.ts +19 -0
- package/dist/sketch-debug/interactions.d.ts.map +1 -0
- package/dist/sketch-debug/interactions.js +17 -0
- package/dist/sketch-debug/interactions.js.map +1 -0
- package/dist/sketch-debug/target.d.ts +48 -0
- package/dist/sketch-debug/target.d.ts.map +1 -0
- package/dist/sketch-debug/target.js +138 -0
- package/dist/sketch-debug/target.js.map +1 -0
- package/dist/stdin.d.ts +18 -19
- package/dist/stdin.d.ts.map +1 -1
- package/dist/stdin.js +160 -157
- package/dist/stdin.js.map +1 -1
- package/dist/supervisor.d.ts +97 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +194 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/terminal-clipboard.d.ts +3 -0
- package/dist/terminal-clipboard.d.ts.map +1 -0
- package/dist/terminal-clipboard.js +24 -0
- package/dist/terminal-clipboard.js.map +1 -0
- package/dist/terminal-mouse.d.ts +24 -0
- package/dist/terminal-mouse.d.ts.map +1 -0
- package/dist/terminal-mouse.js +84 -0
- package/dist/terminal-mouse.js.map +1 -0
- package/dist/terminal-screen.d.ts +41 -0
- package/dist/terminal-screen.d.ts.map +1 -0
- package/dist/terminal-screen.js +228 -0
- package/dist/terminal-screen.js.map +1 -0
- package/dist/timeline-debug/harness.d.ts +79 -0
- package/dist/timeline-debug/harness.d.ts.map +1 -0
- package/dist/timeline-debug/harness.js +122 -0
- package/dist/timeline-debug/harness.js.map +1 -0
- package/dist/timeline-debug/index.d.ts +9 -0
- package/dist/timeline-debug/index.d.ts.map +1 -0
- package/dist/timeline-debug/index.js +9 -0
- package/dist/timeline-debug/index.js.map +1 -0
- package/dist/timeline-debug/interactions.d.ts +19 -0
- package/dist/timeline-debug/interactions.d.ts.map +1 -0
- package/dist/timeline-debug/interactions.js +17 -0
- package/dist/timeline-debug/interactions.js.map +1 -0
- package/dist/timeline-debug/target.d.ts +34 -0
- package/dist/timeline-debug/target.d.ts.map +1 -0
- package/dist/timeline-debug/target.js +132 -0
- package/dist/timeline-debug/target.js.map +1 -0
- package/dist/tool-format.d.ts +54 -0
- package/dist/tool-format.d.ts.map +1 -0
- package/dist/tool-format.js +360 -0
- package/dist/tool-format.js.map +1 -0
- package/dist/useExecutionState.d.ts.map +1 -1
- package/dist/useExecutionState.js +8 -4
- package/dist/useExecutionState.js.map +1 -1
- package/dist/validate/index.d.ts +28 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +51 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/websocket-client.d.ts +78 -15
- package/dist/websocket-client.d.ts.map +1 -1
- package/dist/websocket-client.js +497 -171
- package/dist/websocket-client.js.map +1 -1
- package/package.json +65 -31
package/dist/nodetool.js
CHANGED
|
@@ -1,1154 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* nodetool —
|
|
3
|
+
* nodetool — CLI entry.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* nodetool secrets list/store <key>
|
|
13
|
-
* nodetool settings show
|
|
5
|
+
* The full command tree lives in ./nodetool-main.ts and statically imports
|
|
6
|
+
* every workspace package, so it fails with ERR_MODULE_NOT_FOUND on a tree
|
|
7
|
+
* whose `dist/` has not been built. `harness` (list, audit, gate planning)
|
|
8
|
+
* is the tool that tells you what to build and check, so it must work first:
|
|
9
|
+
* it is routed to a program holding only that command, and its commands import
|
|
10
|
+
* built packages lazily (capabilities) or not at all. Every other command goes
|
|
11
|
+
* to the full tree unchanged.
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import superjson from "superjson";
|
|
22
|
-
import { workflowToDsl } from "@nodetool-ai/dsl";
|
|
23
|
-
import { initDb, Workflow, Secret, getSecret } from "@nodetool-ai/models";
|
|
24
|
-
import { getDefaultDbPath } from "@nodetool-ai/config";
|
|
25
|
-
import { WorkflowRunner } from "@nodetool-ai/kernel";
|
|
26
|
-
import { NodeRegistry } from "@nodetool-ai/node-sdk";
|
|
27
|
-
import { registerBaseNodes } from "@nodetool-ai/base-nodes";
|
|
28
|
-
import { registerElevenLabsNodes } from "@nodetool-ai/elevenlabs-nodes";
|
|
29
|
-
import { registerTransformersJsNodes } from "@nodetool-ai/transformers-js-nodes";
|
|
30
|
-
import { registerFalNodes } from "@nodetool-ai/fal-nodes";
|
|
31
|
-
import { registerReplicateNodes } from "@nodetool-ai/replicate-nodes";
|
|
32
|
-
import { ProcessingContext, initTelemetry } from "@nodetool-ai/runtime";
|
|
33
|
-
import { registerPackageCommands } from "./commands/package.js";
|
|
34
|
-
import { registerDeployCommands, registerListGcpOptions } from "./commands/deploy.js";
|
|
35
|
-
import { registerHfCommands } from "./commands/models-hf.js";
|
|
36
|
-
import { registerRecommendedCommand } from "./commands/models-recommended.js";
|
|
37
|
-
import { registerAgentCommands } from "./commands/agent.js";
|
|
38
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
39
|
-
const __dirname = dirname(__filename);
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
// DB setup (for secrets commands)
|
|
42
|
-
// ---------------------------------------------------------------------------
|
|
43
|
-
async function setupDb() {
|
|
44
|
-
initDb(getDefaultDbPath());
|
|
13
|
+
if (process.argv[2] === "harness") {
|
|
14
|
+
const { program } = await import("commander");
|
|
15
|
+
const { registerHarnessCommands } = await import("./commands/harness.js");
|
|
16
|
+
program.name("nodetool").description("NodeTool CLI");
|
|
17
|
+
registerHarnessCommands(program);
|
|
18
|
+
await program.parseAsync();
|
|
45
19
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// ---------------------------------------------------------------------------
|
|
49
|
-
function createApiClient(apiUrl) {
|
|
50
|
-
return createTRPCClient({
|
|
51
|
-
links: [
|
|
52
|
-
httpBatchLink({
|
|
53
|
-
url: `${apiUrl}/trpc`,
|
|
54
|
-
transformer: superjson
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
});
|
|
20
|
+
else {
|
|
21
|
+
await import("./nodetool-main.js");
|
|
58
22
|
}
|
|
59
|
-
|
|
60
|
-
// because it returns a TypeScript source string rather than JSON.
|
|
61
|
-
async function apiGetText(apiUrl, path) {
|
|
62
|
-
const res = await fetch(`${apiUrl}${path}`);
|
|
63
|
-
if (!res.ok)
|
|
64
|
-
throw new Error(`HTTP ${res.status}: ${await res.text()}`);
|
|
65
|
-
return res.text();
|
|
66
|
-
}
|
|
67
|
-
// ---------------------------------------------------------------------------
|
|
68
|
-
// Table printer
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
|
-
function printTable(rows, columns) {
|
|
71
|
-
if (rows.length === 0) {
|
|
72
|
-
console.log("(no results)");
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const cols = columns ?? Object.keys(rows[0]);
|
|
76
|
-
const widths = cols.map((c) => Math.max(c.length, ...rows.map((r) => String(r[c] ?? "").length)));
|
|
77
|
-
const sep = widths.map((w) => "─".repeat(w + 2)).join("┼");
|
|
78
|
-
const header = cols.map((c, i) => ` ${c.padEnd(widths[i])} `).join("│");
|
|
79
|
-
console.log(header);
|
|
80
|
-
console.log(sep);
|
|
81
|
-
for (const row of rows) {
|
|
82
|
-
console.log(cols
|
|
83
|
-
.map((c, i) => ` ${String(row[c] ?? "").padEnd(widths[i])} `)
|
|
84
|
-
.join("│"));
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function asJson(data) {
|
|
88
|
-
console.log(JSON.stringify(data, null, 2));
|
|
89
|
-
}
|
|
90
|
-
// ---------------------------------------------------------------------------
|
|
91
|
-
// info
|
|
92
|
-
// ---------------------------------------------------------------------------
|
|
93
|
-
program
|
|
94
|
-
.name("nodetool")
|
|
95
|
-
.description("NodeTool CLI")
|
|
96
|
-
.version("0.1.0")
|
|
97
|
-
.option("--trace-file <path>", "Append every LLM/agent/workflow span as JSONL to <path>")
|
|
98
|
-
.option("--trace-stdout [format]", "Stream spans to stdout: 'pretty' (default) or 'json' (JSONL)")
|
|
99
|
-
.option("--no-trace-stdout", "Disable stdout span output (overrides NODETOOL_TRACE_STDOUT)")
|
|
100
|
-
.hook("preAction", async (thisCommand) => {
|
|
101
|
-
const opts = thisCommand.opts();
|
|
102
|
-
await initTelemetry({
|
|
103
|
-
...(opts.traceFile && { traceFile: opts.traceFile }),
|
|
104
|
-
...(opts.traceStdout !== undefined && {
|
|
105
|
-
stdout: parseTraceStdout(opts.traceStdout)
|
|
106
|
-
})
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
function parseTraceStdout(v) {
|
|
110
|
-
if (v === false)
|
|
111
|
-
return false;
|
|
112
|
-
if (v === true)
|
|
113
|
-
return "pretty";
|
|
114
|
-
if (typeof v === "string") {
|
|
115
|
-
const lower = v.toLowerCase();
|
|
116
|
-
if (lower === "false" || lower === "0" || lower === "no")
|
|
117
|
-
return false;
|
|
118
|
-
if (lower === "json")
|
|
119
|
-
return "json";
|
|
120
|
-
if (lower === "pretty" || lower === "true" || lower === "1")
|
|
121
|
-
return "pretty";
|
|
122
|
-
}
|
|
123
|
-
throw new Error(`--trace-stdout must be 'pretty' or 'json' (got ${JSON.stringify(v)})`);
|
|
124
|
-
}
|
|
125
|
-
// ---------------------------------------------------------------------------
|
|
126
|
-
// run — execute a TypeScript/JavaScript DSL workflow file
|
|
127
|
-
// ---------------------------------------------------------------------------
|
|
128
|
-
program
|
|
129
|
-
.command("run <dsl-file>")
|
|
130
|
-
.description("Run a TypeScript/JavaScript DSL workflow file")
|
|
131
|
-
.option("--json", "Output results as JSON (default: pretty-print)")
|
|
132
|
-
.action(async (dslFile, opts) => {
|
|
133
|
-
try {
|
|
134
|
-
const { resolve } = await import("node:path");
|
|
135
|
-
const { runDslFile } = await import("./run-dsl.js");
|
|
136
|
-
const { registerBaseNodes } = await import("@nodetool-ai/base-nodes");
|
|
137
|
-
const { NodeRegistry } = await import("@nodetool-ai/node-sdk");
|
|
138
|
-
registerBaseNodes(NodeRegistry.global);
|
|
139
|
-
const absolutePath = resolve(dslFile);
|
|
140
|
-
const results = await runDslFile(absolutePath);
|
|
141
|
-
if (opts.json) {
|
|
142
|
-
console.log(JSON.stringify(results, null, 2));
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
for (const [workflowName, outputs] of Object.entries(results)) {
|
|
146
|
-
console.log(`\n${workflowName}:`);
|
|
147
|
-
for (const [key, value] of Object.entries(outputs)) {
|
|
148
|
-
console.log(` ${key}: ${JSON.stringify(value)}`);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
catch (e) {
|
|
154
|
-
console.error(String(e));
|
|
155
|
-
process.exit(1);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
program
|
|
159
|
-
.command("info")
|
|
160
|
-
.description("Display system and environment information")
|
|
161
|
-
.option("--json", "Output as JSON")
|
|
162
|
-
.action((opts) => {
|
|
163
|
-
const apiKeys = [
|
|
164
|
-
"ANTHROPIC_API_KEY",
|
|
165
|
-
"OPENAI_API_KEY",
|
|
166
|
-
"GEMINI_API_KEY",
|
|
167
|
-
"MISTRAL_API_KEY",
|
|
168
|
-
"GROQ_API_KEY",
|
|
169
|
-
"OLLAMA_API_URL",
|
|
170
|
-
"SERPAPI_API_KEY",
|
|
171
|
-
"HF_TOKEN"
|
|
172
|
-
];
|
|
173
|
-
const data = {
|
|
174
|
-
version: "0.1.0",
|
|
175
|
-
node_version: process.version,
|
|
176
|
-
platform: process.platform,
|
|
177
|
-
arch: process.arch,
|
|
178
|
-
api_keys: Object.fromEntries(apiKeys.map((k) => [k, process.env[k] ? "configured" : "not set"])),
|
|
179
|
-
environment: {
|
|
180
|
-
ENV: process.env["ENV"] ?? "development",
|
|
181
|
-
LOG_LEVEL: process.env["LOG_LEVEL"] ?? "INFO",
|
|
182
|
-
PORT: process.env["PORT"] ?? "7777"
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
if (opts.json) {
|
|
186
|
-
asJson(data);
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
console.log("\nNodeTool System Information\n");
|
|
190
|
-
printTable([
|
|
191
|
-
{ property: "Version", value: data.version },
|
|
192
|
-
{ property: "Node.js", value: data.node_version },
|
|
193
|
-
{ property: "Platform", value: `${data.platform}/${data.arch}` }
|
|
194
|
-
]);
|
|
195
|
-
console.log("\nAPI Keys:");
|
|
196
|
-
printTable(Object.entries(data.api_keys).map(([k, v]) => ({ key: k, status: v })));
|
|
197
|
-
console.log("\nEnvironment:");
|
|
198
|
-
printTable(Object.entries(data.environment).map(([k, v]) => ({
|
|
199
|
-
variable: k,
|
|
200
|
-
value: v
|
|
201
|
-
})));
|
|
202
|
-
console.log();
|
|
203
|
-
});
|
|
204
|
-
// ---------------------------------------------------------------------------
|
|
205
|
-
// serve
|
|
206
|
-
// ---------------------------------------------------------------------------
|
|
207
|
-
program
|
|
208
|
-
.command("serve")
|
|
209
|
-
.description("Start the NodeTool WebSocket + HTTP server")
|
|
210
|
-
.option("--host <host>", "Host to bind", "127.0.0.1")
|
|
211
|
-
.option("--port <port>", "Port to listen on", "7777")
|
|
212
|
-
.action((opts) => {
|
|
213
|
-
const serverPath = resolve(__dirname, "../../websocket/dist/server.js");
|
|
214
|
-
process.env["HOST"] = opts.host;
|
|
215
|
-
process.env["PORT"] = opts.port;
|
|
216
|
-
const result = spawnSync("node", [serverPath], {
|
|
217
|
-
stdio: "inherit",
|
|
218
|
-
env: { ...process.env }
|
|
219
|
-
});
|
|
220
|
-
process.exit(result.status ?? 0);
|
|
221
|
-
});
|
|
222
|
-
// ---------------------------------------------------------------------------
|
|
223
|
-
// chat
|
|
224
|
-
// ---------------------------------------------------------------------------
|
|
225
|
-
program
|
|
226
|
-
.command("chat")
|
|
227
|
-
.description("Start interactive chat (TUI)")
|
|
228
|
-
.option("-p, --provider <provider>", "LLM provider")
|
|
229
|
-
.option("-m, --model <model>", "Model ID")
|
|
230
|
-
.option("-a, --agent", "Agent mode")
|
|
231
|
-
.option("-u, --url <url>", "WebSocket server URL")
|
|
232
|
-
.option("-w, --workspace <path>", "Workspace directory")
|
|
233
|
-
.option("--tools <tools>", "Comma-separated enabled tools")
|
|
234
|
-
.allowUnknownOption()
|
|
235
|
-
.action((_opts, cmd) => {
|
|
236
|
-
const chatPath = resolve(__dirname, "index.js");
|
|
237
|
-
const args = cmd.args;
|
|
238
|
-
const rawArgs = process.argv;
|
|
239
|
-
// Re-run with the chat entry point, forwarding all flags after "chat"
|
|
240
|
-
const chatIdx = rawArgs.indexOf("chat");
|
|
241
|
-
const forwarded = chatIdx >= 0 ? rawArgs.slice(chatIdx + 1) : args;
|
|
242
|
-
const result = spawnSync("node", [chatPath, ...forwarded], {
|
|
243
|
-
stdio: "inherit",
|
|
244
|
-
env: { ...process.env }
|
|
245
|
-
});
|
|
246
|
-
process.exit(result.status ?? 0);
|
|
247
|
-
});
|
|
248
|
-
// ---------------------------------------------------------------------------
|
|
249
|
-
// workflows
|
|
250
|
-
// ---------------------------------------------------------------------------
|
|
251
|
-
const workflows = program
|
|
252
|
-
.command("workflows")
|
|
253
|
-
.description("Workflow management");
|
|
254
|
-
workflows
|
|
255
|
-
.command("list")
|
|
256
|
-
.description("List workflows")
|
|
257
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
258
|
-
.option("--limit <n>", "Max results", "100")
|
|
259
|
-
.option("--json", "Output as JSON")
|
|
260
|
-
.action(async (opts) => {
|
|
261
|
-
try {
|
|
262
|
-
const client = createApiClient(opts.apiUrl);
|
|
263
|
-
const data = await client.workflows.list.query({
|
|
264
|
-
limit: Number.parseInt(opts.limit, 10)
|
|
265
|
-
});
|
|
266
|
-
const rows = data.workflows;
|
|
267
|
-
if (opts.json) {
|
|
268
|
-
asJson(rows);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
printTable(rows.map((r) => ({
|
|
272
|
-
id: r["id"],
|
|
273
|
-
name: r["name"],
|
|
274
|
-
updated_at: r["updated_at"]
|
|
275
|
-
})));
|
|
276
|
-
}
|
|
277
|
-
catch (e) {
|
|
278
|
-
console.error(String(e));
|
|
279
|
-
process.exit(1);
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
workflows
|
|
283
|
-
.command("get <workflow_id>")
|
|
284
|
-
.description("Get a workflow by ID")
|
|
285
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
286
|
-
.option("--json", "Output as JSON")
|
|
287
|
-
.action(async (workflowId, opts) => {
|
|
288
|
-
try {
|
|
289
|
-
const client = createApiClient(opts.apiUrl);
|
|
290
|
-
const data = await client.workflows.get.query({ id: workflowId });
|
|
291
|
-
if (opts.json) {
|
|
292
|
-
asJson(data);
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
const w = data;
|
|
296
|
-
printTable([
|
|
297
|
-
{
|
|
298
|
-
id: w["id"],
|
|
299
|
-
name: w["name"],
|
|
300
|
-
description: w["description"],
|
|
301
|
-
updated_at: w["updated_at"]
|
|
302
|
-
}
|
|
303
|
-
]);
|
|
304
|
-
}
|
|
305
|
-
catch (e) {
|
|
306
|
-
console.error(String(e));
|
|
307
|
-
process.exit(1);
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
workflows
|
|
311
|
-
.command("run <workflow_id_or_file>")
|
|
312
|
-
.description("Run a workflow by ID, JSON file, or TypeScript DSL file")
|
|
313
|
-
.option("--params <json>", "JSON params string")
|
|
314
|
-
.option("--json", "Output as JSON")
|
|
315
|
-
.action(async (idOrFile, opts) => {
|
|
316
|
-
try {
|
|
317
|
-
await setupDb();
|
|
318
|
-
let graph;
|
|
319
|
-
let workflowId = null;
|
|
320
|
-
const params = opts.params
|
|
321
|
-
? JSON.parse(opts.params)
|
|
322
|
-
: {};
|
|
323
|
-
// Determine if argument is a file path or workflow ID
|
|
324
|
-
if (idOrFile.endsWith(".json") ||
|
|
325
|
-
idOrFile.endsWith(".ts") ||
|
|
326
|
-
idOrFile.endsWith(".tsx") ||
|
|
327
|
-
idOrFile.includes("/") ||
|
|
328
|
-
idOrFile.includes("\\")) {
|
|
329
|
-
let raw;
|
|
330
|
-
if (idOrFile.endsWith(".ts") || idOrFile.endsWith(".tsx")) {
|
|
331
|
-
// Execute DSL file via tsx and capture JSON output
|
|
332
|
-
const { execSync } = await import("node:child_process");
|
|
333
|
-
const output = execSync(`npx tsx "${resolve(idOrFile)}"`, {
|
|
334
|
-
encoding: "utf8",
|
|
335
|
-
cwd: dirname(resolve(idOrFile)),
|
|
336
|
-
timeout: 30000
|
|
337
|
-
});
|
|
338
|
-
raw = JSON.parse(output.trim());
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
const { readFileSync } = await import("node:fs");
|
|
342
|
-
raw = JSON.parse(readFileSync(idOrFile, "utf8"));
|
|
343
|
-
}
|
|
344
|
-
graph = raw.graph ?? raw;
|
|
345
|
-
workflowId = raw.workflow_id ?? raw.id ?? null;
|
|
346
|
-
if (raw.params)
|
|
347
|
-
Object.assign(params, raw.params);
|
|
348
|
-
}
|
|
349
|
-
else {
|
|
350
|
-
// Load from database
|
|
351
|
-
const wf = await Workflow.get(idOrFile);
|
|
352
|
-
if (!wf)
|
|
353
|
-
throw new Error(`Workflow not found: ${idOrFile}`);
|
|
354
|
-
graph = wf.graph;
|
|
355
|
-
workflowId = idOrFile;
|
|
356
|
-
}
|
|
357
|
-
if (!graph?.nodes || !graph?.edges) {
|
|
358
|
-
throw new Error("Invalid workflow: missing nodes or edges");
|
|
359
|
-
}
|
|
360
|
-
// Normalize graph: convert node.data → node.properties (kernel format)
|
|
361
|
-
graph.nodes = graph.nodes.map((n) => {
|
|
362
|
-
if (n.properties === undefined && n.data !== undefined) {
|
|
363
|
-
const { data, ...rest } = n;
|
|
364
|
-
return { ...rest, properties: data };
|
|
365
|
-
}
|
|
366
|
-
return n;
|
|
367
|
-
});
|
|
368
|
-
// Set up node registry
|
|
369
|
-
const registry = new NodeRegistry();
|
|
370
|
-
registerBaseNodes(registry);
|
|
371
|
-
registerElevenLabsNodes(registry);
|
|
372
|
-
registerTransformersJsNodes(registry);
|
|
373
|
-
registerFalNodes(registry);
|
|
374
|
-
registerReplicateNodes(registry);
|
|
375
|
-
// Create processing context with secret resolver
|
|
376
|
-
const jobId = `job-${Date.now()}`;
|
|
377
|
-
const context = new ProcessingContext({
|
|
378
|
-
jobId,
|
|
379
|
-
workflowId,
|
|
380
|
-
userId: "1",
|
|
381
|
-
secretResolver: getSecret
|
|
382
|
-
});
|
|
383
|
-
// Run workflow
|
|
384
|
-
const runner = new WorkflowRunner(jobId, {
|
|
385
|
-
resolveExecutor: (node) => {
|
|
386
|
-
if (!registry.has(node.type))
|
|
387
|
-
throw new Error(`Unknown node type: ${node.type}`);
|
|
388
|
-
return registry.resolve(node);
|
|
389
|
-
},
|
|
390
|
-
executionContext: context
|
|
391
|
-
});
|
|
392
|
-
console.error(`Running workflow${workflowId ? ` ${workflowId}` : ""}...`);
|
|
393
|
-
const result = await runner.run({ job_id: jobId, workflow_id: workflowId ?? undefined, params }, graph);
|
|
394
|
-
if (opts.json) {
|
|
395
|
-
console.log(JSON.stringify(result, null, 2));
|
|
396
|
-
}
|
|
397
|
-
else {
|
|
398
|
-
console.log(`Status: ${result.status}`);
|
|
399
|
-
if (result.error)
|
|
400
|
-
console.error(`Error: ${result.error}`);
|
|
401
|
-
for (const [nodeId, outputs] of Object.entries(result.outputs ?? {})) {
|
|
402
|
-
if (Array.isArray(outputs) && outputs.length > 0) {
|
|
403
|
-
console.log(`\nNode ${nodeId}:`);
|
|
404
|
-
for (const out of outputs) {
|
|
405
|
-
console.log(` ${JSON.stringify(out).slice(0, 200)}`);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
process.exit(result.status === "completed" ? 0 : 1);
|
|
411
|
-
}
|
|
412
|
-
catch (e) {
|
|
413
|
-
console.error(String(e));
|
|
414
|
-
process.exit(1);
|
|
415
|
-
}
|
|
416
|
-
});
|
|
417
|
-
workflows
|
|
418
|
-
.command("export-dsl <workflow_id_or_file>")
|
|
419
|
-
.description("Export a workflow as TypeScript DSL code")
|
|
420
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
421
|
-
.option("-o, --output <file>", "Write the exported DSL to a file")
|
|
422
|
-
.action(async (idOrFile, opts) => {
|
|
423
|
-
try {
|
|
424
|
-
let source;
|
|
425
|
-
if (idOrFile.endsWith(".json") ||
|
|
426
|
-
idOrFile.includes("/") ||
|
|
427
|
-
idOrFile.includes("\\")) {
|
|
428
|
-
const { readFileSync } = await import("node:fs");
|
|
429
|
-
const raw = JSON.parse(readFileSync(idOrFile, "utf8"));
|
|
430
|
-
const graph = (raw.graph ?? raw);
|
|
431
|
-
source = workflowToDsl(graph, {
|
|
432
|
-
workflowName: typeof raw.name === "string" ? raw.name : null
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
else {
|
|
436
|
-
source = await apiGetText(opts.apiUrl, `/api/workflows/${idOrFile}/dsl-export`);
|
|
437
|
-
}
|
|
438
|
-
if (opts.output) {
|
|
439
|
-
const { writeFile } = await import("node:fs/promises");
|
|
440
|
-
await writeFile(opts.output, source, "utf8");
|
|
441
|
-
console.log(opts.output);
|
|
442
|
-
return;
|
|
443
|
-
}
|
|
444
|
-
console.log(source);
|
|
445
|
-
}
|
|
446
|
-
catch (e) {
|
|
447
|
-
console.error(String(e));
|
|
448
|
-
process.exit(1);
|
|
449
|
-
}
|
|
450
|
-
});
|
|
451
|
-
// ---------------------------------------------------------------------------
|
|
452
|
-
// jobs
|
|
453
|
-
// ---------------------------------------------------------------------------
|
|
454
|
-
const jobs = program.command("jobs").description("Job management");
|
|
455
|
-
jobs
|
|
456
|
-
.command("list")
|
|
457
|
-
.description("List jobs")
|
|
458
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
459
|
-
.option("--workflow-id <id>", "Filter by workflow ID")
|
|
460
|
-
.option("--limit <n>", "Max results", "100")
|
|
461
|
-
.option("--json", "Output as JSON")
|
|
462
|
-
.action(async (opts) => {
|
|
463
|
-
try {
|
|
464
|
-
const client = createApiClient(opts.apiUrl);
|
|
465
|
-
const data = await client.jobs.list.query({
|
|
466
|
-
limit: Number.parseInt(opts.limit, 10),
|
|
467
|
-
...(opts.workflowId ? { workflow_id: opts.workflowId } : {})
|
|
468
|
-
});
|
|
469
|
-
const rows = data.jobs;
|
|
470
|
-
if (opts.json) {
|
|
471
|
-
asJson(rows);
|
|
472
|
-
return;
|
|
473
|
-
}
|
|
474
|
-
printTable(rows.map((r) => ({
|
|
475
|
-
id: r["id"],
|
|
476
|
-
status: r["status"],
|
|
477
|
-
workflow_id: r["workflow_id"],
|
|
478
|
-
started_at: r["started_at"]
|
|
479
|
-
})));
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
console.error(String(e));
|
|
483
|
-
process.exit(1);
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
jobs
|
|
487
|
-
.command("get <job_id>")
|
|
488
|
-
.description("Get a job by ID")
|
|
489
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
490
|
-
.option("--json", "Output as JSON")
|
|
491
|
-
.action(async (jobId, opts) => {
|
|
492
|
-
try {
|
|
493
|
-
const client = createApiClient(opts.apiUrl);
|
|
494
|
-
const data = await client.jobs.get.query({ id: jobId });
|
|
495
|
-
if (opts.json) {
|
|
496
|
-
asJson(data);
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
const j = data;
|
|
500
|
-
printTable([
|
|
501
|
-
{
|
|
502
|
-
id: j["id"],
|
|
503
|
-
status: j["status"],
|
|
504
|
-
workflow_id: j["workflow_id"],
|
|
505
|
-
error: j["error"] ?? ""
|
|
506
|
-
}
|
|
507
|
-
]);
|
|
508
|
-
}
|
|
509
|
-
catch (e) {
|
|
510
|
-
console.error(String(e));
|
|
511
|
-
process.exit(1);
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
// ---------------------------------------------------------------------------
|
|
515
|
-
// assets
|
|
516
|
-
// ---------------------------------------------------------------------------
|
|
517
|
-
const assets = program.command("assets").description("Asset management");
|
|
518
|
-
assets
|
|
519
|
-
.command("list")
|
|
520
|
-
.description("List assets")
|
|
521
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
522
|
-
.option("--query <q>", "Search query")
|
|
523
|
-
.option("--content-type <type>", "Filter by content type")
|
|
524
|
-
.option("--limit <n>", "Max results", "100")
|
|
525
|
-
.option("--json", "Output as JSON")
|
|
526
|
-
.action(async (opts) => {
|
|
527
|
-
try {
|
|
528
|
-
const client = createApiClient(opts.apiUrl);
|
|
529
|
-
const data = await client.assets.list.query({
|
|
530
|
-
page_size: Number.parseInt(opts.limit, 10),
|
|
531
|
-
...(opts.contentType ? { content_type: opts.contentType } : {})
|
|
532
|
-
});
|
|
533
|
-
// Note: --query isn't forwarded because assets.list has no server-side
|
|
534
|
-
// search; keep local filtering until the tRPC schema exposes one.
|
|
535
|
-
let rows = data.assets;
|
|
536
|
-
if (opts.query) {
|
|
537
|
-
const q = String(opts.query).toLowerCase();
|
|
538
|
-
rows = rows.filter((r) => String(r["name"] ?? "").toLowerCase().includes(q));
|
|
539
|
-
}
|
|
540
|
-
if (opts.json) {
|
|
541
|
-
asJson(rows);
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
printTable(rows.map((r) => ({
|
|
545
|
-
id: r["id"],
|
|
546
|
-
name: r["name"],
|
|
547
|
-
content_type: r["content_type"],
|
|
548
|
-
size: r["size"]
|
|
549
|
-
})));
|
|
550
|
-
}
|
|
551
|
-
catch (e) {
|
|
552
|
-
console.error(String(e));
|
|
553
|
-
process.exit(1);
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
assets
|
|
557
|
-
.command("get <asset_id>")
|
|
558
|
-
.description("Get an asset by ID")
|
|
559
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
560
|
-
.option("--json", "Output as JSON")
|
|
561
|
-
.action(async (assetId, opts) => {
|
|
562
|
-
try {
|
|
563
|
-
const client = createApiClient(opts.apiUrl);
|
|
564
|
-
const data = await client.assets.get.query({ id: assetId });
|
|
565
|
-
if (opts.json) {
|
|
566
|
-
asJson(data);
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
const a = data;
|
|
570
|
-
printTable([
|
|
571
|
-
{
|
|
572
|
-
id: a["id"],
|
|
573
|
-
name: a["name"],
|
|
574
|
-
content_type: a["content_type"],
|
|
575
|
-
size: a["size"],
|
|
576
|
-
url: a["url"]
|
|
577
|
-
}
|
|
578
|
-
]);
|
|
579
|
-
}
|
|
580
|
-
catch (e) {
|
|
581
|
-
console.error(String(e));
|
|
582
|
-
process.exit(1);
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
// ---------------------------------------------------------------------------
|
|
586
|
-
// models
|
|
587
|
-
// ---------------------------------------------------------------------------
|
|
588
|
-
const models = program.command("models").description("Model management");
|
|
589
|
-
const modelKinds = ["llm", "image", "tts", "asr", "video", "embedding"];
|
|
590
|
-
const byProviderRoute = {
|
|
591
|
-
llm: "llmByProvider",
|
|
592
|
-
image: "imageByProvider",
|
|
593
|
-
tts: "ttsByProvider",
|
|
594
|
-
asr: "asrByProvider",
|
|
595
|
-
video: "videoByProvider",
|
|
596
|
-
embedding: "embeddingByProvider"
|
|
597
|
-
};
|
|
598
|
-
function modelRow(m) {
|
|
599
|
-
return {
|
|
600
|
-
id: m["id"],
|
|
601
|
-
name: m["name"],
|
|
602
|
-
provider: m["provider"] ?? "",
|
|
603
|
-
type: m["type"] ?? "",
|
|
604
|
-
repo_id: m["repo_id"] ?? ""
|
|
605
|
-
};
|
|
606
|
-
}
|
|
607
|
-
models
|
|
608
|
-
.command("list")
|
|
609
|
-
.description("List all models (recommended + provider + HF cached)")
|
|
610
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
611
|
-
.option("--json", "Output as JSON")
|
|
612
|
-
.action(async (opts) => {
|
|
613
|
-
try {
|
|
614
|
-
const client = createApiClient(opts.apiUrl);
|
|
615
|
-
const data = await client.models.all.query();
|
|
616
|
-
const rows = data;
|
|
617
|
-
if (opts.json) {
|
|
618
|
-
asJson(rows);
|
|
619
|
-
return;
|
|
620
|
-
}
|
|
621
|
-
printTable(rows.map(modelRow));
|
|
622
|
-
}
|
|
623
|
-
catch (e) {
|
|
624
|
-
console.error(String(e));
|
|
625
|
-
process.exit(1);
|
|
626
|
-
}
|
|
627
|
-
});
|
|
628
|
-
models
|
|
629
|
-
.command("providers")
|
|
630
|
-
.description("List configured providers and their capabilities")
|
|
631
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
632
|
-
.option("--json", "Output as JSON")
|
|
633
|
-
.action(async (opts) => {
|
|
634
|
-
try {
|
|
635
|
-
const client = createApiClient(opts.apiUrl);
|
|
636
|
-
const data = await client.models.providers.query();
|
|
637
|
-
if (opts.json) {
|
|
638
|
-
asJson(data);
|
|
639
|
-
return;
|
|
640
|
-
}
|
|
641
|
-
printTable(data.map((p) => ({
|
|
642
|
-
provider: p.provider,
|
|
643
|
-
capabilities: p.capabilities.join(", ")
|
|
644
|
-
})));
|
|
645
|
-
}
|
|
646
|
-
catch (e) {
|
|
647
|
-
console.error(String(e));
|
|
648
|
-
process.exit(1);
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
registerRecommendedCommand(models);
|
|
652
|
-
registerHfCommands(models);
|
|
653
|
-
models
|
|
654
|
-
.command("ollama")
|
|
655
|
-
.description("List Ollama models")
|
|
656
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
657
|
-
.option("--json", "Output as JSON")
|
|
658
|
-
.action(async (opts) => {
|
|
659
|
-
try {
|
|
660
|
-
const client = createApiClient(opts.apiUrl);
|
|
661
|
-
const data = await client.models.ollama.query();
|
|
662
|
-
const rows = data;
|
|
663
|
-
if (opts.json) {
|
|
664
|
-
asJson(rows);
|
|
665
|
-
return;
|
|
666
|
-
}
|
|
667
|
-
printTable(rows);
|
|
668
|
-
}
|
|
669
|
-
catch (e) {
|
|
670
|
-
console.error(String(e));
|
|
671
|
-
process.exit(1);
|
|
672
|
-
}
|
|
673
|
-
});
|
|
674
|
-
models
|
|
675
|
-
.command("huggingface")
|
|
676
|
-
.description("List HuggingFace cached models")
|
|
677
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
678
|
-
.option("--query <q>", "Search query")
|
|
679
|
-
.option("--type <t>", "Filter by HF model type")
|
|
680
|
-
.option("--json", "Output as JSON")
|
|
681
|
-
.action(async (opts) => {
|
|
682
|
-
try {
|
|
683
|
-
const client = createApiClient(opts.apiUrl);
|
|
684
|
-
const data = opts.query || opts.type
|
|
685
|
-
? await client.models.huggingfaceSearch.query({
|
|
686
|
-
...(opts.query ? { query: String(opts.query) } : {}),
|
|
687
|
-
...(opts.type ? { type: String(opts.type) } : {})
|
|
688
|
-
})
|
|
689
|
-
: await client.models.huggingfaceList.query();
|
|
690
|
-
const rows = data;
|
|
691
|
-
if (opts.json) {
|
|
692
|
-
asJson(rows);
|
|
693
|
-
return;
|
|
694
|
-
}
|
|
695
|
-
printTable(rows.map(modelRow));
|
|
696
|
-
}
|
|
697
|
-
catch (e) {
|
|
698
|
-
console.error(String(e));
|
|
699
|
-
process.exit(1);
|
|
700
|
-
}
|
|
701
|
-
});
|
|
702
|
-
models
|
|
703
|
-
.command("by-provider <provider>")
|
|
704
|
-
.description(`List models for a provider. --kind one of: ${modelKinds.join(", ")}`)
|
|
705
|
-
.option("--api-url <url>", "API base URL", process.env["NODETOOL_API_URL"] ?? "http://localhost:7777")
|
|
706
|
-
.option("--kind <kind>", "Model kind", "llm")
|
|
707
|
-
.option("--json", "Output as JSON")
|
|
708
|
-
.action(async (provider, opts) => {
|
|
709
|
-
const kind = opts.kind;
|
|
710
|
-
if (!modelKinds.includes(kind)) {
|
|
711
|
-
console.error(`Invalid --kind '${opts.kind}'. Must be one of: ${modelKinds.join(", ")}`);
|
|
712
|
-
process.exit(1);
|
|
713
|
-
}
|
|
714
|
-
try {
|
|
715
|
-
const client = createApiClient(opts.apiUrl);
|
|
716
|
-
const route = byProviderRoute[kind];
|
|
717
|
-
const data = await client.models[route].query({ provider });
|
|
718
|
-
const rows = data;
|
|
719
|
-
if (opts.json) {
|
|
720
|
-
asJson(rows);
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
|
-
printTable(rows.map(modelRow));
|
|
724
|
-
}
|
|
725
|
-
catch (e) {
|
|
726
|
-
console.error(String(e));
|
|
727
|
-
process.exit(1);
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
// ---------------------------------------------------------------------------
|
|
731
|
-
// secrets
|
|
732
|
-
// ---------------------------------------------------------------------------
|
|
733
|
-
const secrets = program
|
|
734
|
-
.command("secrets")
|
|
735
|
-
.description("Manage encrypted secrets");
|
|
736
|
-
secrets
|
|
737
|
-
.command("list")
|
|
738
|
-
.description("List stored secret keys (values are never shown)")
|
|
739
|
-
.option("--user-id <id>", "User ID", "1")
|
|
740
|
-
.action(async (opts) => {
|
|
741
|
-
await setupDb();
|
|
742
|
-
try {
|
|
743
|
-
const [items] = await Secret.listForUser(opts.userId, 100);
|
|
744
|
-
if (items.length === 0) {
|
|
745
|
-
console.log("No secrets stored.");
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
printTable(items.map((s) => ({ key: s.key, updated_at: s.updated_at ?? "" })));
|
|
749
|
-
}
|
|
750
|
-
catch (e) {
|
|
751
|
-
console.error(String(e));
|
|
752
|
-
process.exit(1);
|
|
753
|
-
}
|
|
754
|
-
});
|
|
755
|
-
secrets
|
|
756
|
-
.command("store <key>")
|
|
757
|
-
.description("Store or update a secret (prompts for value)")
|
|
758
|
-
.option("--user-id <id>", "User ID", "1")
|
|
759
|
-
.option("--description <desc>", "Optional description")
|
|
760
|
-
.action(async (key, opts) => {
|
|
761
|
-
await setupDb();
|
|
762
|
-
const rl = createInterface({
|
|
763
|
-
input: process.stdin,
|
|
764
|
-
output: process.stderr
|
|
765
|
-
});
|
|
766
|
-
const value = await new Promise((resolve) => {
|
|
767
|
-
process.stderr.write(`Enter value for '${key}': `);
|
|
768
|
-
rl.question("", (ans) => {
|
|
769
|
-
rl.close();
|
|
770
|
-
resolve(ans);
|
|
771
|
-
});
|
|
772
|
-
});
|
|
773
|
-
try {
|
|
774
|
-
await Secret.upsert({
|
|
775
|
-
userId: opts.userId,
|
|
776
|
-
key,
|
|
777
|
-
value,
|
|
778
|
-
description: opts.description
|
|
779
|
-
});
|
|
780
|
-
console.log(`Secret '${key}' stored.`);
|
|
781
|
-
}
|
|
782
|
-
catch (e) {
|
|
783
|
-
console.error(String(e));
|
|
784
|
-
process.exit(1);
|
|
785
|
-
}
|
|
786
|
-
});
|
|
787
|
-
secrets
|
|
788
|
-
.command("get <key>")
|
|
789
|
-
.description("Retrieve and print a secret value")
|
|
790
|
-
.option("--user-id <id>", "User ID", "1")
|
|
791
|
-
.action(async (key, opts) => {
|
|
792
|
-
await setupDb();
|
|
793
|
-
try {
|
|
794
|
-
const value = await getSecret(key, opts.userId);
|
|
795
|
-
if (value == null) {
|
|
796
|
-
console.error(`Secret '${key}' not found.`);
|
|
797
|
-
process.exit(1);
|
|
798
|
-
}
|
|
799
|
-
console.log(value);
|
|
800
|
-
}
|
|
801
|
-
catch (e) {
|
|
802
|
-
console.error(String(e));
|
|
803
|
-
process.exit(1);
|
|
804
|
-
}
|
|
805
|
-
});
|
|
806
|
-
// ---------------------------------------------------------------------------
|
|
807
|
-
// settings
|
|
808
|
-
// ---------------------------------------------------------------------------
|
|
809
|
-
const settings = program
|
|
810
|
-
.command("settings")
|
|
811
|
-
.description("View configuration settings");
|
|
812
|
-
settings
|
|
813
|
-
.command("show")
|
|
814
|
-
.description("Show current settings from environment")
|
|
815
|
-
.option("--json", "Output as JSON")
|
|
816
|
-
.action((opts) => {
|
|
817
|
-
const vars = [
|
|
818
|
-
"ENV",
|
|
819
|
-
"LOG_LEVEL",
|
|
820
|
-
"PORT",
|
|
821
|
-
"HOST",
|
|
822
|
-
"DB_PATH",
|
|
823
|
-
"NODETOOL_API_URL",
|
|
824
|
-
"ANTHROPIC_API_KEY",
|
|
825
|
-
"OPENAI_API_KEY",
|
|
826
|
-
"GEMINI_API_KEY",
|
|
827
|
-
"MISTRAL_API_KEY",
|
|
828
|
-
"GROQ_API_KEY",
|
|
829
|
-
"OLLAMA_API_URL",
|
|
830
|
-
"SERPAPI_API_KEY",
|
|
831
|
-
"HF_TOKEN",
|
|
832
|
-
"VECTORSTORE_DB_PATH",
|
|
833
|
-
"ASSET_BUCKET",
|
|
834
|
-
"S3_ENDPOINT_URL"
|
|
835
|
-
];
|
|
836
|
-
const data = Object.fromEntries(vars.map((k) => [
|
|
837
|
-
k,
|
|
838
|
-
process.env[k]
|
|
839
|
-
? k.endsWith("KEY") || k.endsWith("TOKEN")
|
|
840
|
-
? "***"
|
|
841
|
-
: process.env[k]
|
|
842
|
-
: ""
|
|
843
|
-
]));
|
|
844
|
-
if (opts.json) {
|
|
845
|
-
asJson(data);
|
|
846
|
-
return;
|
|
847
|
-
}
|
|
848
|
-
printTable(Object.entries(data).map(([variable, value]) => ({ variable, value })));
|
|
849
|
-
});
|
|
850
|
-
// ---------------------------------------------------------------------------
|
|
851
|
-
// mcp
|
|
852
|
-
// ---------------------------------------------------------------------------
|
|
853
|
-
const mcp = program
|
|
854
|
-
.command("mcp")
|
|
855
|
-
.description("MCP server integration for AI coding assistants");
|
|
856
|
-
mcp
|
|
857
|
-
.command("install")
|
|
858
|
-
.description("Install NodeTool MCP server config for Claude Code, Codex, and/or OpenCode")
|
|
859
|
-
.option("--url <url>", "MCP server URL", "http://127.0.0.1:7777/mcp")
|
|
860
|
-
.option("--claude", "Install for Claude Code only")
|
|
861
|
-
.option("--codex", "Install for Codex only")
|
|
862
|
-
.option("--opencode", "Install for OpenCode only")
|
|
863
|
-
.action(async (opts) => {
|
|
864
|
-
const { readFileSync, writeFileSync, existsSync, mkdirSync } = await import("node:fs");
|
|
865
|
-
const { join } = await import("node:path");
|
|
866
|
-
const { homedir } = await import("node:os");
|
|
867
|
-
const home = homedir();
|
|
868
|
-
const mcpUrl = opts.url;
|
|
869
|
-
const installAll = !opts.claude && !opts.codex && !opts.opencode;
|
|
870
|
-
const results = [];
|
|
871
|
-
// ── Claude Code ──────────────────────────────────────────────
|
|
872
|
-
if (installAll || opts.claude) {
|
|
873
|
-
try {
|
|
874
|
-
const claudeConfigPath = join(home, ".claude.json");
|
|
875
|
-
let config = {};
|
|
876
|
-
if (existsSync(claudeConfigPath)) {
|
|
877
|
-
config = JSON.parse(readFileSync(claudeConfigPath, "utf8"));
|
|
878
|
-
}
|
|
879
|
-
// Install globally under projects."~" which applies to all projects
|
|
880
|
-
const projects = (config["projects"] ?? {});
|
|
881
|
-
const globalProject = projects[home] ?? {};
|
|
882
|
-
const mcpServers = (globalProject["mcpServers"] ?? {});
|
|
883
|
-
mcpServers["nodetool"] = {
|
|
884
|
-
type: "http",
|
|
885
|
-
url: mcpUrl
|
|
886
|
-
};
|
|
887
|
-
globalProject["mcpServers"] = mcpServers;
|
|
888
|
-
projects[home] = globalProject;
|
|
889
|
-
config["projects"] = projects;
|
|
890
|
-
writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2) + "\n");
|
|
891
|
-
results.push({ target: "Claude Code", status: `Installed → ${claudeConfigPath}` });
|
|
892
|
-
}
|
|
893
|
-
catch (e) {
|
|
894
|
-
results.push({ target: "Claude Code", status: `Error: ${e}` });
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
// ── Codex ────────────────────────────────────────────────────
|
|
898
|
-
if (installAll || opts.codex) {
|
|
899
|
-
try {
|
|
900
|
-
const codexDir = join(home, ".codex");
|
|
901
|
-
const codexConfigPath = join(codexDir, "config.toml");
|
|
902
|
-
mkdirSync(codexDir, { recursive: true });
|
|
903
|
-
const NODETOOL_MCP_BEGIN = "# BEGIN NODETOOL MCP";
|
|
904
|
-
const NODETOOL_MCP_END = "# END NODETOOL MCP";
|
|
905
|
-
const mcpBlock = [
|
|
906
|
-
NODETOOL_MCP_BEGIN,
|
|
907
|
-
"[mcp_servers.nodetool]",
|
|
908
|
-
`url = "${mcpUrl}"`,
|
|
909
|
-
"startup_timeout_sec = 20",
|
|
910
|
-
"tool_timeout_sec = 60",
|
|
911
|
-
"enabled = true",
|
|
912
|
-
"required = true",
|
|
913
|
-
NODETOOL_MCP_END
|
|
914
|
-
].join("\n");
|
|
915
|
-
let content = "";
|
|
916
|
-
if (existsSync(codexConfigPath)) {
|
|
917
|
-
content = readFileSync(codexConfigPath, "utf8");
|
|
918
|
-
const re = new RegExp(`${NODETOOL_MCP_BEGIN}[\\s\\S]*?${NODETOOL_MCP_END}\\n?`);
|
|
919
|
-
if (re.test(content)) {
|
|
920
|
-
content = content.replace(re, mcpBlock + "\n");
|
|
921
|
-
}
|
|
922
|
-
else {
|
|
923
|
-
content = content.trimEnd() + "\n\n" + mcpBlock + "\n";
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
else {
|
|
927
|
-
content = mcpBlock + "\n";
|
|
928
|
-
}
|
|
929
|
-
writeFileSync(codexConfigPath, content);
|
|
930
|
-
results.push({ target: "Codex", status: `Installed → ${codexConfigPath}` });
|
|
931
|
-
}
|
|
932
|
-
catch (e) {
|
|
933
|
-
results.push({ target: "Codex", status: `Error: ${e}` });
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
// ── OpenCode ─────────────────────────────────────────────────
|
|
937
|
-
if (installAll || opts.opencode) {
|
|
938
|
-
try {
|
|
939
|
-
const opencodeDir = join(home, ".config", "opencode");
|
|
940
|
-
const opencodeConfigPath = join(opencodeDir, "opencode.json");
|
|
941
|
-
mkdirSync(opencodeDir, { recursive: true });
|
|
942
|
-
let config = {};
|
|
943
|
-
if (existsSync(opencodeConfigPath)) {
|
|
944
|
-
config = JSON.parse(readFileSync(opencodeConfigPath, "utf8"));
|
|
945
|
-
}
|
|
946
|
-
const mcpConfig = (config["mcp"] ?? {});
|
|
947
|
-
mcpConfig["nodetool"] = {
|
|
948
|
-
type: "remote",
|
|
949
|
-
url: mcpUrl
|
|
950
|
-
};
|
|
951
|
-
config["mcp"] = mcpConfig;
|
|
952
|
-
writeFileSync(opencodeConfigPath, JSON.stringify(config, null, 2) + "\n");
|
|
953
|
-
results.push({ target: "OpenCode", status: `Installed → ${opencodeConfigPath}` });
|
|
954
|
-
}
|
|
955
|
-
catch (e) {
|
|
956
|
-
results.push({ target: "OpenCode", status: `Error: ${e}` });
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
console.log(`\nNodeTool MCP Server: ${mcpUrl}\n`);
|
|
960
|
-
printTable(results);
|
|
961
|
-
console.log("\nMake sure the NodeTool server is running (nodetool serve) for MCP to work.\n");
|
|
962
|
-
});
|
|
963
|
-
mcp
|
|
964
|
-
.command("uninstall")
|
|
965
|
-
.description("Remove NodeTool MCP server config from all AI coding assistants")
|
|
966
|
-
.option("--claude", "Uninstall from Claude Code only")
|
|
967
|
-
.option("--codex", "Uninstall from Codex only")
|
|
968
|
-
.option("--opencode", "Uninstall from OpenCode only")
|
|
969
|
-
.action(async (opts) => {
|
|
970
|
-
const { readFileSync, writeFileSync, existsSync } = await import("node:fs");
|
|
971
|
-
const { join } = await import("node:path");
|
|
972
|
-
const { homedir } = await import("node:os");
|
|
973
|
-
const home = homedir();
|
|
974
|
-
const uninstallAll = !opts.claude && !opts.codex && !opts.opencode;
|
|
975
|
-
const results = [];
|
|
976
|
-
// ── Claude Code ──────────────────────────────────────────────
|
|
977
|
-
if (uninstallAll || opts.claude) {
|
|
978
|
-
try {
|
|
979
|
-
const claudeConfigPath = join(home, ".claude.json");
|
|
980
|
-
if (existsSync(claudeConfigPath)) {
|
|
981
|
-
const config = JSON.parse(readFileSync(claudeConfigPath, "utf8"));
|
|
982
|
-
const projects = config["projects"] ?? {};
|
|
983
|
-
const globalProject = projects[home] ?? {};
|
|
984
|
-
const mcpServers = globalProject["mcpServers"] ?? {};
|
|
985
|
-
if ("nodetool" in mcpServers) {
|
|
986
|
-
delete mcpServers["nodetool"];
|
|
987
|
-
globalProject["mcpServers"] = mcpServers;
|
|
988
|
-
projects[home] = globalProject;
|
|
989
|
-
config["projects"] = projects;
|
|
990
|
-
writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2) + "\n");
|
|
991
|
-
results.push({ target: "Claude Code", status: "Removed" });
|
|
992
|
-
}
|
|
993
|
-
else {
|
|
994
|
-
results.push({ target: "Claude Code", status: "Not installed" });
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
else {
|
|
998
|
-
results.push({ target: "Claude Code", status: "Config not found" });
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
catch (e) {
|
|
1002
|
-
results.push({ target: "Claude Code", status: `Error: ${e}` });
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
// ── Codex ────────────────────────────────────────────────────
|
|
1006
|
-
if (uninstallAll || opts.codex) {
|
|
1007
|
-
try {
|
|
1008
|
-
const codexConfigPath = join(home, ".codex", "config.toml");
|
|
1009
|
-
if (existsSync(codexConfigPath)) {
|
|
1010
|
-
let content = readFileSync(codexConfigPath, "utf8");
|
|
1011
|
-
const re = /# BEGIN NODETOOL MCP[\s\S]*?# END NODETOOL MCP\n?/;
|
|
1012
|
-
if (re.test(content)) {
|
|
1013
|
-
content = content.replace(re, "").trimEnd() + "\n";
|
|
1014
|
-
writeFileSync(codexConfigPath, content);
|
|
1015
|
-
results.push({ target: "Codex", status: "Removed" });
|
|
1016
|
-
}
|
|
1017
|
-
else {
|
|
1018
|
-
results.push({ target: "Codex", status: "Not installed" });
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
else {
|
|
1022
|
-
results.push({ target: "Codex", status: "Config not found" });
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
catch (e) {
|
|
1026
|
-
results.push({ target: "Codex", status: `Error: ${e}` });
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
// ── OpenCode ─────────────────────────────────────────────────
|
|
1030
|
-
if (uninstallAll || opts.opencode) {
|
|
1031
|
-
try {
|
|
1032
|
-
const opencodeConfigPath = join(home, ".config", "opencode", "opencode.json");
|
|
1033
|
-
if (existsSync(opencodeConfigPath)) {
|
|
1034
|
-
const config = JSON.parse(readFileSync(opencodeConfigPath, "utf8"));
|
|
1035
|
-
const mcpConfig = config["mcp"] ?? {};
|
|
1036
|
-
if ("nodetool" in mcpConfig) {
|
|
1037
|
-
delete mcpConfig["nodetool"];
|
|
1038
|
-
config["mcp"] = mcpConfig;
|
|
1039
|
-
writeFileSync(opencodeConfigPath, JSON.stringify(config, null, 2) + "\n");
|
|
1040
|
-
results.push({ target: "OpenCode", status: "Removed" });
|
|
1041
|
-
}
|
|
1042
|
-
else {
|
|
1043
|
-
results.push({ target: "OpenCode", status: "Not installed" });
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
else {
|
|
1047
|
-
results.push({ target: "OpenCode", status: "Config not found" });
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
catch (e) {
|
|
1051
|
-
results.push({ target: "OpenCode", status: `Error: ${e}` });
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
console.log();
|
|
1055
|
-
printTable(results);
|
|
1056
|
-
console.log();
|
|
1057
|
-
});
|
|
1058
|
-
mcp
|
|
1059
|
-
.command("status")
|
|
1060
|
-
.description("Show NodeTool MCP installation status for all AI coding assistants")
|
|
1061
|
-
.action(async () => {
|
|
1062
|
-
const { readFileSync, existsSync } = await import("node:fs");
|
|
1063
|
-
const { join } = await import("node:path");
|
|
1064
|
-
const { homedir } = await import("node:os");
|
|
1065
|
-
const home = homedir();
|
|
1066
|
-
const results = [];
|
|
1067
|
-
// Claude Code
|
|
1068
|
-
try {
|
|
1069
|
-
const claudeConfigPath = join(home, ".claude.json");
|
|
1070
|
-
if (existsSync(claudeConfigPath)) {
|
|
1071
|
-
const config = JSON.parse(readFileSync(claudeConfigPath, "utf8"));
|
|
1072
|
-
const mcpServers = config?.projects?.[home]?.mcpServers ?? {};
|
|
1073
|
-
if (mcpServers["nodetool"]) {
|
|
1074
|
-
results.push({
|
|
1075
|
-
target: "Claude Code",
|
|
1076
|
-
status: "Installed",
|
|
1077
|
-
url: mcpServers["nodetool"].url ?? ""
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
else {
|
|
1081
|
-
results.push({ target: "Claude Code", status: "Not installed", url: "" });
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1084
|
-
else {
|
|
1085
|
-
results.push({ target: "Claude Code", status: "No config", url: "" });
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
catch {
|
|
1089
|
-
results.push({ target: "Claude Code", status: "Error reading config", url: "" });
|
|
1090
|
-
}
|
|
1091
|
-
// Codex
|
|
1092
|
-
try {
|
|
1093
|
-
const codexConfigPath = join(home, ".codex", "config.toml");
|
|
1094
|
-
if (existsSync(codexConfigPath)) {
|
|
1095
|
-
const content = readFileSync(codexConfigPath, "utf8");
|
|
1096
|
-
const urlMatch = /# BEGIN NODETOOL MCP[\s\S]*?url\s*=\s*"([^"]*)"/.exec(content);
|
|
1097
|
-
if (urlMatch) {
|
|
1098
|
-
results.push({
|
|
1099
|
-
target: "Codex",
|
|
1100
|
-
status: "Installed",
|
|
1101
|
-
url: urlMatch[1] ?? ""
|
|
1102
|
-
});
|
|
1103
|
-
}
|
|
1104
|
-
else {
|
|
1105
|
-
results.push({ target: "Codex", status: "Not installed", url: "" });
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
else {
|
|
1109
|
-
results.push({ target: "Codex", status: "No config", url: "" });
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
catch {
|
|
1113
|
-
results.push({ target: "Codex", status: "Error reading config", url: "" });
|
|
1114
|
-
}
|
|
1115
|
-
// OpenCode
|
|
1116
|
-
try {
|
|
1117
|
-
const opencodeConfigPath = join(home, ".config", "opencode", "opencode.json");
|
|
1118
|
-
if (existsSync(opencodeConfigPath)) {
|
|
1119
|
-
const config = JSON.parse(readFileSync(opencodeConfigPath, "utf8"));
|
|
1120
|
-
if (config?.mcp?.nodetool) {
|
|
1121
|
-
results.push({
|
|
1122
|
-
target: "OpenCode",
|
|
1123
|
-
status: "Installed",
|
|
1124
|
-
url: config.mcp.nodetool.url ?? ""
|
|
1125
|
-
});
|
|
1126
|
-
}
|
|
1127
|
-
else {
|
|
1128
|
-
results.push({ target: "OpenCode", status: "Not installed", url: "" });
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
else {
|
|
1132
|
-
results.push({ target: "OpenCode", status: "No config", url: "" });
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
catch {
|
|
1136
|
-
results.push({ target: "OpenCode", status: "Error reading config", url: "" });
|
|
1137
|
-
}
|
|
1138
|
-
console.log("\nNodeTool MCP Integration Status\n");
|
|
1139
|
-
printTable(results);
|
|
1140
|
-
console.log();
|
|
1141
|
-
});
|
|
1142
|
-
// ---------------------------------------------------------------------------
|
|
1143
|
-
// package
|
|
1144
|
-
// ---------------------------------------------------------------------------
|
|
1145
|
-
registerPackageCommands(program);
|
|
1146
|
-
// ---------------------------------------------------------------------------
|
|
1147
|
-
// deploy / list-gcp-options — registered from commands/deploy.ts
|
|
1148
|
-
// ---------------------------------------------------------------------------
|
|
1149
|
-
registerDeployCommands(program);
|
|
1150
|
-
registerListGcpOptions(program);
|
|
1151
|
-
registerAgentCommands(program);
|
|
1152
|
-
// ---------------------------------------------------------------------------
|
|
1153
|
-
program.parse();
|
|
23
|
+
export {};
|
|
1154
24
|
//# sourceMappingURL=nodetool.js.map
|