@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
package/dist/step-executor.js
CHANGED
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
* Port of src/nodetool/agents/step_executor.py
|
|
5
5
|
*
|
|
6
6
|
* Manages the LLM interaction loop: sending messages, handling tool calls,
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* and capturing the step result via finish_step (for schema'd steps) or the
|
|
8
|
+
* assistant's text response (for unstructured steps).
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { createHash } from "node:crypto";
|
|
13
|
-
import { withAgentSpanGen } from "@nodetool-ai/runtime";
|
|
10
|
+
import { ACTIVE_MODEL_CONTEXT_KEY, isChunk, isToolCall, memoryKeys, withAgentSpanGen, mediaResolverFor } from "@nodetool-ai/runtime";
|
|
11
|
+
import { linkAbort } from "./utils/link-abort.js";
|
|
14
12
|
import { createLogger } from "@nodetool-ai/config";
|
|
15
13
|
import { TaskUpdateEvent } from "@nodetool-ai/protocol";
|
|
16
|
-
import {
|
|
14
|
+
import { Tool } from "./tools/base-tool.js";
|
|
15
|
+
import { extractInjectableImages, stripImagePayload } from "./tools/image-injection.js";
|
|
17
16
|
import { FinishStepTool } from "./tools/finish-step-tool.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
17
|
+
import { getSharedTools } from "./tools/shared-tools.js";
|
|
18
|
+
import { truncateToolResult } from "./constants.js";
|
|
19
|
+
import { formatViolations, validateAgainstSchema } from "./utils/json-schema-validate.js";
|
|
20
|
+
import { lastProseHint } from "./utils/step-failure.js";
|
|
21
|
+
import { createUiEventBuffer } from "./utils/ui-event-buffer.js";
|
|
22
|
+
import { removeThinkTags } from "./utils/think-tags.js";
|
|
23
|
+
import { isBoolean, isFunction, isNonEmptyString, isNumber, isObjectLike, isRecord, isString } from "./utils/type-guards.js";
|
|
21
24
|
const log = createLogger("nodetool.agents.step-executor");
|
|
22
25
|
const DEFAULT_MAX_ITERATIONS = 30;
|
|
23
|
-
const JSON_FAILURE_ALERT_THRESHOLD = 3;
|
|
24
|
-
const MAX_JSON_PARSE_FAILURES = 6;
|
|
25
26
|
// ---------------------------------------------------------------------------
|
|
26
27
|
// Shared prompt fragments (DRY)
|
|
27
28
|
// ---------------------------------------------------------------------------
|
|
@@ -41,24 +42,32 @@ const PROMPT_TOOL_USE = `# Tool Use
|
|
|
41
42
|
- Use tools only when they materially improve correctness or are required.
|
|
42
43
|
- Avoid exploratory or repeated tool calls that are unlikely to change the outcome.
|
|
43
44
|
- Before each tool call, emit a one-sentence rationale describing what you're doing and why.
|
|
45
|
+
- Every tool's input schema includes a \`_message\` string field. Set it on EVERY call to a short (5-12 words), present-continuous status describing what you're doing — this is what the user sees while the tool runs. Examples: "Reading config.json", "Searching the web for AI trends", "Adding image generator node", "Calling http_request to POST /api/items". Be specific about the target (file, URL, query, node type) — generic strings like "Running tool" are useless to the user.
|
|
46
|
+
|
|
47
|
+
## Memory Tools (progressive disclosure)
|
|
48
|
+
- Shared agent memory holds results from prior steps and tasks, original inputs, and facts published by other agents.
|
|
49
|
+
- Memory contents are NOT auto-included in your prompt. If you need upstream context, discover it on demand:
|
|
50
|
+
1. Call \`list_shared\` to see what's available (returns metadata only — keys, titles, kinds, byte sizes).
|
|
51
|
+
2. Call \`read_shared\` with the specific keys you actually need; it returns full values.
|
|
52
|
+
3. Call \`share_result\` to publish a value under \`shared:<key>\` so other agents can find it via \`list_shared\`.
|
|
53
|
+
- Pull only what you need — don't fetch every entry by reflex.
|
|
44
54
|
|
|
45
55
|
## File Tools
|
|
46
|
-
- Use \`read_file\` to read files.
|
|
56
|
+
- Use \`read_file\` to read files.
|
|
47
57
|
- Use \`edit_file\` for modifying existing files — it performs exact string replacement and only sends the diff. Prefer it over \`write_file\` for modifications.
|
|
48
58
|
- Use \`write_file\` only for creating new files or complete rewrites.
|
|
49
|
-
- Use \`glob\` to find files by name pattern (e.g. "**/*.ts").
|
|
50
|
-
- Use \`grep\` to search file contents with regex.
|
|
51
|
-
- Use \`run_code\` with language="bash" only for system commands and operations that require shell execution.
|
|
59
|
+
- Use \`glob\` to find files by name pattern (e.g. "**/*.ts").
|
|
60
|
+
- Use \`grep\` to search file contents with regex.
|
|
52
61
|
|
|
53
62
|
## Web Tools
|
|
54
63
|
- Use \`browser\` to fetch and read the content of a web page. It returns cleaned, readable text extracted from HTML. This is the right choice for reading articles, documentation, or any page content.
|
|
55
64
|
- Use \`http_request\` for API calls, POST/PUT/PATCH requests, or when you need raw response headers and body. Do not use it for reading page content — use \`browser\` instead.
|
|
56
65
|
- Use \`download_file\` to save a file (binary or text) from a URL to disk.`;
|
|
57
|
-
const PROMPT_FINISH_STEP = `# Completion
|
|
58
|
-
- When
|
|
59
|
-
{"result": <result>}
|
|
60
|
-
-
|
|
61
|
-
|
|
66
|
+
const PROMPT_FINISH_STEP = `# Completion
|
|
67
|
+
- When you have everything you need, call \`finish_step\` exactly once with
|
|
68
|
+
\`{"result": <result>}\` matching the declared schema.
|
|
69
|
+
- Use \`read_shared\` to fetch any upstream values you still need before
|
|
70
|
+
finishing.`;
|
|
62
71
|
// ---------------------------------------------------------------------------
|
|
63
72
|
// Assembled system prompts
|
|
64
73
|
// ---------------------------------------------------------------------------
|
|
@@ -124,7 +133,7 @@ function validateAndSanitizeSchema(schema, defaultDescription = "Result object")
|
|
|
124
133
|
throw new Error("Schema is null or undefined");
|
|
125
134
|
}
|
|
126
135
|
let parsed = schema;
|
|
127
|
-
if (
|
|
136
|
+
if (isString(parsed)) {
|
|
128
137
|
parsed = JSON.parse(parsed);
|
|
129
138
|
}
|
|
130
139
|
if (typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
@@ -168,7 +177,7 @@ function validateAndSanitizeSchema(schema, defaultDescription = "Result object")
|
|
|
168
177
|
if (Array.isArray(obj)) {
|
|
169
178
|
return obj.map(cleanSchemaRecursive);
|
|
170
179
|
}
|
|
171
|
-
if (obj
|
|
180
|
+
if (isObjectLike(obj)) {
|
|
172
181
|
const cleaned = {};
|
|
173
182
|
for (const [key, value] of Object.entries(obj)) {
|
|
174
183
|
cleaned[key] = cleanSchemaRecursive(value);
|
|
@@ -182,16 +191,17 @@ function validateAndSanitizeSchema(schema, defaultDescription = "Result object")
|
|
|
182
191
|
}
|
|
183
192
|
return cleanSchemaRecursive(result);
|
|
184
193
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
/**
|
|
195
|
+
* The authored schema, deep-copied and given a `type` when it omits one, so
|
|
196
|
+
* host validation reads exactly what the caller declared and nothing more.
|
|
197
|
+
*/
|
|
198
|
+
function normalizeDeclaredSchema(raw) {
|
|
199
|
+
if (!isRecord(raw))
|
|
200
|
+
return null;
|
|
201
|
+
const copy = JSON.parse(JSON.stringify(raw));
|
|
202
|
+
if (!("type" in copy) && "properties" in copy)
|
|
203
|
+
copy["type"] = "object";
|
|
204
|
+
return copy;
|
|
195
205
|
}
|
|
196
206
|
// ---------------------------------------------------------------------------
|
|
197
207
|
// Tool result normalization
|
|
@@ -199,15 +209,13 @@ function removeThinkTags(text) {
|
|
|
199
209
|
function normalizeToolResult(value) {
|
|
200
210
|
if (value === null || value === undefined)
|
|
201
211
|
return value;
|
|
202
|
-
if (
|
|
203
|
-
typeof value === "number" ||
|
|
204
|
-
typeof value === "boolean")
|
|
212
|
+
if (isString(value) || isNumber(value) || isBoolean(value))
|
|
205
213
|
return value;
|
|
206
214
|
if (Array.isArray(value))
|
|
207
215
|
return value.map(normalizeToolResult);
|
|
208
|
-
if (
|
|
216
|
+
if (isObjectLike(value)) {
|
|
209
217
|
const obj = value;
|
|
210
|
-
if (
|
|
218
|
+
if (isFunction(obj["toJSON"])) {
|
|
211
219
|
return normalizeToolResult(obj.toJSON());
|
|
212
220
|
}
|
|
213
221
|
const result = {};
|
|
@@ -229,6 +237,12 @@ function renderTemplate(template, context) {
|
|
|
229
237
|
}
|
|
230
238
|
return result;
|
|
231
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Rejections by the acceptance callback before the step gives up. Three is
|
|
242
|
+
* enough for the model to read the reason and correct course; more is a model
|
|
243
|
+
* that cannot satisfy the contract, and looping costs real money.
|
|
244
|
+
*/
|
|
245
|
+
export const MAX_REPAIR_ROUNDS = 3;
|
|
232
246
|
export class StepExecutor {
|
|
233
247
|
history = [];
|
|
234
248
|
step;
|
|
@@ -238,22 +252,24 @@ export class StepExecutor {
|
|
|
238
252
|
model;
|
|
239
253
|
context;
|
|
240
254
|
systemPrompt;
|
|
241
|
-
maxTokenLimit;
|
|
242
255
|
maxIterations;
|
|
256
|
+
maxTokens;
|
|
243
257
|
useFinishTask;
|
|
244
|
-
|
|
258
|
+
signal;
|
|
245
259
|
result = null;
|
|
246
260
|
finishStepTool = null;
|
|
247
261
|
resultSchema = null;
|
|
262
|
+
/** The schema as the caller wrote it — what host validation checks. */
|
|
263
|
+
declaredSchema = null;
|
|
248
264
|
iterations = 0;
|
|
249
|
-
jsonParseFailures = 0;
|
|
250
265
|
generationFailures = 0;
|
|
251
|
-
sources = [];
|
|
252
|
-
sourcesSet = new Set();
|
|
253
|
-
inputTokensTotal = 0;
|
|
254
|
-
outputTokensTotal = 0;
|
|
255
|
-
_controlEvents = [];
|
|
256
266
|
threadId;
|
|
267
|
+
upstreamMemoryKeys;
|
|
268
|
+
acceptResult;
|
|
269
|
+
turnBudget;
|
|
270
|
+
repairRounds = 0;
|
|
271
|
+
/** Set when acceptance rejected the result once too often. */
|
|
272
|
+
acceptanceError = null;
|
|
257
273
|
constructor(opts) {
|
|
258
274
|
this.task = opts.task;
|
|
259
275
|
this.step = opts.step;
|
|
@@ -261,26 +277,29 @@ export class StepExecutor {
|
|
|
261
277
|
this.provider = opts.provider;
|
|
262
278
|
this.model = opts.model;
|
|
263
279
|
this.tools = opts.tools ? [...opts.tools] : [];
|
|
264
|
-
this.maxTokenLimit = opts.maxTokenLimit ?? DEFAULT_TOKEN_LIMIT;
|
|
265
280
|
this.maxIterations = opts.maxIterations ?? DEFAULT_MAX_ITERATIONS;
|
|
281
|
+
this.maxTokens = opts.maxTokens;
|
|
266
282
|
this.useFinishTask = opts.useFinishTask ?? false;
|
|
267
283
|
this.threadId = opts.threadId;
|
|
268
|
-
|
|
284
|
+
this.upstreamMemoryKeys = opts.upstreamMemoryKeys ?? [];
|
|
285
|
+
this.signal = opts.signal;
|
|
286
|
+
this.acceptResult = opts.acceptResult;
|
|
287
|
+
this.turnBudget = opts.turnBudget;
|
|
269
288
|
this.resultSchema = this.loadResultSchema();
|
|
270
|
-
//
|
|
289
|
+
// Auto-attach memory tools so the step can list / read / write
|
|
290
|
+
// shared agent memory on demand. Skip any caller-supplied duplicates.
|
|
291
|
+
const existingNames = new Set(this.tools.map((t) => t.name));
|
|
292
|
+
for (const sharedTool of getSharedTools()) {
|
|
293
|
+
if (!existingNames.has(sharedTool.name)) {
|
|
294
|
+
this.tools.push(sharedTool);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
271
297
|
if (this.resultSchema) {
|
|
272
298
|
this.finishStepTool = new FinishStepTool(this.resultSchema);
|
|
273
299
|
this.tools.push(this.finishStepTool);
|
|
274
300
|
}
|
|
275
|
-
// Build the system prompt from templates
|
|
276
301
|
this.systemPrompt = this.buildSystemPrompt(opts.systemPrompt);
|
|
277
302
|
}
|
|
278
|
-
/**
|
|
279
|
-
* Rough token estimate based on JSON serialized history length / 4.
|
|
280
|
-
*/
|
|
281
|
-
estimateTokens() {
|
|
282
|
-
return Math.ceil(JSON.stringify(this.history).length / 4);
|
|
283
|
-
}
|
|
284
303
|
/**
|
|
285
304
|
* Parse and sanitize the declared output schema for this step.
|
|
286
305
|
*/
|
|
@@ -291,39 +310,51 @@ export class StepExecutor {
|
|
|
291
310
|
? "The task result"
|
|
292
311
|
: "The step result";
|
|
293
312
|
try {
|
|
294
|
-
const raw =
|
|
313
|
+
const raw = isString(this.step.outputSchema)
|
|
295
314
|
? JSON.parse(this.step.outputSchema)
|
|
296
315
|
: this.step.outputSchema;
|
|
316
|
+
// Two schemas, on purpose. The sanitized one is what the provider is
|
|
317
|
+
// shown — it injects `additionalProperties: false` because strict
|
|
318
|
+
// structured-output modes demand it. The authored one is the contract,
|
|
319
|
+
// and it is what the host validates against: an author who wrote
|
|
320
|
+
// `properties: {}` meant "an object", not "an empty object", and
|
|
321
|
+
// enforcing a transport artifact would reject a result nobody forbade.
|
|
322
|
+
this.declaredSchema = normalizeDeclaredSchema(raw);
|
|
297
323
|
return validateAndSanitizeSchema(raw, defaultDescription);
|
|
298
324
|
}
|
|
299
325
|
catch {
|
|
300
326
|
// Fallback: permissive object schema
|
|
327
|
+
this.declaredSchema = null;
|
|
301
328
|
return { type: "object", description: defaultDescription };
|
|
302
329
|
}
|
|
303
330
|
}
|
|
304
331
|
/**
|
|
305
332
|
* Build the system prompt for this step using templates.
|
|
333
|
+
*
|
|
334
|
+
* The default execution prompts encode the contract every step relies on
|
|
335
|
+
* (output discipline, finish_step protocol). They must always be present.
|
|
336
|
+
* A caller-supplied `userPrompt` is added as a preamble — never as a
|
|
337
|
+
* replacement — so domain context can be layered in without losing the
|
|
338
|
+
* execution discipline.
|
|
306
339
|
*/
|
|
307
|
-
buildSystemPrompt(
|
|
340
|
+
buildSystemPrompt(userPrompt) {
|
|
308
341
|
let basePrompt;
|
|
309
342
|
const templateContext = {};
|
|
310
343
|
if (this.resultSchema) {
|
|
311
344
|
const schemaJson = JSON.stringify(this.resultSchema, null, 2);
|
|
312
345
|
templateContext["output_schema_json"] = schemaJson;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
basePrompt = customPrompt ?? DEFAULT_EXECUTION_SYSTEM_PROMPT;
|
|
319
|
-
templateContext["step_content"] = this.step.instructions;
|
|
320
|
-
}
|
|
346
|
+
basePrompt = this.useFinishTask
|
|
347
|
+
? DEFAULT_FINISH_TASK_SYSTEM_PROMPT
|
|
348
|
+
: DEFAULT_EXECUTION_SYSTEM_PROMPT;
|
|
321
349
|
}
|
|
322
350
|
else {
|
|
323
|
-
basePrompt =
|
|
324
|
-
templateContext["step_content"] = this.step.instructions;
|
|
351
|
+
basePrompt = DEFAULT_UNSTRUCTURED_SYSTEM_PROMPT;
|
|
325
352
|
}
|
|
353
|
+
templateContext["step_content"] = this.step.instructions;
|
|
326
354
|
let prompt = renderTemplate(basePrompt, templateContext);
|
|
355
|
+
if (userPrompt && userPrompt.trim().length > 0) {
|
|
356
|
+
prompt = `${userPrompt.trim()}\n\n---\n\n${prompt}`;
|
|
357
|
+
}
|
|
327
358
|
prompt += `\n\nToday's date is ${new Date().toISOString().slice(0, 10)}`;
|
|
328
359
|
return prompt;
|
|
329
360
|
}
|
|
@@ -336,43 +367,41 @@ export class StepExecutor {
|
|
|
336
367
|
if (this.resultSchema === null) {
|
|
337
368
|
return [true, null, normalized];
|
|
338
369
|
}
|
|
339
|
-
//
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
const obj = normalized;
|
|
346
|
-
for (const key of requiredKeys) {
|
|
347
|
-
if (!(key in obj)) {
|
|
348
|
-
return [false, `Missing required key: ${key}`, normalized];
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
// Type check
|
|
354
|
-
const expectedType = this.resultSchema["type"];
|
|
355
|
-
if (expectedType === "string" && typeof normalized !== "string") {
|
|
356
|
-
return [false, `Expected string, got ${typeof normalized}`, normalized];
|
|
357
|
-
}
|
|
358
|
-
if (expectedType === "object" &&
|
|
359
|
-
(typeof normalized !== "object" || normalized === null)) {
|
|
360
|
-
return [false, `Expected object, got ${typeof normalized}`, normalized];
|
|
361
|
-
}
|
|
362
|
-
if (expectedType === "array" && !Array.isArray(normalized)) {
|
|
363
|
-
return [false, `Expected array, got ${typeof normalized}`, normalized];
|
|
370
|
+
// The whole declared schema, not its outline. Backends vary in how much of
|
|
371
|
+
// a tool-parameter schema they enforce — enums and unions are routinely
|
|
372
|
+
// dropped — so a contract holds only where the host checks it.
|
|
373
|
+
const violations = validateAgainstSchema(normalized, this.declaredSchema ?? this.resultSchema);
|
|
374
|
+
if (violations.length > 0) {
|
|
375
|
+
return [false, formatViolations(violations), normalized];
|
|
364
376
|
}
|
|
365
377
|
return [true, null, normalized];
|
|
366
378
|
}
|
|
367
379
|
/**
|
|
368
380
|
* Persist the final result and mark the step as completed.
|
|
381
|
+
*
|
|
382
|
+
* Writes a `step_result` entry to {@link ProcessingContext.memory} under
|
|
383
|
+
* `step:<id>`. For finish-task steps it additionally writes the same value
|
|
384
|
+
* as a `task_result` under `task:<id>` so downstream tasks can discover it
|
|
385
|
+
* via memory.
|
|
369
386
|
*/
|
|
370
|
-
|
|
387
|
+
storeCompletionResult(normalizedResult) {
|
|
371
388
|
this.step.completed = true;
|
|
372
389
|
this.step.endTime = Date.now();
|
|
373
|
-
|
|
390
|
+
this.context.memory.set({
|
|
391
|
+
key: memoryKeys.step(this.step.id),
|
|
392
|
+
kind: "step_result",
|
|
393
|
+
value: normalizedResult,
|
|
394
|
+
source: this.step.id,
|
|
395
|
+
title: this.step.instructions.slice(0, 80)
|
|
396
|
+
});
|
|
374
397
|
if (this.useFinishTask) {
|
|
375
|
-
|
|
398
|
+
this.context.memory.set({
|
|
399
|
+
key: memoryKeys.task(this.task.id),
|
|
400
|
+
kind: "task_result",
|
|
401
|
+
value: normalizedResult,
|
|
402
|
+
source: this.task.id,
|
|
403
|
+
title: this.task.title
|
|
404
|
+
});
|
|
376
405
|
}
|
|
377
406
|
this.result = normalizedResult;
|
|
378
407
|
}
|
|
@@ -401,166 +430,18 @@ export class StepExecutor {
|
|
|
401
430
|
this.history.push({ role: "system", content: lines.join("\n") });
|
|
402
431
|
}
|
|
403
432
|
/**
|
|
404
|
-
*
|
|
433
|
+
* For unstructured steps (no schema), accept the assistant's text content
|
|
434
|
+
* as the result when the model produces a final response without tool
|
|
435
|
+
* calls. Schema'd steps finalize exclusively through `finish_step`.
|
|
405
436
|
*/
|
|
406
437
|
maybeFinalizeFromMessage(message) {
|
|
407
438
|
if (!message)
|
|
408
439
|
return [false, null];
|
|
409
|
-
|
|
410
|
-
if (this.resultSchema === null) {
|
|
411
|
-
if (!message.toolCalls || message.toolCalls.length === 0) {
|
|
412
|
-
return [true, message.content];
|
|
413
|
-
}
|
|
414
|
-
return [false, null];
|
|
415
|
-
}
|
|
416
|
-
if (!message.content || typeof message.content !== "string")
|
|
417
|
-
return [false, null];
|
|
418
|
-
const parsed = extractJSON(message.content);
|
|
419
|
-
if (!parsed || typeof parsed !== "object")
|
|
440
|
+
if (this.resultSchema !== null)
|
|
420
441
|
return [false, null];
|
|
421
|
-
|
|
422
|
-
const status = obj["status"];
|
|
423
|
-
if (status !== undefined && status !== "completed")
|
|
424
|
-
return [false, null];
|
|
425
|
-
if (status === "completed" && !("result" in obj)) {
|
|
426
|
-
this.history.push({
|
|
427
|
-
role: "system",
|
|
428
|
-
content: 'Missing \'result\' in completion payload. Provide: {"status": "completed", "result": <your_result>}.'
|
|
429
|
-
});
|
|
430
|
-
return [false, null];
|
|
431
|
-
}
|
|
432
|
-
const candidateResult = "result" in obj ? obj["result"] : parsed;
|
|
433
|
-
const [isValid, errorDetail, normalizedResult] = this.validateResultPayload(candidateResult);
|
|
434
|
-
if (!isValid ||
|
|
435
|
-
normalizedResult === null ||
|
|
436
|
-
normalizedResult === undefined) {
|
|
437
|
-
this.history.push({
|
|
438
|
-
role: "system",
|
|
439
|
-
content: `Schema validation failed: ${errorDetail ?? "unknown error"}`
|
|
440
|
-
});
|
|
442
|
+
if (message.toolCalls && message.toolCalls.length > 0)
|
|
441
443
|
return [false, null];
|
|
442
|
-
|
|
443
|
-
return [true, normalizedResult];
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Track JSON parsing/validation failures and enforce a hard stop.
|
|
447
|
-
*/
|
|
448
|
-
registerJsonFailure(detail) {
|
|
449
|
-
this.jsonParseFailures++;
|
|
450
|
-
if (this.jsonParseFailures === JSON_FAILURE_ALERT_THRESHOLD) {
|
|
451
|
-
const reminder = "SYSTEM: Do NOT output completion JSON in assistant text. You MUST call " +
|
|
452
|
-
"`finish_step` with {'result': <result>} matching the schema, with no extra keys.";
|
|
453
|
-
this.history.push({ role: "system", content: reminder });
|
|
454
|
-
this.inConclusionStage = true;
|
|
455
|
-
}
|
|
456
|
-
if (this.jsonParseFailures >= MAX_JSON_PARSE_FAILURES) {
|
|
457
|
-
throw new Error(`Exceeded maximum JSON parse attempts (${MAX_JSON_PARSE_FAILURES}) for step ${this.step.id}. Last failure: ${detail}`);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Filter tool calls based on whether we're in the conclusion stage.
|
|
462
|
-
*/
|
|
463
|
-
filterToolCallsForCurrentStage(toolCalls) {
|
|
464
|
-
if (!this.inConclusionStage)
|
|
465
|
-
return toolCalls;
|
|
466
|
-
return toolCalls.filter((tc) => tc.name === "finish_step");
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Get the tools available for the current stage.
|
|
470
|
-
*/
|
|
471
|
-
getCurrentTools() {
|
|
472
|
-
if (this.inConclusionStage) {
|
|
473
|
-
return this.finishStepTool ? [this.finishStepTool] : [];
|
|
474
|
-
}
|
|
475
|
-
return [...this.tools];
|
|
476
|
-
}
|
|
477
|
-
/**
|
|
478
|
-
* Transition to conclusion stage: restrict tools to finish_step only.
|
|
479
|
-
*/
|
|
480
|
-
enterConclusionStage() {
|
|
481
|
-
if (this.inConclusionStage)
|
|
482
|
-
return;
|
|
483
|
-
this.inConclusionStage = true;
|
|
484
|
-
const hasFinishTool = !!this.finishStepTool;
|
|
485
|
-
const message = hasFinishTool
|
|
486
|
-
? `SYSTEM: The conversation history is approaching the token limit (${this.maxTokenLimit} tokens).\n` +
|
|
487
|
-
"ENTERING CONCLUSION STAGE: You MUST now synthesize all gathered information and finalize the step.\n" +
|
|
488
|
-
"Only the `finish_step` tool is available. Call `finish_step` exactly once with:\n" +
|
|
489
|
-
'{"result": <result>} where <result> matches the declared schema.'
|
|
490
|
-
: `SYSTEM: The conversation history is approaching the token limit (${this.maxTokenLimit} tokens).\n` +
|
|
491
|
-
"ENTERING CONCLUSION STAGE: You MUST now synthesize all gathered information and finalize the step.\n" +
|
|
492
|
-
"Tools are not available. Provide the final answer concisely.";
|
|
493
|
-
// Prevent duplicate conclusion messages
|
|
494
|
-
if (!this.history.some((m) => m.role === "system" &&
|
|
495
|
-
typeof m.content === "string" &&
|
|
496
|
-
m.content.includes("ENTERING CONCLUSION STAGE"))) {
|
|
497
|
-
this.history.push({ role: "system", content: message });
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Summarize older messages into a concise, factual summary.
|
|
502
|
-
*/
|
|
503
|
-
async summarizeMessages(messages) {
|
|
504
|
-
const joined = messages
|
|
505
|
-
.filter((m) => m.content)
|
|
506
|
-
.map((m) => `${(m.role ?? "").toUpperCase()}: ${m.content}`)
|
|
507
|
-
.join("\n");
|
|
508
|
-
const prompt = "Summarize the following conversation concisely while preserving key facts, " +
|
|
509
|
-
"decisions, and results:\n\n" +
|
|
510
|
-
joined;
|
|
511
|
-
try {
|
|
512
|
-
const msg = await this.provider.generateMessageTraced({
|
|
513
|
-
messages: [
|
|
514
|
-
{ role: "system", content: "Summarize previous context." },
|
|
515
|
-
{ role: "user", content: prompt }
|
|
516
|
-
],
|
|
517
|
-
model: this.model,
|
|
518
|
-
tools: [],
|
|
519
|
-
maxTokens: 512
|
|
520
|
-
});
|
|
521
|
-
return String(msg.content ?? "").trim();
|
|
522
|
-
}
|
|
523
|
-
catch {
|
|
524
|
-
return "Summary unavailable due to compression error.";
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Trim or summarize older messages to stay within token limits.
|
|
529
|
-
*/
|
|
530
|
-
async trimHistoryIfNeeded() {
|
|
531
|
-
const tokenCount = this.estimateTokens();
|
|
532
|
-
if (tokenCount < this.maxTokenLimit * 0.9)
|
|
533
|
-
return;
|
|
534
|
-
// Preserve the last 6 messages
|
|
535
|
-
const preserved = [];
|
|
536
|
-
for (let i = this.history.length - 1; i >= 0 && preserved.length < 6; i--) {
|
|
537
|
-
preserved.unshift(this.history[i]);
|
|
538
|
-
}
|
|
539
|
-
const earlierCount = this.history.length - preserved.length;
|
|
540
|
-
const earlierContext = earlierCount > 1 ? this.history.slice(1, earlierCount) : [];
|
|
541
|
-
if (earlierContext.length > 0) {
|
|
542
|
-
const summary = await this.summarizeMessages(earlierContext);
|
|
543
|
-
const systemPrompt = this.history[0];
|
|
544
|
-
this.history = [];
|
|
545
|
-
if (systemPrompt) {
|
|
546
|
-
this.history.push(systemPrompt);
|
|
547
|
-
}
|
|
548
|
-
this.history.push({
|
|
549
|
-
role: "system",
|
|
550
|
-
content: `Summary of previous context:\n${summary}`
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
else {
|
|
554
|
-
this.history = this.history.slice(0, 1);
|
|
555
|
-
}
|
|
556
|
-
this.history.push(...preserved);
|
|
557
|
-
// Trim further if still over budget
|
|
558
|
-
let currentTokens = this.estimateTokens();
|
|
559
|
-
while (currentTokens > this.maxTokenLimit * 0.85 &&
|
|
560
|
-
this.history.length > 2) {
|
|
561
|
-
this.history.splice(2, 1);
|
|
562
|
-
currentTokens = this.estimateTokens();
|
|
563
|
-
}
|
|
444
|
+
return [true, message.content];
|
|
564
445
|
}
|
|
565
446
|
/**
|
|
566
447
|
* Serialize a tool result for history, with truncation.
|
|
@@ -572,11 +453,7 @@ export class StepExecutor {
|
|
|
572
453
|
try {
|
|
573
454
|
const normalized = normalizeToolResult(toolResult);
|
|
574
455
|
const serialized = JSON.stringify(normalized);
|
|
575
|
-
|
|
576
|
-
return (serialized.slice(0, MAX_TOOL_RESULT_CHARS) +
|
|
577
|
-
"... [truncated to maintain context size]");
|
|
578
|
-
}
|
|
579
|
-
return serialized;
|
|
456
|
+
return truncateToolResult(serialized);
|
|
580
457
|
}
|
|
581
458
|
catch (e) {
|
|
582
459
|
return JSON.stringify({
|
|
@@ -586,164 +463,61 @@ export class StepExecutor {
|
|
|
586
463
|
}
|
|
587
464
|
}
|
|
588
465
|
/**
|
|
589
|
-
*
|
|
590
|
-
*
|
|
591
|
-
*/
|
|
592
|
-
async handleBinaryArtifact(toolResult) {
|
|
593
|
-
if (typeof toolResult !== "object" ||
|
|
594
|
-
toolResult === null ||
|
|
595
|
-
Array.isArray(toolResult)) {
|
|
596
|
-
return toolResult;
|
|
597
|
-
}
|
|
598
|
-
const result = { ...toolResult };
|
|
599
|
-
const workspaceDir = this.context.workspaceDir;
|
|
600
|
-
if (!workspaceDir)
|
|
601
|
-
return result;
|
|
602
|
-
for (const field of ["image", "audio"]) {
|
|
603
|
-
const value = result[field];
|
|
604
|
-
if (typeof value !== "string")
|
|
605
|
-
continue;
|
|
606
|
-
const dataUriMatch = value.match(/^data:([^;]+);base64,(.+)$/s);
|
|
607
|
-
if (!dataUriMatch)
|
|
608
|
-
continue;
|
|
609
|
-
const [, mimeType, base64Data] = dataUriMatch;
|
|
610
|
-
const ext = mimeType.split("/")[1] ?? "bin";
|
|
611
|
-
const hash = createHash("sha256")
|
|
612
|
-
.update(base64Data)
|
|
613
|
-
.digest("hex")
|
|
614
|
-
.slice(0, 16);
|
|
615
|
-
const filename = `artifact_${hash}.${ext}`;
|
|
616
|
-
const artifactsDir = path.join(workspaceDir, "artifacts");
|
|
617
|
-
await fs.mkdir(artifactsDir, { recursive: true });
|
|
618
|
-
const filepath = path.join(artifactsDir, filename);
|
|
619
|
-
await fs.writeFile(filepath, Buffer.from(base64Data, "base64"));
|
|
620
|
-
result[field] = filepath;
|
|
621
|
-
if (!this.sourcesSet.has(filepath)) {
|
|
622
|
-
this.sources.push(filepath);
|
|
623
|
-
this.sourcesSet.add(filepath);
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
return result;
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Persist important sandbox outputs (downloads, screenshots, generated artifacts)
|
|
630
|
-
* as assets so they survive ephemeral workspace/container cleanup.
|
|
631
|
-
*/
|
|
632
|
-
async capturePersistentSandboxOutputs(toolName, toolArgs, toolResult) {
|
|
633
|
-
if (typeof toolResult !== "object" ||
|
|
634
|
-
toolResult === null ||
|
|
635
|
-
Array.isArray(toolResult)) {
|
|
636
|
-
return toolResult;
|
|
637
|
-
}
|
|
638
|
-
const result = { ...toolResult };
|
|
639
|
-
if (result.success === false) {
|
|
640
|
-
return result;
|
|
641
|
-
}
|
|
642
|
-
const candidates = [];
|
|
643
|
-
const candidateKeys = new Set();
|
|
644
|
-
const isExternalUri = (value) => {
|
|
645
|
-
const lower = value.toLowerCase();
|
|
646
|
-
return (lower.startsWith("http://") ||
|
|
647
|
-
lower.startsWith("https://") ||
|
|
648
|
-
lower.startsWith("asset://") ||
|
|
649
|
-
lower.startsWith("memory://") ||
|
|
650
|
-
lower.startsWith("s3://") ||
|
|
651
|
-
lower.startsWith("file://"));
|
|
652
|
-
};
|
|
653
|
-
const maybeAdd = (label, value) => {
|
|
654
|
-
if (typeof value === "string" &&
|
|
655
|
-
value.trim().length > 0 &&
|
|
656
|
-
!value.startsWith("data:") &&
|
|
657
|
-
!isExternalUri(value)) {
|
|
658
|
-
const key = `${label}:${value}`;
|
|
659
|
-
if (!candidateKeys.has(key)) {
|
|
660
|
-
candidates.push({ label, path: value });
|
|
661
|
-
candidateKeys.add(key);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
};
|
|
665
|
-
maybeAdd("output_file", result.output_file);
|
|
666
|
-
if (result.success === true) {
|
|
667
|
-
maybeAdd("output_file", toolArgs?.["output_file"]);
|
|
668
|
-
}
|
|
669
|
-
maybeAdd("image", result.image);
|
|
670
|
-
maybeAdd("audio", result.audio);
|
|
671
|
-
if (candidates.length === 0) {
|
|
672
|
-
return result;
|
|
673
|
-
}
|
|
674
|
-
const refs = {};
|
|
675
|
-
for (const candidate of candidates) {
|
|
676
|
-
try {
|
|
677
|
-
const ref = await this.context.sandboxToAsset(candidate.path);
|
|
678
|
-
refs[candidate.label] = ref;
|
|
679
|
-
const uri = ref.uri;
|
|
680
|
-
if (typeof uri === "string" && uri && !this.sourcesSet.has(uri)) {
|
|
681
|
-
this.sources.push(uri);
|
|
682
|
-
this.sourcesSet.add(uri);
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
catch (error) {
|
|
686
|
-
log.warn("Failed to persist sandbox output as asset", {
|
|
687
|
-
stepId: this.step.id,
|
|
688
|
-
toolName,
|
|
689
|
-
path: candidate.path,
|
|
690
|
-
error: error instanceof Error ? error.message : String(error)
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
if (Object.keys(refs).length > 0) {
|
|
695
|
-
const existing = result.asset_refs;
|
|
696
|
-
if (typeof existing === "object" &&
|
|
697
|
-
existing !== null &&
|
|
698
|
-
!Array.isArray(existing)) {
|
|
699
|
-
result.asset_refs = { ...existing, ...refs };
|
|
700
|
-
}
|
|
701
|
-
else {
|
|
702
|
-
result.asset_refs = refs;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
return result;
|
|
706
|
-
}
|
|
707
|
-
/**
|
|
708
|
-
* Track URLs from browser tool navigation results.
|
|
709
|
-
* Mirrors Python's _process_special_tool_side_effects().
|
|
710
|
-
*/
|
|
711
|
-
trackToolSideEffects(toolName, result) {
|
|
712
|
-
if (toolName === "browser" &&
|
|
713
|
-
typeof result === "object" &&
|
|
714
|
-
result !== null) {
|
|
715
|
-
const url = result.url;
|
|
716
|
-
if (typeof url === "string" && url && !this.sourcesSet.has(url)) {
|
|
717
|
-
this.sources.push(url);
|
|
718
|
-
this.sourcesSet.add(url);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Generate a user-facing message for a tool call.
|
|
466
|
+
* Generate a user-facing message for a tool call. Prefers the LLM-authored
|
|
467
|
+
* `_message` arg; falls back to the tool's parameter-aware template.
|
|
724
468
|
*/
|
|
725
469
|
generateToolCallMessage(toolCall) {
|
|
470
|
+
const llm = Tool.extractMessage(toolCall.args);
|
|
471
|
+
if (llm)
|
|
472
|
+
return llm;
|
|
726
473
|
for (const tool of this.tools) {
|
|
727
474
|
if (tool.name === toolCall.name) {
|
|
728
|
-
return tool.userMessage(toolCall.args);
|
|
475
|
+
return tool.userMessage(Tool.stripMessage(toolCall.args));
|
|
729
476
|
}
|
|
730
477
|
}
|
|
731
478
|
return `Running ${toolCall.name}`;
|
|
732
479
|
}
|
|
733
480
|
/**
|
|
734
|
-
* Build the initial user message
|
|
481
|
+
* Build the initial user message.
|
|
482
|
+
*
|
|
483
|
+
* Memory contents are NOT auto-included — callers fetch on demand via the
|
|
484
|
+
* `list_shared` / `read_shared` tools (progressive disclosure; tool usage
|
|
485
|
+
* is documented in the default system prompt).
|
|
486
|
+
*
|
|
487
|
+
* The only memory information the user message carries is a short list of
|
|
488
|
+
* **specific** upstream keys the planner declared as relevant to this step:
|
|
489
|
+
*
|
|
490
|
+
* - `step:<id>` for every entry of `step.dependsOn` (intra-task deps).
|
|
491
|
+
* - any caller-supplied {@link StepExecutorOptions.upstreamMemoryKeys}
|
|
492
|
+
* (typically `task:<id>` entries from the parent task's `dependsOn`).
|
|
493
|
+
*
|
|
494
|
+
* Only keys that actually exist in `context.memory` are listed. The LLM
|
|
495
|
+
* is expected to call `read_shared` with whichever subset it needs.
|
|
735
496
|
*/
|
|
736
|
-
|
|
497
|
+
buildUserMessage() {
|
|
737
498
|
const parts = [this.step.instructions];
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
499
|
+
const declared = [
|
|
500
|
+
...this.step.dependsOn.map((id) => memoryKeys.step(id)),
|
|
501
|
+
...this.upstreamMemoryKeys
|
|
502
|
+
];
|
|
503
|
+
const seen = new Set();
|
|
504
|
+
const hints = [];
|
|
505
|
+
for (const key of declared) {
|
|
506
|
+
if (seen.has(key))
|
|
507
|
+
continue;
|
|
508
|
+
seen.add(key);
|
|
509
|
+
const entry = this.context.memory.get(key);
|
|
510
|
+
if (!entry)
|
|
511
|
+
continue;
|
|
512
|
+
hints.push({ key: entry.key, title: entry.title });
|
|
513
|
+
}
|
|
514
|
+
if (hints.length > 0) {
|
|
515
|
+
parts.push("");
|
|
516
|
+
parts.push("# Required upstream memory (call `read_shared` with these keys):");
|
|
517
|
+
for (const hint of hints) {
|
|
518
|
+
parts.push(`- ${hint.key}${hint.title ? ` — ${hint.title}` : ""}`);
|
|
744
519
|
}
|
|
745
520
|
}
|
|
746
|
-
parts.push("Please perform the step based on the provided context, instructions, and upstream task results.");
|
|
747
521
|
return parts.join("\n");
|
|
748
522
|
}
|
|
749
523
|
/**
|
|
@@ -766,12 +540,15 @@ export class StepExecutor {
|
|
|
766
540
|
stepId: this.step.id,
|
|
767
541
|
instructions: this.step.instructions.slice(0, 60)
|
|
768
542
|
});
|
|
769
|
-
//
|
|
543
|
+
// Stamp the loop's own selection so a tool that launches another harness
|
|
544
|
+
// inherits this agent's provider/model when the call doesn't name one.
|
|
545
|
+
this.context.set(ACTIVE_MODEL_CONTEXT_KEY, {
|
|
546
|
+
provider: this.provider.provider,
|
|
547
|
+
model: this.model
|
|
548
|
+
});
|
|
770
549
|
this.history.push({ role: "system", content: this.systemPrompt });
|
|
771
|
-
|
|
772
|
-
const userContent = await this.buildUserMessage();
|
|
550
|
+
const userContent = this.buildUserMessage();
|
|
773
551
|
this.history.push({ role: "user", content: userContent });
|
|
774
|
-
// Yield task update: step started
|
|
775
552
|
this.step.startTime = Date.now();
|
|
776
553
|
yield {
|
|
777
554
|
type: "task_update",
|
|
@@ -780,280 +557,231 @@ export class StepExecutor {
|
|
|
780
557
|
step: { id: this.step.id, instructions: this.step.instructions },
|
|
781
558
|
event: TaskUpdateEvent.StepStarted
|
|
782
559
|
};
|
|
783
|
-
|
|
784
|
-
//
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
type: "
|
|
560
|
+
// The provider drives the tool loop, so backends that run their own agent
|
|
561
|
+
// loop (e.g. the Claude Agent SDK) work. Each tool carries its own `execute`
|
|
562
|
+
// closure — running the tool, persisting artifacts, tracking sources — and
|
|
563
|
+
// buffers the completion events; the stream consumer surfaces chunks and
|
|
564
|
+
// tool-call updates.
|
|
565
|
+
//
|
|
566
|
+
// `finish_step` is only *conditionally* terminal: it ends the loop when it
|
|
567
|
+
// captures a schema-valid result, but on an invalid result it returns the
|
|
568
|
+
// error so the model can retry within the iteration budget. The static
|
|
569
|
+
// `terminal` flag can't express that, so the AbortController stops the loop
|
|
570
|
+
// on a valid completion instead.
|
|
571
|
+
const abort = new AbortController();
|
|
572
|
+
// External cancellation (user pressed Stop) fires the same controller.
|
|
573
|
+
const unlinkAbort = linkAbort(abort, this.signal);
|
|
574
|
+
const ui = createUiEventBuffer();
|
|
575
|
+
let lastAssistant = null;
|
|
576
|
+
// Captures a real exception thrown by the provider loop (401, rate limit,
|
|
577
|
+
// network, tool-schema error) so the failure path reports the actual cause
|
|
578
|
+
// instead of misattributing it to iteration exhaustion.
|
|
579
|
+
let generationError = null;
|
|
580
|
+
const emitCompletion = (normalizedResult) => {
|
|
581
|
+
this.storeCompletionResult(normalizedResult);
|
|
582
|
+
ui.push({
|
|
583
|
+
type: "task_update",
|
|
807
584
|
node_id: this.step.id,
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
});
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
585
|
+
task: { id: this.task.id, title: this.task.title },
|
|
586
|
+
step: { id: this.step.id, instructions: this.step.instructions },
|
|
587
|
+
event: TaskUpdateEvent.StepCompleted
|
|
588
|
+
});
|
|
589
|
+
ui.push({
|
|
590
|
+
type: "step_result",
|
|
591
|
+
step: { id: this.step.id, instructions: this.step.instructions },
|
|
592
|
+
result: normalizedResult,
|
|
593
|
+
is_task_result: this.useFinishTask
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
// finish_step is the only completion path for schema'd steps.
|
|
597
|
+
const finishStepExecute = async (args) => {
|
|
598
|
+
const rawResult = args?.["result"];
|
|
599
|
+
// Fall back to the whole args object when `result` is absent, but strip
|
|
600
|
+
// the injected `_message` protocol field so it can't leak into the result.
|
|
601
|
+
let resultPayload = rawResult !== undefined && rawResult !== null
|
|
602
|
+
? rawResult
|
|
603
|
+
: Tool.stripMessage(args ?? {});
|
|
604
|
+
// Array-output steps are wrapped as `{ result: { items: <array> } }` for
|
|
605
|
+
// the tool parameter schema (OpenAI requires an object top-level). Unwrap
|
|
606
|
+
// `{ items: [...] }` back to the array before validating against the
|
|
607
|
+
// original array schema. Gate on the declared schema type so a legitimate
|
|
608
|
+
// object result with an `items` key is not misinterpreted.
|
|
609
|
+
if (this.resultSchema?.["type"] === "array" &&
|
|
610
|
+
isRecord(resultPayload) &&
|
|
611
|
+
Array.isArray(resultPayload["items"])) {
|
|
612
|
+
resultPayload = resultPayload["items"];
|
|
613
|
+
}
|
|
614
|
+
if (resultPayload === undefined || resultPayload === null) {
|
|
615
|
+
return '{"error": "Missing result in finish_step call"}';
|
|
616
|
+
}
|
|
617
|
+
const [isValid, errorDetail, normalizedResult] = this.validateResultPayload(resultPayload);
|
|
618
|
+
if (isValid &&
|
|
619
|
+
normalizedResult !== null &&
|
|
620
|
+
normalizedResult !== undefined) {
|
|
621
|
+
if (this.acceptResult) {
|
|
622
|
+
const acceptance = await this.acceptResult(normalizedResult);
|
|
623
|
+
if (!acceptance.accepted) {
|
|
624
|
+
this.repairRounds++;
|
|
625
|
+
if (this.repairRounds >= MAX_REPAIR_ROUNDS) {
|
|
626
|
+
// Out of rounds. Stop the loop rather than pay for another
|
|
627
|
+
// attempt at a contract this model is not meeting.
|
|
628
|
+
this.acceptanceError = acceptance.reason;
|
|
629
|
+
abort.abort();
|
|
630
|
+
return JSON.stringify({
|
|
631
|
+
error: `Result rejected: ${acceptance.reason}`
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
return JSON.stringify({
|
|
635
|
+
error: `Result rejected: ${acceptance.reason}. Call finish_step again with a corrected result.`
|
|
636
|
+
});
|
|
840
637
|
}
|
|
841
638
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
|
|
639
|
+
emitCompletion(normalizedResult);
|
|
640
|
+
abort.abort();
|
|
641
|
+
return '{"status": "completed"}';
|
|
642
|
+
}
|
|
643
|
+
return JSON.stringify({
|
|
644
|
+
error: `Result validation failed: ${errorDetail ?? "Result failed schema validation."}`
|
|
645
|
+
});
|
|
646
|
+
};
|
|
647
|
+
const runTool = async (tool, args, toolCallId) => {
|
|
648
|
+
let toolResult;
|
|
649
|
+
try {
|
|
650
|
+
toolResult = await Tool.executeTool(tool, this.context, args, {
|
|
651
|
+
toolCallId
|
|
652
|
+
});
|
|
850
653
|
}
|
|
851
654
|
catch (e) {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
655
|
+
return JSON.stringify({ error: String(e) });
|
|
656
|
+
}
|
|
657
|
+
// A view-image-style result carries pixels the model asked for. Forward
|
|
658
|
+
// them as a user image message (generateLoop splits a MessageContent[]
|
|
659
|
+
// result into a light tool note + the image); the note stays in history.
|
|
660
|
+
const injected = extractInjectableImages(toolResult);
|
|
661
|
+
if (injected) {
|
|
662
|
+
toolResult = stripImagePayload(toolResult);
|
|
663
|
+
}
|
|
664
|
+
const resultStr = this.serializeToolResultForHistory(toolResult, tool.name);
|
|
665
|
+
if (injected) {
|
|
666
|
+
return [{ type: "text", text: resultStr }, ...injected.images];
|
|
860
667
|
}
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
668
|
+
return resultStr;
|
|
669
|
+
};
|
|
670
|
+
const providerTools = this.tools.map((tool) => {
|
|
671
|
+
if (tool === this.finishStepTool) {
|
|
672
|
+
return { ...tool.toProviderTool(), execute: finishStepExecute };
|
|
673
|
+
}
|
|
674
|
+
return {
|
|
675
|
+
...tool.toProviderTool(),
|
|
676
|
+
execute: (args, toolCallId) => runTool(tool, args, toolCallId)
|
|
677
|
+
};
|
|
678
|
+
});
|
|
679
|
+
try {
|
|
680
|
+
const stream = this.provider.generateLoop({
|
|
681
|
+
messages: this.history,
|
|
682
|
+
model: this.model,
|
|
683
|
+
tools: providerTools.length > 0 ? providerTools : undefined,
|
|
684
|
+
threadId: this.threadId,
|
|
685
|
+
maxIterations: this.maxIterations,
|
|
686
|
+
maxTokens: this.maxTokens,
|
|
687
|
+
sequentialTools: true,
|
|
688
|
+
turnBudget: this.turnBudget,
|
|
689
|
+
resolveMedia: mediaResolverFor(this.context),
|
|
690
|
+
signal: abort.signal
|
|
691
|
+
});
|
|
692
|
+
for await (const item of stream) {
|
|
693
|
+
if (isToolCall(item)) {
|
|
875
694
|
yield {
|
|
876
695
|
type: "tool_call_update",
|
|
877
696
|
node_id: this.step.id,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
697
|
+
tool_call_id: item.id,
|
|
698
|
+
name: item.name,
|
|
699
|
+
args: item.args,
|
|
700
|
+
message: this.generateToolCallMessage(item)
|
|
881
701
|
};
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
if (resultPayload !== undefined && resultPayload !== null) {
|
|
885
|
-
const [isValid, errorDetail, normalizedResult] = this.validateResultPayload(resultPayload);
|
|
886
|
-
if (isValid &&
|
|
887
|
-
normalizedResult !== null &&
|
|
888
|
-
normalizedResult !== undefined) {
|
|
889
|
-
// Add tool result to history
|
|
890
|
-
this.history.push({
|
|
891
|
-
role: "tool",
|
|
892
|
-
toolCallId: finishStepCall.id,
|
|
893
|
-
content: '{"status": "completed"}'
|
|
894
|
-
});
|
|
895
|
-
await this.storeCompletionResult(normalizedResult);
|
|
896
|
-
log.debug("Step completed", { stepId: this.step.id });
|
|
897
|
-
yield {
|
|
898
|
-
type: "task_update",
|
|
899
|
-
node_id: this.step.id,
|
|
900
|
-
task: { id: this.task.id, title: this.task.title },
|
|
901
|
-
step: {
|
|
902
|
-
id: this.step.id,
|
|
903
|
-
instructions: this.step.instructions
|
|
904
|
-
},
|
|
905
|
-
event: TaskUpdateEvent.StepCompleted
|
|
906
|
-
};
|
|
907
|
-
yield {
|
|
908
|
-
type: "step_result",
|
|
909
|
-
step: {
|
|
910
|
-
id: this.step.id,
|
|
911
|
-
instructions: this.step.instructions
|
|
912
|
-
},
|
|
913
|
-
result: normalizedResult,
|
|
914
|
-
is_task_result: this.useFinishTask
|
|
915
|
-
};
|
|
916
|
-
break;
|
|
917
|
-
}
|
|
918
|
-
else {
|
|
919
|
-
// Invalid result - add feedback and continue loop
|
|
920
|
-
this.history.push({
|
|
921
|
-
role: "tool",
|
|
922
|
-
toolCallId: finishStepCall.id,
|
|
923
|
-
content: JSON.stringify({
|
|
924
|
-
error: `Result validation failed: ${errorDetail}`
|
|
925
|
-
})
|
|
926
|
-
});
|
|
927
|
-
this.appendCompletionFeedback(errorDetail ?? "Result failed schema validation.", resultPayload);
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
else {
|
|
931
|
-
this.history.push({
|
|
932
|
-
role: "tool",
|
|
933
|
-
toolCallId: finishStepCall.id,
|
|
934
|
-
content: '{"error": "Missing result in finish_step call"}'
|
|
935
|
-
});
|
|
936
|
-
}
|
|
702
|
+
yield* ui.drain();
|
|
703
|
+
continue;
|
|
937
704
|
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
const regularToolCalls = filteredToolCalls.filter((tc) => tc.name !== "finish_step");
|
|
941
|
-
// Yield tool call updates
|
|
942
|
-
for (const tc of regularToolCalls) {
|
|
705
|
+
if (isChunk(item)) {
|
|
706
|
+
if (isNonEmptyString(item.content)) {
|
|
943
707
|
yield {
|
|
944
|
-
type: "
|
|
708
|
+
type: "chunk",
|
|
945
709
|
node_id: this.step.id,
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
message: this.generateToolCallMessage(tc)
|
|
710
|
+
content: item.content,
|
|
711
|
+
done: false
|
|
949
712
|
};
|
|
950
713
|
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
if (!tool)
|
|
964
|
-
return { error: `Unknown tool: ${tc.name}` };
|
|
965
|
-
// Intercept ControlNodeTool: create event instead of calling process()
|
|
966
|
-
if (tool instanceof ControlNodeTool) {
|
|
967
|
-
const event = tool.createControlEvent(tc.args ?? {});
|
|
968
|
-
this._controlEvents.push({
|
|
969
|
-
targetNodeId: tool.targetNodeId,
|
|
970
|
-
event
|
|
971
|
-
});
|
|
972
|
-
return tool.userMessage(tc.args ?? {});
|
|
973
|
-
}
|
|
974
|
-
try {
|
|
975
|
-
const result = await tool.process(this.context, tc.args ?? {});
|
|
976
|
-
return result;
|
|
977
|
-
}
|
|
978
|
-
catch (e) {
|
|
979
|
-
return { error: String(e) };
|
|
980
|
-
}
|
|
981
|
-
}));
|
|
982
|
-
// Add tool results to history
|
|
983
|
-
for (let i = 0; i < regularToolCalls.length; i++) {
|
|
984
|
-
const tc = regularToolCalls[i];
|
|
985
|
-
const settledResult = toolResults[i];
|
|
986
|
-
let toolResult;
|
|
987
|
-
if (settledResult.status === "fulfilled") {
|
|
988
|
-
toolResult = settledResult.value;
|
|
989
|
-
}
|
|
990
|
-
else {
|
|
991
|
-
toolResult = {
|
|
992
|
-
error: `Tool execution failed: ${settledResult.reason}`
|
|
993
|
-
};
|
|
994
|
-
}
|
|
995
|
-
// Save base64 binary artifacts (images, audio) to workspace files
|
|
996
|
-
toolResult = await this.handleBinaryArtifact(toolResult);
|
|
997
|
-
toolResult = await this.capturePersistentSandboxOutputs(tc.name, tc.args, toolResult);
|
|
998
|
-
// Track browser URLs for source lineage (from args and results)
|
|
999
|
-
if (tc.name === "browser" && tc.args?.["url"]) {
|
|
1000
|
-
const url = String(tc.args["url"]);
|
|
1001
|
-
if (!this.sourcesSet.has(url)) {
|
|
1002
|
-
this.sources.push(url);
|
|
1003
|
-
this.sourcesSet.add(url);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
this.trackToolSideEffects(tc.name, toolResult);
|
|
1007
|
-
const resultStr = this.serializeToolResultForHistory(toolResult, tc.name);
|
|
1008
|
-
this.history.push({
|
|
1009
|
-
role: "tool",
|
|
1010
|
-
toolCallId: tc.id,
|
|
1011
|
-
content: resultStr
|
|
1012
|
-
});
|
|
714
|
+
yield* ui.drain();
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
if ("type" in item && item.type === "message") {
|
|
718
|
+
const m = item.message;
|
|
719
|
+
if (m && m.role === "assistant") {
|
|
720
|
+
// One assistant message per provider turn — this is the iteration
|
|
721
|
+
// count the failure path reports.
|
|
722
|
+
this.iterations++;
|
|
723
|
+
lastAssistant = isString(m.content)
|
|
724
|
+
? { ...m, content: removeThinkTags(m.content) }
|
|
725
|
+
: m;
|
|
1013
726
|
}
|
|
1014
|
-
yield {
|
|
1015
|
-
type: "log_update",
|
|
1016
|
-
node_id: this.step.id,
|
|
1017
|
-
node_name: `Step: ${this.step.id}`,
|
|
1018
|
-
content: `Completed tool execution: ${toolNamesStr}.`,
|
|
1019
|
-
severity: "info"
|
|
1020
|
-
};
|
|
1021
727
|
}
|
|
728
|
+
yield* ui.drain();
|
|
1022
729
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
is_task_result: this.useFinishTask
|
|
1042
|
-
};
|
|
1043
|
-
break;
|
|
1044
|
-
}
|
|
730
|
+
}
|
|
731
|
+
catch (e) {
|
|
732
|
+
generationError = e instanceof Error ? e : new Error(String(e));
|
|
733
|
+
log.error("Step generation failed", {
|
|
734
|
+
stepId: this.step.id,
|
|
735
|
+
error: generationError.message
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
finally {
|
|
739
|
+
unlinkAbort();
|
|
740
|
+
}
|
|
741
|
+
yield* ui.drain();
|
|
742
|
+
// Unstructured steps finalize from the final assistant text (no finish_step).
|
|
743
|
+
if (!this.step.completed) {
|
|
744
|
+
const [done, normalizedResult] = this.maybeFinalizeFromMessage(lastAssistant);
|
|
745
|
+
if (done && normalizedResult !== null && normalizedResult !== undefined) {
|
|
746
|
+
emitCompletion(normalizedResult);
|
|
747
|
+
yield* ui.drain();
|
|
1045
748
|
}
|
|
1046
749
|
}
|
|
1047
|
-
// If we
|
|
1048
|
-
//
|
|
750
|
+
// If we didn't complete, yield a failure event and a step_result so
|
|
751
|
+
// downstream steps see an explicit error rather than undefined. Each
|
|
752
|
+
// terminal state gets its own sentence: the provider threw, the iteration
|
|
753
|
+
// budget really ran out, or the model ended its turn without calling
|
|
754
|
+
// `finish_step`. Reporting them all as "exceeded N iterations" pointed the
|
|
755
|
+
// reader at a budget that a two-turn step never came near.
|
|
756
|
+
//
|
|
757
|
+
// A failed step is terminal but NOT completed: `failed`/`error` are set and
|
|
758
|
+
// `completed` stays false, so a scheduler cannot treat the failure as a
|
|
759
|
+
// satisfied dependency. The protocol-level `error` field carries the same
|
|
760
|
+
// cause, so a consumer never has to sniff the result payload for it.
|
|
1049
761
|
if (!this.step.completed) {
|
|
1050
|
-
this.step.completed = true;
|
|
1051
762
|
this.step.endTime = Date.now();
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
|
|
763
|
+
const message = this.acceptanceError
|
|
764
|
+
? `Step failed: result rejected after ${MAX_REPAIR_ROUNDS} attempts — ${this.acceptanceError}`
|
|
765
|
+
: generationError
|
|
766
|
+
? `Step failed: ${generationError.message}`
|
|
767
|
+
: this.iterations >= this.maxIterations
|
|
768
|
+
? `Step failed: exceeded ${this.maxIterations} iterations without completion`
|
|
769
|
+
: this.resultSchema !== null
|
|
770
|
+
? `Step failed: ended after ${this.iterations} model turn(s) ` +
|
|
771
|
+
`without calling finish_step.${lastProseHint(lastAssistant)}`
|
|
772
|
+
: `Step failed: ended after ${this.iterations} model turn(s) ` +
|
|
773
|
+
`with no final message to use as the result.`;
|
|
774
|
+
this.step.failed = true;
|
|
775
|
+
this.step.error = message;
|
|
776
|
+
const errorResult = { error: message };
|
|
1055
777
|
this.result = errorResult;
|
|
1056
|
-
|
|
778
|
+
this.context.memory.set({
|
|
779
|
+
key: memoryKeys.step(this.step.id),
|
|
780
|
+
kind: "step_result",
|
|
781
|
+
value: errorResult,
|
|
782
|
+
source: this.step.id,
|
|
783
|
+
title: `Failed: ${this.step.instructions.slice(0, 60)}`
|
|
784
|
+
});
|
|
1057
785
|
yield {
|
|
1058
786
|
type: "task_update",
|
|
1059
787
|
node_id: this.step.id,
|
|
@@ -1065,6 +793,7 @@ export class StepExecutor {
|
|
|
1065
793
|
type: "step_result",
|
|
1066
794
|
step: { id: this.step.id, instructions: this.step.instructions },
|
|
1067
795
|
result: errorResult,
|
|
796
|
+
error: message,
|
|
1068
797
|
is_task_result: this.useFinishTask
|
|
1069
798
|
};
|
|
1070
799
|
}
|
|
@@ -1075,40 +804,5 @@ export class StepExecutor {
|
|
|
1075
804
|
getResult() {
|
|
1076
805
|
return this.result;
|
|
1077
806
|
}
|
|
1078
|
-
/**
|
|
1079
|
-
* Get tracked sources (e.g. browser URLs).
|
|
1080
|
-
*/
|
|
1081
|
-
getSources() {
|
|
1082
|
-
return [...this.sources];
|
|
1083
|
-
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Get token usage statistics.
|
|
1086
|
-
*/
|
|
1087
|
-
getTokenUsage() {
|
|
1088
|
-
return {
|
|
1089
|
-
inputTokensTotal: this.inputTokensTotal,
|
|
1090
|
-
outputTokensTotal: this.outputTokensTotal
|
|
1091
|
-
};
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Get control events emitted during execution (from ControlNodeTool calls).
|
|
1095
|
-
* The caller (workflow actor/runner) is responsible for dispatching these.
|
|
1096
|
-
*/
|
|
1097
|
-
getControlEvents() {
|
|
1098
|
-
return [...this._controlEvents];
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
// ---------------------------------------------------------------------------
|
|
1102
|
-
// Helpers to discriminate ProviderStreamItem union members
|
|
1103
|
-
// ---------------------------------------------------------------------------
|
|
1104
|
-
function isChunk(item) {
|
|
1105
|
-
return ("type" in item &&
|
|
1106
|
-
item["type"] === "chunk" &&
|
|
1107
|
-
typeof item["content"] === "string");
|
|
1108
|
-
}
|
|
1109
|
-
function isToolCall(item) {
|
|
1110
|
-
return ("name" in item &&
|
|
1111
|
-
typeof item["name"] === "string" &&
|
|
1112
|
-
"id" in item);
|
|
1113
807
|
}
|
|
1114
808
|
//# sourceMappingURL=step-executor.js.map
|