@xrkseek/harness 0.4.2 → 0.4.4
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/a2a/README.md +43 -0
- package/node_modules/@xrkseek/a2a/dist/client.d.ts +35 -0
- package/node_modules/@xrkseek/a2a/dist/client.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/client.js +229 -0
- package/node_modules/@xrkseek/a2a/dist/client.js.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/inbound.d.ts +42 -0
- package/node_modules/@xrkseek/a2a/dist/inbound.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/inbound.js +263 -0
- package/node_modules/@xrkseek/a2a/dist/inbound.js.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/index.d.ts +6 -0
- package/node_modules/@xrkseek/a2a/dist/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/index.js +6 -0
- package/node_modules/@xrkseek/a2a/dist/index.js.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/peers.d.ts +25 -0
- package/node_modules/@xrkseek/a2a/dist/peers.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/peers.js +90 -0
- package/node_modules/@xrkseek/a2a/dist/peers.js.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.d.ts +45 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.js +172 -0
- package/node_modules/@xrkseek/a2a/dist/protocol.js.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/tools.d.ts +10 -0
- package/node_modules/@xrkseek/a2a/dist/tools.d.ts.map +1 -0
- package/node_modules/@xrkseek/a2a/dist/tools.js +145 -0
- package/node_modules/@xrkseek/a2a/dist/tools.js.map +1 -0
- package/node_modules/@xrkseek/a2a/package.json +28 -0
- package/node_modules/@xrkseek/attachment/README.md +23 -17
- package/node_modules/@xrkseek/attachment/dist/image-tokens.d.ts +30 -0
- package/node_modules/@xrkseek/attachment/dist/image-tokens.d.ts.map +1 -0
- package/node_modules/@xrkseek/attachment/dist/image-tokens.js +142 -0
- package/node_modules/@xrkseek/attachment/dist/image-tokens.js.map +1 -0
- package/node_modules/@xrkseek/attachment/dist/index.d.ts +2 -0
- package/node_modules/@xrkseek/attachment/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/index.js +2 -0
- package/node_modules/@xrkseek/attachment/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/request-projection.d.ts +20 -0
- package/node_modules/@xrkseek/attachment/dist/request-projection.d.ts.map +1 -0
- package/node_modules/@xrkseek/attachment/dist/request-projection.js +49 -0
- package/node_modules/@xrkseek/attachment/dist/request-projection.js.map +1 -0
- package/node_modules/@xrkseek/attachment-local/dist/request-image.d.ts +2 -11
- package/node_modules/@xrkseek/attachment-local/dist/request-image.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment-local/dist/request-image.js +3 -29
- package/node_modules/@xrkseek/attachment-local/dist/request-image.js.map +1 -1
- package/node_modules/@xrkseek/checkpoint/README.md +4 -2
- package/node_modules/@xrkseek/checkpoint/dist/process-git.d.ts +6 -0
- package/node_modules/@xrkseek/checkpoint/dist/process-git.d.ts.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/process-git.js +23 -1
- package/node_modules/@xrkseek/checkpoint/dist/process-git.js.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/store.d.ts +30 -2
- package/node_modules/@xrkseek/checkpoint/dist/store.d.ts.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/store.js +58 -15
- package/node_modules/@xrkseek/checkpoint/dist/store.js.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/types.d.ts +14 -4
- package/node_modules/@xrkseek/checkpoint/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/checkpoint/package.json +4 -1
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts +14 -0
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/context-fragments/dist/index.js +33 -0
- package/node_modules/@xrkseek/context-fragments/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts +7 -0
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.js +6 -0
- package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/compaction.js +1 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +18 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js +98 -50
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.d.ts +7 -2
- package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.js +7 -3
- package/node_modules/@xrkseek/core-agent-loop/dist/tool-result-bound.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts +23 -2
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js +50 -3
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/drain-hub.d.ts +2 -2
- package/node_modules/@xrkseek/core-session/dist/drain-hub.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/drain-hub.js +2 -2
- package/node_modules/@xrkseek/core-session/dist/drain-hub.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/core-session/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.js +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/latch.d.ts +25 -3
- package/node_modules/@xrkseek/core-session/dist/latch.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/latch.js +33 -12
- package/node_modules/@xrkseek/core-session/dist/latch.js.map +1 -1
- package/node_modules/@xrkseek/core-session/package.json +1 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/index.js +1 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/time-context.d.ts +22 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/time-context.d.ts.map +1 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/time-context.js +47 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/time-context.js.map +1 -0
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts +14 -0
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/definition.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.js +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/materialize.d.ts +9 -3
- package/node_modules/@xrkseek/core-tools/dist/materialize.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/materialize.js +38 -8
- package/node_modules/@xrkseek/core-tools/dist/materialize.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.d.ts +2 -0
- package/node_modules/@xrkseek/exec-computer-use/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.js +4 -1
- package/node_modules/@xrkseek/exec-computer-use/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-environment/README.md +21 -0
- package/node_modules/@xrkseek/exec-environment/dist/http.d.ts +34 -0
- package/node_modules/@xrkseek/exec-environment/dist/http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/http.js +259 -0
- package/node_modules/@xrkseek/exec-environment/dist/http.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.d.ts +5 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.js +4 -0
- package/node_modules/@xrkseek/exec-environment/dist/index.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/local.d.ts +11 -0
- package/node_modules/@xrkseek/exec-environment/dist/local.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/local.js +30 -0
- package/node_modules/@xrkseek/exec-environment/dist/local.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/resolve.d.ts +23 -0
- package/node_modules/@xrkseek/exec-environment/dist/resolve.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/resolve.js +39 -0
- package/node_modules/@xrkseek/exec-environment/dist/resolve.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/types.d.ts +33 -0
- package/node_modules/@xrkseek/exec-environment/dist/types.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-environment/dist/types.js +9 -0
- package/node_modules/@xrkseek/exec-environment/dist/types.js.map +1 -0
- package/node_modules/@xrkseek/exec-environment/package.json +28 -0
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.js +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/present.d.ts +5 -2
- package/node_modules/@xrkseek/exec-fs/dist/present.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/present.js +22 -4
- package/node_modules/@xrkseek/exec-fs/dist/present.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/README.md +6 -4
- package/node_modules/@xrkseek/exec-image-gen/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/format.js +6 -3
- package/node_modules/@xrkseek/exec-image-gen/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +4 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js +4 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/memory.d.ts +4 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/memory.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/memory.js +16 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/memory.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts +5 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js +88 -38
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/references.d.ts +21 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/references.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/references.js +145 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/references.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.d.ts +15 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.js +67 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/schema.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts +5 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +38 -36
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts +34 -2
- package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.js +16 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-memory/README.md +3 -2
- package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +2 -1
- package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/index.js +2 -1
- package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/provider.d.ts +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/provider.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/resolve.d.ts +15 -4
- package/node_modules/@xrkseek/exec-memory/dist/resolve.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/resolve.js +13 -3
- package/node_modules/@xrkseek/exec-memory/dist/resolve.js.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/sqlite.d.ts +19 -0
- package/node_modules/@xrkseek/exec-memory/dist/sqlite.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/sqlite.js +190 -0
- package/node_modules/@xrkseek/exec-memory/dist/sqlite.js.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts +21 -0
- package/node_modules/@xrkseek/exec-memory/dist/write-path.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/write-path.js +128 -25
- package/node_modules/@xrkseek/exec-memory/dist/write-path.js.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts +8 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js +3 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/README.md +27 -19
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts +16 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js +90 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/format.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/format.js +3 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/format.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts +5 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/index.js +5 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/memory.d.ts +3 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/memory.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/memory.js +45 -4
- package/node_modules/@xrkseek/exec-video-gen/dist/memory.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts +3 -6
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js +81 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/references.d.ts +24 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/references.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/references.js +151 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/references.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/schema.d.ts +15 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/schema.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/schema.js +104 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/schema.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts +4 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +99 -70
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts +73 -2
- package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.js +20 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/README.md +2 -2
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.d.ts +3 -0
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.js +3 -0
- package/node_modules/@xrkseek/exec-web/dist/browser-tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/browser-vault-tools.d.ts +32 -0
- package/node_modules/@xrkseek/exec-web/dist/browser-vault-tools.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/browser-vault-tools.js +141 -0
- package/node_modules/@xrkseek/exec-web/dist/browser-vault-tools.js.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.js +1 -0
- package/node_modules/@xrkseek/exec-web/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/llm-deepseek/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/index.js +2 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/request-policy.d.ts +13 -3
- package/node_modules/@xrkseek/llm-deepseek/dist/request-policy.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/request-policy.js +27 -4
- package/node_modules/@xrkseek/llm-deepseek/dist/request-policy.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/README.md +8 -8
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +11 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +11 -3
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/README.md +2 -2
- package/node_modules/@xrkseek/preset-minimal/dist/preset.js +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/README.md +5 -5
- package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js +3 -2
- package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +9 -0
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.js +9 -0
- package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
- package/node_modules/@xrkseek/server-config/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/server-config/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-config/dist/index.js +1 -0
- package/node_modules/@xrkseek/server-config/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-config/dist/json-text.d.ts +8 -0
- package/node_modules/@xrkseek/server-config/dist/json-text.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-config/dist/json-text.js +12 -0
- package/node_modules/@xrkseek/server-config/dist/json-text.js.map +1 -0
- package/node_modules/@xrkseek/server-cron/README.md +3 -2
- package/node_modules/@xrkseek/server-cron/dist/executions.d.ts +31 -0
- package/node_modules/@xrkseek/server-cron/dist/executions.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-cron/dist/executions.js +95 -0
- package/node_modules/@xrkseek/server-cron/dist/executions.js.map +1 -0
- package/node_modules/@xrkseek/server-cron/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/server-cron/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-cron/dist/index.js +6 -0
- package/node_modules/@xrkseek/server-cron/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-cron/dist/scheduler.d.ts +4 -0
- package/node_modules/@xrkseek/server-cron/dist/scheduler.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-cron/dist/scheduler.js +33 -24
- package/node_modules/@xrkseek/server-cron/dist/scheduler.js.map +1 -1
- package/node_modules/@xrkseek/server-cron/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-cron/dist/tools.js +44 -6
- package/node_modules/@xrkseek/server-cron/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts +2 -2
- package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +2 -0
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.d.ts +37 -2
- package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.js +191 -28
- package/node_modules/@xrkseek/server-face/dist/external-agent-runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +31 -5
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts +10 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js +33 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/host-open-path.d.ts +9 -0
- package/node_modules/@xrkseek/server-face/dist/host-open-path.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/host-open-path.js +13 -7
- package/node_modules/@xrkseek/server-face/dist/host-open-path.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-provider-context.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/llm-provider-context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-provider-context.js +13 -0
- package/node_modules/@xrkseek/server-face/dist/llm-provider-context.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-resolve.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-resolve.js +3 -1
- package/node_modules/@xrkseek/server-face/dist/llm-resolve.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts +4 -0
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js +24 -5
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/presets-catalog.js +5 -5
- package/node_modules/@xrkseek/server-face/dist/presets-catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.js +14 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/select-session-model.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/select-session-model.js +8 -0
- package/node_modules/@xrkseek/server-face/dist/select-session-model.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-model-store.d.ts +11 -0
- package/node_modules/@xrkseek/server-face/dist/session-model-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-model-store.js +66 -0
- package/node_modules/@xrkseek/server-face/dist/session-model-store.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +64 -13
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +173 -5
- package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +4 -5
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +36 -4
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js +33 -2
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts +15 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js +35 -7
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.d.ts +11 -0
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.js +22 -0
- package/node_modules/@xrkseek/server-host/dist/a2a-inbound-public.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/drain-status.d.ts +2 -2
- package/node_modules/@xrkseek/server-host/dist/drain-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/drain-status.js +2 -2
- package/node_modules/@xrkseek/server-host/dist/drain-status.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +19 -0
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +248 -33
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.js +3 -3
- package/node_modules/@xrkseek/server-host/dist/mcp-wire.js.map +1 -1
- package/node_modules/@xrkseek/server-host/package.json +2 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.d.ts +13 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.js +24 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/audit-community-client.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.d.ts +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.js +18 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-client-scan.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.d.ts +6 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js +26 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/dsh-compat-matrix.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/embedded-vector-store.d.ts +2 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/embedded-vector-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/embedded-vector-store.js +9 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/embedded-vector-store.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.d.ts +37 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.js +125 -9
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/memory-embeddings.js.map +1 -1
- package/node_modules/@xrkseek/spill/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/spill/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/spill/dist/index.js +1 -1
- package/node_modules/@xrkseek/spill/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/spill/dist/policy.d.ts +35 -0
- package/node_modules/@xrkseek/spill/dist/policy.d.ts.map +1 -1
- package/node_modules/@xrkseek/spill/dist/policy.js +45 -4
- package/node_modules/@xrkseek/spill/dist/policy.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.js +1 -0
- package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-curator.d.ts +46 -0
- package/node_modules/@xrkseek/workspace/dist/skill-curator.d.ts.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/skill-curator.js +114 -0
- package/node_modules/@xrkseek/workspace/dist/skill-curator.js.map +1 -0
- package/package.json +5 -1
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAI Videos API Provider (Sora): `POST /videos` → `GET /videos/{id}` →
|
|
3
|
+
* `GET /videos/{id}/content`, plus i2v (`input_reference`), edit
|
|
4
|
+
* (`POST /videos/edits`), and extend (`POST /videos/extensions`).
|
|
5
|
+
* @see https://developers.openai.com/api/docs/guides/video-generation
|
|
6
|
+
*/
|
|
7
|
+
import { OPENAI_VIDEO_GEN_CAPABILITIES } from "./catalog.js";
|
|
1
8
|
import { VideoGenError } from "./types.js";
|
|
2
9
|
const STATUSES = [
|
|
3
10
|
"queued",
|
|
@@ -8,7 +15,14 @@ const STATUSES = [
|
|
|
8
15
|
function joinUrl(base, path) {
|
|
9
16
|
return `${base.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
10
17
|
}
|
|
11
|
-
function
|
|
18
|
+
function extForMime(mime) {
|
|
19
|
+
if (mime === "image/jpeg")
|
|
20
|
+
return "jpg";
|
|
21
|
+
if (mime === "image/webp")
|
|
22
|
+
return "webp";
|
|
23
|
+
return "png";
|
|
24
|
+
}
|
|
25
|
+
function parseJob(json, extras) {
|
|
12
26
|
const row = (json ?? {});
|
|
13
27
|
const jobId = String(row.id ?? "").trim();
|
|
14
28
|
if (!jobId) {
|
|
@@ -36,6 +50,8 @@ function parseJob(json) {
|
|
|
36
50
|
provider: "openai",
|
|
37
51
|
delivery: "openai",
|
|
38
52
|
note: `openai-videos status=${status}`,
|
|
53
|
+
...(extras?.kind ? { kind: extras.kind } : {}),
|
|
54
|
+
...(extras?.modality ? { modality: extras.modality } : {}),
|
|
39
55
|
};
|
|
40
56
|
}
|
|
41
57
|
export function createOpenAiVideoGenProvider(options) {
|
|
@@ -44,6 +60,7 @@ export function createOpenAiVideoGenProvider(options) {
|
|
|
44
60
|
const model = options.model ?? "sora-2";
|
|
45
61
|
const defaultSeconds = options.defaultSeconds ?? 4;
|
|
46
62
|
const defaultSize = options.defaultSize ?? "1280x720";
|
|
63
|
+
const caps = options.capabilities ?? OPENAI_VIDEO_GEN_CAPABILITIES;
|
|
47
64
|
const auth = { Authorization: `Bearer ${options.apiKey}` };
|
|
48
65
|
const requireId = (jobId) => {
|
|
49
66
|
const id = String(jobId ?? "").trim();
|
|
@@ -63,17 +80,76 @@ export function createOpenAiVideoGenProvider(options) {
|
|
|
63
80
|
}
|
|
64
81
|
return parseJob(await res.json());
|
|
65
82
|
};
|
|
83
|
+
const postJson = async (path, body, kind) => {
|
|
84
|
+
const res = await fetchImpl(joinUrl(baseUrl, path), {
|
|
85
|
+
method: "POST",
|
|
86
|
+
headers: {
|
|
87
|
+
...auth,
|
|
88
|
+
"Content-Type": "application/json",
|
|
89
|
+
},
|
|
90
|
+
body: JSON.stringify(body),
|
|
91
|
+
});
|
|
92
|
+
if (!res.ok) {
|
|
93
|
+
const text = await res.text().catch(() => "");
|
|
94
|
+
throw new VideoGenError(`OpenAI ${path} HTTP ${res.status}: ${text.slice(0, 200)}`, "VIDEO_GEN_BACKEND");
|
|
95
|
+
}
|
|
96
|
+
return parseJob(await res.json(), { kind, modality: "text" });
|
|
97
|
+
};
|
|
66
98
|
return {
|
|
99
|
+
capabilities() {
|
|
100
|
+
return caps;
|
|
101
|
+
},
|
|
67
102
|
async create(req) {
|
|
68
103
|
const prompt = String(req.prompt ?? "").trim();
|
|
69
104
|
if (!prompt) {
|
|
70
105
|
throw new VideoGenError("prompt is empty", "VIDEO_GEN_BAD_ARGS");
|
|
71
106
|
}
|
|
107
|
+
const kind = req.kind ?? "generate";
|
|
108
|
+
if (kind === "edit") {
|
|
109
|
+
if (!caps.supportsEdit) {
|
|
110
|
+
throw new VideoGenError("OpenAI Provider configured without edit capability", "VIDEO_GEN_BAD_ARGS");
|
|
111
|
+
}
|
|
112
|
+
const sourceId = String(req.sourceVideoId ?? "").trim();
|
|
113
|
+
if (!sourceId) {
|
|
114
|
+
throw new VideoGenError("sourceVideoId is required for edit", "VIDEO_GEN_BAD_ARGS");
|
|
115
|
+
}
|
|
116
|
+
return postJson("videos/edits", { video: { id: sourceId }, prompt }, "edit");
|
|
117
|
+
}
|
|
118
|
+
if (kind === "extend") {
|
|
119
|
+
if (!caps.supportsExtend) {
|
|
120
|
+
throw new VideoGenError("OpenAI Provider configured without extend capability", "VIDEO_GEN_BAD_ARGS");
|
|
121
|
+
}
|
|
122
|
+
const sourceId = String(req.sourceVideoId ?? "").trim();
|
|
123
|
+
if (!sourceId) {
|
|
124
|
+
throw new VideoGenError("sourceVideoId is required for extend", "VIDEO_GEN_BAD_ARGS");
|
|
125
|
+
}
|
|
126
|
+
const body = {
|
|
127
|
+
video: { id: sourceId },
|
|
128
|
+
prompt,
|
|
129
|
+
seconds: String(req.seconds ?? defaultSeconds),
|
|
130
|
+
};
|
|
131
|
+
return postJson("videos/extensions", body, "extend");
|
|
132
|
+
}
|
|
133
|
+
// kind === generate (t2v / i2v)
|
|
134
|
+
const first = req.firstFrame;
|
|
135
|
+
const extras = req.referenceImages ?? [];
|
|
136
|
+
const stills = first ? [first, ...extras] : [...extras];
|
|
137
|
+
if (stills.length > 0 && caps.maxReferenceImages <= 0) {
|
|
138
|
+
throw new VideoGenError("OpenAI Provider configured without i2v capability", "VIDEO_GEN_BAD_ARGS");
|
|
139
|
+
}
|
|
140
|
+
if (stills.length > caps.maxReferenceImages) {
|
|
141
|
+
throw new VideoGenError(`at most ${caps.maxReferenceImages} reference image(s) for OpenAI i2v`, "VIDEO_GEN_BAD_ARGS");
|
|
142
|
+
}
|
|
72
143
|
const form = new FormData();
|
|
73
144
|
form.append("model", req.model ?? model);
|
|
74
145
|
form.append("prompt", prompt);
|
|
75
146
|
form.append("seconds", String(req.seconds ?? defaultSeconds));
|
|
76
147
|
form.append("size", req.size ?? defaultSize);
|
|
148
|
+
if (stills[0]) {
|
|
149
|
+
const src = stills[0];
|
|
150
|
+
const blob = new Blob([src.bytes], { type: src.mimeType });
|
|
151
|
+
form.append("input_reference", blob, `first_frame.${extForMime(src.mimeType)}`);
|
|
152
|
+
}
|
|
77
153
|
const res = await fetchImpl(joinUrl(baseUrl, "videos"), {
|
|
78
154
|
method: "POST",
|
|
79
155
|
headers: auth,
|
|
@@ -83,7 +159,10 @@ export function createOpenAiVideoGenProvider(options) {
|
|
|
83
159
|
const body = await res.text().catch(() => "");
|
|
84
160
|
throw new VideoGenError(`OpenAI videos HTTP ${res.status}: ${body.slice(0, 200)}`, "VIDEO_GEN_BACKEND");
|
|
85
161
|
}
|
|
86
|
-
return parseJob(await res.json()
|
|
162
|
+
return parseJob(await res.json(), {
|
|
163
|
+
kind: "generate",
|
|
164
|
+
modality: stills.length > 0 ? "image" : "text",
|
|
165
|
+
});
|
|
87
166
|
},
|
|
88
167
|
async get(jobId) {
|
|
89
168
|
return getJob(requireId(jobId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-http.js","sourceRoot":"","sources":["../src/openai-http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openai-http.js","sourceRoot":"","sources":["../src/openai-http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAa7D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAa3C,MAAM,QAAQ,GAA8B;IAC1C,QAAQ;IACR,aAAa;IACb,WAAW;I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K,CAAC,CAAC;YAC5B,qEAAqE;YACrE,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,EAAE,CAAC,CAAC;YAC7B,IAAI,GAAG,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;gBAC/B,MAAM,IAAI,aAAa,CACrB,aAAa,EAAE,OAAO,GAAG,CAAC,MAAM,iBAAiB,EACjD,qBAAqB,CACtB,CAAC;YACJ,CAAC;YACD,MAAM,GAAG,GAAG,MAAM,SAAS,CACzB,OAAO,CAAC,OAAO,EAAE,UAAU,kBAAkB,CAAC,EAAE,CAAC,UAAU,CAAC,EAC5D,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CACjC,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;gBACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,aAAa,CACrB,6BAA6B,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAChE,mBAAmB,CACpB,CAAC;YACJ,CAAC;YACD,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC;YACnC,OAAO;gBACL,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,CAAC;gBACzB,QAAQ,EAAE,WAAW;gBACrB,QAAQ,EAAE,QAAQ;gBAClB,IAAI,EAAE,uBAAuB,EAAE,CAAC,UAAU,EAAE;aAC7C,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve Hermes-style `image_url` / `first_frame` / `reference_image_urls` /
|
|
3
|
+
* attachment ids into decoded {@link VideoGenSourceImage} rows for i2v.
|
|
4
|
+
*/
|
|
5
|
+
import type { AttachmentStore } from "@xrkseek/attachment";
|
|
6
|
+
import { type VideoGenSourceImage } from "./types.js";
|
|
7
|
+
export interface ResolveVideoGenReferencesOptions {
|
|
8
|
+
/** Hermes / OpenAI first-frame alias. */
|
|
9
|
+
readonly firstFrame?: string;
|
|
10
|
+
/** Hermes `image_url` (same schemes as first_frame). */
|
|
11
|
+
readonly imageUrl?: string;
|
|
12
|
+
readonly referenceImageUrls?: readonly string[];
|
|
13
|
+
readonly referenceAttachmentIds?: readonly string[];
|
|
14
|
+
readonly attachments?: AttachmentStore;
|
|
15
|
+
readonly maxReferenceImages: number;
|
|
16
|
+
readonly fetchImpl?: typeof fetch;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Collect `first_frame` / `image_url` + refs + attachment ids.
|
|
20
|
+
* First non-empty of first_frame / image_url is the primary still (OpenAI
|
|
21
|
+
* `input_reference`). Throws when i2v is requested but maxReferenceImages === 0.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveVideoGenReferenceImages(options: ResolveVideoGenReferencesOptions): Promise<readonly VideoGenSourceImage[]>;
|
|
24
|
+
//# sourceMappingURL=references.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAoHrE,MAAM,WAAW,gCAAgC;IAC/C,yCAAyC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,wDAAwD;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChD,QAAQ,CAAC,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpD,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CA4EzC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve Hermes-style `image_url` / `first_frame` / `reference_image_urls` /
|
|
3
|
+
* attachment ids into decoded {@link VideoGenSourceImage} rows for i2v.
|
|
4
|
+
*/
|
|
5
|
+
import { VideoGenError } from "./types.js";
|
|
6
|
+
const ATTACHMENT_PREFIX = "attachment:";
|
|
7
|
+
function sniffMime(bytes, hint) {
|
|
8
|
+
if (hint === "image/jpeg" || hint === "image/png" || hint === "image/webp") {
|
|
9
|
+
return hint;
|
|
10
|
+
}
|
|
11
|
+
if (bytes.length >= 3 && bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
|
|
12
|
+
return "image/jpeg";
|
|
13
|
+
}
|
|
14
|
+
if (bytes.length >= 12 &&
|
|
15
|
+
bytes[0] === 0x52 &&
|
|
16
|
+
bytes[1] === 0x49 &&
|
|
17
|
+
bytes[2] === 0x46 &&
|
|
18
|
+
bytes[3] === 0x46) {
|
|
19
|
+
return "image/webp";
|
|
20
|
+
}
|
|
21
|
+
return "image/png";
|
|
22
|
+
}
|
|
23
|
+
function parseDataUrl(url) {
|
|
24
|
+
const match = /^data:(image\/(?:png|jpeg|jpg|webp));base64,(.+)$/iu.exec(url.trim());
|
|
25
|
+
if (!match) {
|
|
26
|
+
throw new VideoGenError("data: image_url must be image/png|jpeg|webp base64", "VIDEO_GEN_BAD_ARGS");
|
|
27
|
+
}
|
|
28
|
+
const mimeHint = match[1].toLowerCase().replace("image/jpg", "image/jpeg");
|
|
29
|
+
const bytes = Uint8Array.from(Buffer.from(match[2], "base64"));
|
|
30
|
+
if (bytes.byteLength === 0) {
|
|
31
|
+
throw new VideoGenError("empty data: image", "VIDEO_GEN_BAD_ARGS");
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
bytes,
|
|
35
|
+
mimeType: sniffMime(bytes, mimeHint),
|
|
36
|
+
label: "data-url",
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function fetchHttpImage(url, fetchImpl) {
|
|
40
|
+
let parsed;
|
|
41
|
+
try {
|
|
42
|
+
parsed = new URL(url);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
throw new VideoGenError(`invalid image_url: ${url.slice(0, 80)}`, "VIDEO_GEN_BAD_ARGS");
|
|
46
|
+
}
|
|
47
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
48
|
+
throw new VideoGenError("image_url must be http(s), data:, or attachment:<id>", "VIDEO_GEN_BAD_ARGS");
|
|
49
|
+
}
|
|
50
|
+
// Block obvious loopback / link-local SSRF (Hermes-style safety floor).
|
|
51
|
+
const host = parsed.hostname.toLowerCase();
|
|
52
|
+
if (host === "localhost" ||
|
|
53
|
+
host === "127.0.0.1" ||
|
|
54
|
+
host === "::1" ||
|
|
55
|
+
host === "0.0.0.0" ||
|
|
56
|
+
host.endsWith(".local") ||
|
|
57
|
+
host.startsWith("169.254.") ||
|
|
58
|
+
host.startsWith("10.") ||
|
|
59
|
+
/^192\.168\./u.test(host) ||
|
|
60
|
+
/^172\.(1[6-9]|2\d|3[0-1])\./u.test(host)) {
|
|
61
|
+
throw new VideoGenError(`image_url host blocked for SSRF safety: ${host}`, "VIDEO_GEN_BAD_ARGS");
|
|
62
|
+
}
|
|
63
|
+
const res = await fetchImpl(url);
|
|
64
|
+
if (!res.ok) {
|
|
65
|
+
throw new VideoGenError(`image_url fetch HTTP ${res.status}`, "VIDEO_GEN_BACKEND");
|
|
66
|
+
}
|
|
67
|
+
const buf = new Uint8Array(await res.arrayBuffer());
|
|
68
|
+
if (buf.byteLength === 0) {
|
|
69
|
+
throw new VideoGenError("image_url returned empty body", "VIDEO_GEN_BAD_ARGS");
|
|
70
|
+
}
|
|
71
|
+
const ct = res.headers.get("content-type")?.split(";")[0]?.trim();
|
|
72
|
+
return {
|
|
73
|
+
bytes: buf,
|
|
74
|
+
mimeType: sniffMime(buf, ct),
|
|
75
|
+
label: parsed.pathname.split("/").pop() || "http-image",
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
async function loadAttachment(id, attachments) {
|
|
79
|
+
const stored = await attachments.readImage(id);
|
|
80
|
+
return {
|
|
81
|
+
bytes: stored.data,
|
|
82
|
+
mimeType: sniffMime(stored.data, stored.ref.mediaType),
|
|
83
|
+
label: id,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Collect `first_frame` / `image_url` + refs + attachment ids.
|
|
88
|
+
* First non-empty of first_frame / image_url is the primary still (OpenAI
|
|
89
|
+
* `input_reference`). Throws when i2v is requested but maxReferenceImages === 0.
|
|
90
|
+
*/
|
|
91
|
+
export async function resolveVideoGenReferenceImages(options) {
|
|
92
|
+
const urls = [];
|
|
93
|
+
const primary = options.firstFrame?.trim() || options.imageUrl?.trim() || "";
|
|
94
|
+
if (primary)
|
|
95
|
+
urls.push(primary);
|
|
96
|
+
// If both first_frame and image_url were set and differ, keep the second as a ref.
|
|
97
|
+
const imageUrl = options.imageUrl?.trim();
|
|
98
|
+
const firstFrame = options.firstFrame?.trim();
|
|
99
|
+
if (firstFrame && imageUrl && firstFrame !== imageUrl) {
|
|
100
|
+
urls.push(imageUrl);
|
|
101
|
+
}
|
|
102
|
+
for (const raw of options.referenceImageUrls ?? []) {
|
|
103
|
+
const u = String(raw ?? "").trim();
|
|
104
|
+
if (u)
|
|
105
|
+
urls.push(u);
|
|
106
|
+
}
|
|
107
|
+
const attachmentIds = (options.referenceAttachmentIds ?? [])
|
|
108
|
+
.map((id) => String(id ?? "").trim())
|
|
109
|
+
.filter((id) => id.length > 0);
|
|
110
|
+
if (urls.length === 0 && attachmentIds.length === 0) {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
if (options.maxReferenceImages <= 0) {
|
|
114
|
+
throw new VideoGenError("This video Provider does not support first-frame / reference images (i2v). Omit first_frame, image_url and reference_* args, or switch Provider.", "VIDEO_GEN_BAD_ARGS");
|
|
115
|
+
}
|
|
116
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
117
|
+
const out = [];
|
|
118
|
+
for (const url of urls) {
|
|
119
|
+
if (out.length >= options.maxReferenceImages)
|
|
120
|
+
break;
|
|
121
|
+
if (url.startsWith("data:")) {
|
|
122
|
+
out.push(parseDataUrl(url));
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (url.startsWith(ATTACHMENT_PREFIX)) {
|
|
126
|
+
const id = url.slice(ATTACHMENT_PREFIX.length).trim();
|
|
127
|
+
if (!id) {
|
|
128
|
+
throw new VideoGenError("attachment: image_url missing id", "VIDEO_GEN_BAD_ARGS");
|
|
129
|
+
}
|
|
130
|
+
if (!options.attachments) {
|
|
131
|
+
throw new VideoGenError("attachment: references require Host AttachmentStore", "VIDEO_GEN_BAD_ARGS");
|
|
132
|
+
}
|
|
133
|
+
out.push(await loadAttachment(id, options.attachments));
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
out.push(await fetchHttpImage(url, fetchImpl));
|
|
137
|
+
}
|
|
138
|
+
for (const id of attachmentIds) {
|
|
139
|
+
if (out.length >= options.maxReferenceImages)
|
|
140
|
+
break;
|
|
141
|
+
if (!options.attachments) {
|
|
142
|
+
throw new VideoGenError("reference_attachment_ids require Host AttachmentStore", "VIDEO_GEN_BAD_ARGS");
|
|
143
|
+
}
|
|
144
|
+
out.push(await loadAttachment(id, options.attachments));
|
|
145
|
+
}
|
|
146
|
+
if (out.length > options.maxReferenceImages) {
|
|
147
|
+
throw new VideoGenError(`at most ${options.maxReferenceImages} reference image(s) allowed`, "VIDEO_GEN_BAD_ARGS");
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"references.js","sourceRoot":"","sources":["../src/references.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAA4B,MAAM,YAAY,CAAC;AAErE,MAAM,iBAAiB,GAAG,aAAa,CAAC;AAExC,SAAS,SAAS,CAChB,KAAiB,EACjB,IAAa;IAEb,IAAI,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC3E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACrF,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,IACE,KAAK,CAAC,MAAM,IAAI,EAAE;QAClB,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QACjB,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QACjB,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI;QACjB,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EACjB,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,YAAY,CAAC,GAAW;IAC/B,MAAM,KAAK,GAAG,qDAAqD,CAAC,IAAI,CACtE,GAAG,CAAC,IAAI,EAAE,CACX,CAAC;IACF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,aAAa,CACrB,oDAAoD,EACpD,oBAAoB,CACrB,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,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CAAC,kBAAkB;YAAE,MAAM;QACpD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACzB,MAAM,IAAI,aAAa,CACrB,uDAAuD,EACvD,oBAAoB,CACrB,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,MAAM,cAAc,CAAC,EAAE,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAC5C,MAAM,IAAI,aAAa,CACrB,WAAW,OAAO,CAAC,kBAAkB,6BAA6B,EAClE,oBAAoB,CACrB,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build model-facing tool parameters from Provider capabilities
|
|
3
|
+
* (Hermes `_build_dynamic_video_schema`).
|
|
4
|
+
*/
|
|
5
|
+
import { type VideoGenCapabilities } from "./types.js";
|
|
6
|
+
export interface VideoGenToolParameters {
|
|
7
|
+
readonly type: "object";
|
|
8
|
+
readonly properties: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Actions exposed given caps (edit/extend only when supported). */
|
|
11
|
+
export declare function videoGenActionsForCapabilities(caps: VideoGenCapabilities): readonly string[];
|
|
12
|
+
/** Static base + i2v / edit / extend args only when capabilities allow. */
|
|
13
|
+
export declare function buildVideoGenToolParameters(caps: VideoGenCapabilities): VideoGenToolParameters;
|
|
14
|
+
export declare function buildVideoGenToolDescription(caps: VideoGenCapabilities): string;
|
|
15
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAID,oEAAoE;AACpE,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,oBAAoB,GACzB,SAAS,MAAM,EAAE,CAKnB;AAED,2EAA2E;AAC3E,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,oBAAoB,GACzB,sBAAsB,CAyExB;AAED,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,oBAAoB,GACzB,MAAM,CAyBR"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build model-facing tool parameters from Provider capabilities
|
|
3
|
+
* (Hermes `_build_dynamic_video_schema`).
|
|
4
|
+
*/
|
|
5
|
+
import { VIDEO_GEN_SECONDS, VIDEO_GEN_SIZES } from "./catalog.js";
|
|
6
|
+
import { videoGenSupportsI2v, } from "./types.js";
|
|
7
|
+
const BASE_ACTIONS = ["start", "status", "content", "wait", "catalog"];
|
|
8
|
+
/** Actions exposed given caps (edit/extend only when supported). */
|
|
9
|
+
export function videoGenActionsForCapabilities(caps) {
|
|
10
|
+
const actions = [...BASE_ACTIONS];
|
|
11
|
+
if (caps.supportsEdit)
|
|
12
|
+
actions.push("edit");
|
|
13
|
+
if (caps.supportsExtend)
|
|
14
|
+
actions.push("extend");
|
|
15
|
+
return actions;
|
|
16
|
+
}
|
|
17
|
+
/** Static base + i2v / edit / extend args only when capabilities allow. */
|
|
18
|
+
export function buildVideoGenToolParameters(caps) {
|
|
19
|
+
const actions = videoGenActionsForCapabilities(caps);
|
|
20
|
+
const properties = {
|
|
21
|
+
action: {
|
|
22
|
+
type: "string",
|
|
23
|
+
enum: [...actions],
|
|
24
|
+
description: "start (default, t2v/i2v) | status | content | wait | catalog" +
|
|
25
|
+
(caps.supportsEdit ? " | edit" : "") +
|
|
26
|
+
(caps.supportsExtend ? " | extend" : "") +
|
|
27
|
+
". start needs `prompt`; status/content/wait need `job_id`; " +
|
|
28
|
+
"edit/extend need `job_id` (source) + `prompt`; catalog lists families.",
|
|
29
|
+
},
|
|
30
|
+
prompt: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Complete visual prompt for start/edit/extend (subject, motion, camera, lighting).",
|
|
33
|
+
},
|
|
34
|
+
job_id: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Job id from start (status/content/wait), or source video id for edit/extend.",
|
|
37
|
+
},
|
|
38
|
+
model: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Optional model / family override (e.g. sora-2, sora-2-pro). See action=catalog.",
|
|
41
|
+
},
|
|
42
|
+
seconds: {
|
|
43
|
+
type: "number",
|
|
44
|
+
enum: [...VIDEO_GEN_SECONDS],
|
|
45
|
+
description: "Clip duration in seconds (default 4; also used by extend).",
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
type: "string",
|
|
49
|
+
enum: [...VIDEO_GEN_SIZES],
|
|
50
|
+
description: "Output size (provider-dependent; default 1280x720).",
|
|
51
|
+
},
|
|
52
|
+
timeout_ms: {
|
|
53
|
+
type: "number",
|
|
54
|
+
description: "action=wait: give up after this long (default 120000).",
|
|
55
|
+
},
|
|
56
|
+
poll_interval_ms: {
|
|
57
|
+
type: "number",
|
|
58
|
+
description: "action=wait: poll spacing (default 10000).",
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
if (videoGenSupportsI2v(caps)) {
|
|
62
|
+
properties.first_frame = {
|
|
63
|
+
type: "string",
|
|
64
|
+
description: "First-frame still for image-to-video: https URL, data:image/…;base64,…, or attachment:<attachmentId>. Alias of image_url.",
|
|
65
|
+
};
|
|
66
|
+
properties.image_url = {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Hermes-compatible alias of first_frame (same schemes). Prefer first_frame when both are set as primary.",
|
|
69
|
+
};
|
|
70
|
+
properties.reference_image_urls = {
|
|
71
|
+
type: "array",
|
|
72
|
+
items: { type: "string" },
|
|
73
|
+
description: `Additional reference still URLs (same schemes). Max ${caps.maxReferenceImages} source(s) total (OpenAI first-frame = 1).`,
|
|
74
|
+
};
|
|
75
|
+
properties.reference_attachment_ids = {
|
|
76
|
+
type: "array",
|
|
77
|
+
items: { type: "string" },
|
|
78
|
+
description: "Host AttachmentStore image ids as first-frame / refs (preferred when already attached).",
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return { type: "object", properties };
|
|
82
|
+
}
|
|
83
|
+
export function buildVideoGenToolDescription(caps) {
|
|
84
|
+
const parts = [
|
|
85
|
+
"Generate a video via the Host video Provider. Renders are asynchronous: " +
|
|
86
|
+
"action=start (default) returns a jobId; poll with action=status (or action=wait); " +
|
|
87
|
+
"action=content downloads the MP4. action=catalog lists model families.",
|
|
88
|
+
];
|
|
89
|
+
if (videoGenSupportsI2v(caps)) {
|
|
90
|
+
parts.push(`With first_frame / image_url / reference_* (≤${caps.maxReferenceImages}) → image-to-video (first frame).`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
parts.push("This Provider is text-to-video only (no first-frame input).");
|
|
94
|
+
}
|
|
95
|
+
if (caps.supportsEdit) {
|
|
96
|
+
parts.push("action=edit: rewrite an existing completed video (job_id + prompt).");
|
|
97
|
+
}
|
|
98
|
+
if (caps.supportsExtend) {
|
|
99
|
+
parts.push("action=extend: continue a completed video (job_id + prompt; optional seconds).");
|
|
100
|
+
}
|
|
101
|
+
parts.push("The MP4 is saved to the Host attachment store when one is wired; video bytes are never inlined into tool text.");
|
|
102
|
+
return parts.join(" ");
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EACL,mBAAmB,G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AAC;IACD,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,KAAK,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CACR,gFAAgF,CACjF,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CACR,gHAAgH,CACjH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -17,12 +17,14 @@ export interface CreateVideoGenToolsOptions {
|
|
|
17
17
|
/** Injected sleep for `action=wait`; tests avoid real polling delays. */
|
|
18
18
|
readonly sleep?: (ms: number) => Promise<void>;
|
|
19
19
|
readonly now?: () => number;
|
|
20
|
+
readonly fetchImpl?: typeof fetch;
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
23
|
* Model-facing `video_generate` tool.
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* Static fields are an initial bake; `dynamicSchema` rebuilds from live
|
|
26
|
+
* Provider `capabilities()` on each materialize (Hermes get_definitions).
|
|
27
|
+
* Video renders are asynchronous: `start` → `status` / `wait` → `content`.
|
|
26
28
|
*/
|
|
27
29
|
export declare function createVideoGenTools(options?: CreateVideoGenToolsOptions): ToolDefinition[];
|
|
28
30
|
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D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