@nodetool-ai/agents 0.8.1 → 0.8.3
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/dist/.nodetool-build-stamp +1 -1
- package/dist/analysis/audio-dsp.d.ts +3 -2
- package/dist/analysis/audio-dsp.d.ts.map +1 -1
- package/dist/analysis/audio-dsp.js +11 -8
- package/dist/analysis/audio-dsp.js.map +1 -1
- package/dist/analysis/media-decode.d.ts +13 -0
- package/dist/analysis/media-decode.d.ts.map +1 -1
- package/dist/analysis/media-decode.js +33 -6
- package/dist/analysis/media-decode.js.map +1 -1
- package/dist/apify/assets.d.ts.map +1 -1
- package/dist/apify/assets.js +4 -0
- package/dist/apify/assets.js.map +1 -1
- package/dist/author-graph.d.ts +2 -3
- package/dist/author-graph.d.ts.map +1 -1
- package/dist/author-graph.js +3 -5
- package/dist/author-graph.js.map +1 -1
- package/dist/browser-gate.d.ts +2 -2
- package/dist/browser-gate.js +2 -2
- package/dist/capabilities/GamePublishRequest.d.ts +14 -0
- package/dist/capabilities/GamePublishRequest.d.ts.map +1 -0
- package/dist/capabilities/GamePublishRequest.js +2 -0
- package/dist/capabilities/GamePublishRequest.js.map +1 -0
- package/dist/capabilities/adapters.d.ts +4 -13
- package/dist/capabilities/adapters.d.ts.map +1 -1
- package/dist/capabilities/adapters.js +9 -14
- package/dist/capabilities/adapters.js.map +1 -1
- package/dist/capabilities/agent-activity.d.ts +27 -0
- package/dist/capabilities/agent-activity.d.ts.map +1 -0
- package/dist/capabilities/agent-activity.js +103 -0
- package/dist/capabilities/agent-activity.js.map +1 -0
- package/dist/capabilities/agentic-storyboard-finish.d.ts +67 -0
- package/dist/capabilities/agentic-storyboard-finish.d.ts.map +1 -0
- package/dist/capabilities/agentic-storyboard-finish.js +1321 -0
- package/dist/capabilities/agentic-storyboard-finish.js.map +1 -0
- package/dist/capabilities/agents.d.ts +5 -2
- package/dist/capabilities/agents.d.ts.map +1 -1
- package/dist/capabilities/agents.js +14 -4
- package/dist/capabilities/agents.js.map +1 -1
- package/dist/capabilities/agents.specs.d.ts +3 -0
- package/dist/capabilities/agents.specs.d.ts.map +1 -1
- package/dist/capabilities/agents.specs.js +71 -1
- package/dist/capabilities/agents.specs.js.map +1 -1
- package/dist/capabilities/analysis.d.ts.map +1 -1
- package/dist/capabilities/analysis.js +33 -22
- package/dist/capabilities/analysis.js.map +1 -1
- package/dist/capabilities/analysis.specs.js +2 -2
- package/dist/capabilities/analysis.specs.js.map +1 -1
- package/dist/capabilities/apps.d.ts.map +1 -1
- package/dist/capabilities/apps.js +5 -3
- package/dist/capabilities/apps.js.map +1 -1
- package/dist/capabilities/args.d.ts +2 -5
- package/dist/capabilities/args.d.ts.map +1 -1
- package/dist/capabilities/args.js +2 -5
- package/dist/capabilities/args.js.map +1 -1
- package/dist/capabilities/assets.d.ts.map +1 -1
- package/dist/capabilities/assets.js +40 -10
- package/dist/capabilities/assets.js.map +1 -1
- package/dist/capabilities/browser.d.ts +1 -1
- package/dist/capabilities/browser.js +1 -1
- package/dist/capabilities/browser.specs.d.ts +1 -1
- package/dist/capabilities/browser.specs.js +1 -1
- package/dist/capabilities/code.d.ts +5 -0
- package/dist/capabilities/code.d.ts.map +1 -1
- package/dist/capabilities/code.js +128 -89
- package/dist/capabilities/code.js.map +1 -1
- package/dist/capabilities/collections.d.ts +4 -6
- package/dist/capabilities/collections.d.ts.map +1 -1
- package/dist/capabilities/collections.js +16 -11
- package/dist/capabilities/collections.js.map +1 -1
- package/dist/capabilities/derive-shot.d.ts +45 -0
- package/dist/capabilities/derive-shot.d.ts.map +1 -0
- package/dist/capabilities/derive-shot.js +82 -0
- package/dist/capabilities/derive-shot.js.map +1 -0
- package/dist/capabilities/documents.d.ts +2 -1
- package/dist/capabilities/documents.d.ts.map +1 -1
- package/dist/capabilities/documents.js +12 -6
- package/dist/capabilities/documents.js.map +1 -1
- package/dist/capabilities/email.d.ts +2 -1
- package/dist/capabilities/email.d.ts.map +1 -1
- package/dist/capabilities/email.js +5 -3
- package/dist/capabilities/email.js.map +1 -1
- package/dist/capabilities/errors.d.ts +19 -0
- package/dist/capabilities/errors.d.ts.map +1 -0
- package/dist/capabilities/errors.js +109 -0
- package/dist/capabilities/errors.js.map +1 -0
- package/dist/capabilities/errors.specs.d.ts +11 -0
- package/dist/capabilities/errors.specs.d.ts.map +1 -0
- package/dist/capabilities/errors.specs.js +100 -0
- package/dist/capabilities/errors.specs.js.map +1 -0
- package/dist/capabilities/example-timelines.d.ts.map +1 -1
- package/dist/capabilities/example-timelines.js +52 -10
- package/dist/capabilities/example-timelines.js.map +1 -1
- package/dist/capabilities/example-timelines.specs.d.ts +1 -0
- package/dist/capabilities/example-timelines.specs.d.ts.map +1 -1
- package/dist/capabilities/example-timelines.specs.js +21 -3
- package/dist/capabilities/example-timelines.specs.js.map +1 -1
- package/dist/capabilities/finish-storyboard.d.ts +5 -0
- package/dist/capabilities/finish-storyboard.d.ts.map +1 -0
- package/dist/capabilities/finish-storyboard.js +278 -0
- package/dist/capabilities/finish-storyboard.js.map +1 -0
- package/dist/capabilities/game-asset-browser.d.ts +11 -0
- package/dist/capabilities/game-asset-browser.d.ts.map +1 -0
- package/dist/capabilities/game-asset-browser.js +152 -0
- package/dist/capabilities/game-asset-browser.js.map +1 -0
- package/dist/capabilities/game-asset-source.js +1 -1
- package/dist/capabilities/game-asset-source.js.map +1 -1
- package/dist/capabilities/game.d.ts +44 -2
- package/dist/capabilities/game.d.ts.map +1 -1
- package/dist/capabilities/game.js +408 -160
- package/dist/capabilities/game.js.map +1 -1
- package/dist/capabilities/game.specs.d.ts +4 -0
- package/dist/capabilities/game.specs.d.ts.map +1 -1
- package/dist/capabilities/game.specs.js +42 -13
- package/dist/capabilities/game.specs.js.map +1 -1
- package/dist/capabilities/game3d.d.ts +17 -0
- package/dist/capabilities/game3d.d.ts.map +1 -0
- package/dist/capabilities/game3d.js +434 -0
- package/dist/capabilities/game3d.js.map +1 -0
- package/dist/capabilities/gate-from-context.d.ts +1 -1
- package/dist/capabilities/gate-from-context.js +1 -1
- package/dist/capabilities/generations.d.ts +2 -0
- package/dist/capabilities/generations.d.ts.map +1 -1
- package/dist/capabilities/generations.js +14 -23
- package/dist/capabilities/generations.js.map +1 -1
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/index.js +2 -2
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/invoke.d.ts +14 -25
- package/dist/capabilities/invoke.d.ts.map +1 -1
- package/dist/capabilities/invoke.js +72 -35
- package/dist/capabilities/invoke.js.map +1 -1
- package/dist/capabilities/jobs.d.ts.map +1 -1
- package/dist/capabilities/jobs.js +47 -3
- package/dist/capabilities/jobs.js.map +1 -1
- package/dist/capabilities/jobs.specs.d.ts.map +1 -1
- package/dist/capabilities/jobs.specs.js +3 -1
- package/dist/capabilities/jobs.specs.js.map +1 -1
- package/dist/capabilities/js-scripts.d.ts +19 -1
- package/dist/capabilities/js-scripts.d.ts.map +1 -1
- package/dist/capabilities/js-scripts.js +109 -2
- package/dist/capabilities/js-scripts.js.map +1 -1
- package/dist/capabilities/js-scripts.specs.d.ts +2 -0
- package/dist/capabilities/js-scripts.specs.d.ts.map +1 -1
- package/dist/capabilities/js-scripts.specs.js +50 -0
- package/dist/capabilities/js-scripts.specs.js.map +1 -1
- package/dist/capabilities/lazy-tool-core.d.ts +23 -0
- package/dist/capabilities/lazy-tool-core.d.ts.map +1 -0
- package/dist/capabilities/lazy-tool-core.js +56 -0
- package/dist/capabilities/lazy-tool-core.js.map +1 -0
- package/dist/capabilities/lazy-tool.d.ts +3 -23
- package/dist/capabilities/lazy-tool.d.ts.map +1 -1
- package/dist/capabilities/lazy-tool.js +6 -64
- package/dist/capabilities/lazy-tool.js.map +1 -1
- package/dist/capabilities/legacy-tools.d.ts +15 -0
- package/dist/capabilities/legacy-tools.d.ts.map +1 -0
- package/dist/capabilities/legacy-tools.js +98 -0
- package/dist/capabilities/legacy-tools.js.map +1 -0
- package/dist/capabilities/media.d.ts +0 -9
- package/dist/capabilities/media.d.ts.map +1 -1
- package/dist/capabilities/media.js +314 -261
- package/dist/capabilities/media.js.map +1 -1
- package/dist/capabilities/media.specs.d.ts.map +1 -1
- package/dist/capabilities/media.specs.js +17 -0
- package/dist/capabilities/media.specs.js.map +1 -1
- package/dist/capabilities/metadata.d.ts +62 -0
- package/dist/capabilities/metadata.d.ts.map +1 -0
- package/dist/capabilities/metadata.js +114 -0
- package/dist/capabilities/metadata.js.map +1 -0
- package/dist/capabilities/model3d.d.ts.map +1 -1
- package/dist/capabilities/model3d.js +4 -0
- package/dist/capabilities/model3d.js.map +1 -1
- package/dist/capabilities/models.d.ts +2 -2
- package/dist/capabilities/models.d.ts.map +1 -1
- package/dist/capabilities/models.js +5 -3
- package/dist/capabilities/models.js.map +1 -1
- package/dist/capabilities/registry.d.ts +6 -19
- package/dist/capabilities/registry.d.ts.map +1 -1
- package/dist/capabilities/registry.js +72 -113
- package/dist/capabilities/registry.js.map +1 -1
- package/dist/capabilities/run-agent.d.ts +19 -0
- package/dist/capabilities/run-agent.d.ts.map +1 -0
- package/dist/capabilities/run-agent.js +183 -0
- package/dist/capabilities/run-agent.js.map +1 -0
- package/dist/capabilities/runs.d.ts +9 -0
- package/dist/capabilities/runs.d.ts.map +1 -0
- package/dist/capabilities/runs.js +46 -0
- package/dist/capabilities/runs.js.map +1 -0
- package/dist/capabilities/runs.specs.d.ts +39 -0
- package/dist/capabilities/runs.specs.d.ts.map +1 -0
- package/dist/capabilities/runs.specs.js +52 -0
- package/dist/capabilities/runs.specs.js.map +1 -0
- package/dist/capabilities/scripts.d.ts.map +1 -1
- package/dist/capabilities/scripts.js +11 -5
- package/dist/capabilities/scripts.js.map +1 -1
- package/dist/capabilities/settings.d.ts.map +1 -1
- package/dist/capabilities/settings.js +4 -2
- package/dist/capabilities/settings.js.map +1 -1
- package/dist/capabilities/sketches.d.ts.map +1 -1
- package/dist/capabilities/sketches.js +4 -2
- package/dist/capabilities/sketches.js.map +1 -1
- package/dist/capabilities/skills.d.ts.map +1 -1
- package/dist/capabilities/skills.js +22 -2
- package/dist/capabilities/skills.js.map +1 -1
- package/dist/capabilities/storyboard-layout-check.d.ts +33 -0
- package/dist/capabilities/storyboard-layout-check.d.ts.map +1 -0
- package/dist/capabilities/storyboard-layout-check.js +229 -0
- package/dist/capabilities/storyboard-layout-check.js.map +1 -0
- package/dist/capabilities/storyboard-measured-sources.d.ts +10 -0
- package/dist/capabilities/storyboard-measured-sources.d.ts.map +1 -0
- package/dist/capabilities/storyboard-measured-sources.js +67 -0
- package/dist/capabilities/storyboard-measured-sources.js.map +1 -0
- package/dist/capabilities/storyboard-review-times.d.ts +4 -0
- package/dist/capabilities/storyboard-review-times.d.ts.map +1 -0
- package/dist/capabilities/storyboard-review-times.js +39 -0
- package/dist/capabilities/storyboard-review-times.js.map +1 -0
- package/dist/capabilities/storyboards.d.ts +12 -18
- package/dist/capabilities/storyboards.d.ts.map +1 -1
- package/dist/capabilities/storyboards.js +779 -96
- package/dist/capabilities/storyboards.js.map +1 -1
- package/dist/capabilities/storyboards.specs.d.ts +9 -0
- package/dist/capabilities/storyboards.specs.d.ts.map +1 -1
- package/dist/capabilities/storyboards.specs.js +173 -5
- package/dist/capabilities/storyboards.specs.js.map +1 -1
- package/dist/capabilities/threads.js +1 -1
- package/dist/capabilities/threads.js.map +1 -1
- package/dist/capabilities/timeline-bridge.d.ts +368 -0
- package/dist/capabilities/timeline-bridge.d.ts.map +1 -0
- package/dist/capabilities/timeline-bridge.js +1008 -0
- package/dist/capabilities/timeline-bridge.js.map +1 -0
- package/dist/capabilities/timeline-clip-frames.d.ts +17 -0
- package/dist/capabilities/timeline-clip-frames.d.ts.map +1 -0
- package/dist/capabilities/timeline-clip-frames.js +84 -0
- package/dist/capabilities/timeline-clip-frames.js.map +1 -0
- package/dist/capabilities/timeline-media-edit.d.ts +8 -0
- package/dist/capabilities/timeline-media-edit.d.ts.map +1 -0
- package/dist/capabilities/timeline-media-edit.js +94 -0
- package/dist/capabilities/timeline-media-edit.js.map +1 -0
- package/dist/capabilities/timeline-native-media.d.ts.map +1 -1
- package/dist/capabilities/timeline-native-media.js +40 -0
- package/dist/capabilities/timeline-native-media.js.map +1 -1
- package/dist/capabilities/timeline-operations.d.ts +52 -0
- package/dist/capabilities/timeline-operations.d.ts.map +1 -0
- package/dist/capabilities/timeline-operations.js +413 -0
- package/dist/capabilities/timeline-operations.js.map +1 -0
- package/dist/capabilities/timelines.d.ts +28 -3
- package/dist/capabilities/timelines.d.ts.map +1 -1
- package/dist/capabilities/timelines.js +410 -294
- package/dist/capabilities/timelines.js.map +1 -1
- package/dist/capabilities/timelines.specs.d.ts +8 -0
- package/dist/capabilities/timelines.specs.d.ts.map +1 -1
- package/dist/capabilities/timelines.specs.js +178 -9
- package/dist/capabilities/timelines.specs.js.map +1 -1
- package/dist/capabilities/types.d.ts +3 -1
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/capabilities/types.js.map +1 -1
- package/dist/capabilities/ui.d.ts.map +1 -1
- package/dist/capabilities/ui.js +24 -2
- package/dist/capabilities/ui.js.map +1 -1
- package/dist/capabilities/web.d.ts.map +1 -1
- package/dist/capabilities/web.js +4 -0
- package/dist/capabilities/web.js.map +1 -1
- package/dist/capabilities/workflows.d.ts +3 -1
- package/dist/capabilities/workflows.d.ts.map +1 -1
- package/dist/capabilities/workflows.js +244 -39
- package/dist/capabilities/workflows.js.map +1 -1
- package/dist/capabilities/workflows.specs.d.ts +2 -0
- package/dist/capabilities/workflows.specs.d.ts.map +1 -1
- package/dist/capabilities/workflows.specs.js +72 -2
- package/dist/capabilities/workflows.specs.js.map +1 -1
- package/dist/codeact/action-diagnostics.d.ts.map +1 -1
- package/dist/codeact/action-diagnostics.js +51 -1
- package/dist/codeact/action-diagnostics.js.map +1 -1
- package/dist/codeact/codeact-executor.d.ts.map +1 -1
- package/dist/codeact/codeact-executor.js +16 -8
- package/dist/codeact/codeact-executor.js.map +1 -1
- package/dist/codeact/compact-ids.d.ts.map +1 -1
- package/dist/codeact/compact-ids.js +5 -1
- package/dist/codeact/compact-ids.js.map +1 -1
- package/dist/codeact/graph-model.d.ts +1 -1
- package/dist/codeact/graph-model.d.ts.map +1 -1
- package/dist/codeact/graph-model.js +2 -3
- package/dist/codeact/graph-model.js.map +1 -1
- package/dist/codeact/nodetool-api.d.ts +1 -1
- package/dist/codeact/nodetool-api.d.ts.map +1 -1
- package/dist/codeact/nodetool-api.js +202 -284
- package/dist/codeact/nodetool-api.js.map +1 -1
- package/dist/codeact/sandbox-packages.d.ts +0 -7
- package/dist/codeact/sandbox-packages.d.ts.map +1 -1
- package/dist/codeact/sandbox-packages.js +1 -10
- package/dist/codeact/sandbox-packages.js.map +1 -1
- package/dist/codeact/tool-api.d.ts +6 -3
- package/dist/codeact/tool-api.d.ts.map +1 -1
- package/dist/codeact/tool-api.js +22 -15
- package/dist/codeact/tool-api.js.map +1 -1
- package/dist/evals/codeact-api-cases.d.ts.map +1 -1
- package/dist/evals/codeact-api-cases.js +2 -0
- package/dist/evals/codeact-api-cases.js.map +1 -1
- package/dist/evals/codeact-api-runs.d.ts +3 -0
- package/dist/evals/codeact-api-runs.d.ts.map +1 -0
- package/dist/evals/codeact-api-runs.js +33 -0
- package/dist/evals/codeact-api-runs.js.map +1 -0
- package/dist/evals/surfaces/game.d.ts +8 -2
- package/dist/evals/surfaces/game.d.ts.map +1 -1
- package/dist/evals/surfaces/game.js +460 -2
- package/dist/evals/surfaces/game.js.map +1 -1
- package/dist/evals/surfaces/sketch.d.ts +2 -0
- package/dist/evals/surfaces/sketch.d.ts.map +1 -1
- package/dist/evals/surfaces/sketch.js +11 -3
- package/dist/evals/surfaces/sketch.js.map +1 -1
- package/dist/evals/surfaces/timeline.d.ts +4 -357
- package/dist/evals/surfaces/timeline.d.ts.map +1 -1
- package/dist/evals/surfaces/timeline.js +9 -2621
- package/dist/evals/surfaces/timeline.js.map +1 -1
- package/dist/evals/tool-loop-bridge.d.ts +4 -0
- package/dist/evals/tool-loop-bridge.d.ts.map +1 -1
- package/dist/evals/tool-loop-bridge.js.map +1 -1
- package/dist/evals/tool-loop-eval.d.ts +2 -0
- package/dist/evals/tool-loop-eval.d.ts.map +1 -1
- package/dist/evals/tool-loop-eval.js +6 -1
- package/dist/evals/tool-loop-eval.js.map +1 -1
- package/dist/evals/tool-loop-permission.d.ts +1 -15
- package/dist/evals/tool-loop-permission.d.ts.map +1 -1
- package/dist/evals/tool-loop-permission.js +23 -41
- package/dist/evals/tool-loop-permission.js.map +1 -1
- package/dist/game-authoring.d.ts +9573 -0
- package/dist/game-authoring.d.ts.map +1 -0
- package/dist/game-authoring.js +146 -0
- package/dist/game-authoring.js.map +1 -0
- package/dist/game-build.d.ts +3 -0
- package/dist/game-build.d.ts.map +1 -0
- package/dist/game-build.js +3 -0
- package/dist/game-build.js.map +1 -0
- package/dist/game-code-bake.d.ts +26 -0
- package/dist/game-code-bake.d.ts.map +1 -0
- package/dist/game-code-bake.js +98 -0
- package/dist/game-code-bake.js.map +1 -0
- package/dist/game-examples.d.ts +2227 -18
- package/dist/game-examples.d.ts.map +1 -1
- package/dist/game-examples.js +5 -4
- package/dist/game-examples.js.map +1 -1
- package/dist/generation-cancel.d.ts +31 -0
- package/dist/generation-cancel.d.ts.map +1 -0
- package/dist/generation-cancel.js +28 -0
- package/dist/generation-cancel.js.map +1 -0
- package/dist/host-access-gate.d.ts +29 -0
- package/dist/host-access-gate.d.ts.map +1 -0
- package/dist/host-access-gate.js +39 -0
- package/dist/host-access-gate.js.map +1 -0
- package/dist/host-modules/dispatcher.d.ts +7 -1
- package/dist/host-modules/dispatcher.d.ts.map +1 -1
- package/dist/host-modules/dispatcher.js +13 -2
- package/dist/host-modules/dispatcher.js.map +1 -1
- package/dist/host-modules/docx.d.ts.map +1 -1
- package/dist/host-modules/docx.js +2 -2
- package/dist/host-modules/docx.js.map +1 -1
- package/dist/host-modules/epub.d.ts.map +1 -1
- package/dist/host-modules/epub.js +2 -2
- package/dist/host-modules/epub.js.map +1 -1
- package/dist/host-modules/fabric.d.ts.map +1 -1
- package/dist/host-modules/fabric.js +1 -1
- package/dist/host-modules/fabric.js.map +1 -1
- package/dist/host-modules/limits.d.ts +10 -8
- package/dist/host-modules/limits.d.ts.map +1 -1
- package/dist/host-modules/limits.js +14 -9
- package/dist/host-modules/limits.js.map +1 -1
- package/dist/host-modules/mammoth.d.ts.map +1 -1
- package/dist/host-modules/mammoth.js +2 -2
- package/dist/host-modules/mammoth.js.map +1 -1
- package/dist/host-modules/ocr.d.ts.map +1 -1
- package/dist/host-modules/ocr.js +1 -1
- package/dist/host-modules/ocr.js.map +1 -1
- package/dist/host-modules/pdf.d.ts.map +1 -1
- package/dist/host-modules/pdf.js +2 -2
- package/dist/host-modules/pdf.js.map +1 -1
- package/dist/host-modules/pdflib.d.ts.map +1 -1
- package/dist/host-modules/pdflib.js +2 -2
- package/dist/host-modules/pdflib.js.map +1 -1
- package/dist/host-modules/pptx.d.ts.map +1 -1
- package/dist/host-modules/pptx.js +2 -2
- package/dist/host-modules/pptx.js.map +1 -1
- package/dist/host-modules/pptxgen.d.ts.map +1 -1
- package/dist/host-modules/pptxgen.js +2 -2
- package/dist/host-modules/pptxgen.js.map +1 -1
- package/dist/host-modules/tfjs.d.ts.map +1 -1
- package/dist/host-modules/tfjs.js +4 -4
- package/dist/host-modules/tfjs.js.map +1 -1
- package/dist/host-modules/xlsx.d.ts.map +1 -1
- package/dist/host-modules/xlsx.js +2 -2
- package/dist/host-modules/xlsx.js.map +1 -1
- package/dist/index.d.ts +18 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/js-sandbox-worker/engine.d.ts +4 -0
- package/dist/js-sandbox-worker/engine.d.ts.map +1 -0
- package/dist/js-sandbox-worker/engine.js +45 -0
- package/dist/js-sandbox-worker/engine.js.map +1 -0
- package/dist/js-sandbox-worker/host.js +1 -1
- package/dist/js-sandbox-worker/host.js.map +1 -1
- package/dist/js-sandbox-worker/interpreter.d.ts +1 -1
- package/dist/js-sandbox-worker/interpreter.d.ts.map +1 -1
- package/dist/js-sandbox-worker/interpreter.js +94 -2
- package/dist/js-sandbox-worker/interpreter.js.map +1 -1
- package/dist/js-sandbox-worker/worker-entry.d.ts.map +1 -1
- package/dist/js-sandbox-worker/worker-entry.js +3 -2
- package/dist/js-sandbox-worker/worker-entry.js.map +1 -1
- package/dist/js-sandbox.d.ts +9 -1
- package/dist/js-sandbox.d.ts.map +1 -1
- package/dist/js-sandbox.js +76 -15
- package/dist/js-sandbox.js.map +1 -1
- package/dist/js-script-app-runner.d.ts +2 -0
- package/dist/js-script-app-runner.d.ts.map +1 -1
- package/dist/js-script-app-runner.js +8 -3
- package/dist/js-script-app-runner.js.map +1 -1
- package/dist/js-script-sandbox.d.ts +12 -18
- package/dist/js-script-sandbox.d.ts.map +1 -1
- package/dist/js-script-sandbox.js +3 -49
- package/dist/js-script-sandbox.js.map +1 -1
- package/dist/prompts/product-knowledge.d.ts +1 -1
- package/dist/prompts/product-knowledge.d.ts.map +1 -1
- package/dist/prompts/product-knowledge.js +82 -41
- package/dist/prompts/product-knowledge.js.map +1 -1
- package/dist/sandbox-pack-resolution.d.ts +21 -0
- package/dist/sandbox-pack-resolution.d.ts.map +1 -0
- package/dist/sandbox-pack-resolution.js +42 -0
- package/dist/sandbox-pack-resolution.js.map +1 -0
- package/dist/sandbox-toolbelt.d.ts +3 -1
- package/dist/sandbox-toolbelt.d.ts.map +1 -1
- package/dist/sandbox-toolbelt.js +8 -2
- package/dist/sandbox-toolbelt.js.map +1 -1
- package/dist/skill-prompt.d.ts +11 -1
- package/dist/skill-prompt.d.ts.map +1 -1
- package/dist/skill-prompt.js +17 -6
- package/dist/skill-prompt.js.map +1 -1
- package/dist/system-skills.d.ts +7 -1
- package/dist/system-skills.d.ts.map +1 -1
- package/dist/system-skills.js +2 -2
- package/dist/system-skills.js.map +1 -1
- package/dist/timeline-capture.d.ts +21 -0
- package/dist/timeline-capture.d.ts.map +1 -0
- package/dist/timeline-capture.js +564 -0
- package/dist/timeline-capture.js.map +1 -0
- package/dist/timeline-code-bake.d.ts +75 -0
- package/dist/timeline-code-bake.d.ts.map +1 -0
- package/dist/timeline-code-bake.js +327 -0
- package/dist/timeline-code-bake.js.map +1 -0
- package/dist/timeline-preview/frames.d.ts +26 -0
- package/dist/timeline-preview/frames.d.ts.map +1 -1
- package/dist/timeline-preview/frames.js +155 -70
- package/dist/timeline-preview/frames.js.map +1 -1
- package/dist/tools/base-tool.d.ts +1 -0
- package/dist/tools/base-tool.d.ts.map +1 -1
- package/dist/tools/base-tool.js +1 -1
- package/dist/tools/base-tool.js.map +1 -1
- package/dist/tools/builtin-tools.d.ts +4 -3
- package/dist/tools/builtin-tools.d.ts.map +1 -1
- package/dist/tools/builtin-tools.js +24 -3
- package/dist/tools/builtin-tools.js.map +1 -1
- package/dist/tools/external-capability-tools.d.ts +1 -1
- package/dist/tools/external-capability-tools.js +1 -1
- package/dist/tools/mcp-tool-support.d.ts +10 -9
- package/dist/tools/mcp-tool-support.d.ts.map +1 -1
- package/dist/tools/mcp-tool-support.js +14 -13
- package/dist/tools/mcp-tool-support.js.map +1 -1
- package/dist/tools/mcp-tools.d.ts +6 -4
- package/dist/tools/mcp-tools.d.ts.map +1 -1
- package/dist/tools/mcp-tools.js +65 -62
- package/dist/tools/mcp-tools.js.map +1 -1
- package/dist/tools/tool-permissions.d.ts +1 -1
- package/dist/tools/tool-permissions.js +1 -1
- package/package.json +124 -41
- package/dist/capabilities/gate-tools.d.ts +0 -18
- package/dist/capabilities/gate-tools.d.ts.map +0 -1
- package/dist/capabilities/gate-tools.js +0 -66
- package/dist/capabilities/gate-tools.js.map +0 -1
- package/dist/tsconfig.tests.tmp.tsbuildinfo +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bake a timeline's authoring code: run an `@nodetool-ai/sandbox-timeline`
|
|
3
|
+
* program once and hand back the `TimelineDocument` it built, without
|
|
4
|
+
* writing anywhere.
|
|
5
|
+
*
|
|
6
|
+
* The stored code is a retained program (docs/timeline-code-capture.md):
|
|
7
|
+
* research, generation and every other capability call ran once, in the
|
|
8
|
+
* author's run, and their results are literals in the program. So a bake is
|
|
9
|
+
* hermetic by construction. It gets no network, no secrets and no
|
|
10
|
+
* capability except a stub for `nodetool.timelines`:
|
|
11
|
+
*
|
|
12
|
+
* - `create`/`setDocument` capture the document `v.save()` hands them.
|
|
13
|
+
* - `validate` answers `ok: true`. The caller writes the result through the
|
|
14
|
+
* real `set_timeline_document` path afterward, which validates for real.
|
|
15
|
+
* - `edit` records `v.save()`'s `ops`. This function applies them afterward
|
|
16
|
+
* with `applyOps`, the pure op applier `edit_timeline` uses, over an
|
|
17
|
+
* in-memory `TimelineSequence` that is never saved.
|
|
18
|
+
* - `code.set` answers that nothing was attached, so the `v.save()` inside
|
|
19
|
+
* a bake does not start a second bake.
|
|
20
|
+
* - `bakeAudioAnimation` (`el.react()`) needs a real decode and is refused.
|
|
21
|
+
*
|
|
22
|
+
* Any other capability call fails the bake and names the call. The bake runs
|
|
23
|
+
* on a copy of the context with no workspace, and `applyOps` runs without
|
|
24
|
+
* the hooks that write (a 3D render, a retargeted sequence). A bake reads
|
|
25
|
+
* assets and runs custom animation bodies. It writes nothing.
|
|
26
|
+
*/
|
|
27
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
28
|
+
import { type TimelineDocumentLike } from "@nodetool-ai/timeline";
|
|
29
|
+
/** Wall-clock ceiling on a bake. Building a document is arithmetic over a
|
|
30
|
+
* bounded scene list; anything slower is a runaway script, and a caller
|
|
31
|
+
* (an agent, or the editor) is waiting on this call. */
|
|
32
|
+
export declare const TIMELINE_CODE_BAKE_TIMEOUT_SECONDS = 20;
|
|
33
|
+
export interface BakeTimelineCodeResult {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
/** Present only when `ok`. */
|
|
36
|
+
document?: TimelineDocumentLike;
|
|
37
|
+
logs: string[];
|
|
38
|
+
error?: string;
|
|
39
|
+
duration_ms: number;
|
|
40
|
+
/**
|
|
41
|
+
* The retained program the code's own `v.save()` printed, when capture
|
|
42
|
+
* ran. Baking this program gives the same document again.
|
|
43
|
+
*/
|
|
44
|
+
retainedProgram?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `context` with every path to the run's workspace removed. The sandbox then
|
|
48
|
+
* gives the guest a `workspace` that refuses every call, and so does the
|
|
49
|
+
* sandbox a custom animation body runs in.
|
|
50
|
+
*/
|
|
51
|
+
export declare function hermeticBakeContext(context: ProcessingContext): ProcessingContext;
|
|
52
|
+
/**
|
|
53
|
+
* Run one timeline authoring script and return the document its `v.save()`
|
|
54
|
+
* call wrote. Returns rather than throws: a script that fails is a result to
|
|
55
|
+
* report to the caller (and, through it, the agent that wrote the code).
|
|
56
|
+
*/
|
|
57
|
+
export declare function bakeTimelineCode(hostContext: ProcessingContext, code: string): Promise<BakeTimelineCodeResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether `baked` — a fresh hermetic rebuild of some code — is the same
|
|
60
|
+
* timeline `saved` already is: every scene the two share hashes the same
|
|
61
|
+
* (`hashSceneSubtree`, the same identity check `mergeTimelineSource` uses to
|
|
62
|
+
* tell an untouched scene from a hand-edited one), the two name the same
|
|
63
|
+
* scenes, and everything outside a scene (passthrough clips, tracks, markers,
|
|
64
|
+
* tempo, camera2d, setup, mediaTracks) matches after the same normalization
|
|
65
|
+
* a bake already applies (`normalizeAuthoredDocument`, inside
|
|
66
|
+
* {@link bakeTimelineCode}).
|
|
67
|
+
*
|
|
68
|
+
* This is the gate for attaching the retained program `v.save()` printed:
|
|
69
|
+
* only when a hermetic bake of that program reproduces what was saved is it
|
|
70
|
+
* a faithful record of the document. A mismatch means the capture missed
|
|
71
|
+
* something (a scene clip changed after `v.series()`, a value computed with
|
|
72
|
+
* `Math.random()` or `Date.now()`).
|
|
73
|
+
*/
|
|
74
|
+
export declare function bakedDocumentMatchesSaved(saved: TimelineDocumentLike, baked: TimelineDocumentLike): boolean;
|
|
75
|
+
//# sourceMappingURL=timeline-code-bake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-code-bake.d.ts","sourceRoot":"","sources":["../src/timeline-code-bake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EAKL,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAG/B;;wDAEwD;AACxD,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAWD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CAUjF;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,iBAAiB,EAC9B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,sBAAsB,CAAC,CA6NjC;AAqDD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,oBAAoB,EAC3B,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAoBT"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bake a timeline's authoring code: run an `@nodetool-ai/sandbox-timeline`
|
|
3
|
+
* program once and hand back the `TimelineDocument` it built, without
|
|
4
|
+
* writing anywhere.
|
|
5
|
+
*
|
|
6
|
+
* The stored code is a retained program (docs/timeline-code-capture.md):
|
|
7
|
+
* research, generation and every other capability call ran once, in the
|
|
8
|
+
* author's run, and their results are literals in the program. So a bake is
|
|
9
|
+
* hermetic by construction. It gets no network, no secrets and no
|
|
10
|
+
* capability except a stub for `nodetool.timelines`:
|
|
11
|
+
*
|
|
12
|
+
* - `create`/`setDocument` capture the document `v.save()` hands them.
|
|
13
|
+
* - `validate` answers `ok: true`. The caller writes the result through the
|
|
14
|
+
* real `set_timeline_document` path afterward, which validates for real.
|
|
15
|
+
* - `edit` records `v.save()`'s `ops`. This function applies them afterward
|
|
16
|
+
* with `applyOps`, the pure op applier `edit_timeline` uses, over an
|
|
17
|
+
* in-memory `TimelineSequence` that is never saved.
|
|
18
|
+
* - `code.set` answers that nothing was attached, so the `v.save()` inside
|
|
19
|
+
* a bake does not start a second bake.
|
|
20
|
+
* - `bakeAudioAnimation` (`el.react()`) needs a real decode and is refused.
|
|
21
|
+
*
|
|
22
|
+
* Any other capability call fails the bake and names the call. The bake runs
|
|
23
|
+
* on a copy of the context with no workspace, and `applyOps` runs without
|
|
24
|
+
* the hooks that write (a 3D render, a retargeted sequence). A bake reads
|
|
25
|
+
* assets and runs custom animation bodies. It writes nothing.
|
|
26
|
+
*/
|
|
27
|
+
import { normalizeAuthoredDocument, hashSceneSubtree, sceneSubtreeClips } from "@nodetool-ai/timeline";
|
|
28
|
+
import { resolveImportedPacks } from "./sandbox-pack-resolution.js";
|
|
29
|
+
/** Wall-clock ceiling on a bake. Building a document is arithmetic over a
|
|
30
|
+
* bounded scene list; anything slower is a runaway script, and a caller
|
|
31
|
+
* (an agent, or the editor) is waiting on this call. */
|
|
32
|
+
export const TIMELINE_CODE_BAKE_TIMEOUT_SECONDS = 20;
|
|
33
|
+
const TIMELINE_STUB_METHODS = new Set([
|
|
34
|
+
"create_timeline",
|
|
35
|
+
"set_timeline_document",
|
|
36
|
+
"edit_timeline",
|
|
37
|
+
"validate_timeline",
|
|
38
|
+
"bake_audio_animation",
|
|
39
|
+
"set_timeline_code"
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* `context` with every path to the run's workspace removed. The sandbox then
|
|
43
|
+
* gives the guest a `workspace` that refuses every call, and so does the
|
|
44
|
+
* sandbox a custom animation body runs in.
|
|
45
|
+
*/
|
|
46
|
+
export function hermeticBakeContext(context) {
|
|
47
|
+
const refuse = (name) => () => {
|
|
48
|
+
throw new Error(`${name} is not available during a timeline code bake.`);
|
|
49
|
+
};
|
|
50
|
+
return Object.create(context, {
|
|
51
|
+
workspace: { value: null },
|
|
52
|
+
resolveWorkspacePath: { value: refuse("resolveWorkspacePath") },
|
|
53
|
+
assetToSandbox: { value: refuse("assetToSandbox") },
|
|
54
|
+
sandboxToAsset: { value: refuse("sandboxToAsset") }
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Run one timeline authoring script and return the document its `v.save()`
|
|
59
|
+
* call wrote. Returns rather than throws: a script that fails is a result to
|
|
60
|
+
* report to the caller (and, through it, the agent that wrote the code).
|
|
61
|
+
*/
|
|
62
|
+
export async function bakeTimelineCode(hostContext, code) {
|
|
63
|
+
const context = hermeticBakeContext(hostContext);
|
|
64
|
+
const started = Date.now();
|
|
65
|
+
const fail = (error, logs = []) => ({
|
|
66
|
+
ok: false,
|
|
67
|
+
error,
|
|
68
|
+
logs,
|
|
69
|
+
duration_ms: Date.now() - started
|
|
70
|
+
});
|
|
71
|
+
if (!code.trim()) {
|
|
72
|
+
return fail("The timeline's authoring code is empty.");
|
|
73
|
+
}
|
|
74
|
+
// The same fallback a chat session uses: a context built before the host
|
|
75
|
+
// installed its catalog still bakes against the process catalog.
|
|
76
|
+
const { getProcessSandboxModuleCatalog } = await import("@nodetool-ai/runtime");
|
|
77
|
+
const packs = resolveImportedPacks(code, context, {
|
|
78
|
+
subject: "The timeline's authoring code",
|
|
79
|
+
catalog: context.sandboxModuleCatalog ?? getProcessSandboxModuleCatalog()
|
|
80
|
+
});
|
|
81
|
+
if (!packs.ok) {
|
|
82
|
+
return fail(packs.error);
|
|
83
|
+
}
|
|
84
|
+
let captured;
|
|
85
|
+
let createCount = 0;
|
|
86
|
+
let createdFps;
|
|
87
|
+
let createdWidth;
|
|
88
|
+
let createdHeight;
|
|
89
|
+
let capturedOps;
|
|
90
|
+
let retainedProgram;
|
|
91
|
+
function timelineStubDispatch(name, args) {
|
|
92
|
+
switch (name) {
|
|
93
|
+
case "create_timeline": {
|
|
94
|
+
createCount += 1;
|
|
95
|
+
createdFps = typeof args["fps"] === "number" ? args["fps"] : undefined;
|
|
96
|
+
createdWidth =
|
|
97
|
+
typeof args["width"] === "number" ? args["width"] : undefined;
|
|
98
|
+
createdHeight =
|
|
99
|
+
typeof args["height"] === "number" ? args["height"] : undefined;
|
|
100
|
+
return { timeline_id: `bake:${createCount}` };
|
|
101
|
+
}
|
|
102
|
+
case "set_timeline_document": {
|
|
103
|
+
captured = args["document"];
|
|
104
|
+
return { written: true };
|
|
105
|
+
}
|
|
106
|
+
case "edit_timeline": {
|
|
107
|
+
// Recorded, not applied here: `v.save()` only checks
|
|
108
|
+
// `edit.failed`/`edit.ops`, so an empty success report lets the
|
|
109
|
+
// script finish (and its trailing `validate()` run against the
|
|
110
|
+
// still-unedited document, which is fine — the real validate below
|
|
111
|
+
// runs after ops are applied). Ops are applied host-side once the
|
|
112
|
+
// guest is done; see the file header.
|
|
113
|
+
capturedOps = Array.isArray(args["ops"]) ? args["ops"] : [];
|
|
114
|
+
return { failed: 0, ops: [] };
|
|
115
|
+
}
|
|
116
|
+
case "validate_timeline":
|
|
117
|
+
return { ok: true, errors: [], warnings: [] };
|
|
118
|
+
case "bake_audio_animation":
|
|
119
|
+
throw new Error("el.react() bakes an audio-reactive animation with a real decode " +
|
|
120
|
+
"call, which cannot run during a hermetic code bake. Remove " +
|
|
121
|
+
"el.react() from code stored as timeline source, or call " +
|
|
122
|
+
"bake_audio_animation separately after the code is set.");
|
|
123
|
+
case "set_timeline_code":
|
|
124
|
+
if (typeof args["code"] === "string")
|
|
125
|
+
retainedProgram = args["code"];
|
|
126
|
+
return { timeline_id: args["timeline_id"], embedded: false, warnings: [] };
|
|
127
|
+
default:
|
|
128
|
+
throw new Error(`unreachable: ${name} is not a stubbed timeline method`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
async function callTool(name, argsJson) {
|
|
132
|
+
try {
|
|
133
|
+
if (typeof name !== "string") {
|
|
134
|
+
return { ok: false, error: "callTool: name must be a string" };
|
|
135
|
+
}
|
|
136
|
+
const rawArgs = typeof argsJson === "string" && argsJson
|
|
137
|
+
? JSON.parse(argsJson)
|
|
138
|
+
: {};
|
|
139
|
+
if (TIMELINE_STUB_METHODS.has(name)) {
|
|
140
|
+
return { ok: true, result: timelineStubDispatch(name, rawArgs) };
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
ok: false,
|
|
144
|
+
error: `The code calls "${name}", which a rebake cannot run. Call it in ` +
|
|
145
|
+
"the run that builds the timeline and use its result: v.save() " +
|
|
146
|
+
"stores that result in the code as a value."
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
return {
|
|
151
|
+
ok: false,
|
|
152
|
+
error: error instanceof Error ? error.message : String(error)
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const { NODETOOL_PRELUDE } = await import("./sandbox-toolbelt.js");
|
|
157
|
+
const { listCapabilitySpecs } = await import("./capabilities/metadata.js");
|
|
158
|
+
// Every catalog name, not just the timeline stub's: a membership miss
|
|
159
|
+
// throws "not in this toolbelt" before `callTool` runs, which would hide
|
|
160
|
+
// the message naming the capability behind a confusing one.
|
|
161
|
+
const toolNames = listCapabilitySpecs().map((spec) => spec.name);
|
|
162
|
+
const { runInSandbox } = await import("./js-sandbox.js");
|
|
163
|
+
const result = await runInSandbox({
|
|
164
|
+
code: `${NODETOOL_PRELUDE}\n${code}`,
|
|
165
|
+
context,
|
|
166
|
+
timeoutMs: TIMELINE_CODE_BAKE_TIMEOUT_SECONDS * 1000,
|
|
167
|
+
globals: {
|
|
168
|
+
__toolNames: toolNames,
|
|
169
|
+
__toolModules: {},
|
|
170
|
+
__callTool: callTool
|
|
171
|
+
},
|
|
172
|
+
// Hermetic: no secrets, no network. `maxFetchCalls: 0` makes the
|
|
173
|
+
// guest's first raw `fetch()` fail rather than reach the network, so a
|
|
174
|
+
// build is a function of the code alone.
|
|
175
|
+
limits: { secretScope: [], maxFetchCalls: 0 },
|
|
176
|
+
modules: packs.modules
|
|
177
|
+
});
|
|
178
|
+
const logs = result.logs ?? [];
|
|
179
|
+
if (!result.success) {
|
|
180
|
+
return fail(result.error ?? "The timeline's authoring code failed.", logs);
|
|
181
|
+
}
|
|
182
|
+
if (!captured) {
|
|
183
|
+
return fail("The code ran without calling v.save(nodetool.timelines, {...}) — " +
|
|
184
|
+
"nothing was built.", logs);
|
|
185
|
+
}
|
|
186
|
+
// The real `nodetool.timelines.setDocument` (`set_timeline_document`'s
|
|
187
|
+
// impl) runs every document through `normalizeAuthoredDocument` before it
|
|
188
|
+
// is stored — filling in the schema's bookkeeping fields
|
|
189
|
+
// (track `index`/`visible`/`locked`, clip `sourceType`/`status`/`locked`/
|
|
190
|
+
// `versions`, animation ids) that a hand-authored or freshly-built document
|
|
191
|
+
// leaves out. `edit_timeline`'s `applyOps` then runs against that
|
|
192
|
+
// normalized, stored document, never the raw one `v.save()` built. A bake
|
|
193
|
+
// has to do the same normalization before its own `applyOps` call below —
|
|
194
|
+
// otherwise an op whose result depends on a field normalization fills in
|
|
195
|
+
// (`hashSceneSubtree` sees whatever `snap_to_beats` left the clip at)
|
|
196
|
+
// computes against a document shaped differently than what a real save
|
|
197
|
+
// would have produced, and its hash cannot match the shipped one.
|
|
198
|
+
captured = normalizeAuthoredDocument(captured).document;
|
|
199
|
+
if (capturedOps && capturedOps.length > 0) {
|
|
200
|
+
const { parseOps, applyOps } = await import("./capabilities/timeline-operations.js");
|
|
201
|
+
const { ungatedCapabilityRun } = await import("./capabilities/invoke.js");
|
|
202
|
+
const { TimelineSequence } = await import("@nodetool-ai/models");
|
|
203
|
+
const parsed = parseOps(capturedOps);
|
|
204
|
+
if ("error" in parsed) {
|
|
205
|
+
return fail(`v.save()'s \`ops\`: ${parsed.error}`, logs);
|
|
206
|
+
}
|
|
207
|
+
// Never saved: `applyOps` mutates nothing outside the bridge it builds
|
|
208
|
+
// over this row's fields, and `sequence.save()` is never called. The id
|
|
209
|
+
// only has to be a string — nothing looks it up.
|
|
210
|
+
const sequence = new TimelineSequence({
|
|
211
|
+
id: "bake",
|
|
212
|
+
user_id: context.userId ?? "bake",
|
|
213
|
+
project_id: "bake",
|
|
214
|
+
fps: createdFps ?? 30,
|
|
215
|
+
width: createdWidth ?? 1920,
|
|
216
|
+
height: createdHeight ?? 1080
|
|
217
|
+
});
|
|
218
|
+
const run = ungatedCapabilityRun(context);
|
|
219
|
+
const { records, state } = await applyOps(run, sequence, captured, parsed, { hermetic: true });
|
|
220
|
+
const failedOps = records.filter((record) => !record.ok);
|
|
221
|
+
if (failedOps.length > 0) {
|
|
222
|
+
return fail(`edit_timeline: ${JSON.stringify(failedOps, null, 2)}`, logs);
|
|
223
|
+
}
|
|
224
|
+
// Same merge `edit_timeline` writes back to the row with — see
|
|
225
|
+
// `editTimeline.impl` in `capabilities/timelines.ts`.
|
|
226
|
+
const next = {
|
|
227
|
+
...captured,
|
|
228
|
+
tracks: state.documentTracks,
|
|
229
|
+
clips: state.documentClips,
|
|
230
|
+
markers: state.markers
|
|
231
|
+
};
|
|
232
|
+
if (state.tempo)
|
|
233
|
+
next.tempo = state.tempo;
|
|
234
|
+
if (state.setup)
|
|
235
|
+
next.setup = state.setup;
|
|
236
|
+
if (state.mediaTracks.length > 0 ||
|
|
237
|
+
captured.mediaTracks !== undefined) {
|
|
238
|
+
next.mediaTracks = state.mediaTracks;
|
|
239
|
+
}
|
|
240
|
+
captured = next;
|
|
241
|
+
}
|
|
242
|
+
const baked = {
|
|
243
|
+
ok: true,
|
|
244
|
+
document: captured,
|
|
245
|
+
logs,
|
|
246
|
+
duration_ms: Date.now() - started
|
|
247
|
+
};
|
|
248
|
+
if (retainedProgram !== undefined)
|
|
249
|
+
baked.retainedProgram = retainedProgram;
|
|
250
|
+
return baked;
|
|
251
|
+
}
|
|
252
|
+
/** Scene group clips, keyed by `sourceScene`. Local to `sceneGroupsByName` in `@nodetool-ai/timeline`, which is not exported. */
|
|
253
|
+
function sceneGroupIdsByName(clips) {
|
|
254
|
+
const byName = new Map();
|
|
255
|
+
for (const clip of clips) {
|
|
256
|
+
if (typeof clip.sourceScene === "string" && clip.sourceScene !== "") {
|
|
257
|
+
byName.set(clip.sourceScene, clip.id);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return byName;
|
|
261
|
+
}
|
|
262
|
+
/** Every clip id belonging to one of `groups`' scene subtrees. */
|
|
263
|
+
function sceneClipIds(clips, groups) {
|
|
264
|
+
const ids = new Set();
|
|
265
|
+
for (const groupId of groups.values()) {
|
|
266
|
+
for (const clip of sceneSubtreeClips(clips, groupId))
|
|
267
|
+
ids.add(clip.id);
|
|
268
|
+
}
|
|
269
|
+
return ids;
|
|
270
|
+
}
|
|
271
|
+
/** A stable string for everything in a document outside its own scenes. */
|
|
272
|
+
function nonSceneFingerprint(document, sceneIds) {
|
|
273
|
+
const byId = (a, b) => a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
274
|
+
const outsideClips = document.clips
|
|
275
|
+
.filter((clip) => !sceneIds.has(clip.id))
|
|
276
|
+
.slice()
|
|
277
|
+
.sort(byId);
|
|
278
|
+
const record = document;
|
|
279
|
+
const markers = Array.isArray(record["markers"])
|
|
280
|
+
? [...record["markers"]].sort(byId)
|
|
281
|
+
: record["markers"] ?? null;
|
|
282
|
+
return JSON.stringify({
|
|
283
|
+
outsideClips,
|
|
284
|
+
tracks: record["tracks"] ?? null,
|
|
285
|
+
markers,
|
|
286
|
+
tempo: record["tempo"] ?? null,
|
|
287
|
+
camera2d: record["camera2d"] ?? null,
|
|
288
|
+
setup: record["setup"] ?? null,
|
|
289
|
+
mediaTracks: record["mediaTracks"] ?? null
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Whether `baked` — a fresh hermetic rebuild of some code — is the same
|
|
294
|
+
* timeline `saved` already is: every scene the two share hashes the same
|
|
295
|
+
* (`hashSceneSubtree`, the same identity check `mergeTimelineSource` uses to
|
|
296
|
+
* tell an untouched scene from a hand-edited one), the two name the same
|
|
297
|
+
* scenes, and everything outside a scene (passthrough clips, tracks, markers,
|
|
298
|
+
* tempo, camera2d, setup, mediaTracks) matches after the same normalization
|
|
299
|
+
* a bake already applies (`normalizeAuthoredDocument`, inside
|
|
300
|
+
* {@link bakeTimelineCode}).
|
|
301
|
+
*
|
|
302
|
+
* This is the gate for attaching the retained program `v.save()` printed:
|
|
303
|
+
* only when a hermetic bake of that program reproduces what was saved is it
|
|
304
|
+
* a faithful record of the document. A mismatch means the capture missed
|
|
305
|
+
* something (a scene clip changed after `v.series()`, a value computed with
|
|
306
|
+
* `Math.random()` or `Date.now()`).
|
|
307
|
+
*/
|
|
308
|
+
export function bakedDocumentMatchesSaved(saved, baked) {
|
|
309
|
+
const savedGroups = sceneGroupIdsByName(saved.clips);
|
|
310
|
+
const bakedGroups = sceneGroupIdsByName(baked.clips);
|
|
311
|
+
if (savedGroups.size !== bakedGroups.size)
|
|
312
|
+
return false;
|
|
313
|
+
for (const [name, savedGroupId] of savedGroups) {
|
|
314
|
+
const bakedGroupId = bakedGroups.get(name);
|
|
315
|
+
if (bakedGroupId === undefined)
|
|
316
|
+
return false;
|
|
317
|
+
if (hashSceneSubtree(saved.clips, savedGroupId) !==
|
|
318
|
+
hashSceneSubtree(baked.clips, bakedGroupId)) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const savedSceneIds = sceneClipIds(saved.clips, savedGroups);
|
|
323
|
+
const bakedSceneIds = sceneClipIds(baked.clips, bakedGroups);
|
|
324
|
+
return (nonSceneFingerprint(saved, savedSceneIds) ===
|
|
325
|
+
nonSceneFingerprint(baked, bakedSceneIds));
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=timeline-code-bake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-code-bake.js","sourceRoot":"","sources":["../src/timeline-code-bake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;wDAEwD;AACxD,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,CAAC;AAgBrD,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,iBAAiB;IACjB,uBAAuB;IACvB,eAAe;IACf,mBAAmB;IACnB,sBAAsB;IACtB,mBAAmB;CACpB,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,GAAG,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gDAAgD,CAAC,CAAC;IAC3E,CAAC,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;QAC5B,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;QAC1B,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,sBAAsB,CAAC,EAAE;QAC/D,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE;QACnD,cAAc,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE;KACpD,CAAsB,CAAC;AAC1B,CAAC;AAED;;;;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,GAAG,YAAY,CAAC,KAAK,CAAC,KAAuB,EAAE,WAAW,CAAC,CAAC;IAC/E,OAAO,CACL,mBAAmB,CAAC,KAAK,EAAE,aAAa,CAAC;QACzC,mBAAmB,CAAC,KAAK,EAAE,aAAa,CAAC,CAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -29,6 +29,8 @@ export interface RenderTimelineFramesOptions {
|
|
|
29
29
|
width?: number;
|
|
30
30
|
/** Resolve a clip's asset id to its encoded bytes, or null when unavailable. */
|
|
31
31
|
loadAsset: (assetId: string) => Promise<Uint8Array | null>;
|
|
32
|
+
/** Draw these clips only, while resolving their layout and animations against the full sequence. */
|
|
33
|
+
onlyClipIds?: readonly string[];
|
|
32
34
|
/**
|
|
33
35
|
* Average N sub-frame instants into every frame instead of sampling one (D10).
|
|
34
36
|
* Absent or one sample is blur off, which is what every caller that does not
|
|
@@ -134,12 +136,27 @@ export interface PreviewDroppedLayer {
|
|
|
134
136
|
/** Why the scene model refused it. */
|
|
135
137
|
reason: DroppedLayerReason;
|
|
136
138
|
}
|
|
139
|
+
/** A failure across the shutter window, separate from representative geometry. */
|
|
140
|
+
export interface PreviewSampleFailure {
|
|
141
|
+
kind: "skipped" | "dropped" | "degraded";
|
|
142
|
+
clip_id?: string;
|
|
143
|
+
clip_name?: string;
|
|
144
|
+
reason: string;
|
|
145
|
+
/** Every contributing sample affected by this failure. Index is zero-based. */
|
|
146
|
+
samples: {
|
|
147
|
+
index: number;
|
|
148
|
+
time_ms: number;
|
|
149
|
+
}[];
|
|
150
|
+
}
|
|
137
151
|
export interface PreviewFrame {
|
|
152
|
+
/** False when any requested visual content was skipped or approximated. */
|
|
153
|
+
complete: boolean;
|
|
138
154
|
time_ms: number;
|
|
139
155
|
/** PNG bytes of the composited frame. */
|
|
140
156
|
png: Uint8Array;
|
|
141
157
|
width: number;
|
|
142
158
|
height: number;
|
|
159
|
+
/** Geometry from the first contributing sample. See failures for the full window. */
|
|
143
160
|
layers: PreviewLayerReport[];
|
|
144
161
|
/**
|
|
145
162
|
* Clips the scene model left out of this frame. Empty on almost every
|
|
@@ -153,11 +170,20 @@ export interface PreviewFrame {
|
|
|
153
170
|
* degraded version of the one an export would produce.
|
|
154
171
|
*/
|
|
155
172
|
degraded: PreviewDegradation[];
|
|
173
|
+
/** Failures from every contributing sample, deduplicated with affected taps. */
|
|
174
|
+
failures: PreviewSampleFailure[];
|
|
156
175
|
}
|
|
157
176
|
export interface RenderTimelineFramesResult {
|
|
177
|
+
/** True only when every requested frame rendered without missing content. */
|
|
178
|
+
complete: boolean;
|
|
158
179
|
frames: PreviewFrame[];
|
|
159
180
|
/** Effect types present on the timeline that Canvas 2D cannot draw. */
|
|
160
181
|
effectsNotApplied: string[];
|
|
182
|
+
/**
|
|
183
|
+
* Families a text or caption layer names that are neither bundled nor
|
|
184
|
+
* resolvable from Google Fonts — drawn in the fallback face (D8).
|
|
185
|
+
*/
|
|
186
|
+
fontsUnavailable: string[];
|
|
161
187
|
}
|
|
162
188
|
/**
|
|
163
189
|
* Composite `timesMs` and return the PNG of each, plus what each layer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/timeline-preview/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"frames.d.ts","sourceRoot":"","sources":["../../src/timeline-preview/frames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAGL,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,WAAW,EAKX,yBAAyB,EAGzB,kBAAkB,EAClB,iBAAiB,EAGlB,MAAM,6BAA6B,CAAC;AA0ErC,MAAM,WAAW,2BAA2B;IAC1C,QAAQ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