@nodetool-ai/agents 0.7.0-rc.23 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/analysis/audio-dsp.d.ts +223 -0
- package/dist/analysis/audio-dsp.d.ts.map +1 -0
- package/dist/analysis/audio-dsp.js +642 -0
- package/dist/analysis/audio-dsp.js.map +1 -0
- package/dist/analysis/media-decode.d.ts +85 -0
- package/dist/analysis/media-decode.d.ts.map +1 -0
- package/dist/analysis/media-decode.js +199 -0
- package/dist/analysis/media-decode.js.map +1 -0
- package/dist/analysis/mediabunny-runtime.d.ts +15 -0
- package/dist/analysis/mediabunny-runtime.d.ts.map +1 -0
- package/dist/analysis/mediabunny-runtime.js +30 -0
- package/dist/analysis/mediabunny-runtime.js.map +1 -0
- package/dist/analysis/video-frames.d.ts +120 -0
- package/dist/analysis/video-frames.d.ts.map +1 -0
- package/dist/analysis/video-frames.js +288 -0
- package/dist/analysis/video-frames.js.map +1 -0
- package/dist/apify/assets.d.ts +80 -0
- package/dist/apify/assets.d.ts.map +1 -0
- package/dist/apify/assets.js +192 -0
- package/dist/apify/assets.js.map +1 -0
- package/dist/apify/catalog.d.ts +44 -0
- package/dist/apify/catalog.d.ts.map +1 -0
- package/dist/apify/catalog.js +108 -0
- package/dist/apify/catalog.js.map +1 -0
- package/dist/apify/client.d.ts +137 -0
- package/dist/apify/client.d.ts.map +1 -0
- package/dist/apify/client.js +346 -0
- package/dist/apify/client.js.map +1 -0
- package/dist/apify/errors.d.ts +85 -0
- package/dist/apify/errors.d.ts.map +1 -0
- package/dist/apify/errors.js +90 -0
- package/dist/apify/errors.js.map +1 -0
- package/dist/apify/normalize.d.ts +131 -0
- package/dist/apify/normalize.d.ts.map +1 -0
- package/dist/apify/normalize.js +202 -0
- package/dist/apify/normalize.js.map +1 -0
- package/dist/apify/policy.d.ts +136 -0
- package/dist/apify/policy.d.ts.map +1 -0
- package/dist/apify/policy.js +223 -0
- package/dist/apify/policy.js.map +1 -0
- package/dist/apify/run.d.ts +86 -0
- package/dist/apify/run.d.ts.map +1 -0
- package/dist/apify/run.js +158 -0
- package/dist/apify/run.js.map +1 -0
- package/dist/app-build/author.d.ts +67 -0
- package/dist/app-build/author.d.ts.map +1 -0
- package/dist/app-build/author.js +231 -0
- package/dist/app-build/author.js.map +1 -0
- package/dist/app-build/bridge.d.ts +130 -0
- package/dist/app-build/bridge.d.ts.map +1 -0
- package/dist/app-build/bridge.js +647 -0
- package/dist/app-build/bridge.js.map +1 -0
- package/dist/app-build/build-service.d.ts +66 -0
- package/dist/app-build/build-service.d.ts.map +1 -0
- package/dist/app-build/build-service.js +249 -0
- package/dist/app-build/build-service.js.map +1 -0
- package/dist/app-build/build.d.ts +115 -0
- package/dist/app-build/build.d.ts.map +1 -0
- package/dist/app-build/build.js +901 -0
- package/dist/app-build/build.js.map +1 -0
- package/dist/app-build/interactions.d.ts +20 -0
- package/dist/app-build/interactions.d.ts.map +1 -0
- package/dist/app-build/interactions.js +121 -0
- package/dist/app-build/interactions.js.map +1 -0
- package/dist/app-build/judge.d.ts +113 -0
- package/dist/app-build/judge.d.ts.map +1 -0
- package/dist/app-build/judge.js +318 -0
- package/dist/app-build/judge.js.map +1 -0
- package/dist/app-build/markdown.d.ts +10 -0
- package/dist/app-build/markdown.d.ts.map +1 -0
- package/dist/app-build/markdown.js +65 -0
- package/dist/app-build/markdown.js.map +1 -0
- package/dist/app-build/spec.d.ts +228 -0
- package/dist/app-build/spec.d.ts.map +1 -0
- package/dist/app-build/spec.js +651 -0
- package/dist/app-build/spec.js.map +1 -0
- package/dist/app-build/tool-loop.d.ts +84 -0
- package/dist/app-build/tool-loop.d.ts.map +1 -0
- package/dist/app-build/tool-loop.js +113 -0
- package/dist/app-build/tool-loop.js.map +1 -0
- package/dist/app-build/types.d.ts +215 -0
- package/dist/app-build/types.d.ts.map +1 -0
- package/dist/app-build/types.js +28 -0
- package/dist/app-build/types.js.map +1 -0
- package/dist/author-graph.d.ts +91 -0
- package/dist/author-graph.d.ts.map +1 -0
- package/dist/author-graph.js +319 -0
- package/dist/author-graph.js.map +1 -0
- package/dist/background-subtasks.d.ts +79 -0
- package/dist/background-subtasks.d.ts.map +1 -0
- package/dist/background-subtasks.js +139 -0
- package/dist/background-subtasks.js.map +1 -0
- package/dist/blender-gate.d.ts +21 -0
- package/dist/blender-gate.d.ts.map +1 -0
- package/dist/blender-gate.js +27 -0
- package/dist/blender-gate.js.map +1 -0
- package/dist/browser-gate.d.ts +28 -0
- package/dist/browser-gate.d.ts.map +1 -0
- package/dist/browser-gate.js +34 -0
- package/dist/browser-gate.js.map +1 -0
- package/dist/capabilities/adapters.d.ts +36 -0
- package/dist/capabilities/adapters.d.ts.map +1 -0
- package/dist/capabilities/adapters.js +44 -0
- package/dist/capabilities/adapters.js.map +1 -0
- package/dist/capabilities/agents.d.ts +78 -0
- package/dist/capabilities/agents.d.ts.map +1 -0
- package/dist/capabilities/agents.js +366 -0
- package/dist/capabilities/agents.js.map +1 -0
- package/dist/capabilities/agents.specs.d.ts +27 -0
- package/dist/capabilities/agents.specs.d.ts.map +1 -0
- package/dist/capabilities/agents.specs.js +243 -0
- package/dist/capabilities/agents.specs.js.map +1 -0
- package/dist/capabilities/analysis.d.ts +93 -0
- package/dist/capabilities/analysis.d.ts.map +1 -0
- package/dist/capabilities/analysis.js +812 -0
- package/dist/capabilities/analysis.js.map +1 -0
- package/dist/capabilities/analysis.specs.d.ts +39 -0
- package/dist/capabilities/analysis.specs.d.ts.map +1 -0
- package/dist/capabilities/analysis.specs.js +217 -0
- package/dist/capabilities/analysis.specs.js.map +1 -0
- package/dist/capabilities/apify.d.ts +34 -0
- package/dist/capabilities/apify.d.ts.map +1 -0
- package/dist/capabilities/apify.js +449 -0
- package/dist/capabilities/apify.js.map +1 -0
- package/dist/capabilities/apify.specs.d.ts +28 -0
- package/dist/capabilities/apify.specs.d.ts.map +1 -0
- package/dist/capabilities/apify.specs.js +232 -0
- package/dist/capabilities/apify.specs.js.map +1 -0
- package/dist/capabilities/apps.d.ts +40 -0
- package/dist/capabilities/apps.d.ts.map +1 -0
- package/dist/capabilities/apps.js +413 -0
- package/dist/capabilities/apps.js.map +1 -0
- package/dist/capabilities/apps.specs.d.ts +23 -0
- package/dist/capabilities/apps.specs.d.ts.map +1 -0
- package/dist/capabilities/apps.specs.js +236 -0
- package/dist/capabilities/apps.specs.js.map +1 -0
- package/dist/capabilities/args.d.ts +65 -0
- package/dist/capabilities/args.d.ts.map +1 -0
- package/dist/capabilities/args.js +218 -0
- package/dist/capabilities/args.js.map +1 -0
- package/dist/capabilities/assets.d.ts +45 -0
- package/dist/capabilities/assets.d.ts.map +1 -0
- package/dist/capabilities/assets.js +952 -0
- package/dist/capabilities/assets.js.map +1 -0
- package/dist/capabilities/assets.specs.d.ts +54 -0
- package/dist/capabilities/assets.specs.d.ts.map +1 -0
- package/dist/capabilities/assets.specs.js +291 -0
- package/dist/capabilities/assets.specs.js.map +1 -0
- package/dist/capabilities/background-generation.d.ts +14 -0
- package/dist/capabilities/background-generation.d.ts.map +1 -0
- package/dist/capabilities/background-generation.js +29 -0
- package/dist/capabilities/background-generation.js.map +1 -0
- package/dist/capabilities/browser.d.ts +30 -0
- package/dist/capabilities/browser.d.ts.map +1 -0
- package/dist/capabilities/browser.js +250 -0
- package/dist/capabilities/browser.js.map +1 -0
- package/dist/capabilities/browser.specs.d.ts +37 -0
- package/dist/capabilities/browser.specs.d.ts.map +1 -0
- package/dist/capabilities/browser.specs.js +173 -0
- package/dist/capabilities/browser.specs.js.map +1 -0
- package/dist/capabilities/code-grading.d.ts +68 -0
- package/dist/capabilities/code-grading.d.ts.map +1 -0
- package/dist/capabilities/code-grading.js +75 -0
- package/dist/capabilities/code-grading.js.map +1 -0
- package/dist/capabilities/code.d.ts +56 -0
- package/dist/capabilities/code.d.ts.map +1 -0
- package/dist/capabilities/code.js +327 -0
- package/dist/capabilities/code.js.map +1 -0
- package/dist/capabilities/code.specs.d.ts +22 -0
- package/dist/capabilities/code.specs.d.ts.map +1 -0
- package/dist/capabilities/code.specs.js +175 -0
- package/dist/capabilities/code.specs.js.map +1 -0
- package/dist/capabilities/collections.d.ts +44 -0
- package/dist/capabilities/collections.d.ts.map +1 -0
- package/dist/capabilities/collections.js +432 -0
- package/dist/capabilities/collections.js.map +1 -0
- package/dist/capabilities/collections.specs.d.ts +25 -0
- package/dist/capabilities/collections.specs.d.ts.map +1 -0
- package/dist/capabilities/collections.specs.js +299 -0
- package/dist/capabilities/collections.specs.js.map +1 -0
- package/dist/capabilities/compositions.d.ts +57 -0
- package/dist/capabilities/compositions.d.ts.map +1 -0
- package/dist/capabilities/compositions.js +384 -0
- package/dist/capabilities/compositions.js.map +1 -0
- package/dist/capabilities/compositions.specs.d.ts +22 -0
- package/dist/capabilities/compositions.specs.d.ts.map +1 -0
- package/dist/capabilities/compositions.specs.js +126 -0
- package/dist/capabilities/compositions.specs.js.map +1 -0
- package/dist/capabilities/concurrency.d.ts +12 -0
- package/dist/capabilities/concurrency.d.ts.map +1 -0
- package/dist/capabilities/concurrency.js +30 -0
- package/dist/capabilities/concurrency.js.map +1 -0
- package/dist/capabilities/costs.d.ts +20 -0
- package/dist/capabilities/costs.d.ts.map +1 -0
- package/dist/capabilities/costs.js +40 -0
- package/dist/capabilities/costs.js.map +1 -0
- package/dist/capabilities/costs.specs.d.ts +12 -0
- package/dist/capabilities/costs.specs.d.ts.map +1 -0
- package/dist/capabilities/costs.specs.js +35 -0
- package/dist/capabilities/costs.specs.js.map +1 -0
- package/dist/capabilities/dispatcher.d.ts +57 -0
- package/dist/capabilities/dispatcher.d.ts.map +1 -0
- package/dist/capabilities/dispatcher.js +117 -0
- package/dist/capabilities/dispatcher.js.map +1 -0
- package/dist/capabilities/documents.d.ts +25 -0
- package/dist/capabilities/documents.d.ts.map +1 -0
- package/dist/capabilities/documents.js +278 -0
- package/dist/capabilities/documents.js.map +1 -0
- package/dist/capabilities/documents.specs.d.ts +18 -0
- package/dist/capabilities/documents.specs.d.ts.map +1 -0
- package/dist/capabilities/documents.specs.js +201 -0
- package/dist/capabilities/documents.specs.js.map +1 -0
- package/dist/capabilities/email.d.ts +23 -0
- package/dist/capabilities/email.d.ts.map +1 -0
- package/dist/capabilities/email.js +226 -0
- package/dist/capabilities/email.js.map +1 -0
- package/dist/capabilities/email.specs.d.ts +16 -0
- package/dist/capabilities/email.specs.d.ts.map +1 -0
- package/dist/capabilities/email.specs.js +102 -0
- package/dist/capabilities/email.specs.js.map +1 -0
- package/dist/capabilities/entities.d.ts +52 -0
- package/dist/capabilities/entities.d.ts.map +1 -0
- package/dist/capabilities/entities.js +478 -0
- package/dist/capabilities/entities.js.map +1 -0
- package/dist/capabilities/entities.specs.d.ts +25 -0
- package/dist/capabilities/entities.specs.d.ts.map +1 -0
- package/dist/capabilities/entities.specs.js +247 -0
- package/dist/capabilities/entities.specs.js.map +1 -0
- package/dist/capabilities/example-timelines.d.ts +3 -0
- package/dist/capabilities/example-timelines.d.ts.map +1 -0
- package/dist/capabilities/example-timelines.js +191 -0
- package/dist/capabilities/example-timelines.js.map +1 -0
- package/dist/capabilities/example-timelines.specs.d.ts +5 -0
- package/dist/capabilities/example-timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/example-timelines.specs.js +53 -0
- package/dist/capabilities/example-timelines.specs.js.map +1 -0
- package/dist/capabilities/files.d.ts +53 -0
- package/dist/capabilities/files.d.ts.map +1 -0
- package/dist/capabilities/files.js +1172 -0
- package/dist/capabilities/files.js.map +1 -0
- package/dist/capabilities/files.specs.d.ts +28 -0
- package/dist/capabilities/files.specs.d.ts.map +1 -0
- package/dist/capabilities/files.specs.js +259 -0
- package/dist/capabilities/files.specs.js.map +1 -0
- package/dist/capabilities/flow.d.ts +93 -0
- package/dist/capabilities/flow.d.ts.map +1 -0
- package/dist/capabilities/flow.js +285 -0
- package/dist/capabilities/flow.js.map +1 -0
- package/dist/capabilities/flow.specs.d.ts +25 -0
- package/dist/capabilities/flow.specs.d.ts.map +1 -0
- package/dist/capabilities/flow.specs.js +114 -0
- package/dist/capabilities/flow.specs.js.map +1 -0
- package/dist/capabilities/game-asset-source.d.ts +31 -0
- package/dist/capabilities/game-asset-source.d.ts.map +1 -0
- package/dist/capabilities/game-asset-source.js +81 -0
- package/dist/capabilities/game-asset-source.js.map +1 -0
- package/dist/capabilities/game.d.ts +12 -0
- package/dist/capabilities/game.d.ts.map +1 -0
- package/dist/capabilities/game.js +1262 -0
- package/dist/capabilities/game.js.map +1 -0
- package/dist/capabilities/game.specs.d.ts +3 -0
- package/dist/capabilities/game.specs.d.ts.map +1 -0
- package/dist/capabilities/game.specs.js +96 -0
- package/dist/capabilities/game.specs.js.map +1 -0
- package/dist/capabilities/gate-from-context.d.ts +39 -0
- package/dist/capabilities/gate-from-context.d.ts.map +1 -0
- package/dist/capabilities/gate-from-context.js +97 -0
- package/dist/capabilities/gate-from-context.js.map +1 -0
- package/dist/capabilities/gate-tools.d.ts +18 -0
- package/dist/capabilities/gate-tools.d.ts.map +1 -0
- package/dist/capabilities/gate-tools.js +66 -0
- package/dist/capabilities/gate-tools.js.map +1 -0
- package/dist/capabilities/generations.d.ts +79 -0
- package/dist/capabilities/generations.d.ts.map +1 -0
- package/dist/capabilities/generations.js +382 -0
- package/dist/capabilities/generations.js.map +1 -0
- package/dist/capabilities/generations.specs.d.ts +62 -0
- package/dist/capabilities/generations.specs.d.ts.map +1 -0
- package/dist/capabilities/generations.specs.js +230 -0
- package/dist/capabilities/generations.specs.js.map +1 -0
- package/dist/capabilities/google.d.ts +50 -0
- package/dist/capabilities/google.d.ts.map +1 -0
- package/dist/capabilities/google.js +246 -0
- package/dist/capabilities/google.js.map +1 -0
- package/dist/capabilities/google.specs.d.ts +52 -0
- package/dist/capabilities/google.specs.d.ts.map +1 -0
- package/dist/capabilities/google.specs.js +391 -0
- package/dist/capabilities/google.specs.js.map +1 -0
- package/dist/capabilities/html-text.d.ts +28 -0
- package/dist/capabilities/html-text.d.ts.map +1 -0
- package/dist/capabilities/html-text.js +76 -0
- package/dist/capabilities/html-text.js.map +1 -0
- package/dist/capabilities/index.d.ts +19 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +14 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/invoke.d.ts +89 -0
- package/dist/capabilities/invoke.d.ts.map +1 -0
- package/dist/capabilities/invoke.js +214 -0
- package/dist/capabilities/invoke.js.map +1 -0
- package/dist/capabilities/jobs.d.ts +32 -0
- package/dist/capabilities/jobs.d.ts.map +1 -0
- package/dist/capabilities/jobs.js +123 -0
- package/dist/capabilities/jobs.js.map +1 -0
- package/dist/capabilities/jobs.specs.d.ts +20 -0
- package/dist/capabilities/jobs.specs.d.ts.map +1 -0
- package/dist/capabilities/jobs.specs.js +103 -0
- package/dist/capabilities/jobs.specs.js.map +1 -0
- package/dist/capabilities/js-scripts.d.ts +90 -0
- package/dist/capabilities/js-scripts.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.js +700 -0
- package/dist/capabilities/js-scripts.js.map +1 -0
- package/dist/capabilities/js-scripts.specs.d.ts +50 -0
- package/dist/capabilities/js-scripts.specs.d.ts.map +1 -0
- package/dist/capabilities/js-scripts.specs.js +344 -0
- package/dist/capabilities/js-scripts.specs.js.map +1 -0
- package/dist/capabilities/lazy-tool.d.ts +42 -0
- package/dist/capabilities/lazy-tool.d.ts.map +1 -0
- package/dist/capabilities/lazy-tool.js +88 -0
- package/dist/capabilities/lazy-tool.js.map +1 -0
- package/dist/capabilities/local-browser.d.ts +24 -0
- package/dist/capabilities/local-browser.d.ts.map +1 -0
- package/dist/capabilities/local-browser.js +105 -0
- package/dist/capabilities/local-browser.js.map +1 -0
- package/dist/capabilities/media.d.ts +121 -0
- package/dist/capabilities/media.d.ts.map +1 -0
- package/dist/capabilities/media.js +2217 -0
- package/dist/capabilities/media.js.map +1 -0
- package/dist/capabilities/media.specs.d.ts +65 -0
- package/dist/capabilities/media.specs.d.ts.map +1 -0
- package/dist/capabilities/media.specs.js +779 -0
- package/dist/capabilities/media.specs.js.map +1 -0
- package/dist/capabilities/memory.d.ts +31 -0
- package/dist/capabilities/memory.d.ts.map +1 -0
- package/dist/capabilities/memory.js +403 -0
- package/dist/capabilities/memory.js.map +1 -0
- package/dist/capabilities/memory.specs.d.ts +55 -0
- package/dist/capabilities/memory.specs.d.ts.map +1 -0
- package/dist/capabilities/memory.specs.js +208 -0
- package/dist/capabilities/memory.specs.js.map +1 -0
- package/dist/capabilities/model3d.d.ts +29 -0
- package/dist/capabilities/model3d.d.ts.map +1 -0
- package/dist/capabilities/model3d.js +482 -0
- package/dist/capabilities/model3d.js.map +1 -0
- package/dist/capabilities/model3d.specs.d.ts +28 -0
- package/dist/capabilities/model3d.specs.d.ts.map +1 -0
- package/dist/capabilities/model3d.specs.js +305 -0
- package/dist/capabilities/model3d.specs.js.map +1 -0
- package/dist/capabilities/models.d.ts +138 -0
- package/dist/capabilities/models.d.ts.map +1 -0
- package/dist/capabilities/models.js +803 -0
- package/dist/capabilities/models.js.map +1 -0
- package/dist/capabilities/models.specs.d.ts +21 -0
- package/dist/capabilities/models.specs.d.ts.map +1 -0
- package/dist/capabilities/models.specs.js +141 -0
- package/dist/capabilities/models.specs.js.map +1 -0
- package/dist/capabilities/nodes.d.ts +26 -0
- package/dist/capabilities/nodes.d.ts.map +1 -0
- package/dist/capabilities/nodes.js +266 -0
- package/dist/capabilities/nodes.js.map +1 -0
- package/dist/capabilities/nodes.specs.d.ts +20 -0
- package/dist/capabilities/nodes.specs.d.ts.map +1 -0
- package/dist/capabilities/nodes.specs.js +106 -0
- package/dist/capabilities/nodes.specs.js.map +1 -0
- package/dist/capabilities/packs.d.ts +69 -0
- package/dist/capabilities/packs.d.ts.map +1 -0
- package/dist/capabilities/packs.js +246 -0
- package/dist/capabilities/packs.js.map +1 -0
- package/dist/capabilities/packs.specs.d.ts +27 -0
- package/dist/capabilities/packs.specs.d.ts.map +1 -0
- package/dist/capabilities/packs.specs.js +64 -0
- package/dist/capabilities/packs.specs.js.map +1 -0
- package/dist/capabilities/project-scope.d.ts +12 -0
- package/dist/capabilities/project-scope.d.ts.map +1 -0
- package/dist/capabilities/project-scope.js +19 -0
- package/dist/capabilities/project-scope.js.map +1 -0
- package/dist/capabilities/projects.d.ts +23 -0
- package/dist/capabilities/projects.d.ts.map +1 -0
- package/dist/capabilities/projects.js +206 -0
- package/dist/capabilities/projects.js.map +1 -0
- package/dist/capabilities/projects.specs.d.ts +23 -0
- package/dist/capabilities/projects.specs.d.ts.map +1 -0
- package/dist/capabilities/projects.specs.js +118 -0
- package/dist/capabilities/projects.specs.js.map +1 -0
- package/dist/capabilities/registry.d.ts +109 -0
- package/dist/capabilities/registry.d.ts.map +1 -0
- package/dist/capabilities/registry.js +445 -0
- package/dist/capabilities/registry.js.map +1 -0
- package/dist/capabilities/script-link.d.ts +22 -0
- package/dist/capabilities/script-link.d.ts.map +1 -0
- package/dist/capabilities/script-link.js +35 -0
- package/dist/capabilities/script-link.js.map +1 -0
- package/dist/capabilities/scripts.d.ts +43 -0
- package/dist/capabilities/scripts.d.ts.map +1 -0
- package/dist/capabilities/scripts.js +1789 -0
- package/dist/capabilities/scripts.js.map +1 -0
- package/dist/capabilities/scripts.specs.d.ts +40 -0
- package/dist/capabilities/scripts.specs.d.ts.map +1 -0
- package/dist/capabilities/scripts.specs.js +319 -0
- package/dist/capabilities/scripts.specs.js.map +1 -0
- package/dist/capabilities/serpapi.d.ts +42 -0
- package/dist/capabilities/serpapi.d.ts.map +1 -0
- package/dist/capabilities/serpapi.js +262 -0
- package/dist/capabilities/serpapi.js.map +1 -0
- package/dist/capabilities/serpapi.specs.d.ts +24 -0
- package/dist/capabilities/serpapi.specs.d.ts.map +1 -0
- package/dist/capabilities/serpapi.specs.js +174 -0
- package/dist/capabilities/serpapi.specs.js.map +1 -0
- package/dist/capabilities/settings.d.ts +48 -0
- package/dist/capabilities/settings.d.ts.map +1 -0
- package/dist/capabilities/settings.js +226 -0
- package/dist/capabilities/settings.js.map +1 -0
- package/dist/capabilities/settings.specs.d.ts +42 -0
- package/dist/capabilities/settings.specs.d.ts.map +1 -0
- package/dist/capabilities/settings.specs.js +126 -0
- package/dist/capabilities/settings.specs.js.map +1 -0
- package/dist/capabilities/shared.d.ts +35 -0
- package/dist/capabilities/shared.d.ts.map +1 -0
- package/dist/capabilities/shared.js +165 -0
- package/dist/capabilities/shared.js.map +1 -0
- package/dist/capabilities/shared.specs.d.ts +19 -0
- package/dist/capabilities/shared.specs.d.ts.map +1 -0
- package/dist/capabilities/shared.specs.js +134 -0
- package/dist/capabilities/shared.specs.js.map +1 -0
- package/dist/capabilities/sketches.d.ts +52 -0
- package/dist/capabilities/sketches.d.ts.map +1 -0
- package/dist/capabilities/sketches.js +1163 -0
- package/dist/capabilities/sketches.js.map +1 -0
- package/dist/capabilities/sketches.specs.d.ts +44 -0
- package/dist/capabilities/sketches.specs.d.ts.map +1 -0
- package/dist/capabilities/sketches.specs.js +392 -0
- package/dist/capabilities/sketches.specs.js.map +1 -0
- package/dist/capabilities/skills.d.ts +28 -0
- package/dist/capabilities/skills.d.ts.map +1 -0
- package/dist/capabilities/skills.js +269 -0
- package/dist/capabilities/skills.js.map +1 -0
- package/dist/capabilities/skills.specs.d.ts +17 -0
- package/dist/capabilities/skills.specs.d.ts.map +1 -0
- package/dist/capabilities/skills.specs.js +108 -0
- package/dist/capabilities/skills.specs.js.map +1 -0
- package/dist/capabilities/storyboards.d.ts +68 -0
- package/dist/capabilities/storyboards.d.ts.map +1 -0
- package/dist/capabilities/storyboards.js +2246 -0
- package/dist/capabilities/storyboards.js.map +1 -0
- package/dist/capabilities/storyboards.specs.d.ts +42 -0
- package/dist/capabilities/storyboards.specs.d.ts.map +1 -0
- package/dist/capabilities/storyboards.specs.js +418 -0
- package/dist/capabilities/storyboards.specs.js.map +1 -0
- package/dist/capabilities/threads.d.ts +25 -0
- package/dist/capabilities/threads.d.ts.map +1 -0
- package/dist/capabilities/threads.js +240 -0
- package/dist/capabilities/threads.js.map +1 -0
- package/dist/capabilities/threads.specs.d.ts +26 -0
- package/dist/capabilities/threads.specs.d.ts.map +1 -0
- package/dist/capabilities/threads.specs.js +108 -0
- package/dist/capabilities/threads.specs.js.map +1 -0
- package/dist/capabilities/timeline-audio-bake.d.ts +114 -0
- package/dist/capabilities/timeline-audio-bake.d.ts.map +1 -0
- package/dist/capabilities/timeline-audio-bake.js +188 -0
- package/dist/capabilities/timeline-audio-bake.js.map +1 -0
- package/dist/capabilities/timeline-bake.d.ts +21 -0
- package/dist/capabilities/timeline-bake.d.ts.map +1 -0
- package/dist/capabilities/timeline-bake.js +118 -0
- package/dist/capabilities/timeline-bake.js.map +1 -0
- package/dist/capabilities/timeline-isolate-subject.d.ts +157 -0
- package/dist/capabilities/timeline-isolate-subject.d.ts.map +1 -0
- package/dist/capabilities/timeline-isolate-subject.js +293 -0
- package/dist/capabilities/timeline-isolate-subject.js.map +1 -0
- package/dist/capabilities/timeline-native-media.d.ts +4 -0
- package/dist/capabilities/timeline-native-media.d.ts.map +1 -0
- package/dist/capabilities/timeline-native-media.js +920 -0
- package/dist/capabilities/timeline-native-media.js.map +1 -0
- package/dist/capabilities/timeline-track-object.d.ts +83 -0
- package/dist/capabilities/timeline-track-object.d.ts.map +1 -0
- package/dist/capabilities/timeline-track-object.js +195 -0
- package/dist/capabilities/timeline-track-object.js.map +1 -0
- package/dist/capabilities/timelines.d.ts +190 -0
- package/dist/capabilities/timelines.d.ts.map +1 -0
- package/dist/capabilities/timelines.js +2326 -0
- package/dist/capabilities/timelines.js.map +1 -0
- package/dist/capabilities/timelines.specs.d.ts +134 -0
- package/dist/capabilities/timelines.specs.d.ts.map +1 -0
- package/dist/capabilities/timelines.specs.js +1362 -0
- package/dist/capabilities/timelines.specs.js.map +1 -0
- package/dist/capabilities/types.d.ts +197 -0
- package/dist/capabilities/types.d.ts.map +1 -0
- package/dist/capabilities/types.js +19 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/capabilities/ui.d.ts +38 -0
- package/dist/capabilities/ui.d.ts.map +1 -0
- package/dist/capabilities/ui.js +128 -0
- package/dist/capabilities/ui.js.map +1 -0
- package/dist/capabilities/ui.specs.d.ts +22 -0
- package/dist/capabilities/ui.specs.d.ts.map +1 -0
- package/dist/capabilities/ui.specs.js +59 -0
- package/dist/capabilities/ui.specs.js.map +1 -0
- package/dist/capabilities/video-production-acceptance.d.ts +27 -0
- package/dist/capabilities/video-production-acceptance.d.ts.map +1 -0
- package/dist/capabilities/video-production-acceptance.js +41 -0
- package/dist/capabilities/video-production-acceptance.js.map +1 -0
- package/dist/capabilities/video-production.d.ts +179 -0
- package/dist/capabilities/video-production.d.ts.map +1 -0
- package/dist/capabilities/video-production.js +1492 -0
- package/dist/capabilities/video-production.js.map +1 -0
- package/dist/capabilities/video-production.specs.d.ts +13 -0
- package/dist/capabilities/video-production.specs.d.ts.map +1 -0
- package/dist/capabilities/video-production.specs.js +256 -0
- package/dist/capabilities/video-production.specs.js.map +1 -0
- package/dist/capabilities/web.d.ts +86 -0
- package/dist/capabilities/web.d.ts.map +1 -0
- package/dist/capabilities/web.js +850 -0
- package/dist/capabilities/web.js.map +1 -0
- package/dist/capabilities/web.specs.d.ts +33 -0
- package/dist/capabilities/web.specs.d.ts.map +1 -0
- package/dist/capabilities/web.specs.js +286 -0
- package/dist/capabilities/web.specs.js.map +1 -0
- package/dist/capabilities/workflows.d.ts +58 -0
- package/dist/capabilities/workflows.d.ts.map +1 -0
- package/dist/capabilities/workflows.js +1530 -0
- package/dist/capabilities/workflows.js.map +1 -0
- package/dist/capabilities/workflows.specs.d.ts +63 -0
- package/dist/capabilities/workflows.specs.d.ts.map +1 -0
- package/dist/capabilities/workflows.specs.js +852 -0
- package/dist/capabilities/workflows.specs.js.map +1 -0
- package/dist/code-gen/analyze.d.ts +26 -0
- package/dist/code-gen/analyze.d.ts.map +1 -0
- package/dist/code-gen/analyze.js +79 -0
- package/dist/code-gen/analyze.js.map +1 -0
- package/dist/code-gen/port-types.d.ts +58 -0
- package/dist/code-gen/port-types.d.ts.map +1 -0
- package/dist/code-gen/port-types.js +115 -0
- package/dist/code-gen/port-types.js.map +1 -0
- package/dist/code-gen/prompt.d.ts +37 -0
- package/dist/code-gen/prompt.d.ts.map +1 -0
- package/dist/code-gen/prompt.js +129 -0
- package/dist/code-gen/prompt.js.map +1 -0
- package/dist/code-gen/sandbox-manifest.d.ts +120 -0
- package/dist/code-gen/sandbox-manifest.d.ts.map +1 -0
- package/dist/code-gen/sandbox-manifest.js +1023 -0
- package/dist/code-gen/sandbox-manifest.js.map +1 -0
- package/dist/code-gen/sandbox-prompt.d.ts +26 -0
- package/dist/code-gen/sandbox-prompt.d.ts.map +1 -0
- package/dist/code-gen/sandbox-prompt.js +126 -0
- package/dist/code-gen/sandbox-prompt.js.map +1 -0
- package/dist/code-planner.d.ts +72 -0
- package/dist/code-planner.d.ts.map +1 -0
- package/dist/code-planner.js +271 -0
- package/dist/code-planner.js.map +1 -0
- package/dist/codeact/action-diagnostics.d.ts +35 -0
- package/dist/codeact/action-diagnostics.d.ts.map +1 -0
- package/dist/codeact/action-diagnostics.js +147 -0
- package/dist/codeact/action-diagnostics.js.map +1 -0
- package/dist/codeact/capability-modules.d.ts +66 -0
- package/dist/codeact/capability-modules.d.ts.map +1 -0
- package/dist/codeact/capability-modules.js +278 -0
- package/dist/codeact/capability-modules.js.map +1 -0
- package/dist/codeact/chat-codeact.d.ts +104 -0
- package/dist/codeact/chat-codeact.d.ts.map +1 -0
- package/dist/codeact/chat-codeact.js +424 -0
- package/dist/codeact/chat-codeact.js.map +1 -0
- package/dist/codeact/codeact-executor.d.ts +247 -0
- package/dist/codeact/codeact-executor.d.ts.map +1 -0
- package/dist/codeact/codeact-executor.js +1176 -0
- package/dist/codeact/codeact-executor.js.map +1 -0
- package/dist/codeact/compact-ids.d.ts +28 -0
- package/dist/codeact/compact-ids.d.ts.map +1 -0
- package/dist/codeact/compact-ids.js +77 -0
- package/dist/codeact/compact-ids.js.map +1 -0
- package/dist/codeact/execute-code-contract.d.ts +97 -0
- package/dist/codeact/execute-code-contract.d.ts.map +1 -0
- package/dist/codeact/execute-code-contract.js +225 -0
- package/dist/codeact/execute-code-contract.js.map +1 -0
- package/dist/codeact/fabric-package.d.ts +29 -0
- package/dist/codeact/fabric-package.d.ts.map +1 -0
- package/dist/codeact/fabric-package.js +62 -0
- package/dist/codeact/fabric-package.js.map +1 -0
- package/dist/codeact/flow-package.d.ts +31 -0
- package/dist/codeact/flow-package.d.ts.map +1 -0
- package/dist/codeact/flow-package.js +80 -0
- package/dist/codeact/flow-package.js.map +1 -0
- package/dist/codeact/graph-dsl-package.d.ts +42 -0
- package/dist/codeact/graph-dsl-package.d.ts.map +1 -0
- package/dist/codeact/graph-dsl-package.js +100 -0
- package/dist/codeact/graph-dsl-package.js.map +1 -0
- package/dist/codeact/graph-model.d.ts +30 -0
- package/dist/codeact/graph-model.d.ts.map +1 -0
- package/dist/codeact/graph-model.js +408 -0
- package/dist/codeact/graph-model.js.map +1 -0
- package/dist/codeact/mcp-guest-contract.d.ts +66 -0
- package/dist/codeact/mcp-guest-contract.d.ts.map +1 -0
- package/dist/codeact/mcp-guest-contract.js +108 -0
- package/dist/codeact/mcp-guest-contract.js.map +1 -0
- package/dist/codeact/nodetool-api.d.ts +60 -0
- package/dist/codeact/nodetool-api.d.ts.map +1 -0
- package/dist/codeact/nodetool-api.js +2056 -0
- package/dist/codeact/nodetool-api.js.map +1 -0
- package/dist/codeact/prompt.d.ts +88 -0
- package/dist/codeact/prompt.d.ts.map +1 -0
- package/dist/codeact/prompt.js +326 -0
- package/dist/codeact/prompt.js.map +1 -0
- package/dist/codeact/sandbox-package-docs.d.ts +48 -0
- package/dist/codeact/sandbox-package-docs.d.ts.map +1 -0
- package/dist/codeact/sandbox-package-docs.js +55 -0
- package/dist/codeact/sandbox-package-docs.js.map +1 -0
- package/dist/codeact/sandbox-package-listing.d.ts +81 -0
- package/dist/codeact/sandbox-package-listing.d.ts.map +1 -0
- package/dist/codeact/sandbox-package-listing.js +101 -0
- package/dist/codeact/sandbox-package-listing.js.map +1 -0
- package/dist/codeact/sandbox-packages.d.ts +72 -0
- package/dist/codeact/sandbox-packages.d.ts.map +1 -0
- package/dist/codeact/sandbox-packages.js +230 -0
- package/dist/codeact/sandbox-packages.js.map +1 -0
- package/dist/codeact/timeline-package.d.ts +5 -0
- package/dist/codeact/timeline-package.d.ts.map +1 -0
- package/dist/codeact/timeline-package.js +10 -0
- package/dist/codeact/timeline-package.js.map +1 -0
- package/dist/codeact/tool-api.d.ts +197 -0
- package/dist/codeact/tool-api.d.ts.map +1 -0
- package/dist/codeact/tool-api.js +445 -0
- package/dist/codeact/tool-api.js.map +1 -0
- package/dist/codeact/tools-prelude.d.ts +32 -0
- package/dist/codeact/tools-prelude.d.ts.map +1 -0
- package/dist/codeact/tools-prelude.js +65 -0
- package/dist/codeact/tools-prelude.js.map +1 -0
- package/dist/constants.d.ts +47 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +64 -2
- package/dist/constants.js.map +1 -1
- package/dist/custom-animation-bake.d.ts +57 -0
- package/dist/custom-animation-bake.d.ts.map +1 -0
- package/dist/custom-animation-bake.js +88 -0
- package/dist/custom-animation-bake.js.map +1 -0
- package/dist/dynamic-slots.d.ts +72 -0
- package/dist/dynamic-slots.d.ts.map +1 -0
- package/dist/dynamic-slots.js +0 -0
- package/dist/dynamic-slots.js.map +1 -0
- package/dist/evals/app-build-cases.d.ts +35 -0
- package/dist/evals/app-build-cases.d.ts.map +1 -0
- package/dist/evals/app-build-cases.js +722 -0
- package/dist/evals/app-build-cases.js.map +1 -0
- package/dist/evals/app-build-eval.d.ts +208 -0
- package/dist/evals/app-build-eval.d.ts.map +1 -0
- package/dist/evals/app-build-eval.js +518 -0
- package/dist/evals/app-build-eval.js.map +1 -0
- package/dist/evals/app-build-plan.d.ts +76 -0
- package/dist/evals/app-build-plan.d.ts.map +1 -0
- package/dist/evals/app-build-plan.js +140 -0
- package/dist/evals/app-build-plan.js.map +1 -0
- package/dist/evals/code-gen-cases.d.ts +13 -0
- package/dist/evals/code-gen-cases.d.ts.map +1 -0
- package/dist/evals/code-gen-cases.js +124 -0
- package/dist/evals/code-gen-cases.js.map +1 -0
- package/dist/evals/code-gen-eval.d.ts +109 -0
- package/dist/evals/code-gen-eval.d.ts.map +1 -0
- package/dist/evals/code-gen-eval.js +299 -0
- package/dist/evals/code-gen-eval.js.map +1 -0
- package/dist/evals/codeact-api-cases.d.ts +14 -0
- package/dist/evals/codeact-api-cases.d.ts.map +1 -0
- package/dist/evals/codeact-api-cases.js +29 -0
- package/dist/evals/codeact-api-cases.js.map +1 -0
- package/dist/evals/codeact-api-core.d.ts +23 -0
- package/dist/evals/codeact-api-core.d.ts.map +1 -0
- package/dist/evals/codeact-api-core.js +1411 -0
- package/dist/evals/codeact-api-core.js.map +1 -0
- package/dist/evals/codeact-api-surfaces.d.ts +25 -0
- package/dist/evals/codeact-api-surfaces.d.ts.map +1 -0
- package/dist/evals/codeact-api-surfaces.js +2191 -0
- package/dist/evals/codeact-api-surfaces.js.map +1 -0
- package/dist/evals/codeact-cases.d.ts +76 -0
- package/dist/evals/codeact-cases.d.ts.map +1 -0
- package/dist/evals/codeact-cases.js +151 -0
- package/dist/evals/codeact-cases.js.map +1 -0
- package/dist/evals/codeact-eval.d.ts +66 -0
- package/dist/evals/codeact-eval.d.ts.map +1 -0
- package/dist/evals/codeact-eval.js +250 -0
- package/dist/evals/codeact-eval.js.map +1 -0
- package/dist/evals/codeact-sandbox-pack-cases.d.ts +31 -0
- package/dist/evals/codeact-sandbox-pack-cases.d.ts.map +1 -0
- package/dist/evals/codeact-sandbox-pack-cases.js +219 -0
- package/dist/evals/codeact-sandbox-pack-cases.js.map +1 -0
- package/dist/evals/escalation-cases.d.ts +22 -0
- package/dist/evals/escalation-cases.d.ts.map +1 -0
- package/dist/evals/escalation-cases.js +343 -0
- package/dist/evals/escalation-cases.js.map +1 -0
- package/dist/evals/escalation.d.ts +92 -0
- package/dist/evals/escalation.d.ts.map +1 -0
- package/dist/evals/escalation.js +152 -0
- package/dist/evals/escalation.js.map +1 -0
- package/dist/evals/goal-judge.d.ts +51 -0
- package/dist/evals/goal-judge.d.ts.map +1 -0
- package/dist/evals/goal-judge.js +152 -0
- package/dist/evals/goal-judge.js.map +1 -0
- package/dist/evals/graph-e2e-cases.d.ts +21 -0
- package/dist/evals/graph-e2e-cases.d.ts.map +1 -0
- package/dist/evals/graph-e2e-cases.js +262 -0
- package/dist/evals/graph-e2e-cases.js.map +1 -0
- package/dist/evals/graph-e2e-eval.d.ts +202 -0
- package/dist/evals/graph-e2e-eval.d.ts.map +1 -0
- package/dist/evals/graph-e2e-eval.js +438 -0
- package/dist/evals/graph-e2e-eval.js.map +1 -0
- package/dist/evals/graph-planner-cases.d.ts +12 -0
- package/dist/evals/graph-planner-cases.d.ts.map +1 -0
- package/dist/evals/graph-planner-cases.js +256 -0
- package/dist/evals/graph-planner-cases.js.map +1 -0
- package/dist/evals/graph-planner-eval.d.ts +178 -0
- package/dist/evals/graph-planner-eval.d.ts.map +1 -0
- package/dist/evals/graph-planner-eval.js +495 -0
- package/dist/evals/graph-planner-eval.js.map +1 -0
- package/dist/evals/planner-tools.d.ts +21 -0
- package/dist/evals/planner-tools.d.ts.map +1 -0
- package/dist/evals/planner-tools.js +66 -0
- package/dist/evals/planner-tools.js.map +1 -0
- package/dist/evals/subtask-cases.d.ts +88 -0
- package/dist/evals/subtask-cases.d.ts.map +1 -0
- package/dist/evals/subtask-cases.js +322 -0
- package/dist/evals/subtask-cases.js.map +1 -0
- package/dist/evals/subtask-eval.d.ts +129 -0
- package/dist/evals/subtask-eval.d.ts.map +1 -0
- package/dist/evals/subtask-eval.js +397 -0
- package/dist/evals/subtask-eval.js.map +1 -0
- package/dist/evals/surfaces/app.d.ts +19 -0
- package/dist/evals/surfaces/app.d.ts.map +1 -0
- package/dist/evals/surfaces/app.js +341 -0
- package/dist/evals/surfaces/app.js.map +1 -0
- package/dist/evals/surfaces/creative-pipeline.d.ts +203 -0
- package/dist/evals/surfaces/creative-pipeline.d.ts.map +1 -0
- package/dist/evals/surfaces/creative-pipeline.js +909 -0
- package/dist/evals/surfaces/creative-pipeline.js.map +1 -0
- package/dist/evals/surfaces/game.d.ts +5 -0
- package/dist/evals/surfaces/game.d.ts.map +1 -0
- package/dist/evals/surfaces/game.js +42 -0
- package/dist/evals/surfaces/game.js.map +1 -0
- package/dist/evals/surfaces/js-script.d.ts +66 -0
- package/dist/evals/surfaces/js-script.d.ts.map +1 -0
- package/dist/evals/surfaces/js-script.js +407 -0
- package/dist/evals/surfaces/js-script.js.map +1 -0
- package/dist/evals/surfaces/memory.d.ts +34 -0
- package/dist/evals/surfaces/memory.d.ts.map +1 -0
- package/dist/evals/surfaces/memory.js +264 -0
- package/dist/evals/surfaces/memory.js.map +1 -0
- package/dist/evals/surfaces/model3d.d.ts +45 -0
- package/dist/evals/surfaces/model3d.d.ts.map +1 -0
- package/dist/evals/surfaces/model3d.js +346 -0
- package/dist/evals/surfaces/model3d.js.map +1 -0
- package/dist/evals/surfaces/script.d.ts +96 -0
- package/dist/evals/surfaces/script.d.ts.map +1 -0
- package/dist/evals/surfaces/script.js +709 -0
- package/dist/evals/surfaces/script.js.map +1 -0
- package/dist/evals/surfaces/sketch.d.ts +124 -0
- package/dist/evals/surfaces/sketch.d.ts.map +1 -0
- package/dist/evals/surfaces/sketch.js +1298 -0
- package/dist/evals/surfaces/sketch.js.map +1 -0
- package/dist/evals/surfaces/storyboard.d.ts +97 -0
- package/dist/evals/surfaces/storyboard.d.ts.map +1 -0
- package/dist/evals/surfaces/storyboard.js +693 -0
- package/dist/evals/surfaces/storyboard.js.map +1 -0
- package/dist/evals/surfaces/timeline.d.ts +416 -0
- package/dist/evals/surfaces/timeline.d.ts.map +1 -0
- package/dist/evals/surfaces/timeline.js +3267 -0
- package/dist/evals/surfaces/timeline.js.map +1 -0
- package/dist/evals/task-planner-cases.d.ts +57 -0
- package/dist/evals/task-planner-cases.d.ts.map +1 -0
- package/dist/evals/task-planner-cases.js +117 -0
- package/dist/evals/task-planner-cases.js.map +1 -0
- package/dist/evals/task-planner-eval.d.ts +101 -0
- package/dist/evals/task-planner-eval.d.ts.map +1 -0
- package/dist/evals/task-planner-eval.js +380 -0
- package/dist/evals/task-planner-eval.js.map +1 -0
- package/dist/evals/tool-loop-bridge.d.ts +57 -0
- package/dist/evals/tool-loop-bridge.d.ts.map +1 -0
- package/dist/evals/tool-loop-bridge.js +129 -0
- package/dist/evals/tool-loop-bridge.js.map +1 -0
- package/dist/evals/tool-loop-cases.d.ts +21 -0
- package/dist/evals/tool-loop-cases.d.ts.map +1 -0
- package/dist/evals/tool-loop-cases.js +401 -0
- package/dist/evals/tool-loop-cases.js.map +1 -0
- package/dist/evals/tool-loop-eval.d.ts +234 -0
- package/dist/evals/tool-loop-eval.d.ts.map +1 -0
- package/dist/evals/tool-loop-eval.js +373 -0
- package/dist/evals/tool-loop-eval.js.map +1 -0
- package/dist/evals/tool-loop-permission.d.ts +43 -0
- package/dist/evals/tool-loop-permission.d.ts.map +1 -0
- package/dist/evals/tool-loop-permission.js +76 -0
- package/dist/evals/tool-loop-permission.js.map +1 -0
- package/dist/game-examples.d.ts +447 -0
- package/dist/game-examples.d.ts.map +1 -0
- package/dist/game-examples.js +187 -0
- package/dist/game-examples.js.map +1 -0
- package/dist/graph-builder.d.ts +55 -3
- package/dist/graph-builder.d.ts.map +1 -1
- package/dist/graph-builder.js +159 -4
- package/dist/graph-builder.js.map +1 -1
- package/dist/graph-dsl-core.d.ts +25 -0
- package/dist/graph-dsl-core.d.ts.map +1 -0
- package/dist/graph-dsl-core.js +312 -0
- package/dist/graph-dsl-core.js.map +1 -0
- package/dist/graph-dsl.d.ts +30 -0
- package/dist/graph-dsl.d.ts.map +1 -0
- package/dist/graph-dsl.js +116 -0
- package/dist/graph-dsl.js.map +1 -0
- package/dist/host-binaries.d.ts +6 -0
- package/dist/host-binaries.d.ts.map +1 -0
- package/dist/host-binaries.js +6 -0
- package/dist/host-binaries.js.map +1 -0
- package/dist/host-binary-guard.d.ts +100 -0
- package/dist/host-binary-guard.d.ts.map +1 -0
- package/dist/host-binary-guard.js +205 -0
- package/dist/host-binary-guard.js.map +1 -0
- package/dist/host-modules/aws.d.ts +57 -0
- package/dist/host-modules/aws.d.ts.map +1 -0
- package/dist/host-modules/aws.js +309 -0
- package/dist/host-modules/aws.js.map +1 -0
- package/dist/host-modules/chrono.d.ts +15 -0
- package/dist/host-modules/chrono.d.ts.map +1 -0
- package/dist/host-modules/chrono.js +35 -0
- package/dist/host-modules/chrono.js.map +1 -0
- package/dist/host-modules/csv.d.ts +17 -0
- package/dist/host-modules/csv.d.ts.map +1 -0
- package/dist/host-modules/csv.js +64 -0
- package/dist/host-modules/csv.js.map +1 -0
- package/dist/host-modules/diff.d.ts +9 -0
- package/dist/host-modules/diff.d.ts.map +1 -0
- package/dist/host-modules/diff.js +26 -0
- package/dist/host-modules/diff.js.map +1 -0
- package/dist/host-modules/dispatcher.d.ts +41 -0
- package/dist/host-modules/dispatcher.d.ts.map +1 -0
- package/dist/host-modules/dispatcher.js +99 -0
- package/dist/host-modules/dispatcher.js.map +1 -0
- package/dist/host-modules/docx.d.ts +19 -0
- package/dist/host-modules/docx.d.ts.map +1 -0
- package/dist/host-modules/docx.js +120 -0
- package/dist/host-modules/docx.js.map +1 -0
- package/dist/host-modules/epub.d.ts +48 -0
- package/dist/host-modules/epub.d.ts.map +1 -0
- package/dist/host-modules/epub.js +100 -0
- package/dist/host-modules/epub.js.map +1 -0
- package/dist/host-modules/exif.d.ts +8 -0
- package/dist/host-modules/exif.d.ts.map +1 -0
- package/dist/host-modules/exif.js +19 -0
- package/dist/host-modules/exif.js.map +1 -0
- package/dist/host-modules/expr.d.ts +16 -0
- package/dist/host-modules/expr.d.ts.map +1 -0
- package/dist/host-modules/expr.js +18 -0
- package/dist/host-modules/expr.js.map +1 -0
- package/dist/host-modules/fabric.d.ts +46 -0
- package/dist/host-modules/fabric.d.ts.map +1 -0
- package/dist/host-modules/fabric.js +178 -0
- package/dist/host-modules/fabric.js.map +1 -0
- package/dist/host-modules/html.d.ts +51 -0
- package/dist/host-modules/html.d.ts.map +1 -0
- package/dist/host-modules/html.js +198 -0
- package/dist/host-modules/html.js.map +1 -0
- package/dist/host-modules/ics.d.ts +9 -0
- package/dist/host-modules/ics.d.ts.map +1 -0
- package/dist/host-modules/ics.js +35 -0
- package/dist/host-modules/ics.js.map +1 -0
- package/dist/host-modules/limits.d.ts +41 -0
- package/dist/host-modules/limits.d.ts.map +1 -0
- package/dist/host-modules/limits.js +76 -0
- package/dist/host-modules/limits.js.map +1 -0
- package/dist/host-modules/mammoth.d.ts +11 -0
- package/dist/host-modules/mammoth.d.ts.map +1 -0
- package/dist/host-modules/mammoth.js +29 -0
- package/dist/host-modules/mammoth.js.map +1 -0
- package/dist/host-modules/notion.d.ts +45 -0
- package/dist/host-modules/notion.d.ts.map +1 -0
- package/dist/host-modules/notion.js +128 -0
- package/dist/host-modules/notion.js.map +1 -0
- package/dist/host-modules/ocr.d.ts +25 -0
- package/dist/host-modules/ocr.d.ts.map +1 -0
- package/dist/host-modules/ocr.js +74 -0
- package/dist/host-modules/ocr.js.map +1 -0
- package/dist/host-modules/pdf.d.ts +21 -0
- package/dist/host-modules/pdf.d.ts.map +1 -0
- package/dist/host-modules/pdf.js +53 -0
- package/dist/host-modules/pdf.js.map +1 -0
- package/dist/host-modules/pdflib.d.ts +17 -0
- package/dist/host-modules/pdflib.d.ts.map +1 -0
- package/dist/host-modules/pdflib.js +138 -0
- package/dist/host-modules/pdflib.js.map +1 -0
- package/dist/host-modules/pptx.d.ts +19 -0
- package/dist/host-modules/pptx.d.ts.map +1 -0
- package/dist/host-modules/pptx.js +67 -0
- package/dist/host-modules/pptx.js.map +1 -0
- package/dist/host-modules/pptxgen.d.ts +13 -0
- package/dist/host-modules/pptxgen.d.ts.map +1 -0
- package/dist/host-modules/pptxgen.js +98 -0
- package/dist/host-modules/pptxgen.js.map +1 -0
- package/dist/host-modules/prepared-request.d.ts +41 -0
- package/dist/host-modules/prepared-request.d.ts.map +1 -0
- package/dist/host-modules/prepared-request.js +104 -0
- package/dist/host-modules/prepared-request.js.map +1 -0
- package/dist/host-modules/registry.d.ts +31 -0
- package/dist/host-modules/registry.d.ts.map +1 -0
- package/dist/host-modules/registry.js +193 -0
- package/dist/host-modules/registry.js.map +1 -0
- package/dist/host-modules/subtitle.d.ts +15 -0
- package/dist/host-modules/subtitle.d.ts.map +1 -0
- package/dist/host-modules/subtitle.js +45 -0
- package/dist/host-modules/subtitle.js.map +1 -0
- package/dist/host-modules/supabase.d.ts +42 -0
- package/dist/host-modules/supabase.d.ts.map +1 -0
- package/dist/host-modules/supabase.js +141 -0
- package/dist/host-modules/supabase.js.map +1 -0
- package/dist/host-modules/tfjs.d.ts +42 -0
- package/dist/host-modules/tfjs.d.ts.map +1 -0
- package/dist/host-modules/tfjs.js +186 -0
- package/dist/host-modules/tfjs.js.map +1 -0
- package/dist/host-modules/tokens.d.ts +17 -0
- package/dist/host-modules/tokens.d.ts.map +1 -0
- package/dist/host-modules/tokens.js +74 -0
- package/dist/host-modules/tokens.js.map +1 -0
- package/dist/host-modules/twilio.d.ts +34 -0
- package/dist/host-modules/twilio.d.ts.map +1 -0
- package/dist/host-modules/twilio.js +67 -0
- package/dist/host-modules/twilio.js.map +1 -0
- package/dist/host-modules/xlsx.d.ts +26 -0
- package/dist/host-modules/xlsx.d.ts.map +1 -0
- package/dist/host-modules/xlsx.js +323 -0
- package/dist/host-modules/xlsx.js.map +1 -0
- package/dist/host-modules/xml.d.ts +23 -0
- package/dist/host-modules/xml.d.ts.map +1 -0
- package/dist/host-modules/xml.js +38 -0
- package/dist/host-modules/xml.js.map +1 -0
- package/dist/host-modules/zip.d.ts +24 -0
- package/dist/host-modules/zip.d.ts.map +1 -0
- package/dist/host-modules/zip.js +70 -0
- package/dist/host-modules/zip.js.map +1 -0
- package/dist/index.d.ts +197 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +153 -60
- package/dist/index.js.map +1 -1
- package/dist/js-sandbox-worker/host.d.ts +136 -0
- package/dist/js-sandbox-worker/host.d.ts.map +1 -0
- package/dist/js-sandbox-worker/host.js +482 -0
- package/dist/js-sandbox-worker/host.js.map +1 -0
- package/dist/js-sandbox-worker/interpreter.d.ts +276 -0
- package/dist/js-sandbox-worker/interpreter.d.ts.map +1 -0
- package/dist/js-sandbox-worker/interpreter.js +1201 -0
- package/dist/js-sandbox-worker/interpreter.js.map +1 -0
- package/dist/js-sandbox-worker/protocol.d.ts +168 -0
- package/dist/js-sandbox-worker/protocol.d.ts.map +1 -0
- package/dist/js-sandbox-worker/protocol.js +217 -0
- package/dist/js-sandbox-worker/protocol.js.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts +26 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.js +307 -0
- package/dist/js-sandbox-worker/worker-entry.js.map +1 -0
- package/dist/js-sandbox.d.ts +455 -15
- package/dist/js-sandbox.d.ts.map +1 -1
- package/dist/js-sandbox.js +1961 -309
- package/dist/js-sandbox.js.map +1 -1
- package/dist/js-script-app-runner.d.ts +9 -0
- package/dist/js-script-app-runner.d.ts.map +1 -0
- package/dist/js-script-app-runner.js +49 -0
- package/dist/js-script-app-runner.js.map +1 -0
- package/dist/js-script-sandbox.d.ts +33 -0
- package/dist/js-script-sandbox.d.ts.map +1 -0
- package/dist/js-script-sandbox.js +82 -0
- package/dist/js-script-sandbox.js.map +1 -0
- package/dist/jtbd/friction.d.ts +26 -0
- package/dist/jtbd/friction.d.ts.map +1 -0
- package/dist/jtbd/friction.js +169 -0
- package/dist/jtbd/friction.js.map +1 -0
- package/dist/jtbd/index.d.ts +6 -0
- package/dist/jtbd/index.d.ts.map +1 -0
- package/dist/jtbd/index.js +6 -0
- package/dist/jtbd/index.js.map +1 -0
- package/dist/jtbd/optimize.d.ts +71 -0
- package/dist/jtbd/optimize.d.ts.map +1 -0
- package/dist/jtbd/optimize.js +176 -0
- package/dist/jtbd/optimize.js.map +1 -0
- package/dist/jtbd/registry.d.ts +29 -0
- package/dist/jtbd/registry.d.ts.map +1 -0
- package/dist/jtbd/registry.js +451 -0
- package/dist/jtbd/registry.js.map +1 -0
- package/dist/jtbd/run.d.ts +70 -0
- package/dist/jtbd/run.d.ts.map +1 -0
- package/dist/jtbd/run.js +177 -0
- package/dist/jtbd/run.js.map +1 -0
- package/dist/jtbd/types.d.ts +141 -0
- package/dist/jtbd/types.d.ts.map +1 -0
- package/dist/jtbd/types.js +25 -0
- package/dist/jtbd/types.js.map +1 -0
- package/dist/model-prompting-skills.d.ts +45 -0
- package/dist/model-prompting-skills.d.ts.map +1 -0
- package/dist/model-prompting-skills.js +116 -0
- package/dist/model-prompting-skills.js.map +1 -0
- package/dist/network-guard.d.ts +50 -0
- package/dist/network-guard.d.ts.map +1 -0
- package/dist/network-guard.js +106 -0
- package/dist/network-guard.js.map +1 -0
- package/dist/normalize-model-properties.d.ts +26 -0
- package/dist/normalize-model-properties.d.ts.map +1 -0
- package/dist/normalize-model-properties.js +58 -0
- package/dist/normalize-model-properties.js.map +1 -0
- package/dist/output-format.d.ts +5 -1
- package/dist/output-format.d.ts.map +1 -1
- package/dist/output-format.js.map +1 -1
- package/dist/parallel-task-executor.d.ts +68 -37
- package/dist/parallel-task-executor.d.ts.map +1 -1
- package/dist/parallel-task-executor.js +234 -203
- package/dist/parallel-task-executor.js.map +1 -1
- package/dist/prompts/background-subtask-prompt.d.ts +14 -0
- package/dist/prompts/background-subtask-prompt.d.ts.map +1 -0
- package/dist/prompts/background-subtask-prompt.js +64 -0
- package/dist/prompts/background-subtask-prompt.js.map +1 -0
- package/dist/prompts/product-knowledge.d.ts +3 -0
- package/dist/prompts/product-knowledge.d.ts.map +1 -0
- package/dist/prompts/product-knowledge.js +79 -0
- package/dist/prompts/product-knowledge.js.map +1 -0
- package/dist/prompts/read-only-search-prompt.d.ts +33 -0
- package/dist/prompts/read-only-search-prompt.d.ts.map +1 -0
- package/dist/prompts/read-only-search-prompt.js +109 -0
- package/dist/prompts/read-only-search-prompt.js.map +1 -0
- package/dist/prompts/sandbox-pack-catalog.d.ts +23 -0
- package/dist/prompts/sandbox-pack-catalog.d.ts.map +1 -0
- package/dist/prompts/sandbox-pack-catalog.js +40 -0
- package/dist/prompts/sandbox-pack-catalog.js.map +1 -0
- package/dist/prompts/security-monitor-prompt.d.ts +32 -0
- package/dist/prompts/security-monitor-prompt.d.ts.map +1 -0
- package/dist/prompts/security-monitor-prompt.js +99 -0
- package/dist/prompts/security-monitor-prompt.js.map +1 -0
- package/dist/prompts/workflow-authoring-knowledge.d.ts +77 -0
- package/dist/prompts/workflow-authoring-knowledge.d.ts.map +1 -0
- package/dist/prompts/workflow-authoring-knowledge.js +319 -0
- package/dist/prompts/workflow-authoring-knowledge.js.map +1 -0
- package/dist/run-policy.d.ts +25 -0
- package/dist/run-policy.d.ts.map +1 -0
- package/dist/run-policy.js +54 -0
- package/dist/run-policy.js.map +1 -0
- package/dist/sandbox-av-media.d.ts +33 -0
- package/dist/sandbox-av-media.d.ts.map +1 -0
- package/dist/sandbox-av-media.js +666 -0
- package/dist/sandbox-av-media.js.map +1 -0
- package/dist/sandbox-bootstrap-modules.d.ts +54 -0
- package/dist/sandbox-bootstrap-modules.d.ts.map +1 -0
- package/dist/sandbox-bootstrap-modules.js +104 -0
- package/dist/sandbox-bootstrap-modules.js.map +1 -0
- package/dist/sandbox-bytes.d.ts +43 -0
- package/dist/sandbox-bytes.d.ts.map +1 -0
- package/dist/sandbox-bytes.js +61 -0
- package/dist/sandbox-bytes.js.map +1 -0
- package/dist/sandbox-canvas-api.d.ts +30 -0
- package/dist/sandbox-canvas-api.d.ts.map +1 -0
- package/dist/sandbox-canvas-api.js +81 -0
- package/dist/sandbox-canvas-api.js.map +1 -0
- package/dist/sandbox-constants.d.ts +5 -0
- package/dist/sandbox-constants.d.ts.map +1 -0
- package/dist/sandbox-constants.js +13 -0
- package/dist/sandbox-constants.js.map +1 -0
- package/dist/sandbox-json-transport.d.ts +107 -0
- package/dist/sandbox-json-transport.d.ts.map +1 -0
- package/dist/sandbox-json-transport.js +324 -0
- package/dist/sandbox-json-transport.js.map +1 -0
- package/dist/sandbox-media-handle.d.ts +78 -0
- package/dist/sandbox-media-handle.d.ts.map +1 -0
- package/dist/sandbox-media-handle.js +114 -0
- package/dist/sandbox-media-handle.js.map +1 -0
- package/dist/sandbox-media-ref.d.ts +134 -0
- package/dist/sandbox-media-ref.d.ts.map +1 -0
- package/dist/sandbox-media-ref.js +442 -0
- package/dist/sandbox-media-ref.js.map +1 -0
- package/dist/sandbox-media.d.ts +177 -0
- package/dist/sandbox-media.d.ts.map +1 -0
- package/dist/sandbox-media.js +963 -0
- package/dist/sandbox-media.js.map +1 -0
- package/dist/sandbox-module-fixtures.d.ts +445 -0
- package/dist/sandbox-module-fixtures.d.ts.map +1 -0
- package/dist/sandbox-module-fixtures.js +214 -0
- package/dist/sandbox-module-fixtures.js.map +1 -0
- package/dist/sandbox-toolbelt.d.ts +13 -0
- package/dist/sandbox-toolbelt.d.ts.map +1 -0
- package/dist/sandbox-toolbelt.js +64 -0
- package/dist/sandbox-toolbelt.js.map +1 -0
- package/dist/security-monitor.d.ts +89 -0
- package/dist/security-monitor.d.ts.map +1 -0
- package/dist/security-monitor.js +307 -0
- package/dist/security-monitor.js.map +1 -0
- package/dist/serpapi/catalog.d.ts +101 -0
- package/dist/serpapi/catalog.d.ts.map +1 -0
- package/dist/serpapi/catalog.js +246 -0
- package/dist/serpapi/catalog.js.map +1 -0
- package/dist/serpapi/client.d.ts +81 -0
- package/dist/serpapi/client.d.ts.map +1 -0
- package/dist/serpapi/client.js +228 -0
- package/dist/serpapi/client.js.map +1 -0
- package/dist/serpapi/errors.d.ts +49 -0
- package/dist/serpapi/errors.d.ts.map +1 -0
- package/dist/serpapi/errors.js +64 -0
- package/dist/serpapi/errors.js.map +1 -0
- package/dist/serpapi/normalize.d.ts +58 -0
- package/dist/serpapi/normalize.d.ts.map +1 -0
- package/dist/serpapi/normalize.js +140 -0
- package/dist/serpapi/normalize.js.map +1 -0
- package/dist/skill-prompt.d.ts +27 -0
- package/dist/skill-prompt.d.ts.map +1 -0
- package/dist/skill-prompt.js +61 -0
- package/dist/skill-prompt.js.map +1 -0
- package/dist/step-executor.d.ts +90 -77
- package/dist/step-executor.d.ts.map +1 -1
- package/dist/step-executor.js +384 -690
- package/dist/step-executor.js.map +1 -1
- package/dist/subagent.d.ts +275 -0
- package/dist/subagent.d.ts.map +1 -0
- package/dist/subagent.js +444 -0
- package/dist/subagent.js.map +1 -0
- package/dist/supervisor/prompt.d.ts +12 -0
- package/dist/supervisor/prompt.d.ts.map +1 -0
- package/dist/supervisor/prompt.js +51 -0
- package/dist/supervisor/prompt.js.map +1 -0
- package/dist/supervisor/supervisor-agent.d.ts +72 -0
- package/dist/supervisor/supervisor-agent.d.ts.map +1 -0
- package/dist/supervisor/supervisor-agent.js +185 -0
- package/dist/supervisor/supervisor-agent.js.map +1 -0
- package/dist/supervisor/tools.d.ts +56 -0
- package/dist/supervisor/tools.d.ts.map +1 -0
- package/dist/supervisor/tools.js +83 -0
- package/dist/supervisor/tools.js.map +1 -0
- package/dist/supervisor/verdict-schema.d.ts +18 -0
- package/dist/supervisor/verdict-schema.d.ts.map +1 -0
- package/dist/supervisor/verdict-schema.js +58 -0
- package/dist/supervisor/verdict-schema.js.map +1 -0
- package/dist/system-skills.d.ts +68 -0
- package/dist/system-skills.d.ts.map +1 -0
- package/dist/system-skills.js +168 -0
- package/dist/system-skills.js.map +1 -0
- package/dist/task-executor.d.ts +90 -40
- package/dist/task-executor.d.ts.map +1 -1
- package/dist/task-executor.js +259 -282
- package/dist/task-executor.js.map +1 -1
- package/dist/task-planner.d.ts +18 -12
- package/dist/task-planner.d.ts.map +1 -1
- package/dist/task-planner.js +342 -328
- package/dist/task-planner.js.map +1 -1
- package/dist/timeline-preview/compare.d.ts +27 -0
- package/dist/timeline-preview/compare.d.ts.map +1 -0
- package/dist/timeline-preview/compare.js +71 -0
- package/dist/timeline-preview/compare.js.map +1 -0
- package/dist/timeline-preview/frames.d.ts +167 -0
- package/dist/timeline-preview/frames.d.ts.map +1 -0
- package/dist/timeline-preview/frames.js +646 -0
- package/dist/timeline-preview/frames.js.map +1 -0
- package/dist/timeline-preview/model3d.d.ts +67 -0
- package/dist/timeline-preview/model3d.d.ts.map +1 -0
- package/dist/timeline-preview/model3d.js +165 -0
- package/dist/timeline-preview/model3d.js.map +1 -0
- package/dist/timeline-preview/rasterize.d.ts +33 -0
- package/dist/timeline-preview/rasterize.d.ts.map +1 -0
- package/dist/timeline-preview/rasterize.js +83 -0
- package/dist/timeline-preview/rasterize.js.map +1 -0
- package/dist/timeline-preview/sheet.d.ts +38 -0
- package/dist/timeline-preview/sheet.d.ts.map +1 -0
- package/dist/timeline-preview/sheet.js +72 -0
- package/dist/timeline-preview/sheet.js.map +1 -0
- package/dist/tools/asset-persist.d.ts +29 -0
- package/dist/tools/asset-persist.d.ts.map +1 -0
- package/dist/tools/asset-persist.js +78 -0
- package/dist/tools/asset-persist.js.map +1 -0
- package/dist/tools/base-tool.d.ts +52 -5
- package/dist/tools/base-tool.d.ts.map +1 -1
- package/dist/tools/base-tool.js +180 -3
- package/dist/tools/base-tool.js.map +1 -1
- package/dist/tools/binary-output.d.ts +54 -0
- package/dist/tools/binary-output.d.ts.map +1 -0
- package/dist/tools/binary-output.js +127 -0
- package/dist/tools/binary-output.js.map +1 -0
- package/dist/tools/browser-tools.d.ts +5 -29
- package/dist/tools/browser-tools.d.ts.map +1 -1
- package/dist/tools/browser-tools.js +5 -205
- package/dist/tools/browser-tools.js.map +1 -1
- package/dist/tools/builtin-tools.d.ts +52 -0
- package/dist/tools/builtin-tools.d.ts.map +1 -0
- package/dist/tools/builtin-tools.js +276 -0
- package/dist/tools/builtin-tools.js.map +1 -0
- package/dist/tools/control-tool.d.ts +2 -5
- package/dist/tools/control-tool.d.ts.map +1 -1
- package/dist/tools/control-tool.js +18 -15
- package/dist/tools/control-tool.js.map +1 -1
- package/dist/tools/dataseo-tools.d.ts +34 -32
- package/dist/tools/dataseo-tools.d.ts.map +1 -1
- package/dist/tools/dataseo-tools.js +148 -233
- package/dist/tools/dataseo-tools.js.map +1 -1
- package/dist/tools/external-capability-tools.d.ts +36 -0
- package/dist/tools/external-capability-tools.d.ts.map +1 -0
- package/dist/tools/external-capability-tools.js +41 -0
- package/dist/tools/external-capability-tools.js.map +1 -0
- package/dist/tools/external-mcp-tools.d.ts +139 -0
- package/dist/tools/external-mcp-tools.d.ts.map +1 -0
- package/dist/tools/external-mcp-tools.js +552 -0
- package/dist/tools/external-mcp-tools.js.map +1 -0
- package/dist/tools/finish-step-tool.d.ts +1 -1
- package/dist/tools/finish-step-tool.d.ts.map +1 -1
- package/dist/tools/finish-step-tool.js +3 -3
- package/dist/tools/finish-step-tool.js.map +1 -1
- package/dist/tools/google-tools.d.ts +28 -39
- package/dist/tools/google-tools.d.ts.map +1 -1
- package/dist/tools/google-tools.js +51 -164
- package/dist/tools/google-tools.js.map +1 -1
- package/dist/tools/google-workspace-tools.d.ts +23 -0
- package/dist/tools/google-workspace-tools.d.ts.map +1 -0
- package/dist/tools/google-workspace-tools.js +26 -0
- package/dist/tools/google-workspace-tools.js.map +1 -0
- package/dist/tools/graph-validation-registry.d.ts +33 -0
- package/dist/tools/graph-validation-registry.d.ts.map +1 -0
- package/dist/tools/graph-validation-registry.js +54 -0
- package/dist/tools/graph-validation-registry.js.map +1 -0
- package/dist/tools/http-tools.d.ts +5 -53
- package/dist/tools/http-tools.d.ts.map +1 -1
- package/dist/tools/http-tools.js +5 -177
- package/dist/tools/http-tools.js.map +1 -1
- package/dist/tools/image-injection.d.ts +51 -0
- package/dist/tools/image-injection.d.ts.map +1 -0
- package/dist/tools/image-injection.js +85 -0
- package/dist/tools/image-injection.js.map +1 -0
- package/dist/tools/mcp-tool-support.d.ts +203 -0
- package/dist/tools/mcp-tool-support.d.ts.map +1 -0
- package/dist/tools/mcp-tool-support.js +536 -0
- package/dist/tools/mcp-tool-support.js.map +1 -0
- package/dist/tools/mcp-tools.d.ts +104 -390
- package/dist/tools/mcp-tools.d.ts.map +1 -1
- package/dist/tools/mcp-tools.js +128 -600
- package/dist/tools/mcp-tools.js.map +1 -1
- package/dist/tools/media-tools.d.ts +9 -272
- package/dist/tools/media-tools.d.ts.map +1 -1
- package/dist/tools/media-tools.js +11 -676
- package/dist/tools/media-tools.js.map +1 -1
- package/dist/tools/memory-tools.d.ts +36 -0
- package/dist/tools/memory-tools.d.ts.map +1 -0
- package/dist/tools/memory-tools.js +52 -0
- package/dist/tools/memory-tools.js.map +1 -0
- package/dist/tools/openai-tools.d.ts +28 -68
- package/dist/tools/openai-tools.d.ts.map +1 -1
- package/dist/tools/openai-tools.js +51 -181
- package/dist/tools/openai-tools.js.map +1 -1
- package/dist/tools/plan-builder-tools.d.ts +141 -7
- package/dist/tools/plan-builder-tools.d.ts.map +1 -1
- package/dist/tools/plan-builder-tools.js +159 -86
- package/dist/tools/plan-builder-tools.js.map +1 -1
- package/dist/tools/run-search-tool.d.ts +82 -0
- package/dist/tools/run-search-tool.d.ts.map +1 -0
- package/dist/tools/run-search-tool.js +121 -0
- package/dist/tools/run-search-tool.js.map +1 -0
- package/dist/tools/run-subtask-tool.d.ts +49 -0
- package/dist/tools/run-subtask-tool.d.ts.map +1 -0
- package/dist/tools/run-subtask-tool.js +88 -0
- package/dist/tools/run-subtask-tool.js.map +1 -0
- package/dist/tools/search-tools.d.ts +5 -36
- package/dist/tools/search-tools.d.ts.map +1 -1
- package/dist/tools/search-tools.js +5 -215
- package/dist/tools/search-tools.js.map +1 -1
- package/dist/tools/serp-providers/apify-provider.d.ts +18 -0
- package/dist/tools/serp-providers/apify-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/apify-provider.js +93 -0
- package/dist/tools/serp-providers/apify-provider.js.map +1 -0
- package/dist/tools/serp-providers/brave-provider.d.ts +34 -0
- package/dist/tools/serp-providers/brave-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/brave-provider.js +86 -0
- package/dist/tools/serp-providers/brave-provider.js.map +1 -0
- package/dist/tools/serp-providers/dataforseo-provider.d.ts +14 -1
- package/dist/tools/serp-providers/dataforseo-provider.d.ts.map +1 -1
- package/dist/tools/serp-providers/dataforseo-provider.js +0 -9
- package/dist/tools/serp-providers/dataforseo-provider.js.map +1 -1
- package/dist/tools/serp-providers/gemini-provider.d.ts +45 -0
- package/dist/tools/serp-providers/gemini-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/gemini-provider.js +148 -0
- package/dist/tools/serp-providers/gemini-provider.js.map +1 -0
- package/dist/tools/serp-providers/index.d.ts +61 -0
- package/dist/tools/serp-providers/index.d.ts.map +1 -1
- package/dist/tools/serp-providers/index.js +119 -3
- package/dist/tools/serp-providers/index.js.map +1 -1
- package/dist/tools/serp-providers/openai-provider.d.ts +58 -0
- package/dist/tools/serp-providers/openai-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/openai-provider.js +113 -0
- package/dist/tools/serp-providers/openai-provider.js.map +1 -0
- package/dist/tools/serp-providers/serpapi-provider.d.ts +9 -5
- package/dist/tools/serp-providers/serpapi-provider.d.ts.map +1 -1
- package/dist/tools/serp-providers/serpapi-provider.js +26 -44
- package/dist/tools/serp-providers/serpapi-provider.js.map +1 -1
- package/dist/tools/serp-tool-factory.d.ts +27 -0
- package/dist/tools/serp-tool-factory.d.ts.map +1 -0
- package/dist/tools/serp-tool-factory.js +56 -0
- package/dist/tools/serp-tool-factory.js.map +1 -0
- package/dist/tools/shared-tools.d.ts +33 -0
- package/dist/tools/shared-tools.d.ts.map +1 -0
- package/dist/tools/shared-tools.js +39 -0
- package/dist/tools/shared-tools.js.map +1 -0
- package/dist/tools/start-subtask-tool.d.ts +51 -0
- package/dist/tools/start-subtask-tool.d.ts.map +1 -0
- package/dist/tools/start-subtask-tool.js +189 -0
- package/dist/tools/start-subtask-tool.js.map +1 -0
- package/dist/tools/submit-code-tool.d.ts +159 -0
- package/dist/tools/submit-code-tool.d.ts.map +1 -0
- package/dist/tools/submit-code-tool.js +209 -0
- package/dist/tools/submit-code-tool.js.map +1 -0
- package/dist/tools/subtask-fields.d.ts +11 -0
- package/dist/tools/subtask-fields.d.ts.map +1 -0
- package/dist/tools/subtask-fields.js +11 -0
- package/dist/tools/subtask-fields.js.map +1 -0
- package/dist/tools/todo-tools.d.ts +15 -0
- package/dist/tools/todo-tools.d.ts.map +1 -0
- package/dist/tools/todo-tools.js +15 -0
- package/dist/tools/todo-tools.js.map +1 -0
- package/dist/tools/tool-permissions.d.ts +40 -0
- package/dist/tools/tool-permissions.d.ts.map +1 -0
- package/dist/tools/tool-permissions.js +52 -0
- package/dist/tools/tool-permissions.js.map +1 -0
- package/dist/tools/tool-search.d.ts +39 -0
- package/dist/tools/tool-search.d.ts.map +1 -0
- package/dist/tools/tool-search.js +108 -0
- package/dist/tools/tool-search.js.map +1 -0
- package/dist/tools/vector-tool-support.d.ts +15 -0
- package/dist/tools/vector-tool-support.d.ts.map +1 -0
- package/dist/tools/vector-tool-support.js +133 -0
- package/dist/tools/vector-tool-support.js.map +1 -0
- package/dist/tools/vector-tools.d.ts +13 -220
- package/dist/tools/vector-tools.d.ts.map +1 -1
- package/dist/tools/vector-tools.js +7 -578
- package/dist/tools/vector-tools.js.map +1 -1
- package/dist/tools/wait-subtasks-tool.d.ts +27 -0
- package/dist/tools/wait-subtasks-tool.d.ts.map +1 -0
- package/dist/tools/wait-subtasks-tool.js +66 -0
- package/dist/tools/wait-subtasks-tool.js.map +1 -0
- package/dist/tsconfig.tests.tmp.tsbuildinfo +1 -0
- package/dist/types.d.ts +16 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +8 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/dag-scheduler.d.ts +85 -0
- package/dist/utils/dag-scheduler.d.ts.map +1 -0
- package/dist/utils/dag-scheduler.js +180 -0
- package/dist/utils/dag-scheduler.js.map +1 -0
- package/dist/utils/json-parser.d.ts +32 -1
- package/dist/utils/json-parser.d.ts.map +1 -1
- package/dist/utils/json-parser.js +145 -10
- package/dist/utils/json-parser.js.map +1 -1
- package/dist/utils/json-schema-validate.d.ts +29 -0
- package/dist/utils/json-schema-validate.d.ts.map +1 -0
- package/dist/utils/json-schema-validate.js +228 -0
- package/dist/utils/json-schema-validate.js.map +1 -0
- package/dist/utils/link-abort.d.ts +13 -0
- package/dist/utils/link-abort.d.ts.map +1 -0
- package/dist/utils/link-abort.js +23 -0
- package/dist/utils/link-abort.js.map +1 -0
- package/dist/utils/merge-generators.d.ts +58 -0
- package/dist/utils/merge-generators.d.ts.map +1 -0
- package/dist/utils/merge-generators.js +148 -0
- package/dist/utils/merge-generators.js.map +1 -0
- package/dist/utils/remove-base64-images.d.ts +0 -5
- package/dist/utils/remove-base64-images.d.ts.map +1 -1
- package/dist/utils/remove-base64-images.js.map +1 -1
- package/dist/utils/step-failure.d.ts +20 -0
- package/dist/utils/step-failure.d.ts.map +1 -0
- package/dist/utils/step-failure.js +43 -0
- package/dist/utils/step-failure.js.map +1 -0
- package/dist/utils/think-tags.d.ts +16 -0
- package/dist/utils/think-tags.d.ts.map +1 -0
- package/dist/utils/think-tags.js +23 -0
- package/dist/utils/think-tags.js.map +1 -0
- package/dist/utils/type-guards.d.ts +26 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +44 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/dist/utils/ui-event-buffer.d.ts +18 -0
- package/dist/utils/ui-event-buffer.d.ts.map +1 -0
- package/dist/utils/ui-event-buffer.js +18 -0
- package/dist/utils/ui-event-buffer.js.map +1 -0
- package/dist/utils/wrap-generators-parallel.d.ts +0 -5
- package/dist/utils/wrap-generators-parallel.d.ts.map +1 -1
- package/dist/utils/wrap-generators-parallel.js +3 -6
- package/dist/utils/wrap-generators-parallel.js.map +1 -1
- package/dist/wasm-sandbox/host.d.ts +106 -0
- package/dist/wasm-sandbox/host.d.ts.map +1 -0
- package/dist/wasm-sandbox/host.js +409 -0
- package/dist/wasm-sandbox/host.js.map +1 -0
- package/dist/wasm-sandbox/workers.d.ts +43 -0
- package/dist/wasm-sandbox/workers.d.ts.map +1 -0
- package/dist/wasm-sandbox/workers.js +150 -0
- package/dist/wasm-sandbox/workers.js.map +1 -0
- package/dist/workspace-paths.d.ts +40 -0
- package/dist/workspace-paths.d.ts.map +1 -0
- package/dist/workspace-paths.js +102 -0
- package/dist/workspace-paths.js.map +1 -0
- package/dist/yt-dlp-gate.d.ts +19 -0
- package/dist/yt-dlp-gate.d.ts.map +1 -0
- package/dist/yt-dlp-gate.js +22 -0
- package/dist/yt-dlp-gate.js.map +1 -0
- package/package.json +112 -14
- package/dist/agent-executor.d.ts +0 -62
- package/dist/agent-executor.d.ts.map +0 -1
- package/dist/agent-executor.js +0 -324
- package/dist/agent-executor.js.map +0 -1
- package/dist/agent-step-executor.d.ts +0 -28
- package/dist/agent-step-executor.d.ts.map +0 -1
- package/dist/agent-step-executor.js +0 -99
- package/dist/agent-step-executor.js.map +0 -1
- package/dist/agent-workflow-runner.d.ts +0 -31
- package/dist/agent-workflow-runner.d.ts.map +0 -1
- package/dist/agent-workflow-runner.js +0 -124
- package/dist/agent-workflow-runner.js.map +0 -1
- package/dist/agent.d.ts +0 -115
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -587
- package/dist/agent.js.map +0 -1
- package/dist/base-agent.d.ts +0 -42
- package/dist/base-agent.d.ts.map +0 -1
- package/dist/base-agent.js +0 -29
- package/dist/base-agent.js.map +0 -1
- package/dist/graph-planner.d.ts +0 -56
- package/dist/graph-planner.d.ts.map +0 -1
- package/dist/graph-planner.js +0 -311
- package/dist/graph-planner.js.map +0 -1
- package/dist/multi-mode-agent.d.ts +0 -86
- package/dist/multi-mode-agent.d.ts.map +0 -1
- package/dist/multi-mode-agent.js +0 -476
- package/dist/multi-mode-agent.js.map +0 -1
- package/dist/prompts/graph-planner-prompt.d.ts +0 -48
- package/dist/prompts/graph-planner-prompt.d.ts.map +0 -1
- package/dist/prompts/graph-planner-prompt.js +0 -180
- package/dist/prompts/graph-planner-prompt.js.map +0 -1
- package/dist/reject-agentic-provider.d.ts +0 -21
- package/dist/reject-agentic-provider.d.ts.map +0 -1
- package/dist/reject-agentic-provider.js +0 -32
- package/dist/reject-agentic-provider.js.map +0 -1
- package/dist/simple-agent.d.ts +0 -29
- package/dist/simple-agent.d.ts.map +0 -1
- package/dist/simple-agent.js +0 -54
- package/dist/simple-agent.js.map +0 -1
- package/dist/sub-agent-planner.d.ts +0 -33
- package/dist/sub-agent-planner.d.ts.map +0 -1
- package/dist/sub-agent-planner.js +0 -203
- package/dist/sub-agent-planner.js.map +0 -1
- package/dist/team/db-task-board.d.ts +0 -54
- package/dist/team/db-task-board.d.ts.map +0 -1
- package/dist/team/db-task-board.js +0 -361
- package/dist/team/db-task-board.js.map +0 -1
- package/dist/team/edge-message-bus.d.ts +0 -51
- package/dist/team/edge-message-bus.d.ts.map +0 -1
- package/dist/team/edge-message-bus.js +0 -169
- package/dist/team/edge-message-bus.js.map +0 -1
- package/dist/team/edge-task-board.d.ts +0 -77
- package/dist/team/edge-task-board.d.ts.map +0 -1
- package/dist/team/edge-task-board.js +0 -140
- package/dist/team/edge-task-board.js.map +0 -1
- package/dist/team/index.d.ts +0 -16
- package/dist/team/index.d.ts.map +0 -1
- package/dist/team/index.js +0 -17
- package/dist/team/index.js.map +0 -1
- package/dist/team/message-bus.d.ts +0 -58
- package/dist/team/message-bus.d.ts.map +0 -1
- package/dist/team/message-bus.js +0 -151
- package/dist/team/message-bus.js.map +0 -1
- package/dist/team/task-board.d.ts +0 -106
- package/dist/team/task-board.d.ts.map +0 -1
- package/dist/team/task-board.js +0 -370
- package/dist/team/task-board.js.map +0 -1
- package/dist/team/team-executor.d.ts +0 -72
- package/dist/team/team-executor.d.ts.map +0 -1
- package/dist/team/team-executor.js +0 -466
- package/dist/team/team-executor.js.map +0 -1
- package/dist/team/team-tools.d.ts +0 -252
- package/dist/team/team-tools.d.ts.map +0 -1
- package/dist/team/team-tools.js +0 -412
- package/dist/team/team-tools.js.map +0 -1
- package/dist/team/types.d.ts +0 -198
- package/dist/team/types.d.ts.map +0 -1
- package/dist/team/types.js +0 -8
- package/dist/team/types.js.map +0 -1
- package/dist/tools/add-edge-tool.d.ts +0 -18
- package/dist/tools/add-edge-tool.d.ts.map +0 -1
- package/dist/tools/add-edge-tool.js +0 -92
- package/dist/tools/add-edge-tool.js.map +0 -1
- package/dist/tools/add-node-tool.d.ts +0 -22
- package/dist/tools/add-node-tool.d.ts.map +0 -1
- package/dist/tools/add-node-tool.js +0 -128
- package/dist/tools/add-node-tool.js.map +0 -1
- package/dist/tools/asset-tools.d.ts +0 -58
- package/dist/tools/asset-tools.d.ts.map +0 -1
- package/dist/tools/asset-tools.js +0 -191
- package/dist/tools/asset-tools.js.map +0 -1
- package/dist/tools/calculator-tool.d.ts +0 -24
- package/dist/tools/calculator-tool.d.ts.map +0 -1
- package/dist/tools/calculator-tool.js +0 -64
- package/dist/tools/calculator-tool.js.map +0 -1
- package/dist/tools/claude-code-tools.d.ts +0 -96
- package/dist/tools/claude-code-tools.d.ts.map +0 -1
- package/dist/tools/claude-code-tools.js +0 -463
- package/dist/tools/claude-code-tools.js.map +0 -1
- package/dist/tools/code-tools.d.ts +0 -26
- package/dist/tools/code-tools.d.ts.map +0 -1
- package/dist/tools/code-tools.js +0 -82
- package/dist/tools/code-tools.js.map +0 -1
- package/dist/tools/create-plan-tool.d.ts +0 -29
- package/dist/tools/create-plan-tool.d.ts.map +0 -1
- package/dist/tools/create-plan-tool.js +0 -355
- package/dist/tools/create-plan-tool.js.map +0 -1
- package/dist/tools/create-task-tool.d.ts +0 -28
- package/dist/tools/create-task-tool.d.ts.map +0 -1
- package/dist/tools/create-task-tool.js +0 -254
- package/dist/tools/create-task-tool.js.map +0 -1
- package/dist/tools/email-tools.d.ts +0 -76
- package/dist/tools/email-tools.d.ts.map +0 -1
- package/dist/tools/email-tools.js +0 -259
- package/dist/tools/email-tools.js.map +0 -1
- package/dist/tools/filesystem-tools.d.ts +0 -77
- package/dist/tools/filesystem-tools.d.ts.map +0 -1
- package/dist/tools/filesystem-tools.js +0 -334
- package/dist/tools/filesystem-tools.js.map +0 -1
- package/dist/tools/find-model-tool.d.ts +0 -25
- package/dist/tools/find-model-tool.d.ts.map +0 -1
- package/dist/tools/find-model-tool.js +0 -236
- package/dist/tools/find-model-tool.js.map +0 -1
- package/dist/tools/finish-graph-tool.d.ts +0 -23
- package/dist/tools/finish-graph-tool.d.ts.map +0 -1
- package/dist/tools/finish-graph-tool.js +0 -46
- package/dist/tools/finish-graph-tool.js.map +0 -1
- package/dist/tools/js-code-tool.d.ts +0 -30
- package/dist/tools/js-code-tool.d.ts.map +0 -1
- package/dist/tools/js-code-tool.js +0 -98
- package/dist/tools/js-code-tool.js.map +0 -1
- package/dist/tools/local-get-node-info-tool.d.ts +0 -19
- package/dist/tools/local-get-node-info-tool.d.ts.map +0 -1
- package/dist/tools/local-get-node-info-tool.js +0 -75
- package/dist/tools/local-get-node-info-tool.js.map +0 -1
- package/dist/tools/local-list-nodes-tool.d.ts +0 -19
- package/dist/tools/local-list-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-list-nodes-tool.js +0 -69
- package/dist/tools/local-list-nodes-tool.js.map +0 -1
- package/dist/tools/local-search-nodes-tool.d.ts +0 -21
- package/dist/tools/local-search-nodes-tool.d.ts.map +0 -1
- package/dist/tools/local-search-nodes-tool.js +0 -111
- package/dist/tools/local-search-nodes-tool.js.map +0 -1
- package/dist/tools/math-tools.d.ts +0 -156
- package/dist/tools/math-tools.d.ts.map +0 -1
- package/dist/tools/math-tools.js +0 -422
- package/dist/tools/math-tools.js.map +0 -1
- package/dist/tools/model-tools.d.ts +0 -25
- package/dist/tools/model-tools.d.ts.map +0 -1
- package/dist/tools/model-tools.js +0 -48
- package/dist/tools/model-tools.js.map +0 -1
- package/dist/tools/pdf-tools.d.ts +0 -152
- package/dist/tools/pdf-tools.d.ts.map +0 -1
- package/dist/tools/pdf-tools.js +0 -339
- package/dist/tools/pdf-tools.js.map +0 -1
- package/dist/tools/tool-registry.d.ts +0 -9
- package/dist/tools/tool-registry.d.ts.map +0 -1
- package/dist/tools/tool-registry.js +0 -17
- package/dist/tools/tool-registry.js.map +0 -1
- package/dist/tools/workspace-tools.d.ts +0 -58
- package/dist/tools/workspace-tools.d.ts.map +0 -1
- package/dist/tools/workspace-tools.js +0 -152
- package/dist/tools/workspace-tools.js.map +0 -1
|
@@ -0,0 +1,1298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless bridge for the Sketch / image editor tool-loop eval.
|
|
3
|
+
*
|
|
4
|
+
* The real frontend tools (`web/src/lib/tools/builtin/sketch.ts`) delegate to
|
|
5
|
+
* a `SketchAgentHandler` the live `SketchEditor` registers on the
|
|
6
|
+
* `sketchAgentBridge` under its document id — it mutates a layered raster
|
|
7
|
+
* document backed by real canvases and (for generation) dispatches actual
|
|
8
|
+
* image-generation jobs. This bridge reimplements the *effects* of those tools
|
|
9
|
+
* against an in-memory layer stack, so a model can drive the same
|
|
10
|
+
* `ui_sketch_*` tool surface headlessly.
|
|
11
|
+
*
|
|
12
|
+
* The pixels are real. Every raster layer is backed by an `@napi-rs/canvas`
|
|
13
|
+
* bitmap, and `ui_sketch_stroke` runs the editor's own brush/pencil/eraser
|
|
14
|
+
* engine — `@nodetool-ai/image-editor/painting.js`, the same module the browser
|
|
15
|
+
* calls — through `setPaintSurfaceFactory(createCanvas)`. So a headless run
|
|
16
|
+
* paints the strokes a live editor would, and `ui_sketch_get_layer_image`
|
|
17
|
+
* hands the model a PNG of its own work.
|
|
18
|
+
*
|
|
19
|
+
* What it does NOT fork is the tool *contract*: names and descriptions are
|
|
20
|
+
* copied verbatim from the builtin file, and parameters mirror its Zod
|
|
21
|
+
* shapes — minus the `sketch_id` param, since this bridge addresses a single
|
|
22
|
+
* implicit document rather than a registry of open editors.
|
|
23
|
+
*
|
|
24
|
+
* `ui_sketch_place_image` records the locator it is given without fetching the
|
|
25
|
+
* bytes — there is no asset store here — so it moves the layer's reference,
|
|
26
|
+
* not its pixels. `ui_sketch_render_to_asset` stays excluded: it needs an
|
|
27
|
+
* asset-upload service,
|
|
28
|
+
* which has no meaningful headless equivalent. To look at what a run drew, take
|
|
29
|
+
* the composite PNG off the bridge instead ({@link SketchToolBridge.compositePng},
|
|
30
|
+
* or {@link getLastSketchToolBridge} when the eval runner owns the instance).
|
|
31
|
+
*/
|
|
32
|
+
import { createCanvas } from "@napi-rs/canvas";
|
|
33
|
+
import { DEFAULT_BRUSH_SETTINGS, DEFAULT_ERASER_SETTINGS, DEFAULT_PENCIL_SETTINGS, drawBrushStroke, drawEraserStroke, drawPencilStroke, setPaintSurfaceFactory } from "@nodetool-ai/image-editor/painting.js";
|
|
34
|
+
import { adjustOnContext, combineSelections, cropLayerInPlace, drawGradient, drawShape, ellipseSelection, featherSelection, fillOnContext, hasSelectionPixels, pickPixel, polygonSelection, rectSelection, readFullImage, requireRasterContext, transformRaster } from "@nodetool-ai/image-editor/raster.js";
|
|
35
|
+
import { z } from "zod";
|
|
36
|
+
import { parseWithTypeCoercion } from "@nodetool-ai/runtime";
|
|
37
|
+
import { IMAGE_USE_CASES, findImageUseCase } from "@nodetool-ai/protocol/api-schemas/sketch.js";
|
|
38
|
+
import { isString } from "../../utils/type-guards.js";
|
|
39
|
+
/**
|
|
40
|
+
* Point the paint core at skia. Idempotent and process-wide: the engine only
|
|
41
|
+
* uses it to allocate its brush-stamp scratch bitmaps, so every bridge in this
|
|
42
|
+
* process shares one factory.
|
|
43
|
+
*/
|
|
44
|
+
setPaintSurfaceFactory((w, h) =>
|
|
45
|
+
// SAFETY: the engine only draws brush stamps on the surface, and a skia
|
|
46
|
+
// canvas provides every member `PaintSurface` names for that.
|
|
47
|
+
createCanvas(w, h));
|
|
48
|
+
/** The blend modes NodeTool's compositor ships, in menu order. */
|
|
49
|
+
export const SKETCH_BLEND_MODES = [
|
|
50
|
+
"normal",
|
|
51
|
+
"multiply",
|
|
52
|
+
"screen",
|
|
53
|
+
"overlay",
|
|
54
|
+
"darken",
|
|
55
|
+
"lighten",
|
|
56
|
+
"color-dodge",
|
|
57
|
+
"color-burn",
|
|
58
|
+
"hard-light",
|
|
59
|
+
"soft-light",
|
|
60
|
+
"difference",
|
|
61
|
+
"exclusion",
|
|
62
|
+
"add"
|
|
63
|
+
];
|
|
64
|
+
const BLEND_MODES = SKETCH_BLEND_MODES;
|
|
65
|
+
/**
|
|
66
|
+
* NodeTool's blend-mode names onto Canvas2D `globalCompositeOperation`. All but
|
|
67
|
+
* two are spelled the same; `"normal"` is Canvas's default `"source-over"` and
|
|
68
|
+
* `"add"` is its additive `"lighter"`.
|
|
69
|
+
*/
|
|
70
|
+
const CANVAS_COMPOSITE_OP = {
|
|
71
|
+
normal: "source-over",
|
|
72
|
+
multiply: "multiply",
|
|
73
|
+
screen: "screen",
|
|
74
|
+
overlay: "overlay",
|
|
75
|
+
darken: "darken",
|
|
76
|
+
lighten: "lighten",
|
|
77
|
+
"color-dodge": "color-dodge",
|
|
78
|
+
"color-burn": "color-burn",
|
|
79
|
+
"hard-light": "hard-light",
|
|
80
|
+
"soft-light": "soft-light",
|
|
81
|
+
difference: "difference",
|
|
82
|
+
exclusion: "exclusion",
|
|
83
|
+
add: "lighter"
|
|
84
|
+
};
|
|
85
|
+
const TOOLS = [
|
|
86
|
+
"move",
|
|
87
|
+
"transform",
|
|
88
|
+
"select",
|
|
89
|
+
"brush",
|
|
90
|
+
"pencil",
|
|
91
|
+
"eraser",
|
|
92
|
+
"eyedropper",
|
|
93
|
+
"fill",
|
|
94
|
+
"shape",
|
|
95
|
+
"blur",
|
|
96
|
+
"gradient",
|
|
97
|
+
"crop",
|
|
98
|
+
"clone_stamp",
|
|
99
|
+
"adjust",
|
|
100
|
+
"segment"
|
|
101
|
+
];
|
|
102
|
+
const targetParam = z
|
|
103
|
+
.string()
|
|
104
|
+
.describe('Layer id, layer name (case-insensitive), or the literal "active" for the active layer.');
|
|
105
|
+
const blendModeEnum = z.enum(BLEND_MODES);
|
|
106
|
+
const toolEnum = z.enum(TOOLS);
|
|
107
|
+
const strokePointSchema = z.object({
|
|
108
|
+
x: z.number(),
|
|
109
|
+
y: z.number(),
|
|
110
|
+
pressure: z
|
|
111
|
+
.number()
|
|
112
|
+
.min(0)
|
|
113
|
+
.max(1)
|
|
114
|
+
.optional()
|
|
115
|
+
.describe("Pen pressure in [0,1]; omit for an even, mouse-like stroke.")
|
|
116
|
+
});
|
|
117
|
+
const strokeSchema = z.object({
|
|
118
|
+
target: targetParam
|
|
119
|
+
.optional()
|
|
120
|
+
.describe("Layer to paint on; defaults to the active layer."),
|
|
121
|
+
tool: z
|
|
122
|
+
.enum(["brush", "pencil", "eraser"])
|
|
123
|
+
.optional()
|
|
124
|
+
.describe("Paint engine (default `brush`). `pencil` is aliased hard-edged, `eraser` removes pixels."),
|
|
125
|
+
points: z
|
|
126
|
+
.array(strokePointSchema)
|
|
127
|
+
.min(1)
|
|
128
|
+
.describe("Polyline the stroke follows, in canvas pixels (x right, y down, origin top-left). Dabs are interpolated along each segment, so a smooth curve just needs enough points — roughly one every few pixels of arc."),
|
|
129
|
+
color: z
|
|
130
|
+
.string()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe("Hex color; defaults to the foreground. Ignored by the eraser."),
|
|
133
|
+
size: z.number().min(0.1).optional().describe("Brush diameter in pixels."),
|
|
134
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
135
|
+
hardness: z
|
|
136
|
+
.number()
|
|
137
|
+
.min(0)
|
|
138
|
+
.max(1)
|
|
139
|
+
.optional()
|
|
140
|
+
.describe("Edge hardness — 1 is crisp, 0 is a soft airbrushed falloff."),
|
|
141
|
+
closed: z
|
|
142
|
+
.boolean()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("Connect the last point back to the first, closing the shape.")
|
|
145
|
+
});
|
|
146
|
+
/**
|
|
147
|
+
* Normalize what a caller named as an image into the locator form the editor
|
|
148
|
+
* stores. A bare id becomes `asset://<id>`; a scheme the canvas cannot load is
|
|
149
|
+
* refused here the way the live bridge refuses it.
|
|
150
|
+
*/
|
|
151
|
+
function normalizePlacedImage(value) {
|
|
152
|
+
const image = isString(value) ? value.trim() : "";
|
|
153
|
+
if (!image) {
|
|
154
|
+
throw new Error("place_image needs an `image`: an asset id, an asset:// locator, a data: URL, or an http(s) URL.");
|
|
155
|
+
}
|
|
156
|
+
if (/^(asset:\/\/|data:|https?:\/\/)/.test(image))
|
|
157
|
+
return image;
|
|
158
|
+
if (image.includes("://")) {
|
|
159
|
+
throw new Error(`image "${image}" uses a scheme the sketch canvas cannot load. Use an asset id, asset://, data:, or http(s)://.`);
|
|
160
|
+
}
|
|
161
|
+
return `asset://${image}`;
|
|
162
|
+
}
|
|
163
|
+
function tool(name, description, parameters, impl) {
|
|
164
|
+
return {
|
|
165
|
+
name,
|
|
166
|
+
description,
|
|
167
|
+
parameters,
|
|
168
|
+
execute: (args) => {
|
|
169
|
+
const parsed = parseWithTypeCoercion(parameters, args ?? {});
|
|
170
|
+
return impl(parsed);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/** The 2D context of a skia canvas, seen as the paint core's context. */
|
|
175
|
+
const paintContext = (canvas) => {
|
|
176
|
+
const ctx = canvas.getContext("2d");
|
|
177
|
+
if (!ctx)
|
|
178
|
+
throw new Error("Could not acquire a 2D context.");
|
|
179
|
+
return ctx;
|
|
180
|
+
};
|
|
181
|
+
/** Count pixels with a non-zero alpha — "how much of this bitmap is painted". */
|
|
182
|
+
function countPaintedPixels(canvas) {
|
|
183
|
+
if (!canvas)
|
|
184
|
+
return 0;
|
|
185
|
+
const { data } = paintContext(canvas).getImageData(0, 0, canvas.width, canvas.height);
|
|
186
|
+
let painted = 0;
|
|
187
|
+
for (let i = 3; i < data.length; i += 4) {
|
|
188
|
+
if (data[i] !== 0)
|
|
189
|
+
painted += 1;
|
|
190
|
+
}
|
|
191
|
+
return painted;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Run one polyline through a paint engine into a fresh doc-sized stroke buffer.
|
|
195
|
+
*
|
|
196
|
+
* This is the editor's own compositing model: dabs land at full alpha in a
|
|
197
|
+
* buffer, and the buffer goes onto the layer once — `source-over` at the
|
|
198
|
+
* stroke's opacity for brush/pencil, `destination-out` for the eraser, which is
|
|
199
|
+
* what makes a semi-transparent stroke a single even wash instead of a chain of
|
|
200
|
+
* overlapping dabs.
|
|
201
|
+
*/
|
|
202
|
+
function renderStroke(options) {
|
|
203
|
+
const { width, height, tool, color, size, hardness, closed } = options;
|
|
204
|
+
const buffer = createCanvas(width, height);
|
|
205
|
+
const ctx = paintContext(buffer);
|
|
206
|
+
const dirty = { current: null };
|
|
207
|
+
const stampCache = new Map();
|
|
208
|
+
const stampState = {
|
|
209
|
+
hasStamped: false,
|
|
210
|
+
distanceToNextDab: 0
|
|
211
|
+
};
|
|
212
|
+
const points = [...options.points];
|
|
213
|
+
if (closed && points.length > 2) {
|
|
214
|
+
points.push(points[0]);
|
|
215
|
+
}
|
|
216
|
+
// The engine is opacity-agnostic here: the buffer carries the stroke at full
|
|
217
|
+
// strength and the caller applies opacity when it composites.
|
|
218
|
+
const brush = {
|
|
219
|
+
...DEFAULT_BRUSH_SETTINGS,
|
|
220
|
+
color,
|
|
221
|
+
size,
|
|
222
|
+
hardness,
|
|
223
|
+
opacity: 1
|
|
224
|
+
};
|
|
225
|
+
const pencil = { ...DEFAULT_PENCIL_SETTINGS, color, size, opacity: 1 };
|
|
226
|
+
const eraser = { ...DEFAULT_ERASER_SETTINGS, size, opacity: 1 };
|
|
227
|
+
const segment = (from, to) => {
|
|
228
|
+
const pressure = to.pressure ?? from.pressure;
|
|
229
|
+
switch (tool) {
|
|
230
|
+
case "brush":
|
|
231
|
+
drawBrushStroke(from, to, brush, ctx, pressure, dirty, stampCache, stampState);
|
|
232
|
+
return;
|
|
233
|
+
case "pencil":
|
|
234
|
+
drawPencilStroke(from, to, pencil, ctx, pressure, dirty, stampState);
|
|
235
|
+
return;
|
|
236
|
+
case "eraser":
|
|
237
|
+
drawEraserStroke(from, to, eraser, brush, pencil, ctx, pressure, dirty, stampCache, stampState);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
if (points.length === 1) {
|
|
241
|
+
// A one-point stroke is a single dab, not a no-op.
|
|
242
|
+
segment(points[0], points[0]);
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
for (let i = 1; i < points.length; i += 1) {
|
|
246
|
+
segment(points[i - 1], points[i]);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
return { buffer, dirty };
|
|
250
|
+
}
|
|
251
|
+
let lastCreatedBridge = null;
|
|
252
|
+
/**
|
|
253
|
+
* The most recently created sketch bridge, or null before the first one.
|
|
254
|
+
*
|
|
255
|
+
* `ToolLoopEvalCase.createBridge` builds the bridge inside the runner, so a
|
|
256
|
+
* caller that wants the drawing afterwards has no handle on it. Cases run
|
|
257
|
+
* sequentially, so after a single-case run this is that run's bridge — enough
|
|
258
|
+
* to write the composite PNG somewhere a human can look at it.
|
|
259
|
+
*/
|
|
260
|
+
export function getLastSketchToolBridge() {
|
|
261
|
+
return lastCreatedBridge;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Build an in-memory sketch/image-editor bridge whose tools share the
|
|
265
|
+
* `ui_sketch_*` contract but run headlessly, against a layer stack of real
|
|
266
|
+
* skia bitmaps driven by the editor's own paint engine.
|
|
267
|
+
*/
|
|
268
|
+
export function createSketchToolBridge(initial = {}) {
|
|
269
|
+
const name = initial.name ?? "Untitled";
|
|
270
|
+
let width = initial.width ?? 1024;
|
|
271
|
+
let height = initial.height ?? 1024;
|
|
272
|
+
let foregroundColor = "#000000";
|
|
273
|
+
let backgroundColor = "#ffffff";
|
|
274
|
+
let activeTool = "brush";
|
|
275
|
+
let selection = null;
|
|
276
|
+
let setup;
|
|
277
|
+
let layerSeq = 0;
|
|
278
|
+
const nextLayerId = () => `layer_${++layerSeq}`;
|
|
279
|
+
const makeLayer = (id, layerName, type) => ({
|
|
280
|
+
id,
|
|
281
|
+
name: layerName,
|
|
282
|
+
type,
|
|
283
|
+
visible: true,
|
|
284
|
+
opacity: 1,
|
|
285
|
+
blendMode: "normal",
|
|
286
|
+
locked: false,
|
|
287
|
+
alphaLock: false,
|
|
288
|
+
parentId: null,
|
|
289
|
+
hasBinding: false,
|
|
290
|
+
strokeCount: 0,
|
|
291
|
+
raster: null
|
|
292
|
+
});
|
|
293
|
+
const layers = [];
|
|
294
|
+
let activeLayerId = null;
|
|
295
|
+
if (initial.layers && initial.layers.length > 0) {
|
|
296
|
+
for (const l of initial.layers) {
|
|
297
|
+
const id = nextLayerId();
|
|
298
|
+
layers.push(makeLayer(id, l.name, l.type ?? "raster"));
|
|
299
|
+
}
|
|
300
|
+
activeLayerId = layers[layers.length - 1].id;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
const id = nextLayerId();
|
|
304
|
+
layers.push(makeLayer(id, "Background", "raster"));
|
|
305
|
+
activeLayerId = id;
|
|
306
|
+
}
|
|
307
|
+
const indexOf = (id) => layers.findIndex((l) => l.id === id);
|
|
308
|
+
const resolveTarget = (target) => {
|
|
309
|
+
if (target === "active") {
|
|
310
|
+
if (!activeLayerId)
|
|
311
|
+
throw new Error("No active layer.");
|
|
312
|
+
const l = layers.find((x) => x.id === activeLayerId);
|
|
313
|
+
if (!l)
|
|
314
|
+
throw new Error("No active layer.");
|
|
315
|
+
return l;
|
|
316
|
+
}
|
|
317
|
+
const byId = layers.find((l) => l.id === target);
|
|
318
|
+
if (byId)
|
|
319
|
+
return byId;
|
|
320
|
+
const lower = target.toLowerCase();
|
|
321
|
+
const byName = layers.find((l) => l.name.toLowerCase() === lower);
|
|
322
|
+
if (byName)
|
|
323
|
+
return byName;
|
|
324
|
+
throw new Error(`No layer found matching "${target}".`);
|
|
325
|
+
};
|
|
326
|
+
const serialize = (l) => {
|
|
327
|
+
const { raster: _raster, ...view } = l;
|
|
328
|
+
return view;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Materialize this layer's bitmap at the current canvas size, applying its
|
|
332
|
+
* `fillColor` the first time. A layer that was resized while empty is
|
|
333
|
+
* reallocated rather than kept at the old size.
|
|
334
|
+
*/
|
|
335
|
+
const ensureRaster = (layer) => {
|
|
336
|
+
const existing = layer.raster;
|
|
337
|
+
if (existing && existing.width === width && existing.height === height) {
|
|
338
|
+
return existing;
|
|
339
|
+
}
|
|
340
|
+
const next = createCanvas(width, height);
|
|
341
|
+
const ctx = paintContext(next);
|
|
342
|
+
if (existing) {
|
|
343
|
+
// Resize keeps pixels; anything past the new bounds is clipped.
|
|
344
|
+
ctx.drawImage(existing, 0, 0);
|
|
345
|
+
}
|
|
346
|
+
else if (layer.fillColor) {
|
|
347
|
+
ctx.fillStyle = layer.fillColor;
|
|
348
|
+
ctx.fillRect(0, 0, width, height);
|
|
349
|
+
}
|
|
350
|
+
layer.raster = next;
|
|
351
|
+
return next;
|
|
352
|
+
};
|
|
353
|
+
/** Composite the given layers bottom-to-top honoring visibility, opacity and blend. */
|
|
354
|
+
const compositeOf = (source) => {
|
|
355
|
+
const out = createCanvas(width, height);
|
|
356
|
+
const ctx = paintContext(out);
|
|
357
|
+
for (const layer of source) {
|
|
358
|
+
if (!layer.visible || layer.opacity <= 0 || !layer.raster)
|
|
359
|
+
continue;
|
|
360
|
+
ctx.save();
|
|
361
|
+
ctx.globalAlpha = layer.opacity;
|
|
362
|
+
ctx.globalCompositeOperation = CANVAS_COMPOSITE_OP[layer.blendMode];
|
|
363
|
+
ctx.drawImage(ensureRaster(layer), 0, 0);
|
|
364
|
+
ctx.restore();
|
|
365
|
+
}
|
|
366
|
+
return out;
|
|
367
|
+
};
|
|
368
|
+
const composite = () => compositeOf(layers);
|
|
369
|
+
const tools = [
|
|
370
|
+
tool("ui_sketch_get_state", "Read the specified image document: name, canvas size, the active layer, foreground/background color, the active tool, whether a pixel selection is active, and every layer (id, name, type, visibility, opacity, blend mode, lock state, and any generation binding prompt/provider/model/status). Call this first to discover what's on the canvas and to get the ids/names other image-editor tools need.", z.object({}), async () => {
|
|
371
|
+
return {
|
|
372
|
+
ok: true,
|
|
373
|
+
documentId: null,
|
|
374
|
+
name,
|
|
375
|
+
width,
|
|
376
|
+
height,
|
|
377
|
+
activeLayerId,
|
|
378
|
+
foregroundColor,
|
|
379
|
+
backgroundColor,
|
|
380
|
+
activeTool,
|
|
381
|
+
hasSelection: hasSelectionPixels(selection),
|
|
382
|
+
layers: layers.map((l, i) => ({ ...serialize(l), index: i }))
|
|
383
|
+
};
|
|
384
|
+
}),
|
|
385
|
+
tool("ui_sketch_add_layer", "Add a new layer above the active one. `type` is raster (default) or mask. Optionally give it a `name` and a `fillColor` (hex) to fill it with a solid color.", z.object({
|
|
386
|
+
name: z.string().optional(),
|
|
387
|
+
type: z.enum(["raster", "mask"]).optional(),
|
|
388
|
+
fillColor: z
|
|
389
|
+
.string()
|
|
390
|
+
.optional()
|
|
391
|
+
.describe("Hex color to fill the new layer with, e.g. #ff0000.")
|
|
392
|
+
}), async ({ name: layerName, type, fillColor }) => {
|
|
393
|
+
const id = nextLayerId();
|
|
394
|
+
const idx = activeLayerId ? indexOf(activeLayerId) + 1 : layers.length;
|
|
395
|
+
const layer = makeLayer(id, layerName ?? `Layer ${layerSeq}`, type ?? "raster");
|
|
396
|
+
if (isString(fillColor) && fillColor) {
|
|
397
|
+
layer.fillColor = fillColor;
|
|
398
|
+
// A fill is pixels, not a label — lay them down now.
|
|
399
|
+
ensureRaster(layer);
|
|
400
|
+
}
|
|
401
|
+
layers.splice(idx, 0, layer);
|
|
402
|
+
activeLayerId = id;
|
|
403
|
+
return { ok: true, layer: serialize(layer) };
|
|
404
|
+
}),
|
|
405
|
+
tool("ui_sketch_remove_layer", "Delete a layer from the specified image document.", z.object({ target: targetParam }), async ({ target }) => {
|
|
406
|
+
const layer = resolveTarget(target);
|
|
407
|
+
const idx = indexOf(layer.id);
|
|
408
|
+
layers.splice(idx, 1);
|
|
409
|
+
if (activeLayerId === layer.id) {
|
|
410
|
+
const neighbor = layers[idx] ?? layers[idx - 1] ?? null;
|
|
411
|
+
activeLayerId = neighbor ? neighbor.id : null;
|
|
412
|
+
}
|
|
413
|
+
return { ok: true, deleted: serialize(layer) };
|
|
414
|
+
}),
|
|
415
|
+
tool("ui_sketch_duplicate_layer", "Duplicate a layer. The copy is inserted directly above the source.", z.object({ target: targetParam }), async ({ target }) => {
|
|
416
|
+
const source = resolveTarget(target);
|
|
417
|
+
const id = nextLayerId();
|
|
418
|
+
const copy = {
|
|
419
|
+
...source,
|
|
420
|
+
id,
|
|
421
|
+
name: `${source.name} copy`,
|
|
422
|
+
raster: null
|
|
423
|
+
};
|
|
424
|
+
if (source.raster) {
|
|
425
|
+
// Own bitmap, not a shared reference — painting the copy must not
|
|
426
|
+
// paint the original.
|
|
427
|
+
const dup = createCanvas(source.raster.width, source.raster.height);
|
|
428
|
+
paintContext(dup).drawImage(source.raster, 0, 0);
|
|
429
|
+
copy.raster = dup;
|
|
430
|
+
}
|
|
431
|
+
layers.splice(indexOf(source.id) + 1, 0, copy);
|
|
432
|
+
activeLayerId = id;
|
|
433
|
+
return { ok: true, layer: serialize(copy) };
|
|
434
|
+
}),
|
|
435
|
+
tool("ui_sketch_select_layer", "Make a layer the active layer (subsequent edits target it).", z.object({ target: targetParam }), async ({ target }) => {
|
|
436
|
+
const layer = resolveTarget(target);
|
|
437
|
+
activeLayerId = layer.id;
|
|
438
|
+
return { ok: true, active: serialize(layer) };
|
|
439
|
+
}),
|
|
440
|
+
tool("ui_sketch_set_layer_props", "Change a layer's properties: `name`, `visible`, `opacity` (0..1), `blendMode`, `locked`, or `alphaLock` (lock transparency). Omit a field to leave it unchanged.", z.object({
|
|
441
|
+
target: targetParam,
|
|
442
|
+
name: z.string().optional(),
|
|
443
|
+
visible: z.boolean().optional(),
|
|
444
|
+
opacity: z.number().min(0).max(1).optional(),
|
|
445
|
+
blendMode: blendModeEnum.optional(),
|
|
446
|
+
locked: z.boolean().optional(),
|
|
447
|
+
alphaLock: z.boolean().optional()
|
|
448
|
+
}), async ({ target, ...patch }) => {
|
|
449
|
+
const layer = resolveTarget(target);
|
|
450
|
+
if (patch.name !== undefined)
|
|
451
|
+
layer.name = patch.name;
|
|
452
|
+
if (patch.visible !== undefined)
|
|
453
|
+
layer.visible = patch.visible;
|
|
454
|
+
if (patch.opacity !== undefined)
|
|
455
|
+
layer.opacity = patch.opacity;
|
|
456
|
+
if (patch.blendMode !== undefined)
|
|
457
|
+
layer.blendMode = patch.blendMode;
|
|
458
|
+
if (patch.locked !== undefined)
|
|
459
|
+
layer.locked = patch.locked;
|
|
460
|
+
if (patch.alphaLock !== undefined)
|
|
461
|
+
layer.alphaLock = patch.alphaLock;
|
|
462
|
+
return { ok: true, layer: serialize(layer) };
|
|
463
|
+
}),
|
|
464
|
+
tool("ui_sketch_reorder_layer", "Move a layer up or down in the stack. `up` moves it toward the top (composited above its neighbors); `down` moves it toward the bottom.", z.object({
|
|
465
|
+
target: targetParam,
|
|
466
|
+
direction: z.enum(["up", "down"])
|
|
467
|
+
}), async ({ target, direction }) => {
|
|
468
|
+
const layer = resolveTarget(target);
|
|
469
|
+
const idx = indexOf(layer.id);
|
|
470
|
+
const swapWith = direction === "up" ? idx + 1 : idx - 1;
|
|
471
|
+
if (swapWith >= 0 && swapWith < layers.length) {
|
|
472
|
+
layers[idx] = layers[swapWith];
|
|
473
|
+
layers[swapWith] = layer;
|
|
474
|
+
}
|
|
475
|
+
return { ok: true, layer: serialize(layer) };
|
|
476
|
+
}),
|
|
477
|
+
tool("ui_sketch_merge_down", "Merge a layer into the layer directly below it, replacing the two with a single flattened raster layer.", z.object({ target: targetParam }), async ({ target }) => {
|
|
478
|
+
const layer = resolveTarget(target);
|
|
479
|
+
const idx = indexOf(layer.id);
|
|
480
|
+
if (idx <= 0) {
|
|
481
|
+
return { ok: true, layer: null };
|
|
482
|
+
}
|
|
483
|
+
const below = layers[idx - 1];
|
|
484
|
+
const merged = makeLayer(nextLayerId(), below.name, "raster");
|
|
485
|
+
merged.raster = compositeOf([below, layer]);
|
|
486
|
+
layers.splice(idx - 1, 2, merged);
|
|
487
|
+
activeLayerId = merged.id;
|
|
488
|
+
return { ok: true, layer: serialize(merged) };
|
|
489
|
+
}),
|
|
490
|
+
tool("ui_sketch_flatten_visible", "Flatten all visible layers into a single raster layer. Returns the resulting layer.", z.object({}), async () => {
|
|
491
|
+
const visibleIndices = layers
|
|
492
|
+
.map((l, i) => (l.visible ? i : -1))
|
|
493
|
+
.filter((i) => i >= 0);
|
|
494
|
+
const insertAt = visibleIndices.length > 0 ? visibleIndices[0] : layers.length;
|
|
495
|
+
const removeCount = visibleIndices.length;
|
|
496
|
+
const flattened = makeLayer(nextLayerId(), "Flattened", "raster");
|
|
497
|
+
flattened.raster = compositeOf(visibleIndices.map((i) => layers[i]));
|
|
498
|
+
if (removeCount > 0) {
|
|
499
|
+
for (let i = layers.length - 1; i >= 0; i -= 1) {
|
|
500
|
+
if (visibleIndices.includes(i))
|
|
501
|
+
layers.splice(i, 1);
|
|
502
|
+
}
|
|
503
|
+
layers.splice(insertAt, 0, flattened);
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
layers.push(flattened);
|
|
507
|
+
}
|
|
508
|
+
activeLayerId = flattened.id;
|
|
509
|
+
return { ok: true, layer: serialize(flattened) };
|
|
510
|
+
}),
|
|
511
|
+
tool("ui_sketch_generate", 'Generate imagery onto a new layer. `kind` is text-to-image (from a prompt) or image-to-image (transform an existing layer — pass `sourceLayer`). Provide `provider` and `model` (discover valid ones with the model-search tool); when omitted the last-used image model is reused. Optional `width`/`height` (default the canvas size), `aspectRatio` (e.g. "16:9"), and `resolution` (e.g. "1K") shape the output for models that use size enums. Generation starts immediately unless `autoGenerate` is false. Poll ui_sketch_get_state for the layer\'s binding status.', z.object({
|
|
512
|
+
kind: z.enum(["text-to-image", "image-to-image"]),
|
|
513
|
+
prompt: z.string(),
|
|
514
|
+
name: z.string().optional(),
|
|
515
|
+
sourceLayer: targetParam
|
|
516
|
+
.optional()
|
|
517
|
+
.describe("For image-to-image: the layer to transform."),
|
|
518
|
+
provider: z.string().optional(),
|
|
519
|
+
model: z.string().optional(),
|
|
520
|
+
width: z.number().optional(),
|
|
521
|
+
height: z.number().optional(),
|
|
522
|
+
aspectRatio: z.string().optional(),
|
|
523
|
+
resolution: z.string().optional(),
|
|
524
|
+
seed: z
|
|
525
|
+
.number()
|
|
526
|
+
.int()
|
|
527
|
+
.optional()
|
|
528
|
+
.describe("Sampling seed. Call once per variation with the same prompt, size and model and a different seed to get a set to choose from."),
|
|
529
|
+
autoGenerate: z.boolean().optional()
|
|
530
|
+
}), async (args) => {
|
|
531
|
+
const kind = args.kind;
|
|
532
|
+
const prompt = args.prompt;
|
|
533
|
+
if (kind === "image-to-image" && args.sourceLayer !== undefined) {
|
|
534
|
+
// Throws when unresolved.
|
|
535
|
+
resolveTarget(args.sourceLayer);
|
|
536
|
+
}
|
|
537
|
+
const id = nextLayerId();
|
|
538
|
+
const idx = activeLayerId ? indexOf(activeLayerId) + 1 : layers.length;
|
|
539
|
+
const generationStarted = args.autoGenerate !== false;
|
|
540
|
+
const layer = {
|
|
541
|
+
...makeLayer(id, args.name ?? `Generated ${layerSeq}`, "raster"),
|
|
542
|
+
hasBinding: true,
|
|
543
|
+
bindingKind: kind,
|
|
544
|
+
prompt,
|
|
545
|
+
provider: args.provider,
|
|
546
|
+
model: args.model,
|
|
547
|
+
seed: args.seed,
|
|
548
|
+
bindingStatus: generationStarted ? "generating" : "idle"
|
|
549
|
+
};
|
|
550
|
+
layers.splice(idx, 0, layer);
|
|
551
|
+
activeLayerId = id;
|
|
552
|
+
const result = {
|
|
553
|
+
ok: true,
|
|
554
|
+
layer: serialize(layer),
|
|
555
|
+
generationStarted
|
|
556
|
+
};
|
|
557
|
+
if (!generationStarted) {
|
|
558
|
+
result.note = "Generation not started (autoGenerate=false).";
|
|
559
|
+
}
|
|
560
|
+
return result;
|
|
561
|
+
}),
|
|
562
|
+
tool("ui_sketch_set_setup", "Write the guided image flow's state onto the image document: the `brief` (what the picture should be), the `use_case` (product, portrait, key-art, social, logo, concept, texture), how many `variations` to render, and the `stage` the flow resumes at. Nothing is rendered here — this is the step-by-step state the Image flow reads, and a document whose stage is `done` opens straight in the editor. Omit a field to leave it unchanged.", z.object({
|
|
563
|
+
brief: z.string().optional(),
|
|
564
|
+
use_case: z
|
|
565
|
+
.string()
|
|
566
|
+
.optional()
|
|
567
|
+
.describe("One of: product, portrait, key-art, social, logo, concept, texture."),
|
|
568
|
+
variations: z.number().int().min(1).max(8).optional(),
|
|
569
|
+
stage: z
|
|
570
|
+
.enum(["idea", "useCase", "review", "look", "done"])
|
|
571
|
+
.optional()
|
|
572
|
+
.describe("Where the flow resumes: idea, useCase, review, look, or done (the editor).")
|
|
573
|
+
}), async (args) => {
|
|
574
|
+
const useCase = args.use_case;
|
|
575
|
+
if (useCase !== undefined && !findImageUseCase(useCase)) {
|
|
576
|
+
throw new Error(`use_case must be one of ${IMAGE_USE_CASES.map((entry) => entry.id).join(", ")}.`);
|
|
577
|
+
}
|
|
578
|
+
const next = { ...(setup ?? {}) };
|
|
579
|
+
if (args.brief !== undefined)
|
|
580
|
+
next.brief = args.brief;
|
|
581
|
+
if (useCase !== undefined) {
|
|
582
|
+
next.use_case = useCase;
|
|
583
|
+
const picked = findImageUseCase(useCase);
|
|
584
|
+
if (picked) {
|
|
585
|
+
next.variations ??= picked.defaultVariations;
|
|
586
|
+
width = picked.defaultSize.width;
|
|
587
|
+
height = picked.defaultSize.height;
|
|
588
|
+
// Re-cut the bitmaps, as ui_sketch_resize_canvas does, so the
|
|
589
|
+
// reported pixel counts describe the canvas the flow just chose.
|
|
590
|
+
for (const layer of layers) {
|
|
591
|
+
if (layer.raster)
|
|
592
|
+
ensureRaster(layer);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if (args.variations !== undefined) {
|
|
597
|
+
next.variations = args.variations;
|
|
598
|
+
}
|
|
599
|
+
if (args.stage !== undefined)
|
|
600
|
+
next.stage = args.stage;
|
|
601
|
+
setup = next;
|
|
602
|
+
return { ok: true, setup: next };
|
|
603
|
+
}),
|
|
604
|
+
tool("ui_sketch_place_image", "Put an existing image onto a layer — an asset from the library, or a URL. `image` is an asset id (find one with the asset tools), an asset:// locator, a data: URL, or an http(s) URL. Omit `target` to place it on a new layer, or name a layer to replace what it shows. The image is drawn at its own size from (`x`, `y`) unless `width`/`height` say otherwise. This is how a picture gets onto a canvas; ui_sketch_generate makes a new one from a prompt instead.", z.object({
|
|
605
|
+
image: z.string(),
|
|
606
|
+
target: targetParam.optional(),
|
|
607
|
+
name: z.string().optional(),
|
|
608
|
+
x: z.number().optional(),
|
|
609
|
+
y: z.number().optional(),
|
|
610
|
+
width: z.number().optional(),
|
|
611
|
+
height: z.number().optional()
|
|
612
|
+
}), async (args) => {
|
|
613
|
+
const image = normalizePlacedImage(args["image"]);
|
|
614
|
+
const layer = isString(args["target"]) && args["target"]
|
|
615
|
+
? resolveTarget(args["target"])
|
|
616
|
+
: (() => {
|
|
617
|
+
const id = nextLayerId();
|
|
618
|
+
const created = makeLayer(id, (isString(args["name"]) && args["name"]) || `Layer ${layerSeq}`, "raster");
|
|
619
|
+
const idx = activeLayerId
|
|
620
|
+
? indexOf(activeLayerId) + 1
|
|
621
|
+
: layers.length;
|
|
622
|
+
layers.splice(idx, 0, created);
|
|
623
|
+
activeLayerId = id;
|
|
624
|
+
return created;
|
|
625
|
+
})();
|
|
626
|
+
const num = (value, fallback) => typeof value === "number" && Number.isFinite(value)
|
|
627
|
+
? value
|
|
628
|
+
: fallback;
|
|
629
|
+
layer.imageRef = image;
|
|
630
|
+
layer.imageBounds = {
|
|
631
|
+
x: num(args["x"], 0),
|
|
632
|
+
y: num(args["y"], 0),
|
|
633
|
+
width: num(args["width"], width),
|
|
634
|
+
height: num(args["height"], height)
|
|
635
|
+
};
|
|
636
|
+
activeLayerId = layer.id;
|
|
637
|
+
return { ok: true, layer: serialize(layer) };
|
|
638
|
+
}),
|
|
639
|
+
tool("ui_sketch_set_color", "Set the specified image document's foreground and/or background color (hex). The foreground color is used by the brush, fill, and shape tools.", z.object({
|
|
640
|
+
foreground: z.string().optional(),
|
|
641
|
+
background: z.string().optional()
|
|
642
|
+
}), async ({ foreground, background }) => {
|
|
643
|
+
const result = {};
|
|
644
|
+
if (foreground !== undefined) {
|
|
645
|
+
foregroundColor = foreground;
|
|
646
|
+
result.foreground = foregroundColor;
|
|
647
|
+
}
|
|
648
|
+
if (background !== undefined) {
|
|
649
|
+
backgroundColor = background;
|
|
650
|
+
result.background = backgroundColor;
|
|
651
|
+
}
|
|
652
|
+
return { ok: true, ...result };
|
|
653
|
+
}),
|
|
654
|
+
tool("ui_sketch_set_tool", "Select the active tool in the specified image document (e.g. brush, eraser, fill, select, move, transform, crop). Drives which tool the editor's pointer uses.", z.object({ tool: toolEnum }), async ({ tool: nextTool }) => {
|
|
655
|
+
activeTool = nextTool;
|
|
656
|
+
return { ok: true, activeTool };
|
|
657
|
+
}),
|
|
658
|
+
tool("ui_sketch_stroke", "Paint one or more brush/pencil/eraser strokes onto raster layers — the actual drawing tool. Each stroke is a polyline of canvas-pixel points that the paint engine interpolates into a smooth line, with its own color, size, opacity and hardness. Pass several strokes in one call to draw a whole figure at once; the batch commits as a single undo step. Build curves by sampling points along them (a circle is ~24 points), and put separate parts of a drawing on separate layers so they can be edited independently. Call ui_sketch_get_layer_image afterwards to see what you drew.", z.object({ strokes: z.array(strokeSchema).min(1) }), async ({ strokes }) => {
|
|
659
|
+
const batch = strokes;
|
|
660
|
+
// Resolve and validate every target before painting anything, so a bad
|
|
661
|
+
// stroke in the batch leaves no half-drawn figure behind.
|
|
662
|
+
const resolved = batch.map((stroke) => {
|
|
663
|
+
const layer = resolveTarget(stroke.target ?? "active");
|
|
664
|
+
if (layer.locked) {
|
|
665
|
+
throw new Error(`Layer "${layer.name}" is locked — unlock it with ui_sketch_set_layer_props before painting.`);
|
|
666
|
+
}
|
|
667
|
+
if (layer.type !== "raster") {
|
|
668
|
+
throw new Error(`Layer "${layer.name}" is a ${layer.type} layer; strokes only paint on raster layers.`);
|
|
669
|
+
}
|
|
670
|
+
return { layer, stroke };
|
|
671
|
+
});
|
|
672
|
+
const results = resolved.map(({ layer, stroke }) => {
|
|
673
|
+
const strokeTool = stroke.tool ?? "brush";
|
|
674
|
+
const opacity = stroke.opacity ?? 1;
|
|
675
|
+
const { buffer, dirty } = renderStroke({
|
|
676
|
+
width,
|
|
677
|
+
height,
|
|
678
|
+
tool: strokeTool,
|
|
679
|
+
points: stroke.points,
|
|
680
|
+
color: stroke.color ?? foregroundColor,
|
|
681
|
+
size: stroke.size ?? DEFAULT_BRUSH_SETTINGS.size,
|
|
682
|
+
hardness: stroke.hardness ?? DEFAULT_BRUSH_SETTINGS.hardness,
|
|
683
|
+
closed: stroke.closed ?? false
|
|
684
|
+
});
|
|
685
|
+
const ctx = paintContext(ensureRaster(layer));
|
|
686
|
+
ctx.save();
|
|
687
|
+
ctx.globalAlpha = opacity;
|
|
688
|
+
ctx.globalCompositeOperation =
|
|
689
|
+
strokeTool === "eraser" ? "destination-out" : "source-over";
|
|
690
|
+
ctx.drawImage(buffer, 0, 0);
|
|
691
|
+
ctx.restore();
|
|
692
|
+
layer.strokeCount += 1;
|
|
693
|
+
const box = dirty.current;
|
|
694
|
+
const bounds = box
|
|
695
|
+
? (() => {
|
|
696
|
+
const x = Math.max(0, Math.min(width, box.minX));
|
|
697
|
+
const y = Math.max(0, Math.min(height, box.minY));
|
|
698
|
+
const right = Math.max(0, Math.min(width, box.maxX));
|
|
699
|
+
const bottom = Math.max(0, Math.min(height, box.maxY));
|
|
700
|
+
return right > x && bottom > y
|
|
701
|
+
? { x, y, width: right - x, height: bottom - y }
|
|
702
|
+
: null;
|
|
703
|
+
})()
|
|
704
|
+
: null;
|
|
705
|
+
return {
|
|
706
|
+
layerId: layer.id,
|
|
707
|
+
layerName: layer.name,
|
|
708
|
+
tool: strokeTool,
|
|
709
|
+
points: stroke.points.length,
|
|
710
|
+
bounds
|
|
711
|
+
};
|
|
712
|
+
});
|
|
713
|
+
return { ok: true, strokes: results };
|
|
714
|
+
}),
|
|
715
|
+
tool("ui_sketch_resize_canvas", "Resize the canvas (artboard) to `width` x `height` pixels. Existing layers keep their pixels; content outside the new bounds is clipped.", z.object({
|
|
716
|
+
width: z.number().min(1),
|
|
717
|
+
height: z.number().min(1)
|
|
718
|
+
}), async ({ width: w, height: h }) => {
|
|
719
|
+
width = Math.max(1, Math.round(w));
|
|
720
|
+
height = Math.max(1, Math.round(h));
|
|
721
|
+
// Re-cut every existing bitmap now rather than on next use, so the
|
|
722
|
+
// reported pixel counts always describe the current canvas.
|
|
723
|
+
for (const layer of layers) {
|
|
724
|
+
if (layer.raster)
|
|
725
|
+
ensureRaster(layer);
|
|
726
|
+
}
|
|
727
|
+
return { ok: true, width, height };
|
|
728
|
+
}),
|
|
729
|
+
tool("ui_sketch_selection", "Shape the pixel selection: `all` selects the whole canvas, `invert` inverts the current selection, `clear` deselects. Inpainting and selection-scoped edits act within this selection.", z.object({ op: z.enum(["all", "clear", "invert"]) }), async ({ op }) => {
|
|
730
|
+
if (op === "all") {
|
|
731
|
+
selection = rectSelection(width, height, 0, 0, width, height);
|
|
732
|
+
}
|
|
733
|
+
else if (op === "clear") {
|
|
734
|
+
selection = null;
|
|
735
|
+
}
|
|
736
|
+
else if (!selection) {
|
|
737
|
+
selection = rectSelection(width, height, 0, 0, width, height);
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
const all = rectSelection(width, height, 0, 0, width, height);
|
|
741
|
+
selection = combineSelections(all, selection, "subtract");
|
|
742
|
+
}
|
|
743
|
+
return { ok: true, hasSelection: hasSelectionPixels(selection) };
|
|
744
|
+
}),
|
|
745
|
+
tool("ui_sketch_fill", "Flood fill a connected region on a raster layer starting from canvas pixel coordinates (x, y) with color and tolerance.", z.object({
|
|
746
|
+
target: targetParam.optional(),
|
|
747
|
+
x: z.number(),
|
|
748
|
+
y: z.number(),
|
|
749
|
+
color: z.string().optional(),
|
|
750
|
+
tolerance: z.number().min(0).max(255).optional(),
|
|
751
|
+
contiguous: z.boolean().optional()
|
|
752
|
+
}), async ({ target, x, y, color, tolerance, contiguous }) => {
|
|
753
|
+
const layer = resolveTarget(target ?? "active");
|
|
754
|
+
if (layer.locked) {
|
|
755
|
+
throw new Error(`Layer "${layer.name}" is locked and cannot take pixels.`);
|
|
756
|
+
}
|
|
757
|
+
if (layer.type !== "raster") {
|
|
758
|
+
throw new Error(`Layer "${layer.name}" is a ${layer.type} layer; fill only writes raster layers.`);
|
|
759
|
+
}
|
|
760
|
+
const fillColor = color ?? foregroundColor;
|
|
761
|
+
fillOnContext(requireRasterContext(paintContext(ensureRaster(layer))), x, y, {
|
|
762
|
+
color: fillColor,
|
|
763
|
+
tolerance: tolerance ?? 16,
|
|
764
|
+
contiguous: contiguous ?? true
|
|
765
|
+
});
|
|
766
|
+
return {
|
|
767
|
+
ok: true,
|
|
768
|
+
layerId: layer.id,
|
|
769
|
+
layerName: layer.name,
|
|
770
|
+
x,
|
|
771
|
+
y,
|
|
772
|
+
color: fillColor
|
|
773
|
+
};
|
|
774
|
+
}),
|
|
775
|
+
tool("ui_sketch_gradient", "Draw a linear or radial gradient across a raster layer from start to end points.", z.object({
|
|
776
|
+
target: targetParam.optional(),
|
|
777
|
+
type: z.enum(["linear", "radial"]),
|
|
778
|
+
start: z.object({ x: z.number(), y: z.number() }),
|
|
779
|
+
end: z.object({ x: z.number(), y: z.number() }),
|
|
780
|
+
stops: z
|
|
781
|
+
.array(z.object({ offset: z.number().min(0).max(1), color: z.string() }))
|
|
782
|
+
.optional()
|
|
783
|
+
}), async ({ target, type, start, end, stops }) => {
|
|
784
|
+
const layer = resolveTarget(target ?? "active");
|
|
785
|
+
if (layer.locked || layer.type !== "raster") {
|
|
786
|
+
throw new Error(`Layer "${layer.name}" cannot take a gradient.`);
|
|
787
|
+
}
|
|
788
|
+
const ramp = stops ?? [
|
|
789
|
+
{ offset: 0, color: foregroundColor },
|
|
790
|
+
{ offset: 1, color: backgroundColor }
|
|
791
|
+
];
|
|
792
|
+
if (ramp.length < 2) {
|
|
793
|
+
throw new Error("A gradient needs at least two color stops.");
|
|
794
|
+
}
|
|
795
|
+
drawGradient(requireRasterContext(paintContext(ensureRaster(layer))), type, start, end, ramp);
|
|
796
|
+
return { ok: true, layerId: layer.id, layerName: layer.name, type };
|
|
797
|
+
}),
|
|
798
|
+
tool("ui_sketch_draw_shape", "Draw geometric shapes (rect, ellipse, line, arrow, polygon, star) with optional fill, stroke, and corner radius.", z.object({
|
|
799
|
+
target: targetParam.optional(),
|
|
800
|
+
shape: z.enum(["rect", "ellipse", "line", "arrow", "polygon", "star"]),
|
|
801
|
+
x: z.number(),
|
|
802
|
+
y: z.number(),
|
|
803
|
+
width: z.number().positive().optional(),
|
|
804
|
+
height: z.number().positive().optional(),
|
|
805
|
+
fill: z.string().optional(),
|
|
806
|
+
stroke: z.string().optional(),
|
|
807
|
+
strokeWidth: z.number().min(0).optional(),
|
|
808
|
+
cornerRadius: z.number().min(0).optional(),
|
|
809
|
+
points: z.number().int().min(3).optional(),
|
|
810
|
+
innerRadius: z.number().optional()
|
|
811
|
+
}), async (args) => {
|
|
812
|
+
const layer = resolveTarget(args.target ?? "active");
|
|
813
|
+
if (layer.locked || layer.type !== "raster") {
|
|
814
|
+
throw new Error(`Layer "${layer.name}" cannot take a shape.`);
|
|
815
|
+
}
|
|
816
|
+
const bounds = drawShape(requireRasterContext(paintContext(ensureRaster(layer))), {
|
|
817
|
+
shape: args.shape,
|
|
818
|
+
x: args.x,
|
|
819
|
+
y: args.y,
|
|
820
|
+
width: args.width,
|
|
821
|
+
height: args.height,
|
|
822
|
+
fill: args.fill,
|
|
823
|
+
stroke: args.stroke,
|
|
824
|
+
strokeWidth: args.strokeWidth,
|
|
825
|
+
cornerRadius: args.cornerRadius,
|
|
826
|
+
points: args.points,
|
|
827
|
+
innerRadius: args.innerRadius
|
|
828
|
+
});
|
|
829
|
+
return {
|
|
830
|
+
ok: true,
|
|
831
|
+
layerId: layer.id,
|
|
832
|
+
layerName: layer.name,
|
|
833
|
+
shape: args.shape,
|
|
834
|
+
bounds
|
|
835
|
+
};
|
|
836
|
+
}),
|
|
837
|
+
tool("ui_sketch_set_selection_shape", "Define or modify a pixel selection mask using geometric shapes (rect, ellipse) or polylines (lasso, polygon).", z.object({
|
|
838
|
+
mode: z.enum(["replace", "add", "subtract", "intersect"]).optional(),
|
|
839
|
+
shape: z.enum(["rect", "ellipse", "lasso", "polygon"]),
|
|
840
|
+
bounds: z
|
|
841
|
+
.object({
|
|
842
|
+
x: z.number(),
|
|
843
|
+
y: z.number(),
|
|
844
|
+
width: z.number(),
|
|
845
|
+
height: z.number()
|
|
846
|
+
})
|
|
847
|
+
.optional(),
|
|
848
|
+
points: z.array(z.object({ x: z.number(), y: z.number() })).optional(),
|
|
849
|
+
feather: z.number().min(0).optional()
|
|
850
|
+
}), async ({ mode, shape, bounds, points, feather }) => {
|
|
851
|
+
const op = mode ?? "replace";
|
|
852
|
+
let overlay;
|
|
853
|
+
if (shape === "rect" || shape === "ellipse") {
|
|
854
|
+
const box = bounds;
|
|
855
|
+
if (!box) {
|
|
856
|
+
throw new Error(`Shape "${shape}" needs a bounds box.`);
|
|
857
|
+
}
|
|
858
|
+
overlay =
|
|
859
|
+
shape === "rect"
|
|
860
|
+
? rectSelection(width, height, box.x, box.y, box.width, box.height)
|
|
861
|
+
: ellipseSelection(width, height, box.x, box.y, box.width, box.height);
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
const pts = points;
|
|
865
|
+
if (!pts || pts.length < 3) {
|
|
866
|
+
throw new Error(`Shape "${shape}" needs at least three points.`);
|
|
867
|
+
}
|
|
868
|
+
overlay = polygonSelection(width, height, pts);
|
|
869
|
+
}
|
|
870
|
+
selection = combineSelections(selection, overlay, op);
|
|
871
|
+
if (feather && feather > 0) {
|
|
872
|
+
selection = featherSelection(selection, feather);
|
|
873
|
+
}
|
|
874
|
+
return {
|
|
875
|
+
ok: true,
|
|
876
|
+
hasSelection: hasSelectionPixels(selection),
|
|
877
|
+
shape,
|
|
878
|
+
mode: op
|
|
879
|
+
};
|
|
880
|
+
}),
|
|
881
|
+
tool("ui_sketch_transform", "Translate, scale, rotate, or flip a layer's raster pixels or active selection.", z.object({
|
|
882
|
+
target: targetParam.optional(),
|
|
883
|
+
dx: z.number().optional(),
|
|
884
|
+
dy: z.number().optional(),
|
|
885
|
+
scaleX: z.number().optional(),
|
|
886
|
+
scaleY: z.number().optional(),
|
|
887
|
+
rotation: z.number().optional(),
|
|
888
|
+
flipH: z.boolean().optional(),
|
|
889
|
+
flipV: z.boolean().optional()
|
|
890
|
+
}), async (args) => {
|
|
891
|
+
const layer = resolveTarget(args.target ?? "active");
|
|
892
|
+
if (layer.locked || layer.type !== "raster") {
|
|
893
|
+
throw new Error(`Layer "${layer.name}" cannot be transformed.`);
|
|
894
|
+
}
|
|
895
|
+
const dx = args.dx ?? 0;
|
|
896
|
+
const dy = args.dy ?? 0;
|
|
897
|
+
const scaleX = args.scaleX ?? 1;
|
|
898
|
+
const scaleY = args.scaleY ?? 1;
|
|
899
|
+
const rotation = args.rotation ?? 0;
|
|
900
|
+
const flipH = args.flipH ?? false;
|
|
901
|
+
const flipV = args.flipV ?? false;
|
|
902
|
+
transformRaster(requireRasterContext(paintContext(ensureRaster(layer))), {
|
|
903
|
+
dx,
|
|
904
|
+
dy,
|
|
905
|
+
scaleX,
|
|
906
|
+
scaleY,
|
|
907
|
+
rotation,
|
|
908
|
+
flipH,
|
|
909
|
+
flipV
|
|
910
|
+
});
|
|
911
|
+
return {
|
|
912
|
+
ok: true,
|
|
913
|
+
layerId: layer.id,
|
|
914
|
+
layerName: layer.name,
|
|
915
|
+
dx,
|
|
916
|
+
dy,
|
|
917
|
+
scaleX,
|
|
918
|
+
scaleY,
|
|
919
|
+
rotation,
|
|
920
|
+
flipH,
|
|
921
|
+
flipV
|
|
922
|
+
};
|
|
923
|
+
}),
|
|
924
|
+
tool("ui_sketch_adjust_layer", "Apply tone and color adjustments (brightness, contrast, exposure, saturation, hue, blur) to a layer.", z.object({
|
|
925
|
+
target: targetParam.optional(),
|
|
926
|
+
brightness: z.number().min(-1).max(1).optional(),
|
|
927
|
+
contrast: z.number().min(-1).max(1).optional(),
|
|
928
|
+
exposure: z.number().min(-2).max(2).optional(),
|
|
929
|
+
saturation: z.number().min(-1).max(1).optional(),
|
|
930
|
+
hue: z.number().min(-180).max(180).optional(),
|
|
931
|
+
blur: z.number().min(0).max(100).optional()
|
|
932
|
+
}), async (args) => {
|
|
933
|
+
const layer = resolveTarget(args.target ?? "active");
|
|
934
|
+
if (layer.locked || layer.type !== "raster") {
|
|
935
|
+
throw new Error(`Layer "${layer.name}" cannot be adjusted.`);
|
|
936
|
+
}
|
|
937
|
+
const adjustments = {};
|
|
938
|
+
if (args.brightness !== undefined) {
|
|
939
|
+
adjustments.brightness = args.brightness;
|
|
940
|
+
}
|
|
941
|
+
if (args.contrast !== undefined) {
|
|
942
|
+
adjustments.contrast = args.contrast;
|
|
943
|
+
}
|
|
944
|
+
if (args.exposure !== undefined) {
|
|
945
|
+
adjustments.exposure = args.exposure;
|
|
946
|
+
}
|
|
947
|
+
if (args.saturation !== undefined) {
|
|
948
|
+
adjustments.saturation = args.saturation;
|
|
949
|
+
}
|
|
950
|
+
if (args.hue !== undefined)
|
|
951
|
+
adjustments.hue = args.hue;
|
|
952
|
+
if (args.blur !== undefined)
|
|
953
|
+
adjustments.blur = args.blur;
|
|
954
|
+
if (Object.keys(adjustments).length === 0) {
|
|
955
|
+
throw new Error("Provide at least one adjustment.");
|
|
956
|
+
}
|
|
957
|
+
adjustOnContext(requireRasterContext(paintContext(ensureRaster(layer))), adjustments);
|
|
958
|
+
return {
|
|
959
|
+
ok: true,
|
|
960
|
+
layerId: layer.id,
|
|
961
|
+
layerName: layer.name,
|
|
962
|
+
adjustments
|
|
963
|
+
};
|
|
964
|
+
}),
|
|
965
|
+
tool("ui_sketch_crop", "Crop the document canvas or a specific layer to a defined bounding box (x, y, width, height).", z.object({
|
|
966
|
+
target: targetParam.nullable().optional(),
|
|
967
|
+
x: z.number(),
|
|
968
|
+
y: z.number(),
|
|
969
|
+
width: z.number().positive(),
|
|
970
|
+
height: z.number().positive()
|
|
971
|
+
}), async ({ target, x, y, width: cw, height: ch }) => {
|
|
972
|
+
const box = {
|
|
973
|
+
x: Math.round(x),
|
|
974
|
+
y: Math.round(y),
|
|
975
|
+
width: Math.round(cw),
|
|
976
|
+
height: Math.round(ch)
|
|
977
|
+
};
|
|
978
|
+
if (target == null) {
|
|
979
|
+
for (const layer of layers) {
|
|
980
|
+
if (!layer.raster) {
|
|
981
|
+
continue;
|
|
982
|
+
}
|
|
983
|
+
const next = createCanvas(box.width, box.height);
|
|
984
|
+
paintContext(next).drawImage(layer.raster, -box.x, -box.y);
|
|
985
|
+
layer.raster = next;
|
|
986
|
+
}
|
|
987
|
+
width = box.width;
|
|
988
|
+
height = box.height;
|
|
989
|
+
return { ok: true, layerId: null, width, height };
|
|
990
|
+
}
|
|
991
|
+
const layer = resolveTarget(target);
|
|
992
|
+
if (layer.locked || layer.type !== "raster") {
|
|
993
|
+
throw new Error(`Layer "${layer.name}" cannot be cropped.`);
|
|
994
|
+
}
|
|
995
|
+
cropLayerInPlace(requireRasterContext(paintContext(ensureRaster(layer))), box.x, box.y, box.width, box.height);
|
|
996
|
+
return {
|
|
997
|
+
ok: true,
|
|
998
|
+
layerId: layer.id,
|
|
999
|
+
width: box.width,
|
|
1000
|
+
height: box.height
|
|
1001
|
+
};
|
|
1002
|
+
}),
|
|
1003
|
+
tool("ui_sketch_pick_color", "Sample the pixel color at (x, y) on the composite canvas or on a specific layer (eyedropper).", z.object({
|
|
1004
|
+
target: targetParam.nullable().optional(),
|
|
1005
|
+
x: z.number(),
|
|
1006
|
+
y: z.number()
|
|
1007
|
+
}), async ({ target, x, y }) => {
|
|
1008
|
+
const canvas = target == null
|
|
1009
|
+
? composite()
|
|
1010
|
+
: ensureRaster(resolveTarget(target));
|
|
1011
|
+
const sample = pickPixel(readFullImage(requireRasterContext(paintContext(canvas))), x, y);
|
|
1012
|
+
return { ok: true, ...sample };
|
|
1013
|
+
}),
|
|
1014
|
+
tool("ui_sketch_get_layer_image", "Inspect the canvas as an image. Omit `target` (or pass null) for the flattened composite of all visible layers; pass a layer id/name to read that single layer's pixels. Returns the dimensions plus an image you can visually inspect, so you can see the current artwork before editing it.", z.object({
|
|
1015
|
+
target: targetParam
|
|
1016
|
+
.nullable()
|
|
1017
|
+
.optional()
|
|
1018
|
+
.describe("Layer to read; omit or null for the flattened composite.")
|
|
1019
|
+
}), async ({ target }) => {
|
|
1020
|
+
const addressed = (target ?? null);
|
|
1021
|
+
const layer = addressed === null ? null : resolveTarget(addressed);
|
|
1022
|
+
const canvas = layer ? ensureRaster(layer) : composite();
|
|
1023
|
+
return {
|
|
1024
|
+
ok: true,
|
|
1025
|
+
layerId: layer?.id ?? null,
|
|
1026
|
+
layerName: layer?.name ?? null,
|
|
1027
|
+
width,
|
|
1028
|
+
height,
|
|
1029
|
+
note: layer === null
|
|
1030
|
+
? "Flattened composite of all visible layers (PNG)."
|
|
1031
|
+
: `Pixels of layer "${layer.name}" (PNG).`,
|
|
1032
|
+
// Mirrors the frontend tool: the base64 rides in `image_content`, not
|
|
1033
|
+
// in the result body, so a full-canvas PNG never lands in the
|
|
1034
|
+
// transcript verbatim.
|
|
1035
|
+
image_content: {
|
|
1036
|
+
uri: canvas.toDataURL("image/png"),
|
|
1037
|
+
mimeType: "image/png"
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
})
|
|
1041
|
+
];
|
|
1042
|
+
const bridge = {
|
|
1043
|
+
tools,
|
|
1044
|
+
compositePng: () => composite().toBuffer("image/png"),
|
|
1045
|
+
compositeDataUrl: () => composite().toDataURL("image/png"),
|
|
1046
|
+
finalState: () => {
|
|
1047
|
+
const area = width * height;
|
|
1048
|
+
const paintedPixels = countPaintedPixels(composite());
|
|
1049
|
+
const strokedPixels = countPaintedPixels(compositeOf(layers.filter((l) => l.strokeCount > 0)));
|
|
1050
|
+
return {
|
|
1051
|
+
name,
|
|
1052
|
+
width,
|
|
1053
|
+
height,
|
|
1054
|
+
activeLayerId,
|
|
1055
|
+
foregroundColor,
|
|
1056
|
+
backgroundColor,
|
|
1057
|
+
activeTool,
|
|
1058
|
+
hasSelection: hasSelectionPixels(selection),
|
|
1059
|
+
setup,
|
|
1060
|
+
paintedPixels,
|
|
1061
|
+
paintedFraction: paintedPixels / area,
|
|
1062
|
+
strokedFraction: strokedPixels / area,
|
|
1063
|
+
layers: layers.map((l, i) => {
|
|
1064
|
+
const entry = {
|
|
1065
|
+
id: l.id,
|
|
1066
|
+
name: l.name,
|
|
1067
|
+
type: l.type,
|
|
1068
|
+
visible: l.visible,
|
|
1069
|
+
opacity: l.opacity,
|
|
1070
|
+
blendMode: l.blendMode,
|
|
1071
|
+
index: i,
|
|
1072
|
+
hasBinding: l.hasBinding,
|
|
1073
|
+
paintedPixels: countPaintedPixels(l.raster),
|
|
1074
|
+
strokeCount: l.strokeCount
|
|
1075
|
+
};
|
|
1076
|
+
if (l.prompt !== undefined)
|
|
1077
|
+
entry.prompt = l.prompt;
|
|
1078
|
+
if (l.provider !== undefined)
|
|
1079
|
+
entry.provider = l.provider;
|
|
1080
|
+
if (l.model !== undefined)
|
|
1081
|
+
entry.model = l.model;
|
|
1082
|
+
if (l.seed !== undefined)
|
|
1083
|
+
entry.seed = l.seed;
|
|
1084
|
+
if (l.fillColor !== undefined)
|
|
1085
|
+
entry.fillColor = l.fillColor;
|
|
1086
|
+
if (l.imageRef !== undefined)
|
|
1087
|
+
entry.imageRef = l.imageRef;
|
|
1088
|
+
if (l.imageBounds !== undefined)
|
|
1089
|
+
entry.imageBounds = l.imageBounds;
|
|
1090
|
+
return entry;
|
|
1091
|
+
})
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
lastCreatedBridge = bridge;
|
|
1096
|
+
return bridge;
|
|
1097
|
+
}
|
|
1098
|
+
const SKETCH_SYSTEM_PROMPT = `You are an assistant driving a Sketch / image editor through UI tools.
|
|
1099
|
+
|
|
1100
|
+
Use the ui_sketch_* tools to inspect and modify the open image document:
|
|
1101
|
+
- Call ui_sketch_get_state first to see the layer stack, active layer, colors, and tool.
|
|
1102
|
+
- Layers are addressed by id, by (case-insensitive) name, or the literal "active" for the active layer.
|
|
1103
|
+
- Add layers with ui_sketch_add_layer, adjust them with ui_sketch_set_layer_props (opacity, blend mode, name, visibility, lock).
|
|
1104
|
+
- Put an existing image (an asset id or a URL) on a layer with ui_sketch_place_image; generate a new one with ui_sketch_generate; recolor with ui_sketch_set_color; resize the canvas with ui_sketch_resize_canvas; shape the pixel selection with ui_sketch_selection or ui_sketch_set_selection_shape.
|
|
1105
|
+
- Paint regions with ui_sketch_fill, ui_sketch_gradient, and ui_sketch_draw_shape. Transform or grade a layer with ui_sketch_transform and ui_sketch_adjust_layer. Crop with ui_sketch_crop. Sample a pixel with ui_sketch_pick_color.
|
|
1106
|
+
|
|
1107
|
+
You can draw. ui_sketch_stroke paints real pixels with the editor's brush, pencil and eraser:
|
|
1108
|
+
- A stroke is a polyline of canvas-pixel points (x right, y down, origin top-left) plus its own color, size, opacity and hardness. The engine interpolates dabs along each segment, so a curve is just enough sampled points — a circle is about 24 points around it, and you can pass "closed": true to join the last point back to the first.
|
|
1109
|
+
- Pass several strokes in one call to lay down a whole figure at once. Paint on raster layers only, and never on a locked one.
|
|
1110
|
+
- Put separate parts of a drawing on separate, named layers (ui_sketch_add_layer) so each can be moved, recolored or hidden on its own.
|
|
1111
|
+
- Call ui_sketch_get_layer_image to look at your own work — omit target for the flattened composite, or name a layer to see it alone. Check the result and fix what looks wrong before you finish.
|
|
1112
|
+
|
|
1113
|
+
The guided image flow lives on the document: ui_sketch_set_setup writes its brief, use case, variation count and stage. It renders nothing. To make a set of variations, call ui_sketch_generate once per variation with the same prompt, size and model and a different seed each time.
|
|
1114
|
+
|
|
1115
|
+
Call one tool at a time and use the result before the next call. When the objective is fully satisfied, STOP calling tools and give a one-line summary.`;
|
|
1116
|
+
export const SKETCH_TOOL_LOOP_CASES = [
|
|
1117
|
+
{
|
|
1118
|
+
id: "compose-layers",
|
|
1119
|
+
description: "Add two layers, set the top layer to 50% opacity + multiply blend, and name them",
|
|
1120
|
+
objective: "The document has a single 'Background' layer. Add two new layers, name them, and set the top new layer to 50% opacity with 'multiply' blend mode.",
|
|
1121
|
+
createBridge: () => createSketchToolBridge(),
|
|
1122
|
+
systemPrompt: SKETCH_SYSTEM_PROMPT,
|
|
1123
|
+
expect: {
|
|
1124
|
+
requiredTools: ["ui_sketch_add_layer", "ui_sketch_set_layer_props"],
|
|
1125
|
+
noErrorResults: true,
|
|
1126
|
+
minToolCalls: 2,
|
|
1127
|
+
maxToolCalls: 15,
|
|
1128
|
+
finalState: [
|
|
1129
|
+
{
|
|
1130
|
+
name: "hasThreeLayers",
|
|
1131
|
+
detail: "fewer than 3 layers in the document",
|
|
1132
|
+
test: (s) => s.layers.length >= 3
|
|
1133
|
+
},
|
|
1134
|
+
{
|
|
1135
|
+
name: "hasHalfOpacityLayer",
|
|
1136
|
+
detail: "no layer has opacity < 1",
|
|
1137
|
+
test: (s) => s.layers.some((l) => l.opacity < 1)
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
name: "hasMultiplyBlend",
|
|
1141
|
+
detail: "no layer uses multiply blend mode",
|
|
1142
|
+
test: (s) => s.layers.some((l) => l.blendMode === "multiply")
|
|
1143
|
+
}
|
|
1144
|
+
]
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
{
|
|
1148
|
+
id: "generate-layer",
|
|
1149
|
+
description: "Generate a text-to-image layer from a prompt and set the foreground color",
|
|
1150
|
+
objective: "Generate a text-to-image layer using provider 'fal_ai' and model 'fal-ai/flux/schnell' with a descriptive prompt, and set the foreground color to #ff8800.",
|
|
1151
|
+
createBridge: () => createSketchToolBridge(),
|
|
1152
|
+
systemPrompt: SKETCH_SYSTEM_PROMPT,
|
|
1153
|
+
expect: {
|
|
1154
|
+
requiredTools: ["ui_sketch_generate", "ui_sketch_set_color"],
|
|
1155
|
+
noErrorResults: true,
|
|
1156
|
+
minToolCalls: 2,
|
|
1157
|
+
maxToolCalls: 12,
|
|
1158
|
+
finalState: [
|
|
1159
|
+
{
|
|
1160
|
+
name: "hasBoundLayerWithPrompt",
|
|
1161
|
+
detail: "no layer has a generation binding with a prompt set",
|
|
1162
|
+
test: (s) => s.layers.some((l) => l.hasBinding && !!l.prompt && l.prompt.length > 0)
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
name: "foregroundSet",
|
|
1166
|
+
detail: "foreground color is not #ff8800",
|
|
1167
|
+
test: (s) => s.foregroundColor.toLowerCase() === "#ff8800"
|
|
1168
|
+
}
|
|
1169
|
+
]
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
id: "resize-and-select",
|
|
1174
|
+
description: "Resize the canvas to 1024x768 and select the whole canvas",
|
|
1175
|
+
objective: "Resize the canvas to 1024x768 pixels and select the whole canvas.",
|
|
1176
|
+
createBridge: () => createSketchToolBridge(),
|
|
1177
|
+
systemPrompt: SKETCH_SYSTEM_PROMPT,
|
|
1178
|
+
expect: {
|
|
1179
|
+
requiredTools: ["ui_sketch_resize_canvas", "ui_sketch_selection"],
|
|
1180
|
+
noErrorResults: true,
|
|
1181
|
+
minToolCalls: 2,
|
|
1182
|
+
maxToolCalls: 8,
|
|
1183
|
+
finalState: [
|
|
1184
|
+
{
|
|
1185
|
+
name: "resizedWidth",
|
|
1186
|
+
detail: "canvas width is not 1024",
|
|
1187
|
+
test: (s) => s.width === 1024
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
name: "resizedHeight",
|
|
1191
|
+
detail: "canvas height is not 768",
|
|
1192
|
+
test: (s) => s.height === 768
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
name: "hasSelection",
|
|
1196
|
+
detail: "canvas has no active selection",
|
|
1197
|
+
test: (s) => s.hasSelection === true
|
|
1198
|
+
}
|
|
1199
|
+
]
|
|
1200
|
+
}
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
id: "image-flow-variations",
|
|
1204
|
+
description: "Walk the guided image flow's state and render a set of variations that differ only by seed",
|
|
1205
|
+
objective: "Set up the guided image flow for a product shot of a ceramic pour-over coffee dripper on a sunlit kitchen counter, asking for 3 variations, and leave the flow finished. Then render those 3 variations with provider 'fal_ai' and model 'fal-ai/flux/schnell', using the same prompt and size for every one and a different seed each time.",
|
|
1206
|
+
createBridge: () => createSketchToolBridge(),
|
|
1207
|
+
systemPrompt: SKETCH_SYSTEM_PROMPT,
|
|
1208
|
+
maxIterations: 20,
|
|
1209
|
+
expect: {
|
|
1210
|
+
requiredTools: ["ui_sketch_set_setup", "ui_sketch_generate"],
|
|
1211
|
+
// The brief is written before anything is rendered (D4).
|
|
1212
|
+
ordering: [["ui_sketch_set_setup", "ui_sketch_generate"]],
|
|
1213
|
+
noErrorResults: true,
|
|
1214
|
+
minToolCalls: 4,
|
|
1215
|
+
maxToolCalls: 20,
|
|
1216
|
+
finalState: [
|
|
1217
|
+
{
|
|
1218
|
+
name: "setupNamesTheProductShot",
|
|
1219
|
+
detail: "the flow state does not name a product shot with a brief",
|
|
1220
|
+
test: (s) => s.setup?.use_case === "product" &&
|
|
1221
|
+
(s.setup?.brief ?? "").trim().length > 0
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
name: "askedForThreeVariations",
|
|
1225
|
+
detail: "the flow state does not ask for 3 variations",
|
|
1226
|
+
test: (s) => s.setup?.variations === 3
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
name: "renderedThreeVariations",
|
|
1230
|
+
detail: "fewer than 3 generated layers",
|
|
1231
|
+
test: (s) => s.layers.filter((l) => l.hasBinding).length >= 3
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
name: "variationsShareOnePrompt",
|
|
1235
|
+
// Criterion 4: same prompt, same model, differing only by seed.
|
|
1236
|
+
detail: "the generated layers do not share one prompt and model",
|
|
1237
|
+
test: (s) => {
|
|
1238
|
+
const generated = s.layers.filter((l) => l.hasBinding);
|
|
1239
|
+
return (new Set(generated.map((l) => `${l.prompt ?? ""}|${l.model ?? ""}`)).size === 1);
|
|
1240
|
+
}
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
name: "variationsDifferBySeed",
|
|
1244
|
+
detail: "the generated layers do not each carry a distinct seed",
|
|
1245
|
+
test: (s) => {
|
|
1246
|
+
const seeds = s.layers
|
|
1247
|
+
.filter((l) => l.hasBinding)
|
|
1248
|
+
.map((l) => l.seed);
|
|
1249
|
+
return (seeds.length >= 3 &&
|
|
1250
|
+
seeds.every((seed) => seed !== undefined) &&
|
|
1251
|
+
new Set(seeds).size === seeds.length);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
]
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
id: "draw-an-animal",
|
|
1259
|
+
description: "Draw a cat with ui_sketch_stroke across separate named layers, then look at the result",
|
|
1260
|
+
objective: "Draw a simple cat on the canvas. Put the body, the head, and the face details (eyes, nose, whiskers) on separate layers, each with a name that says what it holds, and draw each part with strokes. When you are done, look at the flattened result to check what you drew.",
|
|
1261
|
+
createBridge: () => createSketchToolBridge({ width: 512, height: 512 }),
|
|
1262
|
+
systemPrompt: SKETCH_SYSTEM_PROMPT,
|
|
1263
|
+
// Drawing is many-turned: a layer per part, a stroke batch per layer, and
|
|
1264
|
+
// a look at the result. Measured runs land around 8-20 calls, well past
|
|
1265
|
+
// the runner's default cap of 12.
|
|
1266
|
+
maxIterations: 40,
|
|
1267
|
+
expect: {
|
|
1268
|
+
requiredTools: ["ui_sketch_stroke", "ui_sketch_get_layer_image"],
|
|
1269
|
+
// Looking at the drawing only means something once there is one.
|
|
1270
|
+
ordering: [["ui_sketch_stroke", "ui_sketch_get_layer_image"]],
|
|
1271
|
+
noErrorResults: true,
|
|
1272
|
+
minToolCalls: 3,
|
|
1273
|
+
maxToolCalls: 40,
|
|
1274
|
+
finalState: [
|
|
1275
|
+
{
|
|
1276
|
+
name: "hasSeparateNamedLayers",
|
|
1277
|
+
detail: "fewer than 3 distinctly named layers — the parts were not separated",
|
|
1278
|
+
test: (s) => new Set(s.layers.map((l) => l.name.trim().toLowerCase())).size >=
|
|
1279
|
+
3
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
name: "partsAreOnDifferentLayers",
|
|
1283
|
+
detail: "strokes landed on fewer than 2 layers",
|
|
1284
|
+
test: (s) => s.layers.filter((l) => l.strokeCount > 0).length >= 2
|
|
1285
|
+
},
|
|
1286
|
+
{
|
|
1287
|
+
name: "canvasIsMeaningfullyPainted",
|
|
1288
|
+
// Structural, not pictorial: a cat this cannot judge, but a canvas
|
|
1289
|
+
// still 99% empty is not a drawing by any reading. Measured over
|
|
1290
|
+
// the stroked layers only, so a solid backdrop fill cannot pass it.
|
|
1291
|
+
detail: "strokes covered less than 1% of the canvas",
|
|
1292
|
+
test: (s) => s.strokedFraction >= 0.01
|
|
1293
|
+
}
|
|
1294
|
+
]
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
];
|
|
1298
|
+
//# sourceMappingURL=sketch.js.map
|