@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
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-end curated-memory consolidate pipeline (Codex-style lease + Hermes status).
|
|
3
|
+
* Single-flight per session: archive/stop/dispose share one claim so Phase1 cannot double-write.
|
|
4
|
+
*/
|
|
5
|
+
import { mkdirSync, readFileSync, renameSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { consolidateCuratedMemoryPhase1, consolidateCuratedMemoryPhase2, } from "./write-path.js";
|
|
8
|
+
export const CONSOLIDATE_LEASE_FILE = ".consolidate-lease.json";
|
|
9
|
+
export const CONSOLIDATE_REPORT_FILE = ".last-consolidate.json";
|
|
10
|
+
const DEFAULT_TTL_MS = 120_000;
|
|
11
|
+
/** In-process claims keyed by session id (cross-call within one Host). */
|
|
12
|
+
const processClaims = new Map();
|
|
13
|
+
function leasePath(dir) {
|
|
14
|
+
return path.join(dir, CONSOLIDATE_LEASE_FILE);
|
|
15
|
+
}
|
|
16
|
+
function reportPath(dir) {
|
|
17
|
+
return path.join(dir, CONSOLIDATE_REPORT_FILE);
|
|
18
|
+
}
|
|
19
|
+
function newHolder() {
|
|
20
|
+
return `${process.pid}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
21
|
+
}
|
|
22
|
+
function leaseAlive(claim, now) {
|
|
23
|
+
return now - claim.at < claim.ttlMs;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Claim a consolidate slot for `sessionId`. Returns a release fn on success.
|
|
27
|
+
* Failures (busy / I/O) return `{ ok: false }`.
|
|
28
|
+
*/
|
|
29
|
+
export function tryClaimConsolidateLease(sessionId, options) {
|
|
30
|
+
const id = sessionId.trim();
|
|
31
|
+
if (!id)
|
|
32
|
+
return { ok: false };
|
|
33
|
+
const now = options?.now ?? Date.now();
|
|
34
|
+
const ttlMs = Math.max(5_000, options?.ttlMs ?? DEFAULT_TTL_MS);
|
|
35
|
+
const existing = processClaims.get(id);
|
|
36
|
+
if (existing && leaseAlive(existing, now))
|
|
37
|
+
return { ok: false };
|
|
38
|
+
const holder = newHolder();
|
|
39
|
+
processClaims.set(id, { holder, at: now, ttlMs });
|
|
40
|
+
const dir = options?.dir?.trim();
|
|
41
|
+
if (dir) {
|
|
42
|
+
try {
|
|
43
|
+
mkdirSync(dir, { recursive: true });
|
|
44
|
+
const file = leasePath(dir);
|
|
45
|
+
try {
|
|
46
|
+
const raw = JSON.parse(readFileSync(file, "utf8"));
|
|
47
|
+
if (raw &&
|
|
48
|
+
typeof raw.sessionId === "string" &&
|
|
49
|
+
raw.sessionId === id &&
|
|
50
|
+
typeof raw.at === "number" &&
|
|
51
|
+
typeof raw.ttlMs === "number" &&
|
|
52
|
+
leaseAlive(raw, now) &&
|
|
53
|
+
raw.holder !== holder) {
|
|
54
|
+
processClaims.delete(id);
|
|
55
|
+
return { ok: false };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
/* missing / corrupt → take */
|
|
60
|
+
}
|
|
61
|
+
const payload = { sessionId: id, holder, at: now, ttlMs };
|
|
62
|
+
const tmp = `${file}.${holder}.tmp`;
|
|
63
|
+
writeFileSync(tmp, JSON.stringify(payload), "utf8");
|
|
64
|
+
try {
|
|
65
|
+
renameSync(tmp, file);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
try {
|
|
69
|
+
unlinkSync(tmp);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
/* ignore */
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
writeFileSync(file, JSON.stringify(payload), "utf8");
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
processClaims.delete(id);
|
|
79
|
+
return { ok: false };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
processClaims.delete(id);
|
|
85
|
+
return { ok: false };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const release = () => {
|
|
89
|
+
const cur = processClaims.get(id);
|
|
90
|
+
if (cur?.holder === holder)
|
|
91
|
+
processClaims.delete(id);
|
|
92
|
+
if (!dir)
|
|
93
|
+
return;
|
|
94
|
+
try {
|
|
95
|
+
const raw = JSON.parse(readFileSync(leasePath(dir), "utf8"));
|
|
96
|
+
if (raw?.holder === holder)
|
|
97
|
+
unlinkSync(leasePath(dir));
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
/* ignore */
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return { ok: true, release };
|
|
104
|
+
}
|
|
105
|
+
/** Read the last consolidate report sidecar (if any). */
|
|
106
|
+
export function readConsolidateReport(dir) {
|
|
107
|
+
try {
|
|
108
|
+
const raw = JSON.parse(readFileSync(reportPath(dir), "utf8"));
|
|
109
|
+
if (!raw || typeof raw.sessionId !== "string" || typeof raw.at !== "number") {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
return raw;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
export function writeConsolidateReport(dir, report) {
|
|
119
|
+
try {
|
|
120
|
+
mkdirSync(dir, { recursive: true });
|
|
121
|
+
const file = reportPath(dir);
|
|
122
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
123
|
+
writeFileSync(tmp, JSON.stringify(report), "utf8");
|
|
124
|
+
try {
|
|
125
|
+
renameSync(tmp, file);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
writeFileSync(file, JSON.stringify(report), "utf8");
|
|
129
|
+
try {
|
|
130
|
+
unlinkSync(tmp);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
/* ignore */
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
/* best-effort observability */
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Lease → Phase1 → optional Phase2. Writes `.last-consolidate.json` beside the store.
|
|
143
|
+
*/
|
|
144
|
+
export async function runCuratedMemoryConsolidate(input) {
|
|
145
|
+
const now = input.now ?? Date.now();
|
|
146
|
+
const sessionId = input.sessionId.trim() || "unknown";
|
|
147
|
+
const base = {
|
|
148
|
+
sessionId,
|
|
149
|
+
at: now,
|
|
150
|
+
phase1Written: 0,
|
|
151
|
+
phase2: "skipped",
|
|
152
|
+
phase2Written: 0,
|
|
153
|
+
...(input.providerKind ? { providerKind: input.providerKind } : {}),
|
|
154
|
+
};
|
|
155
|
+
if (input.userTexts.length === 0) {
|
|
156
|
+
const report = {
|
|
157
|
+
...base,
|
|
158
|
+
skipped: "no-user-text",
|
|
159
|
+
};
|
|
160
|
+
writeConsolidateReport(input.store.dir, report);
|
|
161
|
+
return report;
|
|
162
|
+
}
|
|
163
|
+
const claim = tryClaimConsolidateLease(sessionId, {
|
|
164
|
+
dir: input.store.dir,
|
|
165
|
+
...(input.ttlMs !== undefined ? { ttlMs: input.ttlMs } : {}),
|
|
166
|
+
now,
|
|
167
|
+
});
|
|
168
|
+
if (!claim.ok) {
|
|
169
|
+
const report = {
|
|
170
|
+
...base,
|
|
171
|
+
skipped: "busy",
|
|
172
|
+
};
|
|
173
|
+
writeConsolidateReport(input.store.dir, report);
|
|
174
|
+
return report;
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
const phase1 = await consolidateCuratedMemoryPhase1(input.store, {
|
|
178
|
+
userTexts: input.userTexts,
|
|
179
|
+
});
|
|
180
|
+
let phase2 = "skipped";
|
|
181
|
+
let phase2Written = 0;
|
|
182
|
+
if (input.phase2Complete) {
|
|
183
|
+
try {
|
|
184
|
+
const phase2Result = await consolidateCuratedMemoryPhase2(input.store, {
|
|
185
|
+
userTexts: input.userTexts,
|
|
186
|
+
...(input.assistantTexts
|
|
187
|
+
? { assistantTexts: input.assistantTexts }
|
|
188
|
+
: {}),
|
|
189
|
+
complete: input.phase2Complete,
|
|
190
|
+
});
|
|
191
|
+
phase2Written = phase2Result.written.length;
|
|
192
|
+
phase2 = phase2Written > 0 ? "written" : "skipped";
|
|
193
|
+
}
|
|
194
|
+
catch {
|
|
195
|
+
phase2 = "failed";
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else if (input.phase2Requested) {
|
|
199
|
+
phase2 = "no-llm";
|
|
200
|
+
}
|
|
201
|
+
const report = {
|
|
202
|
+
sessionId,
|
|
203
|
+
at: Date.now(),
|
|
204
|
+
phase1Written: phase1.written.length,
|
|
205
|
+
phase2,
|
|
206
|
+
phase2Written,
|
|
207
|
+
...(input.providerKind ? { providerKind: input.providerKind } : {}),
|
|
208
|
+
};
|
|
209
|
+
writeConsolidateReport(input.store.dir, report);
|
|
210
|
+
return report;
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
claim.release();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=consolidate-pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consolidate-pipeline.js","sourceRoot":"","sources":["../src/consolidate-pipeline.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAE/B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAC;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAEhE,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,0EAA0E;AAC1E,MAAM,aAAa,GAAG,IAAI,GAAG,EAAyD,CAAC;AAyBvF,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC/F,CAAC;AAED,SAAS,UAAU,CACjB,KAAoC,EACpC,GAAW;I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AAS,CAAC,CAAC,CAAC,SAAS,CAAC;YACrD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,GAAG,QAAQ,CAAC;YACpB,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;YACjC,MAAM,GAAG,QAAQ,CAAC;QACpB,CAAC;QAED,MAAM,MAAM,GAAmC;YAC7C,SAAS;YACT,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE;YACd,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;YACpC,MAAM;YACN,aAAa;YACb,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpE,CAAC;QACF,sBAAsB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -4,5 +4,6 @@ export { createHttpMemoryProvider, HttpMemoryProviderError, probeHttpMemoryProvi
|
|
|
4
4
|
export { createFileMemoryProvider, resolveMemoryProvider, type ResolveMemoryProviderOptions, } from "./resolve.js";
|
|
5
5
|
export { createSqliteMemoryProvider, type SqliteMemoryProvider, type SqliteMemoryProviderOptions, } from "./sqlite.js";
|
|
6
6
|
export { CURATED_MEMORY_PROMPT_TEXT, createCuratedMemoryTools, } from "./tools.js";
|
|
7
|
+
export { CONSOLIDATE_LEASE_FILE, CONSOLIDATE_REPORT_FILE, tryClaimConsolidateLease, readConsolidateReport, writeConsolidateReport, runCuratedMemoryConsolidate, type CuratedMemoryConsolidateReport, type CuratedMemoryPhase2Status, type RunCuratedMemoryConsolidateInput, } from "./consolidate-pipeline.js";
|
|
7
8
|
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, consolidateCuratedMemoryPhase2, buildPhase2ExtractPrompt, parsePhase2Notes, noteCoveredByEntries, type TurnNoteInput, type TurnNoteWriteResult, type SessionEndConsolidateInput, type SessionEndPhase2Input, type Phase2CompleteFn, } from "./write-path.js";
|
|
8
9
|
//# 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,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
|
+
{"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,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,GACtC,MAAM,2BAA2B,CAAC;AACnC,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"}
|
|
@@ -3,5 +3,6 @@ export { createHttpMemoryProvider, HttpMemoryProviderError, probeHttpMemoryProvi
|
|
|
3
3
|
export { createFileMemoryProvider, resolveMemoryProvider, } from "./resolve.js";
|
|
4
4
|
export { createSqliteMemoryProvider, } from "./sqlite.js";
|
|
5
5
|
export { CURATED_MEMORY_PROMPT_TEXT, createCuratedMemoryTools, } from "./tools.js";
|
|
6
|
+
export { CONSOLIDATE_LEASE_FILE, CONSOLIDATE_REPORT_FILE, tryClaimConsolidateLease, readConsolidateReport, writeConsolidateReport, runCuratedMemoryConsolidate, } from "./consolidate-pipeline.js";
|
|
6
7
|
export { extractReusableNotes, writeReusableNotesAfterTurn, consolidateCuratedMemoryPhase1, consolidateCuratedMemoryPhase2, buildPhase2ExtractPrompt, parsePhase2Notes, noteCoveredByEntries, } from "./write-path.js";
|
|
7
8
|
//# 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,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"}
|
|
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,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,GAI5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,GAMrB,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAcO,CAAC;AAmB/C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,GAAG,cAAc,EAAE,CAkJpF"}
|
|
@@ -13,10 +13,11 @@ export const CURATED_MEMORY_PROMPT_TEXT = "Curated memory is two files under {XR
|
|
|
13
13
|
+ "and does not follow the user into a new session. Do not write session-local WIP, "
|
|
14
14
|
+ "numbered task checklists, or 'we were doing X' handoff notes into memory. Do "
|
|
15
15
|
+ "not volunteer to resume work that appears only in MEMORY unless the user asks. "
|
|
16
|
-
+ "The `memory` tool
|
|
16
|
+
+ "The `memory` tool supports add / replace / remove / list (or one atomic "
|
|
17
|
+
+ "`operations` batch). list returns live disk entries for the chosen target. "
|
|
17
18
|
+ "Writes hit disk immediately and do not change this session's system prompt. "
|
|
18
19
|
+ "This is not the Mnemon document library.";
|
|
19
|
-
const ACTIONS = ["add", "replace", "remove"];
|
|
20
|
+
const ACTIONS = ["add", "replace", "remove", "list"];
|
|
20
21
|
function asTarget(raw) {
|
|
21
22
|
const target = String(raw ?? "memory");
|
|
22
23
|
if (target === "memory" || target === "user")
|
|
@@ -43,7 +44,8 @@ export function createCuratedMemoryTools(store) {
|
|
|
43
44
|
+ "(preferences, lasting conventions, who the user is). "
|
|
44
45
|
+ "Do NOT store session WIP, standing plans, todo checklists, or handoff notes "
|
|
45
46
|
+ "for unfinished work — use `todo_write` for those (they stay in this session only). "
|
|
46
|
-
+ "Actions: add, replace, remove. Prefer one `operations` batch when several entries change. "
|
|
47
|
+
+ "Actions: add, replace, remove, list. Prefer one `operations` batch when several entries change. "
|
|
48
|
+
+ "Use list before replace/remove when you need the exact on-disk wording. "
|
|
47
49
|
+ "target `memory` is agent notes (MEMORY.md under {XRK_HOME}/memories); "
|
|
48
50
|
+ "target `user` is the curated user profile (memories/USER.md — not standing "
|
|
49
51
|
+ "~/.xrk/USER.md or IDENTITY.md). "
|
|
@@ -56,7 +58,7 @@ export function createCuratedMemoryTools(store) {
|
|
|
56
58
|
action: {
|
|
57
59
|
type: "string",
|
|
58
60
|
enum: [...ACTIONS],
|
|
59
|
-
description: "Single change. Omit when using operations.",
|
|
61
|
+
description: "Single change or list. Omit when using operations.",
|
|
60
62
|
},
|
|
61
63
|
target: {
|
|
62
64
|
type: "string",
|
|
@@ -81,7 +83,7 @@ export function createCuratedMemoryTools(store) {
|
|
|
81
83
|
items: {
|
|
82
84
|
type: "object",
|
|
83
85
|
properties: {
|
|
84
|
-
action: { type: "string", enum: [
|
|
86
|
+
action: { type: "string", enum: ["add", "replace", "remove"] },
|
|
85
87
|
content: { type: "string" },
|
|
86
88
|
new_text: { type: "string" },
|
|
87
89
|
old_text: { type: "string" },
|
|
@@ -106,6 +108,18 @@ export function createCuratedMemoryTools(store) {
|
|
|
106
108
|
}),
|
|
107
109
|
};
|
|
108
110
|
}
|
|
111
|
+
const action = String(args.action ?? "");
|
|
112
|
+
if (action === "list") {
|
|
113
|
+
const entries = await Promise.resolve(store.listEntries(target));
|
|
114
|
+
return {
|
|
115
|
+
content: JSON.stringify({
|
|
116
|
+
success: true,
|
|
117
|
+
target,
|
|
118
|
+
entry_count: entries.length,
|
|
119
|
+
current_entries: entries,
|
|
120
|
+
}),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
109
123
|
const ops = asOps(args.operations);
|
|
110
124
|
if (Array.isArray(args.operations) && args.operations.length > 0 && ops && ops.length > 0) {
|
|
111
125
|
const result = await Promise.resolve(store.applyBatch(target, ops));
|
|
@@ -120,7 +134,6 @@ export function createCuratedMemoryTools(store) {
|
|
|
120
134
|
}),
|
|
121
135
|
};
|
|
122
136
|
}
|
|
123
|
-
const action = String(args.action ?? "");
|
|
124
137
|
const content = String(args.content ?? args.new_text ?? "");
|
|
125
138
|
const oldText = String(args.old_text ?? "");
|
|
126
139
|
if (!ACTIONS.includes(action)) {
|
|
@@ -128,7 +141,7 @@ export function createCuratedMemoryTools(store) {
|
|
|
128
141
|
isError: true,
|
|
129
142
|
content: JSON.stringify({
|
|
130
143
|
success: false,
|
|
131
|
-
error: `Unknown action '${action}'. Use: add, replace, remove`,
|
|
144
|
+
error: `Unknown action '${action}'. Use: add, replace, remove, list`,
|
|
132
145
|
}),
|
|
133
146
|
};
|
|
134
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,CAAC,MAAM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CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;gBAClE,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC;wBACtB,OAAO,EAAE,KAAK;wBACd,KAAK,EAAE,4BAA4B,MAAM,IAAI;qBAC9C,CAAC;iBACH,CAAC;YACJ,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAClC,MAAM,KAAK,KAAK;gBACd,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;gBAC5B,CAAC,CAAC,MAAM,KAAK,SAAS;oBACpB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;oBACzC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CACpC,CAAC;YACF,OAAO,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QACvE,CAAC;KACF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# `@xrkseek/exec-video-analyze`
|
|
2
|
+
|
|
3
|
+
Hermes-style **video understanding** tool (`video_analyze`).
|
|
4
|
+
|
|
5
|
+
- **In**: video URL or workspace path + question
|
|
6
|
+
- **Out**: JSON `{ success, analysis, … }` text (whole-clip multimodal LLM — not frame extraction)
|
|
7
|
+
- **Not**: `browser_vision` (live page screenshot) · `video_generate` (create video) · `read_image` (stills)
|
|
8
|
+
|
|
9
|
+
Providers: `memory` (CI) · OpenAI-compatible chat with `video_url` part (needs a video-capable model such as Gemini).
|
|
10
|
+
|
|
11
|
+
See [docs/video-analyze.md](../../../docs/video-analyze.md).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,eAAO,MAAM,yBAAyB,QAO5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** System-prompt fragment for video_analyze (boundary vs browser_vision). */
|
|
2
|
+
export const VIDEO_ANALYZE_PROMPT_TEXT = [
|
|
3
|
+
"## Video analysis",
|
|
4
|
+
"Use `video_analyze` for video files or video URLs (mp4/webm/mov/…). ",
|
|
5
|
+
"It sends the whole clip to a video-capable multimodal model and returns a text analysis — not frame extraction. ",
|
|
6
|
+
"Do **not** use it for live browser pages (use `browser_vision`) or static images (use `read_image`). ",
|
|
7
|
+
"Do **not** use `video_generate` here — that tool creates videos, it does not understand them. ",
|
|
8
|
+
"Large clips (>20 MB) may be slow; hard limit ~50 MB.",
|
|
9
|
+
].join("");
|
|
10
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,mBAAmB;IACnB,sEAAsE;IACtE,kHAAkH;IAClH,uGAAuG;IACvG,gGAAgG;IAChG,sDAAsD;CACvD,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { VideoAnalyzeService } from "./types.js";
|
|
2
|
+
export { VideoAnalyzeError, isVideoAnalyzeError, type VideoAnalyzeErrorCode, type VideoAnalyzeRequest, type VideoAnalyzeResult, type VideoAnalyzeService, type VideoMediaType, } from "./types.js";
|
|
3
|
+
export { MAX_VIDEO_BYTES, VIDEO_MIME_BY_EXT, VIDEO_SIZE_WARN_BYTES, assertVideoByteBudget, unsupportedVideoFormatMessage, videoMimeForPath, wrapVideoAnalyzePrompt, } from "./mime.js";
|
|
4
|
+
export { materializeVideo, type MaterializedVideo, type VideoAnalyzeFs, } from "./materialize.js";
|
|
5
|
+
export { VIDEO_ANALYZE_PROMPT_TEXT } from "./format.js";
|
|
6
|
+
export { createMemoryVideoAnalyzeProvider, type MemoryVideoAnalyzeOptions, } from "./memory.js";
|
|
7
|
+
export { createOpenAiVideoAnalyzeProvider, type OpenAiVideoAnalyzeOptions, } from "./openai-http.js";
|
|
8
|
+
export { createVideoAnalyzeTools, videoAnalyzeUnavailableMessage, type CreateVideoAnalyzeToolsOptions, } from "./tools.js";
|
|
9
|
+
/** Face `video-analyze` product modes (Settings SoT). `memory` stays env-only. */
|
|
10
|
+
export type VideoAnalyzeProductMode = "off" | "openai";
|
|
11
|
+
/** Face `video-analyze` product shape. */
|
|
12
|
+
export interface VideoAnalyzeProductConfig {
|
|
13
|
+
readonly mode: VideoAnalyzeProductMode;
|
|
14
|
+
readonly baseUrl?: string;
|
|
15
|
+
readonly model?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DefaultVideoAnalyzeAccessOptions {
|
|
18
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
19
|
+
/**
|
|
20
|
+
* Face Settings product. Used when `XRK_VIDEO_ANALYZE` is unset
|
|
21
|
+
* (env remains the CI bypass).
|
|
22
|
+
*/
|
|
23
|
+
readonly product?: VideoAnalyzeProductConfig;
|
|
24
|
+
readonly service?: VideoAnalyzeService;
|
|
25
|
+
readonly fetchImpl?: typeof fetch;
|
|
26
|
+
}
|
|
27
|
+
export interface DefaultVideoAnalyzeAccess {
|
|
28
|
+
readonly service?: VideoAnalyzeService;
|
|
29
|
+
readonly unavailableMessage: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a video-analyze Provider.
|
|
33
|
+
* - Injected `service` wins.
|
|
34
|
+
* - Non-empty `XRK_VIDEO_ANALYZE` is CI bypass over Face `product`.
|
|
35
|
+
* - Product / env: `off` · `openai` (`1`) · `memory` (env-only).
|
|
36
|
+
* - Else no service; tools stay registered and fail honestly.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createDefaultVideoAnalyzeAccess(options?: DefaultVideoAnalyzeAccessOptions): DefaultVideoAnalyzeAccess;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,cAAc,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,gCAAgC,EAChC,KAAK,yBAAyB,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,EAChC,KAAK,yBAAyB,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,KAAK,8BAA8B,GACpC,MAAM,YAAY,CAAC;AAEpB,kFAAkF;AAClF,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEvD,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,yBAAyB,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CACnC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;CACrC;AASD;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,gCAAqC,GAC7C,yBAAyB,CAyC3B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createMemoryVideoAnalyzeProvider } from "./memory.js";
|
|
2
|
+
import { createOpenAiVideoAnalyzeProvider } from "./openai-http.js";
|
|
3
|
+
import { videoAnalyzeUnavailableMessage } from "./tools.js";
|
|
4
|
+
export { VideoAnalyzeError, isVideoAnalyzeError, } from "./types.js";
|
|
5
|
+
export { MAX_VIDEO_BYTES, VIDEO_MIME_BY_EXT, VIDEO_SIZE_WARN_BYTES, assertVideoByteBudget, unsupportedVideoFormatMessage, videoMimeForPath, wrapVideoAnalyzePrompt, } from "./mime.js";
|
|
6
|
+
export { materializeVideo, } from "./materialize.js";
|
|
7
|
+
export { VIDEO_ANALYZE_PROMPT_TEXT } from "./format.js";
|
|
8
|
+
export { createMemoryVideoAnalyzeProvider, } from "./memory.js";
|
|
9
|
+
export { createOpenAiVideoAnalyzeProvider, } from "./openai-http.js";
|
|
10
|
+
export { createVideoAnalyzeTools, videoAnalyzeUnavailableMessage, } from "./tools.js";
|
|
11
|
+
function resolveApiKey(env) {
|
|
12
|
+
const a = String(env.XRK_VIDEO_ANALYZE_OPENAI_KEY ?? "").trim();
|
|
13
|
+
if (a)
|
|
14
|
+
return a;
|
|
15
|
+
const b = String(env.OPENAI_API_KEY ?? "").trim();
|
|
16
|
+
return b || undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a video-analyze Provider.
|
|
20
|
+
* - Injected `service` wins.
|
|
21
|
+
* - Non-empty `XRK_VIDEO_ANALYZE` 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.
|
|
24
|
+
*/
|
|
25
|
+
export function createDefaultVideoAnalyzeAccess(options = {}) {
|
|
26
|
+
const env = options.env ?? process.env;
|
|
27
|
+
const unavailableMessage = videoAnalyzeUnavailableMessage(env, options.product);
|
|
28
|
+
if (options.service) {
|
|
29
|
+
return { service: options.service, unavailableMessage };
|
|
30
|
+
}
|
|
31
|
+
const envRaw = String(env.XRK_VIDEO_ANALYZE ?? "").trim();
|
|
32
|
+
const flag = envRaw !== ""
|
|
33
|
+
? envRaw.toLowerCase()
|
|
34
|
+
: options.product?.mode === "openai"
|
|
35
|
+
? "1"
|
|
36
|
+
: "";
|
|
37
|
+
if (flag === "memory") {
|
|
38
|
+
return {
|
|
39
|
+
service: createMemoryVideoAnalyzeProvider(),
|
|
40
|
+
unavailableMessage,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (flag === "1" || flag === "openai") {
|
|
44
|
+
const apiKey = resolveApiKey(env);
|
|
45
|
+
if (!apiKey) {
|
|
46
|
+
return { unavailableMessage };
|
|
47
|
+
}
|
|
48
|
+
const baseUrl = options.product?.baseUrl?.trim() ||
|
|
49
|
+
String(env.XRK_VIDEO_ANALYZE_BASE_URL ?? "").trim();
|
|
50
|
+
const model = options.product?.model?.trim() ||
|
|
51
|
+
String(env.XRK_VIDEO_ANALYZE_MODEL ?? "").trim();
|
|
52
|
+
return {
|
|
53
|
+
service: createOpenAiVideoAnalyzeProvider({
|
|
54
|
+
apiKey,
|
|
55
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
56
|
+
...(model ? { model } : {}),
|
|
57
|
+
...(options.fetchImpl ? { fetchImpl: options.fetchImpl } : {}),
|
|
58
|
+
}),
|
|
59
|
+
unavailableMessage,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return { unavailableMessage };
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAMpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,GAGjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,gCAAgC,GAEjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,GAEjC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,8BAA8B,GAE/B,MAAM,YAAY,CAAC;AA4BpB,SAAS,aAAa,CAAC,GAAsB;IAC3C,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAChB,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,OAAO,CAA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C9B,MAAM,CAAC,GAAG,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACnD,OAAO;YACL,OAAO,EAAE,gCAAgC,CAAC;gBACxC,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,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/D,CAAC;YACF,kBAAkB;SACnB,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface VideoAnalyzeFs {
|
|
2
|
+
stat(userPath: string): Promise<{
|
|
3
|
+
readonly isFile: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
readBytes(userPath: string, maxBytes?: number): Promise<Uint8Array>;
|
|
6
|
+
}
|
|
7
|
+
export interface MaterializedVideo {
|
|
8
|
+
readonly data: Uint8Array;
|
|
9
|
+
readonly mediaType: string;
|
|
10
|
+
readonly source: "url" | "path";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Load video bytes for analysis.
|
|
14
|
+
* - http(s): download with Accept video/*, capped at MAX_VIDEO_BYTES
|
|
15
|
+
* - else: workspace path via injected Fs (same world as read_image)
|
|
16
|
+
*/
|
|
17
|
+
export declare function materializeVideo(videoUrl: string, options?: {
|
|
18
|
+
readonly fs?: VideoAnalyzeFs;
|
|
19
|
+
readonly fetchImpl?: typeof fetch;
|
|
20
|
+
readonly signal?: AbortSignal;
|
|
21
|
+
}): Promise<MaterializedVideo>;
|
|
22
|
+
//# sourceMappingURL=materialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.d.ts","sourceRoot":"","sources":["../src/materialize.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC9D,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACrE;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC;CACjC;AAOD;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,CAAC,EAAE,cAAc,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC1B,GACL,OAAO,CAAC,iBAAiB,CAAC,CA0E5B"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialize a video from http(s) URL or local workspace path.
|
|
3
|
+
*/
|
|
4
|
+
import { extname } from "node:path";
|
|
5
|
+
import { assertVideoByteBudget, MAX_VIDEO_BYTES, unsupportedVideoFormatMessage, videoMimeForPath, } from "./mime.js";
|
|
6
|
+
import { VideoAnalyzeError } from "./types.js";
|
|
7
|
+
function isHttpUrl(raw) {
|
|
8
|
+
const lower = raw.trim().toLowerCase();
|
|
9
|
+
return lower.startsWith("http://") || lower.startsWith("https://");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Load video bytes for analysis.
|
|
13
|
+
* - http(s): download with Accept video/*, capped at MAX_VIDEO_BYTES
|
|
14
|
+
* - else: workspace path via injected Fs (same world as read_image)
|
|
15
|
+
*/
|
|
16
|
+
export async function materializeVideo(videoUrl, options = {}) {
|
|
17
|
+
const source = videoUrl.trim();
|
|
18
|
+
if (!source) {
|
|
19
|
+
throw new VideoAnalyzeError("video_url must be a non-empty string", "VIDEO_ANALYZE_BAD_ARGS");
|
|
20
|
+
}
|
|
21
|
+
if (isHttpUrl(source)) {
|
|
22
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
23
|
+
let res;
|
|
24
|
+
try {
|
|
25
|
+
res = await fetchImpl(source, {
|
|
26
|
+
method: "GET",
|
|
27
|
+
headers: { Accept: "video/*,*/*;q=0.8" },
|
|
28
|
+
...(options.signal ? { signal: options.signal } : {}),
|
|
29
|
+
redirect: "follow",
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
throw new VideoAnalyzeError(`Failed to download video: ${err instanceof Error ? err.message : String(err)}`, "VIDEO_ANALYZE_FETCH", { cause: err });
|
|
34
|
+
}
|
|
35
|
+
if (!res.ok) {
|
|
36
|
+
throw new VideoAnalyzeError(`Video download HTTP ${res.status}`, "VIDEO_ANALYZE_FETCH");
|
|
37
|
+
}
|
|
38
|
+
const contentLength = Number(res.headers.get("content-length") ?? "");
|
|
39
|
+
if (Number.isFinite(contentLength) && contentLength > MAX_VIDEO_BYTES) {
|
|
40
|
+
assertVideoByteBudget(contentLength);
|
|
41
|
+
}
|
|
42
|
+
const ab = await res.arrayBuffer();
|
|
43
|
+
const data = new Uint8Array(ab);
|
|
44
|
+
assertVideoByteBudget(data.byteLength);
|
|
45
|
+
const headerType = (res.headers.get("content-type") ?? "")
|
|
46
|
+
.split(";")[0]
|
|
47
|
+
?.trim()
|
|
48
|
+
.toLowerCase();
|
|
49
|
+
const fromUrl = videoMimeForPath(new URL(source).pathname);
|
|
50
|
+
const mediaType = (headerType && headerType.startsWith("video/") ? headerType : undefined) ??
|
|
51
|
+
fromUrl ??
|
|
52
|
+
"video/mp4";
|
|
53
|
+
return { data, mediaType, source: "url" };
|
|
54
|
+
}
|
|
55
|
+
const mime = videoMimeForPath(source);
|
|
56
|
+
if (!mime) {
|
|
57
|
+
throw new VideoAnalyzeError(unsupportedVideoFormatMessage(extname(source).toLowerCase() || "(none)"), "VIDEO_ANALYZE_UNSUPPORTED");
|
|
58
|
+
}
|
|
59
|
+
if (!options.fs) {
|
|
60
|
+
throw new VideoAnalyzeError("Local video paths require a workspace filesystem (Host harness fs).", "VIDEO_ANALYZE_BAD_ARGS");
|
|
61
|
+
}
|
|
62
|
+
const st = await options.fs.stat(source);
|
|
63
|
+
if (!st.isFile) {
|
|
64
|
+
throw new VideoAnalyzeError(`cannot read "${source}": not a regular file`, "VIDEO_ANALYZE_BAD_ARGS");
|
|
65
|
+
}
|
|
66
|
+
const data = await options.fs.readBytes(source, MAX_VIDEO_BYTES + 1);
|
|
67
|
+
assertVideoByteBudget(data.byteLength);
|
|
68
|
+
return { data, mediaType: mime, source: "path" };
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=materialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.js","sourceRoot":"","sources":["../src/materialize.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAa/C,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,OAAO,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACrE,CAAC;A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,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;QACf,MAAM,IAAI,iBAAiB,CACzB,gBAAgB,MAAM,uBAAuB,EAC7C,wBAAwB,CACzB,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,CAAC,CAAC,CAAC;IACrE,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** In-memory Provider for CI / unit tests (no network). */
|
|
2
|
+
import type { VideoAnalyzeService } from "./types.js";
|
|
3
|
+
export interface MemoryVideoAnalyzeOptions {
|
|
4
|
+
/** Fixed analysis text; default summarizes byte length + prompt head. */
|
|
5
|
+
readonly analysis?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function createMemoryVideoAnalyzeProvider(options?: MemoryVideoAnalyzeOptions): VideoAnalyzeService;
|
|
8
|
+
//# sourceMappingURL=memory.d.ts.map
|