@nodetool-ai/agents 0.7.0-rc.23 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/analysis/audio-dsp.d.ts +224 -0
- package/dist/analysis/audio-dsp.d.ts.map +1 -0
- package/dist/analysis/audio-dsp.js +645 -0
- package/dist/analysis/audio-dsp.js.map +1 -0
- package/dist/analysis/media-decode.d.ts +98 -0
- package/dist/analysis/media-decode.d.ts.map +1 -0
- package/dist/analysis/media-decode.js +226 -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 +90 -0
- package/dist/author-graph.d.ts.map +1 -0
- package/dist/author-graph.js +317 -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/GamePublishRequest.d.ts +14 -0
- package/dist/capabilities/GamePublishRequest.d.ts.map +1 -0
- package/dist/capabilities/GamePublishRequest.js +2 -0
- package/dist/capabilities/GamePublishRequest.js.map +1 -0
- package/dist/capabilities/adapters.d.ts +27 -0
- package/dist/capabilities/adapters.d.ts.map +1 -0
- package/dist/capabilities/adapters.js +39 -0
- package/dist/capabilities/adapters.js.map +1 -0
- package/dist/capabilities/agent-activity.d.ts +27 -0
- package/dist/capabilities/agent-activity.d.ts.map +1 -0
- package/dist/capabilities/agent-activity.js +103 -0
- package/dist/capabilities/agent-activity.js.map +1 -0
- package/dist/capabilities/agentic-storyboard-finish.d.ts +67 -0
- package/dist/capabilities/agentic-storyboard-finish.d.ts.map +1 -0
- package/dist/capabilities/agentic-storyboard-finish.js +1321 -0
- package/dist/capabilities/agentic-storyboard-finish.js.map +1 -0
- package/dist/capabilities/agents.d.ts +81 -0
- package/dist/capabilities/agents.d.ts.map +1 -0
- package/dist/capabilities/agents.js +376 -0
- package/dist/capabilities/agents.js.map +1 -0
- package/dist/capabilities/agents.specs.d.ts +30 -0
- package/dist/capabilities/agents.specs.d.ts.map +1 -0
- package/dist/capabilities/agents.specs.js +313 -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 +823 -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 +415 -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 +62 -0
- package/dist/capabilities/args.d.ts.map +1 -0
- package/dist/capabilities/args.js +215 -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 +61 -0
- package/dist/capabilities/code.d.ts.map +1 -0
- package/dist/capabilities/code.js +366 -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/errors.d.ts +19 -0
- package/dist/capabilities/errors.d.ts.map +1 -0
- package/dist/capabilities/errors.js +109 -0
- package/dist/capabilities/errors.js.map +1 -0
- package/dist/capabilities/errors.specs.d.ts +11 -0
- package/dist/capabilities/errors.specs.d.ts.map +1 -0
- package/dist/capabilities/errors.specs.js +100 -0
- package/dist/capabilities/errors.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 +233 -0
- package/dist/capabilities/example-timelines.js.map +1 -0
- package/dist/capabilities/example-timelines.specs.d.ts +6 -0
- package/dist/capabilities/example-timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/example-timelines.specs.js +71 -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/finish-storyboard.d.ts +5 -0
- package/dist/capabilities/finish-storyboard.d.ts.map +1 -0
- package/dist/capabilities/finish-storyboard.js +278 -0
- package/dist/capabilities/finish-storyboard.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 +24 -0
- package/dist/capabilities/game.d.ts.map +1 -0
- package/dist/capabilities/game.js +1432 -0
- package/dist/capabilities/game.js.map +1 -0
- package/dist/capabilities/game.specs.d.ts +5 -0
- package/dist/capabilities/game.specs.d.ts.map +1 -0
- package/dist/capabilities/game.specs.js +110 -0
- package/dist/capabilities/game.specs.js.map +1 -0
- package/dist/capabilities/game3d.d.ts +17 -0
- package/dist/capabilities/game3d.d.ts.map +1 -0
- package/dist/capabilities/game3d.js +433 -0
- package/dist/capabilities/game3d.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/generations.d.ts +81 -0
- package/dist/capabilities/generations.d.ts.map +1 -0
- package/dist/capabilities/generations.js +387 -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 +78 -0
- package/dist/capabilities/invoke.d.ts.map +1 -0
- package/dist/capabilities/invoke.js +251 -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 +167 -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 +105 -0
- package/dist/capabilities/jobs.specs.js.map +1 -0
- package/dist/capabilities/js-scripts.d.ts +108 -0
- package/dist/capabilities/js-scripts.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.js +807 -0
- package/dist/capabilities/js-scripts.js.map +1 -0
- package/dist/capabilities/js-scripts.specs.d.ts +52 -0
- package/dist/capabilities/js-scripts.specs.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.specs.js +394 -0
- package/dist/capabilities/js-scripts.specs.js.map +1 -0
- package/dist/capabilities/lazy-tool.d.ts +41 -0
- package/dist/capabilities/lazy-tool.d.ts.map +1 -0
- package/dist/capabilities/lazy-tool.js +82 -0
- package/dist/capabilities/lazy-tool.js.map +1 -0
- package/dist/capabilities/legacy-tools.d.ts +15 -0
- package/dist/capabilities/legacy-tools.d.ts.map +1 -0
- package/dist/capabilities/legacy-tools.js +98 -0
- package/dist/capabilities/legacy-tools.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 +112 -0
- package/dist/capabilities/media.d.ts.map +1 -0
- package/dist/capabilities/media.js +2258 -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 +805 -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 +111 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +473 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/capabilities/run-agent.d.ts +19 -0
- package/dist/capabilities/run-agent.d.ts.map +1 -0
- package/dist/capabilities/run-agent.js +183 -0
- package/dist/capabilities/run-agent.js.map +1 -0
- package/dist/capabilities/runs.d.ts +9 -0
- package/dist/capabilities/runs.d.ts.map +1 -0
- package/dist/capabilities/runs.js +46 -0
- package/dist/capabilities/runs.js.map +1 -0
- package/dist/capabilities/runs.specs.d.ts +39 -0
- package/dist/capabilities/runs.specs.d.ts.map +1 -0
- package/dist/capabilities/runs.specs.js +52 -0
- package/dist/capabilities/runs.specs.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 +1795 -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 +1165 -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 +289 -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/storyboard-layout-check.d.ts +33 -0
- package/dist/capabilities/storyboard-layout-check.d.ts.map +1 -0
- package/dist/capabilities/storyboard-layout-check.js +229 -0
- package/dist/capabilities/storyboard-layout-check.js.map +1 -0
- package/dist/capabilities/storyboard-measured-sources.d.ts +10 -0
- package/dist/capabilities/storyboard-measured-sources.d.ts.map +1 -0
- package/dist/capabilities/storyboard-measured-sources.js +67 -0
- package/dist/capabilities/storyboard-measured-sources.js.map +1 -0
- package/dist/capabilities/storyboard-review-times.d.ts +4 -0
- package/dist/capabilities/storyboard-review-times.d.ts.map +1 -0
- package/dist/capabilities/storyboard-review-times.js +39 -0
- package/dist/capabilities/storyboard-review-times.js.map +1 -0
- package/dist/capabilities/storyboards.d.ts +52 -0
- package/dist/capabilities/storyboards.d.ts.map +1 -0
- package/dist/capabilities/storyboards.js +2467 -0
- package/dist/capabilities/storyboards.js.map +1 -0
- package/dist/capabilities/storyboards.specs.d.ts +45 -0
- package/dist/capabilities/storyboards.specs.d.ts.map +1 -0
- package/dist/capabilities/storyboards.specs.js +457 -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-bridge.d.ts +359 -0
- package/dist/capabilities/timeline-bridge.d.ts.map +1 -0
- package/dist/capabilities/timeline-bridge.js +1016 -0
- package/dist/capabilities/timeline-bridge.js.map +1 -0
- package/dist/capabilities/timeline-clip-frames.d.ts +17 -0
- package/dist/capabilities/timeline-clip-frames.d.ts.map +1 -0
- package/dist/capabilities/timeline-clip-frames.js +84 -0
- package/dist/capabilities/timeline-clip-frames.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-media-edit.d.ts +8 -0
- package/dist/capabilities/timeline-media-edit.d.ts.map +1 -0
- package/dist/capabilities/timeline-media-edit.js +94 -0
- package/dist/capabilities/timeline-media-edit.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 +960 -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 +250 -0
- package/dist/capabilities/timelines.d.ts.map +1 -0
- package/dist/capabilities/timelines.js +2825 -0
- package/dist/capabilities/timelines.js.map +1 -0
- package/dist/capabilities/timelines.specs.d.ts +142 -0
- package/dist/capabilities/timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/timelines.specs.js +1527 -0
- package/dist/capabilities/timelines.specs.js.map +1 -0
- package/dist/capabilities/types.d.ts +199 -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 +150 -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 +1557 -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 +858 -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 +197 -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 +1184 -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 +81 -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 +407 -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 +1974 -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 +200 -0
- package/dist/codeact/tool-api.d.ts.map +1 -0
- package/dist/codeact/tool-api.js +452 -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 +31 -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-runs.d.ts +3 -0
- package/dist/evals/codeact-api-runs.d.ts.map +1 -0
- package/dist/evals/codeact-api-runs.js +33 -0
- package/dist/evals/codeact-api-runs.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 +126 -0
- package/dist/evals/surfaces/sketch.d.ts.map +1 -0
- package/dist/evals/surfaces/sketch.js +1306 -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 +63 -0
- package/dist/evals/surfaces/timeline.d.ts.map +1 -0
- package/dist/evals/surfaces/timeline.js +655 -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 +61 -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 +236 -0
- package/dist/evals/tool-loop-eval.d.ts.map +1 -0
- package/dist/evals/tool-loop-eval.js +378 -0
- package/dist/evals/tool-loop-eval.js.map +1 -0
- package/dist/evals/tool-loop-permission.d.ts +29 -0
- package/dist/evals/tool-loop-permission.d.ts.map +1 -0
- package/dist/evals/tool-loop-permission.js +58 -0
- package/dist/evals/tool-loop-permission.js.map +1 -0
- package/dist/game-authoring.d.ts +4737 -0
- package/dist/game-authoring.d.ts.map +1 -0
- package/dist/game-authoring.js +146 -0
- package/dist/game-authoring.js.map +1 -0
- package/dist/game-code-bake.d.ts +26 -0
- package/dist/game-code-bake.d.ts.map +1 -0
- package/dist/game-code-bake.js +98 -0
- package/dist/game-code-bake.js.map +1 -0
- package/dist/game-examples.d.ts +1303 -0
- package/dist/game-examples.d.ts.map +1 -0
- package/dist/game-examples.js +188 -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 +208 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -60
- package/dist/index.js.map +1 -1
- package/dist/js-sandbox-worker/engine.d.ts +4 -0
- package/dist/js-sandbox-worker/engine.d.ts.map +1 -0
- package/dist/js-sandbox-worker/engine.js +45 -0
- package/dist/js-sandbox-worker/engine.js.map +1 -0
- 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 +1293 -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 +308 -0
- package/dist/js-sandbox-worker/worker-entry.js.map +1 -0
- package/dist/js-sandbox.d.ts +457 -15
- package/dist/js-sandbox.d.ts.map +1 -1
- package/dist/js-sandbox.js +2008 -311
- package/dist/js-sandbox.js.map +1 -1
- package/dist/js-script-app-runner.d.ts +11 -0
- package/dist/js-script-app-runner.d.ts.map +1 -0
- package/dist/js-script-app-runner.js +54 -0
- package/dist/js-script-app-runner.js.map +1 -0
- package/dist/js-script-sandbox.d.ts +27 -0
- package/dist/js-script-sandbox.d.ts.map +1 -0
- package/dist/js-script-sandbox.js +36 -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 +120 -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-pack-resolution.d.ts +21 -0
- package/dist/sandbox-pack-resolution.d.ts.map +1 -0
- package/dist/sandbox-pack-resolution.js +42 -0
- package/dist/sandbox-pack-resolution.js.map +1 -0
- package/dist/sandbox-toolbelt.d.ts +15 -0
- package/dist/sandbox-toolbelt.d.ts.map +1 -0
- package/dist/sandbox-toolbelt.js +70 -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 +37 -0
- package/dist/skill-prompt.d.ts.map +1 -0
- package/dist/skill-prompt.js +72 -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 +74 -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-capture.d.ts +21 -0
- package/dist/timeline-capture.d.ts.map +1 -0
- package/dist/timeline-capture.js +564 -0
- package/dist/timeline-capture.js.map +1 -0
- package/dist/timeline-code-bake.d.ts +75 -0
- package/dist/timeline-code-bake.d.ts.map +1 -0
- package/dist/timeline-code-bake.js +327 -0
- package/dist/timeline-code-bake.js.map +1 -0
- 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 +193 -0
- package/dist/timeline-preview/frames.d.ts.map +1 -0
- package/dist/timeline-preview/frames.js +731 -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 +53 -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 +289 -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 +204 -0
- package/dist/tools/mcp-tool-support.d.ts.map +1 -0
- package/dist/tools/mcp-tool-support.js +537 -0
- package/dist/tools/mcp-tool-support.js.map +1 -0
- package/dist/tools/mcp-tools.d.ts +106 -390
- package/dist/tools/mcp-tools.d.ts.map +1 -1
- package/dist/tools/mcp-tools.js +132 -601
- 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/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 +114 -14
- package/dist/agent-executor.d.ts +0 -62
- package/dist/agent-executor.d.ts.map +0 -1
- package/dist/agent-executor.js +0 -324
- package/dist/agent-executor.js.map +0 -1
- package/dist/agent-step-executor.d.ts +0 -28
- package/dist/agent-step-executor.d.ts.map +0 -1
- package/dist/agent-step-executor.js +0 -99
- package/dist/agent-step-executor.js.map +0 -1
- package/dist/agent-workflow-runner.d.ts +0 -31
- package/dist/agent-workflow-runner.d.ts.map +0 -1
- package/dist/agent-workflow-runner.js +0 -124
- package/dist/agent-workflow-runner.js.map +0 -1
- package/dist/agent.d.ts +0 -115
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -587
- package/dist/agent.js.map +0 -1
- package/dist/base-agent.d.ts +0 -42
- package/dist/base-agent.d.ts.map +0 -1
- package/dist/base-agent.js +0 -29
- package/dist/base-agent.js.map +0 -1
- package/dist/graph-planner.d.ts +0 -56
- package/dist/graph-planner.d.ts.map +0 -1
- package/dist/graph-planner.js +0 -311
- package/dist/graph-planner.js.map +0 -1
- package/dist/multi-mode-agent.d.ts +0 -86
- package/dist/multi-mode-agent.d.ts.map +0 -1
- package/dist/multi-mode-agent.js +0 -476
- package/dist/multi-mode-agent.js.map +0 -1
- package/dist/prompts/graph-planner-prompt.d.ts +0 -48
- package/dist/prompts/graph-planner-prompt.d.ts.map +0 -1
- package/dist/prompts/graph-planner-prompt.js +0 -180
- package/dist/prompts/graph-planner-prompt.js.map +0 -1
- package/dist/reject-agentic-provider.d.ts +0 -21
- package/dist/reject-agentic-provider.d.ts.map +0 -1
- package/dist/reject-agentic-provider.js +0 -32
- package/dist/reject-agentic-provider.js.map +0 -1
- package/dist/simple-agent.d.ts +0 -29
- package/dist/simple-agent.d.ts.map +0 -1
- package/dist/simple-agent.js +0 -54
- package/dist/simple-agent.js.map +0 -1
- package/dist/sub-agent-planner.d.ts +0 -33
- package/dist/sub-agent-planner.d.ts.map +0 -1
- package/dist/sub-agent-planner.js +0 -203
- package/dist/sub-agent-planner.js.map +0 -1
- package/dist/team/db-task-board.d.ts +0 -54
- package/dist/team/db-task-board.d.ts.map +0 -1
- package/dist/team/db-task-board.js +0 -361
- package/dist/team/db-task-board.js.map +0 -1
- package/dist/team/edge-message-bus.d.ts +0 -51
- package/dist/team/edge-message-bus.d.ts.map +0 -1
- package/dist/team/edge-message-bus.js +0 -169
- package/dist/team/edge-message-bus.js.map +0 -1
- package/dist/team/edge-task-board.d.ts +0 -77
- package/dist/team/edge-task-board.d.ts.map +0 -1
- package/dist/team/edge-task-board.js +0 -140
- package/dist/team/edge-task-board.js.map +0 -1
- package/dist/team/index.d.ts +0 -16
- package/dist/team/index.d.ts.map +0 -1
- package/dist/team/index.js +0 -17
- package/dist/team/index.js.map +0 -1
- package/dist/team/message-bus.d.ts +0 -58
- package/dist/team/message-bus.d.ts.map +0 -1
- package/dist/team/message-bus.js +0 -151
- package/dist/team/message-bus.js.map +0 -1
- package/dist/team/task-board.d.ts +0 -106
- package/dist/team/task-board.d.ts.map +0 -1
- package/dist/team/task-board.js +0 -370
- package/dist/team/task-board.js.map +0 -1
- package/dist/team/team-executor.d.ts +0 -72
- package/dist/team/team-executor.d.ts.map +0 -1
- package/dist/team/team-executor.js +0 -466
- package/dist/team/team-executor.js.map +0 -1
- package/dist/team/team-tools.d.ts +0 -252
- package/dist/team/team-tools.d.ts.map +0 -1
- package/dist/team/team-tools.js +0 -412
- package/dist/team/team-tools.js.map +0 -1
- package/dist/team/types.d.ts +0 -198
- package/dist/team/types.d.ts.map +0 -1
- package/dist/team/types.js +0 -8
- package/dist/team/types.js.map +0 -1
- package/dist/tools/add-edge-tool.d.ts +0 -18
- package/dist/tools/add-edge-tool.d.ts.map +0 -1
- package/dist/tools/add-edge-tool.js +0 -92
- package/dist/tools/add-edge-tool.js.map +0 -1
- package/dist/tools/add-node-tool.d.ts +0 -22
- package/dist/tools/add-node-tool.d.ts.map +0 -1
- package/dist/tools/add-node-tool.js +0 -128
- package/dist/tools/add-node-tool.js.map +0 -1
- package/dist/tools/asset-tools.d.ts +0 -58
- package/dist/tools/asset-tools.d.ts.map +0 -1
- package/dist/tools/asset-tools.js +0 -191
- package/dist/tools/asset-tools.js.map +0 -1
- package/dist/tools/calculator-tool.d.ts +0 -24
- package/dist/tools/calculator-tool.d.ts.map +0 -1
- package/dist/tools/calculator-tool.js +0 -64
- package/dist/tools/calculator-tool.js.map +0 -1
- package/dist/tools/claude-code-tools.d.ts +0 -96
- package/dist/tools/claude-code-tools.d.ts.map +0 -1
- package/dist/tools/claude-code-tools.js +0 -463
- package/dist/tools/claude-code-tools.js.map +0 -1
- package/dist/tools/code-tools.d.ts +0 -26
- package/dist/tools/code-tools.d.ts.map +0 -1
- package/dist/tools/code-tools.js +0 -82
- package/dist/tools/code-tools.js.map +0 -1
- package/dist/tools/create-plan-tool.d.ts +0 -29
- package/dist/tools/create-plan-tool.d.ts.map +0 -1
- package/dist/tools/create-plan-tool.js +0 -355
- package/dist/tools/create-plan-tool.js.map +0 -1
- package/dist/tools/create-task-tool.d.ts +0 -28
- package/dist/tools/create-task-tool.d.ts.map +0 -1
- package/dist/tools/create-task-tool.js +0 -254
- package/dist/tools/create-task-tool.js.map +0 -1
- package/dist/tools/email-tools.d.ts +0 -76
- package/dist/tools/email-tools.d.ts.map +0 -1
- package/dist/tools/email-tools.js +0 -259
- package/dist/tools/email-tools.js.map +0 -1
- package/dist/tools/filesystem-tools.d.ts +0 -77
- package/dist/tools/filesystem-tools.d.ts.map +0 -1
- package/dist/tools/filesystem-tools.js +0 -334
- package/dist/tools/filesystem-tools.js.map +0 -1
- package/dist/tools/find-model-tool.d.ts +0 -25
- package/dist/tools/find-model-tool.d.ts.map +0 -1
- package/dist/tools/find-model-tool.js +0 -236
- package/dist/tools/find-model-tool.js.map +0 -1
- package/dist/tools/finish-graph-tool.d.ts +0 -23
- package/dist/tools/finish-graph-tool.d.ts.map +0 -1
- package/dist/tools/finish-graph-tool.js +0 -46
- package/dist/tools/finish-graph-tool.js.map +0 -1
- package/dist/tools/js-code-tool.d.ts +0 -30
- package/dist/tools/js-code-tool.d.ts.map +0 -1
- package/dist/tools/js-code-tool.js +0 -98
- package/dist/tools/js-code-tool.js.map +0 -1
- package/dist/tools/local-get-node-info-tool.d.ts +0 -19
- package/dist/tools/local-get-node-info-tool.d.ts.map +0 -1
- package/dist/tools/local-get-node-info-tool.js +0 -75
- package/dist/tools/local-get-node-info-tool.js.map +0 -1
- package/dist/tools/local-list-nodes-tool.d.ts +0 -19
- package/dist/tools/local-list-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-list-nodes-tool.js +0 -69
- package/dist/tools/local-list-nodes-tool.js.map +0 -1
- package/dist/tools/local-search-nodes-tool.d.ts +0 -21
- package/dist/tools/local-search-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-search-nodes-tool.js +0 -111
- package/dist/tools/local-search-nodes-tool.js.map +0 -1
- package/dist/tools/math-tools.d.ts +0 -156
- package/dist/tools/math-tools.d.ts.map +0 -1
- package/dist/tools/math-tools.js +0 -422
- package/dist/tools/math-tools.js.map +0 -1
- package/dist/tools/model-tools.d.ts +0 -25
- package/dist/tools/model-tools.d.ts.map +0 -1
- package/dist/tools/model-tools.js +0 -48
- package/dist/tools/model-tools.js.map +0 -1
- package/dist/tools/pdf-tools.d.ts +0 -152
- package/dist/tools/pdf-tools.d.ts.map +0 -1
- package/dist/tools/pdf-tools.js +0 -339
- package/dist/tools/pdf-tools.js.map +0 -1
- package/dist/tools/tool-registry.d.ts +0 -9
- package/dist/tools/tool-registry.d.ts.map +0 -1
- package/dist/tools/tool-registry.js +0 -17
- package/dist/tools/tool-registry.js.map +0 -1
- package/dist/tools/workspace-tools.d.ts +0 -58
- package/dist/tools/workspace-tools.d.ts.map +0 -1
- package/dist/tools/workspace-tools.js +0 -152
- package/dist/tools/workspace-tools.js.map +0 -1
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The interpreter half of the QuickJS sandbox: everything that happens *inside*
|
|
3
|
+
* one `runSandboxed` call.
|
|
4
|
+
*
|
|
5
|
+
* `runInSandbox` (../js-sandbox.ts) owns the host half — building the bridge
|
|
6
|
+
* record, the WASM/host/capability dispatchers, the cancellation race, the
|
|
7
|
+
* unhandled-rejection guard, and the result shape callers see. This module owns
|
|
8
|
+
* what runs against the guest context: the interrupt handler, the never-reject
|
|
9
|
+
* wrap layer, the init prelude, the entry module, and the sync-back extractor.
|
|
10
|
+
*
|
|
11
|
+
* The split exists so the guest can run on a `worker_threads` worker without a
|
|
12
|
+
* second copy of any of it. Both hosts call {@link runInterpreter}; the pieces
|
|
13
|
+
* that must live next to the guest (the module loader's closures, the
|
|
14
|
+
* serializers, the interrupt handler) live here, and the pieces that need live
|
|
15
|
+
* host objects reach this module as plain functions — {@link
|
|
16
|
+
* InterpreterParams.isAborted} and {@link InterpreterParams.suspendedMs} stand
|
|
17
|
+
* in for the `AbortSignal` and the `SandboxClock`, neither of which can cross a
|
|
18
|
+
* thread.
|
|
19
|
+
*
|
|
20
|
+
* Browser-safe: nothing here imports a Node builtin, statically or otherwise.
|
|
21
|
+
*/
|
|
22
|
+
import { addSerializer, expose, getModuleLoader as createDefaultModuleLoader, modulePathNormalizer as defaultModulePathNormalizer } from "@sebastianwessel/quickjs";
|
|
23
|
+
import * as acorn from "acorn";
|
|
24
|
+
import { captureTimelineScenes } from "../timeline-capture.js";
|
|
25
|
+
import { Scope } from "quickjs-emscripten-core";
|
|
26
|
+
import { SANDBOX_CAPABILITY_BRIDGE_SOURCE, SANDBOX_CAPABILITY_BRIDGE_SPECIFIER, SANDBOX_CAPABILITY_DISPATCH_GLOBAL } from "@nodetool-ai/protocol/sandbox-capability";
|
|
27
|
+
import { generateSandboxHostFacade, sandboxHostModule, SANDBOX_HOST_BRIDGE_SOURCE, SANDBOX_HOST_BRIDGE_SPECIFIER, SANDBOX_HOST_DISPATCH_GLOBAL } from "@nodetool-ai/protocol/sandbox-host";
|
|
28
|
+
import { generateSandboxWasmFacade, SANDBOX_WASM_BRIDGE_SOURCE, SANDBOX_WASM_BRIDGE_SPECIFIER, SANDBOX_WASM_DISPATCH_GLOBAL } from "@nodetool-ai/protocol/sandbox-wasm";
|
|
29
|
+
import { CANVAS_GRADIENT_FACTORIES, CANVAS_GRADIENT_MARKER, CANVAS_METHODS, CANVAS_PROPERTIES } from "../sandbox-canvas-api.js";
|
|
30
|
+
import { BASE64_ALPHABET, SANDBOX_BYTES_MARKER } from "../sandbox-bytes.js";
|
|
31
|
+
import { MEDIA_REF_MEMBERS } from "../sandbox-constants.js";
|
|
32
|
+
import { BOOTSTRAP_MODULE_SOURCES, normalizeBootstrapModuleId } from "../sandbox-bootstrap-modules.js";
|
|
33
|
+
import { decodeGuestPayload, encodeHostRecord, GUEST_GLOBALS_JSON_BINDING, GUEST_GLOBALS_SIDECAR_BINDING, GUEST_JSON_TRANSPORT_SOURCE, GUEST_MARSHAL_GLOBAL } from "../sandbox-json-transport.js";
|
|
34
|
+
import { isFunction, isObjectLike } from "../utils/type-guards.js";
|
|
35
|
+
/**
|
|
36
|
+
* The engine's wall-clock abort is a `setTimeout`, and Node fires a delay past
|
|
37
|
+
* this immediately instead of never — so this is the practical "no backstop".
|
|
38
|
+
*/
|
|
39
|
+
export const MAX_ENGINE_TIMEOUT_MS = 2_147_483_647;
|
|
40
|
+
/**
|
|
41
|
+
* What the guest is told when it calls `stream` in a run that has no input
|
|
42
|
+
* stream behind it. Shared by the host bridge and the guest prelude so both
|
|
43
|
+
* paths say the same thing.
|
|
44
|
+
*/
|
|
45
|
+
export const NO_INPUT_STREAM_MESSAGE = "stream() requires streaming-input mode; this run has no input stream";
|
|
46
|
+
let serializersRegistered = false;
|
|
47
|
+
/**
|
|
48
|
+
* The library's serializer table is module-global, so this registers once —
|
|
49
|
+
* and a worker, holding its own module instance, registers its own.
|
|
50
|
+
*/
|
|
51
|
+
export function registerTypedArraySerializers() {
|
|
52
|
+
if (serializersRegistered)
|
|
53
|
+
return;
|
|
54
|
+
serializersRegistered = true;
|
|
55
|
+
// Map every typed-array class to a native Uint8Array on the host side.
|
|
56
|
+
// The guest returns `new Uint8Array([...])` (or friends); without this,
|
|
57
|
+
// the library's generic object serializer produces a plain object with
|
|
58
|
+
// numeric keys, which downstream code (CodeNode's normalizeOutput) would
|
|
59
|
+
// miss when detecting binary values.
|
|
60
|
+
const typedArrayNames = [
|
|
61
|
+
"Uint8Array",
|
|
62
|
+
"Int8Array",
|
|
63
|
+
"Uint8ClampedArray",
|
|
64
|
+
"Int16Array",
|
|
65
|
+
"Uint16Array",
|
|
66
|
+
"Int32Array",
|
|
67
|
+
"Uint32Array",
|
|
68
|
+
"Float32Array",
|
|
69
|
+
"Float64Array"
|
|
70
|
+
];
|
|
71
|
+
for (const name of typedArrayNames) {
|
|
72
|
+
addSerializer(name, (ctx, handle) => {
|
|
73
|
+
const bufferHandle = ctx.getProp(handle, "buffer");
|
|
74
|
+
try {
|
|
75
|
+
// `getArrayBuffer` hands back a Lifetime that owns a view into the
|
|
76
|
+
// guest heap, not a plain value. Dropping it leaks the underlying
|
|
77
|
+
// object, and enough leaks trip `list_empty(&rt->gc_obj_list)` in
|
|
78
|
+
// JS_FreeRuntime — an Emscripten abort that kills the run *after* it
|
|
79
|
+
// produced its answer. Copy out, then release.
|
|
80
|
+
const ab = ctx.getArrayBuffer(bufferHandle);
|
|
81
|
+
try {
|
|
82
|
+
return Uint8Array.from(ab.value);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
ab.dispose();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
bufferHandle.dispose();
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// The never-reject convention
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
/**
|
|
98
|
+
* Marker key placed on an object to signal a sandboxed error. A host async
|
|
99
|
+
* function that would normally `throw` instead resolves with one of these
|
|
100
|
+
* objects; a prelude inside the guest rewraps them as real guest-side errors.
|
|
101
|
+
*
|
|
102
|
+
* This indirection exists because the current `@sebastianwessel/quickjs`
|
|
103
|
+
* runtime leaks handles whenever a host-backed guest Promise is *rejected*,
|
|
104
|
+
* tripping an internal assertion (`list_empty(&rt->gc_obj_list)`) in
|
|
105
|
+
* quickjs-ng when the runtime is freed. Routing failures through a resolved
|
|
106
|
+
* tagged value sidesteps the leak while preserving the guest-visible
|
|
107
|
+
* behaviour (the user still gets a thrown Error with name + message).
|
|
108
|
+
*/
|
|
109
|
+
export const SANDBOX_ERROR_MARKER = "__nodetool_sandbox_error__";
|
|
110
|
+
function neverReject(fn) {
|
|
111
|
+
return async (...args) => {
|
|
112
|
+
try {
|
|
113
|
+
return await fn(...args);
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
return {
|
|
117
|
+
[SANDBOX_ERROR_MARKER]: true,
|
|
118
|
+
name: e instanceof Error ? e.name : "Error",
|
|
119
|
+
message: e instanceof Error ? e.message : String(e)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Compose with {@link neverReject}: once the run is cancelled, every subsequent
|
|
126
|
+
* host bridge call fails fast instead of doing work. The guest prelude rewraps
|
|
127
|
+
* the marker into a real `throw`, so an awaiting script unwinds on its next
|
|
128
|
+
* bridge call rather than running to completion after the user cancelled.
|
|
129
|
+
*
|
|
130
|
+
* Without an `isAborted` probe — a run the caller gave no cancellation source —
|
|
131
|
+
* the bridge is handed back untouched, exactly as when there is no signal.
|
|
132
|
+
*/
|
|
133
|
+
function guardAbort(fn, isAborted) {
|
|
134
|
+
if (!isAborted)
|
|
135
|
+
return fn;
|
|
136
|
+
return async (...args) => {
|
|
137
|
+
if (isAborted()) {
|
|
138
|
+
return {
|
|
139
|
+
[SANDBOX_ERROR_MARKER]: true,
|
|
140
|
+
name: "ExecutionCancelled",
|
|
141
|
+
message: "Execution cancelled"
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
return fn(...args);
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Replace every function reachable inside a caller-supplied data global with
|
|
149
|
+
* `wrap(fn)`, shallow-cloning the plain objects/arrays that hold them.
|
|
150
|
+
*
|
|
151
|
+
* A caller-supplied global is often a stub object nested a level or two deep
|
|
152
|
+
* — `{ nodetool: { timelines: { edit(id, ops) { ... } } } }` is exactly the
|
|
153
|
+
* shape `bakeTimelineCode`'s hermetic stub uses. Only the top-level `globals`
|
|
154
|
+
* entries were ever routed through the never-reject convention; a function
|
|
155
|
+
* found deeper than that reached the guest through the wrapper's own generic
|
|
156
|
+
* marshaling (see the call site), where a host throw or promise rejection is
|
|
157
|
+
* the exact shape `SANDBOX_ERROR_MARKER` exists to avoid. Running every
|
|
158
|
+
* nested function through the same `wrap` the top-level ones get — before the
|
|
159
|
+
* value is even classified as JSON-representable or not — means no host
|
|
160
|
+
* function this run exposes, at any depth, can ever throw or reject across
|
|
161
|
+
* the boundary; the guest-side deep-unwrap at the call site turns the
|
|
162
|
+
* resulting tagged value back into an ordinary guest `throw`.
|
|
163
|
+
*/
|
|
164
|
+
function wrapNestedFunctionsDeep(value, wrap, seen = new Set()) {
|
|
165
|
+
if (isFunction(value)) {
|
|
166
|
+
return wrap(value);
|
|
167
|
+
}
|
|
168
|
+
if (value === null || typeof value !== "object")
|
|
169
|
+
return value;
|
|
170
|
+
if (seen.has(value))
|
|
171
|
+
return value;
|
|
172
|
+
seen.add(value);
|
|
173
|
+
if (Array.isArray(value)) {
|
|
174
|
+
return value.map((entry) => wrapNestedFunctionsDeep(entry, wrap, seen));
|
|
175
|
+
}
|
|
176
|
+
// Only plain records can hold a bridge function. Rebuilding anything else
|
|
177
|
+
// (Uint8Array, Date, Map) as a record strips the type the guest relies on.
|
|
178
|
+
const proto = Object.getPrototypeOf(value);
|
|
179
|
+
if (proto !== Object.prototype && proto !== null)
|
|
180
|
+
return value;
|
|
181
|
+
const out = {};
|
|
182
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
183
|
+
out[key] = wrapNestedFunctionsDeep(entry, wrap, seen);
|
|
184
|
+
}
|
|
185
|
+
return out;
|
|
186
|
+
}
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
// Guest surface tables
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
/**
|
|
191
|
+
* Names injected as bridge bindings into the QuickJS guest. The rest of the
|
|
192
|
+
* `buildSandbox` record (JSON, Math, Date, URL, etc.) is deliberately NOT
|
|
193
|
+
* marshaled — QuickJS already provides native implementations, and re-exposing
|
|
194
|
+
* host versions creates thousands of handles that slow execution and leak on
|
|
195
|
+
* teardown.
|
|
196
|
+
*/
|
|
197
|
+
export const EXPOSED_BRIDGE_NAMES = [
|
|
198
|
+
"console",
|
|
199
|
+
"fetch",
|
|
200
|
+
"crypto",
|
|
201
|
+
"sleep",
|
|
202
|
+
"getSecret",
|
|
203
|
+
"workspace",
|
|
204
|
+
"assetToSandbox",
|
|
205
|
+
"sandboxToAsset",
|
|
206
|
+
"progress",
|
|
207
|
+
"emit",
|
|
208
|
+
"output",
|
|
209
|
+
"format",
|
|
210
|
+
"image",
|
|
211
|
+
"audio",
|
|
212
|
+
"video",
|
|
213
|
+
"canvas",
|
|
214
|
+
"media",
|
|
215
|
+
"__maxIter",
|
|
216
|
+
"__secretScope"
|
|
217
|
+
];
|
|
218
|
+
/**
|
|
219
|
+
* Globals the init prelude removes. `eval` and `Function` go so the guest
|
|
220
|
+
* cannot re-enter code generation. The rest are stubs
|
|
221
|
+
* `@sebastianwessel/quickjs` installs unconditionally (its node-compatibility
|
|
222
|
+
* layer and `provideEnv` have no off switch): `Buffer`, `process`, `env`,
|
|
223
|
+
* `Headers`, `Request`, `Response`, `performance`. Nothing in the sandbox's
|
|
224
|
+
* own machinery uses them — the fetch bridge returns plain objects and the
|
|
225
|
+
* guest-to-host serializers dispatch on constructor names no guest code can
|
|
226
|
+
* reach once the classes are gone — so they are deleted to keep the guest
|
|
227
|
+
* surface minimal instead of documented as stubs.
|
|
228
|
+
*/
|
|
229
|
+
export const DELETED_GUEST_GLOBALS = [
|
|
230
|
+
"eval",
|
|
231
|
+
"Function",
|
|
232
|
+
"Buffer",
|
|
233
|
+
"process",
|
|
234
|
+
"env",
|
|
235
|
+
"Headers",
|
|
236
|
+
"Request",
|
|
237
|
+
"Response",
|
|
238
|
+
"performance"
|
|
239
|
+
];
|
|
240
|
+
/** Name the host parks the raw (never-rejecting) dispatcher bridge on. */
|
|
241
|
+
export const SANDBOX_WASM_BRIDGE_BINDING = "__wasmCall";
|
|
242
|
+
/** Name the host parks the raw (never-rejecting) host dispatcher bridge on. */
|
|
243
|
+
export const SANDBOX_HOST_BRIDGE_BINDING = "__hostCall";
|
|
244
|
+
/** Name the host parks the raw (never-rejecting) capability dispatcher on. */
|
|
245
|
+
export const SANDBOX_CAPABILITY_BRIDGE_BINDING = "__capabilityCall";
|
|
246
|
+
/**
|
|
247
|
+
* Names the host parks the input bridges on, which the prelude captures and
|
|
248
|
+
* then deletes — the guest reaches them only through `stream`.
|
|
249
|
+
*/
|
|
250
|
+
export const SANDBOX_INPUT_TAKE_BINDING = "__takeInput";
|
|
251
|
+
export const SANDBOX_STREAM_OPEN_BINDING = "__streamOpen";
|
|
252
|
+
// ---------------------------------------------------------------------------
|
|
253
|
+
// User code wrapping
|
|
254
|
+
// ---------------------------------------------------------------------------
|
|
255
|
+
/**
|
|
256
|
+
* Timer globals the guest must not see. The documented contract has always
|
|
257
|
+
* been "`sleep` is the only timer", but `@sebastianwessel/quickjs` installs
|
|
258
|
+
* host-backed `setTimeout`/`setInterval`/`setImmediate` into the context on
|
|
259
|
+
* every `evalCode` call — *after* the init prelude runs — so a prelude-time
|
|
260
|
+
* `delete` does not stick. {@link wrapCode} deletes them inside the user-code
|
|
261
|
+
* module itself, which evaluates after the library's re-install. They are
|
|
262
|
+
* blocked deliberately: their callbacks fire through `ctx.callFunction` with
|
|
263
|
+
* errors silently discarded, outside the never-reject and abort-guard
|
|
264
|
+
* conventions every bridge follows. Concurrency does not need them —
|
|
265
|
+
* bridge calls run in parallel under `Promise.all`/`parallelMap`.
|
|
266
|
+
*/
|
|
267
|
+
export const BLOCKED_TIMER_GLOBALS = [
|
|
268
|
+
"setTimeout",
|
|
269
|
+
"clearTimeout",
|
|
270
|
+
"setInterval",
|
|
271
|
+
"clearInterval",
|
|
272
|
+
"setImmediate",
|
|
273
|
+
"clearImmediate"
|
|
274
|
+
];
|
|
275
|
+
/**
|
|
276
|
+
* Wrap user code as the default export of an ES module with a top-level-awaited
|
|
277
|
+
* async IIFE body, so `return <value>` inside the snippet becomes the module's
|
|
278
|
+
* default export and `await` at the top level works. The module first drops
|
|
279
|
+
* the timer globals the engine re-installs per evaluation (see
|
|
280
|
+
* {@link BLOCKED_TIMER_GLOBALS}).
|
|
281
|
+
*/
|
|
282
|
+
export function wrapCode(code, prelude = "", encodeResult = false) {
|
|
283
|
+
const [open, close] = resultEncoding(encodeResult);
|
|
284
|
+
return `${dropTimersStatement()}${prelude}
|
|
285
|
+
export default ${open}await (async () => {
|
|
286
|
+
${code}
|
|
287
|
+
})()${close};`;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Wrap the module's default export in the guest's JSON encoder, or leave it
|
|
291
|
+
* alone. Both halves sit on the lines the IIFE already occupies, so
|
|
292
|
+
* {@link entryBodyLineOffset} — and every stack trace mapped through it — is
|
|
293
|
+
* unchanged either way.
|
|
294
|
+
*/
|
|
295
|
+
function resultEncoding(encodeResult) {
|
|
296
|
+
return encodeResult
|
|
297
|
+
? [`globalThis.${GUEST_MARSHAL_GLOBAL}(`, ")"]
|
|
298
|
+
: ["", ""];
|
|
299
|
+
}
|
|
300
|
+
function dropTimersStatement() {
|
|
301
|
+
return BLOCKED_TIMER_GLOBALS.map((n) => `delete globalThis.${n};`).join(" ");
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Build the entry module for user code, hoisting static `import` declarations
|
|
305
|
+
* out of the async IIFE {@link wrapCode} wraps the body in.
|
|
306
|
+
*
|
|
307
|
+
* An `import` is only legal at module top level, so the IIFE body cannot hold
|
|
308
|
+
* one. The imports are spliced out by source range and re-emitted on a single
|
|
309
|
+
* line above the wrapper; the ranges they vacate are blanked with spaces (never
|
|
310
|
+
* with fewer newlines), so every remaining line of user code keeps its content
|
|
311
|
+
* and its offset from the body's start. The whole body shifts down by exactly
|
|
312
|
+
* one line relative to {@link wrapCode}'s output.
|
|
313
|
+
*
|
|
314
|
+
* Import-free code takes the {@link wrapCode} path unchanged, and so does code
|
|
315
|
+
* acorn cannot parse — a syntax error must reach the guest exactly as the user
|
|
316
|
+
* wrote it, not as this transform's complaint about it.
|
|
317
|
+
*
|
|
318
|
+
* Dynamic `import()` expressions are left where they are. The module loader
|
|
319
|
+
* denies them at runtime (see {@link createGuestModuleHost}); rewriting them
|
|
320
|
+
* here would only move a runtime denial into a confusing compile-time one.
|
|
321
|
+
*/
|
|
322
|
+
export function buildEntryModule(source, prelude = "", encodeResult = false) {
|
|
323
|
+
// Timeline code gets its scene capture records here, the one step every
|
|
324
|
+
// guest run passes (docs/timeline-code-capture.md). The records add no
|
|
325
|
+
// line breaks, so line offsets below stay correct.
|
|
326
|
+
const code = captureTimelineScenes(source);
|
|
327
|
+
let program;
|
|
328
|
+
try {
|
|
329
|
+
program = acorn.parse(code, {
|
|
330
|
+
ecmaVersion: "latest",
|
|
331
|
+
sourceType: "module",
|
|
332
|
+
allowAwaitOutsideFunction: true,
|
|
333
|
+
allowReturnOutsideFunction: true
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
return wrapCode(code, prelude, encodeResult);
|
|
338
|
+
}
|
|
339
|
+
const imports = program.body.filter((node) => node.type === "ImportDeclaration");
|
|
340
|
+
if (imports.length === 0)
|
|
341
|
+
return wrapCode(code, prelude, encodeResult);
|
|
342
|
+
const hoisted = [];
|
|
343
|
+
let body = "";
|
|
344
|
+
let cursor = 0;
|
|
345
|
+
for (const declaration of imports) {
|
|
346
|
+
const text = code.slice(declaration.start, declaration.end);
|
|
347
|
+
hoisted.push(text.endsWith(";") ? text : `${text};`);
|
|
348
|
+
body += code.slice(cursor, declaration.start);
|
|
349
|
+
body += text.replace(/[^\n]/g, " ");
|
|
350
|
+
cursor = declaration.end;
|
|
351
|
+
}
|
|
352
|
+
body += code.slice(cursor);
|
|
353
|
+
const [open, close] = resultEncoding(encodeResult);
|
|
354
|
+
return `${hoisted.join(" ")}
|
|
355
|
+
${dropTimersStatement()}${prelude}
|
|
356
|
+
export default ${open}await (async () => {
|
|
357
|
+
${body}
|
|
358
|
+
})()${close};`;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* How many module lines {@link buildEntryModule} (or {@link wrapCode}) place
|
|
362
|
+
* before the first line of the code it was given.
|
|
363
|
+
*
|
|
364
|
+
* QuickJS reports stack positions in the wrapped entry module, so an error on
|
|
365
|
+
* the guest's line N sits at `N + offset` in the source the user wrote. The
|
|
366
|
+
* hoisted-import path spends one extra leading line (the joined imports) over
|
|
367
|
+
* the plain wrapper, and which path applied is decided by the same acorn parse
|
|
368
|
+
* {@link buildEntryModule} runs — so the offset must come from here, not be
|
|
369
|
+
* guessed by callers.
|
|
370
|
+
*/
|
|
371
|
+
export function entryBodyLineOffset(code) {
|
|
372
|
+
try {
|
|
373
|
+
const program = acorn.parse(code, {
|
|
374
|
+
ecmaVersion: "latest",
|
|
375
|
+
sourceType: "module",
|
|
376
|
+
allowAwaitOutsideFunction: true,
|
|
377
|
+
allowReturnOutsideFunction: true
|
|
378
|
+
});
|
|
379
|
+
const hasImports = program.body.some((node) => node.type === "ImportDeclaration");
|
|
380
|
+
return hasImports ? 3 : 2;
|
|
381
|
+
}
|
|
382
|
+
catch {
|
|
383
|
+
// Unparsable code takes the wrapCode path — the same path its syntax
|
|
384
|
+
// error will be reported against.
|
|
385
|
+
return 2;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
// ---------------------------------------------------------------------------
|
|
389
|
+
// Guest module loading
|
|
390
|
+
// ---------------------------------------------------------------------------
|
|
391
|
+
/** Prefix of every module id this host resolves. Not a path — nothing mounts it. */
|
|
392
|
+
const GUEST_MODULE_PREFIX = "nodetool-sandbox:";
|
|
393
|
+
/**
|
|
394
|
+
* The module id every denial normalizes to. QuickJS never caches a module whose
|
|
395
|
+
* load failed, so one constant id serves every denial in a run: the normalizer
|
|
396
|
+
* records the reason, the loader immediately turns it into a guest-side Error.
|
|
397
|
+
*/
|
|
398
|
+
const DENIED_MODULE_ID = `${GUEST_MODULE_PREFIX}denied`;
|
|
399
|
+
/** Separator between a pack name and a file id inside a module id. */
|
|
400
|
+
const GUEST_MODULE_SEPARATOR = "|";
|
|
401
|
+
/**
|
|
402
|
+
* The private bridge module's guest id.
|
|
403
|
+
*
|
|
404
|
+
* Only a generated WASM facade may import it. The denial is decided by the
|
|
405
|
+
* importing module, so neither user code nor a pack's authored JavaScript can
|
|
406
|
+
* reach it by name — and a module that reaches the dispatcher some other way
|
|
407
|
+
* gains nothing beyond the run's declared WASM surface, because the
|
|
408
|
+
* dispatcher's own checks are the boundary.
|
|
409
|
+
*/
|
|
410
|
+
const WASM_BRIDGE_MODULE_ID = `${GUEST_MODULE_PREFIX}wasm-bridge`;
|
|
411
|
+
/**
|
|
412
|
+
* The private host-bridge module's guest id.
|
|
413
|
+
*
|
|
414
|
+
* Only a generated host facade may import it, decided by the importing module —
|
|
415
|
+
* so neither user code nor a pack's authored JavaScript can reach it by name.
|
|
416
|
+
* A module that reaches the dispatcher some other way gains nothing beyond the
|
|
417
|
+
* run's declared host surface, because the dispatcher's checks are the boundary.
|
|
418
|
+
*/
|
|
419
|
+
const HOST_BRIDGE_MODULE_ID = `${GUEST_MODULE_PREFIX}host-bridge`;
|
|
420
|
+
/**
|
|
421
|
+
* The private capability-bridge module's guest id.
|
|
422
|
+
*
|
|
423
|
+
* Same rule as the host bridge: only a generated capability facade may import
|
|
424
|
+
* it. What differs is who mounts a capability module — the host, per session,
|
|
425
|
+
* never a pack's manifest and never the model's consent allowlist.
|
|
426
|
+
*/
|
|
427
|
+
const CAPABILITY_BRIDGE_MODULE_ID = `${GUEST_MODULE_PREFIX}capability-bridge`;
|
|
428
|
+
function guestModuleId(packName, fileId) {
|
|
429
|
+
return `${GUEST_MODULE_PREFIX}${packName}${GUEST_MODULE_SEPARATOR}${fileId}`;
|
|
430
|
+
}
|
|
431
|
+
/** Resolve a `./`-relative specifier against a pack-relative file id. */
|
|
432
|
+
function resolveRelativeFileId(fromFileId, specifier) {
|
|
433
|
+
const parts = fromFileId.split("/").slice(0, -1);
|
|
434
|
+
for (const segment of specifier.split("/")) {
|
|
435
|
+
if (segment === "" || segment === ".")
|
|
436
|
+
continue;
|
|
437
|
+
if (segment === "..")
|
|
438
|
+
parts.pop();
|
|
439
|
+
else
|
|
440
|
+
parts.push(segment);
|
|
441
|
+
}
|
|
442
|
+
return parts.join("/");
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Install the run's declared sandbox modules as the *only* importable modules.
|
|
446
|
+
*
|
|
447
|
+
* The enforcement point is the **normalizer**, not the loader: QuickJS resolves
|
|
448
|
+
* an already-loaded module straight out of its cache without consulting the
|
|
449
|
+
* loader, but it normalizes every specifier first. A denial decided in the
|
|
450
|
+
* normalizer therefore also holds for `node:buffer` and friends, which the
|
|
451
|
+
* wrapper imports into the cache during its own bootstrap
|
|
452
|
+
* (`prepareNodeCompatibility`) before guest code exists.
|
|
453
|
+
*
|
|
454
|
+
* Three phases, in order:
|
|
455
|
+
*
|
|
456
|
+
* 1. **bootstrap** — the wrapper's `import 'node:buffer'` and the rest of its
|
|
457
|
+
* compat preamble run before our sandboxed function is called. They resolve
|
|
458
|
+
* through the library's own normalizer, and through its loader for anything
|
|
459
|
+
* {@link BOOTSTRAP_MODULE_SOURCES} does not serve a cheaper source for, or
|
|
460
|
+
* the runtime never starts.
|
|
461
|
+
* 2. **guest, linking** — only the run's declared specifiers and their
|
|
462
|
+
* intra-pack siblings resolve. Everything else — `node:*`, the compat
|
|
463
|
+
* modules the bootstrap warmed, absolute paths, `../` escapes, encoded
|
|
464
|
+
* traversals, another pack's internal files — is denied by name.
|
|
465
|
+
* 3. **guest, locked** — the entry module's static graph is linked, so any
|
|
466
|
+
* further resolution is a dynamic `import()`, and every one of those is
|
|
467
|
+
* denied. A computed specifier is unknowable ahead of the call, and the
|
|
468
|
+
* declaration is the whole contract, so the stricter rule is the honest one.
|
|
469
|
+
*
|
|
470
|
+
* Loaded module sources are prefixed with the timer deletions
|
|
471
|
+
* ({@link BLOCKED_TIMER_GLOBALS}) on the same line as their first statement:
|
|
472
|
+
* dependencies evaluate *before* the entry body, so the entry's own deletions
|
|
473
|
+
* come too late to harden them. `eval`/`Function` need no such treatment — the
|
|
474
|
+
* init prelude deletes them for the whole context before any user `evalCode`.
|
|
475
|
+
*/
|
|
476
|
+
export function createGuestModuleHost(modules, capabilityFacades) {
|
|
477
|
+
const sources = new Map();
|
|
478
|
+
const specifiers = new Map();
|
|
479
|
+
const facades = new Set();
|
|
480
|
+
const hostFacades = new Set();
|
|
481
|
+
const platformFacades = new Set();
|
|
482
|
+
for (const [specifier, source] of capabilityFacades ?? []) {
|
|
483
|
+
// A platform module has no pack behind it, so its guest id is derived from
|
|
484
|
+
// the specifier rather than from a pack/file pair.
|
|
485
|
+
const entryId = `${GUEST_MODULE_PREFIX}capability${GUEST_MODULE_SEPARATOR}${specifier}`;
|
|
486
|
+
specifiers.set(specifier, entryId);
|
|
487
|
+
sources.set(entryId, source);
|
|
488
|
+
platformFacades.add(entryId);
|
|
489
|
+
}
|
|
490
|
+
for (const module of modules?.modules ?? []) {
|
|
491
|
+
const entryId = guestModuleId(module.packName, module.moduleId);
|
|
492
|
+
if (module.kind === "host") {
|
|
493
|
+
// A host entry has no guest source of its own either: its specifier
|
|
494
|
+
// resolves to a facade generated from the protocol registry, so the guest
|
|
495
|
+
// surface of a host module is decided by NodeTool, never by the pack.
|
|
496
|
+
const spec = sandboxHostModule(module.hostId);
|
|
497
|
+
if (spec === undefined) {
|
|
498
|
+
throw new Error(`${module.specifier}: "${module.hostId}" is not a host module NodeTool implements`);
|
|
499
|
+
}
|
|
500
|
+
specifiers.set(module.specifier, entryId);
|
|
501
|
+
sources.set(entryId, generateSandboxHostFacade(module.specifier, spec));
|
|
502
|
+
hostFacades.add(entryId);
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (module.kind === "wasm") {
|
|
506
|
+
// A WASM entry has no guest source of its own: its specifier resolves to
|
|
507
|
+
// a generated facade over the per-run dispatcher. An authored sibling
|
|
508
|
+
// importing "./thing.wasm" lands on the same id, so it gets the same
|
|
509
|
+
// facade.
|
|
510
|
+
specifiers.set(module.specifier, entryId);
|
|
511
|
+
sources.set(entryId, generateSandboxWasmFacade(module.specifier, module.wasm));
|
|
512
|
+
facades.add(entryId);
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
specifiers.set(module.specifier, entryId);
|
|
516
|
+
sources.set(entryId, module.source);
|
|
517
|
+
for (const file of module.graph) {
|
|
518
|
+
if (file.kind !== "js")
|
|
519
|
+
continue;
|
|
520
|
+
sources.set(guestModuleId(module.packName, file.id), file.source);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
if (facades.size > 0)
|
|
524
|
+
sources.set(WASM_BRIDGE_MODULE_ID, SANDBOX_WASM_BRIDGE_SOURCE);
|
|
525
|
+
if (hostFacades.size > 0) {
|
|
526
|
+
sources.set(HOST_BRIDGE_MODULE_ID, SANDBOX_HOST_BRIDGE_SOURCE);
|
|
527
|
+
}
|
|
528
|
+
if (platformFacades.size > 0) {
|
|
529
|
+
sources.set(CAPABILITY_BRIDGE_MODULE_ID, SANDBOX_CAPABILITY_BRIDGE_SOURCE);
|
|
530
|
+
}
|
|
531
|
+
const hardening = dropTimersStatement();
|
|
532
|
+
let phase = "bootstrap";
|
|
533
|
+
let locked = false;
|
|
534
|
+
let denial = "";
|
|
535
|
+
const deny = (message) => {
|
|
536
|
+
denial = message;
|
|
537
|
+
return DENIED_MODULE_ID;
|
|
538
|
+
};
|
|
539
|
+
const resolve = (baseName, requested) => {
|
|
540
|
+
if (locked) {
|
|
541
|
+
return deny(`dynamic import() is not allowed in the sandbox (requested "${requested}")` +
|
|
542
|
+
` — declare it as a static \`import\` at the top of the code instead`);
|
|
543
|
+
}
|
|
544
|
+
if (requested === SANDBOX_HOST_BRIDGE_SPECIFIER) {
|
|
545
|
+
if (hostFacades.has(baseName))
|
|
546
|
+
return HOST_BRIDGE_MODULE_ID;
|
|
547
|
+
return deny(`"${SANDBOX_HOST_BRIDGE_SPECIFIER}" is private to the sandbox's generated host facades and cannot be imported`);
|
|
548
|
+
}
|
|
549
|
+
if (requested === SANDBOX_CAPABILITY_BRIDGE_SPECIFIER) {
|
|
550
|
+
if (platformFacades.has(baseName))
|
|
551
|
+
return CAPABILITY_BRIDGE_MODULE_ID;
|
|
552
|
+
return deny(`"${SANDBOX_CAPABILITY_BRIDGE_SPECIFIER}" is private to the sandbox's generated capability facades and cannot be imported`);
|
|
553
|
+
}
|
|
554
|
+
if (requested === SANDBOX_WASM_BRIDGE_SPECIFIER) {
|
|
555
|
+
if (facades.has(baseName))
|
|
556
|
+
return WASM_BRIDGE_MODULE_ID;
|
|
557
|
+
return deny(`"${SANDBOX_WASM_BRIDGE_SPECIFIER}" is private to the sandbox's generated WASM facades and cannot be imported`);
|
|
558
|
+
}
|
|
559
|
+
const declared = specifiers.get(requested);
|
|
560
|
+
if (declared !== undefined)
|
|
561
|
+
return declared;
|
|
562
|
+
if (requested.startsWith(".") && baseName.startsWith(GUEST_MODULE_PREFIX)) {
|
|
563
|
+
const separator = baseName.indexOf(GUEST_MODULE_SEPARATOR);
|
|
564
|
+
const pack = baseName.slice(GUEST_MODULE_PREFIX.length, separator);
|
|
565
|
+
const fileId = baseName.slice(separator + 1);
|
|
566
|
+
const target = resolveRelativeFileId(fileId, requested);
|
|
567
|
+
for (const candidate of [target, `${target}.js`, `${target}/index.js`]) {
|
|
568
|
+
const id = guestModuleId(pack, candidate);
|
|
569
|
+
if (sources.has(id))
|
|
570
|
+
return id;
|
|
571
|
+
}
|
|
572
|
+
return deny(`"${requested}" is not a file of the ${pack} sandbox package`);
|
|
573
|
+
}
|
|
574
|
+
return deny(`"${requested}" is not a sandbox package this run serves — only an installed pack the code imports resolves`);
|
|
575
|
+
};
|
|
576
|
+
return {
|
|
577
|
+
options: {
|
|
578
|
+
modulePathNormalizer: (baseName, requestedName, context) => phase === "bootstrap"
|
|
579
|
+
? defaultModulePathNormalizer(baseName, requestedName, context)
|
|
580
|
+
: resolve(baseName, requestedName),
|
|
581
|
+
getModuleLoader: (fs, runtimeOptions) => {
|
|
582
|
+
const fallback = createDefaultModuleLoader(fs, runtimeOptions);
|
|
583
|
+
return (moduleName, context) => {
|
|
584
|
+
if (moduleName === DENIED_MODULE_ID) {
|
|
585
|
+
return { error: new Error(denial) };
|
|
586
|
+
}
|
|
587
|
+
const source = sources.get(moduleName);
|
|
588
|
+
if (source !== undefined)
|
|
589
|
+
return { value: `${hardening}${source}` };
|
|
590
|
+
if (phase === "bootstrap") {
|
|
591
|
+
// The wrapper's own compat preamble. Most of what it compiles into
|
|
592
|
+
// every fresh runtime, the init prelude deletes a moment later, so
|
|
593
|
+
// it is served something cheaper — see BOOTSTRAP_MODULE_SOURCES.
|
|
594
|
+
const stub = BOOTSTRAP_MODULE_SOURCES.get(normalizeBootstrapModuleId(moduleName));
|
|
595
|
+
if (stub !== undefined)
|
|
596
|
+
return { value: stub };
|
|
597
|
+
return fallback(moduleName, context);
|
|
598
|
+
}
|
|
599
|
+
return {
|
|
600
|
+
error: new Error(`Module "${moduleName}" is not available`)
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
},
|
|
605
|
+
enterGuestPhase() {
|
|
606
|
+
phase = "guest";
|
|
607
|
+
},
|
|
608
|
+
lockStaticGraph() {
|
|
609
|
+
locked = true;
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Run one piece of user code against a fresh guest context.
|
|
615
|
+
*
|
|
616
|
+
* Resolves with the guest's verdict — including a guest-side error, which is a
|
|
617
|
+
* result and not a failure. It rejects only when the engine itself fails
|
|
618
|
+
* (an Emscripten abort, a marshaling error, a module host that could not be
|
|
619
|
+
* built), which the caller translates.
|
|
620
|
+
*/
|
|
621
|
+
export async function runInterpreter(params) {
|
|
622
|
+
const { runSandboxed, code, sandbox, globals, syncTargetNames, wasmCall, hostCall, capabilityCall, modules, capabilityFacades, timeoutMs, limits, suspendAllowanceMs, hasClock, isAborted, suspendedMs, onTiming } = params;
|
|
623
|
+
const interpreterStartedAt = performance.now();
|
|
624
|
+
let callbackEnteredAt = interpreterStartedAt;
|
|
625
|
+
let callbackFinishedAt = interpreterStartedAt;
|
|
626
|
+
let initMs = 0;
|
|
627
|
+
let userCodeMs = 0;
|
|
628
|
+
let syncMs = 0;
|
|
629
|
+
// Built for every run, including one that resolved nothing. An empty host
|
|
630
|
+
// serves no specifier and denies each by name; skipping it would leave the
|
|
631
|
+
// wrapper's own Node-compat modules (`node:buffer` and friends) reachable
|
|
632
|
+
// from guest code, which is the one thing the normalizer exists to stop.
|
|
633
|
+
const moduleHost = createGuestModuleHost(modules, capabilityFacades);
|
|
634
|
+
const outcome = await runSandboxed(async ({ ctx, evalCode }) => {
|
|
635
|
+
callbackEnteredAt = performance.now();
|
|
636
|
+
// Past this point the wrapper's own Node-compat bootstrap has run, so
|
|
637
|
+
// nothing else may resolve outside the run's declared modules.
|
|
638
|
+
moduleHost.enterGuestPhase();
|
|
639
|
+
// A CPU-bound guest never yields to the host event loop, so an abort
|
|
640
|
+
// listener can't fire and Promise.race can't help. QuickJS polls this
|
|
641
|
+
// interrupt handler from inside the interpreter, which is the only
|
|
642
|
+
// mechanism that can stop a spinning loop. Compose cancellation with
|
|
643
|
+
// the library's own wall-clock deadline (it installed one before
|
|
644
|
+
// calling us; replacing it means re-implementing the deadline here).
|
|
645
|
+
// Suspended time is added back, so a program parked on a permission
|
|
646
|
+
// prompt resumes with the budget it had when it asked.
|
|
647
|
+
const deadline = Date.now() + timeoutMs;
|
|
648
|
+
ctx.runtime.setInterruptHandler(() => isAborted?.() === true ||
|
|
649
|
+
Date.now() > deadline + (suspendedMs?.() ?? 0));
|
|
650
|
+
const bridges = {};
|
|
651
|
+
for (const name of EXPOSED_BRIDGE_NAMES) {
|
|
652
|
+
bridges[name] = sandbox[name];
|
|
653
|
+
}
|
|
654
|
+
// Wrap every async bridge in a never-reject adapter (see
|
|
655
|
+
// SANDBOX_ERROR_MARKER above). The guest prelude rewraps them back into
|
|
656
|
+
// throwing functions before user code runs.
|
|
657
|
+
// guardAbort short-circuits each bridge once the run is cancelled;
|
|
658
|
+
// neverReject keeps the QuickJS handle-leak convention intact.
|
|
659
|
+
const wrap = (fn) => guardAbort(neverReject(fn), isAborted);
|
|
660
|
+
bridges.fetch = wrap(bridges.fetch);
|
|
661
|
+
bridges.sleep = wrap(bridges.sleep);
|
|
662
|
+
bridges.getSecret = wrap(bridges.getSecret);
|
|
663
|
+
bridges.assetToSandbox = wrap(bridges.assetToSandbox);
|
|
664
|
+
bridges.sandboxToAsset = wrap(bridges.sandboxToAsset);
|
|
665
|
+
// The guest hands these an encoded payload (see the prelude): decode it
|
|
666
|
+
// back into a value before the host sink ever sees it.
|
|
667
|
+
const decodeValueArg = (fn) => async (name, payload) => fn(name, decodeGuestPayload(payload));
|
|
668
|
+
bridges.emit = wrap(decodeValueArg(bridges.emit));
|
|
669
|
+
bridges.output = wrap(decodeValueArg(bridges.output));
|
|
670
|
+
// The input bridges are not in EXPOSED_BRIDGE_NAMES — the prelude
|
|
671
|
+
// captures them, builds `stream` on top, and deletes them. The take is
|
|
672
|
+
// async like every other host call; the open probe is synchronous and
|
|
673
|
+
// never throws, so it stays unwrapped (the `crypto.randomUUID` rule).
|
|
674
|
+
bridges[SANDBOX_INPUT_TAKE_BINDING] = wrap(sandbox[SANDBOX_INPUT_TAKE_BINDING]);
|
|
675
|
+
bridges[SANDBOX_STREAM_OPEN_BINDING] =
|
|
676
|
+
sandbox[SANDBOX_STREAM_OPEN_BINDING];
|
|
677
|
+
// Object bridges whose members are all async: wrap each member.
|
|
678
|
+
const wrapAllMembers = (bridge) => {
|
|
679
|
+
const out = {};
|
|
680
|
+
const members = bridge;
|
|
681
|
+
for (const [name, fn] of Object.entries(members)) {
|
|
682
|
+
out[name] = wrap(fn);
|
|
683
|
+
}
|
|
684
|
+
return out;
|
|
685
|
+
};
|
|
686
|
+
bridges.workspace = wrapAllMembers(bridges.workspace);
|
|
687
|
+
bridges.format = wrapAllMembers(bridges.format);
|
|
688
|
+
bridges.image = wrapAllMembers(bridges.image);
|
|
689
|
+
bridges.audio = wrapAllMembers(bridges.audio);
|
|
690
|
+
bridges.video = wrapAllMembers(bridges.video);
|
|
691
|
+
bridges.canvas = wrapAllMembers(bridges.canvas);
|
|
692
|
+
bridges.media = wrapAllMembers(bridges.media);
|
|
693
|
+
const hostCrypto = bridges.crypto;
|
|
694
|
+
bridges.crypto = {
|
|
695
|
+
// randomUUID/getRandomValues are synchronous and never throw, so they
|
|
696
|
+
// stay unwrapped; the async pair follows the never-reject convention.
|
|
697
|
+
randomUUID: hostCrypto.randomUUID,
|
|
698
|
+
getRandomValues: hostCrypto.getRandomValues,
|
|
699
|
+
digest: wrap(hostCrypto.digest),
|
|
700
|
+
hmac: wrap(hostCrypto.hmac)
|
|
701
|
+
};
|
|
702
|
+
// The WASM dispatcher rides the same never-reject convention as every
|
|
703
|
+
// other async bridge. It is exposed only when the run declares WASM
|
|
704
|
+
// modules, so a run without them has no such binding at any point.
|
|
705
|
+
if (wasmCall !== undefined) {
|
|
706
|
+
const dispatch = wasmCall;
|
|
707
|
+
bridges[SANDBOX_WASM_BRIDGE_BINDING] = wrap(async (moduleKey, exportName, args) => dispatch(moduleKey, exportName, args));
|
|
708
|
+
}
|
|
709
|
+
// Same treatment for host modules, exposed only when the run declares
|
|
710
|
+
// one, so a run without them has no such binding at any point.
|
|
711
|
+
if (hostCall !== undefined) {
|
|
712
|
+
const dispatch = hostCall;
|
|
713
|
+
bridges[SANDBOX_HOST_BRIDGE_BINDING] = wrap(async (moduleKey, exportName, args) => dispatch(moduleKey, exportName, args));
|
|
714
|
+
}
|
|
715
|
+
// And for the platform's own modules, exposed only when the host
|
|
716
|
+
// mounted some — a session with no capability run has no such binding.
|
|
717
|
+
if (capabilityCall !== undefined) {
|
|
718
|
+
const dispatch = capabilityCall;
|
|
719
|
+
bridges[SANDBOX_CAPABILITY_BRIDGE_BINDING] = wrap(async (moduleKey, exportName, args) => dispatch(moduleKey, exportName, args));
|
|
720
|
+
}
|
|
721
|
+
// Caller-injected globals are host functions too — guard the async
|
|
722
|
+
// ones or a cancelled run keeps driving real work through them after
|
|
723
|
+
// runInSandbox has returned. A caller-supplied global must follow the
|
|
724
|
+
// byte-tagging contract itself (`toGuestBytesDeep`): a raw `Uint8Array`
|
|
725
|
+
// returned to the guest is marshaled property-by-property, which OOMs
|
|
726
|
+
// the guest and throws inside the library's detached marshaling
|
|
727
|
+
// continuation. `guardHostProcess` on the caller's side keeps that from
|
|
728
|
+
// killing the process, but the run still fails.
|
|
729
|
+
// Data globals cross as one JSON string the prelude parses, because the
|
|
730
|
+
// wrapper installs an object property-by-property — ~400 µs per object
|
|
731
|
+
// node, which a Code node fed a few thousand rows pays before its first
|
|
732
|
+
// statement. A value JSON plus the transport's markers cannot carry
|
|
733
|
+
// (a function, a cycle, a class instance) keeps the wrapper's own path.
|
|
734
|
+
const dataGlobals = {};
|
|
735
|
+
for (const [name, value] of Object.entries(globals)) {
|
|
736
|
+
if (isFunction(value)) {
|
|
737
|
+
bridges[name] = wrap(value);
|
|
738
|
+
}
|
|
739
|
+
else if (value === null || typeof value !== "object") {
|
|
740
|
+
// A primitive crosses as a primitive: `newString` is one copy, while
|
|
741
|
+
// JSON would escape the text only to parse it back again.
|
|
742
|
+
bridges[name] = value;
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
// A function reachable at any depth inside this object (a stub
|
|
746
|
+
// like `{ nodetool: { timelines: { edit() {...} } } }`) makes the
|
|
747
|
+
// whole tree UNREPRESENTABLE below and falls through to the
|
|
748
|
+
// wrapper's own generic marshaling (`encoded.skipped`). That path
|
|
749
|
+
// calls a *nested* host function the way the wrapper calls any
|
|
750
|
+
// host function — no never-reject convention applied — so a host
|
|
751
|
+
// implementation that throws (or whose returned promise rejects)
|
|
752
|
+
// crosses the FFI boundary as a genuine QuickJS exception/rejection
|
|
753
|
+
// rather than the tagged, always-resolved value the top-level
|
|
754
|
+
// bridges above are wrapped to produce. That is exactly the
|
|
755
|
+
// handle-leak shape documented on `SANDBOX_ERROR_MARKER`: replacing
|
|
756
|
+
// every nested function with `wrap(fn)` here, before the tree is
|
|
757
|
+
// even classified, means every host function this run exposes —
|
|
758
|
+
// top-level or nested — follows the same never-reject contract, and
|
|
759
|
+
// the guest-side deep-unwrap below turns the tagged value back into
|
|
760
|
+
// a plain guest `throw`.
|
|
761
|
+
dataGlobals[name] = wrapNestedFunctionsDeep(value, wrap);
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const skippedGlobalNames = [];
|
|
765
|
+
if (Object.keys(dataGlobals).length > 0) {
|
|
766
|
+
const encoded = encodeHostRecord(dataGlobals);
|
|
767
|
+
if (encoded.cyclic.length > 0) {
|
|
768
|
+
// The fallback cannot take these: the wrapper's marshaler follows a
|
|
769
|
+
// cycle until the runtime aborts, which fails the run with an
|
|
770
|
+
// assertion instead of saying what was wrong with the input.
|
|
771
|
+
throw new Error(`Cannot pass ${encoded.cyclic
|
|
772
|
+
.map((name) => `"${name}"`)
|
|
773
|
+
.join(", ")} into the sandbox: the value refers back to itself`);
|
|
774
|
+
}
|
|
775
|
+
bridges[GUEST_GLOBALS_JSON_BINDING] = encoded.json;
|
|
776
|
+
if (encoded.sidecar.length > 0) {
|
|
777
|
+
bridges[GUEST_GLOBALS_SIDECAR_BINDING] = encoded.sidecar;
|
|
778
|
+
}
|
|
779
|
+
for (const name of encoded.skipped) {
|
|
780
|
+
bridges[name] = dataGlobals[name];
|
|
781
|
+
skippedGlobalNames.push(name);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
// `expose` manages its own internal Scope; the second arg is unused.
|
|
785
|
+
const disposable = new Scope();
|
|
786
|
+
try {
|
|
787
|
+
expose(ctx, disposable, bridges);
|
|
788
|
+
}
|
|
789
|
+
finally {
|
|
790
|
+
disposable.dispose();
|
|
791
|
+
}
|
|
792
|
+
// Block dynamic code generation and re-wrap the never-reject bridges as
|
|
793
|
+
// throwing guest-side functions. Direct eval in QuickJS can't be neutered
|
|
794
|
+
// by overwriting `globalThis.eval` (QuickJS still resolves the builtin),
|
|
795
|
+
// but a plain `delete` removes the binding entirely so any reference
|
|
796
|
+
// throws ReferenceError — same for `Function`.
|
|
797
|
+
const initStartedAt = performance.now();
|
|
798
|
+
await evalCode(`const __marker = "${SANDBOX_ERROR_MARKER}";
|
|
799
|
+
const __bytesMarker = "${SANDBOX_BYTES_MARKER}";
|
|
800
|
+
const __b64chars = "${BASE64_ALPHABET}";
|
|
801
|
+
const __asBytes = (input, where) => {
|
|
802
|
+
if (typeof input === "string") return new TextEncoder().encode(input);
|
|
803
|
+
// Anything without a byte length silently encoded to "" here, and the empty
|
|
804
|
+
// string travelled on to whatever was going to save it. The call that
|
|
805
|
+
// produces this most often is an un-awaited async one — every media op and
|
|
806
|
+
// canvas.toBytes() is async — so say that rather than "invalid input".
|
|
807
|
+
if (!input || typeof input.length !== "number") {
|
|
808
|
+
const kind = input && typeof input.then === "function"
|
|
809
|
+
? "a Promise — await it first"
|
|
810
|
+
: "a " + (input === null ? "null" : typeof input);
|
|
811
|
+
throw new TypeError(where + ": expected a Uint8Array or string, got " + kind);
|
|
812
|
+
}
|
|
813
|
+
return input;
|
|
814
|
+
};
|
|
815
|
+
globalThis.toBase64 = (input) => {
|
|
816
|
+
const b = __asBytes(input, "toBase64");
|
|
817
|
+
let out = "";
|
|
818
|
+
for (let i = 0; i < b.length; i += 3) {
|
|
819
|
+
const c = (b[i] << 16) | ((b[i + 1] || 0) << 8) | (b[i + 2] || 0);
|
|
820
|
+
out += __b64chars[(c >> 18) & 63] + __b64chars[(c >> 12) & 63] +
|
|
821
|
+
(i + 1 < b.length ? __b64chars[(c >> 6) & 63] : "=") +
|
|
822
|
+
(i + 2 < b.length ? __b64chars[c & 63] : "=");
|
|
823
|
+
}
|
|
824
|
+
return out;
|
|
825
|
+
};
|
|
826
|
+
globalThis.fromBase64 = (s) => {
|
|
827
|
+
const clean = String(s).replace(/-/g, "+").replace(/_/g, "/").replace(/[^A-Za-z0-9+/]/g, "");
|
|
828
|
+
const out = new Uint8Array((clean.length * 6) >> 3);
|
|
829
|
+
let acc = 0, bits = 0, o = 0;
|
|
830
|
+
for (let i = 0; i < clean.length; i++) {
|
|
831
|
+
acc = (acc << 6) | __b64chars.indexOf(clean[i]);
|
|
832
|
+
bits += 6;
|
|
833
|
+
if (bits >= 8) { bits -= 8; out[o++] = (acc >> bits) & 255; }
|
|
834
|
+
}
|
|
835
|
+
return out;
|
|
836
|
+
};
|
|
837
|
+
// Format console arguments guest-side, so only strings cross the boundary.
|
|
838
|
+
// The wrapper's marshaler walks an argument property by property, and a
|
|
839
|
+
// function has a prototype chain that leads back to itself: logging one — or
|
|
840
|
+
// a module namespace holding one, which is what \`import * as ns\` gives —
|
|
841
|
+
// recursed until the host stack blew, leaving handles alive and aborting the
|
|
842
|
+
// runtime on free with "list_empty(&rt->gc_obj_list)". That killed the whole
|
|
843
|
+
// run, after its real work was done, for a debug print.
|
|
844
|
+
{
|
|
845
|
+
const __hostConsole = globalThis.console;
|
|
846
|
+
const __fnLabel = (v) => "[Function: " + (v.name || "anonymous") + "]";
|
|
847
|
+
const __fmtConsoleArg = (value) => {
|
|
848
|
+
if (value === null) return "null";
|
|
849
|
+
if (value === undefined) return "undefined";
|
|
850
|
+
if (typeof value === "string") return value;
|
|
851
|
+
if (typeof value === "function") return __fnLabel(value);
|
|
852
|
+
if (typeof value === "symbol" || typeof value === "bigint") {
|
|
853
|
+
return String(value);
|
|
854
|
+
}
|
|
855
|
+
try {
|
|
856
|
+
const seen = new WeakSet();
|
|
857
|
+
const text = JSON.stringify(value, function (key, v) {
|
|
858
|
+
if (typeof v === "function") return __fnLabel(v);
|
|
859
|
+
if (typeof v === "bigint" || typeof v === "symbol") return String(v);
|
|
860
|
+
if (v !== null && typeof v === "object") {
|
|
861
|
+
if (seen.has(v)) return "[Circular]";
|
|
862
|
+
seen.add(v);
|
|
863
|
+
}
|
|
864
|
+
return v;
|
|
865
|
+
}, 2);
|
|
866
|
+
return text === undefined ? String(value) : text;
|
|
867
|
+
} catch {
|
|
868
|
+
try { return String(value); } catch { return "[unprintable]"; }
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
const __level = (name) => (...args) => {
|
|
872
|
+
__hostConsole[name](...args.map(__fmtConsoleArg));
|
|
873
|
+
};
|
|
874
|
+
globalThis.console = {
|
|
875
|
+
log: __level("log"),
|
|
876
|
+
warn: __level("warn"),
|
|
877
|
+
error: __level("error"),
|
|
878
|
+
info: __level("info")
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
globalThis.toHex = (input) => {
|
|
882
|
+
const b = __asBytes(input, "toHex");
|
|
883
|
+
let s = "";
|
|
884
|
+
for (let i = 0; i < b.length; i++) s += (b[i] < 16 ? "0" : "") + b[i].toString(16);
|
|
885
|
+
return s;
|
|
886
|
+
};
|
|
887
|
+
globalThis.fromHex = (s) => {
|
|
888
|
+
const t = String(s).replace(/[^0-9a-fA-F]/g, "");
|
|
889
|
+
const out = new Uint8Array(t.length >> 1);
|
|
890
|
+
for (let i = 0; i < out.length; i++) out[i] = parseInt(t.substr(i * 2, 2), 16);
|
|
891
|
+
return out;
|
|
892
|
+
};
|
|
893
|
+
globalThis.parallelMap = async (items, fn, concurrency) => {
|
|
894
|
+
if (typeof fn !== "function") {
|
|
895
|
+
throw new TypeError("parallelMap: fn must be a function");
|
|
896
|
+
}
|
|
897
|
+
const list = Array.from(items);
|
|
898
|
+
const raw = Number(concurrency === undefined ? 5 : concurrency);
|
|
899
|
+
const limit = Number.isFinite(raw)
|
|
900
|
+
? Math.min(Math.max(Math.floor(raw), 1), 32)
|
|
901
|
+
: 5;
|
|
902
|
+
const results = new Array(list.length);
|
|
903
|
+
let next = 0;
|
|
904
|
+
const worker = async () => {
|
|
905
|
+
while (next < list.length) {
|
|
906
|
+
const i = next++;
|
|
907
|
+
results[i] = await fn(list[i], i);
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
const workers = [];
|
|
911
|
+
for (let w = 0; w < Math.min(limit, list.length); w++) workers.push(worker());
|
|
912
|
+
await Promise.all(workers);
|
|
913
|
+
return results;
|
|
914
|
+
};
|
|
915
|
+
const __revive = (v) => (v && typeof v === "object" && typeof v[__bytesMarker] === "string")
|
|
916
|
+
? globalThis.fromBase64(v[__bytesMarker])
|
|
917
|
+
: v;
|
|
918
|
+
const __wrap = (fn) => async (...args) => {
|
|
919
|
+
const r = await fn(...args);
|
|
920
|
+
if (r && r[__marker]) {
|
|
921
|
+
const e = new Error(r.message);
|
|
922
|
+
e.name = r.name;
|
|
923
|
+
throw e;
|
|
924
|
+
}
|
|
925
|
+
return __revive(r);
|
|
926
|
+
};
|
|
927
|
+
const __rawFetch = __wrap(globalThis.fetch);
|
|
928
|
+
globalThis.fetch = async (...args) => {
|
|
929
|
+
const r = await __rawFetch(...args);
|
|
930
|
+
if (r && typeof r === "object") {
|
|
931
|
+
const bb = r.bodyBytes;
|
|
932
|
+
delete r.bodyBytes;
|
|
933
|
+
r.text = async () => r.body;
|
|
934
|
+
r.bytes = async () => __revive(bb);
|
|
935
|
+
r.arrayBuffer = async () => __revive(bb).buffer;
|
|
936
|
+
}
|
|
937
|
+
return r;
|
|
938
|
+
};
|
|
939
|
+
// progress is fire-and-forget and returns undefined by contract. Behind a
|
|
940
|
+
// worker its bridge is an RPC proxy that answers with a promise, so the
|
|
941
|
+
// wrapper swallows the return value on both paths rather than leak the
|
|
942
|
+
// difference to the guest.
|
|
943
|
+
const __rawProgress = globalThis.progress;
|
|
944
|
+
globalThis.progress = (percent, message) => {
|
|
945
|
+
void __rawProgress(percent, message);
|
|
946
|
+
};
|
|
947
|
+
globalThis.sleep = __wrap(globalThis.sleep);
|
|
948
|
+
globalThis.getSecret = __wrap(globalThis.getSecret);
|
|
949
|
+
globalThis.assetToSandbox = __wrap(globalThis.assetToSandbox);
|
|
950
|
+
globalThis.sandboxToAsset = __wrap(globalThis.sandboxToAsset);
|
|
951
|
+
// emit and output carry the run's data, so their argument takes the same
|
|
952
|
+
// JSON transport the result does — a single \`emit(rows)\` otherwise pays the
|
|
953
|
+
// wrapper's per-object marshal on the way out.
|
|
954
|
+
const __rawEmit = __wrap(globalThis.emit);
|
|
955
|
+
const __rawOutput = __wrap(globalThis.output);
|
|
956
|
+
globalThis.emit = (name, value) =>
|
|
957
|
+
__rawEmit(name, globalThis.${GUEST_MARSHAL_GLOBAL}(value));
|
|
958
|
+
globalThis.output = (name, value) =>
|
|
959
|
+
__rawOutput(name, globalThis.${GUEST_MARSHAL_GLOBAL}(value));
|
|
960
|
+
const __ws = globalThis.workspace;
|
|
961
|
+
globalThis.workspace = {
|
|
962
|
+
read: __wrap(__ws.read),
|
|
963
|
+
write: __wrap(__ws.write),
|
|
964
|
+
list: __wrap(__ws.list),
|
|
965
|
+
readBytes: __wrap(__ws.readBytes),
|
|
966
|
+
writeBytes: __wrap(__ws.writeBytes),
|
|
967
|
+
stat: __wrap(__ws.stat),
|
|
968
|
+
root: __wrap(__ws.root),
|
|
969
|
+
copy: __wrap(__ws.copy),
|
|
970
|
+
move: __wrap(__ws.move),
|
|
971
|
+
mkdir: __wrap(__ws.mkdir),
|
|
972
|
+
remove: __wrap(__ws.remove)
|
|
973
|
+
};
|
|
974
|
+
const __fmt = globalThis.format;
|
|
975
|
+
globalThis.format = {
|
|
976
|
+
number: __wrap(__fmt.number),
|
|
977
|
+
date: __wrap(__fmt.date),
|
|
978
|
+
relativeTime: __wrap(__fmt.relativeTime),
|
|
979
|
+
list: __wrap(__fmt.list)
|
|
980
|
+
};
|
|
981
|
+
const __reviveDeep = (v) => {
|
|
982
|
+
const r = __revive(v);
|
|
983
|
+
if (r !== v) return r;
|
|
984
|
+
// Revived bytes are already final. Walking a typed array key by key makes
|
|
985
|
+
// one string per byte and exhausts the guest heap on a large image.
|
|
986
|
+
if (ArrayBuffer.isView(v)) return v;
|
|
987
|
+
if (Array.isArray(v)) {
|
|
988
|
+
for (let i = 0; i < v.length; i++) v[i] = __reviveDeep(v[i]);
|
|
989
|
+
return v;
|
|
990
|
+
}
|
|
991
|
+
if (v && typeof v === "object") {
|
|
992
|
+
for (const k of Object.keys(v)) v[k] = __reviveDeep(v[k]);
|
|
993
|
+
return v;
|
|
994
|
+
}
|
|
995
|
+
return v;
|
|
996
|
+
};
|
|
997
|
+
const __wrapDeep = (fn) => {
|
|
998
|
+
const wrapped = __wrap(fn);
|
|
999
|
+
return async (...args) => __reviveDeep(await wrapped(...args));
|
|
1000
|
+
};
|
|
1001
|
+
const __image = globalThis.image;
|
|
1002
|
+
globalThis.image = {
|
|
1003
|
+
bytes: __wrapDeep(__image.bytes),
|
|
1004
|
+
toAsset: __wrapDeep(__image.toAsset),
|
|
1005
|
+
info: __wrapDeep(__image.info),
|
|
1006
|
+
decode: __wrapDeep(__image.decode),
|
|
1007
|
+
stats: __wrapDeep(__image.stats),
|
|
1008
|
+
blank: __wrapDeep(__image.blank),
|
|
1009
|
+
pad: __wrapDeep(__image.pad),
|
|
1010
|
+
grid: __wrapDeep(__image.grid),
|
|
1011
|
+
resize: __wrapDeep(__image.resize),
|
|
1012
|
+
crop: __wrapDeep(__image.crop),
|
|
1013
|
+
rotate: __wrapDeep(__image.rotate),
|
|
1014
|
+
flip: __wrapDeep(__image.flip),
|
|
1015
|
+
adjust: __wrapDeep(__image.adjust),
|
|
1016
|
+
composite: __wrapDeep(__image.composite),
|
|
1017
|
+
convert: __wrapDeep(__image.convert)
|
|
1018
|
+
};
|
|
1019
|
+
const __wrapMediaNamespace = (bridge) => {
|
|
1020
|
+
const out = {};
|
|
1021
|
+
for (const name of Object.keys(bridge)) out[name] = __wrapDeep(bridge[name]);
|
|
1022
|
+
return out;
|
|
1023
|
+
};
|
|
1024
|
+
globalThis.audio = __wrapMediaNamespace(globalThis.audio);
|
|
1025
|
+
globalThis.video = __wrapMediaNamespace(globalThis.video);
|
|
1026
|
+
const __canvasBridge = globalThis.canvas;
|
|
1027
|
+
globalThis.canvas = {
|
|
1028
|
+
render: __wrapDeep(__canvasBridge.render),
|
|
1029
|
+
measureText: __wrapDeep(__canvasBridge.measureText)
|
|
1030
|
+
};
|
|
1031
|
+
const __mediaBridge = globalThis.media;
|
|
1032
|
+
const __mediaOut = {};
|
|
1033
|
+
for (const __m of ${JSON.stringify(MEDIA_REF_MEMBERS)}) {
|
|
1034
|
+
__mediaOut[__m] = __wrapDeep(__mediaBridge[__m]);
|
|
1035
|
+
}
|
|
1036
|
+
globalThis.media = __mediaOut;
|
|
1037
|
+
// The input side of emit. An async iterable cannot cross the bridge, so the
|
|
1038
|
+
// guest builds one over a take-one-value host call: the body pulls, and an item
|
|
1039
|
+
// it has not asked for stays in the host's inbox. The raw bindings are captured
|
|
1040
|
+
// and deleted, so \`stream\` is the only way to reach them.
|
|
1041
|
+
const __takeInput = __wrapDeep(globalThis.${SANDBOX_INPUT_TAKE_BINDING});
|
|
1042
|
+
const __streamOpen = globalThis.${SANDBOX_STREAM_OPEN_BINDING};
|
|
1043
|
+
delete globalThis.${SANDBOX_INPUT_TAKE_BINDING};
|
|
1044
|
+
delete globalThis.${SANDBOX_STREAM_OPEN_BINDING};
|
|
1045
|
+
const __streamName = (fn, name) => {
|
|
1046
|
+
if (typeof name !== "string") {
|
|
1047
|
+
throw new TypeError(fn + ": name must be a string");
|
|
1048
|
+
}
|
|
1049
|
+
return name;
|
|
1050
|
+
};
|
|
1051
|
+
// \`handle\` is null for stream.any(), which yields [handle, value] pairs.
|
|
1052
|
+
const __streamIterable = (handle) => ({
|
|
1053
|
+
[Symbol.asyncIterator]: () => ({
|
|
1054
|
+
next: async () => {
|
|
1055
|
+
const take = await __takeInput(handle);
|
|
1056
|
+
if (take.done) return { done: true, value: undefined };
|
|
1057
|
+
return {
|
|
1058
|
+
done: false,
|
|
1059
|
+
value: handle === null ? [take.handle, take.value] : take.value
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
})
|
|
1063
|
+
});
|
|
1064
|
+
globalThis.stream = (name) => __streamIterable(__streamName("stream", name));
|
|
1065
|
+
globalThis.stream.any = () => __streamIterable(null);
|
|
1066
|
+
globalThis.stream.first = async (name) => {
|
|
1067
|
+
const take = await __takeInput(__streamName("stream.first", name));
|
|
1068
|
+
return take.done ? undefined : take.value;
|
|
1069
|
+
};
|
|
1070
|
+
globalThis.stream.open = (name) => {
|
|
1071
|
+
const open = __streamOpen(__streamName("stream.open", name));
|
|
1072
|
+
// null is the host saying this run has no input stream at all. Every other
|
|
1073
|
+
// stream verb reports that by throwing; this one has to do it here, because
|
|
1074
|
+
// a synchronous bridge cannot.
|
|
1075
|
+
if (open === null) {
|
|
1076
|
+
throw new Error(${JSON.stringify(NO_INPUT_STREAM_MESSAGE)});
|
|
1077
|
+
}
|
|
1078
|
+
return open;
|
|
1079
|
+
};
|
|
1080
|
+
const __canvasProps = ${JSON.stringify(CANVAS_PROPERTIES)};
|
|
1081
|
+
const __canvasMethods = ${JSON.stringify(CANVAS_METHODS)};
|
|
1082
|
+
const __canvasGradients = ${JSON.stringify(CANVAS_GRADIENT_FACTORIES)};
|
|
1083
|
+
const __gradMarker = "${CANVAS_GRADIENT_MARKER}";
|
|
1084
|
+
// A canvas context is a host object with methods, which the bridge contract
|
|
1085
|
+
// cannot carry. So this records the ordinary Canvas 2D calls synchronously and
|
|
1086
|
+
// ships the whole draw list in one canvas.render() when toBytes() is awaited.
|
|
1087
|
+
globalThis.createCanvas = (width, height) => {
|
|
1088
|
+
const ops = [];
|
|
1089
|
+
const gradients = {};
|
|
1090
|
+
let gradientSeq = 0;
|
|
1091
|
+
const asStyle = (value) =>
|
|
1092
|
+
value && typeof value === "object" && typeof value[__gradMarker] === "string"
|
|
1093
|
+
? { [__gradMarker]: value[__gradMarker] }
|
|
1094
|
+
: value;
|
|
1095
|
+
const ctx = {};
|
|
1096
|
+
for (const name of __canvasMethods) {
|
|
1097
|
+
ctx[name] = (...args) => {
|
|
1098
|
+
ops.push({ op: name, args });
|
|
1099
|
+
return ctx;
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
ctx.drawImage = (source, ...rest) => {
|
|
1103
|
+
ops.push({ op: "drawImage", args: [source, ...rest] });
|
|
1104
|
+
return ctx;
|
|
1105
|
+
};
|
|
1106
|
+
const values = {};
|
|
1107
|
+
for (const prop of __canvasProps) {
|
|
1108
|
+
Object.defineProperty(ctx, prop, {
|
|
1109
|
+
enumerable: true,
|
|
1110
|
+
get: () => values[prop],
|
|
1111
|
+
set: (value) => {
|
|
1112
|
+
values[prop] = value;
|
|
1113
|
+
ops.push({ op: "set", args: [prop, asStyle(value)] });
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
for (const factory of Object.keys(__canvasGradients)) {
|
|
1118
|
+
ctx[factory] = (...coords) => {
|
|
1119
|
+
const id = "g" + gradientSeq++;
|
|
1120
|
+
const spec = { type: __canvasGradients[factory], coords, stops: [] };
|
|
1121
|
+
gradients[id] = spec;
|
|
1122
|
+
const handle = {
|
|
1123
|
+
[__gradMarker]: id,
|
|
1124
|
+
addColorStop: (offset, color) => {
|
|
1125
|
+
spec.stops.push([offset, color]);
|
|
1126
|
+
return handle;
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
return handle;
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
const surface = {
|
|
1133
|
+
width,
|
|
1134
|
+
height,
|
|
1135
|
+
getContext: (kind) => {
|
|
1136
|
+
if (kind !== undefined && kind !== "2d") {
|
|
1137
|
+
throw new Error('createCanvas: only the "2d" context exists');
|
|
1138
|
+
}
|
|
1139
|
+
return ctx;
|
|
1140
|
+
},
|
|
1141
|
+
toSpec: (options) => ({
|
|
1142
|
+
width,
|
|
1143
|
+
height,
|
|
1144
|
+
gradients,
|
|
1145
|
+
ops,
|
|
1146
|
+
...(options || {})
|
|
1147
|
+
}),
|
|
1148
|
+
// render answers with a handle, like every other image producer, so a
|
|
1149
|
+
// drawing that goes straight into image.* never crosses the boundary.
|
|
1150
|
+
// toBytes keeps its name's promise and pays for the bytes explicitly.
|
|
1151
|
+
toImage: (options) => globalThis.canvas.render(surface.toSpec(options)),
|
|
1152
|
+
toBytes: async (options) =>
|
|
1153
|
+
globalThis.image.bytes(
|
|
1154
|
+
await globalThis.canvas.render(surface.toSpec(options))
|
|
1155
|
+
)
|
|
1156
|
+
};
|
|
1157
|
+
return surface;
|
|
1158
|
+
};
|
|
1159
|
+
const __crypto = globalThis.crypto;
|
|
1160
|
+
globalThis.crypto = {
|
|
1161
|
+
randomUUID: () => __crypto.randomUUID(),
|
|
1162
|
+
getRandomValues: (n) => {
|
|
1163
|
+
const len = Number(n);
|
|
1164
|
+
if (!Number.isFinite(len) || len < 0) {
|
|
1165
|
+
throw new TypeError("crypto.getRandomValues: length must be a non-negative number");
|
|
1166
|
+
}
|
|
1167
|
+
return __revive(__crypto.getRandomValues(Math.floor(len)));
|
|
1168
|
+
},
|
|
1169
|
+
digest: __wrap(__crypto.digest),
|
|
1170
|
+
hmac: __wrap(__crypto.hmac)
|
|
1171
|
+
};
|
|
1172
|
+
${GUEST_JSON_TRANSPORT_SOURCE}
|
|
1173
|
+
${skippedGlobalNames.length === 0
|
|
1174
|
+
? ""
|
|
1175
|
+
: `// A global whose JSON tree held a function anywhere (\`encoded.skipped\`
|
|
1176
|
+
// on the host side) crossed via the wrapper's own generic marshaling, with
|
|
1177
|
+
// every nested function already replaced host-side by \`wrap(fn)\` — see
|
|
1178
|
+
// \`wrapNestedFunctionsDeep\`. Each one now resolves instead of throwing or
|
|
1179
|
+
// rejecting; this walks the same tree guest-side and turns every one of
|
|
1180
|
+
// those resolved, possibly-tagged values back into a normal guest function
|
|
1181
|
+
// that throws a real Error on failure, the same contract every named bridge
|
|
1182
|
+
// above already has.
|
|
1183
|
+
const __wrapGlobalFnsDeep = (v, seen) => {
|
|
1184
|
+
if (typeof v === "function") return __wrap(v);
|
|
1185
|
+
if (v && typeof v === "object") {
|
|
1186
|
+
if (seen.has(v)) return v;
|
|
1187
|
+
seen.add(v);
|
|
1188
|
+
if (Array.isArray(v)) {
|
|
1189
|
+
for (let i = 0; i < v.length; i++) v[i] = __wrapGlobalFnsDeep(v[i], seen);
|
|
1190
|
+
} else {
|
|
1191
|
+
for (const k of Object.keys(v)) v[k] = __wrapGlobalFnsDeep(v[k], seen);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
return v;
|
|
1195
|
+
};
|
|
1196
|
+
${skippedGlobalNames
|
|
1197
|
+
.map((n) => `globalThis.${n} = __wrapGlobalFnsDeep(globalThis.${n}, new Set());`)
|
|
1198
|
+
.join("\n")}`}
|
|
1199
|
+
${DELETED_GUEST_GLOBALS.map((n) => `delete globalThis.${n};`).join("\n")}
|
|
1200
|
+
${wasmCall === undefined
|
|
1201
|
+
? ""
|
|
1202
|
+
: `globalThis.${SANDBOX_WASM_DISPATCH_GLOBAL} = __wrap(globalThis.${SANDBOX_WASM_BRIDGE_BINDING});
|
|
1203
|
+
delete globalThis.${SANDBOX_WASM_BRIDGE_BINDING};`}
|
|
1204
|
+
${hostCall === undefined
|
|
1205
|
+
? ""
|
|
1206
|
+
: `globalThis.${SANDBOX_HOST_DISPATCH_GLOBAL} = __wrapDeep(globalThis.${SANDBOX_HOST_BRIDGE_BINDING});
|
|
1207
|
+
delete globalThis.${SANDBOX_HOST_BRIDGE_BINDING};`}
|
|
1208
|
+
${capabilityCall === undefined
|
|
1209
|
+
? ""
|
|
1210
|
+
: `globalThis.${SANDBOX_CAPABILITY_DISPATCH_GLOBAL} = __wrapDeep(globalThis.${SANDBOX_CAPABILITY_BRIDGE_BINDING});
|
|
1211
|
+
delete globalThis.${SANDBOX_CAPABILITY_BRIDGE_BINDING};`}
|
|
1212
|
+
export default true;`, "sandbox-init");
|
|
1213
|
+
initMs = performance.now() - initStartedAt;
|
|
1214
|
+
// `evalCode` compiles and links the module — resolving its whole static
|
|
1215
|
+
// import graph — before its first await, so a resolution that arrives
|
|
1216
|
+
// after this call has returned can only come from a dynamic `import()`.
|
|
1217
|
+
// The dispatcher binding lives only long enough for the bridge module
|
|
1218
|
+
// to capture it while the entry's static graph links. This deletion is
|
|
1219
|
+
// the entry module's first statement, so it runs after every imported
|
|
1220
|
+
// module has evaluated and before the user IIFE starts.
|
|
1221
|
+
const userCodeStartedAt = performance.now();
|
|
1222
|
+
const pendingUserResult = evalCode(buildEntryModule(code, `${wasmCall === undefined
|
|
1223
|
+
? ""
|
|
1224
|
+
: ` delete globalThis.${SANDBOX_WASM_DISPATCH_GLOBAL};`}${hostCall === undefined
|
|
1225
|
+
? ""
|
|
1226
|
+
: ` delete globalThis.${SANDBOX_HOST_DISPATCH_GLOBAL};`}${capabilityCall === undefined
|
|
1227
|
+
? ""
|
|
1228
|
+
: ` delete globalThis.${SANDBOX_CAPABILITY_DISPATCH_GLOBAL};`}`, true), "user-code");
|
|
1229
|
+
moduleHost.lockStaticGraph();
|
|
1230
|
+
const userResult = await pendingUserResult;
|
|
1231
|
+
userCodeMs = performance.now() - userCodeStartedAt;
|
|
1232
|
+
// Read mutable globals back out. node:vm shared the host heap, so
|
|
1233
|
+
// `state.counter++` in user code mutated the caller's object directly.
|
|
1234
|
+
// With QuickJS the guest heap is isolated, so after user code runs we
|
|
1235
|
+
// extract the current values of the object-typed user globals and hand
|
|
1236
|
+
// them to the caller, which replaces the contents of its own objects in
|
|
1237
|
+
// place. CodeNode relies on this to make its `state` object persist
|
|
1238
|
+
// across invocations.
|
|
1239
|
+
let syncedGlobals;
|
|
1240
|
+
if (syncTargetNames.length > 0) {
|
|
1241
|
+
const syncStartedAt = performance.now();
|
|
1242
|
+
const extractor = `export default globalThis.${GUEST_MARSHAL_GLOBAL}({${syncTargetNames
|
|
1243
|
+
.map((n) => `${n}: (typeof ${n} !== 'undefined' && ${n} !== null) ? ${n} : null`)
|
|
1244
|
+
.join(", ")}});`;
|
|
1245
|
+
const syncResp = await evalCode(extractor, "sandbox-sync");
|
|
1246
|
+
if (syncResp.ok) {
|
|
1247
|
+
const decoded = decodeGuestPayload(syncResp.data);
|
|
1248
|
+
if (isObjectLike(decoded)) {
|
|
1249
|
+
syncedGlobals = decoded;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
syncMs = performance.now() - syncStartedAt;
|
|
1253
|
+
}
|
|
1254
|
+
const result = userResult.ok
|
|
1255
|
+
? {
|
|
1256
|
+
ok: true,
|
|
1257
|
+
data: decodeGuestPayload(userResult.data),
|
|
1258
|
+
syncedGlobals
|
|
1259
|
+
}
|
|
1260
|
+
: { ok: false, error: userResult.error, syncedGlobals };
|
|
1261
|
+
callbackFinishedAt = performance.now();
|
|
1262
|
+
return result;
|
|
1263
|
+
}, {
|
|
1264
|
+
// The engine's own abort is a plain `setTimeout` armed when evaluation
|
|
1265
|
+
// starts — it cannot be paused. With a clock in play it becomes the
|
|
1266
|
+
// backstop for a run that stays suspended forever, while the interrupt
|
|
1267
|
+
// handler above keeps the exact bound on guest execution.
|
|
1268
|
+
executionTimeout: hasClock
|
|
1269
|
+
? Math.min(timeoutMs + Math.max(0, suspendAllowanceMs), MAX_ENGINE_TIMEOUT_MS)
|
|
1270
|
+
: timeoutMs,
|
|
1271
|
+
memoryLimit: limits.memoryLimitBytes,
|
|
1272
|
+
maxStackSize: limits.stackLimitBytes,
|
|
1273
|
+
// The library defaults this to `{NODE_DEBUG: "true"}`, which reaches
|
|
1274
|
+
// the guest as `process.env` and can flip debug paths in its `node:util`
|
|
1275
|
+
// polyfill. Guest code has no business reading host-shaped environment
|
|
1276
|
+
// variables, so the stub carries nothing.
|
|
1277
|
+
env: {},
|
|
1278
|
+
...moduleHost.options
|
|
1279
|
+
});
|
|
1280
|
+
const interpreterFinishedAt = performance.now();
|
|
1281
|
+
const callbackMs = callbackFinishedAt - callbackEnteredAt;
|
|
1282
|
+
onTiming?.({
|
|
1283
|
+
wrapperSetupMs: callbackEnteredAt - interpreterStartedAt,
|
|
1284
|
+
initMs,
|
|
1285
|
+
userCodeMs,
|
|
1286
|
+
syncMs,
|
|
1287
|
+
callbackRemainderMs: Math.max(0, callbackMs - initMs - userCodeMs - syncMs),
|
|
1288
|
+
wrapperCleanupMs: Math.max(0, interpreterFinishedAt - callbackFinishedAt),
|
|
1289
|
+
totalMs: interpreterFinishedAt - interpreterStartedAt
|
|
1290
|
+
});
|
|
1291
|
+
return outcome;
|
|
1292
|
+
}
|
|
1293
|
+
//# sourceMappingURL=interpreter.js.map
|