@nodetool-ai/agents 0.7.0-rc.22 → 0.8.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.
- package/README.md +35 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/analysis/audio-dsp.d.ts +223 -0
- package/dist/analysis/audio-dsp.d.ts.map +1 -0
- package/dist/analysis/audio-dsp.js +642 -0
- package/dist/analysis/audio-dsp.js.map +1 -0
- package/dist/analysis/media-decode.d.ts +85 -0
- package/dist/analysis/media-decode.d.ts.map +1 -0
- package/dist/analysis/media-decode.js +199 -0
- package/dist/analysis/media-decode.js.map +1 -0
- package/dist/analysis/mediabunny-runtime.d.ts +15 -0
- package/dist/analysis/mediabunny-runtime.d.ts.map +1 -0
- package/dist/analysis/mediabunny-runtime.js +30 -0
- package/dist/analysis/mediabunny-runtime.js.map +1 -0
- package/dist/analysis/video-frames.d.ts +120 -0
- package/dist/analysis/video-frames.d.ts.map +1 -0
- package/dist/analysis/video-frames.js +288 -0
- package/dist/analysis/video-frames.js.map +1 -0
- package/dist/apify/assets.d.ts +80 -0
- package/dist/apify/assets.d.ts.map +1 -0
- package/dist/apify/assets.js +192 -0
- package/dist/apify/assets.js.map +1 -0
- package/dist/apify/catalog.d.ts +44 -0
- package/dist/apify/catalog.d.ts.map +1 -0
- package/dist/apify/catalog.js +108 -0
- package/dist/apify/catalog.js.map +1 -0
- package/dist/apify/client.d.ts +137 -0
- package/dist/apify/client.d.ts.map +1 -0
- package/dist/apify/client.js +346 -0
- package/dist/apify/client.js.map +1 -0
- package/dist/apify/errors.d.ts +85 -0
- package/dist/apify/errors.d.ts.map +1 -0
- package/dist/apify/errors.js +90 -0
- package/dist/apify/errors.js.map +1 -0
- package/dist/apify/normalize.d.ts +131 -0
- package/dist/apify/normalize.d.ts.map +1 -0
- package/dist/apify/normalize.js +202 -0
- package/dist/apify/normalize.js.map +1 -0
- package/dist/apify/policy.d.ts +136 -0
- package/dist/apify/policy.d.ts.map +1 -0
- package/dist/apify/policy.js +223 -0
- package/dist/apify/policy.js.map +1 -0
- package/dist/apify/run.d.ts +86 -0
- package/dist/apify/run.d.ts.map +1 -0
- package/dist/apify/run.js +158 -0
- package/dist/apify/run.js.map +1 -0
- package/dist/app-build/author.d.ts +67 -0
- package/dist/app-build/author.d.ts.map +1 -0
- package/dist/app-build/author.js +231 -0
- package/dist/app-build/author.js.map +1 -0
- package/dist/app-build/bridge.d.ts +130 -0
- package/dist/app-build/bridge.d.ts.map +1 -0
- package/dist/app-build/bridge.js +647 -0
- package/dist/app-build/bridge.js.map +1 -0
- package/dist/app-build/build-service.d.ts +66 -0
- package/dist/app-build/build-service.d.ts.map +1 -0
- package/dist/app-build/build-service.js +249 -0
- package/dist/app-build/build-service.js.map +1 -0
- package/dist/app-build/build.d.ts +115 -0
- package/dist/app-build/build.d.ts.map +1 -0
- package/dist/app-build/build.js +901 -0
- package/dist/app-build/build.js.map +1 -0
- package/dist/app-build/interactions.d.ts +20 -0
- package/dist/app-build/interactions.d.ts.map +1 -0
- package/dist/app-build/interactions.js +121 -0
- package/dist/app-build/interactions.js.map +1 -0
- package/dist/app-build/judge.d.ts +113 -0
- package/dist/app-build/judge.d.ts.map +1 -0
- package/dist/app-build/judge.js +318 -0
- package/dist/app-build/judge.js.map +1 -0
- package/dist/app-build/markdown.d.ts +10 -0
- package/dist/app-build/markdown.d.ts.map +1 -0
- package/dist/app-build/markdown.js +65 -0
- package/dist/app-build/markdown.js.map +1 -0
- package/dist/app-build/spec.d.ts +228 -0
- package/dist/app-build/spec.d.ts.map +1 -0
- package/dist/app-build/spec.js +651 -0
- package/dist/app-build/spec.js.map +1 -0
- package/dist/app-build/tool-loop.d.ts +84 -0
- package/dist/app-build/tool-loop.d.ts.map +1 -0
- package/dist/app-build/tool-loop.js +113 -0
- package/dist/app-build/tool-loop.js.map +1 -0
- package/dist/app-build/types.d.ts +215 -0
- package/dist/app-build/types.d.ts.map +1 -0
- package/dist/app-build/types.js +28 -0
- package/dist/app-build/types.js.map +1 -0
- package/dist/author-graph.d.ts +91 -0
- package/dist/author-graph.d.ts.map +1 -0
- package/dist/author-graph.js +319 -0
- package/dist/author-graph.js.map +1 -0
- package/dist/background-subtasks.d.ts +79 -0
- package/dist/background-subtasks.d.ts.map +1 -0
- package/dist/background-subtasks.js +139 -0
- package/dist/background-subtasks.js.map +1 -0
- package/dist/blender-gate.d.ts +21 -0
- package/dist/blender-gate.d.ts.map +1 -0
- package/dist/blender-gate.js +27 -0
- package/dist/blender-gate.js.map +1 -0
- package/dist/browser-gate.d.ts +28 -0
- package/dist/browser-gate.d.ts.map +1 -0
- package/dist/browser-gate.js +34 -0
- package/dist/browser-gate.js.map +1 -0
- package/dist/capabilities/adapters.d.ts +36 -0
- package/dist/capabilities/adapters.d.ts.map +1 -0
- package/dist/capabilities/adapters.js +44 -0
- package/dist/capabilities/adapters.js.map +1 -0
- package/dist/capabilities/agents.d.ts +78 -0
- package/dist/capabilities/agents.d.ts.map +1 -0
- package/dist/capabilities/agents.js +366 -0
- package/dist/capabilities/agents.js.map +1 -0
- package/dist/capabilities/agents.specs.d.ts +27 -0
- package/dist/capabilities/agents.specs.d.ts.map +1 -0
- package/dist/capabilities/agents.specs.js +243 -0
- package/dist/capabilities/agents.specs.js.map +1 -0
- package/dist/capabilities/analysis.d.ts +93 -0
- package/dist/capabilities/analysis.d.ts.map +1 -0
- package/dist/capabilities/analysis.js +812 -0
- package/dist/capabilities/analysis.js.map +1 -0
- package/dist/capabilities/analysis.specs.d.ts +39 -0
- package/dist/capabilities/analysis.specs.d.ts.map +1 -0
- package/dist/capabilities/analysis.specs.js +217 -0
- package/dist/capabilities/analysis.specs.js.map +1 -0
- package/dist/capabilities/apify.d.ts +34 -0
- package/dist/capabilities/apify.d.ts.map +1 -0
- package/dist/capabilities/apify.js +449 -0
- package/dist/capabilities/apify.js.map +1 -0
- package/dist/capabilities/apify.specs.d.ts +28 -0
- package/dist/capabilities/apify.specs.d.ts.map +1 -0
- package/dist/capabilities/apify.specs.js +232 -0
- package/dist/capabilities/apify.specs.js.map +1 -0
- package/dist/capabilities/apps.d.ts +40 -0
- package/dist/capabilities/apps.d.ts.map +1 -0
- package/dist/capabilities/apps.js +413 -0
- package/dist/capabilities/apps.js.map +1 -0
- package/dist/capabilities/apps.specs.d.ts +23 -0
- package/dist/capabilities/apps.specs.d.ts.map +1 -0
- package/dist/capabilities/apps.specs.js +236 -0
- package/dist/capabilities/apps.specs.js.map +1 -0
- package/dist/capabilities/args.d.ts +65 -0
- package/dist/capabilities/args.d.ts.map +1 -0
- package/dist/capabilities/args.js +218 -0
- package/dist/capabilities/args.js.map +1 -0
- package/dist/capabilities/assets.d.ts +45 -0
- package/dist/capabilities/assets.d.ts.map +1 -0
- package/dist/capabilities/assets.js +952 -0
- package/dist/capabilities/assets.js.map +1 -0
- package/dist/capabilities/assets.specs.d.ts +54 -0
- package/dist/capabilities/assets.specs.d.ts.map +1 -0
- package/dist/capabilities/assets.specs.js +291 -0
- package/dist/capabilities/assets.specs.js.map +1 -0
- package/dist/capabilities/background-generation.d.ts +14 -0
- package/dist/capabilities/background-generation.d.ts.map +1 -0
- package/dist/capabilities/background-generation.js +29 -0
- package/dist/capabilities/background-generation.js.map +1 -0
- package/dist/capabilities/browser.d.ts +30 -0
- package/dist/capabilities/browser.d.ts.map +1 -0
- package/dist/capabilities/browser.js +250 -0
- package/dist/capabilities/browser.js.map +1 -0
- package/dist/capabilities/browser.specs.d.ts +37 -0
- package/dist/capabilities/browser.specs.d.ts.map +1 -0
- package/dist/capabilities/browser.specs.js +173 -0
- package/dist/capabilities/browser.specs.js.map +1 -0
- package/dist/capabilities/code-grading.d.ts +68 -0
- package/dist/capabilities/code-grading.d.ts.map +1 -0
- package/dist/capabilities/code-grading.js +75 -0
- package/dist/capabilities/code-grading.js.map +1 -0
- package/dist/capabilities/code.d.ts +56 -0
- package/dist/capabilities/code.d.ts.map +1 -0
- package/dist/capabilities/code.js +327 -0
- package/dist/capabilities/code.js.map +1 -0
- package/dist/capabilities/code.specs.d.ts +22 -0
- package/dist/capabilities/code.specs.d.ts.map +1 -0
- package/dist/capabilities/code.specs.js +175 -0
- package/dist/capabilities/code.specs.js.map +1 -0
- package/dist/capabilities/collections.d.ts +44 -0
- package/dist/capabilities/collections.d.ts.map +1 -0
- package/dist/capabilities/collections.js +432 -0
- package/dist/capabilities/collections.js.map +1 -0
- package/dist/capabilities/collections.specs.d.ts +25 -0
- package/dist/capabilities/collections.specs.d.ts.map +1 -0
- package/dist/capabilities/collections.specs.js +299 -0
- package/dist/capabilities/collections.specs.js.map +1 -0
- package/dist/capabilities/compositions.d.ts +57 -0
- package/dist/capabilities/compositions.d.ts.map +1 -0
- package/dist/capabilities/compositions.js +384 -0
- package/dist/capabilities/compositions.js.map +1 -0
- package/dist/capabilities/compositions.specs.d.ts +22 -0
- package/dist/capabilities/compositions.specs.d.ts.map +1 -0
- package/dist/capabilities/compositions.specs.js +126 -0
- package/dist/capabilities/compositions.specs.js.map +1 -0
- package/dist/capabilities/concurrency.d.ts +12 -0
- package/dist/capabilities/concurrency.d.ts.map +1 -0
- package/dist/capabilities/concurrency.js +30 -0
- package/dist/capabilities/concurrency.js.map +1 -0
- package/dist/capabilities/costs.d.ts +20 -0
- package/dist/capabilities/costs.d.ts.map +1 -0
- package/dist/capabilities/costs.js +40 -0
- package/dist/capabilities/costs.js.map +1 -0
- package/dist/capabilities/costs.specs.d.ts +12 -0
- package/dist/capabilities/costs.specs.d.ts.map +1 -0
- package/dist/capabilities/costs.specs.js +35 -0
- package/dist/capabilities/costs.specs.js.map +1 -0
- package/dist/capabilities/dispatcher.d.ts +57 -0
- package/dist/capabilities/dispatcher.d.ts.map +1 -0
- package/dist/capabilities/dispatcher.js +117 -0
- package/dist/capabilities/dispatcher.js.map +1 -0
- package/dist/capabilities/documents.d.ts +25 -0
- package/dist/capabilities/documents.d.ts.map +1 -0
- package/dist/capabilities/documents.js +278 -0
- package/dist/capabilities/documents.js.map +1 -0
- package/dist/capabilities/documents.specs.d.ts +18 -0
- package/dist/capabilities/documents.specs.d.ts.map +1 -0
- package/dist/capabilities/documents.specs.js +201 -0
- package/dist/capabilities/documents.specs.js.map +1 -0
- package/dist/capabilities/email.d.ts +23 -0
- package/dist/capabilities/email.d.ts.map +1 -0
- package/dist/capabilities/email.js +226 -0
- package/dist/capabilities/email.js.map +1 -0
- package/dist/capabilities/email.specs.d.ts +16 -0
- package/dist/capabilities/email.specs.d.ts.map +1 -0
- package/dist/capabilities/email.specs.js +102 -0
- package/dist/capabilities/email.specs.js.map +1 -0
- package/dist/capabilities/entities.d.ts +52 -0
- package/dist/capabilities/entities.d.ts.map +1 -0
- package/dist/capabilities/entities.js +478 -0
- package/dist/capabilities/entities.js.map +1 -0
- package/dist/capabilities/entities.specs.d.ts +25 -0
- package/dist/capabilities/entities.specs.d.ts.map +1 -0
- package/dist/capabilities/entities.specs.js +247 -0
- package/dist/capabilities/entities.specs.js.map +1 -0
- package/dist/capabilities/example-timelines.d.ts +3 -0
- package/dist/capabilities/example-timelines.d.ts.map +1 -0
- package/dist/capabilities/example-timelines.js +191 -0
- package/dist/capabilities/example-timelines.js.map +1 -0
- package/dist/capabilities/example-timelines.specs.d.ts +5 -0
- package/dist/capabilities/example-timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/example-timelines.specs.js +53 -0
- package/dist/capabilities/example-timelines.specs.js.map +1 -0
- package/dist/capabilities/files.d.ts +53 -0
- package/dist/capabilities/files.d.ts.map +1 -0
- package/dist/capabilities/files.js +1172 -0
- package/dist/capabilities/files.js.map +1 -0
- package/dist/capabilities/files.specs.d.ts +28 -0
- package/dist/capabilities/files.specs.d.ts.map +1 -0
- package/dist/capabilities/files.specs.js +259 -0
- package/dist/capabilities/files.specs.js.map +1 -0
- package/dist/capabilities/flow.d.ts +93 -0
- package/dist/capabilities/flow.d.ts.map +1 -0
- package/dist/capabilities/flow.js +285 -0
- package/dist/capabilities/flow.js.map +1 -0
- package/dist/capabilities/flow.specs.d.ts +25 -0
- package/dist/capabilities/flow.specs.d.ts.map +1 -0
- package/dist/capabilities/flow.specs.js +114 -0
- package/dist/capabilities/flow.specs.js.map +1 -0
- package/dist/capabilities/game-asset-source.d.ts +31 -0
- package/dist/capabilities/game-asset-source.d.ts.map +1 -0
- package/dist/capabilities/game-asset-source.js +81 -0
- package/dist/capabilities/game-asset-source.js.map +1 -0
- package/dist/capabilities/game.d.ts +12 -0
- package/dist/capabilities/game.d.ts.map +1 -0
- package/dist/capabilities/game.js +1262 -0
- package/dist/capabilities/game.js.map +1 -0
- package/dist/capabilities/game.specs.d.ts +3 -0
- package/dist/capabilities/game.specs.d.ts.map +1 -0
- package/dist/capabilities/game.specs.js +96 -0
- package/dist/capabilities/game.specs.js.map +1 -0
- package/dist/capabilities/gate-from-context.d.ts +39 -0
- package/dist/capabilities/gate-from-context.d.ts.map +1 -0
- package/dist/capabilities/gate-from-context.js +97 -0
- package/dist/capabilities/gate-from-context.js.map +1 -0
- package/dist/capabilities/gate-tools.d.ts +18 -0
- package/dist/capabilities/gate-tools.d.ts.map +1 -0
- package/dist/capabilities/gate-tools.js +66 -0
- package/dist/capabilities/gate-tools.js.map +1 -0
- package/dist/capabilities/generations.d.ts +79 -0
- package/dist/capabilities/generations.d.ts.map +1 -0
- package/dist/capabilities/generations.js +382 -0
- package/dist/capabilities/generations.js.map +1 -0
- package/dist/capabilities/generations.specs.d.ts +62 -0
- package/dist/capabilities/generations.specs.d.ts.map +1 -0
- package/dist/capabilities/generations.specs.js +230 -0
- package/dist/capabilities/generations.specs.js.map +1 -0
- package/dist/capabilities/google.d.ts +50 -0
- package/dist/capabilities/google.d.ts.map +1 -0
- package/dist/capabilities/google.js +246 -0
- package/dist/capabilities/google.js.map +1 -0
- package/dist/capabilities/google.specs.d.ts +52 -0
- package/dist/capabilities/google.specs.d.ts.map +1 -0
- package/dist/capabilities/google.specs.js +391 -0
- package/dist/capabilities/google.specs.js.map +1 -0
- package/dist/capabilities/html-text.d.ts +28 -0
- package/dist/capabilities/html-text.d.ts.map +1 -0
- package/dist/capabilities/html-text.js +76 -0
- package/dist/capabilities/html-text.js.map +1 -0
- package/dist/capabilities/index.d.ts +19 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +14 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/invoke.d.ts +89 -0
- package/dist/capabilities/invoke.d.ts.map +1 -0
- package/dist/capabilities/invoke.js +214 -0
- package/dist/capabilities/invoke.js.map +1 -0
- package/dist/capabilities/jobs.d.ts +32 -0
- package/dist/capabilities/jobs.d.ts.map +1 -0
- package/dist/capabilities/jobs.js +123 -0
- package/dist/capabilities/jobs.js.map +1 -0
- package/dist/capabilities/jobs.specs.d.ts +20 -0
- package/dist/capabilities/jobs.specs.d.ts.map +1 -0
- package/dist/capabilities/jobs.specs.js +103 -0
- package/dist/capabilities/jobs.specs.js.map +1 -0
- package/dist/capabilities/js-scripts.d.ts +90 -0
- package/dist/capabilities/js-scripts.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.js +700 -0
- package/dist/capabilities/js-scripts.js.map +1 -0
- package/dist/capabilities/js-scripts.specs.d.ts +50 -0
- package/dist/capabilities/js-scripts.specs.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.specs.js +344 -0
- package/dist/capabilities/js-scripts.specs.js.map +1 -0
- package/dist/capabilities/lazy-tool.d.ts +42 -0
- package/dist/capabilities/lazy-tool.d.ts.map +1 -0
- package/dist/capabilities/lazy-tool.js +88 -0
- package/dist/capabilities/lazy-tool.js.map +1 -0
- package/dist/capabilities/local-browser.d.ts +24 -0
- package/dist/capabilities/local-browser.d.ts.map +1 -0
- package/dist/capabilities/local-browser.js +105 -0
- package/dist/capabilities/local-browser.js.map +1 -0
- package/dist/capabilities/media.d.ts +121 -0
- package/dist/capabilities/media.d.ts.map +1 -0
- package/dist/capabilities/media.js +2217 -0
- package/dist/capabilities/media.js.map +1 -0
- package/dist/capabilities/media.specs.d.ts +65 -0
- package/dist/capabilities/media.specs.d.ts.map +1 -0
- package/dist/capabilities/media.specs.js +779 -0
- package/dist/capabilities/media.specs.js.map +1 -0
- package/dist/capabilities/memory.d.ts +31 -0
- package/dist/capabilities/memory.d.ts.map +1 -0
- package/dist/capabilities/memory.js +403 -0
- package/dist/capabilities/memory.js.map +1 -0
- package/dist/capabilities/memory.specs.d.ts +55 -0
- package/dist/capabilities/memory.specs.d.ts.map +1 -0
- package/dist/capabilities/memory.specs.js +208 -0
- package/dist/capabilities/memory.specs.js.map +1 -0
- package/dist/capabilities/model3d.d.ts +29 -0
- package/dist/capabilities/model3d.d.ts.map +1 -0
- package/dist/capabilities/model3d.js +482 -0
- package/dist/capabilities/model3d.js.map +1 -0
- package/dist/capabilities/model3d.specs.d.ts +28 -0
- package/dist/capabilities/model3d.specs.d.ts.map +1 -0
- package/dist/capabilities/model3d.specs.js +305 -0
- package/dist/capabilities/model3d.specs.js.map +1 -0
- package/dist/capabilities/models.d.ts +138 -0
- package/dist/capabilities/models.d.ts.map +1 -0
- package/dist/capabilities/models.js +803 -0
- package/dist/capabilities/models.js.map +1 -0
- package/dist/capabilities/models.specs.d.ts +21 -0
- package/dist/capabilities/models.specs.d.ts.map +1 -0
- package/dist/capabilities/models.specs.js +141 -0
- package/dist/capabilities/models.specs.js.map +1 -0
- package/dist/capabilities/nodes.d.ts +26 -0
- package/dist/capabilities/nodes.d.ts.map +1 -0
- package/dist/capabilities/nodes.js +266 -0
- package/dist/capabilities/nodes.js.map +1 -0
- package/dist/capabilities/nodes.specs.d.ts +20 -0
- package/dist/capabilities/nodes.specs.d.ts.map +1 -0
- package/dist/capabilities/nodes.specs.js +106 -0
- package/dist/capabilities/nodes.specs.js.map +1 -0
- package/dist/capabilities/packs.d.ts +69 -0
- package/dist/capabilities/packs.d.ts.map +1 -0
- package/dist/capabilities/packs.js +246 -0
- package/dist/capabilities/packs.js.map +1 -0
- package/dist/capabilities/packs.specs.d.ts +27 -0
- package/dist/capabilities/packs.specs.d.ts.map +1 -0
- package/dist/capabilities/packs.specs.js +64 -0
- package/dist/capabilities/packs.specs.js.map +1 -0
- package/dist/capabilities/project-scope.d.ts +12 -0
- package/dist/capabilities/project-scope.d.ts.map +1 -0
- package/dist/capabilities/project-scope.js +19 -0
- package/dist/capabilities/project-scope.js.map +1 -0
- package/dist/capabilities/projects.d.ts +23 -0
- package/dist/capabilities/projects.d.ts.map +1 -0
- package/dist/capabilities/projects.js +206 -0
- package/dist/capabilities/projects.js.map +1 -0
- package/dist/capabilities/projects.specs.d.ts +23 -0
- package/dist/capabilities/projects.specs.d.ts.map +1 -0
- package/dist/capabilities/projects.specs.js +118 -0
- package/dist/capabilities/projects.specs.js.map +1 -0
- package/dist/capabilities/registry.d.ts +109 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +445 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/capabilities/script-link.d.ts +22 -0
- package/dist/capabilities/script-link.d.ts.map +1 -0
- package/dist/capabilities/script-link.js +35 -0
- package/dist/capabilities/script-link.js.map +1 -0
- package/dist/capabilities/scripts.d.ts +43 -0
- package/dist/capabilities/scripts.d.ts.map +1 -0
- package/dist/capabilities/scripts.js +1789 -0
- package/dist/capabilities/scripts.js.map +1 -0
- package/dist/capabilities/scripts.specs.d.ts +40 -0
- package/dist/capabilities/scripts.specs.d.ts.map +1 -0
- package/dist/capabilities/scripts.specs.js +319 -0
- package/dist/capabilities/scripts.specs.js.map +1 -0
- package/dist/capabilities/serpapi.d.ts +42 -0
- package/dist/capabilities/serpapi.d.ts.map +1 -0
- package/dist/capabilities/serpapi.js +262 -0
- package/dist/capabilities/serpapi.js.map +1 -0
- package/dist/capabilities/serpapi.specs.d.ts +24 -0
- package/dist/capabilities/serpapi.specs.d.ts.map +1 -0
- package/dist/capabilities/serpapi.specs.js +174 -0
- package/dist/capabilities/serpapi.specs.js.map +1 -0
- package/dist/capabilities/settings.d.ts +48 -0
- package/dist/capabilities/settings.d.ts.map +1 -0
- package/dist/capabilities/settings.js +226 -0
- package/dist/capabilities/settings.js.map +1 -0
- package/dist/capabilities/settings.specs.d.ts +42 -0
- package/dist/capabilities/settings.specs.d.ts.map +1 -0
- package/dist/capabilities/settings.specs.js +126 -0
- package/dist/capabilities/settings.specs.js.map +1 -0
- package/dist/capabilities/shared.d.ts +35 -0
- package/dist/capabilities/shared.d.ts.map +1 -0
- package/dist/capabilities/shared.js +165 -0
- package/dist/capabilities/shared.js.map +1 -0
- package/dist/capabilities/shared.specs.d.ts +19 -0
- package/dist/capabilities/shared.specs.d.ts.map +1 -0
- package/dist/capabilities/shared.specs.js +134 -0
- package/dist/capabilities/shared.specs.js.map +1 -0
- package/dist/capabilities/sketches.d.ts +52 -0
- package/dist/capabilities/sketches.d.ts.map +1 -0
- package/dist/capabilities/sketches.js +1163 -0
- package/dist/capabilities/sketches.js.map +1 -0
- package/dist/capabilities/sketches.specs.d.ts +44 -0
- package/dist/capabilities/sketches.specs.d.ts.map +1 -0
- package/dist/capabilities/sketches.specs.js +392 -0
- package/dist/capabilities/sketches.specs.js.map +1 -0
- package/dist/capabilities/skills.d.ts +28 -0
- package/dist/capabilities/skills.d.ts.map +1 -0
- package/dist/capabilities/skills.js +269 -0
- package/dist/capabilities/skills.js.map +1 -0
- package/dist/capabilities/skills.specs.d.ts +17 -0
- package/dist/capabilities/skills.specs.d.ts.map +1 -0
- package/dist/capabilities/skills.specs.js +108 -0
- package/dist/capabilities/skills.specs.js.map +1 -0
- package/dist/capabilities/storyboards.d.ts +68 -0
- package/dist/capabilities/storyboards.d.ts.map +1 -0
- package/dist/capabilities/storyboards.js +2246 -0
- package/dist/capabilities/storyboards.js.map +1 -0
- package/dist/capabilities/storyboards.specs.d.ts +42 -0
- package/dist/capabilities/storyboards.specs.d.ts.map +1 -0
- package/dist/capabilities/storyboards.specs.js +418 -0
- package/dist/capabilities/storyboards.specs.js.map +1 -0
- package/dist/capabilities/threads.d.ts +25 -0
- package/dist/capabilities/threads.d.ts.map +1 -0
- package/dist/capabilities/threads.js +240 -0
- package/dist/capabilities/threads.js.map +1 -0
- package/dist/capabilities/threads.specs.d.ts +26 -0
- package/dist/capabilities/threads.specs.d.ts.map +1 -0
- package/dist/capabilities/threads.specs.js +108 -0
- package/dist/capabilities/threads.specs.js.map +1 -0
- package/dist/capabilities/timeline-audio-bake.d.ts +114 -0
- package/dist/capabilities/timeline-audio-bake.d.ts.map +1 -0
- package/dist/capabilities/timeline-audio-bake.js +188 -0
- package/dist/capabilities/timeline-audio-bake.js.map +1 -0
- package/dist/capabilities/timeline-bake.d.ts +21 -0
- package/dist/capabilities/timeline-bake.d.ts.map +1 -0
- package/dist/capabilities/timeline-bake.js +118 -0
- package/dist/capabilities/timeline-bake.js.map +1 -0
- package/dist/capabilities/timeline-isolate-subject.d.ts +157 -0
- package/dist/capabilities/timeline-isolate-subject.d.ts.map +1 -0
- package/dist/capabilities/timeline-isolate-subject.js +293 -0
- package/dist/capabilities/timeline-isolate-subject.js.map +1 -0
- package/dist/capabilities/timeline-native-media.d.ts +4 -0
- package/dist/capabilities/timeline-native-media.d.ts.map +1 -0
- package/dist/capabilities/timeline-native-media.js +920 -0
- package/dist/capabilities/timeline-native-media.js.map +1 -0
- package/dist/capabilities/timeline-track-object.d.ts +83 -0
- package/dist/capabilities/timeline-track-object.d.ts.map +1 -0
- package/dist/capabilities/timeline-track-object.js +195 -0
- package/dist/capabilities/timeline-track-object.js.map +1 -0
- package/dist/capabilities/timelines.d.ts +190 -0
- package/dist/capabilities/timelines.d.ts.map +1 -0
- package/dist/capabilities/timelines.js +2326 -0
- package/dist/capabilities/timelines.js.map +1 -0
- package/dist/capabilities/timelines.specs.d.ts +134 -0
- package/dist/capabilities/timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/timelines.specs.js +1362 -0
- package/dist/capabilities/timelines.specs.js.map +1 -0
- package/dist/capabilities/types.d.ts +197 -0
- package/dist/capabilities/types.d.ts.map +1 -0
- package/dist/capabilities/types.js +19 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/capabilities/ui.d.ts +38 -0
- package/dist/capabilities/ui.d.ts.map +1 -0
- package/dist/capabilities/ui.js +128 -0
- package/dist/capabilities/ui.js.map +1 -0
- package/dist/capabilities/ui.specs.d.ts +22 -0
- package/dist/capabilities/ui.specs.d.ts.map +1 -0
- package/dist/capabilities/ui.specs.js +59 -0
- package/dist/capabilities/ui.specs.js.map +1 -0
- package/dist/capabilities/video-production-acceptance.d.ts +27 -0
- package/dist/capabilities/video-production-acceptance.d.ts.map +1 -0
- package/dist/capabilities/video-production-acceptance.js +41 -0
- package/dist/capabilities/video-production-acceptance.js.map +1 -0
- package/dist/capabilities/video-production.d.ts +179 -0
- package/dist/capabilities/video-production.d.ts.map +1 -0
- package/dist/capabilities/video-production.js +1492 -0
- package/dist/capabilities/video-production.js.map +1 -0
- package/dist/capabilities/video-production.specs.d.ts +13 -0
- package/dist/capabilities/video-production.specs.d.ts.map +1 -0
- package/dist/capabilities/video-production.specs.js +256 -0
- package/dist/capabilities/video-production.specs.js.map +1 -0
- package/dist/capabilities/web.d.ts +86 -0
- package/dist/capabilities/web.d.ts.map +1 -0
- package/dist/capabilities/web.js +850 -0
- package/dist/capabilities/web.js.map +1 -0
- package/dist/capabilities/web.specs.d.ts +33 -0
- package/dist/capabilities/web.specs.d.ts.map +1 -0
- package/dist/capabilities/web.specs.js +286 -0
- package/dist/capabilities/web.specs.js.map +1 -0
- package/dist/capabilities/workflows.d.ts +58 -0
- package/dist/capabilities/workflows.d.ts.map +1 -0
- package/dist/capabilities/workflows.js +1530 -0
- package/dist/capabilities/workflows.js.map +1 -0
- package/dist/capabilities/workflows.specs.d.ts +63 -0
- package/dist/capabilities/workflows.specs.d.ts.map +1 -0
- package/dist/capabilities/workflows.specs.js +852 -0
- package/dist/capabilities/workflows.specs.js.map +1 -0
- package/dist/code-gen/analyze.d.ts +26 -0
- package/dist/code-gen/analyze.d.ts.map +1 -0
- package/dist/code-gen/analyze.js +79 -0
- package/dist/code-gen/analyze.js.map +1 -0
- package/dist/code-gen/port-types.d.ts +58 -0
- package/dist/code-gen/port-types.d.ts.map +1 -0
- package/dist/code-gen/port-types.js +115 -0
- package/dist/code-gen/port-types.js.map +1 -0
- package/dist/code-gen/prompt.d.ts +37 -0
- package/dist/code-gen/prompt.d.ts.map +1 -0
- package/dist/code-gen/prompt.js +129 -0
- package/dist/code-gen/prompt.js.map +1 -0
- package/dist/code-gen/sandbox-manifest.d.ts +120 -0
- package/dist/code-gen/sandbox-manifest.d.ts.map +1 -0
- package/dist/code-gen/sandbox-manifest.js +1023 -0
- package/dist/code-gen/sandbox-manifest.js.map +1 -0
- package/dist/code-gen/sandbox-prompt.d.ts +26 -0
- package/dist/code-gen/sandbox-prompt.d.ts.map +1 -0
- package/dist/code-gen/sandbox-prompt.js +126 -0
- package/dist/code-gen/sandbox-prompt.js.map +1 -0
- package/dist/code-planner.d.ts +72 -0
- package/dist/code-planner.d.ts.map +1 -0
- package/dist/code-planner.js +271 -0
- package/dist/code-planner.js.map +1 -0
- package/dist/codeact/action-diagnostics.d.ts +35 -0
- package/dist/codeact/action-diagnostics.d.ts.map +1 -0
- package/dist/codeact/action-diagnostics.js +147 -0
- package/dist/codeact/action-diagnostics.js.map +1 -0
- package/dist/codeact/capability-modules.d.ts +66 -0
- package/dist/codeact/capability-modules.d.ts.map +1 -0
- package/dist/codeact/capability-modules.js +278 -0
- package/dist/codeact/capability-modules.js.map +1 -0
- package/dist/codeact/chat-codeact.d.ts +104 -0
- package/dist/codeact/chat-codeact.d.ts.map +1 -0
- package/dist/codeact/chat-codeact.js +424 -0
- package/dist/codeact/chat-codeact.js.map +1 -0
- package/dist/codeact/codeact-executor.d.ts +247 -0
- package/dist/codeact/codeact-executor.d.ts.map +1 -0
- package/dist/codeact/codeact-executor.js +1176 -0
- package/dist/codeact/codeact-executor.js.map +1 -0
- package/dist/codeact/compact-ids.d.ts +28 -0
- package/dist/codeact/compact-ids.d.ts.map +1 -0
- package/dist/codeact/compact-ids.js +77 -0
- package/dist/codeact/compact-ids.js.map +1 -0
- package/dist/codeact/execute-code-contract.d.ts +97 -0
- package/dist/codeact/execute-code-contract.d.ts.map +1 -0
- package/dist/codeact/execute-code-contract.js +225 -0
- package/dist/codeact/execute-code-contract.js.map +1 -0
- package/dist/codeact/fabric-package.d.ts +29 -0
- package/dist/codeact/fabric-package.d.ts.map +1 -0
- package/dist/codeact/fabric-package.js +62 -0
- package/dist/codeact/fabric-package.js.map +1 -0
- package/dist/codeact/flow-package.d.ts +31 -0
- package/dist/codeact/flow-package.d.ts.map +1 -0
- package/dist/codeact/flow-package.js +80 -0
- package/dist/codeact/flow-package.js.map +1 -0
- package/dist/codeact/graph-dsl-package.d.ts +42 -0
- package/dist/codeact/graph-dsl-package.d.ts.map +1 -0
- package/dist/codeact/graph-dsl-package.js +100 -0
- package/dist/codeact/graph-dsl-package.js.map +1 -0
- package/dist/codeact/graph-model.d.ts +30 -0
- package/dist/codeact/graph-model.d.ts.map +1 -0
- package/dist/codeact/graph-model.js +408 -0
- package/dist/codeact/graph-model.js.map +1 -0
- package/dist/codeact/mcp-guest-contract.d.ts +66 -0
- package/dist/codeact/mcp-guest-contract.d.ts.map +1 -0
- package/dist/codeact/mcp-guest-contract.js +108 -0
- package/dist/codeact/mcp-guest-contract.js.map +1 -0
- package/dist/codeact/nodetool-api.d.ts +60 -0
- package/dist/codeact/nodetool-api.d.ts.map +1 -0
- package/dist/codeact/nodetool-api.js +2056 -0
- package/dist/codeact/nodetool-api.js.map +1 -0
- package/dist/codeact/prompt.d.ts +88 -0
- package/dist/codeact/prompt.d.ts.map +1 -0
- package/dist/codeact/prompt.js +326 -0
- package/dist/codeact/prompt.js.map +1 -0
- package/dist/codeact/sandbox-package-docs.d.ts +48 -0
- package/dist/codeact/sandbox-package-docs.d.ts.map +1 -0
- package/dist/codeact/sandbox-package-docs.js +55 -0
- package/dist/codeact/sandbox-package-docs.js.map +1 -0
- package/dist/codeact/sandbox-package-listing.d.ts +81 -0
- package/dist/codeact/sandbox-package-listing.d.ts.map +1 -0
- package/dist/codeact/sandbox-package-listing.js +101 -0
- package/dist/codeact/sandbox-package-listing.js.map +1 -0
- package/dist/codeact/sandbox-packages.d.ts +72 -0
- package/dist/codeact/sandbox-packages.d.ts.map +1 -0
- package/dist/codeact/sandbox-packages.js +230 -0
- package/dist/codeact/sandbox-packages.js.map +1 -0
- package/dist/codeact/timeline-package.d.ts +5 -0
- package/dist/codeact/timeline-package.d.ts.map +1 -0
- package/dist/codeact/timeline-package.js +10 -0
- package/dist/codeact/timeline-package.js.map +1 -0
- package/dist/codeact/tool-api.d.ts +197 -0
- package/dist/codeact/tool-api.d.ts.map +1 -0
- package/dist/codeact/tool-api.js +445 -0
- package/dist/codeact/tool-api.js.map +1 -0
- package/dist/codeact/tools-prelude.d.ts +32 -0
- package/dist/codeact/tools-prelude.d.ts.map +1 -0
- package/dist/codeact/tools-prelude.js +65 -0
- package/dist/codeact/tools-prelude.js.map +1 -0
- package/dist/constants.d.ts +47 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +64 -2
- package/dist/constants.js.map +1 -1
- package/dist/custom-animation-bake.d.ts +57 -0
- package/dist/custom-animation-bake.d.ts.map +1 -0
- package/dist/custom-animation-bake.js +88 -0
- package/dist/custom-animation-bake.js.map +1 -0
- package/dist/dynamic-slots.d.ts +72 -0
- package/dist/dynamic-slots.d.ts.map +1 -0
- package/dist/dynamic-slots.js +0 -0
- package/dist/dynamic-slots.js.map +1 -0
- package/dist/evals/app-build-cases.d.ts +35 -0
- package/dist/evals/app-build-cases.d.ts.map +1 -0
- package/dist/evals/app-build-cases.js +722 -0
- package/dist/evals/app-build-cases.js.map +1 -0
- package/dist/evals/app-build-eval.d.ts +208 -0
- package/dist/evals/app-build-eval.d.ts.map +1 -0
- package/dist/evals/app-build-eval.js +518 -0
- package/dist/evals/app-build-eval.js.map +1 -0
- package/dist/evals/app-build-plan.d.ts +76 -0
- package/dist/evals/app-build-plan.d.ts.map +1 -0
- package/dist/evals/app-build-plan.js +140 -0
- package/dist/evals/app-build-plan.js.map +1 -0
- package/dist/evals/code-gen-cases.d.ts +13 -0
- package/dist/evals/code-gen-cases.d.ts.map +1 -0
- package/dist/evals/code-gen-cases.js +124 -0
- package/dist/evals/code-gen-cases.js.map +1 -0
- package/dist/evals/code-gen-eval.d.ts +109 -0
- package/dist/evals/code-gen-eval.d.ts.map +1 -0
- package/dist/evals/code-gen-eval.js +299 -0
- package/dist/evals/code-gen-eval.js.map +1 -0
- package/dist/evals/codeact-api-cases.d.ts +14 -0
- package/dist/evals/codeact-api-cases.d.ts.map +1 -0
- package/dist/evals/codeact-api-cases.js +29 -0
- package/dist/evals/codeact-api-cases.js.map +1 -0
- package/dist/evals/codeact-api-core.d.ts +23 -0
- package/dist/evals/codeact-api-core.d.ts.map +1 -0
- package/dist/evals/codeact-api-core.js +1411 -0
- package/dist/evals/codeact-api-core.js.map +1 -0
- package/dist/evals/codeact-api-surfaces.d.ts +25 -0
- package/dist/evals/codeact-api-surfaces.d.ts.map +1 -0
- package/dist/evals/codeact-api-surfaces.js +2191 -0
- package/dist/evals/codeact-api-surfaces.js.map +1 -0
- package/dist/evals/codeact-cases.d.ts +76 -0
- package/dist/evals/codeact-cases.d.ts.map +1 -0
- package/dist/evals/codeact-cases.js +151 -0
- package/dist/evals/codeact-cases.js.map +1 -0
- package/dist/evals/codeact-eval.d.ts +66 -0
- package/dist/evals/codeact-eval.d.ts.map +1 -0
- package/dist/evals/codeact-eval.js +250 -0
- package/dist/evals/codeact-eval.js.map +1 -0
- package/dist/evals/codeact-sandbox-pack-cases.d.ts +31 -0
- package/dist/evals/codeact-sandbox-pack-cases.d.ts.map +1 -0
- package/dist/evals/codeact-sandbox-pack-cases.js +219 -0
- package/dist/evals/codeact-sandbox-pack-cases.js.map +1 -0
- package/dist/evals/escalation-cases.d.ts +22 -0
- package/dist/evals/escalation-cases.d.ts.map +1 -0
- package/dist/evals/escalation-cases.js +343 -0
- package/dist/evals/escalation-cases.js.map +1 -0
- package/dist/evals/escalation.d.ts +92 -0
- package/dist/evals/escalation.d.ts.map +1 -0
- package/dist/evals/escalation.js +152 -0
- package/dist/evals/escalation.js.map +1 -0
- package/dist/evals/goal-judge.d.ts +51 -0
- package/dist/evals/goal-judge.d.ts.map +1 -0
- package/dist/evals/goal-judge.js +152 -0
- package/dist/evals/goal-judge.js.map +1 -0
- package/dist/evals/graph-e2e-cases.d.ts +21 -0
- package/dist/evals/graph-e2e-cases.d.ts.map +1 -0
- package/dist/evals/graph-e2e-cases.js +262 -0
- package/dist/evals/graph-e2e-cases.js.map +1 -0
- package/dist/evals/graph-e2e-eval.d.ts +202 -0
- package/dist/evals/graph-e2e-eval.d.ts.map +1 -0
- package/dist/evals/graph-e2e-eval.js +438 -0
- package/dist/evals/graph-e2e-eval.js.map +1 -0
- package/dist/evals/graph-planner-cases.d.ts +12 -0
- package/dist/evals/graph-planner-cases.d.ts.map +1 -0
- package/dist/evals/graph-planner-cases.js +256 -0
- package/dist/evals/graph-planner-cases.js.map +1 -0
- package/dist/evals/graph-planner-eval.d.ts +178 -0
- package/dist/evals/graph-planner-eval.d.ts.map +1 -0
- package/dist/evals/graph-planner-eval.js +495 -0
- package/dist/evals/graph-planner-eval.js.map +1 -0
- package/dist/evals/planner-tools.d.ts +21 -0
- package/dist/evals/planner-tools.d.ts.map +1 -0
- package/dist/evals/planner-tools.js +66 -0
- package/dist/evals/planner-tools.js.map +1 -0
- package/dist/evals/subtask-cases.d.ts +88 -0
- package/dist/evals/subtask-cases.d.ts.map +1 -0
- package/dist/evals/subtask-cases.js +322 -0
- package/dist/evals/subtask-cases.js.map +1 -0
- package/dist/evals/subtask-eval.d.ts +129 -0
- package/dist/evals/subtask-eval.d.ts.map +1 -0
- package/dist/evals/subtask-eval.js +397 -0
- package/dist/evals/subtask-eval.js.map +1 -0
- package/dist/evals/surfaces/app.d.ts +19 -0
- package/dist/evals/surfaces/app.d.ts.map +1 -0
- package/dist/evals/surfaces/app.js +341 -0
- package/dist/evals/surfaces/app.js.map +1 -0
- package/dist/evals/surfaces/creative-pipeline.d.ts +203 -0
- package/dist/evals/surfaces/creative-pipeline.d.ts.map +1 -0
- package/dist/evals/surfaces/creative-pipeline.js +909 -0
- package/dist/evals/surfaces/creative-pipeline.js.map +1 -0
- package/dist/evals/surfaces/game.d.ts +5 -0
- package/dist/evals/surfaces/game.d.ts.map +1 -0
- package/dist/evals/surfaces/game.js +42 -0
- package/dist/evals/surfaces/game.js.map +1 -0
- package/dist/evals/surfaces/js-script.d.ts +66 -0
- package/dist/evals/surfaces/js-script.d.ts.map +1 -0
- package/dist/evals/surfaces/js-script.js +407 -0
- package/dist/evals/surfaces/js-script.js.map +1 -0
- package/dist/evals/surfaces/memory.d.ts +34 -0
- package/dist/evals/surfaces/memory.d.ts.map +1 -0
- package/dist/evals/surfaces/memory.js +264 -0
- package/dist/evals/surfaces/memory.js.map +1 -0
- package/dist/evals/surfaces/model3d.d.ts +45 -0
- package/dist/evals/surfaces/model3d.d.ts.map +1 -0
- package/dist/evals/surfaces/model3d.js +346 -0
- package/dist/evals/surfaces/model3d.js.map +1 -0
- package/dist/evals/surfaces/script.d.ts +96 -0
- package/dist/evals/surfaces/script.d.ts.map +1 -0
- package/dist/evals/surfaces/script.js +709 -0
- package/dist/evals/surfaces/script.js.map +1 -0
- package/dist/evals/surfaces/sketch.d.ts +124 -0
- package/dist/evals/surfaces/sketch.d.ts.map +1 -0
- package/dist/evals/surfaces/sketch.js +1298 -0
- package/dist/evals/surfaces/sketch.js.map +1 -0
- package/dist/evals/surfaces/storyboard.d.ts +97 -0
- package/dist/evals/surfaces/storyboard.d.ts.map +1 -0
- package/dist/evals/surfaces/storyboard.js +693 -0
- package/dist/evals/surfaces/storyboard.js.map +1 -0
- package/dist/evals/surfaces/timeline.d.ts +416 -0
- package/dist/evals/surfaces/timeline.d.ts.map +1 -0
- package/dist/evals/surfaces/timeline.js +3267 -0
- package/dist/evals/surfaces/timeline.js.map +1 -0
- package/dist/evals/task-planner-cases.d.ts +57 -0
- package/dist/evals/task-planner-cases.d.ts.map +1 -0
- package/dist/evals/task-planner-cases.js +117 -0
- package/dist/evals/task-planner-cases.js.map +1 -0
- package/dist/evals/task-planner-eval.d.ts +101 -0
- package/dist/evals/task-planner-eval.d.ts.map +1 -0
- package/dist/evals/task-planner-eval.js +380 -0
- package/dist/evals/task-planner-eval.js.map +1 -0
- package/dist/evals/tool-loop-bridge.d.ts +57 -0
- package/dist/evals/tool-loop-bridge.d.ts.map +1 -0
- package/dist/evals/tool-loop-bridge.js +129 -0
- package/dist/evals/tool-loop-bridge.js.map +1 -0
- package/dist/evals/tool-loop-cases.d.ts +21 -0
- package/dist/evals/tool-loop-cases.d.ts.map +1 -0
- package/dist/evals/tool-loop-cases.js +401 -0
- package/dist/evals/tool-loop-cases.js.map +1 -0
- package/dist/evals/tool-loop-eval.d.ts +234 -0
- package/dist/evals/tool-loop-eval.d.ts.map +1 -0
- package/dist/evals/tool-loop-eval.js +373 -0
- package/dist/evals/tool-loop-eval.js.map +1 -0
- package/dist/evals/tool-loop-permission.d.ts +43 -0
- package/dist/evals/tool-loop-permission.d.ts.map +1 -0
- package/dist/evals/tool-loop-permission.js +76 -0
- package/dist/evals/tool-loop-permission.js.map +1 -0
- package/dist/game-examples.d.ts +447 -0
- package/dist/game-examples.d.ts.map +1 -0
- package/dist/game-examples.js +187 -0
- package/dist/game-examples.js.map +1 -0
- package/dist/graph-builder.d.ts +55 -3
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +159 -4
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-dsl-core.d.ts +25 -0
- package/dist/graph-dsl-core.d.ts.map +1 -0
- package/dist/graph-dsl-core.js +312 -0
- package/dist/graph-dsl-core.js.map +1 -0
- package/dist/graph-dsl.d.ts +30 -0
- package/dist/graph-dsl.d.ts.map +1 -0
- package/dist/graph-dsl.js +116 -0
- package/dist/graph-dsl.js.map +1 -0
- package/dist/host-binaries.d.ts +6 -0
- package/dist/host-binaries.d.ts.map +1 -0
- package/dist/host-binaries.js +6 -0
- package/dist/host-binaries.js.map +1 -0
- package/dist/host-binary-guard.d.ts +100 -0
- package/dist/host-binary-guard.d.ts.map +1 -0
- package/dist/host-binary-guard.js +205 -0
- package/dist/host-binary-guard.js.map +1 -0
- package/dist/host-modules/aws.d.ts +57 -0
- package/dist/host-modules/aws.d.ts.map +1 -0
- package/dist/host-modules/aws.js +309 -0
- package/dist/host-modules/aws.js.map +1 -0
- package/dist/host-modules/chrono.d.ts +15 -0
- package/dist/host-modules/chrono.d.ts.map +1 -0
- package/dist/host-modules/chrono.js +35 -0
- package/dist/host-modules/chrono.js.map +1 -0
- package/dist/host-modules/csv.d.ts +17 -0
- package/dist/host-modules/csv.d.ts.map +1 -0
- package/dist/host-modules/csv.js +64 -0
- package/dist/host-modules/csv.js.map +1 -0
- package/dist/host-modules/diff.d.ts +9 -0
- package/dist/host-modules/diff.d.ts.map +1 -0
- package/dist/host-modules/diff.js +26 -0
- package/dist/host-modules/diff.js.map +1 -0
- package/dist/host-modules/dispatcher.d.ts +41 -0
- package/dist/host-modules/dispatcher.d.ts.map +1 -0
- package/dist/host-modules/dispatcher.js +99 -0
- package/dist/host-modules/dispatcher.js.map +1 -0
- package/dist/host-modules/docx.d.ts +19 -0
- package/dist/host-modules/docx.d.ts.map +1 -0
- package/dist/host-modules/docx.js +120 -0
- package/dist/host-modules/docx.js.map +1 -0
- package/dist/host-modules/epub.d.ts +48 -0
- package/dist/host-modules/epub.d.ts.map +1 -0
- package/dist/host-modules/epub.js +100 -0
- package/dist/host-modules/epub.js.map +1 -0
- package/dist/host-modules/exif.d.ts +8 -0
- package/dist/host-modules/exif.d.ts.map +1 -0
- package/dist/host-modules/exif.js +19 -0
- package/dist/host-modules/exif.js.map +1 -0
- package/dist/host-modules/expr.d.ts +16 -0
- package/dist/host-modules/expr.d.ts.map +1 -0
- package/dist/host-modules/expr.js +18 -0
- package/dist/host-modules/expr.js.map +1 -0
- package/dist/host-modules/fabric.d.ts +46 -0
- package/dist/host-modules/fabric.d.ts.map +1 -0
- package/dist/host-modules/fabric.js +178 -0
- package/dist/host-modules/fabric.js.map +1 -0
- package/dist/host-modules/html.d.ts +51 -0
- package/dist/host-modules/html.d.ts.map +1 -0
- package/dist/host-modules/html.js +198 -0
- package/dist/host-modules/html.js.map +1 -0
- package/dist/host-modules/ics.d.ts +9 -0
- package/dist/host-modules/ics.d.ts.map +1 -0
- package/dist/host-modules/ics.js +35 -0
- package/dist/host-modules/ics.js.map +1 -0
- package/dist/host-modules/limits.d.ts +41 -0
- package/dist/host-modules/limits.d.ts.map +1 -0
- package/dist/host-modules/limits.js +76 -0
- package/dist/host-modules/limits.js.map +1 -0
- package/dist/host-modules/mammoth.d.ts +11 -0
- package/dist/host-modules/mammoth.d.ts.map +1 -0
- package/dist/host-modules/mammoth.js +29 -0
- package/dist/host-modules/mammoth.js.map +1 -0
- package/dist/host-modules/notion.d.ts +45 -0
- package/dist/host-modules/notion.d.ts.map +1 -0
- package/dist/host-modules/notion.js +128 -0
- package/dist/host-modules/notion.js.map +1 -0
- package/dist/host-modules/ocr.d.ts +25 -0
- package/dist/host-modules/ocr.d.ts.map +1 -0
- package/dist/host-modules/ocr.js +74 -0
- package/dist/host-modules/ocr.js.map +1 -0
- package/dist/host-modules/pdf.d.ts +21 -0
- package/dist/host-modules/pdf.d.ts.map +1 -0
- package/dist/host-modules/pdf.js +53 -0
- package/dist/host-modules/pdf.js.map +1 -0
- package/dist/host-modules/pdflib.d.ts +17 -0
- package/dist/host-modules/pdflib.d.ts.map +1 -0
- package/dist/host-modules/pdflib.js +138 -0
- package/dist/host-modules/pdflib.js.map +1 -0
- package/dist/host-modules/pptx.d.ts +19 -0
- package/dist/host-modules/pptx.d.ts.map +1 -0
- package/dist/host-modules/pptx.js +67 -0
- package/dist/host-modules/pptx.js.map +1 -0
- package/dist/host-modules/pptxgen.d.ts +13 -0
- package/dist/host-modules/pptxgen.d.ts.map +1 -0
- package/dist/host-modules/pptxgen.js +98 -0
- package/dist/host-modules/pptxgen.js.map +1 -0
- package/dist/host-modules/prepared-request.d.ts +41 -0
- package/dist/host-modules/prepared-request.d.ts.map +1 -0
- package/dist/host-modules/prepared-request.js +104 -0
- package/dist/host-modules/prepared-request.js.map +1 -0
- package/dist/host-modules/registry.d.ts +31 -0
- package/dist/host-modules/registry.d.ts.map +1 -0
- package/dist/host-modules/registry.js +193 -0
- package/dist/host-modules/registry.js.map +1 -0
- package/dist/host-modules/subtitle.d.ts +15 -0
- package/dist/host-modules/subtitle.d.ts.map +1 -0
- package/dist/host-modules/subtitle.js +45 -0
- package/dist/host-modules/subtitle.js.map +1 -0
- package/dist/host-modules/supabase.d.ts +42 -0
- package/dist/host-modules/supabase.d.ts.map +1 -0
- package/dist/host-modules/supabase.js +141 -0
- package/dist/host-modules/supabase.js.map +1 -0
- package/dist/host-modules/tfjs.d.ts +42 -0
- package/dist/host-modules/tfjs.d.ts.map +1 -0
- package/dist/host-modules/tfjs.js +186 -0
- package/dist/host-modules/tfjs.js.map +1 -0
- package/dist/host-modules/tokens.d.ts +17 -0
- package/dist/host-modules/tokens.d.ts.map +1 -0
- package/dist/host-modules/tokens.js +74 -0
- package/dist/host-modules/tokens.js.map +1 -0
- package/dist/host-modules/twilio.d.ts +34 -0
- package/dist/host-modules/twilio.d.ts.map +1 -0
- package/dist/host-modules/twilio.js +67 -0
- package/dist/host-modules/twilio.js.map +1 -0
- package/dist/host-modules/xlsx.d.ts +26 -0
- package/dist/host-modules/xlsx.d.ts.map +1 -0
- package/dist/host-modules/xlsx.js +323 -0
- package/dist/host-modules/xlsx.js.map +1 -0
- package/dist/host-modules/xml.d.ts +23 -0
- package/dist/host-modules/xml.d.ts.map +1 -0
- package/dist/host-modules/xml.js +38 -0
- package/dist/host-modules/xml.js.map +1 -0
- package/dist/host-modules/zip.d.ts +24 -0
- package/dist/host-modules/zip.d.ts.map +1 -0
- package/dist/host-modules/zip.js +70 -0
- package/dist/host-modules/zip.js.map +1 -0
- package/dist/index.d.ts +197 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -60
- package/dist/index.js.map +1 -1
- package/dist/js-sandbox-worker/host.d.ts +136 -0
- package/dist/js-sandbox-worker/host.d.ts.map +1 -0
- package/dist/js-sandbox-worker/host.js +482 -0
- package/dist/js-sandbox-worker/host.js.map +1 -0
- package/dist/js-sandbox-worker/interpreter.d.ts +276 -0
- package/dist/js-sandbox-worker/interpreter.d.ts.map +1 -0
- package/dist/js-sandbox-worker/interpreter.js +1201 -0
- package/dist/js-sandbox-worker/interpreter.js.map +1 -0
- package/dist/js-sandbox-worker/protocol.d.ts +168 -0
- package/dist/js-sandbox-worker/protocol.d.ts.map +1 -0
- package/dist/js-sandbox-worker/protocol.js +217 -0
- package/dist/js-sandbox-worker/protocol.js.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts +26 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.js +307 -0
- package/dist/js-sandbox-worker/worker-entry.js.map +1 -0
- package/dist/js-sandbox.d.ts +455 -15
- package/dist/js-sandbox.d.ts.map +1 -1
- package/dist/js-sandbox.js +1961 -309
- package/dist/js-sandbox.js.map +1 -1
- package/dist/js-script-app-runner.d.ts +9 -0
- package/dist/js-script-app-runner.d.ts.map +1 -0
- package/dist/js-script-app-runner.js +49 -0
- package/dist/js-script-app-runner.js.map +1 -0
- package/dist/js-script-sandbox.d.ts +33 -0
- package/dist/js-script-sandbox.d.ts.map +1 -0
- package/dist/js-script-sandbox.js +82 -0
- package/dist/js-script-sandbox.js.map +1 -0
- package/dist/jtbd/friction.d.ts +26 -0
- package/dist/jtbd/friction.d.ts.map +1 -0
- package/dist/jtbd/friction.js +169 -0
- package/dist/jtbd/friction.js.map +1 -0
- package/dist/jtbd/index.d.ts +6 -0
- package/dist/jtbd/index.d.ts.map +1 -0
- package/dist/jtbd/index.js +6 -0
- package/dist/jtbd/index.js.map +1 -0
- package/dist/jtbd/optimize.d.ts +71 -0
- package/dist/jtbd/optimize.d.ts.map +1 -0
- package/dist/jtbd/optimize.js +176 -0
- package/dist/jtbd/optimize.js.map +1 -0
- package/dist/jtbd/registry.d.ts +29 -0
- package/dist/jtbd/registry.d.ts.map +1 -0
- package/dist/jtbd/registry.js +451 -0
- package/dist/jtbd/registry.js.map +1 -0
- package/dist/jtbd/run.d.ts +70 -0
- package/dist/jtbd/run.d.ts.map +1 -0
- package/dist/jtbd/run.js +177 -0
- package/dist/jtbd/run.js.map +1 -0
- package/dist/jtbd/types.d.ts +141 -0
- package/dist/jtbd/types.d.ts.map +1 -0
- package/dist/jtbd/types.js +25 -0
- package/dist/jtbd/types.js.map +1 -0
- package/dist/model-prompting-skills.d.ts +45 -0
- package/dist/model-prompting-skills.d.ts.map +1 -0
- package/dist/model-prompting-skills.js +116 -0
- package/dist/model-prompting-skills.js.map +1 -0
- package/dist/network-guard.d.ts +50 -0
- package/dist/network-guard.d.ts.map +1 -0
- package/dist/network-guard.js +106 -0
- package/dist/network-guard.js.map +1 -0
- package/dist/normalize-model-properties.d.ts +26 -0
- package/dist/normalize-model-properties.d.ts.map +1 -0
- package/dist/normalize-model-properties.js +58 -0
- package/dist/normalize-model-properties.js.map +1 -0
- package/dist/output-format.d.ts +5 -1
- package/dist/output-format.d.ts.map +1 -1
- package/dist/output-format.js.map +1 -1
- package/dist/parallel-task-executor.d.ts +68 -37
- package/dist/parallel-task-executor.d.ts.map +1 -1
- package/dist/parallel-task-executor.js +234 -203
- package/dist/parallel-task-executor.js.map +1 -1
- package/dist/prompts/background-subtask-prompt.d.ts +14 -0
- package/dist/prompts/background-subtask-prompt.d.ts.map +1 -0
- package/dist/prompts/background-subtask-prompt.js +64 -0
- package/dist/prompts/background-subtask-prompt.js.map +1 -0
- package/dist/prompts/product-knowledge.d.ts +3 -0
- package/dist/prompts/product-knowledge.d.ts.map +1 -0
- package/dist/prompts/product-knowledge.js +79 -0
- package/dist/prompts/product-knowledge.js.map +1 -0
- package/dist/prompts/read-only-search-prompt.d.ts +33 -0
- package/dist/prompts/read-only-search-prompt.d.ts.map +1 -0
- package/dist/prompts/read-only-search-prompt.js +109 -0
- package/dist/prompts/read-only-search-prompt.js.map +1 -0
- package/dist/prompts/sandbox-pack-catalog.d.ts +23 -0
- package/dist/prompts/sandbox-pack-catalog.d.ts.map +1 -0
- package/dist/prompts/sandbox-pack-catalog.js +40 -0
- package/dist/prompts/sandbox-pack-catalog.js.map +1 -0
- package/dist/prompts/security-monitor-prompt.d.ts +32 -0
- package/dist/prompts/security-monitor-prompt.d.ts.map +1 -0
- package/dist/prompts/security-monitor-prompt.js +99 -0
- package/dist/prompts/security-monitor-prompt.js.map +1 -0
- package/dist/prompts/workflow-authoring-knowledge.d.ts +77 -0
- package/dist/prompts/workflow-authoring-knowledge.d.ts.map +1 -0
- package/dist/prompts/workflow-authoring-knowledge.js +319 -0
- package/dist/prompts/workflow-authoring-knowledge.js.map +1 -0
- package/dist/run-policy.d.ts +25 -0
- package/dist/run-policy.d.ts.map +1 -0
- package/dist/run-policy.js +54 -0
- package/dist/run-policy.js.map +1 -0
- package/dist/sandbox-av-media.d.ts +33 -0
- package/dist/sandbox-av-media.d.ts.map +1 -0
- package/dist/sandbox-av-media.js +666 -0
- package/dist/sandbox-av-media.js.map +1 -0
- package/dist/sandbox-bootstrap-modules.d.ts +54 -0
- package/dist/sandbox-bootstrap-modules.d.ts.map +1 -0
- package/dist/sandbox-bootstrap-modules.js +104 -0
- package/dist/sandbox-bootstrap-modules.js.map +1 -0
- package/dist/sandbox-bytes.d.ts +43 -0
- package/dist/sandbox-bytes.d.ts.map +1 -0
- package/dist/sandbox-bytes.js +61 -0
- package/dist/sandbox-bytes.js.map +1 -0
- package/dist/sandbox-canvas-api.d.ts +30 -0
- package/dist/sandbox-canvas-api.d.ts.map +1 -0
- package/dist/sandbox-canvas-api.js +81 -0
- package/dist/sandbox-canvas-api.js.map +1 -0
- package/dist/sandbox-constants.d.ts +5 -0
- package/dist/sandbox-constants.d.ts.map +1 -0
- package/dist/sandbox-constants.js +13 -0
- package/dist/sandbox-constants.js.map +1 -0
- package/dist/sandbox-json-transport.d.ts +107 -0
- package/dist/sandbox-json-transport.d.ts.map +1 -0
- package/dist/sandbox-json-transport.js +324 -0
- package/dist/sandbox-json-transport.js.map +1 -0
- package/dist/sandbox-media-handle.d.ts +78 -0
- package/dist/sandbox-media-handle.d.ts.map +1 -0
- package/dist/sandbox-media-handle.js +114 -0
- package/dist/sandbox-media-handle.js.map +1 -0
- package/dist/sandbox-media-ref.d.ts +134 -0
- package/dist/sandbox-media-ref.d.ts.map +1 -0
- package/dist/sandbox-media-ref.js +442 -0
- package/dist/sandbox-media-ref.js.map +1 -0
- package/dist/sandbox-media.d.ts +177 -0
- package/dist/sandbox-media.d.ts.map +1 -0
- package/dist/sandbox-media.js +963 -0
- package/dist/sandbox-media.js.map +1 -0
- package/dist/sandbox-module-fixtures.d.ts +445 -0
- package/dist/sandbox-module-fixtures.d.ts.map +1 -0
- package/dist/sandbox-module-fixtures.js +214 -0
- package/dist/sandbox-module-fixtures.js.map +1 -0
- package/dist/sandbox-toolbelt.d.ts +13 -0
- package/dist/sandbox-toolbelt.d.ts.map +1 -0
- package/dist/sandbox-toolbelt.js +64 -0
- package/dist/sandbox-toolbelt.js.map +1 -0
- package/dist/security-monitor.d.ts +89 -0
- package/dist/security-monitor.d.ts.map +1 -0
- package/dist/security-monitor.js +307 -0
- package/dist/security-monitor.js.map +1 -0
- package/dist/serpapi/catalog.d.ts +101 -0
- package/dist/serpapi/catalog.d.ts.map +1 -0
- package/dist/serpapi/catalog.js +246 -0
- package/dist/serpapi/catalog.js.map +1 -0
- package/dist/serpapi/client.d.ts +81 -0
- package/dist/serpapi/client.d.ts.map +1 -0
- package/dist/serpapi/client.js +228 -0
- package/dist/serpapi/client.js.map +1 -0
- package/dist/serpapi/errors.d.ts +49 -0
- package/dist/serpapi/errors.d.ts.map +1 -0
- package/dist/serpapi/errors.js +64 -0
- package/dist/serpapi/errors.js.map +1 -0
- package/dist/serpapi/normalize.d.ts +58 -0
- package/dist/serpapi/normalize.d.ts.map +1 -0
- package/dist/serpapi/normalize.js +140 -0
- package/dist/serpapi/normalize.js.map +1 -0
- package/dist/skill-prompt.d.ts +27 -0
- package/dist/skill-prompt.d.ts.map +1 -0
- package/dist/skill-prompt.js +61 -0
- package/dist/skill-prompt.js.map +1 -0
- package/dist/step-executor.d.ts +90 -77
- package/dist/step-executor.d.ts.map +1 -1
- package/dist/step-executor.js +384 -690
- package/dist/step-executor.js.map +1 -1
- package/dist/subagent.d.ts +275 -0
- package/dist/subagent.d.ts.map +1 -0
- package/dist/subagent.js +444 -0
- package/dist/subagent.js.map +1 -0
- package/dist/supervisor/prompt.d.ts +12 -0
- package/dist/supervisor/prompt.d.ts.map +1 -0
- package/dist/supervisor/prompt.js +51 -0
- package/dist/supervisor/prompt.js.map +1 -0
- package/dist/supervisor/supervisor-agent.d.ts +72 -0
- package/dist/supervisor/supervisor-agent.d.ts.map +1 -0
- package/dist/supervisor/supervisor-agent.js +185 -0
- package/dist/supervisor/supervisor-agent.js.map +1 -0
- package/dist/supervisor/tools.d.ts +56 -0
- package/dist/supervisor/tools.d.ts.map +1 -0
- package/dist/supervisor/tools.js +83 -0
- package/dist/supervisor/tools.js.map +1 -0
- package/dist/supervisor/verdict-schema.d.ts +18 -0
- package/dist/supervisor/verdict-schema.d.ts.map +1 -0
- package/dist/supervisor/verdict-schema.js +58 -0
- package/dist/supervisor/verdict-schema.js.map +1 -0
- package/dist/system-skills.d.ts +68 -0
- package/dist/system-skills.d.ts.map +1 -0
- package/dist/system-skills.js +168 -0
- package/dist/system-skills.js.map +1 -0
- package/dist/task-executor.d.ts +90 -40
- package/dist/task-executor.d.ts.map +1 -1
- package/dist/task-executor.js +259 -282
- package/dist/task-executor.js.map +1 -1
- package/dist/task-planner.d.ts +18 -12
- package/dist/task-planner.d.ts.map +1 -1
- package/dist/task-planner.js +342 -328
- package/dist/task-planner.js.map +1 -1
- package/dist/timeline-preview/compare.d.ts +27 -0
- package/dist/timeline-preview/compare.d.ts.map +1 -0
- package/dist/timeline-preview/compare.js +71 -0
- package/dist/timeline-preview/compare.js.map +1 -0
- package/dist/timeline-preview/frames.d.ts +167 -0
- package/dist/timeline-preview/frames.d.ts.map +1 -0
- package/dist/timeline-preview/frames.js +646 -0
- package/dist/timeline-preview/frames.js.map +1 -0
- package/dist/timeline-preview/model3d.d.ts +67 -0
- package/dist/timeline-preview/model3d.d.ts.map +1 -0
- package/dist/timeline-preview/model3d.js +165 -0
- package/dist/timeline-preview/model3d.js.map +1 -0
- package/dist/timeline-preview/rasterize.d.ts +33 -0
- package/dist/timeline-preview/rasterize.d.ts.map +1 -0
- package/dist/timeline-preview/rasterize.js +83 -0
- package/dist/timeline-preview/rasterize.js.map +1 -0
- package/dist/timeline-preview/sheet.d.ts +38 -0
- package/dist/timeline-preview/sheet.d.ts.map +1 -0
- package/dist/timeline-preview/sheet.js +72 -0
- package/dist/timeline-preview/sheet.js.map +1 -0
- package/dist/tools/asset-persist.d.ts +29 -0
- package/dist/tools/asset-persist.d.ts.map +1 -0
- package/dist/tools/asset-persist.js +78 -0
- package/dist/tools/asset-persist.js.map +1 -0
- package/dist/tools/base-tool.d.ts +52 -5
- package/dist/tools/base-tool.d.ts.map +1 -1
- package/dist/tools/base-tool.js +180 -3
- package/dist/tools/base-tool.js.map +1 -1
- package/dist/tools/binary-output.d.ts +54 -0
- package/dist/tools/binary-output.d.ts.map +1 -0
- package/dist/tools/binary-output.js +127 -0
- package/dist/tools/binary-output.js.map +1 -0
- package/dist/tools/browser-tools.d.ts +5 -29
- package/dist/tools/browser-tools.d.ts.map +1 -1
- package/dist/tools/browser-tools.js +5 -205
- package/dist/tools/browser-tools.js.map +1 -1
- package/dist/tools/builtin-tools.d.ts +52 -0
- package/dist/tools/builtin-tools.d.ts.map +1 -0
- package/dist/tools/builtin-tools.js +276 -0
- package/dist/tools/builtin-tools.js.map +1 -0
- package/dist/tools/control-tool.d.ts +2 -5
- package/dist/tools/control-tool.d.ts.map +1 -1
- package/dist/tools/control-tool.js +18 -15
- package/dist/tools/control-tool.js.map +1 -1
- package/dist/tools/dataseo-tools.d.ts +34 -32
- package/dist/tools/dataseo-tools.d.ts.map +1 -1
- package/dist/tools/dataseo-tools.js +148 -233
- package/dist/tools/dataseo-tools.js.map +1 -1
- package/dist/tools/external-capability-tools.d.ts +36 -0
- package/dist/tools/external-capability-tools.d.ts.map +1 -0
- package/dist/tools/external-capability-tools.js +41 -0
- package/dist/tools/external-capability-tools.js.map +1 -0
- package/dist/tools/external-mcp-tools.d.ts +139 -0
- package/dist/tools/external-mcp-tools.d.ts.map +1 -0
- package/dist/tools/external-mcp-tools.js +552 -0
- package/dist/tools/external-mcp-tools.js.map +1 -0
- package/dist/tools/finish-step-tool.d.ts +1 -1
- package/dist/tools/finish-step-tool.d.ts.map +1 -1
- package/dist/tools/finish-step-tool.js +3 -3
- package/dist/tools/finish-step-tool.js.map +1 -1
- package/dist/tools/google-tools.d.ts +28 -39
- package/dist/tools/google-tools.d.ts.map +1 -1
- package/dist/tools/google-tools.js +51 -164
- package/dist/tools/google-tools.js.map +1 -1
- package/dist/tools/google-workspace-tools.d.ts +23 -0
- package/dist/tools/google-workspace-tools.d.ts.map +1 -0
- package/dist/tools/google-workspace-tools.js +26 -0
- package/dist/tools/google-workspace-tools.js.map +1 -0
- package/dist/tools/graph-validation-registry.d.ts +33 -0
- package/dist/tools/graph-validation-registry.d.ts.map +1 -0
- package/dist/tools/graph-validation-registry.js +54 -0
- package/dist/tools/graph-validation-registry.js.map +1 -0
- package/dist/tools/http-tools.d.ts +5 -53
- package/dist/tools/http-tools.d.ts.map +1 -1
- package/dist/tools/http-tools.js +5 -177
- package/dist/tools/http-tools.js.map +1 -1
- package/dist/tools/image-injection.d.ts +51 -0
- package/dist/tools/image-injection.d.ts.map +1 -0
- package/dist/tools/image-injection.js +85 -0
- package/dist/tools/image-injection.js.map +1 -0
- package/dist/tools/mcp-tool-support.d.ts +203 -0
- package/dist/tools/mcp-tool-support.d.ts.map +1 -0
- package/dist/tools/mcp-tool-support.js +536 -0
- package/dist/tools/mcp-tool-support.js.map +1 -0
- package/dist/tools/mcp-tools.d.ts +104 -390
- package/dist/tools/mcp-tools.d.ts.map +1 -1
- package/dist/tools/mcp-tools.js +128 -600
- package/dist/tools/mcp-tools.js.map +1 -1
- package/dist/tools/media-tools.d.ts +9 -272
- package/dist/tools/media-tools.d.ts.map +1 -1
- package/dist/tools/media-tools.js +11 -676
- package/dist/tools/media-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +36 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +52 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/openai-tools.d.ts +28 -68
- package/dist/tools/openai-tools.d.ts.map +1 -1
- package/dist/tools/openai-tools.js +51 -181
- package/dist/tools/openai-tools.js.map +1 -1
- package/dist/tools/plan-builder-tools.d.ts +141 -7
- package/dist/tools/plan-builder-tools.d.ts.map +1 -1
- package/dist/tools/plan-builder-tools.js +159 -86
- package/dist/tools/plan-builder-tools.js.map +1 -1
- package/dist/tools/run-search-tool.d.ts +82 -0
- package/dist/tools/run-search-tool.d.ts.map +1 -0
- package/dist/tools/run-search-tool.js +121 -0
- package/dist/tools/run-search-tool.js.map +1 -0
- package/dist/tools/run-subtask-tool.d.ts +49 -0
- package/dist/tools/run-subtask-tool.d.ts.map +1 -0
- package/dist/tools/run-subtask-tool.js +88 -0
- package/dist/tools/run-subtask-tool.js.map +1 -0
- package/dist/tools/search-tools.d.ts +5 -36
- package/dist/tools/search-tools.d.ts.map +1 -1
- package/dist/tools/search-tools.js +5 -215
- package/dist/tools/search-tools.js.map +1 -1
- package/dist/tools/serp-providers/apify-provider.d.ts +18 -0
- package/dist/tools/serp-providers/apify-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/apify-provider.js +93 -0
- package/dist/tools/serp-providers/apify-provider.js.map +1 -0
- package/dist/tools/serp-providers/brave-provider.d.ts +34 -0
- package/dist/tools/serp-providers/brave-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/brave-provider.js +86 -0
- package/dist/tools/serp-providers/brave-provider.js.map +1 -0
- package/dist/tools/serp-providers/dataforseo-provider.d.ts +14 -1
- package/dist/tools/serp-providers/dataforseo-provider.d.ts.map +1 -1
- package/dist/tools/serp-providers/dataforseo-provider.js +0 -9
- package/dist/tools/serp-providers/dataforseo-provider.js.map +1 -1
- package/dist/tools/serp-providers/gemini-provider.d.ts +45 -0
- package/dist/tools/serp-providers/gemini-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/gemini-provider.js +148 -0
- package/dist/tools/serp-providers/gemini-provider.js.map +1 -0
- package/dist/tools/serp-providers/index.d.ts +61 -0
- package/dist/tools/serp-providers/index.d.ts.map +1 -1
- package/dist/tools/serp-providers/index.js +119 -3
- package/dist/tools/serp-providers/index.js.map +1 -1
- package/dist/tools/serp-providers/openai-provider.d.ts +58 -0
- package/dist/tools/serp-providers/openai-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/openai-provider.js +113 -0
- package/dist/tools/serp-providers/openai-provider.js.map +1 -0
- package/dist/tools/serp-providers/serpapi-provider.d.ts +9 -5
- package/dist/tools/serp-providers/serpapi-provider.d.ts.map +1 -1
- package/dist/tools/serp-providers/serpapi-provider.js +26 -44
- package/dist/tools/serp-providers/serpapi-provider.js.map +1 -1
- package/dist/tools/serp-tool-factory.d.ts +27 -0
- package/dist/tools/serp-tool-factory.d.ts.map +1 -0
- package/dist/tools/serp-tool-factory.js +56 -0
- package/dist/tools/serp-tool-factory.js.map +1 -0
- package/dist/tools/shared-tools.d.ts +33 -0
- package/dist/tools/shared-tools.d.ts.map +1 -0
- package/dist/tools/shared-tools.js +39 -0
- package/dist/tools/shared-tools.js.map +1 -0
- package/dist/tools/start-subtask-tool.d.ts +51 -0
- package/dist/tools/start-subtask-tool.d.ts.map +1 -0
- package/dist/tools/start-subtask-tool.js +189 -0
- package/dist/tools/start-subtask-tool.js.map +1 -0
- package/dist/tools/submit-code-tool.d.ts +159 -0
- package/dist/tools/submit-code-tool.d.ts.map +1 -0
- package/dist/tools/submit-code-tool.js +209 -0
- package/dist/tools/submit-code-tool.js.map +1 -0
- package/dist/tools/subtask-fields.d.ts +11 -0
- package/dist/tools/subtask-fields.d.ts.map +1 -0
- package/dist/tools/subtask-fields.js +11 -0
- package/dist/tools/subtask-fields.js.map +1 -0
- package/dist/tools/todo-tools.d.ts +15 -0
- package/dist/tools/todo-tools.d.ts.map +1 -0
- package/dist/tools/todo-tools.js +15 -0
- package/dist/tools/todo-tools.js.map +1 -0
- package/dist/tools/tool-permissions.d.ts +40 -0
- package/dist/tools/tool-permissions.d.ts.map +1 -0
- package/dist/tools/tool-permissions.js +52 -0
- package/dist/tools/tool-permissions.js.map +1 -0
- package/dist/tools/tool-search.d.ts +39 -0
- package/dist/tools/tool-search.d.ts.map +1 -0
- package/dist/tools/tool-search.js +108 -0
- package/dist/tools/tool-search.js.map +1 -0
- package/dist/tools/vector-tool-support.d.ts +15 -0
- package/dist/tools/vector-tool-support.d.ts.map +1 -0
- package/dist/tools/vector-tool-support.js +133 -0
- package/dist/tools/vector-tool-support.js.map +1 -0
- package/dist/tools/vector-tools.d.ts +13 -220
- package/dist/tools/vector-tools.d.ts.map +1 -1
- package/dist/tools/vector-tools.js +7 -578
- package/dist/tools/vector-tools.js.map +1 -1
- package/dist/tools/wait-subtasks-tool.d.ts +27 -0
- package/dist/tools/wait-subtasks-tool.d.ts.map +1 -0
- package/dist/tools/wait-subtasks-tool.js +66 -0
- package/dist/tools/wait-subtasks-tool.js.map +1 -0
- package/dist/tsconfig.tests.tmp.tsbuildinfo +1 -0
- package/dist/types.d.ts +16 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +8 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/dag-scheduler.d.ts +85 -0
- package/dist/utils/dag-scheduler.d.ts.map +1 -0
- package/dist/utils/dag-scheduler.js +180 -0
- package/dist/utils/dag-scheduler.js.map +1 -0
- package/dist/utils/json-parser.d.ts +32 -1
- package/dist/utils/json-parser.d.ts.map +1 -1
- package/dist/utils/json-parser.js +145 -10
- package/dist/utils/json-parser.js.map +1 -1
- package/dist/utils/json-schema-validate.d.ts +29 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.js +228 -0
- package/dist/utils/json-schema-validate.js.map +1 -0
- package/dist/utils/link-abort.d.ts +13 -0
- package/dist/utils/link-abort.d.ts.map +1 -0
- package/dist/utils/link-abort.js +23 -0
- package/dist/utils/link-abort.js.map +1 -0
- package/dist/utils/merge-generators.d.ts +58 -0
- package/dist/utils/merge-generators.d.ts.map +1 -0
- package/dist/utils/merge-generators.js +148 -0
- package/dist/utils/merge-generators.js.map +1 -0
- package/dist/utils/remove-base64-images.d.ts +0 -5
- package/dist/utils/remove-base64-images.d.ts.map +1 -1
- package/dist/utils/remove-base64-images.js.map +1 -1
- package/dist/utils/step-failure.d.ts +20 -0
- package/dist/utils/step-failure.d.ts.map +1 -0
- package/dist/utils/step-failure.js +43 -0
- package/dist/utils/step-failure.js.map +1 -0
- package/dist/utils/think-tags.d.ts +16 -0
- package/dist/utils/think-tags.d.ts.map +1 -0
- package/dist/utils/think-tags.js +23 -0
- package/dist/utils/think-tags.js.map +1 -0
- package/dist/utils/type-guards.d.ts +26 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +44 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/ui-event-buffer.d.ts +18 -0
- package/dist/utils/ui-event-buffer.d.ts.map +1 -0
- package/dist/utils/ui-event-buffer.js +18 -0
- package/dist/utils/ui-event-buffer.js.map +1 -0
- package/dist/utils/wrap-generators-parallel.d.ts +0 -5
- package/dist/utils/wrap-generators-parallel.d.ts.map +1 -1
- package/dist/utils/wrap-generators-parallel.js +3 -6
- package/dist/utils/wrap-generators-parallel.js.map +1 -1
- package/dist/wasm-sandbox/host.d.ts +106 -0
- package/dist/wasm-sandbox/host.d.ts.map +1 -0
- package/dist/wasm-sandbox/host.js +409 -0
- package/dist/wasm-sandbox/host.js.map +1 -0
- package/dist/wasm-sandbox/workers.d.ts +43 -0
- package/dist/wasm-sandbox/workers.d.ts.map +1 -0
- package/dist/wasm-sandbox/workers.js +150 -0
- package/dist/wasm-sandbox/workers.js.map +1 -0
- package/dist/workspace-paths.d.ts +40 -0
- package/dist/workspace-paths.d.ts.map +1 -0
- package/dist/workspace-paths.js +102 -0
- package/dist/workspace-paths.js.map +1 -0
- package/dist/yt-dlp-gate.d.ts +19 -0
- package/dist/yt-dlp-gate.d.ts.map +1 -0
- package/dist/yt-dlp-gate.js +22 -0
- package/dist/yt-dlp-gate.js.map +1 -0
- package/package.json +112 -14
- package/dist/agent-executor.d.ts +0 -62
- package/dist/agent-executor.d.ts.map +0 -1
- package/dist/agent-executor.js +0 -324
- package/dist/agent-executor.js.map +0 -1
- package/dist/agent-step-executor.d.ts +0 -28
- package/dist/agent-step-executor.d.ts.map +0 -1
- package/dist/agent-step-executor.js +0 -99
- package/dist/agent-step-executor.js.map +0 -1
- package/dist/agent-workflow-runner.d.ts +0 -31
- package/dist/agent-workflow-runner.d.ts.map +0 -1
- package/dist/agent-workflow-runner.js +0 -124
- package/dist/agent-workflow-runner.js.map +0 -1
- package/dist/agent.d.ts +0 -115
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -587
- package/dist/agent.js.map +0 -1
- package/dist/base-agent.d.ts +0 -42
- package/dist/base-agent.d.ts.map +0 -1
- package/dist/base-agent.js +0 -29
- package/dist/base-agent.js.map +0 -1
- package/dist/graph-planner.d.ts +0 -56
- package/dist/graph-planner.d.ts.map +0 -1
- package/dist/graph-planner.js +0 -311
- package/dist/graph-planner.js.map +0 -1
- package/dist/multi-mode-agent.d.ts +0 -86
- package/dist/multi-mode-agent.d.ts.map +0 -1
- package/dist/multi-mode-agent.js +0 -476
- package/dist/multi-mode-agent.js.map +0 -1
- package/dist/prompts/graph-planner-prompt.d.ts +0 -48
- package/dist/prompts/graph-planner-prompt.d.ts.map +0 -1
- package/dist/prompts/graph-planner-prompt.js +0 -180
- package/dist/prompts/graph-planner-prompt.js.map +0 -1
- package/dist/reject-agentic-provider.d.ts +0 -21
- package/dist/reject-agentic-provider.d.ts.map +0 -1
- package/dist/reject-agentic-provider.js +0 -32
- package/dist/reject-agentic-provider.js.map +0 -1
- package/dist/simple-agent.d.ts +0 -29
- package/dist/simple-agent.d.ts.map +0 -1
- package/dist/simple-agent.js +0 -54
- package/dist/simple-agent.js.map +0 -1
- package/dist/sub-agent-planner.d.ts +0 -33
- package/dist/sub-agent-planner.d.ts.map +0 -1
- package/dist/sub-agent-planner.js +0 -203
- package/dist/sub-agent-planner.js.map +0 -1
- package/dist/team/db-task-board.d.ts +0 -54
- package/dist/team/db-task-board.d.ts.map +0 -1
- package/dist/team/db-task-board.js +0 -361
- package/dist/team/db-task-board.js.map +0 -1
- package/dist/team/edge-message-bus.d.ts +0 -51
- package/dist/team/edge-message-bus.d.ts.map +0 -1
- package/dist/team/edge-message-bus.js +0 -169
- package/dist/team/edge-message-bus.js.map +0 -1
- package/dist/team/edge-task-board.d.ts +0 -77
- package/dist/team/edge-task-board.d.ts.map +0 -1
- package/dist/team/edge-task-board.js +0 -140
- package/dist/team/edge-task-board.js.map +0 -1
- package/dist/team/index.d.ts +0 -16
- package/dist/team/index.d.ts.map +0 -1
- package/dist/team/index.js +0 -17
- package/dist/team/index.js.map +0 -1
- package/dist/team/message-bus.d.ts +0 -58
- package/dist/team/message-bus.d.ts.map +0 -1
- package/dist/team/message-bus.js +0 -151
- package/dist/team/message-bus.js.map +0 -1
- package/dist/team/task-board.d.ts +0 -106
- package/dist/team/task-board.d.ts.map +0 -1
- package/dist/team/task-board.js +0 -370
- package/dist/team/task-board.js.map +0 -1
- package/dist/team/team-executor.d.ts +0 -72
- package/dist/team/team-executor.d.ts.map +0 -1
- package/dist/team/team-executor.js +0 -466
- package/dist/team/team-executor.js.map +0 -1
- package/dist/team/team-tools.d.ts +0 -252
- package/dist/team/team-tools.d.ts.map +0 -1
- package/dist/team/team-tools.js +0 -412
- package/dist/team/team-tools.js.map +0 -1
- package/dist/team/types.d.ts +0 -198
- package/dist/team/types.d.ts.map +0 -1
- package/dist/team/types.js +0 -8
- package/dist/team/types.js.map +0 -1
- package/dist/tools/add-edge-tool.d.ts +0 -18
- package/dist/tools/add-edge-tool.d.ts.map +0 -1
- package/dist/tools/add-edge-tool.js +0 -92
- package/dist/tools/add-edge-tool.js.map +0 -1
- package/dist/tools/add-node-tool.d.ts +0 -22
- package/dist/tools/add-node-tool.d.ts.map +0 -1
- package/dist/tools/add-node-tool.js +0 -128
- package/dist/tools/add-node-tool.js.map +0 -1
- package/dist/tools/asset-tools.d.ts +0 -58
- package/dist/tools/asset-tools.d.ts.map +0 -1
- package/dist/tools/asset-tools.js +0 -191
- package/dist/tools/asset-tools.js.map +0 -1
- package/dist/tools/calculator-tool.d.ts +0 -24
- package/dist/tools/calculator-tool.d.ts.map +0 -1
- package/dist/tools/calculator-tool.js +0 -64
- package/dist/tools/calculator-tool.js.map +0 -1
- package/dist/tools/claude-code-tools.d.ts +0 -96
- package/dist/tools/claude-code-tools.d.ts.map +0 -1
- package/dist/tools/claude-code-tools.js +0 -463
- package/dist/tools/claude-code-tools.js.map +0 -1
- package/dist/tools/code-tools.d.ts +0 -26
- package/dist/tools/code-tools.d.ts.map +0 -1
- package/dist/tools/code-tools.js +0 -82
- package/dist/tools/code-tools.js.map +0 -1
- package/dist/tools/create-plan-tool.d.ts +0 -29
- package/dist/tools/create-plan-tool.d.ts.map +0 -1
- package/dist/tools/create-plan-tool.js +0 -355
- package/dist/tools/create-plan-tool.js.map +0 -1
- package/dist/tools/create-task-tool.d.ts +0 -28
- package/dist/tools/create-task-tool.d.ts.map +0 -1
- package/dist/tools/create-task-tool.js +0 -254
- package/dist/tools/create-task-tool.js.map +0 -1
- package/dist/tools/email-tools.d.ts +0 -76
- package/dist/tools/email-tools.d.ts.map +0 -1
- package/dist/tools/email-tools.js +0 -259
- package/dist/tools/email-tools.js.map +0 -1
- package/dist/tools/filesystem-tools.d.ts +0 -77
- package/dist/tools/filesystem-tools.d.ts.map +0 -1
- package/dist/tools/filesystem-tools.js +0 -334
- package/dist/tools/filesystem-tools.js.map +0 -1
- package/dist/tools/find-model-tool.d.ts +0 -25
- package/dist/tools/find-model-tool.d.ts.map +0 -1
- package/dist/tools/find-model-tool.js +0 -236
- package/dist/tools/find-model-tool.js.map +0 -1
- package/dist/tools/finish-graph-tool.d.ts +0 -23
- package/dist/tools/finish-graph-tool.d.ts.map +0 -1
- package/dist/tools/finish-graph-tool.js +0 -46
- package/dist/tools/finish-graph-tool.js.map +0 -1
- package/dist/tools/js-code-tool.d.ts +0 -30
- package/dist/tools/js-code-tool.d.ts.map +0 -1
- package/dist/tools/js-code-tool.js +0 -98
- package/dist/tools/js-code-tool.js.map +0 -1
- package/dist/tools/local-get-node-info-tool.d.ts +0 -19
- package/dist/tools/local-get-node-info-tool.d.ts.map +0 -1
- package/dist/tools/local-get-node-info-tool.js +0 -75
- package/dist/tools/local-get-node-info-tool.js.map +0 -1
- package/dist/tools/local-list-nodes-tool.d.ts +0 -19
- package/dist/tools/local-list-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-list-nodes-tool.js +0 -69
- package/dist/tools/local-list-nodes-tool.js.map +0 -1
- package/dist/tools/local-search-nodes-tool.d.ts +0 -21
- package/dist/tools/local-search-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-search-nodes-tool.js +0 -111
- package/dist/tools/local-search-nodes-tool.js.map +0 -1
- package/dist/tools/math-tools.d.ts +0 -156
- package/dist/tools/math-tools.d.ts.map +0 -1
- package/dist/tools/math-tools.js +0 -422
- package/dist/tools/math-tools.js.map +0 -1
- package/dist/tools/model-tools.d.ts +0 -25
- package/dist/tools/model-tools.d.ts.map +0 -1
- package/dist/tools/model-tools.js +0 -48
- package/dist/tools/model-tools.js.map +0 -1
- package/dist/tools/pdf-tools.d.ts +0 -152
- package/dist/tools/pdf-tools.d.ts.map +0 -1
- package/dist/tools/pdf-tools.js +0 -339
- package/dist/tools/pdf-tools.js.map +0 -1
- package/dist/tools/tool-registry.d.ts +0 -9
- package/dist/tools/tool-registry.d.ts.map +0 -1
- package/dist/tools/tool-registry.js +0 -17
- package/dist/tools/tool-registry.js.map +0 -1
- package/dist/tools/workspace-tools.d.ts +0 -58
- package/dist/tools/workspace-tools.d.ts.map +0 -1
- package/dist/tools/workspace-tools.js +0 -152
- package/dist/tools/workspace-tools.js.map +0 -1
|
@@ -0,0 +1,1530 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `workflows` capability module — the pilot namespace.
|
|
3
|
+
*
|
|
4
|
+
* Ten capabilities that used to be ten `Tool` subclasses in
|
|
5
|
+
* `../tools/mcp-tools.ts`: the nine the guest reaches as `nodetool.workflows.*`
|
|
6
|
+
* (`NODETOOL_API_NAMESPACE_TOOLS.workflows`) plus `export_workflow_digraph`,
|
|
7
|
+
* which the design's mapping table folds in here rather than leaving it beside
|
|
8
|
+
* the file tools.
|
|
9
|
+
*
|
|
10
|
+
* Wire names, descriptions and schemas are unchanged: `getAllMcpTools` builds
|
|
11
|
+
* these through `toolFromCapability`, so every consumer — runner, MCP, CLI,
|
|
12
|
+
* evals — sees the surface it saw before.
|
|
13
|
+
*
|
|
14
|
+
* What was a constructor argument is now a field on the run: the example
|
|
15
|
+
* catalog, the node registry, the run environment, the DSL exporter, and the
|
|
16
|
+
* model catalogs. Every heavy dependency (`@nodetool-ai/models`, the execution
|
|
17
|
+
* service, the graph validators, the DSL sandbox) is imported inside the
|
|
18
|
+
* implementation that needs it, so loading this module costs nothing.
|
|
19
|
+
*
|
|
20
|
+
* Design: docs/tool-class-retirement-design.md § "Worked example:
|
|
21
|
+
* `nodetool.workflows`".
|
|
22
|
+
*/
|
|
23
|
+
import { NO_EXAMPLES, RUNTIME_MODEL_CATALOGS, annotateEscalatedRun, jobRecord, leftoverWiringHandleError, lightWorkflowList, modelSelectionError, noRegistryError, normalizeWorkflowGraph, outcomeResult, resolveRunEnvironment, summarizeWorkflowGraph, unsetModelSelectionError, userIdOf, workflowRecord } from "../tools/mcp-tool-support.js";
|
|
24
|
+
import { planNodeShape, planToPlacement, parseWorkflowPlan, resolveWorkflowPlan, readEntityMarker, GAME_DESIGNER_SYSTEM_PROMPT, GAME_DESIGN_TOOL_DESCRIPTION, GAME_DESIGN_TOOL_NAME, GAME_INSPIRATION_CHIPS, WORKFLOW_PLANNER_SYSTEM_PROMPT, WORKFLOW_PLAN_TOOL_DESCRIPTION, WORKFLOW_PLAN_TOOL_NAME, buildGameDesignSchema, buildWorkflowPlanSchema, designSourceOf, gameAudioChoice, gameGraphPlacement, parseGameDesign } from "@nodetool-ai/protocol";
|
|
25
|
+
import { gameDesign, readGameSetup, readWorkflowSetup, workflowSetupPlan, writeGameSetup, writeWorkflowSetup } from "@nodetool-ai/protocol/api-schemas/workflows.js";
|
|
26
|
+
import { declareDynamicOutputsInGraph } from "../dynamic-slots.js";
|
|
27
|
+
import { findCapability } from "./registry.js";
|
|
28
|
+
import { REQUEST_SECRET_TOOL_NAME } from "./settings.specs.js";
|
|
29
|
+
import { listWorkflowsSpec, getWorkflowSpec, createWorkflowSpec, updateWorkflowSpec, deleteWorkflowSpec, listWorkflowVersionsSpec, getWorkflowVersionSpec, createWorkflowVersionSpec, restoreWorkflowVersionSpec, deleteWorkflowVersionSpec, setWorkflowAccessSpec, runWorkflowCapabilitySpec, debugWorkflowSpec, resolveWorkflowEscalationSpec, validateWorkflowSpec, startBackgroundJobSpec, getExampleWorkflowSpec, exportWorkflowDigraphSpec, setWorkflowSetupSpec, planWorkflowSpec, updateWorkflowPlanStepSpec, buildWorkflowFromPlanSpec, setGameSetupSpec, designGameSpec, updateGameDesignSpec, buildGameSpec, DEFAULT_VERSION_LIMIT, MAX_VERSION_LIMIT } from "./workflows.specs.js";
|
|
30
|
+
import { isNumber, isObjectLike, isString } from "../utils/type-guards.js";
|
|
31
|
+
import { resolveProjectId } from "./project-scope.js";
|
|
32
|
+
/** The run environment this run can execute a workflow in, or null. */
|
|
33
|
+
function runEnvironmentOf(run) {
|
|
34
|
+
return resolveRunEnvironment(run.workflowEnvironment, run.nodeRegistry);
|
|
35
|
+
}
|
|
36
|
+
async function listUserWorkflows(run, limit) {
|
|
37
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
38
|
+
const [workflows, next] = await Workflow.paginate(userIdOf(run.context), {
|
|
39
|
+
limit,
|
|
40
|
+
projectId: run.projectId
|
|
41
|
+
});
|
|
42
|
+
return lightWorkflowList({
|
|
43
|
+
workflows: workflows.map((w) => workflowRecord(w)),
|
|
44
|
+
next: next || null
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async function listExampleWorkflows(run, query, limit) {
|
|
48
|
+
if (!run.examples)
|
|
49
|
+
return NO_EXAMPLES;
|
|
50
|
+
const listOptions = { limit };
|
|
51
|
+
if (query)
|
|
52
|
+
listOptions.query = query;
|
|
53
|
+
return lightWorkflowList({
|
|
54
|
+
workflows: await run.examples.list(listOptions),
|
|
55
|
+
next: null
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const listWorkflows = {
|
|
59
|
+
spec: listWorkflowsSpec,
|
|
60
|
+
impl: async (run, params) => {
|
|
61
|
+
const workflowType = String(params["workflow_type"] ?? "user");
|
|
62
|
+
const query = params["query"];
|
|
63
|
+
const limit = Number(params["limit"] ?? 100);
|
|
64
|
+
if (workflowType === "example") {
|
|
65
|
+
return listExampleWorkflows(run, query, limit);
|
|
66
|
+
}
|
|
67
|
+
if (workflowType === "all") {
|
|
68
|
+
return {
|
|
69
|
+
examples: await listExampleWorkflows(run, query, limit),
|
|
70
|
+
user: await listUserWorkflows(run, limit)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return listUserWorkflows(run, limit);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// get_workflow
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
const getWorkflow = {
|
|
80
|
+
spec: getWorkflowSpec,
|
|
81
|
+
impl: async (run, params) => {
|
|
82
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
83
|
+
const workflowId = String(params["workflow_id"]);
|
|
84
|
+
const workflow = await Workflow.find(userIdOf(run.context), workflowId);
|
|
85
|
+
if (!workflow)
|
|
86
|
+
return { error: `Workflow ${workflowId} was not found.` };
|
|
87
|
+
if (run.projectId !== undefined && workflow.project_id !== run.projectId) {
|
|
88
|
+
return { error: `Workflow ${workflowId} was not found.` };
|
|
89
|
+
}
|
|
90
|
+
return workflowRecord(workflow);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const createWorkflow = {
|
|
94
|
+
spec: createWorkflowSpec,
|
|
95
|
+
impl: async (run, params) => {
|
|
96
|
+
const { Project, Workflow } = await import("@nodetool-ai/models");
|
|
97
|
+
const projectId = resolveProjectId(run, params);
|
|
98
|
+
if (projectId !== "default" &&
|
|
99
|
+
!(await Project.findOwned(userIdOf(run.context), projectId))) {
|
|
100
|
+
return { error: "Project not found." };
|
|
101
|
+
}
|
|
102
|
+
// Declare before normalizing, so the handle is on the node the editor,
|
|
103
|
+
// the validator and every later run read. Without a registry this is the
|
|
104
|
+
// identity function and the graph is stored exactly as it arrived.
|
|
105
|
+
const authored = run.nodeRegistry
|
|
106
|
+
? declareDynamicOutputsInGraph(params["graph"], run.nodeRegistry)
|
|
107
|
+
: params["graph"];
|
|
108
|
+
const graph = normalizeWorkflowGraph(authored);
|
|
109
|
+
const badModels = await modelSelectionError(graph, run.modelCatalogs ?? RUNTIME_MODEL_CATALOGS);
|
|
110
|
+
if (badModels)
|
|
111
|
+
return badModels;
|
|
112
|
+
const leftoverHandles = leftoverWiringHandleError(graph);
|
|
113
|
+
if (leftoverHandles)
|
|
114
|
+
return leftoverHandles;
|
|
115
|
+
if (run.nodeRegistry) {
|
|
116
|
+
const unselected = unsetModelSelectionError(graph, run.nodeRegistry);
|
|
117
|
+
if (unselected)
|
|
118
|
+
return unselected;
|
|
119
|
+
}
|
|
120
|
+
const created = (await Workflow.create({
|
|
121
|
+
user_id: userIdOf(run.context),
|
|
122
|
+
name: String(params["name"]),
|
|
123
|
+
description: isString(params["description"]) ? params["description"] : "",
|
|
124
|
+
tags: Array.isArray(params["tags"]) ? params["tags"] : [],
|
|
125
|
+
access: params["access"] === "public" ? "public" : "private",
|
|
126
|
+
graph: graph,
|
|
127
|
+
run_mode: "workflow",
|
|
128
|
+
project_id: projectId
|
|
129
|
+
}));
|
|
130
|
+
return workflowRecord(created);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* The one ownership test the three lifecycle capabilities share.
|
|
135
|
+
*
|
|
136
|
+
* `Workflow.find` is deliberately not it: that answers for a public workflow
|
|
137
|
+
* and for one shared with the caller as well, so writing a mutation on top of
|
|
138
|
+
* it would let a run rewrite or publish a workflow it can merely read. Missing
|
|
139
|
+
* and not-yours are one answer, so a caller cannot probe for ids.
|
|
140
|
+
*/
|
|
141
|
+
async function findOwnedWorkflow(run, id) {
|
|
142
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
143
|
+
const wf = (await Workflow.get(id));
|
|
144
|
+
if (!wf || wf.user_id !== userIdOf(run.context))
|
|
145
|
+
return null;
|
|
146
|
+
if (run.projectId !== undefined && wf.project_id !== run.projectId) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return wf;
|
|
150
|
+
}
|
|
151
|
+
function notYours(id) {
|
|
152
|
+
return { error: `Workflow ${id} was not found, or it is not yours.` };
|
|
153
|
+
}
|
|
154
|
+
const updateWorkflow = {
|
|
155
|
+
spec: updateWorkflowSpec,
|
|
156
|
+
impl: async (run, params) => {
|
|
157
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
158
|
+
const id = String(params["workflow_id"]);
|
|
159
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
160
|
+
if (!existing)
|
|
161
|
+
return notYours(id);
|
|
162
|
+
const fields = {};
|
|
163
|
+
if (params["graph"] !== undefined) {
|
|
164
|
+
// The same three passes create_workflow runs, in the same order: an
|
|
165
|
+
// update that skipped them could store a graph the create path would
|
|
166
|
+
// have refused.
|
|
167
|
+
const authored = run.nodeRegistry
|
|
168
|
+
? declareDynamicOutputsInGraph(params["graph"], run.nodeRegistry)
|
|
169
|
+
: params["graph"];
|
|
170
|
+
const graph = normalizeWorkflowGraph(authored);
|
|
171
|
+
const badModels = await modelSelectionError(graph, run.modelCatalogs ?? RUNTIME_MODEL_CATALOGS);
|
|
172
|
+
if (badModels)
|
|
173
|
+
return badModels;
|
|
174
|
+
const leftoverHandles = leftoverWiringHandleError(graph);
|
|
175
|
+
if (leftoverHandles)
|
|
176
|
+
return leftoverHandles;
|
|
177
|
+
if (run.nodeRegistry) {
|
|
178
|
+
const unselected = unsetModelSelectionError(graph, run.nodeRegistry);
|
|
179
|
+
if (unselected)
|
|
180
|
+
return unselected;
|
|
181
|
+
}
|
|
182
|
+
fields.graph = graph;
|
|
183
|
+
}
|
|
184
|
+
if (isString(params["name"]))
|
|
185
|
+
fields.name = params["name"];
|
|
186
|
+
if (isString(params["description"])) {
|
|
187
|
+
fields.description = params["description"];
|
|
188
|
+
}
|
|
189
|
+
if (Array.isArray(params["tags"]))
|
|
190
|
+
fields.tags = params["tags"];
|
|
191
|
+
if (Object.keys(fields).length === 0) {
|
|
192
|
+
return { error: "Nothing to update — pass graph, name, description or tags." };
|
|
193
|
+
}
|
|
194
|
+
// `access` is not in the field set on purpose. Publishing is its own
|
|
195
|
+
// capability because it is its own permission class.
|
|
196
|
+
const expected = isString(params["expected_updated_at"])
|
|
197
|
+
? params["expected_updated_at"]
|
|
198
|
+
: existing.updated_at;
|
|
199
|
+
const updated = await Workflow.updateFieldsIfUnchanged(id, expected, fields,
|
|
200
|
+
// A whole-graph write names no units, so an open editor falls back to
|
|
201
|
+
// diff-based touching instead of treating the graph as replaced.
|
|
202
|
+
"graph" in fields ? { ops: [{ tool: "update_graph", input: {} }] } : undefined);
|
|
203
|
+
if (!updated) {
|
|
204
|
+
return {
|
|
205
|
+
error: `Workflow ${id} changed since you read it — read it again and retry.`
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
return workflowRecord(updated);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const deleteWorkflow = {
|
|
212
|
+
spec: deleteWorkflowSpec,
|
|
213
|
+
impl: async (run, params) => {
|
|
214
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
215
|
+
const id = String(params["workflow_id"]);
|
|
216
|
+
const deleted = await Workflow.deleteOwned(userIdOf(run.context), id);
|
|
217
|
+
return deleted ? { workflow_id: id, deleted: true } : notYours(id);
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
function versionNumber(value) {
|
|
221
|
+
const n = Number(value);
|
|
222
|
+
if (!Number.isInteger(n) || n < 1) {
|
|
223
|
+
return {
|
|
224
|
+
error: "version must be a positive integer (use list_workflow_versions to see the available ones)."
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
return n;
|
|
228
|
+
}
|
|
229
|
+
function toVersionListItem(version) {
|
|
230
|
+
return {
|
|
231
|
+
id: version.id,
|
|
232
|
+
version: version.version,
|
|
233
|
+
name: version.name,
|
|
234
|
+
description: version.description,
|
|
235
|
+
save_type: version.save_type,
|
|
236
|
+
created_at: version.created_at
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
const listWorkflowVersions = {
|
|
240
|
+
spec: listWorkflowVersionsSpec,
|
|
241
|
+
impl: async (run, params) => {
|
|
242
|
+
const id = String(params["workflow_id"]);
|
|
243
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
244
|
+
if (!existing)
|
|
245
|
+
return notYours(id);
|
|
246
|
+
const { WorkflowVersion } = await import("@nodetool-ai/models");
|
|
247
|
+
const limit = Math.max(1, Math.min(Number(params["limit"]) || DEFAULT_VERSION_LIMIT, MAX_VERSION_LIMIT));
|
|
248
|
+
const versions = await WorkflowVersion.listForWorkflow(id, { limit });
|
|
249
|
+
return {
|
|
250
|
+
workflow_id: id,
|
|
251
|
+
name: existing.name,
|
|
252
|
+
versions: versions.map(toVersionListItem)
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const getWorkflowVersion = {
|
|
257
|
+
spec: getWorkflowVersionSpec,
|
|
258
|
+
impl: async (run, params) => {
|
|
259
|
+
const id = String(params["workflow_id"]);
|
|
260
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
261
|
+
if (!existing)
|
|
262
|
+
return notYours(id);
|
|
263
|
+
const number = versionNumber(params["version"]);
|
|
264
|
+
if (typeof number !== "number")
|
|
265
|
+
return number;
|
|
266
|
+
const { WorkflowVersion } = await import("@nodetool-ai/models");
|
|
267
|
+
const version = await WorkflowVersion.findByVersion(id, number);
|
|
268
|
+
if (!version) {
|
|
269
|
+
return {
|
|
270
|
+
error: `Workflow ${id} has no version ${number}. Call list_workflow_versions to see the available ones.`
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
return {
|
|
274
|
+
workflow_id: id,
|
|
275
|
+
...toVersionListItem(version),
|
|
276
|
+
graph: version.graph
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
const createWorkflowVersion = {
|
|
281
|
+
spec: createWorkflowVersionSpec,
|
|
282
|
+
impl: async (run, params) => {
|
|
283
|
+
const id = String(params["workflow_id"]);
|
|
284
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
285
|
+
if (!existing)
|
|
286
|
+
return notYours(id);
|
|
287
|
+
const { WorkflowVersion } = await import("@nodetool-ai/models");
|
|
288
|
+
const nextVer = await WorkflowVersion.nextVersion(id);
|
|
289
|
+
const version = (await WorkflowVersion.create({
|
|
290
|
+
workflow_id: id,
|
|
291
|
+
user_id: userIdOf(run.context),
|
|
292
|
+
name: isString(params["name"]) ? params["name"] : null,
|
|
293
|
+
description: isString(params["description"])
|
|
294
|
+
? params["description"]
|
|
295
|
+
: null,
|
|
296
|
+
graph: existing.graph,
|
|
297
|
+
version: nextVer,
|
|
298
|
+
save_type: "manual"
|
|
299
|
+
}));
|
|
300
|
+
return {
|
|
301
|
+
ok: true,
|
|
302
|
+
workflow_id: id,
|
|
303
|
+
...toVersionListItem(version)
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
const restoreWorkflowVersion = {
|
|
308
|
+
spec: restoreWorkflowVersionSpec,
|
|
309
|
+
impl: async (run, params) => {
|
|
310
|
+
const id = String(params["workflow_id"]);
|
|
311
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
312
|
+
if (!existing)
|
|
313
|
+
return notYours(id);
|
|
314
|
+
const number = versionNumber(params["version"]);
|
|
315
|
+
if (typeof number !== "number")
|
|
316
|
+
return number;
|
|
317
|
+
const { Workflow, WorkflowVersion } = await import("@nodetool-ai/models");
|
|
318
|
+
const version = await WorkflowVersion.findByVersion(id, number);
|
|
319
|
+
if (!version) {
|
|
320
|
+
return {
|
|
321
|
+
error: `Workflow ${id} has no version ${number}. Call list_workflow_versions to see the available ones.`
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const undoVer = await WorkflowVersion.nextVersion(id);
|
|
325
|
+
const undo = (await WorkflowVersion.create({
|
|
326
|
+
workflow_id: id,
|
|
327
|
+
user_id: userIdOf(run.context),
|
|
328
|
+
name: `Before restore to v${number}`,
|
|
329
|
+
description: null,
|
|
330
|
+
graph: existing.graph,
|
|
331
|
+
version: undoVer,
|
|
332
|
+
save_type: "restore"
|
|
333
|
+
}));
|
|
334
|
+
const updated = await Workflow.updateFieldsIfUnchanged(id, existing.updated_at, { graph: version.graph },
|
|
335
|
+
// Whole-graph restore: no unit attribution, diff-based touching.
|
|
336
|
+
{ ops: [{ tool: "restore_version", input: {} }] });
|
|
337
|
+
if (!updated) {
|
|
338
|
+
return {
|
|
339
|
+
error: `Workflow ${id} changed since you read it — read it again and retry.`,
|
|
340
|
+
undo_version: undo.version
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
return {
|
|
344
|
+
ok: true,
|
|
345
|
+
workflow_id: id,
|
|
346
|
+
restored_version: number,
|
|
347
|
+
undo_version: undo.version,
|
|
348
|
+
...workflowRecord(updated)
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
const deleteWorkflowVersion = {
|
|
353
|
+
spec: deleteWorkflowVersionSpec,
|
|
354
|
+
impl: async (run, params) => {
|
|
355
|
+
const id = String(params["workflow_id"]);
|
|
356
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
357
|
+
if (!existing)
|
|
358
|
+
return notYours(id);
|
|
359
|
+
const number = versionNumber(params["version"]);
|
|
360
|
+
if (typeof number !== "number")
|
|
361
|
+
return number;
|
|
362
|
+
const { WorkflowVersion } = await import("@nodetool-ai/models");
|
|
363
|
+
const version = await WorkflowVersion.findByVersion(id, number);
|
|
364
|
+
if (!version) {
|
|
365
|
+
return {
|
|
366
|
+
error: `Workflow ${id} has no version ${number}. Call list_workflow_versions to see the available ones.`
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
await version.delete();
|
|
370
|
+
return {
|
|
371
|
+
ok: true,
|
|
372
|
+
workflow_id: id,
|
|
373
|
+
deleted_version: number
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
const setWorkflowAccess = {
|
|
378
|
+
spec: setWorkflowAccessSpec,
|
|
379
|
+
impl: async (run, params) => {
|
|
380
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
381
|
+
const id = String(params["workflow_id"]);
|
|
382
|
+
const access = params["access"] === "public" ? "public" : "private";
|
|
383
|
+
const existing = await findOwnedWorkflow(run, id);
|
|
384
|
+
if (!existing)
|
|
385
|
+
return notYours(id);
|
|
386
|
+
const updated = await Workflow.updateFieldsIfUnchanged(id, existing.updated_at, { access }, { ops: [{ tool: "set_link", input: { access } }] });
|
|
387
|
+
if (!updated) {
|
|
388
|
+
return {
|
|
389
|
+
error: `Workflow ${id} changed since it was read — retry.`
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
return { workflow_id: id, access };
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const runWorkflowCapability = {
|
|
396
|
+
spec: runWorkflowCapabilitySpec,
|
|
397
|
+
impl: async (run, params) => {
|
|
398
|
+
const env = await runEnvironmentOf(run);
|
|
399
|
+
if (!env)
|
|
400
|
+
return noRegistryError("run a workflow");
|
|
401
|
+
const { runWorkflow } = await import("@nodetool-ai/execution/service");
|
|
402
|
+
const outcome = await runWorkflow({
|
|
403
|
+
workflowId: String(params["workflow_id"]),
|
|
404
|
+
userId: userIdOf(run.context),
|
|
405
|
+
environment: env,
|
|
406
|
+
params: params["params"] ?? {},
|
|
407
|
+
interactive: params["interactive"] === true,
|
|
408
|
+
// A run started from a project's agent thread is that project's spend.
|
|
409
|
+
projectId: run.projectId ?? null
|
|
410
|
+
});
|
|
411
|
+
return annotateEscalatedRun(outcomeResult(outcome));
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
const debugWorkflow = {
|
|
415
|
+
spec: debugWorkflowSpec,
|
|
416
|
+
impl: async (run, params) => {
|
|
417
|
+
const env = await runEnvironmentOf(run);
|
|
418
|
+
if (!env)
|
|
419
|
+
return noRegistryError("debug a workflow");
|
|
420
|
+
const { Job, Workflow } = await import("@nodetool-ai/models");
|
|
421
|
+
const { runWorkflow } = await import("@nodetool-ai/execution/service");
|
|
422
|
+
const workflowId = String(params["workflow_id"]);
|
|
423
|
+
const userId = userIdOf(run.context);
|
|
424
|
+
const includeGraph = params["include_graph"] !== false;
|
|
425
|
+
const outcome = await runWorkflow({
|
|
426
|
+
workflowId,
|
|
427
|
+
userId,
|
|
428
|
+
debug: true,
|
|
429
|
+
environment: env,
|
|
430
|
+
params: params["params"] ?? {},
|
|
431
|
+
interactive: params["interactive"] === true,
|
|
432
|
+
projectId: run.projectId ?? null
|
|
433
|
+
});
|
|
434
|
+
// A run the service refused never started, so there is no report to nest.
|
|
435
|
+
// Nesting it under `run` put the failure where nothing looks: the caller
|
|
436
|
+
// reads a `{workflow_id, run}` record, and the sandbox dispatcher — which
|
|
437
|
+
// throws on a top-level `{error}` so a guest cannot compute with a
|
|
438
|
+
// failure — sees an ordinary object. A 404 came back as a value the guest
|
|
439
|
+
// logged as `Status: 404` and carried on from. `run_workflow` and
|
|
440
|
+
// `start_background_job` already return this at the top level.
|
|
441
|
+
if (outcome.kind !== "payload") {
|
|
442
|
+
return outcomeResult(outcome);
|
|
443
|
+
}
|
|
444
|
+
const result = outcomeResult(outcome);
|
|
445
|
+
// An escalated run has produced no report yet — the job is parked on the
|
|
446
|
+
// failing node. Hand the escalation back for a verdict; the final report
|
|
447
|
+
// arrives from resolve_workflow_escalation once the run settles.
|
|
448
|
+
if (isObjectLike(result) &&
|
|
449
|
+
result["status"] === "escalated") {
|
|
450
|
+
return { workflow_id: workflowId, run: annotateEscalatedRun(result) };
|
|
451
|
+
}
|
|
452
|
+
const report = {
|
|
453
|
+
workflow_id: workflowId,
|
|
454
|
+
run: result
|
|
455
|
+
};
|
|
456
|
+
const jobId = result?.["job_id"];
|
|
457
|
+
if (isString(jobId)) {
|
|
458
|
+
const job = await Job.find(userId, jobId);
|
|
459
|
+
if (job) {
|
|
460
|
+
const logLimit = Number(params["log_limit"] ?? 200);
|
|
461
|
+
const logs = job.logs ?? [];
|
|
462
|
+
report["job"] = {
|
|
463
|
+
...jobRecord(job),
|
|
464
|
+
logs: logs.slice(Math.max(0, logs.length - logLimit))
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (includeGraph) {
|
|
469
|
+
const workflow = await Workflow.find(userId, workflowId);
|
|
470
|
+
if (workflow) {
|
|
471
|
+
report["workflow"] = summarizeWorkflowGraph(workflowRecord(workflow));
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return report;
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
const resolveWorkflowEscalation = {
|
|
478
|
+
spec: resolveWorkflowEscalationSpec,
|
|
479
|
+
impl: async (run, params) => {
|
|
480
|
+
const { submitEscalationVerdict } = await import("@nodetool-ai/execution/service");
|
|
481
|
+
const action = String(params["action"]);
|
|
482
|
+
const verdict = { action };
|
|
483
|
+
if (action === "substitute" && params["outputs"] !== undefined) {
|
|
484
|
+
verdict["outputs"] = params["outputs"];
|
|
485
|
+
}
|
|
486
|
+
if (action === "fail" && isString(params["reason"])) {
|
|
487
|
+
verdict["reason"] = params["reason"];
|
|
488
|
+
}
|
|
489
|
+
if ((action === "skip" || action === "fail") &&
|
|
490
|
+
isString(params["apply_to"])) {
|
|
491
|
+
verdict["applyTo"] = params["apply_to"];
|
|
492
|
+
}
|
|
493
|
+
const outcome = await submitEscalationVerdict(String(params["session_id"]), userIdOf(run.context), String(params["escalation_id"]), verdict);
|
|
494
|
+
return annotateEscalatedRun(outcomeResult(outcome));
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
const validateWorkflow = {
|
|
498
|
+
spec: validateWorkflowSpec,
|
|
499
|
+
impl: async (run, params) => {
|
|
500
|
+
let graph = params["graph"];
|
|
501
|
+
const workflowId = params["workflow_id"];
|
|
502
|
+
const code = isString(params["code"]) ? params["code"] : "";
|
|
503
|
+
// A legacy graph program can be checked in the form it was authored in
|
|
504
|
+
// rather than hand-translated to JSON first.
|
|
505
|
+
if (code.trim()) {
|
|
506
|
+
const { evaluateGraphDsl } = await import("../graph-dsl.js");
|
|
507
|
+
const evaluated = await evaluateGraphDsl(code);
|
|
508
|
+
if (!evaluated.graph) {
|
|
509
|
+
const failure = {
|
|
510
|
+
status: "code_error",
|
|
511
|
+
error: evaluated.error ?? "Program produced no graph."
|
|
512
|
+
};
|
|
513
|
+
if (evaluated.logs?.length)
|
|
514
|
+
failure.logs = evaluated.logs;
|
|
515
|
+
return failure;
|
|
516
|
+
}
|
|
517
|
+
graph = evaluated.graph;
|
|
518
|
+
}
|
|
519
|
+
if (!graph && workflowId) {
|
|
520
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
521
|
+
const workflow = await Workflow.find(userIdOf(run.context), workflowId);
|
|
522
|
+
if (!workflow)
|
|
523
|
+
return { error: `Workflow ${workflowId} was not found.` };
|
|
524
|
+
graph = workflow.getGraph();
|
|
525
|
+
}
|
|
526
|
+
if (!graph || !Array.isArray(graph.nodes)) {
|
|
527
|
+
return {
|
|
528
|
+
error: "No graph to validate — pass a graph program as `code`, an inline `graph` ({nodes, edges}), or a valid `workflow_id`."
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
// `edges` reaches `.map()` inside validateGraph — a non-array would throw a
|
|
532
|
+
// raw TypeError past the tool's structured error shape.
|
|
533
|
+
if (graph.edges !== undefined && !Array.isArray(graph.edges)) {
|
|
534
|
+
return {
|
|
535
|
+
error: "`graph.edges` must be an array of edges ({source, sourceHandle, target, targetHandle})."
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
const registry = run.nodeRegistry;
|
|
539
|
+
if (!registry) {
|
|
540
|
+
// Returning the graph with a note read as a pass to every caller that
|
|
541
|
+
// checks for issues rather than for prose. A validator with no registry
|
|
542
|
+
// cannot validate; say so as an error.
|
|
543
|
+
return {
|
|
544
|
+
error: "Cannot validate: no node registry is available in this process. Run `nodetool validate` from the CLI, or call this tool from a server-side context with a registry.",
|
|
545
|
+
validated: false
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
// The provider and model catalogs are supplied by the run rather than
|
|
549
|
+
// living on NodeRegistry: the registry also runs in the browser, which has
|
|
550
|
+
// neither to reach. Without them `validateGraph` skips the
|
|
551
|
+
// `unknown_provider` and `unknown_model` checks entirely, so a model
|
|
552
|
+
// naming a provider the runtime cannot construct — or an id that provider
|
|
553
|
+
// does not offer — would pass silently on the agent surface, which is
|
|
554
|
+
// exactly where hallucinated ids come from. This capability always runs
|
|
555
|
+
// server-side, so the runtime's own catalogs are the right default.
|
|
556
|
+
const catalogs = run.modelCatalogs ?? RUNTIME_MODEL_CATALOGS;
|
|
557
|
+
// An outgoing edge declares the source's dynamic output handle. The tool
|
|
558
|
+
// path does this in `GraphBuilder`; a graph the DSL pack authors arrives
|
|
559
|
+
// here as data and has never seen one, so the same rule runs on the JSON.
|
|
560
|
+
const declared = declareDynamicOutputsInGraph(graph, registry);
|
|
561
|
+
const { collectSecretRequirementSites, validateGraph } = await import("@nodetool-ai/node-sdk");
|
|
562
|
+
const registryView = {
|
|
563
|
+
has: (type) => registry.has(type),
|
|
564
|
+
getMetadata: (type) => registry.getMetadata(type),
|
|
565
|
+
validateNode: (descriptor, connectedHandles) => registry.validateNode(descriptor, connectedHandles),
|
|
566
|
+
listProviderIds: () => catalogs.listProviderIds(),
|
|
567
|
+
listModelIds: (provider, modelType) => catalogs.listModelIds(provider, modelType),
|
|
568
|
+
listRequiredTextInputs: (provider, modelType, modelId) => catalogs.listRequiredTextInputs?.(provider, modelType, modelId)
|
|
569
|
+
};
|
|
570
|
+
const checked = {
|
|
571
|
+
nodes: declared.nodes,
|
|
572
|
+
edges: (declared.edges ?? [])
|
|
573
|
+
};
|
|
574
|
+
// The credentials the graph's nodes declare are collected first so the
|
|
575
|
+
// host resolves exactly those names — one store round trip per
|
|
576
|
+
// requirement, not one per key it holds. A run with no reachable store
|
|
577
|
+
// carries no resolver and the check is skipped: reporting every declared
|
|
578
|
+
// key as missing because nothing could answer is the false alarm this
|
|
579
|
+
// whole path fails toward silence to avoid.
|
|
580
|
+
let availableSecrets;
|
|
581
|
+
if (run.availableSecrets) {
|
|
582
|
+
const sites = collectSecretRequirementSites(checked, registryView);
|
|
583
|
+
if (sites.length > 0) {
|
|
584
|
+
availableSecrets = await run.availableSecrets(sites.map((site) => site.key));
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
const report = validateGraph(checked, registryView, { availableSecrets });
|
|
588
|
+
return await withSecretRemediation(run, report);
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Tell the agent what to do about a `missing_secret` warning.
|
|
593
|
+
*
|
|
594
|
+
* The validator says a key is missing; only the run knows how this agent can
|
|
595
|
+
* get one set. Settings → Credentials is always the answer a person can act
|
|
596
|
+
* on; `request_secret` is added only where this run can actually serve it —
|
|
597
|
+
* it needs the capability *and* a host that can raise the dialog, and a
|
|
598
|
+
* headless run has neither, so naming it there sends the agent at a call that
|
|
599
|
+
* fails closed.
|
|
600
|
+
*/
|
|
601
|
+
async function withSecretRemediation(run, report) {
|
|
602
|
+
if (!report.issues.some((issue) => issue.code === "missing_secret")) {
|
|
603
|
+
return report;
|
|
604
|
+
}
|
|
605
|
+
const canAsk = run.secretPrompt !== undefined &&
|
|
606
|
+
(await findCapability(REQUEST_SECRET_TOOL_NAME)) !== undefined;
|
|
607
|
+
const remediation = canAsk
|
|
608
|
+
? "Ask the user to set it in Settings → Credentials, or call " +
|
|
609
|
+
`\`${REQUEST_SECRET_TOOL_NAME}\` to have them enter it now.`
|
|
610
|
+
: "Ask the user to set it in Settings → Credentials.";
|
|
611
|
+
return {
|
|
612
|
+
...report,
|
|
613
|
+
issues: report.issues.map((issue) => issue.code === "missing_secret"
|
|
614
|
+
? { ...issue, message: `${issue.message} ${remediation}` }
|
|
615
|
+
: issue)
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
// ---------------------------------------------------------------------------
|
|
619
|
+
// start_background_job
|
|
620
|
+
// ---------------------------------------------------------------------------
|
|
621
|
+
const startBackgroundJob = {
|
|
622
|
+
spec: startBackgroundJobSpec,
|
|
623
|
+
impl: async (run, params) => {
|
|
624
|
+
const env = await runEnvironmentOf(run);
|
|
625
|
+
if (!env)
|
|
626
|
+
return noRegistryError("start a background job");
|
|
627
|
+
const { runWorkflow } = await import("@nodetool-ai/execution/service");
|
|
628
|
+
const outcome = await runWorkflow({
|
|
629
|
+
workflowId: String(params["workflow_id"]),
|
|
630
|
+
userId: userIdOf(run.context),
|
|
631
|
+
environment: env,
|
|
632
|
+
params: params["params"] ?? {},
|
|
633
|
+
background: true,
|
|
634
|
+
projectId: run.projectId ?? null
|
|
635
|
+
});
|
|
636
|
+
return outcomeResult(outcome);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
639
|
+
// ---------------------------------------------------------------------------
|
|
640
|
+
// get_example_workflow
|
|
641
|
+
// ---------------------------------------------------------------------------
|
|
642
|
+
const getExampleWorkflow = {
|
|
643
|
+
spec: getExampleWorkflowSpec,
|
|
644
|
+
impl: async (run, params) => {
|
|
645
|
+
if (!run.examples)
|
|
646
|
+
return NO_EXAMPLES;
|
|
647
|
+
const packageName = String(params["package_name"]);
|
|
648
|
+
const exampleName = String(params["example_name"]);
|
|
649
|
+
const example = await run.examples.get(packageName, exampleName);
|
|
650
|
+
return (example ?? {
|
|
651
|
+
error: `No example named "${exampleName}" in package "${packageName}".`
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
};
|
|
655
|
+
// ---------------------------------------------------------------------------
|
|
656
|
+
// export_workflow_digraph
|
|
657
|
+
// ---------------------------------------------------------------------------
|
|
658
|
+
const exportWorkflowDigraph = {
|
|
659
|
+
spec: exportWorkflowDigraphSpec,
|
|
660
|
+
// `workflowToDsl` lives in `@nodetool-ai/dsl`, which sits above this package
|
|
661
|
+
// in the dependency order, so the exporter rides on the run rather than
|
|
662
|
+
// being imported.
|
|
663
|
+
impl: async (run, params) => {
|
|
664
|
+
const exportDsl = run.exportDsl;
|
|
665
|
+
if (!exportDsl) {
|
|
666
|
+
return {
|
|
667
|
+
error: "Cannot export: no DSL exporter is available in this process. Run " +
|
|
668
|
+
"`nodetool workflows export-dsl` from the CLI instead."
|
|
669
|
+
};
|
|
670
|
+
}
|
|
671
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
672
|
+
const workflowId = String(params["workflow_id"]);
|
|
673
|
+
const workflow = await Workflow.find(userIdOf(run.context), workflowId);
|
|
674
|
+
if (!workflow)
|
|
675
|
+
return { error: `Workflow ${workflowId} was not found.` };
|
|
676
|
+
if (!workflow.graph)
|
|
677
|
+
return { error: "Workflow has no graph to export." };
|
|
678
|
+
try {
|
|
679
|
+
return {
|
|
680
|
+
workflow_id: workflowId,
|
|
681
|
+
source: exportDsl(workflow.graph, { workflowName: workflow.name })
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
catch (error) {
|
|
685
|
+
return {
|
|
686
|
+
error: error instanceof Error ? error.message : String(error)
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
// ── Guided setup (PRD § 11.6) ────────────────────────────────────────────────
|
|
692
|
+
//
|
|
693
|
+
// The headless half of the Workflow creation flow: write the setup answers,
|
|
694
|
+
// plan the steps, edit one step, build the graph from the plan. The browser
|
|
695
|
+
// drives the same four through `ui_workflow_set_setup`, `ui_workflow_plan`,
|
|
696
|
+
// `ui_workflow_update_plan_step` and `ui_workflow_build_from_plan`, and both
|
|
697
|
+
// halves share the planner contract and the plan→graph builder in
|
|
698
|
+
// `@nodetool-ai/protocol`, so a plan built here places the nodes the editor
|
|
699
|
+
// would have placed.
|
|
700
|
+
//
|
|
701
|
+
// Two rules carry the phase and both are asserted:
|
|
702
|
+
//
|
|
703
|
+
// - `plan_workflow` places no node (criterion 3). It writes text and nothing
|
|
704
|
+
// else.
|
|
705
|
+
// - `build_workflow_from_plan` refuses a plan that still names an unknown node
|
|
706
|
+
// type or an unavailable model role (D23), and reports the wiring it could
|
|
707
|
+
// not do rather than reporting a graph that validates and produces nothing
|
|
708
|
+
// (R6).
|
|
709
|
+
/** How many candidate node types the planner prompt lists. */
|
|
710
|
+
const CANDIDATE_LIMIT = 60;
|
|
711
|
+
/**
|
|
712
|
+
* Which model role each provider capability answers. Read to decide whether a
|
|
713
|
+
* step's role is covered — the same question the review step's amber marker
|
|
714
|
+
* asks in the browser (D23).
|
|
715
|
+
*/
|
|
716
|
+
const ROLE_CAPABILITY = {
|
|
717
|
+
language: "generate_message",
|
|
718
|
+
image: "text_to_image",
|
|
719
|
+
video: "text_to_video",
|
|
720
|
+
audio: "text_to_speech"
|
|
721
|
+
};
|
|
722
|
+
async function loadOwned(run, id) {
|
|
723
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
724
|
+
const row = (await Workflow.get(id));
|
|
725
|
+
if (!row || row.user_id !== userIdOf(run.context)) {
|
|
726
|
+
return { error: `Workflow ${id} was not found, or it is not yours.` };
|
|
727
|
+
}
|
|
728
|
+
return { row, setup: readWorkflowSetup(row.settings) };
|
|
729
|
+
}
|
|
730
|
+
const isError = (value) => isObjectLike(value) && isString(value.error);
|
|
731
|
+
/** Write a setup patch back onto the row, leaving the rest of `settings` alone. */
|
|
732
|
+
async function persistSetup(row, patch, extra = {}) {
|
|
733
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
734
|
+
const fields = {
|
|
735
|
+
settings: writeWorkflowSetup(row.settings, patch)
|
|
736
|
+
};
|
|
737
|
+
if (extra.graph !== undefined) {
|
|
738
|
+
fields.graph = extra.graph;
|
|
739
|
+
}
|
|
740
|
+
const updated = await Workflow.updateFieldsIfUnchanged(row.id, row.updated_at, fields);
|
|
741
|
+
if (!updated) {
|
|
742
|
+
return {
|
|
743
|
+
error: `Workflow ${row.id} changed since you read it — read it again and retry.`
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
return updated;
|
|
747
|
+
}
|
|
748
|
+
/** The plan on the row, or the reason there is none to act on. */
|
|
749
|
+
function requirePlan(setup) {
|
|
750
|
+
const plan = setup?.plan;
|
|
751
|
+
if (!plan) {
|
|
752
|
+
return {
|
|
753
|
+
error: "This workflow has no plan yet. Run plan_workflow first, or store one with plan_workflow's `plan` argument."
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
return plan;
|
|
757
|
+
}
|
|
758
|
+
/** Grade a plan against the live registry and this install's providers. */
|
|
759
|
+
async function reviewPlan(run, plan) {
|
|
760
|
+
const registry = run.nodeRegistry;
|
|
761
|
+
const providers = run.providers ?? {};
|
|
762
|
+
const { providerCapabilities } = await import("@nodetool-ai/runtime");
|
|
763
|
+
const capabilities = new Set();
|
|
764
|
+
for (const provider of Object.values(providers)) {
|
|
765
|
+
for (const capability of providerCapabilities(provider)) {
|
|
766
|
+
capabilities.add(capability);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
return resolveWorkflowPlan(plan, {
|
|
770
|
+
// With no registry nothing can be confirmed, so every step reads unknown
|
|
771
|
+
// and the build is blocked — the same answer validate_workflow gives.
|
|
772
|
+
knownNodeType: (type) => registry?.has(type) === true,
|
|
773
|
+
providerConfigured: (role) => {
|
|
774
|
+
const capability = ROLE_CAPABILITY[role];
|
|
775
|
+
// A role nothing maps to is not a provider question; do not block on it.
|
|
776
|
+
if (capability === undefined)
|
|
777
|
+
return true;
|
|
778
|
+
return capabilities.size === 0 ? false : capabilities.has(capability);
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
/** Shape the review into the marker list the caller renders (D23). */
|
|
783
|
+
function reviewReport(resolved) {
|
|
784
|
+
return {
|
|
785
|
+
can_continue: resolved.canContinue,
|
|
786
|
+
missing_roles: resolved.missingRoles,
|
|
787
|
+
steps: resolved.steps.map((entry) => ({
|
|
788
|
+
id: entry.step.id,
|
|
789
|
+
title: entry.step.title,
|
|
790
|
+
summary: entry.step.summary,
|
|
791
|
+
node_type: entry.step.node_type,
|
|
792
|
+
model_role: entry.step.model_role ?? null,
|
|
793
|
+
unknown_node_type: entry.unknownNodeType,
|
|
794
|
+
missing_provider: entry.missingProvider,
|
|
795
|
+
block: entry.block
|
|
796
|
+
}))
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
/** The registry lookup the builder wires from. */
|
|
800
|
+
function registryLookup(registry) {
|
|
801
|
+
return (nodeType) => {
|
|
802
|
+
const meta = registry.getMetadata(nodeType);
|
|
803
|
+
return meta ? planNodeShape(meta) : null;
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* A placement as a workflow graph. The Workflow flow's build and the Game
|
|
808
|
+
* flow's build write the same node shape, so one function answers both — a
|
|
809
|
+
* second copy is how `setup_step_id` or `dynamic_properties` goes missing on
|
|
810
|
+
* one of them.
|
|
811
|
+
*/
|
|
812
|
+
function placementToGraph(placement) {
|
|
813
|
+
return {
|
|
814
|
+
nodes: placement.nodes.map((node) => ({
|
|
815
|
+
id: node.id,
|
|
816
|
+
type: node.type,
|
|
817
|
+
data: node.properties,
|
|
818
|
+
ui_properties: { position: node.position, setup_step_id: node.setupStepId },
|
|
819
|
+
dynamic_properties: node.dynamicProperties ?? {},
|
|
820
|
+
dynamic_outputs: {}
|
|
821
|
+
})),
|
|
822
|
+
edges: placement.edges.map((edge, index) => ({
|
|
823
|
+
id: `e${index + 1}`,
|
|
824
|
+
source: edge.source,
|
|
825
|
+
sourceHandle: edge.sourceHandle,
|
|
826
|
+
target: edge.target,
|
|
827
|
+
targetHandle: edge.targetHandle
|
|
828
|
+
}))
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
// ── set_workflow_setup ──────────────────────────────────────────────────────
|
|
832
|
+
const setWorkflowSetup = {
|
|
833
|
+
spec: setWorkflowSetupSpec,
|
|
834
|
+
impl: async (run, params) => {
|
|
835
|
+
const id = String(params["workflow_id"]);
|
|
836
|
+
const owned = await loadOwned(run, id);
|
|
837
|
+
if (isError(owned))
|
|
838
|
+
return owned;
|
|
839
|
+
const patch = {};
|
|
840
|
+
if (isString(params["brief"]))
|
|
841
|
+
patch.brief = params["brief"];
|
|
842
|
+
if (isString(params["category"]))
|
|
843
|
+
patch.category = params["category"];
|
|
844
|
+
if (isString(params["run_mode"])) {
|
|
845
|
+
patch.run_mode = params["run_mode"];
|
|
846
|
+
}
|
|
847
|
+
if (isString(params["stage"])) {
|
|
848
|
+
patch.stage = params["stage"];
|
|
849
|
+
}
|
|
850
|
+
if (Object.keys(patch).length === 0) {
|
|
851
|
+
return {
|
|
852
|
+
error: "Nothing to set — pass brief, category, run_mode or stage."
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
const saved = await persistSetup(owned.row, patch);
|
|
856
|
+
if (isError(saved))
|
|
857
|
+
return saved;
|
|
858
|
+
return { workflow_id: id, setup: readWorkflowSetup(saved.settings) };
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
// ── plan_workflow ───────────────────────────────────────────────────────────
|
|
862
|
+
/** Candidate node types for the planner prompt, ranked against the brief. */
|
|
863
|
+
function candidateLines(registry, terms) {
|
|
864
|
+
const ranked = registry.searchMetadata(terms).slice(0, CANDIDATE_LIMIT);
|
|
865
|
+
return ranked.map((entry) => `- ${entry.meta.node_type}: ${entry.meta.title} — ${entry.meta.description.split("\n")[0]}`);
|
|
866
|
+
}
|
|
867
|
+
const planWorkflow = {
|
|
868
|
+
spec: planWorkflowSpec,
|
|
869
|
+
impl: async (run, params) => {
|
|
870
|
+
const id = String(params["workflow_id"]);
|
|
871
|
+
const owned = await loadOwned(run, id);
|
|
872
|
+
if (isError(owned))
|
|
873
|
+
return owned;
|
|
874
|
+
const brief = owned.setup?.brief?.trim() ?? "";
|
|
875
|
+
const supplied = params["plan"];
|
|
876
|
+
let plan = null;
|
|
877
|
+
if (supplied !== undefined) {
|
|
878
|
+
// A plan handed in replaces the model call outright: it is how a harness
|
|
879
|
+
// case and a replay reach the builder with no provider at all.
|
|
880
|
+
const parsed = workflowSetupPlan.safeParse(parseWorkflowPlan(supplied) ?? supplied);
|
|
881
|
+
if (!parsed.success) {
|
|
882
|
+
return { error: "`plan` is not a plan ({inputs, steps, outputs})." };
|
|
883
|
+
}
|
|
884
|
+
plan = parsed.data;
|
|
885
|
+
}
|
|
886
|
+
else {
|
|
887
|
+
if (brief.length === 0) {
|
|
888
|
+
return {
|
|
889
|
+
error: "This workflow has no brief, so there is nothing to plan. Write one with set_workflow_setup first."
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
const registry = run.nodeRegistry;
|
|
893
|
+
if (!registry) {
|
|
894
|
+
return {
|
|
895
|
+
error: "Cannot plan: no node registry is available in this process, so no step could name a node type that exists."
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
const provider = isString(params["provider"]) ? params["provider"] : "";
|
|
899
|
+
const model = isString(params["model"]) ? params["model"] : "";
|
|
900
|
+
if (provider.length === 0 || model.length === 0) {
|
|
901
|
+
return {
|
|
902
|
+
error: "Pass provider and model to plan, or pass a `plan` to store without calling one."
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
const { generateStructured } = await import("@nodetool-ai/runtime");
|
|
906
|
+
const category = owned.setup?.category ?? "";
|
|
907
|
+
const terms = brief
|
|
908
|
+
.split(/\s+/)
|
|
909
|
+
.filter((term) => term.length > 2);
|
|
910
|
+
const candidates = candidateLines(registry, terms);
|
|
911
|
+
const raw = await generateStructured(await run.context.getProvider(provider), {
|
|
912
|
+
model,
|
|
913
|
+
maxTokens: 4096,
|
|
914
|
+
messages: [
|
|
915
|
+
{ role: "system", content: WORKFLOW_PLANNER_SYSTEM_PROMPT },
|
|
916
|
+
{
|
|
917
|
+
role: "user",
|
|
918
|
+
content: [
|
|
919
|
+
`Task: ${brief}`,
|
|
920
|
+
category ? `Kind of workflow: ${category}` : "",
|
|
921
|
+
"",
|
|
922
|
+
"Candidate node types:",
|
|
923
|
+
...candidates
|
|
924
|
+
]
|
|
925
|
+
.filter((line) => line !== "")
|
|
926
|
+
.join("\n")
|
|
927
|
+
}
|
|
928
|
+
],
|
|
929
|
+
toolName: WORKFLOW_PLAN_TOOL_NAME,
|
|
930
|
+
toolDescription: WORKFLOW_PLAN_TOOL_DESCRIPTION,
|
|
931
|
+
schema: buildWorkflowPlanSchema()
|
|
932
|
+
});
|
|
933
|
+
plan = parseWorkflowPlan(raw);
|
|
934
|
+
if (!plan) {
|
|
935
|
+
return { error: "The planner did not return a plan." };
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
// Nothing below places a node — criterion 3. The plan is text on the row.
|
|
939
|
+
const saved = await persistSetup(owned.row, { plan, stage: "review" });
|
|
940
|
+
if (isError(saved))
|
|
941
|
+
return saved;
|
|
942
|
+
const resolved = await reviewPlan(run, plan);
|
|
943
|
+
return {
|
|
944
|
+
workflow_id: id,
|
|
945
|
+
stage: "review",
|
|
946
|
+
plan,
|
|
947
|
+
review: reviewReport(resolved),
|
|
948
|
+
nodes_placed: 0
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
// ── update_workflow_plan_step ───────────────────────────────────────────────
|
|
953
|
+
const updateWorkflowPlanStep = {
|
|
954
|
+
spec: updateWorkflowPlanStepSpec,
|
|
955
|
+
impl: async (run, params) => {
|
|
956
|
+
const id = String(params["workflow_id"]);
|
|
957
|
+
const owned = await loadOwned(run, id);
|
|
958
|
+
if (isError(owned))
|
|
959
|
+
return owned;
|
|
960
|
+
const plan = requirePlan(owned.setup);
|
|
961
|
+
if (isError(plan))
|
|
962
|
+
return plan;
|
|
963
|
+
const op = isString(params["op"]) ? params["op"] : "update";
|
|
964
|
+
const stepId = isString(params["step_id"]) ? params["step_id"] : null;
|
|
965
|
+
const steps = [...plan.steps];
|
|
966
|
+
const at = stepId === null ? -1 : steps.findIndex((s) => s.id === stepId);
|
|
967
|
+
if (op !== "add" && at === -1) {
|
|
968
|
+
return {
|
|
969
|
+
error: `No plan step "${stepId ?? ""}". The step ids are: ${steps
|
|
970
|
+
.map((step) => step.id)
|
|
971
|
+
.join(", ")}.`
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
const fields = {};
|
|
975
|
+
if (isString(params["title"]))
|
|
976
|
+
fields.title = params["title"];
|
|
977
|
+
if (isString(params["summary"]))
|
|
978
|
+
fields.summary = params["summary"];
|
|
979
|
+
if (params["node_type"] !== undefined) {
|
|
980
|
+
fields.node_type = isString(params["node_type"])
|
|
981
|
+
? params["node_type"]
|
|
982
|
+
: null;
|
|
983
|
+
}
|
|
984
|
+
if (isString(params["model_role"])) {
|
|
985
|
+
fields.model_role = params["model_role"];
|
|
986
|
+
}
|
|
987
|
+
if (op === "remove") {
|
|
988
|
+
steps.splice(at, 1);
|
|
989
|
+
}
|
|
990
|
+
else if (op === "move") {
|
|
991
|
+
if (!isNumber(params["index"])) {
|
|
992
|
+
return { error: "op 'move' needs an `index`." };
|
|
993
|
+
}
|
|
994
|
+
const [moved] = steps.splice(at, 1);
|
|
995
|
+
steps.splice(Math.max(0, Math.min(steps.length, params["index"])), 0, moved);
|
|
996
|
+
}
|
|
997
|
+
else if (op === "add") {
|
|
998
|
+
const added = {
|
|
999
|
+
id: stepId ?? `step-${steps.length + 1}`,
|
|
1000
|
+
title: fields.title ?? "New step",
|
|
1001
|
+
summary: fields.summary ?? "",
|
|
1002
|
+
node_type: fields.node_type ?? null
|
|
1003
|
+
};
|
|
1004
|
+
if (fields.model_role !== undefined) {
|
|
1005
|
+
added.model_role = fields.model_role;
|
|
1006
|
+
}
|
|
1007
|
+
steps.splice(isNumber(params["index"])
|
|
1008
|
+
? Math.max(0, Math.min(steps.length, params["index"]))
|
|
1009
|
+
: steps.length, 0, added);
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
steps[at] = { ...steps[at], ...fields };
|
|
1013
|
+
}
|
|
1014
|
+
const next = workflowSetupPlan.parse({ ...plan, steps });
|
|
1015
|
+
const saved = await persistSetup(owned.row, { plan: next });
|
|
1016
|
+
if (isError(saved))
|
|
1017
|
+
return saved;
|
|
1018
|
+
const resolved = await reviewPlan(run, next);
|
|
1019
|
+
return { workflow_id: id, plan: next, review: reviewReport(resolved) };
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
// ── build_workflow_from_plan ────────────────────────────────────────────────
|
|
1023
|
+
const buildWorkflowFromPlan = {
|
|
1024
|
+
spec: buildWorkflowFromPlanSpec,
|
|
1025
|
+
impl: async (run, params) => {
|
|
1026
|
+
const id = String(params["workflow_id"]);
|
|
1027
|
+
const owned = await loadOwned(run, id);
|
|
1028
|
+
if (isError(owned))
|
|
1029
|
+
return owned;
|
|
1030
|
+
const plan = requirePlan(owned.setup);
|
|
1031
|
+
if (isError(plan))
|
|
1032
|
+
return plan;
|
|
1033
|
+
const registry = run.nodeRegistry;
|
|
1034
|
+
if (!registry) {
|
|
1035
|
+
return {
|
|
1036
|
+
built: false,
|
|
1037
|
+
submitted: false,
|
|
1038
|
+
verified_result: false,
|
|
1039
|
+
error: "Cannot build: no node registry is available in this process, so no node type could be resolved."
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
// D23: an unknown type blocks the build, and names itself.
|
|
1043
|
+
const resolved = await reviewPlan(run, plan);
|
|
1044
|
+
const unknown = resolved.steps.filter((entry) => entry.unknownNodeType);
|
|
1045
|
+
if (unknown.length > 0) {
|
|
1046
|
+
return {
|
|
1047
|
+
built: false,
|
|
1048
|
+
submitted: false,
|
|
1049
|
+
verified_result: false,
|
|
1050
|
+
error: "Every step must name a node type the registry has before the graph is built. " +
|
|
1051
|
+
`Unresolved: ${unknown
|
|
1052
|
+
.map((entry) => `${entry.step.id} (${entry.step.node_type ?? "no type"})`)
|
|
1053
|
+
.join(", ")}. Fix them with update_workflow_plan_step.`,
|
|
1054
|
+
review: reviewReport(resolved)
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
if (resolved.missingRoles.length > 0) {
|
|
1058
|
+
return {
|
|
1059
|
+
built: false,
|
|
1060
|
+
submitted: false,
|
|
1061
|
+
verified_result: false,
|
|
1062
|
+
error: "Cannot build until every model role is available in this install. " +
|
|
1063
|
+
`Missing provider roles: ${resolved.missingRoles.join(", ")}. ` +
|
|
1064
|
+
"Configure a provider or choose a different model role.",
|
|
1065
|
+
review: reviewReport(resolved)
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
const placement = planToPlacement(plan, registryLookup(registry));
|
|
1069
|
+
const graph = placementToGraph(placement);
|
|
1070
|
+
const validation = await validateBuiltGraph(run, graph);
|
|
1071
|
+
const save = params["save"] !== false;
|
|
1072
|
+
let savedRow = null;
|
|
1073
|
+
if (save) {
|
|
1074
|
+
const written = await persistSetup(owned.row, { stage: "done" }, { graph: graph });
|
|
1075
|
+
if (isError(written))
|
|
1076
|
+
return written;
|
|
1077
|
+
savedRow = written;
|
|
1078
|
+
}
|
|
1079
|
+
return {
|
|
1080
|
+
workflow_id: id,
|
|
1081
|
+
built: true,
|
|
1082
|
+
submitted: savedRow !== null,
|
|
1083
|
+
verified_result: false,
|
|
1084
|
+
saved: savedRow !== null,
|
|
1085
|
+
stage: save ? "done" : owned.setup?.stage ?? "setup",
|
|
1086
|
+
graph,
|
|
1087
|
+
/** Plan input name → the sample a test run should send. */
|
|
1088
|
+
sample_inputs: Object.fromEntries(plan.inputs.map((input) => [
|
|
1089
|
+
input.name,
|
|
1090
|
+
input.sample ?? ""
|
|
1091
|
+
])),
|
|
1092
|
+
/**
|
|
1093
|
+
* What the builder could not wire. Empty is the only value that means the
|
|
1094
|
+
* graph does what the plan described — a validated graph with issues here
|
|
1095
|
+
* is exactly the R6 failure: it runs and produces nothing.
|
|
1096
|
+
*/
|
|
1097
|
+
issues: placement.issues,
|
|
1098
|
+
validation
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
};
|
|
1102
|
+
/** Run the same static checks `validate_workflow` runs, on a built graph. */
|
|
1103
|
+
async function validateBuiltGraph(run, graph) {
|
|
1104
|
+
return validateWorkflow.impl(run, { graph });
|
|
1105
|
+
}
|
|
1106
|
+
async function loadOwnedGame(run, id) {
|
|
1107
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
1108
|
+
const row = (await Workflow.get(id));
|
|
1109
|
+
if (!row || row.user_id !== userIdOf(run.context)) {
|
|
1110
|
+
return { error: `Workflow ${id} was not found, or it is not yours.` };
|
|
1111
|
+
}
|
|
1112
|
+
return { row, game: readGameSetup(row.settings) };
|
|
1113
|
+
}
|
|
1114
|
+
/** Write a game patch back onto the row, leaving the rest of `settings` alone. */
|
|
1115
|
+
async function persistGame(row, patch, extra = {}) {
|
|
1116
|
+
const { Workflow } = await import("@nodetool-ai/models");
|
|
1117
|
+
const fields = {
|
|
1118
|
+
settings: writeGameSetup(row.settings, patch)
|
|
1119
|
+
};
|
|
1120
|
+
if (extra.graph !== undefined) {
|
|
1121
|
+
fields.graph = extra.graph;
|
|
1122
|
+
}
|
|
1123
|
+
if (extra.workspaceId !== undefined) {
|
|
1124
|
+
fields.workspace_id = extra.workspaceId;
|
|
1125
|
+
}
|
|
1126
|
+
const updated = await Workflow.updateFieldsIfUnchanged(row.id, row.updated_at, fields);
|
|
1127
|
+
if (!updated) {
|
|
1128
|
+
return {
|
|
1129
|
+
error: `Workflow ${row.id} changed since you read it — read it again and retry.`
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
return updated;
|
|
1133
|
+
}
|
|
1134
|
+
/** The template's manifest, or the reason there is none to work from. */
|
|
1135
|
+
async function requireGameTemplate(game) {
|
|
1136
|
+
const id = game?.template?.trim() ?? "";
|
|
1137
|
+
if (id === "") {
|
|
1138
|
+
return {
|
|
1139
|
+
error: "This workflow has no native game template yet. Pick topdown with set_game_setup."
|
|
1140
|
+
};
|
|
1141
|
+
}
|
|
1142
|
+
const { getNativeTemplate, listNativeTemplates } = await import("@nodetool-ai/game-nodes");
|
|
1143
|
+
try {
|
|
1144
|
+
return getNativeTemplate(id);
|
|
1145
|
+
}
|
|
1146
|
+
catch {
|
|
1147
|
+
return {
|
|
1148
|
+
error: `Unknown template ${id}. Templates: ${listNativeTemplates()
|
|
1149
|
+
.map((t) => t.id)
|
|
1150
|
+
.join(", ")}.`
|
|
1151
|
+
};
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
/** `provider:model_id` as the model value a node's model prop takes. */
|
|
1155
|
+
function modelValue(tileId, type) {
|
|
1156
|
+
const at = tileId.indexOf(":");
|
|
1157
|
+
if (at <= 0 || at === tileId.length - 1)
|
|
1158
|
+
return null;
|
|
1159
|
+
const provider = tileId.slice(0, at);
|
|
1160
|
+
const id = tileId.slice(at + 1);
|
|
1161
|
+
return { type, provider, id, name: id, path: null };
|
|
1162
|
+
}
|
|
1163
|
+
/** The style entity's name and descriptor, read off the library row. */
|
|
1164
|
+
async function loadStyle(run, entityId) {
|
|
1165
|
+
if (!entityId)
|
|
1166
|
+
return null;
|
|
1167
|
+
const { Asset } = await import("@nodetool-ai/models");
|
|
1168
|
+
const asset = await Asset.find(userIdOf(run.context), entityId);
|
|
1169
|
+
const marker = readEntityMarker(asset?.metadata ?? null);
|
|
1170
|
+
if (!marker || marker.kind !== "style")
|
|
1171
|
+
return null;
|
|
1172
|
+
const style = { name: marker.name, descriptor: marker.descriptor };
|
|
1173
|
+
const referenceAssetId = marker.reference_asset_id ??
|
|
1174
|
+
(asset?.content_type.startsWith("image/") ? asset.id : undefined);
|
|
1175
|
+
if (referenceAssetId)
|
|
1176
|
+
style.referenceAssetId = referenceAssetId;
|
|
1177
|
+
return style;
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* What the Look step's `Continue` is blocked on (criterion 4): every cast
|
|
1181
|
+
* entry named and described, every slot prompt written.
|
|
1182
|
+
*/
|
|
1183
|
+
function designGaps(design) {
|
|
1184
|
+
const gaps = [];
|
|
1185
|
+
for (const member of design.cast) {
|
|
1186
|
+
if (member.name.trim() === "") {
|
|
1187
|
+
gaps.push(`cast "${member.slot_id}" has no name`);
|
|
1188
|
+
}
|
|
1189
|
+
if (member.descriptor.trim() === "") {
|
|
1190
|
+
gaps.push(`cast "${member.slot_id}" has no descriptor`);
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
for (const entry of design.slot_prompts) {
|
|
1194
|
+
if (entry.prompt.trim() === "") {
|
|
1195
|
+
gaps.push(`slot "${entry.slot_id}" has no prompt`);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return gaps;
|
|
1199
|
+
}
|
|
1200
|
+
// ── set_game_setup ──────────────────────────────────────────────────────────
|
|
1201
|
+
const SET_GAME_STRING_FIELDS = [
|
|
1202
|
+
"brief",
|
|
1203
|
+
"template",
|
|
1204
|
+
"style_entity_id",
|
|
1205
|
+
"image_model",
|
|
1206
|
+
"sfx_node_type",
|
|
1207
|
+
"music_model",
|
|
1208
|
+
"project_name",
|
|
1209
|
+
"game_id",
|
|
1210
|
+
"stage"
|
|
1211
|
+
];
|
|
1212
|
+
const setGameSetup = {
|
|
1213
|
+
spec: setGameSetupSpec,
|
|
1214
|
+
impl: async (run, params) => {
|
|
1215
|
+
const id = String(params["workflow_id"]);
|
|
1216
|
+
const owned = await loadOwnedGame(run, id);
|
|
1217
|
+
if (isError(owned))
|
|
1218
|
+
return owned;
|
|
1219
|
+
const patch = {};
|
|
1220
|
+
for (const field of SET_GAME_STRING_FIELDS) {
|
|
1221
|
+
if (isString(params[field]))
|
|
1222
|
+
patch[field] = params[field];
|
|
1223
|
+
}
|
|
1224
|
+
if (Object.keys(patch).length === 0) {
|
|
1225
|
+
return {
|
|
1226
|
+
error: "Nothing to set — pass brief, template, style_entity_id, image_model, sfx_node_type, music_model, project_name or stage."
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
const saved = await persistGame(owned.row, patch);
|
|
1230
|
+
if (isError(saved))
|
|
1231
|
+
return saved;
|
|
1232
|
+
return { workflow_id: id, game: readGameSetup(saved.settings) };
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
// ── design_game ─────────────────────────────────────────────────────────────
|
|
1236
|
+
const designGame = {
|
|
1237
|
+
spec: designGameSpec,
|
|
1238
|
+
impl: async (run, params) => {
|
|
1239
|
+
const id = String(params["workflow_id"]);
|
|
1240
|
+
const owned = await loadOwnedGame(run, id);
|
|
1241
|
+
if (isError(owned))
|
|
1242
|
+
return owned;
|
|
1243
|
+
const template = await requireGameTemplate(owned.game);
|
|
1244
|
+
if (isError(template))
|
|
1245
|
+
return template;
|
|
1246
|
+
const brief = owned.game?.brief?.trim() ?? "";
|
|
1247
|
+
const supplied = params["design"];
|
|
1248
|
+
const provider = isString(params["provider"]) ? params["provider"] : "";
|
|
1249
|
+
const model = isString(params["model"]) ? params["model"] : "";
|
|
1250
|
+
let raw;
|
|
1251
|
+
if (supplied !== undefined) {
|
|
1252
|
+
raw = supplied;
|
|
1253
|
+
}
|
|
1254
|
+
else if (provider.length > 0 && model.length > 0) {
|
|
1255
|
+
if (brief.length === 0) {
|
|
1256
|
+
return {
|
|
1257
|
+
error: "This workflow has no game brief, so there is nothing to design. Write one with set_game_setup first."
|
|
1258
|
+
};
|
|
1259
|
+
}
|
|
1260
|
+
const { generateStructured } = await import("@nodetool-ai/runtime");
|
|
1261
|
+
raw = await generateStructured(await run.context.getProvider(provider), {
|
|
1262
|
+
model,
|
|
1263
|
+
maxTokens: 4096,
|
|
1264
|
+
messages: [
|
|
1265
|
+
{ role: "system", content: GAME_DESIGNER_SYSTEM_PROMPT },
|
|
1266
|
+
{
|
|
1267
|
+
role: "user",
|
|
1268
|
+
content: [
|
|
1269
|
+
`Brief: ${brief}`,
|
|
1270
|
+
`Template: ${template.id}`,
|
|
1271
|
+
"",
|
|
1272
|
+
"Asset manifest:",
|
|
1273
|
+
JSON.stringify(template.manifest.slots, null, 2)
|
|
1274
|
+
].join("\n")
|
|
1275
|
+
}
|
|
1276
|
+
],
|
|
1277
|
+
toolName: GAME_DESIGN_TOOL_NAME,
|
|
1278
|
+
toolDescription: GAME_DESIGN_TOOL_DESCRIPTION,
|
|
1279
|
+
schema: buildGameDesignSchema(template.manifest)
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
// No model: the shipped chip whose brief this is carries a pinned design,
|
|
1284
|
+
// so a keyless install still reaches the review step.
|
|
1285
|
+
const chip = GAME_INSPIRATION_CHIPS.find((entry) => entry.template === template.id &&
|
|
1286
|
+
entry.brief.trim().toLowerCase() === brief.toLowerCase());
|
|
1287
|
+
if (!chip) {
|
|
1288
|
+
return {
|
|
1289
|
+
error: "Pass provider and model to design, or pass a `design` to store without calling one. " +
|
|
1290
|
+
`Without either, only a shipped inspiration chip's brief designs: ${GAME_INSPIRATION_CHIPS.map((entry) => `"${entry.brief}"`).join(", ")}.`
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
raw = chip.design;
|
|
1294
|
+
}
|
|
1295
|
+
const parsed = parseGameDesign(raw, template.manifest);
|
|
1296
|
+
if (!parsed) {
|
|
1297
|
+
return { error: "The designer did not return a design." };
|
|
1298
|
+
}
|
|
1299
|
+
// Nothing below places a node: the design is text on the row.
|
|
1300
|
+
const saved = await persistGame(owned.row, {
|
|
1301
|
+
design: parsed.design,
|
|
1302
|
+
design_source: designSourceOf(template.id, brief),
|
|
1303
|
+
stage: "review"
|
|
1304
|
+
});
|
|
1305
|
+
if (isError(saved))
|
|
1306
|
+
return saved;
|
|
1307
|
+
return {
|
|
1308
|
+
workflow_id: id,
|
|
1309
|
+
stage: "review",
|
|
1310
|
+
design: parsed.design,
|
|
1311
|
+
/** Slots the designer skipped, filled from the template's own prompt. */
|
|
1312
|
+
filled_from_manifest: parsed.filled,
|
|
1313
|
+
gaps: designGaps(parsed.design),
|
|
1314
|
+
nodes_placed: 0
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
};
|
|
1318
|
+
// ── update_game_design ──────────────────────────────────────────────────────
|
|
1319
|
+
/** Merge `patch` entries into `current` by `slot_id`, keeping order. */
|
|
1320
|
+
function mergeBySlot(current, patch) {
|
|
1321
|
+
if (!Array.isArray(patch))
|
|
1322
|
+
return [...current];
|
|
1323
|
+
const merged = [...current];
|
|
1324
|
+
for (const entry of patch) {
|
|
1325
|
+
if (!isObjectLike(entry) || !isString(entry.slot_id))
|
|
1326
|
+
continue;
|
|
1327
|
+
const slotId = entry.slot_id;
|
|
1328
|
+
const at = merged.findIndex((item) => item.slot_id === slotId);
|
|
1329
|
+
if (at === -1) {
|
|
1330
|
+
merged.push(entry);
|
|
1331
|
+
}
|
|
1332
|
+
else {
|
|
1333
|
+
merged[at] = { ...merged[at], ...entry };
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
return merged;
|
|
1337
|
+
}
|
|
1338
|
+
const GAME_DESIGN_TEXT_FIELDS = [
|
|
1339
|
+
"title",
|
|
1340
|
+
"premise",
|
|
1341
|
+
"core_loop",
|
|
1342
|
+
"level",
|
|
1343
|
+
"win",
|
|
1344
|
+
"lose"
|
|
1345
|
+
];
|
|
1346
|
+
const updateGameDesign = {
|
|
1347
|
+
spec: updateGameDesignSpec,
|
|
1348
|
+
impl: async (run, params) => {
|
|
1349
|
+
const id = String(params["workflow_id"]);
|
|
1350
|
+
const owned = await loadOwnedGame(run, id);
|
|
1351
|
+
if (isError(owned))
|
|
1352
|
+
return owned;
|
|
1353
|
+
const current = owned.game?.design;
|
|
1354
|
+
if (!current) {
|
|
1355
|
+
return {
|
|
1356
|
+
error: "This workflow has no game design yet. Run design_game first, or store one with design_game's `design` argument."
|
|
1357
|
+
};
|
|
1358
|
+
}
|
|
1359
|
+
const next = { ...current };
|
|
1360
|
+
for (const field of GAME_DESIGN_TEXT_FIELDS) {
|
|
1361
|
+
if (isString(params[field]))
|
|
1362
|
+
next[field] = params[field];
|
|
1363
|
+
}
|
|
1364
|
+
if (Array.isArray(params["player_verbs"])) {
|
|
1365
|
+
next["player_verbs"] = params["player_verbs"].filter(isString);
|
|
1366
|
+
}
|
|
1367
|
+
next["cast"] = mergeBySlot(current.cast, params["cast"]);
|
|
1368
|
+
next["enemies"] = mergeBySlot(current.enemies, params["enemies"]);
|
|
1369
|
+
next["slot_prompts"] = mergeBySlot(current.slot_prompts, params["slot_prompts"]);
|
|
1370
|
+
const parsed = gameDesign.safeParse(next);
|
|
1371
|
+
if (!parsed.success) {
|
|
1372
|
+
return { error: `The edited design is malformed: ${parsed.error.message}` };
|
|
1373
|
+
}
|
|
1374
|
+
const saved = await persistGame(owned.row, { design: parsed.data });
|
|
1375
|
+
if (isError(saved))
|
|
1376
|
+
return saved;
|
|
1377
|
+
return {
|
|
1378
|
+
workflow_id: id,
|
|
1379
|
+
design: parsed.data,
|
|
1380
|
+
gaps: designGaps(parsed.data)
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
// ── build_game ──────────────────────────────────────────────────────────────
|
|
1385
|
+
const buildGame = {
|
|
1386
|
+
spec: buildGameSpec,
|
|
1387
|
+
impl: async (run, params) => {
|
|
1388
|
+
const id = String(params["workflow_id"]);
|
|
1389
|
+
const owned = await loadOwnedGame(run, id);
|
|
1390
|
+
if (isError(owned))
|
|
1391
|
+
return owned;
|
|
1392
|
+
const template = await requireGameTemplate(owned.game);
|
|
1393
|
+
if (isError(template))
|
|
1394
|
+
return template;
|
|
1395
|
+
const design = owned.game?.design;
|
|
1396
|
+
if (!design) {
|
|
1397
|
+
return {
|
|
1398
|
+
error: "This workflow has no game design yet. Run design_game first, then build_game."
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1401
|
+
const gaps = designGaps(design);
|
|
1402
|
+
if (gaps.length > 0) {
|
|
1403
|
+
return {
|
|
1404
|
+
error: "Every cast member needs a name and a descriptor and every slot needs a prompt before the graph is built. " +
|
|
1405
|
+
`Unfinished: ${gaps.join("; ")}. Fix them with update_game_design.`,
|
|
1406
|
+
gaps
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
const registry = run.nodeRegistry;
|
|
1410
|
+
if (!registry) {
|
|
1411
|
+
return {
|
|
1412
|
+
error: "Cannot build: no node registry is available in this process, so no node type could be resolved."
|
|
1413
|
+
};
|
|
1414
|
+
}
|
|
1415
|
+
const imageTile = owned.game?.image_model ?? "";
|
|
1416
|
+
const imageModel = modelValue(imageTile, "image_model");
|
|
1417
|
+
if (!imageModel) {
|
|
1418
|
+
return {
|
|
1419
|
+
error: "No image model is chosen. Set image_model to `provider:model_id` with set_game_setup — find_model has the ids."
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
// A setup saved in the browser keeps "the template's own audio" as the
|
|
1423
|
+
// placeholder sentinel, not as an absent field, so both audio answers are
|
|
1424
|
+
// normalized the way the flow normalizes them (D27). Handing the sentinel
|
|
1425
|
+
// on would fail this as an invalid model id and reach the registry as a
|
|
1426
|
+
// node type nothing answers for.
|
|
1427
|
+
const musicTile = gameAudioChoice(owned.game?.music_model);
|
|
1428
|
+
const musicModel = musicTile === null ? null : modelValue(musicTile, "music_model");
|
|
1429
|
+
if (musicTile !== null && !musicModel) {
|
|
1430
|
+
return {
|
|
1431
|
+
error: `music_model "${musicTile}" is not \`provider:model_id\`. Omit it to keep the template's placeholder music.`
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
const projectName = owned.game?.project_name?.trim() ||
|
|
1435
|
+
design.title.trim() ||
|
|
1436
|
+
template.id;
|
|
1437
|
+
const { Game } = await import("@nodetool-ai/models");
|
|
1438
|
+
let nativeGame = owned.game?.game_id
|
|
1439
|
+
? await Game.findOwned(userIdOf(run.context), owned.game.game_id)
|
|
1440
|
+
: null;
|
|
1441
|
+
if (nativeGame && nativeGame.project_id !== owned.row.project_id) {
|
|
1442
|
+
return { error: "The selected game belongs to another project" };
|
|
1443
|
+
}
|
|
1444
|
+
if (owned.game?.game_id && !nativeGame) {
|
|
1445
|
+
return { error: "The selected native game was not found" };
|
|
1446
|
+
}
|
|
1447
|
+
if (!nativeGame && params["save"] === false) {
|
|
1448
|
+
return { error: "Create or select a native game before previewing the asset graph" };
|
|
1449
|
+
}
|
|
1450
|
+
if (!nativeGame) {
|
|
1451
|
+
const { createNativeGame } = await import("./game.js");
|
|
1452
|
+
const created = await createNativeGame(userIdOf(run.context), owned.row.project_id, projectName);
|
|
1453
|
+
if ("error" in created)
|
|
1454
|
+
return created;
|
|
1455
|
+
nativeGame = created.game;
|
|
1456
|
+
}
|
|
1457
|
+
const choices = {
|
|
1458
|
+
imageModel,
|
|
1459
|
+
sfxNodeType: gameAudioChoice(owned.game?.sfx_node_type),
|
|
1460
|
+
musicModel,
|
|
1461
|
+
style: await loadStyle(run, owned.game?.style_entity_id),
|
|
1462
|
+
projectName,
|
|
1463
|
+
gameId: nativeGame.id,
|
|
1464
|
+
directory: nativeGame.source_root,
|
|
1465
|
+
verify: true
|
|
1466
|
+
};
|
|
1467
|
+
const placement = gameGraphPlacement(template.manifest, design, choices, registryLookup(registry));
|
|
1468
|
+
const graph = placementToGraph(placement);
|
|
1469
|
+
const validation = await validateBuiltGraph(run, graph);
|
|
1470
|
+
const save = params["save"] !== false;
|
|
1471
|
+
let savedRow = null;
|
|
1472
|
+
if (save) {
|
|
1473
|
+
const written = await persistGame(owned.row, { stage: "done", project_name: projectName, game_id: nativeGame.id }, { graph: graph, workspaceId: nativeGame.workspace_id });
|
|
1474
|
+
if (isError(written))
|
|
1475
|
+
return written;
|
|
1476
|
+
savedRow = written;
|
|
1477
|
+
}
|
|
1478
|
+
return {
|
|
1479
|
+
workflow_id: id,
|
|
1480
|
+
game_id: nativeGame.id,
|
|
1481
|
+
saved: savedRow !== null,
|
|
1482
|
+
stage: save ? "done" : owned.game?.stage ?? "look",
|
|
1483
|
+
graph,
|
|
1484
|
+
node_count: placement.nodes.length,
|
|
1485
|
+
directory: choices.directory,
|
|
1486
|
+
/**
|
|
1487
|
+
* The slots the builder could not wire. Empty is the only value that
|
|
1488
|
+
* means the graph fills every slot the template needs — a validated graph
|
|
1489
|
+
* with issues here exports a project with holes in it.
|
|
1490
|
+
*/
|
|
1491
|
+
issues: placement.issues,
|
|
1492
|
+
validation
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
};
|
|
1496
|
+
/** Every workflow capability, in the order `getAllMcpTools` offered them. */
|
|
1497
|
+
export const WORKFLOW_CAPABILITIES = [
|
|
1498
|
+
listWorkflows,
|
|
1499
|
+
getWorkflow,
|
|
1500
|
+
createWorkflow,
|
|
1501
|
+
updateWorkflow,
|
|
1502
|
+
deleteWorkflow,
|
|
1503
|
+
listWorkflowVersions,
|
|
1504
|
+
getWorkflowVersion,
|
|
1505
|
+
createWorkflowVersion,
|
|
1506
|
+
restoreWorkflowVersion,
|
|
1507
|
+
deleteWorkflowVersion,
|
|
1508
|
+
setWorkflowAccess,
|
|
1509
|
+
runWorkflowCapability,
|
|
1510
|
+
debugWorkflow,
|
|
1511
|
+
resolveWorkflowEscalation,
|
|
1512
|
+
validateWorkflow,
|
|
1513
|
+
getExampleWorkflow,
|
|
1514
|
+
exportWorkflowDigraph,
|
|
1515
|
+
startBackgroundJob,
|
|
1516
|
+
setWorkflowSetup,
|
|
1517
|
+
planWorkflow,
|
|
1518
|
+
updateWorkflowPlanStep,
|
|
1519
|
+
buildWorkflowFromPlan,
|
|
1520
|
+
setGameSetup,
|
|
1521
|
+
designGame,
|
|
1522
|
+
updateGameDesign,
|
|
1523
|
+
buildGame
|
|
1524
|
+
];
|
|
1525
|
+
export const module = {
|
|
1526
|
+
module: "workflows",
|
|
1527
|
+
exports: [...WORKFLOW_CAPABILITIES]
|
|
1528
|
+
};
|
|
1529
|
+
export { listWorkflows, getWorkflow, createWorkflow, updateWorkflow, deleteWorkflow, listWorkflowVersions, getWorkflowVersion, createWorkflowVersion, restoreWorkflowVersion, deleteWorkflowVersion, setWorkflowAccess, runWorkflowCapability, debugWorkflow, resolveWorkflowEscalation, validateWorkflow, getExampleWorkflow, exportWorkflowDigraph, startBackgroundJob, setWorkflowSetup, planWorkflow, updateWorkflowPlanStep, buildWorkflowFromPlan, setGameSetup, designGame, updateGameDesign, buildGame, registryLookup };
|
|
1530
|
+
//# sourceMappingURL=workflows.js.map
|