@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
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve Hermes-style `image_url` / `reference_image_urls` / attachment ids
|
|
3
|
+
* into decoded {@link ImageGenSourceImage} rows for Provider edit calls.
|
|
4
|
+
*/
|
|
5
|
+
import { ImageGenError } 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 ImageGenError("data: image_url must be image/png|jpeg|webp base64", "IMAGE_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 ImageGenError("empty data: image", "IMAGE_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 ImageGenError(`invalid image_url: ${url.slice(0, 80)}`, "IMAGE_GEN_BAD_ARGS");
|
|
46
|
+
}
|
|
47
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
48
|
+
throw new ImageGenError("image_url must be http(s), data:, or attachment:<id>", "IMAGE_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 ImageGenError(`image_url host blocked for SSRF safety: ${host}`, "IMAGE_GEN_BAD_ARGS");
|
|
62
|
+
}
|
|
63
|
+
const res = await fetchImpl(url);
|
|
64
|
+
if (!res.ok) {
|
|
65
|
+
throw new ImageGenError(`image_url fetch HTTP ${res.status}`, "IMAGE_GEN_BACKEND");
|
|
66
|
+
}
|
|
67
|
+
const buf = new Uint8Array(await res.arrayBuffer());
|
|
68
|
+
if (buf.byteLength === 0) {
|
|
69
|
+
throw new ImageGenError("image_url returned empty body", "IMAGE_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 primary `image_url` + `reference_image_urls` + attachment ids
|
|
88
|
+
* (Hermes `collect_source_images` order). Throws when edit is requested but
|
|
89
|
+
* `maxReferenceImages === 0`.
|
|
90
|
+
*/
|
|
91
|
+
export async function resolveImageGenReferenceImages(options) {
|
|
92
|
+
const urls = [];
|
|
93
|
+
const primary = options.imageUrl?.trim();
|
|
94
|
+
if (primary)
|
|
95
|
+
urls.push(primary);
|
|
96
|
+
for (const raw of options.referenceImageUrls ?? []) {
|
|
97
|
+
const u = String(raw ?? "").trim();
|
|
98
|
+
if (u)
|
|
99
|
+
urls.push(u);
|
|
100
|
+
}
|
|
101
|
+
const attachmentIds = (options.referenceAttachmentIds ?? [])
|
|
102
|
+
.map((id) => String(id ?? "").trim())
|
|
103
|
+
.filter((id) => id.length > 0);
|
|
104
|
+
if (urls.length === 0 && attachmentIds.length === 0) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
if (options.maxReferenceImages <= 0) {
|
|
108
|
+
throw new ImageGenError("This image Provider does not support reference images / edit. Omit image_url and reference_* args, or switch Provider.", "IMAGE_GEN_BAD_ARGS");
|
|
109
|
+
}
|
|
110
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
111
|
+
const out = [];
|
|
112
|
+
for (const url of urls) {
|
|
113
|
+
if (out.length >= options.maxReferenceImages)
|
|
114
|
+
break;
|
|
115
|
+
if (url.startsWith("data:")) {
|
|
116
|
+
out.push(parseDataUrl(url));
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (url.startsWith(ATTACHMENT_PREFIX)) {
|
|
120
|
+
const id = url.slice(ATTACHMENT_PREFIX.length).trim();
|
|
121
|
+
if (!id) {
|
|
122
|
+
throw new ImageGenError("attachment: image_url missing id", "IMAGE_GEN_BAD_ARGS");
|
|
123
|
+
}
|
|
124
|
+
if (!options.attachments) {
|
|
125
|
+
throw new ImageGenError("attachment: references require Host AttachmentStore", "IMAGE_GEN_BAD_ARGS");
|
|
126
|
+
}
|
|
127
|
+
out.push(await loadAttachment(id, options.attachments));
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
out.push(await fetchHttpImage(url, fetchImpl));
|
|
131
|
+
}
|
|
132
|
+
for (const id of attachmentIds) {
|
|
133
|
+
if (out.length >= options.maxReferenceImages)
|
|
134
|
+
break;
|
|
135
|
+
if (!options.attachments) {
|
|
136
|
+
throw new ImageGenError("reference_attachment_ids require Host AttachmentStore", "IMAGE_GEN_BAD_ARGS");
|
|
137
|
+
}
|
|
138
|
+
out.push(await loadAttachment(id, options.attachments));
|
|
139
|
+
}
|
|
140
|
+
if (out.length > options.maxReferenceImages) {
|
|
141
|
+
throw new ImageGenError(`at most ${options.maxReferenceImages} reference image(s) allowed`, "IMAGE_GEN_BAD_ARGS");
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +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C;AACb,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build model-facing tool parameters from Provider capabilities
|
|
3
|
+
* (Hermes `_build_dynamic_image_schema`).
|
|
4
|
+
*/
|
|
5
|
+
import { type ImageGenCapabilities, type ImageGenSize } from "./types.js";
|
|
6
|
+
export declare const IMAGE_GEN_SIZES: readonly ImageGenSize[];
|
|
7
|
+
export interface ImageGenToolParameters {
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly properties: Record<string, unknown>;
|
|
10
|
+
readonly required: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Static base + edit args only when `capabilities` support image refs. */
|
|
13
|
+
export declare function buildImageGenToolParameters(caps: ImageGenCapabilities): ImageGenToolParameters;
|
|
14
|
+
export declare function buildImageGenToolDescription(caps: ImageGenCapabilities): 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;AAEH,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAClB,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAMlD,CAAC;AAEF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC;AAED,2EAA2E;AAC3E,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,oBAAoB,GACzB,sBAAsB,CA8CxB;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAc/E"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build model-facing tool parameters from Provider capabilities
|
|
3
|
+
* (Hermes `_build_dynamic_image_schema`).
|
|
4
|
+
*/
|
|
5
|
+
import { imageGenSupportsEdit, } from "./types.js";
|
|
6
|
+
export const IMAGE_GEN_SIZES = [
|
|
7
|
+
"256x256",
|
|
8
|
+
"512x512",
|
|
9
|
+
"1024x1024",
|
|
10
|
+
"1792x1024",
|
|
11
|
+
"1024x1792",
|
|
12
|
+
];
|
|
13
|
+
/** Static base + edit args only when `capabilities` support image refs. */
|
|
14
|
+
export function buildImageGenToolParameters(caps) {
|
|
15
|
+
const properties = {
|
|
16
|
+
prompt: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Full visual description (text-to-image) or edit instruction (image-to-image).",
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: "string",
|
|
22
|
+
enum: [...IMAGE_GEN_SIZES],
|
|
23
|
+
description: "Output size (provider-dependent; default 1024x1024).",
|
|
24
|
+
},
|
|
25
|
+
n: {
|
|
26
|
+
type: "number",
|
|
27
|
+
description: "Number of images (1–4; dall-e-3 forces 1).",
|
|
28
|
+
},
|
|
29
|
+
model: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Optional model override (e.g. dall-e-3, gpt-image-1).",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
if (imageGenSupportsEdit(caps)) {
|
|
35
|
+
properties.image_url = {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Primary reference image for edit / i2i: https URL, data:image/…;base64,…, or attachment:<attachmentId>.",
|
|
38
|
+
};
|
|
39
|
+
properties.reference_image_urls = {
|
|
40
|
+
type: "array",
|
|
41
|
+
items: { type: "string" },
|
|
42
|
+
description: `Additional reference image URLs (same schemes as image_url). Max ${caps.maxReferenceImages} sources total.`,
|
|
43
|
+
};
|
|
44
|
+
properties.reference_attachment_ids = {
|
|
45
|
+
type: "array",
|
|
46
|
+
items: { type: "string" },
|
|
47
|
+
description: "Host AttachmentStore image ids to use as edit references (preferred over fetching URLs when already attached).",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties,
|
|
53
|
+
required: ["prompt"],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function buildImageGenToolDescription(caps) {
|
|
57
|
+
if (imageGenSupportsEdit(caps)) {
|
|
58
|
+
return ("Generate or edit an image via the Host image Provider. " +
|
|
59
|
+
"Text-only prompt → text-to-image; with image_url / reference_image_urls / " +
|
|
60
|
+
`reference_attachment_ids (≤${caps.maxReferenceImages}) → image edit. ` +
|
|
61
|
+
"Returns PNG base64 (truncated in tool text) and optional attachment id.");
|
|
62
|
+
}
|
|
63
|
+
return ("Generate an image from a text prompt via the Host text-to-image Provider. " +
|
|
64
|
+
"This Provider does not accept reference images. " +
|
|
65
|
+
"Returns PNG as base64 (truncated in tool text) and optional attachment id.");
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,GAGrB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,eAAe,GAA4B;IACtD,SAAS;IACT,SAAS;IACT,WAAW;IACX,WAAW;IACX,WAAW;CACZ,CAAC;AAQF,2EAA2E;AAC3E,MAAM,UAAU,2BAA2B,CACzC,IAA0B;IAE1B,MAAM,UAAU,GAA4B;QAC1C,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+EAA+E;SAClF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,GAAG,eAAe,CAAC;YAC1B,WAAW,EAAE,sDAAsD;SACpE;QACD,CAAC,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,4CAA4C;SAC1D;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uDAAuD;SACrE;KACF,CAAC;IAEF,IAAI,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,UAAU,CAAC,SAAS,GAAG;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,yGAAyG;SAC5G,CAAC;QACF,UAAU,CAAC,oBAAoB,GAAG;YAChC,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,WAAW,EAAE,oEAAoE,IAAI,CAAC,kBAAkB,iBAAiB;SAC1H,CAAC;QACF,UAAU,CAAC,wBAAwB,GAAG;YACpC,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,WAAW,EACT,gHAAgH;SACnH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,UAAU;QACV,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,IAA0B;IACrE,IAAI,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/B,OAAO,CACL,yDAAyD;YACzD,4EAA4E;YAC5E,8BAA8B,IAAI,CAAC,kBAAkB,kBAAkB;YACvE,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IACD,OAAO,CACL,4EAA4E;QAC5E,kDAAkD;QAClD,4EAA4E,CAC7E,CAAC;AACJ,CAAC"}
|
|
@@ -12,11 +12,14 @@ export interface CreateImageGenToolsOptions {
|
|
|
12
12
|
readonly product?: {
|
|
13
13
|
readonly mode?: string;
|
|
14
14
|
};
|
|
15
|
-
/** When set, persist generated images and
|
|
15
|
+
/** When set, persist generated images and resolve reference_attachment_ids. */
|
|
16
16
|
readonly attachments?: AttachmentStore;
|
|
17
|
+
readonly fetchImpl?: typeof fetch;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
* Model-facing `image_generate` tool (Hermes-style
|
|
20
|
+
* Model-facing `image_generate` tool (Hermes-style t2i + edit in one tool).
|
|
21
|
+
* Static fields are an initial bake; `dynamicSchema` rebuilds from live
|
|
22
|
+
* Provider `capabilities()` on each materialize (Hermes get_definitions).
|
|
20
23
|
*/
|
|
21
24
|
export declare function createImageGenTools(options?: CreateImageGenToolsOptions): ToolDefinition[];
|
|
22
25
|
//# 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;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,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,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAOpD,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,wBAAgB,0BAA0B,CACxC,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACnC,MAAM,CAuBR;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAgCD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,cAAc,EAAE,CAqGlB"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { IMAGE_GEN_PROMPT_TEXT } from "./format.js";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveImageGenReferenceImages } from "./references.js";
|
|
3
|
+
import { buildImageGenToolDescription, buildImageGenToolParameters, IMAGE_GEN_SIZES, } from "./schema.js";
|
|
4
|
+
import { ImageGenError, isImageGenError, resolveImageGenCapabilities, } from "./types.js";
|
|
3
5
|
export { IMAGE_GEN_PROMPT_TEXT };
|
|
4
|
-
const SIZES = [
|
|
5
|
-
"256x256",
|
|
6
|
-
"512x512",
|
|
7
|
-
"1024x1024",
|
|
8
|
-
"1792x1024",
|
|
9
|
-
"1024x1792",
|
|
10
|
-
];
|
|
11
6
|
export function imageGenUnavailableMessage(env = process.env, product) {
|
|
12
7
|
const envRaw = String(env.XRK_IMAGE_GEN ?? "").trim();
|
|
13
8
|
const flag = envRaw !== ""
|
|
@@ -36,44 +31,39 @@ function parseSize(raw) {
|
|
|
36
31
|
if (raw === undefined || raw === null || raw === "")
|
|
37
32
|
return undefined;
|
|
38
33
|
const s = String(raw).trim();
|
|
39
|
-
if (!
|
|
40
|
-
throw new ImageGenError(`size must be one of ${
|
|
34
|
+
if (!IMAGE_GEN_SIZES.includes(s)) {
|
|
35
|
+
throw new ImageGenError(`size must be one of ${IMAGE_GEN_SIZES.join(", ")}`, "IMAGE_GEN_BAD_ARGS");
|
|
41
36
|
}
|
|
42
37
|
return s;
|
|
43
38
|
}
|
|
39
|
+
function asStringList(raw) {
|
|
40
|
+
if (raw === undefined || raw === null)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (!Array.isArray(raw)) {
|
|
43
|
+
throw new ImageGenError("reference lists must be arrays of strings", "IMAGE_GEN_BAD_ARGS");
|
|
44
|
+
}
|
|
45
|
+
return raw.map((item) => String(item));
|
|
46
|
+
}
|
|
44
47
|
/**
|
|
45
|
-
* Model-facing `image_generate` tool (Hermes-style
|
|
48
|
+
* Model-facing `image_generate` tool (Hermes-style t2i + edit in one tool).
|
|
49
|
+
* Static fields are an initial bake; `dynamicSchema` rebuilds from live
|
|
50
|
+
* Provider `capabilities()` on each materialize (Hermes get_definitions).
|
|
46
51
|
*/
|
|
47
52
|
export function createImageGenTools(options = {}) {
|
|
48
53
|
const missing = imageGenUnavailableMessage(options.env ?? process.env, options.product);
|
|
49
54
|
const service = options.service;
|
|
50
55
|
const attachments = options.attachments;
|
|
56
|
+
const caps = resolveImageGenCapabilities(service);
|
|
51
57
|
const tool = {
|
|
52
58
|
name: "image_generate",
|
|
53
|
-
description:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
size: {
|
|
63
|
-
type: "string",
|
|
64
|
-
enum: [...SIZES],
|
|
65
|
-
description: "Output size (provider-dependent; default 1024x1024).",
|
|
66
|
-
},
|
|
67
|
-
n: {
|
|
68
|
-
type: "number",
|
|
69
|
-
description: "Number of images (1–4; dall-e-3 forces 1).",
|
|
70
|
-
},
|
|
71
|
-
model: {
|
|
72
|
-
type: "string",
|
|
73
|
-
description: "Optional model override (e.g. dall-e-3, gpt-image-1).",
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
required: ["prompt"],
|
|
59
|
+
description: buildImageGenToolDescription(caps),
|
|
60
|
+
parameters: buildImageGenToolParameters(caps),
|
|
61
|
+
dynamicSchema: () => {
|
|
62
|
+
const live = resolveImageGenCapabilities(service);
|
|
63
|
+
return {
|
|
64
|
+
description: buildImageGenToolDescription(live),
|
|
65
|
+
parameters: buildImageGenToolParameters(live),
|
|
66
|
+
};
|
|
77
67
|
},
|
|
78
68
|
presentCall: (args) => ({
|
|
79
69
|
card: "generic",
|
|
@@ -85,19 +75,31 @@ export function createImageGenTools(options = {}) {
|
|
|
85
75
|
if (!service)
|
|
86
76
|
return { content: missing, isError: true };
|
|
87
77
|
try {
|
|
78
|
+
const liveCaps = resolveImageGenCapabilities(service);
|
|
88
79
|
const prompt = String(args.prompt ?? "").trim();
|
|
89
80
|
const size = parseSize(args.size);
|
|
90
81
|
const n = typeof args.n === "number" && Number.isFinite(args.n)
|
|
91
82
|
? Math.trunc(args.n)
|
|
92
83
|
: undefined;
|
|
84
|
+
const refUrls = asStringList(args.reference_image_urls);
|
|
85
|
+
const refAttach = asStringList(args.reference_attachment_ids);
|
|
86
|
+
const referenceImages = await resolveImageGenReferenceImages({
|
|
87
|
+
maxReferenceImages: liveCaps.maxReferenceImages,
|
|
88
|
+
...(args.image_url ? { imageUrl: String(args.image_url) } : {}),
|
|
89
|
+
...(refUrls ? { referenceImageUrls: refUrls } : {}),
|
|
90
|
+
...(refAttach ? { referenceAttachmentIds: refAttach } : {}),
|
|
91
|
+
...(attachments ? { attachments } : {}),
|
|
92
|
+
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
93
|
+
});
|
|
93
94
|
const result = await service.generate({
|
|
94
95
|
prompt,
|
|
95
96
|
...(size ? { size } : {}),
|
|
96
97
|
...(n !== undefined ? { n } : {}),
|
|
97
98
|
...(args.model ? { model: String(args.model) } : {}),
|
|
99
|
+
...(referenceImages.length > 0 ? { referenceImages } : {}),
|
|
98
100
|
});
|
|
99
101
|
const lines = [
|
|
100
|
-
`provider=${result.provider} delivery=${result.delivery} images=${result.images.length}`,
|
|
102
|
+
`provider=${result.provider} delivery=${result.delivery} modality=${result.modality ?? "text"} images=${result.images.length}`,
|
|
101
103
|
];
|
|
102
104
|
if (result.note)
|
|
103
105
|
lines.push(`note=${result.note}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,aAAa,EACb,eAAe,EACf,2BAA2B,GAG5B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,MAAM,UAAU,0BAA0B,CACxC,MAAyB,OAAO,CAAC,GAAG,EACpC,OAAoC;IAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtD,MAAM,IAAI,GAAG,MAAM,KAAK,EAAE;QACxB,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE;QACtB,CAAC,CAAC,OAAO,EAAE,IAAI,KAAK,QAAQ;YAC1B,CAAC,CAAC,GAAG;YACL,CAAC,CAAC,EAAE,CAAC;IACT,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,CACL,qFAAqF;YACrF,mGAAmG;YACnG,wBAAwB,CACzB,CAAC;IACJ,CAAC;IACD,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,CACL,uFAAuF;YACvF,qEAAqE,CACtE,CAAC;IACJ,CAAC;IACD,OAAO,CACL,0FAA0F,CAC3F,CAAC;AACJ,CAAC;AAWD,SAAS,IAAI,CAAC,GAAY;IACxB,MAAM,OAAO,GAAG,eAAe,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AM,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;oBACtE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;oBACrC,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,QAAQ,UAAU,GAAG,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;oBACjE,IAAI,GAAG,CAAC,aAAa;wBAAE,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC;oBACzE,IAAI,GAAG,CAAC,GAAG;wBAAE,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;oBAC1C,IAAI,YAAY;wBAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,YAAY,EAAE,CAAC,CAAC;oBAC7D,KAAK,CAAC,IAAI,CAAC,gBAAgB,OAAO,EAAE,CAAC,CAAC;gBACxC,CAAC;gBACD,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;KACF,CAAC;IAEF,OAAO,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Text-to-image Provider seam — model tool `image_generate`.
|
|
2
|
+
* Text-to-image / image-to-image Provider seam — model tool `image_generate`.
|
|
3
|
+
* Aligns Hermes `image_gen` (single tool; refs select edit) + Codex ImageGen/Edit.
|
|
3
4
|
*/
|
|
4
5
|
export type ImageGenDelivery = "memory" | "openai" | "unavailable";
|
|
5
6
|
export type ImageGenErrorCode = "IMAGE_GEN_UNAVAILABLE" | "IMAGE_GEN_BAD_ARGS" | "IMAGE_GEN_BACKEND";
|
|
@@ -9,11 +10,33 @@ export declare class ImageGenError extends Error {
|
|
|
9
10
|
}
|
|
10
11
|
export declare function isImageGenError(err: unknown): err is ImageGenError;
|
|
11
12
|
export type ImageGenSize = "256x256" | "512x512" | "1024x1024" | "1792x1024" | "1024x1792";
|
|
13
|
+
/** One decoded source image for edit / i2i (Hermes `image_url` + refs). */
|
|
14
|
+
export interface ImageGenSourceImage {
|
|
15
|
+
readonly bytes: Uint8Array;
|
|
16
|
+
readonly mimeType: "image/png" | "image/jpeg" | "image/webp";
|
|
17
|
+
/** Optional label for logs (attachment id or URL stem). */
|
|
18
|
+
readonly label?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Provider capability surface (Hermes `capabilities()`).
|
|
22
|
+
* Tool schema is rebuilt from this — edit args appear only when supported.
|
|
23
|
+
*/
|
|
24
|
+
export interface ImageGenCapabilities {
|
|
25
|
+
/** `"text"` = t2i only; `"image"` = accepts reference images for edit. */
|
|
26
|
+
readonly modalities: readonly ("text" | "image")[];
|
|
27
|
+
/** Max source images for edit (OpenAI Images edit ≤16). 0 = t2i only. */
|
|
28
|
+
readonly maxReferenceImages: number;
|
|
29
|
+
}
|
|
12
30
|
export interface ImageGenRequest {
|
|
13
31
|
readonly prompt: string;
|
|
14
32
|
readonly size?: ImageGenSize;
|
|
15
33
|
readonly n?: number;
|
|
16
34
|
readonly model?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Decoded reference images (primary + extras). Non-empty → edit / i2i.
|
|
37
|
+
* Tools resolve URLs / attachment ids before calling the Provider.
|
|
38
|
+
*/
|
|
39
|
+
readonly referenceImages?: readonly ImageGenSourceImage[];
|
|
17
40
|
}
|
|
18
41
|
export interface ImageGenImage {
|
|
19
42
|
readonly bytes: Uint8Array;
|
|
@@ -26,12 +49,21 @@ export interface ImageGenResult {
|
|
|
26
49
|
readonly provider: string;
|
|
27
50
|
readonly delivery: ImageGenDelivery;
|
|
28
51
|
readonly note?: string;
|
|
52
|
+
/** `"text"` generation vs `"image"` edit (Hermes modality). */
|
|
53
|
+
readonly modality?: "text" | "image";
|
|
29
54
|
}
|
|
55
|
+
/** Text-only default when a Provider omits `capabilities()`. */
|
|
56
|
+
export declare const IMAGE_GEN_CAPABILITIES_TEXT_ONLY: ImageGenCapabilities;
|
|
57
|
+
export declare function imageGenSupportsEdit(caps: ImageGenCapabilities): boolean;
|
|
30
58
|
/**
|
|
31
|
-
* Definition: text-to-image Provider.
|
|
59
|
+
* Definition: text-to-image / edit Provider.
|
|
32
60
|
* Tools always register; missing Provider → honest execute error.
|
|
33
61
|
*/
|
|
34
62
|
export interface ImageGenService {
|
|
35
63
|
generate(req: ImageGenRequest): Promise<ImageGenResult>;
|
|
64
|
+
/** Optional; tools rebuild schema from this (Hermes dynamic schema). */
|
|
65
|
+
capabilities?(): ImageGenCapabilities;
|
|
36
66
|
}
|
|
67
|
+
/** Resolve caps with text-only fallback. */
|
|
68
|
+
export declare function resolveImageGenCapabilities(service: ImageGenService | undefined): ImageGenCapabilities;
|
|
37
69
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,GAAG,aAAa,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GACzB,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,CAAC;AAExB,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;gBAErB,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAuC;CAK3E;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa,CAElE;AAED,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT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vB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CACtC;AAED,gEAAgE;AAChE,eAAO,MAAM,gCAAgC,EAAE,oBAG9C,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAIxE;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxD,wEAAwE;IACxE,YAAY,CAAC,IAAI,oBAAoB,CAAC;CACvC;AAED,4CAA4C;AAC5C,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,eAAe,GAAG,SAAS,GACnC,oBAAoB,CAGtB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Text-to-image Provider seam — model tool `image_generate`.
|
|
2
|
+
* Text-to-image / image-to-image Provider seam — model tool `image_generate`.
|
|
3
|
+
* Aligns Hermes `image_gen` (single tool; refs select edit) + Codex ImageGen/Edit.
|
|
3
4
|
*/
|
|
4
5
|
export class ImageGenError extends Error {
|
|
5
6
|
code;
|
|
@@ -12,4 +13,18 @@ export class ImageGenError extends Error {
|
|
|
12
13
|
export function isImageGenError(err) {
|
|
13
14
|
return err instanceof ImageGenError;
|
|
14
15
|
}
|
|
16
|
+
/** Text-only default when a Provider omits `capabilities()`. */
|
|
17
|
+
export const IMAGE_GEN_CAPABILITIES_TEXT_ONLY = {
|
|
18
|
+
modalities: ["text"],
|
|
19
|
+
maxReferenceImages: 0,
|
|
20
|
+
};
|
|
21
|
+
export function imageGenSupportsEdit(caps) {
|
|
22
|
+
return (caps.maxReferenceImages > 0 && caps.modalities.includes("image"));
|
|
23
|
+
}
|
|
24
|
+
/** Resolve caps with text-only fallback. */
|
|
25
|
+
export function resolveImageGenCapabilities(service) {
|
|
26
|
+
if (!service?.capabilities)
|
|
27
|
+
return IMAGE_GEN_CAPABILITIES_TEXT_ONLY;
|
|
28
|
+
return service.capabilities();
|
|
29
|
+
}
|
|
15
30
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAC7B,IAAI,CAAoB;IAEjC,YAAY,OAAe,EAAE,OAA0B,mBAAmB;QACxE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,GAAG,YAAY,aAAa,CAAC;AACtC,CAAC;AAwDD,gEAAgE;AAChE,MAAM,CAAC,MAAM,gCAAgC,GAAyB;IACpE,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,IAA0B;IAC7D,OAAO,CACL,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CACjE,CAAC;AACJ,CAAC;AAYD,4CAA4C;AAC5C,MAAM,UAAU,2BAA2B,CACzC,OAAoC;IAEpC,IAAI,CAAC,OAAO,EAAE,YAAY;QAAE,OAAO,gCAAgC,CAAC;IACpE,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
Curated memory files frozen into the system prompt at session start.
|
|
4
4
|
|
|
5
5
|
- **Definition**: `CuratedMemoryStore` / `MemoryProvider` (`add` / `replace` / `remove`, plus an atomic batch)
|
|
6
|
-
- **Providers**: default **file** (`MEMORY.md` / `USER.md` under `{XRK_HOME}/memories`); optional **HTTP**
|
|
6
|
+
- **Providers**: default **file** (`MEMORY.md` / `USER.md` under `{XRK_HOME}/memories`); optional **HTTP** and **sqlite** samples
|
|
7
7
|
- **Consumer**: `createCuratedMemoryTools` → `memory`
|
|
8
|
+
- **Consolidate**: Phase1 heuristic session-end; optional Phase2 LLM extract (`consolidateCuratedMemoryPhase2`)
|
|
8
9
|
|
|
9
10
|
The prompt block is the snapshot taken when the store is created. Tool writes update the backend and leave that snapshot alone. This is not the Mnemon document library.
|
|
10
11
|
|
|
11
|
-
Select via `resolveMemoryProvider` / `XRK_MEMORY_PROVIDER=file|http` (+ `XRK_MEMORY_HTTP_URL`).
|
|
12
|
+
Select via `resolveMemoryProvider` / `XRK_MEMORY_PROVIDER=file|http|sqlite` (+ `XRK_MEMORY_HTTP_URL` for http).
|
|
12
13
|
|
|
13
14
|
See [docs/curated-memory.md](../../../docs/curated-memory.md).
|
|
@@ -2,6 +2,7 @@ export { createCuratedMemoryStore, defaultCuratedMemoryDir, ENTRY_DELIMITER, MEM
|
|
|
2
2
|
export type { MemoryProvider, MemoryProviderKind, } from "./provider.js";
|
|
3
3
|
export { createHttpMemoryProvider, HttpMemoryProviderError, probeHttpMemoryProvider, type HttpMemoryProviderOptions, } from "./http.js";
|
|
4
4
|
export { createFileMemoryProvider, resolveMemoryProvider, type ResolveMemoryProviderOptions, } from "./resolve.js";
|
|
5
|
+
export { createSqliteMemoryProvider, type SqliteMemoryProvider, type SqliteMemoryProviderOptions, } from "./sqlite.js";
|
|
5
6
|
export { CURATED_MEMORY_PROMPT_TEXT, createCuratedMemoryTools, } from "./tools.js";
|
|
6
|
-
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, noteCoveredByEntries, type TurnNoteInput, type TurnNoteWriteResult, type SessionEndConsolidateInput, } from "./write-path.js";
|
|
7
|
+
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, consolidateCuratedMemoryPhase2, buildPhase2ExtractPrompt, parsePhase2Notes, noteCoveredByEntries, type TurnNoteInput, type TurnNoteWriteResult, type SessionEndConsolidateInput, type SessionEndPhase2Input, type Phase2CompleteFn, } from "./write-path.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,4BAA4B,GAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,KAAK,+BAA+B,EACpC,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,UAAU,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,cAAc,EACd,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,4BAA4B,GAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createCuratedMemoryStore, defaultCuratedMemoryDir, ENTRY_DELIMITER, MEMORY_CHAR_LIMIT, USER_CHAR_LIMIT, } from "./store.js";
|
|
2
2
|
export { createHttpMemoryProvider, HttpMemoryProviderError, probeHttpMemoryProvider, } from "./http.js";
|
|
3
3
|
export { createFileMemoryProvider, resolveMemoryProvider, } from "./resolve.js";
|
|
4
|
+
export { createSqliteMemoryProvider, } from "./sqlite.js";
|
|
4
5
|
export { CURATED_MEMORY_PROMPT_TEXT, createCuratedMemoryTools, } from "./tools.js";
|
|
5
|
-
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, noteCoveredByEntries, } from "./write-path.js";
|
|
6
|
+
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, consolidateCuratedMemoryPhase2, buildPhase2ExtractPrompt, parsePhase2Notes, noteCoveredByEntries, } from "./write-path.js";
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAQhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GAExB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,eAAe,GAQhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,GAExB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,qBAAqB,GAEtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,GAG3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,GAMrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -15,5 +15,5 @@ export interface MemoryProvider extends CuratedMemoryStore {
|
|
|
15
15
|
/** Probe before wiring (Hermes `is_available`). */
|
|
16
16
|
isAvailable(): boolean | Promise<boolean>;
|
|
17
17
|
}
|
|
18
|
-
export type MemoryProviderKind = "file" | "http";
|
|
18
|
+
export type MemoryProviderKind = "file" | "http" | "sqlite";
|
|
19
19
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,WAAW,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,iDAAiD;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,WAAW,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|