@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,101 @@
|
|
|
1
|
+
import type { Dict } from '@xrkseek/cosmokit';
|
|
2
|
+
import { EventsService } from './events.ts';
|
|
3
|
+
import { LoggerService } from './logger.ts';
|
|
4
|
+
import { ReflectService } from './reflect.ts';
|
|
5
|
+
import { RegistryService, type InjectKey } from './registry.ts';
|
|
6
|
+
import { symbols } from './utils.ts';
|
|
7
|
+
import './fiber.ts';
|
|
8
|
+
/**
|
|
9
|
+
* Public shape of a Cordis context.
|
|
10
|
+
*
|
|
11
|
+
* The concrete `Context` class is proxied at runtime, so this interface is
|
|
12
|
+
* augmented by core services and plugins to describe the properties that may
|
|
13
|
+
* be read from `ctx`.
|
|
14
|
+
*/
|
|
15
|
+
export interface Context {
|
|
16
|
+
/** Isolation map: service name → scope label. Lookups for a name resolve within its label. */
|
|
17
|
+
[symbols.isolate]: Dict<symbol>;
|
|
18
|
+
/** Intercept map: service name → config merged into that service's per-plugin config. */
|
|
19
|
+
[symbols.intercept]: Dict;
|
|
20
|
+
/** The root context of the application (every child context shares it). @experimental */
|
|
21
|
+
root: this;
|
|
22
|
+
/** Base URL used to resolve relative plugin/module specifiers, if the runtime sets one. */
|
|
23
|
+
baseUrl?: string;
|
|
24
|
+
/** The event bus. Its methods are also mixed onto `ctx` (`ctx.on`, `ctx.emit`, ...). */
|
|
25
|
+
events: EventsService;
|
|
26
|
+
/** The logging service. Call `ctx.logger(name)` for a named logger. */
|
|
27
|
+
logger: LoggerService;
|
|
28
|
+
/** The reflection layer backing the context proxy (`ctx.get`, `ctx.provide`, ...). */
|
|
29
|
+
reflect: ReflectService;
|
|
30
|
+
/** The plugin registry. Its methods are mixed onto `ctx` (`ctx.plugin`, `ctx.inject`). */
|
|
31
|
+
registry: RegistryService;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Root and child dependency containers for Cordis plugins.
|
|
35
|
+
*
|
|
36
|
+
* A context is a proxy: normal property reads go through the service resolver,
|
|
37
|
+
* while `extend()`, `isolate()`, and `intercept()` create scoped child
|
|
38
|
+
* contexts without mutating their parent.
|
|
39
|
+
*/
|
|
40
|
+
export declare class Context {
|
|
41
|
+
/** Symbol key under which a disposer exposes its {@link EffectMeta} diagnostics tree. */
|
|
42
|
+
static readonly effect: unique symbol;
|
|
43
|
+
/** Symbol key for a context's listener filter, consulted on every event dispatch. */
|
|
44
|
+
static readonly filter: unique symbol;
|
|
45
|
+
/** Symbol key of the isolation map (see the `Context[symbols.isolate]` property). */
|
|
46
|
+
static readonly isolate: unique symbol;
|
|
47
|
+
/** Symbol key of the intercept map (see the `Context[symbols.intercept]` property). */
|
|
48
|
+
static readonly intercept: unique symbol;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true for Cordis context proxies and context prototypes.
|
|
51
|
+
*
|
|
52
|
+
* Works across realms and across multiple copies of cordis, because the
|
|
53
|
+
* brand is keyed by a global symbol rather than by `instanceof`.
|
|
54
|
+
*
|
|
55
|
+
* @param value — the value to test.
|
|
56
|
+
* @returns `true` if `value` is a Cordis context, narrowing its type.
|
|
57
|
+
*/
|
|
58
|
+
static is(value: any): value is Context;
|
|
59
|
+
/** Create the root context and install the built-in services. */
|
|
60
|
+
constructor();
|
|
61
|
+
/**
|
|
62
|
+
* Create a child context with extra metadata on top of the current scope.
|
|
63
|
+
*
|
|
64
|
+
* The child prototypally inherits every property of this context; own
|
|
65
|
+
* properties of `meta` shadow the inherited ones. The parent is not mutated.
|
|
66
|
+
*
|
|
67
|
+
* @param meta — own properties (including symbol keys) to define on the child.
|
|
68
|
+
* @returns a child context inheriting from this one.
|
|
69
|
+
*/
|
|
70
|
+
extend(meta?: {}): this;
|
|
71
|
+
/**
|
|
72
|
+
* Create a child context with an independent service scope for `name`.
|
|
73
|
+
*
|
|
74
|
+
* Below the returned context, reads and writes of the service `name`
|
|
75
|
+
* resolve against the new label instead of the parent's, so a different
|
|
76
|
+
* implementation can be provided without affecting the parent scope.
|
|
77
|
+
* Passing the same `label` to two `isolate()` calls joins their scopes.
|
|
78
|
+
*
|
|
79
|
+
* @param name — the service name to isolate.
|
|
80
|
+
* @param label — scope label to join; defaults to a fresh unique symbol.
|
|
81
|
+
* @returns a child context whose `name` service resolves in the new scope.
|
|
82
|
+
*/
|
|
83
|
+
isolate(name: string, label?: symbol): this;
|
|
84
|
+
/**
|
|
85
|
+
* Add service-specific intercept config for plugins started below this
|
|
86
|
+
* context.
|
|
87
|
+
*
|
|
88
|
+
* Plugins loaded under the returned context see `config` merged into the
|
|
89
|
+
* service's resolved config (ancestor entries first; see
|
|
90
|
+
* `Service[symbols.resolveConfig]`). The parent context is not affected.
|
|
91
|
+
*
|
|
92
|
+
* @param name — the service name whose config to intercept.
|
|
93
|
+
* @param config — the intercept config to merge for that service.
|
|
94
|
+
* @returns a child context carrying the additional intercept entry.
|
|
95
|
+
*/
|
|
96
|
+
intercept<K extends InjectKey>(name: K, config: Context[K] extends {
|
|
97
|
+
[symbols.config]: infer T;
|
|
98
|
+
} ? T : never): this;
|
|
99
|
+
intercept(name: string, config: any): this;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAC/D,OAAO,EAAgB,OAAO,EAAE,MAAM,YAAY,CAAA;AAClD,OAAsB,YAAY,CAAA;AAElC;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,8FAA8F;IAC9F,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/B,yFAAyF;IACzF,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAA;IACzB,yFAAyF;IACzF,IAAI,EAAE,IAAI,CAAA;IACV,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wFAAwF;IACxF,MAAM,EAAE,aAAa,CAAA;IACrB,uEAAuE;IACvE,MAAM,EAAE,aAAa,CAAA;IACrB,sFAAsF;IACtF,OAAO,EAAE,cAAc,CAAA;IACvB,0FAA0F;IAC1F,QAAQ,EAAE,eAAe,CAAA;CAC1B;AAED;;;;;;GAMG;AACH,qBAAa,OAAO;IAClB,yFAAyF;IACzF,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,MAAM,CAAiB;IACtD,qFAAqF;IACrF,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,MAAM,CAAiB;IACtD,qFAAqF;IACrF,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAkB;IACxD,uFAAuF;IACvF,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,MAAM,CAAoB;IAE5D;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO;IASvC,iEAAiE;;IAoBjE;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,KAAK,GAAG,IAAI;IAUvB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAMpC;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS;QAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI;IACnH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,IAAI;CAM3C"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import type { Promisify } from '@xrkseek/cosmokit';
|
|
2
|
+
import { Context } from './context.ts';
|
|
3
|
+
import { Fiber, FiberState } from './fiber.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Return whether an event result should stop a bail-style dispatch.
|
|
6
|
+
*
|
|
7
|
+
* @param value — a listener's return value.
|
|
8
|
+
* @returns `true` unless `value` is `null`, `false`, or `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isBailed(value: any): boolean;
|
|
11
|
+
/** Extract the parameter tuple from a function type. */
|
|
12
|
+
export type Parameters<F> = F extends (...args: infer P) => any ? P : never;
|
|
13
|
+
/** Extract the return type from a function type. */
|
|
14
|
+
export type ReturnType<F> = F extends (...args: any) => infer R ? R : never;
|
|
15
|
+
/** Extract the explicit `this` type from a function type. */
|
|
16
|
+
export type ThisType<F> = F extends (this: infer T, ...args: any) => any ? T : never;
|
|
17
|
+
/**
|
|
18
|
+
* Event dispatch strategy used by the event service.
|
|
19
|
+
*
|
|
20
|
+
* `emit` runs synchronous listeners without awaiting them, `parallel` awaits
|
|
21
|
+
* all listeners together, `serial` awaits them in order until one bails,
|
|
22
|
+
* `bail` stops on the first synchronous bail value, and `waterfall` composes
|
|
23
|
+
* listeners around a final `next` callback.
|
|
24
|
+
*/
|
|
25
|
+
export type DispatchMode = 'emit' | 'parallel' | 'serial' | 'bail' | 'waterfall';
|
|
26
|
+
declare module './context.ts' {
|
|
27
|
+
interface Context {
|
|
28
|
+
/**
|
|
29
|
+
* Dispatch an event, running all listeners concurrently.
|
|
30
|
+
*
|
|
31
|
+
* @param name — the event name.
|
|
32
|
+
* @param args — arguments passed to every listener.
|
|
33
|
+
* @returns a promise resolving once every listener has settled.
|
|
34
|
+
*/
|
|
35
|
+
parallel<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): Promise<void>;
|
|
36
|
+
/** Same as above, with an explicit `this` for listeners (also used for filtering). */
|
|
37
|
+
parallel<K extends keyof Events>(thisArg: NoInfer<ThisType<Events[K]>>, name: K, ...args: Parameters<Events[K]>): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Dispatch an event synchronously, ignoring listener return values.
|
|
40
|
+
*
|
|
41
|
+
* @param name — the event name.
|
|
42
|
+
* @param args — arguments passed to every listener.
|
|
43
|
+
*/
|
|
44
|
+
emit<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): void;
|
|
45
|
+
/** Same as above, with an explicit `this` for listeners (also used for filtering). */
|
|
46
|
+
emit<K extends keyof Events>(thisArg: NoInfer<ThisType<Events[K]>>, name: K, ...args: Parameters<Events[K]>): void;
|
|
47
|
+
/**
|
|
48
|
+
* Dispatch an event, awaiting listeners in order until one bails.
|
|
49
|
+
*
|
|
50
|
+
* @param name — the event name.
|
|
51
|
+
* @param args — arguments passed to each listener.
|
|
52
|
+
* @returns the first bail value (non-null, non-false, non-undefined), if any.
|
|
53
|
+
*/
|
|
54
|
+
serial<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): Promisify<ReturnType<Events[K]>>;
|
|
55
|
+
/** Same as above, with an explicit `this` for listeners (also used for filtering). */
|
|
56
|
+
serial<K extends keyof Events>(thisArg: NoInfer<ThisType<Events[K]>>, name: K, ...args: Parameters<Events[K]>): Promisify<ReturnType<Events[K]>>;
|
|
57
|
+
/**
|
|
58
|
+
* Dispatch an event, calling listeners in order until one bails.
|
|
59
|
+
*
|
|
60
|
+
* @param name — the event name.
|
|
61
|
+
* @param args — arguments passed to each listener.
|
|
62
|
+
* @returns the first bail value (non-null, non-false, non-undefined), if any.
|
|
63
|
+
*/
|
|
64
|
+
bail<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): ReturnType<Events[K]>;
|
|
65
|
+
/** Same as above, with an explicit `this` for listeners (also used for filtering). */
|
|
66
|
+
bail<K extends keyof Events>(thisArg: NoInfer<ThisType<Events[K]>>, name: K, ...args: Parameters<Events[K]>): ReturnType<Events[K]>;
|
|
67
|
+
/**
|
|
68
|
+
* Dispatch an event whose last argument is a `next` continuation.
|
|
69
|
+
*
|
|
70
|
+
* Each listener wraps the rest of the chain: calling `next()` invokes the
|
|
71
|
+
* next listener (finally the built-in behavior); not calling it vetoes.
|
|
72
|
+
*
|
|
73
|
+
* @param name — the event name.
|
|
74
|
+
* @param args — listener arguments; the final one is the innermost `next`.
|
|
75
|
+
* @returns the outermost listener's return value.
|
|
76
|
+
*/
|
|
77
|
+
waterfall<K extends keyof Events>(name: K, ...args: Parameters<Events[K]>): ReturnType<Events[K]>;
|
|
78
|
+
/** Same as above, with an explicit `this` for listeners (also used for filtering). */
|
|
79
|
+
waterfall<K extends keyof Events>(thisArg: NoInfer<ThisType<Events[K]>>, name: K, ...args: Parameters<Events[K]>): ReturnType<Events[K]>;
|
|
80
|
+
/**
|
|
81
|
+
* Register an event listener owned by the current fiber.
|
|
82
|
+
*
|
|
83
|
+
* @param name — the event name to listen for.
|
|
84
|
+
* @param listener — called with the dispatch arguments.
|
|
85
|
+
* @param options — listener options; a boolean is shorthand for `prepend`.
|
|
86
|
+
* @returns a disposer removing the listener; `true` if it was still registered.
|
|
87
|
+
*/
|
|
88
|
+
on<K extends keyof Events>(name: K, listener: Events[K], options?: boolean | EventOptions): () => boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Same as `on()`, but the listener disposes itself after its first call.
|
|
91
|
+
*
|
|
92
|
+
* @param name — the event name to listen for.
|
|
93
|
+
* @param listener — called at most once with the dispatch arguments.
|
|
94
|
+
* @param options — listener options; a boolean is shorthand for `prepend`.
|
|
95
|
+
* @returns a disposer removing the listener; `true` if it was still registered.
|
|
96
|
+
*/
|
|
97
|
+
once<K extends keyof Events>(name: K, listener: Events[K], options?: boolean | EventOptions): () => boolean;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** Options accepted by `ctx.on()` and `ctx.once()`. */
|
|
101
|
+
export interface EventOptions {
|
|
102
|
+
/** Add the listener before existing listeners for the same event. */
|
|
103
|
+
prepend?: boolean;
|
|
104
|
+
/** Receive the event regardless of context filter checks. */
|
|
105
|
+
global?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/** Registered listener record stored by the event service. */
|
|
108
|
+
export interface Hook extends EventOptions {
|
|
109
|
+
ctx: Context;
|
|
110
|
+
callback: (...args: any[]) => any;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Event bus installed as `ctx.events` and mixed into every context.
|
|
114
|
+
*
|
|
115
|
+
* The service supports concurrent, synchronous, serial, bail, and waterfall
|
|
116
|
+
* dispatch and automatically disposes listeners with their owning fiber.
|
|
117
|
+
*/
|
|
118
|
+
export declare class EventsService {
|
|
119
|
+
private ctx;
|
|
120
|
+
_hooks: Record<keyof any, Hook[]>;
|
|
121
|
+
constructor(ctx: Context);
|
|
122
|
+
/**
|
|
123
|
+
* Resolve listeners for one dispatch and apply context filtering.
|
|
124
|
+
*
|
|
125
|
+
* @param type — the dispatch mode, reported on `internal/dispatch`.
|
|
126
|
+
* @param args — the raw dispatch arguments; consumed up to the event name.
|
|
127
|
+
* @returns the matching listener callbacks, bound to the dispatch `this`.
|
|
128
|
+
*/
|
|
129
|
+
dispatch(type: string, args: any[]): ((...args: any[]) => any)[];
|
|
130
|
+
/**
|
|
131
|
+
* Run listeners concurrently and wait for all of them.
|
|
132
|
+
*
|
|
133
|
+
* @param args — optional `this`, the event name, then listener arguments.
|
|
134
|
+
* @returns a promise resolving once every listener has settled.
|
|
135
|
+
*/
|
|
136
|
+
parallel(...args: any[]): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Run listeners synchronously without waiting for returned promises.
|
|
139
|
+
*
|
|
140
|
+
* @param args — optional `this`, the event name, then listener arguments.
|
|
141
|
+
*/
|
|
142
|
+
emit(...args: any[]): void;
|
|
143
|
+
/**
|
|
144
|
+
* Run listeners in order, awaiting each, until one returns a bail value.
|
|
145
|
+
*
|
|
146
|
+
* @param args — optional `this`, the event name, then listener arguments.
|
|
147
|
+
* @returns the first bail value (see {@link isBailed}), if any.
|
|
148
|
+
*/
|
|
149
|
+
serial(...args: any[]): Promise<any>;
|
|
150
|
+
/**
|
|
151
|
+
* Run listeners synchronously until one returns a bail value.
|
|
152
|
+
*
|
|
153
|
+
* @param args — optional `this`, the event name, then listener arguments.
|
|
154
|
+
* @returns the first bail value (see {@link isBailed}), if any.
|
|
155
|
+
*/
|
|
156
|
+
bail(...args: any[]): any;
|
|
157
|
+
/**
|
|
158
|
+
* Compose listeners around the final `next` callback.
|
|
159
|
+
*
|
|
160
|
+
* The last dispatch argument is treated as the innermost `next`. Listeners
|
|
161
|
+
* run outermost-first; a listener that does not call `next()` vetoes the
|
|
162
|
+
* rest of the chain, including the built-in behavior.
|
|
163
|
+
*
|
|
164
|
+
* @param args — optional `this`, the event name, listener arguments, then `next`.
|
|
165
|
+
* @returns the outermost listener's return value.
|
|
166
|
+
*/
|
|
167
|
+
waterfall(...args: any[]): any;
|
|
168
|
+
/**
|
|
169
|
+
* Store a listener record as an effect on the current fiber.
|
|
170
|
+
*
|
|
171
|
+
* @param label — effect label shown in fiber diagnostics.
|
|
172
|
+
* @param hooks — the listener list for one event.
|
|
173
|
+
* @param callback — the listener to store.
|
|
174
|
+
* @param options — placement and filtering options.
|
|
175
|
+
* @returns a disposer that unregisters the listener.
|
|
176
|
+
*/
|
|
177
|
+
register(label: string, hooks: Hook[], callback: any, options: EventOptions): () => void;
|
|
178
|
+
/**
|
|
179
|
+
* Remove a stored listener record.
|
|
180
|
+
*
|
|
181
|
+
* @param hooks — the listener list for one event.
|
|
182
|
+
* @param callback — the listener to remove.
|
|
183
|
+
* @returns `true` if the listener was found and removed.
|
|
184
|
+
*/
|
|
185
|
+
unregister(hooks: Hook[], callback: any): true | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* Register an event listener owned by the current fiber.
|
|
188
|
+
*
|
|
189
|
+
* The listener is removed automatically when the fiber unloads. Throws
|
|
190
|
+
* `CordisError('INACTIVE_EFFECT')` if the fiber is already disposed.
|
|
191
|
+
*
|
|
192
|
+
* @param name — the event name to listen for.
|
|
193
|
+
* @param listener — called with the dispatch arguments.
|
|
194
|
+
* @param options — listener options; a boolean is shorthand for `prepend`.
|
|
195
|
+
* @returns a disposer removing the listener; `true` if it was still registered.
|
|
196
|
+
*/
|
|
197
|
+
on(name: string | symbol, listener: (...args: any) => any, options?: boolean | EventOptions): any;
|
|
198
|
+
/**
|
|
199
|
+
* Register an event listener that disposes itself after the first call.
|
|
200
|
+
*
|
|
201
|
+
* @param name — the event name to listen for.
|
|
202
|
+
* @param listener — called at most once with the dispatch arguments.
|
|
203
|
+
* @param options — listener options; a boolean is shorthand for `prepend`.
|
|
204
|
+
* @returns a disposer removing the listener; `true` if it was still registered.
|
|
205
|
+
*/
|
|
206
|
+
once(name: string, listener: (...args: any) => any, options?: boolean | EventOptions): any;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Built-in framework events used by core services and extension points.
|
|
210
|
+
*
|
|
211
|
+
* Plugin and status events track fiber lifecycle, service events observe
|
|
212
|
+
* dependency registration, update/get/set/listener events allow core services
|
|
213
|
+
* to intercept runtime operations, and `internal/dispatch` exposes event-bus
|
|
214
|
+
* diagnostics before public events are delivered.
|
|
215
|
+
*/
|
|
216
|
+
export interface Events {
|
|
217
|
+
/** A plugin fiber was created or its uid was cleared on disposal. */
|
|
218
|
+
'internal/plugin'(fiber: Fiber): void;
|
|
219
|
+
/** A fiber changed lifecycle state; receives the fiber and its previous state. */
|
|
220
|
+
'internal/status'(fiber: Fiber, oldValue: FiberState): void;
|
|
221
|
+
/**
|
|
222
|
+
* Resolve raw plugin config after the fiber's injections become active.
|
|
223
|
+
* @param config - the raw config for this activation.
|
|
224
|
+
* @mode waterfall
|
|
225
|
+
*/
|
|
226
|
+
'internal/config'(this: Fiber, config: any, next: () => any): any;
|
|
227
|
+
/** Interception hook for a service binding (no core producer). */
|
|
228
|
+
'internal/service'(this: Context, name: string, value: any): void;
|
|
229
|
+
/** Waterfall: a fiber config update is being applied; skip `next()` to veto. */
|
|
230
|
+
'internal/update'(this: Fiber, config: any, noSave: boolean, next: () => void | Promise<void>): void | Promise<void>;
|
|
231
|
+
/** Waterfall: a service is being read through the context proxy. */
|
|
232
|
+
'internal/get'(ctx: Context, name: string, error: Error, next: () => any): any;
|
|
233
|
+
/** Waterfall: a service is being written through the context proxy. */
|
|
234
|
+
'internal/set'(ctx: Context, name: string, value: any, error: Error, next: () => boolean): boolean;
|
|
235
|
+
/** Bail: a listener is being registered; a non-null result replaces registration. */
|
|
236
|
+
'internal/listener'(this: Context, name: string, listener: any, prepend: boolean): void;
|
|
237
|
+
/** An event is being dispatched to listeners (fired for non-internal events only). */
|
|
238
|
+
'internal/dispatch'(mode: DispatchMode, name: string, args: any[], thisArg: any): void;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAG9C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,WAElC;AAED,wDAAwD;AACxD,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;AAC3E,oDAAoD;AACpD,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;AAC3E,6DAA6D;AAC7D,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAA;AAEpF;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAA;AAEhF,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAiB,OAAO;QAEtB;;;;;;WAMG;QACH,QAAQ,CAAC,CAAC,SAAS,MAAM,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,M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AG,CAAA;IAC9E,uEAAuE;IACvE,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,GAAG,OAAO,CAAA;IAClG,qFAAqF;IACrF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvF,sFAAsF;IACtF,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI,CAAA;CACvF"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import type { Awaitable, Dict } from '@xrkseek/cosmokit';
|
|
2
|
+
import { Context } from './context.ts';
|
|
3
|
+
import type { Plugin } from './registry.ts';
|
|
4
|
+
import { DisposableList } from './utils.ts';
|
|
5
|
+
import type { Impl } from './reflect.ts';
|
|
6
|
+
import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
7
|
+
declare module './context.ts' {
|
|
8
|
+
interface Context extends Pick<Fiber, 'effect'> {
|
|
9
|
+
/** The fiber (plugin runtime instance) that owns this context. */
|
|
10
|
+
fiber: Fiber;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Error raised when plugin configuration fails standard-schema validation. */
|
|
14
|
+
export declare class ValidationError extends TypeError {
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Build the aggregated message from schema issues.
|
|
18
|
+
*
|
|
19
|
+
* @param issues — the standard-schema issues, one message line each.
|
|
20
|
+
*/
|
|
21
|
+
constructor(issues: readonly StandardSchemaV1.Issue[]);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Validate and normalize config for a plugin runtime before it starts.
|
|
25
|
+
*
|
|
26
|
+
* @param runtime — the plugin runtime whose `Config` schema to apply.
|
|
27
|
+
* @param config — the raw user config.
|
|
28
|
+
* @returns the validated config, or `config` unchanged if the runtime has no schema.
|
|
29
|
+
* @throws {ValidationError} when validation reports issues.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolveConfig(runtime: Plugin.Runtime, config: any): any;
|
|
32
|
+
interface AsyncDisposable<T extends Awaitable<void> = Awaitable<void>> extends PromiseLike<() => T> {
|
|
33
|
+
(): T;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Function returned by an effect to release resources during disposal.
|
|
37
|
+
*
|
|
38
|
+
* Disposers run in reverse registration order when the owning fiber unloads;
|
|
39
|
+
* they may be async, in which case unloading awaits them.
|
|
40
|
+
*/
|
|
41
|
+
export type Disposable<T = any> = () => T;
|
|
42
|
+
/**
|
|
43
|
+
* Effect body result accepted by `ctx.effect()` and plugin startup.
|
|
44
|
+
*
|
|
45
|
+
* Either a single disposer, a promise of one, or a (possibly async) iterable
|
|
46
|
+
* yielding several — generator effects register each yielded disposer as it
|
|
47
|
+
* is produced.
|
|
48
|
+
*/
|
|
49
|
+
export type Effect<T = any> = SyncEffect<T> | AsyncEffect<T>;
|
|
50
|
+
type SyncEffect<T = any> = Disposable<T> | Iterable<Disposable<T>, void, void>;
|
|
51
|
+
type AsyncEffect<T = any> = Promise<Disposable<T>> | AsyncIterable<Disposable<T>, void, void>;
|
|
52
|
+
/** Tree node used to expose nested effect labels for diagnostics. */
|
|
53
|
+
export interface EffectMeta {
|
|
54
|
+
/** Human-readable effect label, e.g. `ctx.on("event")` or `ctx.provide("name")`. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** Metadata of nested effects registered while this effect ran. */
|
|
57
|
+
children: EffectMeta[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Lifecycle state for one plugin fiber.
|
|
61
|
+
*
|
|
62
|
+
* `PENDING` — waiting for required services; `LOADING` — the plugin callback
|
|
63
|
+
* is running; `ACTIVE` — loaded and providing; `FAILED` — the callback or its
|
|
64
|
+
* config threw; `UNLOADING` — disposers are running; `DISPOSED` — the fiber
|
|
65
|
+
* was removed and cannot restart.
|
|
66
|
+
*/
|
|
67
|
+
export declare const enum FiberState {
|
|
68
|
+
PENDING = 0,
|
|
69
|
+
LOADING = 1,
|
|
70
|
+
ACTIVE = 2,
|
|
71
|
+
FAILED = 3,
|
|
72
|
+
DISPOSED = 4,
|
|
73
|
+
UNLOADING = 5
|
|
74
|
+
}
|
|
75
|
+
/** Framework error with a stable machine-readable code. */
|
|
76
|
+
export declare class CordisError extends Error {
|
|
77
|
+
code: CordisError.Code;
|
|
78
|
+
/**
|
|
79
|
+
* @param code — the stable error code; also the default message.
|
|
80
|
+
* @param message — optional human-readable override.
|
|
81
|
+
*/
|
|
82
|
+
constructor(code: CordisError.Code, message?: string);
|
|
83
|
+
}
|
|
84
|
+
/** Cordis error code definitions. */
|
|
85
|
+
export declare namespace CordisError {
|
|
86
|
+
type Code = keyof typeof Code;
|
|
87
|
+
const Code: {
|
|
88
|
+
readonly INACTIVE_EFFECT: "cannot create effect on inactive context";
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Runtime instance of one plugin application.
|
|
93
|
+
*
|
|
94
|
+
* A fiber tracks dependency state, validated config, lifecycle effects, and
|
|
95
|
+
* cleanup for the plugin context returned by `ctx.plugin()`.
|
|
96
|
+
*/
|
|
97
|
+
export declare class Fiber {
|
|
98
|
+
parent: Context;
|
|
99
|
+
inject: Dict<any>;
|
|
100
|
+
runtime: Plugin.Runtime | null;
|
|
101
|
+
/** Unique id within the registry; 0 for the root fiber, `null` once disposed. */
|
|
102
|
+
uid: number | null;
|
|
103
|
+
/** The context this fiber's plugin runs in (extends the parent context). */
|
|
104
|
+
readonly ctx: Context;
|
|
105
|
+
/** The validated plugin config (updated by `update()`). */
|
|
106
|
+
config: any;
|
|
107
|
+
/** The raw plugin config, re-resolved before each activation. */
|
|
108
|
+
_config: any;
|
|
109
|
+
/** Current lifecycle state; transitions emit `internal/status`. */
|
|
110
|
+
state: FiberState;
|
|
111
|
+
/** Dispose this fiber: unload the plugin, then settle once cleanup finished. */
|
|
112
|
+
readonly dispose: () => Promise<void>;
|
|
113
|
+
/** Snapshot of required service implementations while loaded; `undefined` otherwise. */
|
|
114
|
+
store: Dict<Impl> | undefined;
|
|
115
|
+
/** The in-flight load/unload transition, if one is currently running. */
|
|
116
|
+
inertia: Promise<void> | undefined;
|
|
117
|
+
readonly _hooks: Dict<DisposableList<Function>>;
|
|
118
|
+
readonly _disposables: DisposableList<Disposable<any>>;
|
|
119
|
+
protected context: Context;
|
|
120
|
+
private _error;
|
|
121
|
+
private _runner;
|
|
122
|
+
private _store;
|
|
123
|
+
/**
|
|
124
|
+
* Create a fiber. Plugin authors normally obtain fibers from `ctx.plugin()`
|
|
125
|
+
* rather than constructing them directly.
|
|
126
|
+
*
|
|
127
|
+
* @param parent — the context the plugin was loaded from.
|
|
128
|
+
* @param config — raw config, validated against the runtime's schema.
|
|
129
|
+
* @param inject — resolved dependency map (service name → intercept config).
|
|
130
|
+
* @param runtime — the shared plugin runtime, or `null` for the root fiber.
|
|
131
|
+
* @param getOuterStack — captures the caller stack for effect diagnostics.
|
|
132
|
+
*/
|
|
133
|
+
constructor(parent: Context, config: any, inject: Dict<any>, runtime: Plugin.Runtime | null, getOuterStack: () => string[]);
|
|
134
|
+
/** The plugin's display name, inherited from the nearest named ancestor, else `'root'`. */
|
|
135
|
+
get name(): string;
|
|
136
|
+
/**
|
|
137
|
+
* Throw if the fiber has already been disposed.
|
|
138
|
+
*
|
|
139
|
+
* @returns nothing when the fiber is still active.
|
|
140
|
+
* @throws {CordisError} `INACTIVE_EFFECT` when the fiber's uid has been cleared.
|
|
141
|
+
*/
|
|
142
|
+
assertActive(): void;
|
|
143
|
+
private _execute;
|
|
144
|
+
/**
|
|
145
|
+
* Register a cleanup-aware effect on this fiber.
|
|
146
|
+
*
|
|
147
|
+
* `execute` runs immediately; the disposers it produces are collected and
|
|
148
|
+
* run (in reverse order) either when the returned disposer is called or
|
|
149
|
+
* when the fiber unloads, whichever comes first. Calling the disposer twice
|
|
150
|
+
* is a no-op. Throws `CordisError('INACTIVE_EFFECT')` if the fiber is
|
|
151
|
+
* already disposed, and `TypeError` if `execute` returns an invalid shape.
|
|
152
|
+
*
|
|
153
|
+
* @param execute — the effect body; see {@link Effect} for accepted shapes.
|
|
154
|
+
* @param label — effect label shown in `getEffects()` diagnostics.
|
|
155
|
+
* @returns a disposer that tears the effect down and settles once done.
|
|
156
|
+
*/
|
|
157
|
+
effect(execute: () => SyncEffect, label?: string): Disposable<Promise<void>>;
|
|
158
|
+
/** Same as above for async effects; the disposer is also awaitable. */
|
|
159
|
+
effect(execute: () => Effect, label?: string): AsyncDisposable<Promise<void>>;
|
|
160
|
+
/**
|
|
161
|
+
* Return metadata for currently registered effects.
|
|
162
|
+
*
|
|
163
|
+
* @returns one {@link EffectMeta} tree per labeled live effect.
|
|
164
|
+
*/
|
|
165
|
+
getEffects(): EffectMeta[];
|
|
166
|
+
private _getState;
|
|
167
|
+
private _updateState;
|
|
168
|
+
_checkImpl(name: string): boolean | undefined;
|
|
169
|
+
_refresh(): void;
|
|
170
|
+
private _setEpoch;
|
|
171
|
+
private _resolveConfig;
|
|
172
|
+
private _reload;
|
|
173
|
+
private _unload;
|
|
174
|
+
/**
|
|
175
|
+
* Wait for current lifecycle work and rethrow startup errors.
|
|
176
|
+
*
|
|
177
|
+
* @returns this fiber, once it has settled into a stable state.
|
|
178
|
+
* @throws the config-validation or plugin-startup error, if any.
|
|
179
|
+
*/
|
|
180
|
+
await(): Promise<this>;
|
|
181
|
+
/**
|
|
182
|
+
* Dispose and immediately reload this plugin with its current config.
|
|
183
|
+
*
|
|
184
|
+
* @returns a promise resolving once the reload settled.
|
|
185
|
+
* @throws {CordisError} `INACTIVE_EFFECT` when the fiber is already disposed.
|
|
186
|
+
*/
|
|
187
|
+
restart(): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Validate and apply new config, then restart the plugin.
|
|
190
|
+
*
|
|
191
|
+
* Runs the `internal/update` waterfall first, so update hooks (and HMR)
|
|
192
|
+
* can veto or replace the restart.
|
|
193
|
+
*
|
|
194
|
+
* @param config — the new raw config; validated before anything restarts.
|
|
195
|
+
* @param noSave — hint for persistence hooks not to write the change back.
|
|
196
|
+
* @returns the update waterfall result; the default restart returns a promise.
|
|
197
|
+
* @throws when validation, an update listener, or the restarted plugin fails.
|
|
198
|
+
*/
|
|
199
|
+
update(config: any, noSave?: boolean): void | Promise<void>;
|
|
200
|
+
}
|
|
201
|
+
export {};
|
|
202
|
+
//# sourceMappingURL=fiber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fiber.d.ts","sourceRoot":"","sources":["../../src/fiber.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAiC,cAAc,EAAkD,MAAM,YAAY,CAAA;AAC1H,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAiB,OAAQ,SAAQ,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC;QACpD,kEAAkE;QAClE,KAAK,EAAE,KAAK,CAAA;KACb;CACF;AAID,+EAA+E;AAC/E,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,IAAI,SAAoB;IAExB;;;;OAIG;gBACS,MAAM,EAAE,SAAS,gBAAgB,CAAC,KAAK,EAAE;CAStD;AAMD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,C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AAO,CAAC,QAAQ;IA8ChB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,uEAAuE;IACvE,MAAM,CAAC,OAAO,EAAE,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAkJ7E;;;;OAIG;IACH,UAAU;IAMV,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,YAAY;IAgBpB,UAAU,CAAC,IAAI,EAAE,MAAM;IAcvB,QAAQ;IAcR,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,cAAc;YAKR,OAAO;YA6BP,OAAO;IAuBrB;;;;;OAKG;IACG,KAAK;IAQX;;;;;OAKG;IACG,OAAO;IAOb;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,UAAQ;CAkBnC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Core context type and root context implementation. */
|
|
2
|
+
export * from './context.ts';
|
|
3
|
+
/** Event bus, dispatch modes, and event augmentation types. */
|
|
4
|
+
export * from './events.ts';
|
|
5
|
+
/** Plugin fiber lifecycle, effects, and config validation helpers. */
|
|
6
|
+
export * from './fiber.ts';
|
|
7
|
+
/** Logger facade, logger service, message, exporter, and formatting types. */
|
|
8
|
+
export * from './logger.ts';
|
|
9
|
+
/** Plugin registry, dependency injection, and plugin entrypoint types. */
|
|
10
|
+
export * from './registry.ts';
|
|
11
|
+
/** Base service class and service lifecycle symbols. */
|
|
12
|
+
export * from './service.ts';
|
|
13
|
+
/** Shared internal helpers used by context, services, and plugin fibers. */
|
|
14
|
+
export * from './utils.ts';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,cAAc,cAAc,CAAA;AAC5B,+DAA+D;AAC/D,cAAc,aAAa,CAAA;AAC3B,sEAAsE;AACtE,cAAc,YAAY,CAAA;AAC1B,8EAA8E;AAC9E,cAAc,aAAa,CAAA;AAC3B,0EAA0E;AAC1E,cAAc,eAAe,CAAA;AAC7B,wDAAwD;AACxD,cAAc,cAAc,CAAA;AAC5B,4EAA4E;AAC5E,cAAc,YAAY,CAAA"}
|