@xrkseek/harness 0.4.7 → 0.4.9
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/node_modules/@xrkseek/attachment/dist/error.d.ts +1 -1
- package/node_modules/@xrkseek/attachment/dist/error.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/error.js.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/image-region.d.ts +45 -0
- package/node_modules/@xrkseek/attachment/dist/image-region.d.ts.map +1 -0
- package/node_modules/@xrkseek/attachment/dist/image-region.js +64 -0
- package/node_modules/@xrkseek/attachment/dist/image-region.js.map +1 -0
- package/node_modules/@xrkseek/attachment/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/attachment/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/index.js +1 -0
- package/node_modules/@xrkseek/attachment/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/attachment/dist/store.d.ts +7 -0
- package/node_modules/@xrkseek/attachment/dist/store.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment-local/dist/crop-region.d.ts +10 -0
- package/node_modules/@xrkseek/attachment-local/dist/crop-region.d.ts.map +1 -0
- package/node_modules/@xrkseek/attachment-local/dist/crop-region.js +53 -0
- package/node_modules/@xrkseek/attachment-local/dist/crop-region.js.map +1 -0
- package/node_modules/@xrkseek/attachment-local/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/attachment-local/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/attachment-local/dist/index.js +3 -0
- package/node_modules/@xrkseek/attachment-local/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/cordis/LICENSE +21 -0
- package/node_modules/@xrkseek/cordis/README.md +14 -0
- package/node_modules/@xrkseek/cordis/bin.js +16 -0
- package/node_modules/@xrkseek/cordis/lib/index.js +1828 -0
- package/node_modules/@xrkseek/cordis/lib/types/context.d.ts +101 -0
- package/node_modules/@xrkseek/cordis/lib/types/context.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/events.d.ts +240 -0
- package/node_modules/@xrkseek/cordis/lib/types/events.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts +202 -0
- package/node_modules/@xrkseek/cordis/lib/types/fiber.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/index.d.ts +15 -0
- package/node_modules/@xrkseek/cordis/lib/types/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts +105 -0
- package/node_modules/@xrkseek/cordis/lib/types/logger.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts +186 -0
- package/node_modules/@xrkseek/cordis/lib/types/reflect.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts +201 -0
- package/node_modules/@xrkseek/cordis/lib/types/registry.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/service.d.ts +55 -0
- package/node_modules/@xrkseek/cordis/lib/types/service.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts +62 -0
- package/node_modules/@xrkseek/cordis/lib/types/utils.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/package.json +49 -0
- package/node_modules/@xrkseek/cordis/src/context.d.ts +101 -0
- package/node_modules/@xrkseek/cordis/src/context.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/context.js +99 -0
- package/node_modules/@xrkseek/cordis/src/context.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/context.ts +146 -0
- package/node_modules/@xrkseek/cordis/src/events.d.ts +240 -0
- package/node_modules/@xrkseek/cordis/src/events.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/events.js +199 -0
- package/node_modules/@xrkseek/cordis/src/events.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/events.ts +352 -0
- package/node_modules/@xrkseek/cordis/src/fiber.d.ts +202 -0
- package/node_modules/@xrkseek/cordis/src/fiber.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/fiber.js +677 -0
- package/node_modules/@xrkseek/cordis/src/fiber.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/fiber.ts +754 -0
- package/node_modules/@xrkseek/cordis/src/index.d.ts +15 -0
- package/node_modules/@xrkseek/cordis/src/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/index.js +15 -0
- package/node_modules/@xrkseek/cordis/src/index.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/index.ts +14 -0
- package/node_modules/@xrkseek/cordis/src/logger.d.ts +105 -0
- package/node_modules/@xrkseek/cordis/src/logger.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/logger.js +193 -0
- package/node_modules/@xrkseek/cordis/src/logger.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/logger.ts +270 -0
- package/node_modules/@xrkseek/cordis/src/reflect.d.ts +186 -0
- package/node_modules/@xrkseek/cordis/src/reflect.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/reflect.js +311 -0
- package/node_modules/@xrkseek/cordis/src/reflect.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/reflect.ts +418 -0
- package/node_modules/@xrkseek/cordis/src/registry.d.ts +201 -0
- package/node_modules/@xrkseek/cordis/src/registry.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/registry.js +218 -0
- package/node_modules/@xrkseek/cordis/src/registry.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/registry.ts +337 -0
- package/node_modules/@xrkseek/cordis/src/service.d.ts +55 -0
- package/node_modules/@xrkseek/cordis/src/service.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/service.js +113 -0
- package/node_modules/@xrkseek/cordis/src/service.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/service.ts +115 -0
- package/node_modules/@xrkseek/cordis/src/utils.d.ts +62 -0
- package/node_modules/@xrkseek/cordis/src/utils.d.ts.map +1 -0
- package/node_modules/@xrkseek/cordis/src/utils.js +271 -0
- package/node_modules/@xrkseek/cordis/src/utils.js.map +1 -0
- package/node_modules/@xrkseek/cordis/src/utils.ts +287 -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 +52 -73
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts +4 -3
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js +2 -1
- package/node_modules/@xrkseek/core-tools/dist/subagent-prompt.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.js +3 -0
- package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.d.ts +25 -0
- package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.js +107 -0
- package/node_modules/@xrkseek/exec-fs/dist/present-deliverable.js.map +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts +5 -0
- package/node_modules/@xrkseek/exec-fs/dist/read-image.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/read-image.js +55 -7
- package/node_modules/@xrkseek/exec-fs/dist/read-image.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/README.md +3 -3
- package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts +16 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/catalog.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js +152 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/catalog.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts +9 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js +21 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/deepinfra-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts +16 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js +189 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/fal-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts +10 -5
- package/node_modules/@xrkseek/exec-image-gen/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js +174 -18
- package/node_modules/@xrkseek/exec-image-gen/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts +16 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js +144 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/krea-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts +9 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js +21 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/meta-ai-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.d.ts +4 -1
- 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 +7 -5
- package/node_modules/@xrkseek/exec-image-gen/dist/openai-http.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts +14 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js +117 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/openrouter-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js +43 -6
- package/node_modules/@xrkseek/exec-image-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts +16 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js +137 -0
- package/node_modules/@xrkseek/exec-image-gen/dist/xai-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts +52 -0
- package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js +216 -0
- package/node_modules/@xrkseek/exec-memory/dist/consolidate-pipeline.js.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/index.js +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-memory/dist/tools.js +20 -7
- package/node_modules/@xrkseek/exec-memory/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-analyze/README.md +11 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/format.d.ts +3 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/format.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/format.js +10 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/format.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/index.d.ts +39 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/index.js +64 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/index.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.d.ts +22 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.js +70 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/materialize.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/memory.d.ts +8 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/memory.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/memory.js +21 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/memory.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/mime.d.ts +13 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/mime.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/mime.js +44 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/mime.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.d.ts +15 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.js +102 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/openai-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/tools.d.ts +24 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/tools.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/tools.js +120 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/tools.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/types.d.ts +30 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/types.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/types.js +16 -0
- package/node_modules/@xrkseek/exec-video-analyze/dist/types.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-analyze/package.json +26 -0
- package/node_modules/@xrkseek/exec-video-gen/README.md +3 -4
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts +14 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js +99 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/catalog.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts +9 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js +17 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/deepinfra-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts +14 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js +342 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/fal-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts +8 -6
- package/node_modules/@xrkseek/exec-video-gen/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/index.js +122 -19
- package/node_modules/@xrkseek/exec-video-gen/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.d.ts +4 -1
- 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 +21 -15
- package/node_modules/@xrkseek/exec-video-gen/dist/openai-http.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts +9 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js +18 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/openrouter-http.js.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js +26 -6
- package/node_modules/@xrkseek/exec-video-gen/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts +18 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js +263 -0
- package/node_modules/@xrkseek/exec-video-gen/dist/xai-http.js.map +1 -0
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +14 -0
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +48 -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-harness/package.json +1 -0
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.js +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts +12 -0
- package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/json-schema.js +23 -0
- package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +24 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.js +12 -0
- 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 +32 -0
- package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.d.ts +6 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.js +8 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/tool-view.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts +1 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js +15 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts +6 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js +16 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts +31 -0
- package/node_modules/@xrkseek/server-face/dist/agent-team-graph.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js +125 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-graph.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/approval-category.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/approval-category.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/approval-category.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts +19 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +3 -3
- 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/mcp-oauth.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js +25 -3
- package/node_modules/@xrkseek/server-face/dist/mcp-oauth.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/ralph-tool.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/ralph-tool.js +11 -5
- package/node_modules/@xrkseek/server-face/dist/ralph-tool.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 +8 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +16 -0
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +44 -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 +9 -0
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +55 -0
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-document.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-document.js +44 -0
- package/node_modules/@xrkseek/server-face/dist/settings-document.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 +34 -3
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +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 +191 -0
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js +8 -0
- package/node_modules/@xrkseek/server-face/dist/wire/rpc-error.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +7 -0
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +165 -23
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js +6 -0
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts +32 -0
- package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js +134 -0
- package/node_modules/@xrkseek/server-host/dist/workflow-engine-mount.js.map +1 -0
- package/node_modules/@xrkseek/server-host/package.json +3 -0
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js +20 -0
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-adapter.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts +10 -2
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-face-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/xrk-workflow/README.i18n.yaml +6 -0
- package/node_modules/@xrkseek/xrk-workflow/README.md +73 -0
- package/node_modules/@xrkseek/xrk-workflow/README.zh.md +72 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/index.d.ts +177 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/index.js +730 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.d.ts +13 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/invariant.js +118 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.d.ts +45 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/runtime-types.js +9 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/types.d.ts +118 -0
- package/node_modules/@xrkseek/xrk-workflow/lib/types/types.js +16 -0
- package/node_modules/@xrkseek/xrk-workflow/package.json +53 -0
- package/node_modules/@xrkseek/xrk-workflow/src/index.ts +947 -0
- package/package.json +7 -1
|
@@ -1,26 +1,100 @@
|
|
|
1
|
+
import { createDeepInfraImageGenProvider } from "./deepinfra-http.js";
|
|
2
|
+
import { createFalImageGenProvider } from "./fal-http.js";
|
|
3
|
+
import { createKreaImageGenProvider } from "./krea-http.js";
|
|
1
4
|
import { createMemoryImageGenProvider } from "./memory.js";
|
|
5
|
+
import { createMetaAiImageGenProvider } from "./meta-ai-http.js";
|
|
2
6
|
import { createOpenAiImageGenProvider } from "./openai-http.js";
|
|
7
|
+
import { createOpenRouterImageGenProvider } from "./openrouter-http.js";
|
|
8
|
+
import { createXaiImageGenProvider } from "./xai-http.js";
|
|
3
9
|
import { imageGenUnavailableMessage } from "./tools.js";
|
|
4
10
|
export { ImageGenError, IMAGE_GEN_CAPABILITIES_TEXT_ONLY, imageGenSupportsEdit, isImageGenError, resolveImageGenCapabilities, } from "./types.js";
|
|
11
|
+
export { FAL_IMAGE_DEFAULT_MODEL, FAL_IMAGE_MODELS, resolveFalImageModel, } from "./catalog.js";
|
|
5
12
|
export { IMAGE_GEN_PROMPT_TEXT } from "./format.js";
|
|
6
13
|
export { createMemoryImageGenProvider, minimalPngBytes, } from "./memory.js";
|
|
7
14
|
export { createOpenAiImageGenProvider, } from "./openai-http.js";
|
|
15
|
+
export { createFalImageGenProvider, } from "./fal-http.js";
|
|
16
|
+
export { createXaiImageGenProvider, } from "./xai-http.js";
|
|
17
|
+
export { createOpenRouterImageGenProvider, } from "./openrouter-http.js";
|
|
18
|
+
export { createDeepInfraImageGenProvider, } from "./deepinfra-http.js";
|
|
19
|
+
export { createKreaImageGenProvider, } from "./krea-http.js";
|
|
20
|
+
export { createMetaAiImageGenProvider, } from "./meta-ai-http.js";
|
|
8
21
|
export { createImageGenTools, imageGenUnavailableMessage, } from "./tools.js";
|
|
9
22
|
export { buildImageGenToolDescription, buildImageGenToolParameters, IMAGE_GEN_SIZES, } from "./schema.js";
|
|
10
23
|
export { resolveImageGenReferenceImages } from "./references.js";
|
|
11
|
-
|
|
24
|
+
/** Face `image-gen` product modes (Settings SoT). `memory` stays env-only. */
|
|
25
|
+
export const IMAGE_GEN_PRODUCT_MODES = [
|
|
26
|
+
"off",
|
|
27
|
+
"openai",
|
|
28
|
+
"fal",
|
|
29
|
+
"xai",
|
|
30
|
+
"openrouter",
|
|
31
|
+
"deepinfra",
|
|
32
|
+
"krea",
|
|
33
|
+
"meta-ai",
|
|
34
|
+
];
|
|
35
|
+
function resolveOpenAiKey(env) {
|
|
12
36
|
const a = String(env.XRK_IMAGE_GEN_OPENAI_KEY ?? "").trim();
|
|
13
37
|
if (a)
|
|
14
38
|
return a;
|
|
15
39
|
const b = String(env.OPENAI_API_KEY ?? "").trim();
|
|
16
40
|
return b || undefined;
|
|
17
41
|
}
|
|
42
|
+
function resolveFalKey(env) {
|
|
43
|
+
const a = String(env.XRK_IMAGE_GEN_FAL_KEY ?? "").trim();
|
|
44
|
+
if (a)
|
|
45
|
+
return a;
|
|
46
|
+
const b = String(env.FAL_KEY ?? "").trim();
|
|
47
|
+
return b || undefined;
|
|
48
|
+
}
|
|
49
|
+
function resolveXaiKey(env) {
|
|
50
|
+
const a = String(env.XRK_IMAGE_GEN_XAI_KEY ?? "").trim();
|
|
51
|
+
if (a)
|
|
52
|
+
return a;
|
|
53
|
+
const b = String(env.XAI_API_KEY ?? "").trim();
|
|
54
|
+
return b || undefined;
|
|
55
|
+
}
|
|
56
|
+
function resolveOpenRouterKey(env) {
|
|
57
|
+
const a = String(env.XRK_IMAGE_GEN_OPENROUTER_KEY ?? "").trim();
|
|
58
|
+
if (a)
|
|
59
|
+
return a;
|
|
60
|
+
const b = String(env.OPENROUTER_API_KEY ?? "").trim();
|
|
61
|
+
return b || undefined;
|
|
62
|
+
}
|
|
63
|
+
function resolveDeepInfraKey(env) {
|
|
64
|
+
const a = String(env.XRK_IMAGE_GEN_DEEPINFRA_KEY ?? "").trim();
|
|
65
|
+
if (a)
|
|
66
|
+
return a;
|
|
67
|
+
const b = String(env.DEEPINFRA_API_KEY ?? "").trim();
|
|
68
|
+
return b || undefined;
|
|
69
|
+
}
|
|
70
|
+
function resolveKreaKey(env) {
|
|
71
|
+
const a = String(env.XRK_IMAGE_GEN_KREA_KEY ?? "").trim();
|
|
72
|
+
if (a)
|
|
73
|
+
return a;
|
|
74
|
+
const b = String(env.KREA_API_KEY ?? "").trim();
|
|
75
|
+
return b || undefined;
|
|
76
|
+
}
|
|
77
|
+
function resolveMetaAiKey(env) {
|
|
78
|
+
const a = String(env.XRK_IMAGE_GEN_META_KEY ?? "").trim();
|
|
79
|
+
if (a)
|
|
80
|
+
return a;
|
|
81
|
+
for (const name of ["META_MODEL_API_KEY", "META_API_KEY", "MODEL_API_KEY"]) {
|
|
82
|
+
const v = String(env[name] ?? "").trim();
|
|
83
|
+
if (v)
|
|
84
|
+
return v;
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
function productModeFlag(product) {
|
|
89
|
+
const m = product?.mode;
|
|
90
|
+
if (m && m !== "off" && IMAGE_GEN_PRODUCT_MODES.includes(m)) {
|
|
91
|
+
return m;
|
|
92
|
+
}
|
|
93
|
+
return "";
|
|
94
|
+
}
|
|
18
95
|
/**
|
|
19
96
|
* Resolve an image Provider (t2i + edit when capabilities allow).
|
|
20
|
-
* -
|
|
21
|
-
* - Non-empty `XRK_IMAGE_GEN` is CI bypass over Face `product`.
|
|
22
|
-
* - Product / env: `off` · `openai` (`1`) · `memory` (env-only).
|
|
23
|
-
* - Else no service; tools stay registered and fail honestly.
|
|
97
|
+
* Hermes main-path matrix: openai · fal · xai · openrouter · deepinfra · krea · meta-ai (+ memory env).
|
|
24
98
|
*/
|
|
25
99
|
export function createDefaultImageGenAccess(options = {}) {
|
|
26
100
|
const env = options.env ?? process.env;
|
|
@@ -29,32 +103,114 @@ export function createDefaultImageGenAccess(options = {}) {
|
|
|
29
103
|
return { service: options.service, unavailableMessage };
|
|
30
104
|
}
|
|
31
105
|
const envRaw = String(env.XRK_IMAGE_GEN ?? "").trim();
|
|
32
|
-
const flag = envRaw !== ""
|
|
33
|
-
? envRaw.toLowerCase()
|
|
34
|
-
: options.product?.mode === "openai"
|
|
35
|
-
? "1"
|
|
36
|
-
: "";
|
|
106
|
+
const flag = envRaw !== "" ? envRaw.toLowerCase() : productModeFlag(options.product);
|
|
37
107
|
if (flag === "memory") {
|
|
38
108
|
return {
|
|
39
109
|
service: createMemoryImageGenProvider(),
|
|
40
110
|
unavailableMessage,
|
|
41
111
|
};
|
|
42
112
|
}
|
|
113
|
+
const baseUrl = options.product?.baseUrl?.trim() ||
|
|
114
|
+
String(env.XRK_IMAGE_GEN_BASE_URL ?? "").trim();
|
|
115
|
+
const model = options.product?.model?.trim() ||
|
|
116
|
+
String(env.XRK_IMAGE_GEN_MODEL ?? "").trim();
|
|
117
|
+
const fetchOpts = options.fetchImpl
|
|
118
|
+
? { fetchImpl: options.fetchImpl }
|
|
119
|
+
: {};
|
|
43
120
|
if (flag === "1" || flag === "openai") {
|
|
44
|
-
const apiKey =
|
|
45
|
-
if (!apiKey)
|
|
121
|
+
const apiKey = resolveOpenAiKey(env);
|
|
122
|
+
if (!apiKey)
|
|
46
123
|
return { unavailableMessage };
|
|
47
|
-
}
|
|
48
|
-
const baseUrl = options.product?.baseUrl?.trim() ||
|
|
49
|
-
String(env.XRK_IMAGE_GEN_BASE_URL ?? "").trim();
|
|
50
|
-
const model = options.product?.model?.trim() ||
|
|
51
|
-
String(env.XRK_IMAGE_GEN_MODEL ?? "").trim();
|
|
52
124
|
return {
|
|
53
125
|
service: createOpenAiImageGenProvider({
|
|
54
126
|
apiKey,
|
|
55
127
|
...(baseUrl ? { baseUrl } : {}),
|
|
56
128
|
...(model ? { model } : {}),
|
|
57
|
-
...
|
|
129
|
+
...fetchOpts,
|
|
130
|
+
}),
|
|
131
|
+
unavailableMessage,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (flag === "fal") {
|
|
135
|
+
const apiKey = resolveFalKey(env);
|
|
136
|
+
if (!apiKey)
|
|
137
|
+
return { unavailableMessage };
|
|
138
|
+
return {
|
|
139
|
+
service: createFalImageGenProvider({
|
|
140
|
+
apiKey,
|
|
141
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
142
|
+
...(model ? { model } : {}),
|
|
143
|
+
...fetchOpts,
|
|
144
|
+
}),
|
|
145
|
+
unavailableMessage,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (flag === "xai") {
|
|
149
|
+
const apiKey = resolveXaiKey(env);
|
|
150
|
+
if (!apiKey)
|
|
151
|
+
return { unavailableMessage };
|
|
152
|
+
return {
|
|
153
|
+
service: createXaiImageGenProvider({
|
|
154
|
+
apiKey,
|
|
155
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
156
|
+
...(model ? { model } : {}),
|
|
157
|
+
...fetchOpts,
|
|
158
|
+
}),
|
|
159
|
+
unavailableMessage,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (flag === "openrouter") {
|
|
163
|
+
const apiKey = resolveOpenRouterKey(env);
|
|
164
|
+
if (!apiKey)
|
|
165
|
+
return { unavailableMessage };
|
|
166
|
+
return {
|
|
167
|
+
service: createOpenRouterImageGenProvider({
|
|
168
|
+
apiKey,
|
|
169
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
170
|
+
...(model ? { model } : {}),
|
|
171
|
+
...fetchOpts,
|
|
172
|
+
}),
|
|
173
|
+
unavailableMessage,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (flag === "deepinfra") {
|
|
177
|
+
const apiKey = resolveDeepInfraKey(env);
|
|
178
|
+
if (!apiKey)
|
|
179
|
+
return { unavailableMessage };
|
|
180
|
+
return {
|
|
181
|
+
service: createDeepInfraImageGenProvider({
|
|
182
|
+
apiKey,
|
|
183
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
184
|
+
...(model ? { model } : {}),
|
|
185
|
+
...fetchOpts,
|
|
186
|
+
}),
|
|
187
|
+
unavailableMessage,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
if (flag === "krea") {
|
|
191
|
+
const apiKey = resolveKreaKey(env);
|
|
192
|
+
if (!apiKey)
|
|
193
|
+
return { unavailableMessage };
|
|
194
|
+
return {
|
|
195
|
+
service: createKreaImageGenProvider({
|
|
196
|
+
apiKey,
|
|
197
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
198
|
+
...(model ? { model } : {}),
|
|
199
|
+
...fetchOpts,
|
|
200
|
+
}),
|
|
201
|
+
unavailableMessage,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (flag === "meta-ai" || flag === "meta") {
|
|
205
|
+
const apiKey = resolveMetaAiKey(env);
|
|
206
|
+
if (!apiKey)
|
|
207
|
+
return { unavailableMessage };
|
|
208
|
+
return {
|
|
209
|
+
service: createMetaAiImageGenProvider({
|
|
210
|
+
apiKey,
|
|
211
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
212
|
+
...(model ? { model } : {}),
|
|
213
|
+
...fetchOpts,
|
|
58
214
|
}),
|
|
59
215
|
unavailableMessage,
|
|
60
216
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EACL,aAAa,EACb,gCAAgC,EAChC,oBAAoB,EACpB,eAAe,EACf,2BAA2B,GAU5B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,oBAAoB,GAErB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EACL,4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,SAAS,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;QAC3C,OAAO;YACL,OAAO,EAAE,4BAA4B,CAAC;gBACpC,MAAM;gBACN,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC3B,GAAG,SAAS;aACb,CAAC;YACF,kBAAkB;SACnB,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Krea 2 async image Provider (Hermes plugins/image_gen/krea).
|
|
3
|
+
* Submit → poll `/jobs/{id}` → download result URL.
|
|
4
|
+
*/
|
|
5
|
+
import type { ImageGenCapabilities, ImageGenService } from "./types.js";
|
|
6
|
+
export interface KreaImageGenOptions {
|
|
7
|
+
readonly apiKey: string;
|
|
8
|
+
readonly baseUrl?: string;
|
|
9
|
+
readonly fetchImpl?: typeof fetch;
|
|
10
|
+
readonly model?: string;
|
|
11
|
+
readonly pollIntervalMs?: number;
|
|
12
|
+
readonly timeoutMs?: number;
|
|
13
|
+
readonly capabilities?: ImageGenCapabilities;
|
|
14
|
+
}
|
|
15
|
+
export declare function createKreaImageGenProvider(options: KreaImageGenOptions): ImageGenService;
|
|
16
|
+
//# sourceMappingURL=krea-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"krea-http.d.ts","sourceRoot":"","sources":["../src/krea-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,oBAAoB,EAGpB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CAC9C;AAiCD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,GAC3B,eAAe,CAqJjB"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ImageGenError } from "./types.js";
|
|
2
|
+
const MODEL_PATHS = {
|
|
3
|
+
"krea-2-medium": "medium",
|
|
4
|
+
"krea-2-large": "large",
|
|
5
|
+
"krea-2-medium-turbo": "medium-turbo",
|
|
6
|
+
};
|
|
7
|
+
const DEFAULT_MODEL = "krea-2-medium";
|
|
8
|
+
const DEFAULT_CAPS = {
|
|
9
|
+
modalities: ["text", "image"],
|
|
10
|
+
maxReferenceImages: 10,
|
|
11
|
+
};
|
|
12
|
+
function sizeToAspect(size) {
|
|
13
|
+
switch (size) {
|
|
14
|
+
case "1792x1024":
|
|
15
|
+
return "16:9";
|
|
16
|
+
case "1024x1792":
|
|
17
|
+
return "9:16";
|
|
18
|
+
default:
|
|
19
|
+
return "1:1";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function bytesToDataUrl(img) {
|
|
23
|
+
return `data:${img.mimeType};base64,${Buffer.from(img.bytes).toString("base64")}`;
|
|
24
|
+
}
|
|
25
|
+
async function sleep(ms) {
|
|
26
|
+
await new Promise((r) => setTimeout(r, ms));
|
|
27
|
+
}
|
|
28
|
+
export function createKreaImageGenProvider(options) {
|
|
29
|
+
const baseUrl = (options.baseUrl ?? "https://api.krea.ai").replace(/\/+$/, "");
|
|
30
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
31
|
+
const model = options.model?.trim() || DEFAULT_MODEL;
|
|
32
|
+
const caps = options.capabilities ?? DEFAULT_CAPS;
|
|
33
|
+
const pollIntervalMs = options.pollIntervalMs ?? 2000;
|
|
34
|
+
const timeoutMs = options.timeoutMs ?? 180_000;
|
|
35
|
+
const auth = {
|
|
36
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
37
|
+
"User-Agent": "XRK-Harness/1.0 (krea-image-gen)",
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
capabilities() {
|
|
42
|
+
return caps;
|
|
43
|
+
},
|
|
44
|
+
async generate(req) {
|
|
45
|
+
const prompt = String(req.prompt ?? "").trim();
|
|
46
|
+
if (!prompt) {
|
|
47
|
+
throw new ImageGenError("prompt is empty", "IMAGE_GEN_BAD_ARGS");
|
|
48
|
+
}
|
|
49
|
+
const refs = req.referenceImages ?? [];
|
|
50
|
+
if (refs.length > caps.maxReferenceImages) {
|
|
51
|
+
throw new ImageGenError(`at most ${caps.maxReferenceImages} style reference(s) for Krea`, "IMAGE_GEN_BAD_ARGS");
|
|
52
|
+
}
|
|
53
|
+
const resolved = req.model?.trim() || model;
|
|
54
|
+
const pathSeg = MODEL_PATHS[resolved] ?? MODEL_PATHS[DEFAULT_MODEL];
|
|
55
|
+
const body = {
|
|
56
|
+
prompt,
|
|
57
|
+
aspect_ratio: sizeToAspect(req.size),
|
|
58
|
+
resolution: "1K",
|
|
59
|
+
creativity: "medium",
|
|
60
|
+
};
|
|
61
|
+
if (refs.length > 0) {
|
|
62
|
+
body.style_references = refs.map((img) => ({
|
|
63
|
+
url: bytesToDataUrl(img),
|
|
64
|
+
strength: 0.6,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
const submitRes = await fetchImpl(`${baseUrl}/generate/image/krea/${pathSeg}`, {
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: auth,
|
|
70
|
+
body: JSON.stringify(body),
|
|
71
|
+
});
|
|
72
|
+
const submitText = await submitRes.text().catch(() => "");
|
|
73
|
+
if (!submitRes.ok) {
|
|
74
|
+
throw new ImageGenError(`Krea submit HTTP ${submitRes.status}: ${submitText.slice(0, 200)}`, "IMAGE_GEN_BACKEND");
|
|
75
|
+
}
|
|
76
|
+
let submit;
|
|
77
|
+
try {
|
|
78
|
+
submit = JSON.parse(submitText);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
throw new ImageGenError("Krea submit was not JSON", "IMAGE_GEN_BACKEND");
|
|
82
|
+
}
|
|
83
|
+
const jobId = String(submit.job_id ?? submit.id ?? "").trim();
|
|
84
|
+
if (!jobId) {
|
|
85
|
+
throw new ImageGenError("Krea submit missing job_id", "IMAGE_GEN_BACKEND");
|
|
86
|
+
}
|
|
87
|
+
const deadline = Date.now() + timeoutMs;
|
|
88
|
+
let interval = pollIntervalMs;
|
|
89
|
+
while (Date.now() < deadline) {
|
|
90
|
+
await sleep(interval);
|
|
91
|
+
interval = Math.min(interval * 1.3, 5000);
|
|
92
|
+
const stRes = await fetchImpl(`${baseUrl}/jobs/${encodeURIComponent(jobId)}`, {
|
|
93
|
+
headers: auth,
|
|
94
|
+
});
|
|
95
|
+
const stText = await stRes.text().catch(() => "");
|
|
96
|
+
if (!stRes.ok) {
|
|
97
|
+
throw new ImageGenError(`Krea poll HTTP ${stRes.status}: ${stText.slice(0, 200)}`, "IMAGE_GEN_BACKEND");
|
|
98
|
+
}
|
|
99
|
+
let statusBody;
|
|
100
|
+
try {
|
|
101
|
+
statusBody = JSON.parse(stText);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
throw new ImageGenError("Krea poll was not JSON", "IMAGE_GEN_BACKEND");
|
|
105
|
+
}
|
|
106
|
+
const status = String(statusBody.status ?? statusBody.state ?? "").toLowerCase();
|
|
107
|
+
if (status === "completed" || status === "succeeded" || status === "success") {
|
|
108
|
+
const url = statusBody.result?.url?.trim() ||
|
|
109
|
+
statusBody.result?.image_url?.trim() ||
|
|
110
|
+
"";
|
|
111
|
+
if (!url) {
|
|
112
|
+
throw new ImageGenError("Krea completed without image URL", "IMAGE_GEN_BACKEND");
|
|
113
|
+
}
|
|
114
|
+
const imgRes = await fetchImpl(url);
|
|
115
|
+
if (!imgRes.ok) {
|
|
116
|
+
throw new ImageGenError(`Krea image download HTTP ${imgRes.status}`, "IMAGE_GEN_BACKEND");
|
|
117
|
+
}
|
|
118
|
+
const ab = await imgRes.arrayBuffer();
|
|
119
|
+
return {
|
|
120
|
+
images: [
|
|
121
|
+
{
|
|
122
|
+
bytes: new Uint8Array(ab),
|
|
123
|
+
mimeType: "image/png",
|
|
124
|
+
url,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
provider: "krea",
|
|
128
|
+
delivery: "krea",
|
|
129
|
+
modality: refs.length > 0 ? "image" : "text",
|
|
130
|
+
note: `krea-images model=${resolved} refs=${refs.length}`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (status === "failed" ||
|
|
134
|
+
status === "cancelled" ||
|
|
135
|
+
status === "canceled" ||
|
|
136
|
+
status === "error") {
|
|
137
|
+
throw new ImageGenError(`Krea job ${status}: ${statusBody.error ?? "no detail"}`, "IMAGE_GEN_BACKEND");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
throw new ImageGenError(`Krea timed out after ${timeoutMs}ms`, "IMAGE_GEN_BACKEND");
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=krea-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"krea-http.js","sourceRoot":"","sources":["../src/krea-http.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAY3C,MAAM,WAAW,GAAqC;IACp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,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;oBACpC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;wBACf,MAAM,IAAI,aAAa,CACrB,4BAA4B,MAAM,CAAC,MAAM,EAAE,EAC3C,mBAAmB,CACpB,CAAC;oBACJ,CAAC;oBACD,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAC;oBACtC,OAAO;wBACL,MAAM,EAAE;4BACN;gCACE,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,CAAC;gCACzB,QAAQ,EAAE,WAAW;gCACrB,GAAG;6BACJ;yBACF;wBACD,QAAQ,EAAE,MAAM;wBAChB,QAAQ,EAAE,MAAM;wBAChB,QAAQ,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;wBAC5C,IAAI,EAAE,qBAAqB,QAAQ,SAAS,IAAI,CAAC,MAAM,EAAE;qBAC1D,CAAC;gBACJ,CAAC;gBACD,IACE,MAAM,KAAK,QAAQ;oBACnB,MAAM,KAAK,WAAW;oBACtB,MAAM,KAAK,UAAU;oBACrB,MAAM,KAAK,OAAO,EAClB,CAAC;oBACD,MAAM,IAAI,aAAa,CACrB,YAAY,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,WAAW,EAAE,EACxD,mBAAmB,CACpB,CAAC;gBACJ,CAAC;YACH,CAAC;YACD,MAAM,IAAI,aAAa,CACrB,wBAAwB,SAAS,IAAI,EACrC,mBAAmB,CACpB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ImageGenService } from "./types.js";
|
|
2
|
+
export interface MetaAiImageGenOptions {
|
|
3
|
+
readonly apiKey: string;
|
|
4
|
+
readonly baseUrl?: string;
|
|
5
|
+
readonly fetchImpl?: typeof fetch;
|
|
6
|
+
readonly model?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function createMetaAiImageGenProvider(options: MetaAiImageGenOptions): ImageGenService;
|
|
9
|
+
//# sourceMappingURL=meta-ai-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-ai-http.d.ts","sourceRoot":"","sources":["../src/meta-ai-http.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAwB,eAAe,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAOD,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,qBAAqB,GAC7B,eAAe,CAUjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meta Model API Muse Image (Hermes meta-ai) — OpenAI-compatible `/images/generations`.
|
|
3
|
+
* Text-to-image only until Meta i2i is verified.
|
|
4
|
+
*/
|
|
5
|
+
import { createOpenAiImageGenProvider } from "./openai-http.js";
|
|
6
|
+
const TEXT_ONLY = {
|
|
7
|
+
modalities: ["text"],
|
|
8
|
+
maxReferenceImages: 0,
|
|
9
|
+
};
|
|
10
|
+
export function createMetaAiImageGenProvider(options) {
|
|
11
|
+
return createOpenAiImageGenProvider({
|
|
12
|
+
apiKey: options.apiKey,
|
|
13
|
+
baseUrl: options.baseUrl ?? "https://api.meta.ai/v1",
|
|
14
|
+
model: options.model ?? "muse-image-1.0",
|
|
15
|
+
capabilities: TEXT_ONLY,
|
|
16
|
+
delivery: "meta-ai",
|
|
17
|
+
providerName: "meta-ai",
|
|
18
|
+
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=meta-ai-http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-ai-http.js","sourceRoot":"","sources":["../src/meta-ai-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAUhE,MAAM,SAAS,GAAyB;IACtC,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,UAAU,4BAA4B,CAC1C,OAA8B;IAE9B,OAAO,4BAA4B,CAAC;QAClC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,wBAAwB;QACpD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,gBAAgB;QACxC,YAAY,EAAE,SAAS;QACvB,QAAQ,EAAE,SAAS;QACnB,YAAY,EAAE,SAAS;QACvB,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* OpenAI Images API Provider — `POST /images/generations` + `POST /images/edits`.
|
|
3
3
|
* Edit when `referenceImages` non-empty (Hermes openai plugin / Codex ImageGen edit).
|
|
4
4
|
*/
|
|
5
|
-
import type { ImageGenCapabilities, ImageGenService, ImageGenSize } from "./types.js";
|
|
5
|
+
import type { ImageGenCapabilities, ImageGenDelivery, ImageGenService, ImageGenSize } from "./types.js";
|
|
6
6
|
export interface OpenAiImageGenOptions {
|
|
7
7
|
readonly apiKey: string;
|
|
8
8
|
readonly baseUrl?: string;
|
|
@@ -11,6 +11,9 @@ export interface OpenAiImageGenOptions {
|
|
|
11
11
|
readonly defaultSize?: ImageGenSize;
|
|
12
12
|
/** Override capabilities (default: text+image, max 16 refs). */
|
|
13
13
|
readonly capabilities?: ImageGenCapabilities;
|
|
14
|
+
/** Result label (DeepInfra / Meta reuse this OpenAI-shaped client). */
|
|
15
|
+
readonly delivery?: ImageGenDelivery;
|
|
16
|
+
readonly providerName?: string;
|
|
14
17
|
}
|
|
15
18
|
export declare function createOpenAiImageGenProvider(options: OpenAiImageGenOptions): ImageGenService;
|
|
16
19
|
//# sourceMappingURL=openai-http.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai-http.d.ts","sourceRoot":"","sources":["../src/openai-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,oBAAoB,
|
|
1
|
+
{"version":3,"file":"openai-http.d.ts","sourceRoot":"","sources":["../src/openai-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAGhB,eAAe,EACf,YAAY,EAEb,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,CAAC;IACpC,gEAAgE;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;IAC7C,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAmDD,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,qBAAqB,GAC7B,eAAe,CAuGjB"}
|
|
@@ -39,6 +39,8 @@ export function createOpenAiImageGenProvider(options) {
|
|
|
39
39
|
const model = options.model ?? "dall-e-3";
|
|
40
40
|
const defaultSize = options.defaultSize ?? "1024x1024";
|
|
41
41
|
const caps = options.capabilities ?? DEFAULT_CAPS;
|
|
42
|
+
const delivery = options.delivery ?? "openai";
|
|
43
|
+
const providerName = options.providerName ?? "openai";
|
|
42
44
|
return {
|
|
43
45
|
capabilities() {
|
|
44
46
|
return caps;
|
|
@@ -51,7 +53,7 @@ export function createOpenAiImageGenProvider(options) {
|
|
|
51
53
|
const refs = req.referenceImages ?? [];
|
|
52
54
|
const isEdit = refs.length > 0;
|
|
53
55
|
if (isEdit && caps.maxReferenceImages <= 0) {
|
|
54
|
-
throw new ImageGenError(
|
|
56
|
+
throw new ImageGenError(`${providerName} Provider is text-to-image only; omit reference images`, "IMAGE_GEN_BAD_ARGS");
|
|
55
57
|
}
|
|
56
58
|
if (isEdit && refs.length > caps.maxReferenceImages) {
|
|
57
59
|
throw new ImageGenError(`at most ${caps.maxReferenceImages} reference image(s) for OpenAI edit`, "IMAGE_GEN_BAD_ARGS");
|
|
@@ -100,16 +102,16 @@ export function createOpenAiImageGenProvider(options) {
|
|
|
100
102
|
}
|
|
101
103
|
if (!res.ok) {
|
|
102
104
|
const body = await res.text().catch(() => "");
|
|
103
|
-
throw new ImageGenError(
|
|
105
|
+
throw new ImageGenError(`${providerName} images ${isEdit ? "edit" : "generations"} HTTP ${res.status}: ${body.slice(0, 200)}`, "IMAGE_GEN_BACKEND");
|
|
104
106
|
}
|
|
105
107
|
const json = (await res.json());
|
|
106
108
|
const images = parseOpenAiImageRows(json);
|
|
107
109
|
return {
|
|
108
110
|
images,
|
|
109
|
-
provider:
|
|
110
|
-
delivery
|
|
111
|
+
provider: providerName,
|
|
112
|
+
delivery,
|
|
111
113
|
modality: isEdit ? "image" : "text",
|
|
112
|
-
note:
|
|
114
|
+
note: `${providerName}-images ${isEdit ? "edit" : "generate"} model=${resolvedModel} n=${images.length} refs=${refs.length}`,
|
|
113
115
|
};
|
|
114
116
|
},
|
|
115
117
|
};
|
|
@@ -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,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAe3C,SAAS,OAAO,CAAC,IAAY,EAAE,IAAY;IACzC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;AACnE,CAAC;AAED,SAAS,UAAU,CAAC,IAAqC;IACvD,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,KAAK,CAAC;IACxC,IAAI,IAAI,KAAK,YAAY;QAAE,OAAO,MAAM,CAAC;IACzC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAC3B,IAEC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,aAAa,CACrB,qCAAqC,EACrC,mBAAmB,CACpB,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACtB,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YACjB,OAAO;gBACL,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAC3D,QAAQ,EAAE,WAAoB;gBAC9B,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACpE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EA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,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,aAAa,CACrB,GAAG,YAAY,WAAW,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,SAAS,GAAG,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EACrG,mBAAmB,CACpB,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAE7B,CAAC;YACF,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;YAC1C,OAAO;gBACL,MAAM;gBACN,QAAQ,EAAE,YAAY;gBACtB,QAAQ;gBACR,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM;gBACnC,IAAI,EAAE,GAAG,YAAY,WAAW,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,UAAU,aAAa,MAAM,MAAM,CAAC,MAAM,SAAS,IAAI,CAAC,MAAM,EAAE;aAC7H,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenRouter Dedicated Image API — `POST /images/generations` (Hermes openrouter).
|
|
3
|
+
* Supports reference images via `image_urls` when the selected model allows.
|
|
4
|
+
*/
|
|
5
|
+
import type { ImageGenCapabilities, ImageGenService } from "./types.js";
|
|
6
|
+
export interface OpenRouterImageGenOptions {
|
|
7
|
+
readonly apiKey: string;
|
|
8
|
+
readonly baseUrl?: string;
|
|
9
|
+
readonly fetchImpl?: typeof fetch;
|
|
10
|
+
readonly model?: string;
|
|
11
|
+
readonly capabilities?: ImageGenCapabilities;
|
|
12
|
+
}
|
|
13
|
+
export declare function createOpenRouterImageGenProvider(options: OpenRouterImageGenOptions): ImageGenService;
|
|
14
|
+
//# sourceMappingURL=openrouter-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openrouter-http.d.ts","sourceRoot":"","sources":["../src/openrouter-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,oBAAoB,EAGpB,eAAe,EAGhB,MAAM,YAAY,CAAC;AAGpB,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CAC9C;AAqDD,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,yBAAyB,GACjC,eAAe,CAiGjB"}
|