@xrkseek/harness 0.6.21 → 0.7.0-rc.1
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/a2a/README.md +45 -45
- package/node_modules/@xrkseek/attachment/README.md +23 -23
- package/node_modules/@xrkseek/attachment-local/README.md +6 -6
- package/node_modules/@xrkseek/attachment-local/package.json +26 -26
- package/node_modules/@xrkseek/checkpoint/README.md +90 -90
- package/node_modules/@xrkseek/checkpoint/dist/store.d.ts +21 -0
- package/node_modules/@xrkseek/checkpoint/dist/store.d.ts.map +1 -1
- package/node_modules/@xrkseek/checkpoint/dist/store.js +33 -0
- package/node_modules/@xrkseek/checkpoint/dist/store.js.map +1 -1
- package/node_modules/@xrkseek/checkpoint/package.json +26 -26
- package/node_modules/@xrkseek/claude-code-mods/README.md +152 -0
- package/node_modules/@xrkseek/claude-code-mods/README.zh.md +172 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/api.d.ts +36 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/api.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/api.js +215 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/api.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/attach.d.ts +92 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/attach.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/attach.js +106 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/attach.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/chain.d.ts +105 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/chain.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/chain.js +324 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/chain.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.d.ts +39 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.js +39 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/define-mod.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/elements.d.ts +96 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/elements.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/elements.js +171 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/elements.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/engine.d.ts +155 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/engine.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/engine.js +356 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/engine.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.d.ts +72 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.js +603 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/host-ops.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/index.d.ts +112 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/index.js +654 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/index.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/matcher.d.ts +45 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/matcher.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/matcher.js +195 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/matcher.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/module.d.ts +74 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/module.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/module.js +167 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/module.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/native-import.d.ts +31 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/native-import.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/native-import.js +32 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/native-import.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.d.ts +70 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.js +167 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/plugin-dir.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.d.ts +57 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.js +85 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/product-agent.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/runtime.d.ts +117 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/runtime.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/runtime.js +252 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/runtime.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.d.ts +68 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.js +104 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/storage-domain.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.d.ts +82 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.js +243 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/surfaces.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/testing.d.ts +157 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/testing.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/testing.js +266 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/testing.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.d.ts +21 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.js +37 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/tool-names.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/types.d.ts +592 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/types.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/types.js +10 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/types.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/values.d.ts +58 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/values.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/values.js +75 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/values.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.d.ts +45 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.d.ts.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.js +29 -0
- package/node_modules/@xrkseek/claude-code-mods/dist/working-directory.js.map +1 -0
- package/node_modules/@xrkseek/claude-code-mods/package.json +47 -0
- package/node_modules/@xrkseek/code-runtime/README.md +20 -20
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts +87 -0
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js +9 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/package.json +42 -42
- package/node_modules/@xrkseek/core-session/README.md +35 -35
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js +62 -37
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/freeze.d.ts +6 -0
- package/node_modules/@xrkseek/core-session/dist/freeze.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/freeze.js +9 -0
- package/node_modules/@xrkseek/core-session/dist/freeze.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.d.ts +18 -2
- package/node_modules/@xrkseek/core-session/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.js +53 -12
- package/node_modules/@xrkseek/core-session/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/list-hints.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/list-hints.js +14 -4
- package/node_modules/@xrkseek/core-session/dist/list-hints.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/repair-open-turn.d.ts +8 -1
- package/node_modules/@xrkseek/core-session/dist/repair-open-turn.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/repair-open-turn.js +14 -4
- package/node_modules/@xrkseek/core-session/dist/repair-open-turn.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts +55 -0
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.js +670 -92
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/store.d.ts +38 -0
- package/node_modules/@xrkseek/core-session/dist/store.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/package.json +34 -34
- package/node_modules/@xrkseek/core-system-prompt/README.md +14 -14
- package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js +3 -2
- package/node_modules/@xrkseek/core-tools/dist/session-query-prompt.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/std-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/std-tools.js +1 -13
- package/node_modules/@xrkseek/core-tools/dist/std-tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-computer-use/README.md +14 -14
- package/node_modules/@xrkseek/exec-computer-use/dist/windows-uia.js +402 -402
- package/node_modules/@xrkseek/exec-computer-use/package.json +26 -26
- package/node_modules/@xrkseek/exec-fs/README.md +12 -12
- package/node_modules/@xrkseek/exec-fs/dist/read-image.js +4 -4
- package/node_modules/@xrkseek/exec-image-gen/README.md +13 -13
- package/node_modules/@xrkseek/exec-image-gen/package.json +28 -28
- package/node_modules/@xrkseek/exec-memory/README.md +14 -14
- package/node_modules/@xrkseek/exec-memory/dist/live-fragment.d.ts +11 -0
- package/node_modules/@xrkseek/exec-memory/dist/live-fragment.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-memory/dist/live-fragment.js +40 -0
- package/node_modules/@xrkseek/exec-memory/dist/live-fragment.js.map +1 -0
- package/node_modules/@xrkseek/exec-memory/package.json +28 -28
- package/node_modules/@xrkseek/exec-sandbox/README.md +15 -15
- package/node_modules/@xrkseek/exec-ssh/README.md +19 -19
- package/node_modules/@xrkseek/exec-subprocess/README.md +10 -10
- package/node_modules/@xrkseek/exec-video-analyze/README.md +11 -11
- package/node_modules/@xrkseek/exec-video-analyze/package.json +26 -26
- package/node_modules/@xrkseek/exec-video-gen/README.md +26 -26
- package/node_modules/@xrkseek/exec-voice/README.md +25 -25
- package/node_modules/@xrkseek/exec-web/README.md +11 -11
- package/node_modules/@xrkseek/llm-deepseek/README.md +22 -22
- package/node_modules/@xrkseek/llm-deepseek/package.json +30 -30
- package/node_modules/@xrkseek/llm-registry/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/llm-registry/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/index.js +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/types.d.ts +29 -0
- package/node_modules/@xrkseek/llm-registry/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/types.js +21 -0
- package/node_modules/@xrkseek/llm-registry/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/mcp/README.md +78 -78
- package/node_modules/@xrkseek/policy/README.md +18 -18
- package/node_modules/@xrkseek/policy/package.json +31 -31
- package/node_modules/@xrkseek/preset-harness/README.md +7 -7
- package/node_modules/@xrkseek/preset-harness/dist/mods.d.ts +68 -0
- package/node_modules/@xrkseek/preset-harness/dist/mods.d.ts.map +1 -0
- package/node_modules/@xrkseek/preset-harness/dist/mods.js +510 -0
- package/node_modules/@xrkseek/preset-harness/dist/mods.js.map +1 -0
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +12 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +73 -26
- 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 +9 -8
- package/node_modules/@xrkseek/preset-minimal/README.md +6 -6
- package/node_modules/@xrkseek/preset-minimal/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/preset.js +9 -3
- package/node_modules/@xrkseek/preset-minimal/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/README.md +4 -4
- package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js +2 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/README.md +34 -34
- package/node_modules/@xrkseek/protocol/dist/index.d.ts +3 -2
- package/node_modules/@xrkseek/protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.js +1 -0
- 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 +9 -0
- package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/json-value.d.ts +25 -0
- package/node_modules/@xrkseek/protocol/dist/json-value.d.ts.map +1 -0
- package/node_modules/@xrkseek/protocol/dist/json-value.js +181 -0
- package/node_modules/@xrkseek/protocol/dist/json-value.js.map +1 -0
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +21 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.js +1 -0
- package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.d.ts +4 -1
- package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.js +28 -2
- package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
- package/node_modules/@xrkseek/schemastery/lib/index.cjs +597 -597
- package/node_modules/@xrkseek/schemastery/lib/index.mjs +597 -597
- package/node_modules/@xrkseek/schemastery/lib/types/index.d.ts +203 -203
- package/node_modules/@xrkseek/schemastery/src/index.d.ts +203 -203
- package/node_modules/@xrkseek/schemastery/src/index.ts +906 -906
- package/node_modules/@xrkseek/server-config/package.json +28 -28
- package/node_modules/@xrkseek/server-cron/README.md +12 -12
- package/node_modules/@xrkseek/server-cron/package.json +26 -26
- package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.d.ts +22 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.js +40 -3
- package/node_modules/@xrkseek/server-face/dist/adapt/history-paginate.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.js +2 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/subagent-notice.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 +2 -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 +5 -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 +7 -0
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-ids.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.d.ts +31 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.js +71 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home-boundary.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home.d.ts +18 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home.js +64 -0
- package/node_modules/@xrkseek/server-face/dist/agent-home.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts +41 -2
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js +200 -28
- package/node_modules/@xrkseek/server-face/dist/agent-roster-store.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js +1 -1
- package/node_modules/@xrkseek/server-face/dist/agent-team-roles.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/attach-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/attach-http.js +9 -0
- package/node_modules/@xrkseek/server-face/dist/attach-http.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.d.ts +55 -0
- package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.js +167 -0
- package/node_modules/@xrkseek/server-face/dist/boss-status-broadcast.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/collab-board.d.ts +12 -0
- package/node_modules/@xrkseek/server-face/dist/collab-board.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/collab-board.js +101 -19
- package/node_modules/@xrkseek/server-face/dist/collab-board.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts +25 -2
- package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +6 -2
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/fork-cut.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/fork-cut.js +15 -3
- package/node_modules/@xrkseek/server-face/dist/fork-cut.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/fork-lineage.d.ts +7 -0
- package/node_modules/@xrkseek/server-face/dist/fork-lineage.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/fork-lineage.js +23 -8
- package/node_modules/@xrkseek/server-face/dist/fork-lineage.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/band.d.ts +7 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/band.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/band.js +40 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/band.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js +81 -3
- package/node_modules/@xrkseek/server-face/dist/handlers/checkpoint.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js +4 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/remotes.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +236 -62
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/team.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/team.js +100 -9
- package/node_modules/@xrkseek/server-face/dist/handlers/team.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts +8 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js +15 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/worktree.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +5 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +5 -1
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.d.ts +19 -0
- package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.js +28 -0
- package/node_modules/@xrkseek/server-face/dist/instruction-authority-fragment.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/log-cut-reset.d.ts +3 -0
- package/node_modules/@xrkseek/server-face/dist/log-cut-reset.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/log-cut-reset.js +22 -0
- package/node_modules/@xrkseek/server-face/dist/log-cut-reset.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts +66 -4
- package/node_modules/@xrkseek/server-face/dist/managed-worktree.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/managed-worktree.js +147 -5
- package/node_modules/@xrkseek/server-face/dist/managed-worktree.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js +60 -5
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts +2 -2
- package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/index.js +2 -2
- package/node_modules/@xrkseek/server-face/dist/projections/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.d.ts +50 -4
- package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.js +167 -19
- package/node_modules/@xrkseek/server-face/dist/projections/list-checkpoint-cache.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.d.ts +21 -1
- package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.js +21 -1
- package/node_modules/@xrkseek/server-face/dist/projections/snapshot-keys.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js +58 -0
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-timeline.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js +85 -0
- package/node_modules/@xrkseek/server-face/dist/projections/units/cost-usage.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.js +14 -0
- package/node_modules/@xrkseek/server-face/dist/projections/units/session-list-metadata.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/title.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/title.js +14 -0
- package/node_modules/@xrkseek/server-face/dist/projections/units/title.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js +24 -0
- package/node_modules/@xrkseek/server-face/dist/projections/units/turn-outline.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts +4 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.js +127 -17
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/seat-identity.d.ts +26 -0
- package/node_modules/@xrkseek/server-face/dist/seat-identity.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/seat-identity.js +137 -0
- package/node_modules/@xrkseek/server-face/dist/seat-identity.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/seat-titles.d.ts +29 -0
- package/node_modules/@xrkseek/server-face/dist/seat-titles.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/seat-titles.js +74 -0
- package/node_modules/@xrkseek/server-face/dist/seat-titles.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-capability.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-capability.js +9 -6
- package/node_modules/@xrkseek/server-face/dist/session-capability.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-cwd.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-cwd.js +3 -1
- package/node_modules/@xrkseek/server-face/dist/session-cwd.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-event-window.d.ts +37 -0
- package/node_modules/@xrkseek/server-face/dist/session-event-window.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-event-window.js +88 -0
- package/node_modules/@xrkseek/server-face/dist/session-event-window.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-identity-store.d.ts +20 -0
- package/node_modules/@xrkseek/server-face/dist/session-identity-store.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-identity-store.js +82 -0
- package/node_modules/@xrkseek/server-face/dist/session-identity-store.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-posture.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-posture.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-posture.js +20 -5
- package/node_modules/@xrkseek/server-face/dist/session-posture.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-query-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-query-tools.js +172 -25
- package/node_modules/@xrkseek/server-face/dist/session-query-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-search.d.ts +20 -2
- package/node_modules/@xrkseek/server-face/dist/session-search.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-search.js +125 -19
- package/node_modules/@xrkseek/server-face/dist/session-search.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +143 -21
- package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-thread-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js +5 -0
- package/node_modules/@xrkseek/server-face/dist/session-thread-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js +2 -1
- package/node_modules/@xrkseek/server-face/dist/session-tool-copy.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js +10 -2
- package/node_modules/@xrkseek/server-face/dist/settings-credentials.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +48 -10
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-documents.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-documents.js +14 -4
- package/node_modules/@xrkseek/server-face/dist/skill-documents.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts +4 -2
- package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-list.js +10 -4
- package/node_modules/@xrkseek/server-face/dist/skill-list.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-read.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-read.js +9 -2
- package/node_modules/@xrkseek/server-face/dist/skill-read.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-source.d.ts +2 -1
- package/node_modules/@xrkseek/server-face/dist/skill-source.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-source.js +12 -2
- package/node_modules/@xrkseek/server-face/dist/skill-source.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/slash.d.ts +10 -1
- package/node_modules/@xrkseek/server-face/dist/slash.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/slash.js +97 -22
- package/node_modules/@xrkseek/server-face/dist/slash.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.js +53 -0
- package/node_modules/@xrkseek/server-face/dist/status-snapshot-cache.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 +10 -5
- package/node_modules/@xrkseek/server-face/dist/subagent-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/types.d.ts +23 -0
- package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts +6 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js +17 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-checkpoint.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js +19 -14
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-member-look.d.ts +22 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-member-look.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-member-look.js +35 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-member-look.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.d.ts +3 -2
- package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.js +74 -57
- package/node_modules/@xrkseek/server-face/dist/workspace-orchestrate-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +31 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +109 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js +7 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js.map +1 -1
- package/node_modules/@xrkseek/server-face/package.json +60 -60
- package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts +16 -2
- package/node_modules/@xrkseek/server-host/dist/agent-cache.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/agent-cache.js +84 -36
- package/node_modules/@xrkseek/server-host/dist/agent-cache.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +37 -6
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +124 -27
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/log.d.ts +6 -0
- package/node_modules/@xrkseek/server-host/dist/log.d.ts.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 +17 -2
- package/node_modules/@xrkseek/server-host/dist/sidebar-face-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/standing-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/standing-tools.js +3 -3
- package/node_modules/@xrkseek/server-host/dist/standing-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-host/package.json +75 -75
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts +5 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js +41 -6
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/generic-plugin-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/genui-browser-runtime.js +188 -188
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js +292 -24
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-auth.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js +12 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access-gate.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts +16 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js +47 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/mobile-access.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/skin-center.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/token-usage-stats-dash.js +53 -53
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts +9 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js +39 -20
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/underlying/mobile-gate-kit.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts +2 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js +2 -1
- package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.d.ts +11 -0
- package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.js +85 -0
- package/node_modules/@xrkseek/server-http/dist/sunflower-free/ensure.js.map +1 -0
- package/node_modules/@xrkseek/server-http/package.json +72 -72
- package/node_modules/@xrkseek/server-loader/dist/load.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-loader/dist/load.js +132 -0
- package/node_modules/@xrkseek/server-loader/dist/load.js.map +1 -1
- package/node_modules/@xrkseek/session-projection/README.md +26 -26
- package/node_modules/@xrkseek/session-projection/dist/index.d.ts +31 -2
- package/node_modules/@xrkseek/session-projection/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/session-projection/dist/index.js +135 -19
- package/node_modules/@xrkseek/session-projection/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/session-telemetry/README.md +11 -11
- package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/session-telemetry/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/session-telemetry/dist/index.js +1 -0
- package/node_modules/@xrkseek/session-telemetry/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/session-telemetry/dist/redact.d.ts +14 -0
- package/node_modules/@xrkseek/session-telemetry/dist/redact.d.ts.map +1 -0
- package/node_modules/@xrkseek/session-telemetry/dist/redact.js +58 -0
- package/node_modules/@xrkseek/session-telemetry/dist/redact.js.map +1 -0
- package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.d.ts +7 -0
- package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.js +43 -12
- package/node_modules/@xrkseek/session-telemetry/dist/wrap-store.js.map +1 -1
- package/node_modules/@xrkseek/session-telemetry/package.json +27 -27
- package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts +13 -0
- package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/durable-inject.js +40 -4
- package/node_modules/@xrkseek/workspace/dist/durable-inject.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts +10 -9
- package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js +67 -19
- package/node_modules/@xrkseek/workspace/dist/ecosystem-instructions.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.d.ts +19 -20
- package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.js +43 -20
- package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.d.ts +2 -0
- package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.js +23 -12
- package/node_modules/@xrkseek/workspace/dist/inject-fingerprint.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/inject-sources.d.ts +7 -4
- package/node_modules/@xrkseek/workspace/dist/inject-sources.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/inject-sources.js +10 -0
- package/node_modules/@xrkseek/workspace/dist/inject-sources.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/instruction-authority.d.ts +27 -0
- package/node_modules/@xrkseek/workspace/dist/instruction-authority.d.ts.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/instruction-authority.js +78 -0
- package/node_modules/@xrkseek/workspace/dist/instruction-authority.js.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/skill-dirs.d.ts +7 -0
- package/node_modules/@xrkseek/workspace/dist/skill-dirs.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-dirs.js +4 -2
- package/node_modules/@xrkseek/workspace/dist/skill-dirs.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-tools.js +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-tools.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skills.d.ts +13 -1
- package/node_modules/@xrkseek/workspace/dist/skills.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skills.js +45 -5
- package/node_modules/@xrkseek/workspace/dist/skills.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.d.ts +26 -0
- package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.d.ts.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.js +80 -0
- package/node_modules/@xrkseek/workspace/dist/standing-skill-dirs.js.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts +7 -1
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js +21 -1
- package/node_modules/@xrkseek/workspace/dist/workspace-anchor.js.map +1 -1
- package/node_modules/@xrkseek/workspace/package.json +28 -28
- package/node_modules/@xrkseek/xrk-agent/lib/index.js +1 -793
- package/node_modules/@xrkseek/xrk-agent/lib/invariant.js +1 -23
- package/node_modules/@xrkseek/xrk-attachment/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-attachment/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/brand.js +10 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/error.js +48 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/index.js +42 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/invariant.js +16 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/types.d.ts +6 -0
- package/node_modules/@xrkseek/xrk-attachment/lib/types/types.js +3 -0
- package/node_modules/@xrkseek/xrk-attachment/package.json +1 -0
- package/node_modules/@xrkseek/xrk-brand/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-brand/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-brand/lib/types/index.js +24 -0
- package/node_modules/@xrkseek/xrk-brand/lib/types/invariant.js +22 -0
- package/node_modules/@xrkseek/xrk-brand/package.json +1 -0
- package/node_modules/@xrkseek/xrk-commands/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-commands/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-file-reference-local/README.md +46 -46
- package/node_modules/@xrkseek/xrk-file-reference-local/README.zh.md +46 -46
- package/node_modules/@xrkseek/xrk-file-reference-local/package.json +30 -30
- package/node_modules/@xrkseek/xrk-invariants/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-invariants/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-invariants/lib/types/index.js +148 -0
- package/node_modules/@xrkseek/xrk-invariants/lib/types/invariant.js +22 -0
- package/node_modules/@xrkseek/xrk-invariants/package.json +1 -0
- package/node_modules/@xrkseek/xrk-llm/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-llm/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-llm/lib/types/index.js +4 -0
- package/node_modules/@xrkseek/xrk-llm/lib/types/types.d.ts +11 -0
- package/node_modules/@xrkseek/xrk-permission-presets/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-permission-presets/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-scope/lib/index.js +1 -0
- package/node_modules/@xrkseek/xrk-scope/lib/types/index.d.ts +129 -0
- package/node_modules/@xrkseek/xrk-scope/lib/types/index.js +243 -0
- package/node_modules/@xrkseek/xrk-scope/package.json +34 -0
- package/node_modules/@xrkseek/xrk-session/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-session/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-session-projection/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-session-projection/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-session-reference/README.md +50 -50
- package/node_modules/@xrkseek/xrk-session-reference/README.zh.md +50 -50
- package/node_modules/@xrkseek/xrk-session-reference/dist/prepare-face.js +13 -13
- package/node_modules/@xrkseek/xrk-session-reference/dist/spill.js +2 -2
- package/node_modules/@xrkseek/xrk-session-reference/package.json +56 -56
- package/node_modules/@xrkseek/xrk-settings/lib/index.js +1 -638
- package/node_modules/@xrkseek/xrk-settings/lib/invariant.js +1 -67
- package/node_modules/@xrkseek/xrk-system-prompt/package.json +15 -15
- package/node_modules/@xrkseek/xrk-system-prompt/src/index.ts +144 -144
- package/node_modules/@xrkseek/xrk-token-meter/README.i18n.yaml +6 -0
- package/node_modules/@xrkseek/xrk-token-meter/README.md +68 -0
- package/node_modules/@xrkseek/xrk-token-meter/README.zh.md +68 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/index.js +1 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/breakdown-projection.d.ts +29 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/breakdown-projection.js +56 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/client.d.ts +9 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/client.js +7 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/estimate.d.ts +42 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/estimate.js +79 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/index.d.ts +62 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/index.js +250 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/invariant.d.ts +16 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/invariant.js +30 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/projection.d.ts +74 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/projection.js +7 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-fold.d.ts +38 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-fold.js +47 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-projection.d.ts +59 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/surface-projection.js +66 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/turn-usage.d.ts +33 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/turn-usage.js +247 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/types.d.ts +44 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/types.js +7 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/usage-projection.d.ts +64 -0
- package/node_modules/@xrkseek/xrk-token-meter/lib/types/usage-projection.js +161 -0
- package/node_modules/@xrkseek/xrk-token-meter/package.json +57 -0
- package/node_modules/@xrkseek/xrk-tools/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-tools/lib/invariant.js +1 -1
- package/node_modules/@xrkseek/xrk-tools/src/presentation.ts +39 -39
- package/node_modules/@xrkseek/xrk-typert-protocol/lib/index.js +1 -1
- package/node_modules/@xrkseek/xrk-typert-protocol/lib/invariant.js +1 -0
- package/node_modules/@xrkseek/xrk-workflow/README.md +73 -73
- package/node_modules/@xrkseek/xrk-workflow/README.zh.md +72 -72
- package/node_modules/@xrkseek/xrk-workflow/lib/types/index.js +118 -118
- package/package.json +7 -1
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts +0 -14
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.d.ts.map +0 -1
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.js +0 -21
- package/node_modules/@xrkseek/llm/dist/reasoning-effort.js.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.mts +0 -3734
- package/node_modules/@xrkseek/server-face/dist/index.d.mts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/index.mjs +0 -22085
- package/node_modules/@xrkseek/server-face/dist/index.mjs.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts +0 -51
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.js +0 -104
- package/node_modules/@xrkseek/server-face/dist/model-reasoning.js.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts +0 -2
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js +0 -98
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-agent.js.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts +0 -18
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js +0 -141
- package/node_modules/@xrkseek/server-host/dist/sidebar-pty-worker.js.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts +0 -30
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js +0 -96
- package/node_modules/@xrkseek/server-host/dist/win-fd-inherit.js.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attach point for this product's runtime.
|
|
3
|
+
*
|
|
4
|
+
* The bridge itself (`ClaudeCodeMods`) raises events; what it cannot know is
|
|
5
|
+
* *which* seams this host has. Upstream those seams were Cordis events
|
|
6
|
+
* (`agent/created`, `agent/pre-step`, `tools/execute`) published by its own
|
|
7
|
+
* agent and tool services. Our shipped runtime drives `core-agent` and
|
|
8
|
+
* `core-tools` instead, whose extension point for per-call interception is
|
|
9
|
+
* `ToolPipeline` — so this module wires the bridge onto that pipeline and
|
|
10
|
+
* exposes the remaining dispatches for the seams a caller owns.
|
|
11
|
+
*
|
|
12
|
+
* What is wired here:
|
|
13
|
+
*
|
|
14
|
+
* - **`tool.call`** — through `pipeline.onPre` (refusals) and `pipeline.onPost`
|
|
15
|
+
* (result replacement), so a plugin observes and can veto every tool call the
|
|
16
|
+
* agent makes, in both directions.
|
|
17
|
+
*
|
|
18
|
+
* What a caller dispatches through {@link AttachedClaudeCodeMods.dispatch}:
|
|
19
|
+
*
|
|
20
|
+
* - `session.start` / `session.end` — wherever the host creates and disposes an
|
|
21
|
+
* agent (one call each).
|
|
22
|
+
* - `prompt.submit` / `turn.start` / `turn.complete` — the same place the host
|
|
23
|
+
* admits a prompt and observes a completed turn.
|
|
24
|
+
* - `command.run` / `ui.render` — raised by the command registry and the band,
|
|
25
|
+
* respectively, once those are wired; the engine serves both already.
|
|
26
|
+
*
|
|
27
|
+
* The bridge does not invent these calls: an unattached event is simply one no
|
|
28
|
+
* plugin sees, which is the honest state rather than a silently partial one.
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
import type { Context } from "@xrkseek/cordis";
|
|
32
|
+
import type { ToolPipeline, ToolPipelineContext } from "@xrkseek/core-tools";
|
|
33
|
+
import { type Config } from "./index.js";
|
|
34
|
+
import type { LoadedMod } from "./chain.js";
|
|
35
|
+
import { type ToolNameAliases } from "./tool-names.js";
|
|
36
|
+
import type { ModAgent } from "./types.js";
|
|
37
|
+
export interface AttachClaudeCodeModsOptions {
|
|
38
|
+
readonly ctx: Context;
|
|
39
|
+
/**
|
|
40
|
+
* The composition's existing tool pipeline. Omitted for a host that wants the
|
|
41
|
+
* bridge without tool interception (for example a `plugin validate` run).
|
|
42
|
+
*/
|
|
43
|
+
readonly pipeline?: ToolPipeline;
|
|
44
|
+
/**
|
|
45
|
+
* Which agent a tool call belongs to.
|
|
46
|
+
*
|
|
47
|
+
* `ToolCall` carries no session identity, so this is the host's knowledge to
|
|
48
|
+
* supply. Returning `undefined` is allowed: mods still see the call, but
|
|
49
|
+
* `$.session.*` and `$.prompt.submit` refuse for that event because there is
|
|
50
|
+
* no session to speak for.
|
|
51
|
+
*/
|
|
52
|
+
readonly agentOf?: (context: ToolPipelineContext) => ModAgent | undefined;
|
|
53
|
+
/** Plugin directories to load, in chain order. */
|
|
54
|
+
readonly dirs?: readonly string[];
|
|
55
|
+
/** Bridge configuration (timeouts, tool aliases). */
|
|
56
|
+
readonly config?: Config;
|
|
57
|
+
/**
|
|
58
|
+
* Claude Code ↔ harness tool-name translation.
|
|
59
|
+
*
|
|
60
|
+
* A plugin's matchers and `e.tool` use Claude Code's names (`Bash`, `Read`),
|
|
61
|
+
* while our registry names tools in lowercase; without translation a
|
|
62
|
+
* `{ tool: 'Bash' }` matcher would never match. Defaults to the built-in table.
|
|
63
|
+
*/
|
|
64
|
+
readonly toolAliases?: ToolNameAliases;
|
|
65
|
+
}
|
|
66
|
+
export interface AttachedClaudeCodeMods {
|
|
67
|
+
/** The loaded mods in chain order. */
|
|
68
|
+
readonly mods: readonly LoadedMod[];
|
|
69
|
+
/**
|
|
70
|
+
* Raise one engine event from a seam this module did not wire itself.
|
|
71
|
+
* @param event - engine event name (`session.start`, `turn.complete`, …).
|
|
72
|
+
* @param input - the payload mods receive.
|
|
73
|
+
* @param fallback - the answer when no mod decides.
|
|
74
|
+
* @param options - agent binding and cancellation for the dispatch.
|
|
75
|
+
* @returns the chain's answer.
|
|
76
|
+
*/
|
|
77
|
+
dispatch<I, R>(event: string, input: I, fallback: (input: I) => R, options?: {
|
|
78
|
+
readonly agent?: ModAgent;
|
|
79
|
+
readonly signal?: AbortSignal;
|
|
80
|
+
}): Promise<R>;
|
|
81
|
+
/** Undo every handler this attach installed. Loaded mods stay loaded. */
|
|
82
|
+
dispose(): void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Mount the bridge on this composition and wire `tool.call` to its pipeline.
|
|
86
|
+
*
|
|
87
|
+
* Mounting is `await`ed to completion: a plugin whose `register` throws must
|
|
88
|
+
* fail here, at composition time, rather than half-loading and surfacing later
|
|
89
|
+
* as hooks that never fire.
|
|
90
|
+
*/
|
|
91
|
+
export declare function attachClaudeCodeMods(options: AttachClaudeCodeModsOptions): Promise<AttachedClaudeCodeMods>;
|
|
92
|
+
//# sourceMappingURL=attach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../src/attach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAuB,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAiC,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,QAAQ,GAAG,SAAS,CAAC;IAC1E,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC;CACxC;AAED,MAAM,WAAW,sBAAsB;IACrC,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IACpC;;;;;;;OAOG;IACH,QAAQ,CAAC,CAAC,EAAE,CAAC,EACX,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACzB,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACrE,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,yEAAyE;IACzE,OAAO,IAAI,IAAI,CAAC;CACjB;AAKD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,sBAAsB,CAAC,CAsFjC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attach point for this product's runtime.
|
|
3
|
+
*
|
|
4
|
+
* The bridge itself (`ClaudeCodeMods`) raises events; what it cannot know is
|
|
5
|
+
* *which* seams this host has. Upstream those seams were Cordis events
|
|
6
|
+
* (`agent/created`, `agent/pre-step`, `tools/execute`) published by its own
|
|
7
|
+
* agent and tool services. Our shipped runtime drives `core-agent` and
|
|
8
|
+
* `core-tools` instead, whose extension point for per-call interception is
|
|
9
|
+
* `ToolPipeline` — so this module wires the bridge onto that pipeline and
|
|
10
|
+
* exposes the remaining dispatches for the seams a caller owns.
|
|
11
|
+
*
|
|
12
|
+
* What is wired here:
|
|
13
|
+
*
|
|
14
|
+
* - **`tool.call`** — through `pipeline.onPre` (refusals) and `pipeline.onPost`
|
|
15
|
+
* (result replacement), so a plugin observes and can veto every tool call the
|
|
16
|
+
* agent makes, in both directions.
|
|
17
|
+
*
|
|
18
|
+
* What a caller dispatches through {@link AttachedClaudeCodeMods.dispatch}:
|
|
19
|
+
*
|
|
20
|
+
* - `session.start` / `session.end` — wherever the host creates and disposes an
|
|
21
|
+
* agent (one call each).
|
|
22
|
+
* - `prompt.submit` / `turn.start` / `turn.complete` — the same place the host
|
|
23
|
+
* admits a prompt and observes a completed turn.
|
|
24
|
+
* - `command.run` / `ui.render` — raised by the command registry and the band,
|
|
25
|
+
* respectively, once those are wired; the engine serves both already.
|
|
26
|
+
*
|
|
27
|
+
* The bridge does not invent these calls: an unattached event is simply one no
|
|
28
|
+
* plugin sees, which is the honest state rather than a silently partial one.
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
import ClaudeCodeMods, {} from "./index.js";
|
|
32
|
+
import { definePluginDir } from "./plugin-dir.js";
|
|
33
|
+
import { createToolNameAliases } from "./tool-names.js";
|
|
34
|
+
import { record } from "./values.js";
|
|
35
|
+
/** A signal that never aborts, for a host seam that supplies none. */
|
|
36
|
+
const DETACHED = new AbortController().signal;
|
|
37
|
+
/**
|
|
38
|
+
* Mount the bridge on this composition and wire `tool.call` to its pipeline.
|
|
39
|
+
*
|
|
40
|
+
* Mounting is `await`ed to completion: a plugin whose `register` throws must
|
|
41
|
+
* fail here, at composition time, rather than half-loading and surfacing later
|
|
42
|
+
* as hooks that never fire.
|
|
43
|
+
*/
|
|
44
|
+
export async function attachClaudeCodeMods(options) {
|
|
45
|
+
const { ctx, pipeline, agentOf } = options;
|
|
46
|
+
const aliases = options.toolAliases ?? createToolNameAliases();
|
|
47
|
+
await ctx.plugin(ClaudeCodeMods, options.config ?? {});
|
|
48
|
+
for (const dir of options.dirs ?? []) {
|
|
49
|
+
await ctx.plugin(await definePluginDir(dir), {});
|
|
50
|
+
}
|
|
51
|
+
const bridge = ctx.claudeCodeMods;
|
|
52
|
+
const disposers = [];
|
|
53
|
+
const bindingOf = (context) => {
|
|
54
|
+
const agent = agentOf?.(context);
|
|
55
|
+
return agent === undefined ? { agent: undefined } : { agent };
|
|
56
|
+
};
|
|
57
|
+
if (pipeline !== undefined) {
|
|
58
|
+
// Before dispatch: a mod may refuse, and its refusal becomes the tool error
|
|
59
|
+
// the model reads — the same place the host's own policy denies.
|
|
60
|
+
disposers.push(pipeline.onPre(async (context) => {
|
|
61
|
+
const input = {
|
|
62
|
+
tool: aliases.toMod(context.call.name),
|
|
63
|
+
tool_use_id: context.call.id,
|
|
64
|
+
...record(context.args),
|
|
65
|
+
};
|
|
66
|
+
const answer = await bridge.raise("tool.call", input, () => ({ result: undefined }), { binding: bindingOf(context), signal: context.signal ?? DETACHED });
|
|
67
|
+
if (answer.deny !== undefined)
|
|
68
|
+
return { action: "deny", reason: answer.deny };
|
|
69
|
+
return { action: "continue", args: context.args };
|
|
70
|
+
}));
|
|
71
|
+
// After dispatch: a mod may replace the result the model will read. `deny`
|
|
72
|
+
// is meaningless here — the call already ran — so only `{ result }` is
|
|
73
|
+
// honoured, and an explicit `isError` survives as a failure.
|
|
74
|
+
disposers.push(pipeline.onPost(async (context) => {
|
|
75
|
+
const input = {
|
|
76
|
+
tool: aliases.toMod(context.call.name),
|
|
77
|
+
tool_use_id: context.call.id,
|
|
78
|
+
...record(context.args),
|
|
79
|
+
};
|
|
80
|
+
const answer = await bridge.raise("tool.call", input, () => ({ result: undefined }), { binding: bindingOf(context), signal: context.signal ?? DETACHED });
|
|
81
|
+
if (answer.result === undefined)
|
|
82
|
+
return { action: "accept" };
|
|
83
|
+
return {
|
|
84
|
+
action: "replace",
|
|
85
|
+
content: typeof answer.result === "string"
|
|
86
|
+
? answer.result
|
|
87
|
+
: JSON.stringify(answer.result),
|
|
88
|
+
...(answer.isError === true ? { isError: true } : {}),
|
|
89
|
+
};
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
mods: bridge.mods,
|
|
94
|
+
dispatch: (event, input, fallback, dispatchOptions = {}) => bridge.raise(event, input, fallback, {
|
|
95
|
+
binding: {
|
|
96
|
+
agent: dispatchOptions.agent,
|
|
97
|
+
},
|
|
98
|
+
signal: dispatchOptions.signal ?? DETACHED,
|
|
99
|
+
}),
|
|
100
|
+
dispose() {
|
|
101
|
+
for (const dispose of disposers.splice(0))
|
|
102
|
+
dispose();
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=attach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.js","sourceRoot":"","sources":["../src/attach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,cAAc,EAAE,EAAe,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAwB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsDrC,sEAAsE;AACtE,MAAM,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC,MAAM,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAoC;IAEpC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,qBAAq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EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACtD,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,GAAG,EAAE,EAAE,EAAE,CACzD,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE;YACnC,OAAO,EAAE;gBACP,KAAK,EAAE,eAAe,CAAC,KAAK;aAC7B;YACD,MAAM,EAAE,eAAe,CAAC,MAAM,IAAI,QAAQ;SAC3C,CAAC;QACJ,OAAO;YACL,KAAK,MAAM,OAAO,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;gBAAE,OAAO,EAAE,CAAC;QACvD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The middleware chain: runs the hooks selected for one event in order, each
|
|
3
|
+
* hook's `next` reaching the hooks beneath and then the engine behavior, under
|
|
4
|
+
* Claude Code's failure rules (skip a hook that throws, times out, or returns
|
|
5
|
+
* no result; keep the result from beneath when it had already called `next`;
|
|
6
|
+
* give a `.catch` handler the chance to answer in its place).
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import type { AnyHook, HookOrigin, HookMatcher, ModsApi, PluginOptions } from "./types.js";
|
|
10
|
+
/** One loaded mod: its plugin identity and the `register` options it received. */
|
|
11
|
+
export interface LoadedMod {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly version: string | undefined;
|
|
14
|
+
/** Absolute directory the mod ships in, as `$.plugin.root` reports it. */
|
|
15
|
+
readonly root: string;
|
|
16
|
+
readonly options: PluginOptions;
|
|
17
|
+
/** Load order; hooks of an earlier mod run outside those of a later one. */
|
|
18
|
+
readonly order: number;
|
|
19
|
+
}
|
|
20
|
+
/** One `on(...)` registration. */
|
|
21
|
+
export interface RegisteredHook {
|
|
22
|
+
readonly mod: LoadedMod;
|
|
23
|
+
readonly event: string;
|
|
24
|
+
readonly matcher: HookMatcher | undefined;
|
|
25
|
+
readonly hook: AnyHook;
|
|
26
|
+
catchHandler: AnyHook | undefined;
|
|
27
|
+
/** Failure kinds already reported for this hook; one line per kind until the mod reloads. */
|
|
28
|
+
readonly reported: Set<string>;
|
|
29
|
+
}
|
|
30
|
+
/** The `next.error.kind === 'timeout'` failure. */
|
|
31
|
+
export declare class HookTimeoutError extends Error {
|
|
32
|
+
constructor(budgetMs: number);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Accounts a hook's own running time: the clock runs while the hook is busy
|
|
36
|
+
* and pauses while it awaits `next` or a mods API call. The deadline promise
|
|
37
|
+
* rejects once the busy time reaches the limit.
|
|
38
|
+
*/
|
|
39
|
+
export declare class BudgetClock {
|
|
40
|
+
readonly ms: number;
|
|
41
|
+
private readonly now;
|
|
42
|
+
private spent;
|
|
43
|
+
private busySince;
|
|
44
|
+
private pauses;
|
|
45
|
+
private stopped;
|
|
46
|
+
private timer;
|
|
47
|
+
private readonly deadline;
|
|
48
|
+
/**
|
|
49
|
+
* @param ms - the running-time limit in milliseconds.
|
|
50
|
+
* @param now - monotonic clock in milliseconds.
|
|
51
|
+
*/
|
|
52
|
+
constructor(ms: number, now?: () => number);
|
|
53
|
+
/** Rejects with {@link HookTimeoutError} when the busy time reaches the limit. */
|
|
54
|
+
get expired(): Promise<never>;
|
|
55
|
+
/** Milliseconds left before the deadline fires. */
|
|
56
|
+
get remainingMs(): number;
|
|
57
|
+
/** Start counting; the hook is busy from now on. */
|
|
58
|
+
start(): void;
|
|
59
|
+
/** Stop counting while the hook awaits `next` or a mods API call. Nested pauses are counted. */
|
|
60
|
+
pause(): void;
|
|
61
|
+
/** Resume counting after the awaited call settled. */
|
|
62
|
+
resume(): void;
|
|
63
|
+
/** The hook settled: no deadline can fire from now on. */
|
|
64
|
+
stop(): void;
|
|
65
|
+
private arm;
|
|
66
|
+
private disarm;
|
|
67
|
+
}
|
|
68
|
+
/** Everything one dispatch needs besides the hooks themselves. */
|
|
69
|
+
export interface DispatchRequest<E, R> {
|
|
70
|
+
readonly event: string;
|
|
71
|
+
readonly input: E;
|
|
72
|
+
/** The engine behavior at the bottom of the chain; receives the input as the chain left it. */
|
|
73
|
+
readonly core: (e: E) => Promise<R> | R;
|
|
74
|
+
readonly origin: HookOrigin;
|
|
75
|
+
/** Hooks whose event pattern selects this event, outermost first; matchers are evaluated per hook. */
|
|
76
|
+
readonly hooks: readonly RegisteredHook[];
|
|
77
|
+
/** Builds the `$` a hook receives; the clock pauses while its calls are awaited. */
|
|
78
|
+
readonly api: (hook: RegisteredHook, clock: BudgetClock) => ModsApi;
|
|
79
|
+
/** A hook's own running-time limit. */
|
|
80
|
+
readonly budgetMs: number;
|
|
81
|
+
/** A `.catch` handler's running-time limit. */
|
|
82
|
+
readonly catchBudgetMs: number;
|
|
83
|
+
readonly signal: AbortSignal;
|
|
84
|
+
/** Receives one diagnostic line per skipped hook and failure kind. */
|
|
85
|
+
readonly report: (line: string) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Checks the input a hook passes to `next` before anything beneath runs; a
|
|
88
|
+
* throw skips that hook as a failure of its own and the chain continues with
|
|
89
|
+
* the input the hook received.
|
|
90
|
+
*/
|
|
91
|
+
readonly validateNext?: (e: E, hook: RegisteredHook) => void;
|
|
92
|
+
}
|
|
93
|
+
/** Thrown by {@link DispatchRequest.validateNext}: the hook asked for a rewrite this host does not serve. */
|
|
94
|
+
export declare class RewriteRefusedError extends Error {
|
|
95
|
+
constructor(message: string);
|
|
96
|
+
}
|
|
97
|
+
/** The engine's own origin. */
|
|
98
|
+
export declare const ENGINE_ORIGIN: HookOrigin;
|
|
99
|
+
/**
|
|
100
|
+
* Run one event through its hooks and the engine behavior.
|
|
101
|
+
* @param request - the event, its hooks, and the engine behavior beneath them.
|
|
102
|
+
* @returns the event's result as the outermost hook returned it.
|
|
103
|
+
*/
|
|
104
|
+
export declare function dispatch<E, R>(request: DispatchRequest<E, R>): Promise<R>;
|
|
105
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,OAAO,EAEP,UAAU,EACV,WAAW,EACX,OAAO,EAEP,aAAa,EACd,MAAM,YAAY,CAAC;AAGpB,kFAAkF;AAClF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,6FAA6F;IAC7F,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,mDAAmD;AACnD,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,QAAQ,EAAE,MAAM;CAI7B;AAED;;;;GAIG;AACH,qBAAa,WAAW;IAapB,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAbtB,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,SAAS,C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CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9D;AAED,6GAA6G;AAC7G,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED,+BAA+B;AAC/B,eAAO,MAAM,aAAa,EAAE,UAG1B,CAAC;AA8BH;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAqN/E"}
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The middleware chain: runs the hooks selected for one event in order, each
|
|
3
|
+
* hook's `next` reaching the hooks beneath and then the engine behavior, under
|
|
4
|
+
* Claude Code's failure rules (skip a hook that throws, times out, or returns
|
|
5
|
+
* no result; keep the result from beneath when it had already called `next`;
|
|
6
|
+
* give a `.catch` handler the chance to answer in its place).
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { deepFreeze } from "./values.js";
|
|
10
|
+
import { messageOf } from "./values.js";
|
|
11
|
+
import { matcherMatches } from "./matcher.js";
|
|
12
|
+
/** The `next.error.kind === 'timeout'` failure. */
|
|
13
|
+
export class HookTimeoutError extends Error {
|
|
14
|
+
constructor(budgetMs) {
|
|
15
|
+
super(`ran past its ${budgetMs} ms limit`);
|
|
16
|
+
this.name = "HookTimeoutError";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Accounts a hook's own running time: the clock runs while the hook is busy
|
|
21
|
+
* and pauses while it awaits `next` or a mods API call. The deadline promise
|
|
22
|
+
* rejects once the busy time reaches the limit.
|
|
23
|
+
*/
|
|
24
|
+
export class BudgetClock {
|
|
25
|
+
ms;
|
|
26
|
+
now;
|
|
27
|
+
spent = 0;
|
|
28
|
+
busySince;
|
|
29
|
+
pauses = 0;
|
|
30
|
+
stopped = false;
|
|
31
|
+
timer;
|
|
32
|
+
deadline = Promise.withResolvers();
|
|
33
|
+
/**
|
|
34
|
+
* @param ms - the running-time limit in milliseconds.
|
|
35
|
+
* @param now - monotonic clock in milliseconds.
|
|
36
|
+
*/
|
|
37
|
+
constructor(ms, now = () => performance.now()) {
|
|
38
|
+
this.ms = ms;
|
|
39
|
+
this.now = now;
|
|
40
|
+
// The deadline only matters while a race awaits it; an unobserved
|
|
41
|
+
// rejection after the hook settled must not surface.
|
|
42
|
+
this.deadline.promise.catch(() => { });
|
|
43
|
+
}
|
|
44
|
+
/** Rejects with {@link HookTimeoutError} when the busy time reaches the limit. */
|
|
45
|
+
get expired() {
|
|
46
|
+
return this.deadline.promise;
|
|
47
|
+
}
|
|
48
|
+
/** Milliseconds left before the deadline fires. */
|
|
49
|
+
get remainingMs() {
|
|
50
|
+
const busy = this.busySince === undefined ? 0 : this.now() - this.busySince;
|
|
51
|
+
return Math.max(0, this.ms - this.spent - busy);
|
|
52
|
+
}
|
|
53
|
+
/** Start counting; the hook is busy from now on. */
|
|
54
|
+
start() {
|
|
55
|
+
if (this.stopped)
|
|
56
|
+
return;
|
|
57
|
+
this.busySince = this.now();
|
|
58
|
+
this.arm();
|
|
59
|
+
}
|
|
60
|
+
/** Stop counting while the hook awaits `next` or a mods API call. Nested pauses are counted. */
|
|
61
|
+
pause() {
|
|
62
|
+
if (this.stopped)
|
|
63
|
+
return;
|
|
64
|
+
this.pauses += 1;
|
|
65
|
+
if (this.busySince !== undefined) {
|
|
66
|
+
this.spent += this.now() - this.busySince;
|
|
67
|
+
this.busySince = undefined;
|
|
68
|
+
}
|
|
69
|
+
this.disarm();
|
|
70
|
+
}
|
|
71
|
+
/** Resume counting after the awaited call settled. */
|
|
72
|
+
resume() {
|
|
73
|
+
if (this.stopped || this.pauses === 0)
|
|
74
|
+
return;
|
|
75
|
+
this.pauses -= 1;
|
|
76
|
+
if (this.pauses === 0) {
|
|
77
|
+
this.busySince = this.now();
|
|
78
|
+
this.arm();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** The hook settled: no deadline can fire from now on. */
|
|
82
|
+
stop() {
|
|
83
|
+
if (this.busySince !== undefined)
|
|
84
|
+
this.spent += this.now() - this.busySince;
|
|
85
|
+
this.stopped = true;
|
|
86
|
+
this.busySince = undefined;
|
|
87
|
+
this.disarm();
|
|
88
|
+
}
|
|
89
|
+
arm() {
|
|
90
|
+
this.disarm();
|
|
91
|
+
const remaining = this.remainingMs;
|
|
92
|
+
this.timer = setTimeout(() => {
|
|
93
|
+
this.stopped = true;
|
|
94
|
+
this.busySince = undefined;
|
|
95
|
+
this.spent = this.ms;
|
|
96
|
+
this.deadline.reject(new HookTimeoutError(this.ms));
|
|
97
|
+
}, remaining);
|
|
98
|
+
this.timer.unref();
|
|
99
|
+
}
|
|
100
|
+
disarm() {
|
|
101
|
+
if (this.timer !== undefined)
|
|
102
|
+
clearTimeout(this.timer);
|
|
103
|
+
this.timer = undefined;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/** Thrown by {@link DispatchRequest.validateNext}: the hook asked for a rewrite this host does not serve. */
|
|
107
|
+
export class RewriteRefusedError extends Error {
|
|
108
|
+
constructor(message) {
|
|
109
|
+
super(message);
|
|
110
|
+
this.name = "RewriteRefusedError";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** The engine's own origin. */
|
|
114
|
+
export const ENGINE_ORIGIN = Object.freeze({
|
|
115
|
+
plugin: "engine",
|
|
116
|
+
tier: "core",
|
|
117
|
+
});
|
|
118
|
+
/** A hook settled with something other than a result object. */
|
|
119
|
+
class NoResultError extends Error {
|
|
120
|
+
constructor() {
|
|
121
|
+
super("returned no result");
|
|
122
|
+
this.name = "NoResultError";
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** Classify a failed hook and word the diagnostic line's tail. */
|
|
126
|
+
function failureOf(error) {
|
|
127
|
+
if (error instanceof HookTimeoutError)
|
|
128
|
+
return {
|
|
129
|
+
kind: "timeout",
|
|
130
|
+
message: error.message,
|
|
131
|
+
line: `timeout, ${error.message}`,
|
|
132
|
+
};
|
|
133
|
+
if (error instanceof NoResultError || error instanceof RewriteRefusedError)
|
|
134
|
+
return { kind: "throw", message: error.message, line: error.message };
|
|
135
|
+
const message = error instanceof Error ? `${error.name}: ${error.message}` : messageOf(error);
|
|
136
|
+
return { kind: "throw", message, line: `threw ${message}` };
|
|
137
|
+
}
|
|
138
|
+
/** Freeze the event input in place at every depth, as the mods API promises. */
|
|
139
|
+
function freezeInput(input) {
|
|
140
|
+
return typeof input === "object" && input !== null ? deepFreeze(input) : input;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Run one event through its hooks and the engine behavior.
|
|
144
|
+
* @param request - the event, its hooks, and the engine behavior beneath them.
|
|
145
|
+
* @returns the event's result as the outermost hook returned it.
|
|
146
|
+
*/
|
|
147
|
+
export async function dispatch(request) {
|
|
148
|
+
const { hooks } = request;
|
|
149
|
+
async function runFrom(index, input) {
|
|
150
|
+
for (let i = index; i < hooks.length; i += 1) {
|
|
151
|
+
const hook = hooks[i];
|
|
152
|
+
if (hook.matcher !== undefined && !matcherMatches(hook.matcher, input))
|
|
153
|
+
continue;
|
|
154
|
+
return runHook(hook, i, input);
|
|
155
|
+
}
|
|
156
|
+
return request.core(input);
|
|
157
|
+
}
|
|
158
|
+
async function runHook(hook, index, input) {
|
|
159
|
+
const frozen = freezeInput(input);
|
|
160
|
+
const clock = new BudgetClock(request.budgetMs);
|
|
161
|
+
// Closure-written flags live on one object so the catch path reads their current values.
|
|
162
|
+
const state = {
|
|
163
|
+
abandoned: false,
|
|
164
|
+
called: false,
|
|
165
|
+
beneath: undefined,
|
|
166
|
+
beneathError: undefined,
|
|
167
|
+
refused: undefined,
|
|
168
|
+
};
|
|
169
|
+
const next = Object.assign((e) => {
|
|
170
|
+
state.called = true;
|
|
171
|
+
// One run beneath per hook: a second call hands back the first run.
|
|
172
|
+
if (state.beneath !== undefined)
|
|
173
|
+
return state.beneath;
|
|
174
|
+
if (state.abandoned)
|
|
175
|
+
return Promise.resolve(undefined);
|
|
176
|
+
if (request.validateNext !== undefined) {
|
|
177
|
+
try {
|
|
178
|
+
request.validateNext(e, hook);
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
const refused = error instanceof Error ? error : new Error(messageOf(error));
|
|
182
|
+
state.refused = { error: refused };
|
|
183
|
+
return Promise.reject(refused);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
clock.pause();
|
|
187
|
+
state.beneath = runFrom(index + 1, e)
|
|
188
|
+
.catch((error) => {
|
|
189
|
+
state.beneathError = { error };
|
|
190
|
+
throw error;
|
|
191
|
+
})
|
|
192
|
+
.finally(() => {
|
|
193
|
+
clock.resume();
|
|
194
|
+
});
|
|
195
|
+
return state.beneath;
|
|
196
|
+
}, {
|
|
197
|
+
signal: request.signal,
|
|
198
|
+
origin: request.origin,
|
|
199
|
+
budget: {
|
|
200
|
+
ms: request.budgetMs,
|
|
201
|
+
get remainingMs() {
|
|
202
|
+
return clock.remainingMs;
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
to() {
|
|
206
|
+
return Promise.reject(new Error("next.to is only available to mods in managed prependPlugins or appendPlugins"));
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
const api = request.api(hook, clock);
|
|
210
|
+
clock.start();
|
|
211
|
+
try {
|
|
212
|
+
const running = Promise.resolve().then(() => hook.hook(api, frozen, next));
|
|
213
|
+
// An abandoned hook's later rejection is not an unhandled rejection.
|
|
214
|
+
running.catch(() => { });
|
|
215
|
+
const result = await Promise.race([running, clock.expired]);
|
|
216
|
+
// `null` is an answer (a surface drawn empty); only a hook that settles with no object at all is skipped.
|
|
217
|
+
if (typeof result !== "object")
|
|
218
|
+
throw new NoResultError();
|
|
219
|
+
// The hook answered; whatever it started beneath still runs to its end before the event settles.
|
|
220
|
+
clock.stop();
|
|
221
|
+
if (state.beneath !== undefined) {
|
|
222
|
+
await state.beneath.catch((error) => {
|
|
223
|
+
request.report(`${hook.mod.name}: ${request.event}: the chain beneath failed after the hook answered: ${messageOf(error)}`);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
state.abandoned = true;
|
|
230
|
+
// The engine beneath failed, not the hook: the failure is the event's own.
|
|
231
|
+
if (state.beneathError !== undefined && error === state.beneathError.error)
|
|
232
|
+
throw error;
|
|
233
|
+
// A refused rewrite is the hook's failure even when the hook let the rejection through unchanged.
|
|
234
|
+
const failure = failureOf(state.refused !== undefined && error === state.refused.error
|
|
235
|
+
? state.refused.error
|
|
236
|
+
: error);
|
|
237
|
+
// A hook that ran the chain beneath and then returned nothing is the
|
|
238
|
+
// ordinary "observe, do not modify" shape (`await next(e)` followed by a
|
|
239
|
+
// side effect). The result from beneath already stands, so there is
|
|
240
|
+
// nothing to warn about. A hook that returned nothing and never ran
|
|
241
|
+
// anything *is* a mistake worth naming once.
|
|
242
|
+
const observedOnly = error instanceof NoResultError && state.called;
|
|
243
|
+
if (!observedOnly && !hook.reported.has(failure.kind)) {
|
|
244
|
+
hook.reported.add(failure.kind);
|
|
245
|
+
request.report(`${hook.mod.name}: ${request.event} hook skipped: ${failure.line}`);
|
|
246
|
+
}
|
|
247
|
+
if (hook.catchHandler !== undefined) {
|
|
248
|
+
const answered = await runCatch(hook, index, frozen, { kind: failure.kind, message: failure.message }, state);
|
|
249
|
+
if (answered !== undefined)
|
|
250
|
+
return answered;
|
|
251
|
+
}
|
|
252
|
+
// Whatever ran beneath, for the hook or its handler, ran once; its result stands.
|
|
253
|
+
if (state.beneath !== undefined)
|
|
254
|
+
return await state.beneath;
|
|
255
|
+
return await runFrom(index + 1, input);
|
|
256
|
+
}
|
|
257
|
+
finally {
|
|
258
|
+
clock.stop();
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Run the failed hook's `.catch` handler. It shares the hook's beneath state:
|
|
263
|
+
* what the hook already ran is handed back, what the handler runs is recorded
|
|
264
|
+
* for the skip path, so nothing beneath runs twice.
|
|
265
|
+
*/
|
|
266
|
+
async function runCatch(hook, index, input, failure, state) {
|
|
267
|
+
const clock = new BudgetClock(request.catchBudgetMs);
|
|
268
|
+
let handlerAbandoned = false;
|
|
269
|
+
const next = Object.assign((e) => {
|
|
270
|
+
if (state.beneath !== undefined)
|
|
271
|
+
return state.beneath;
|
|
272
|
+
if (handlerAbandoned)
|
|
273
|
+
return Promise.resolve(undefined);
|
|
274
|
+
if (request.validateNext !== undefined) {
|
|
275
|
+
// The same check the hook's own next makes: a handler cannot pass a rewrite beneath either.
|
|
276
|
+
try {
|
|
277
|
+
request.validateNext(e, hook);
|
|
278
|
+
}
|
|
279
|
+
catch (error) {
|
|
280
|
+
return Promise.reject(error instanceof Error ? error : new Error(messageOf(error)));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
clock.pause();
|
|
284
|
+
state.beneath = runFrom(index + 1, e).finally(() => {
|
|
285
|
+
clock.resume();
|
|
286
|
+
});
|
|
287
|
+
return state.beneath;
|
|
288
|
+
}, {
|
|
289
|
+
signal: request.signal,
|
|
290
|
+
origin: request.origin,
|
|
291
|
+
budget: {
|
|
292
|
+
ms: request.catchBudgetMs,
|
|
293
|
+
get remainingMs() {
|
|
294
|
+
return clock.remainingMs;
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
to() {
|
|
298
|
+
return Promise.reject(new Error("next.to is not available in a .catch handler"));
|
|
299
|
+
},
|
|
300
|
+
error: failure,
|
|
301
|
+
called: state.called,
|
|
302
|
+
});
|
|
303
|
+
const api = request.api(hook, clock);
|
|
304
|
+
clock.start();
|
|
305
|
+
try {
|
|
306
|
+
const handler = hook.catchHandler;
|
|
307
|
+
const running = Promise.resolve().then(() => handler(api, input, next));
|
|
308
|
+
running.catch(() => { });
|
|
309
|
+
const result = await Promise.race([running, clock.expired]);
|
|
310
|
+
if (typeof result === "object")
|
|
311
|
+
return result;
|
|
312
|
+
}
|
|
313
|
+
catch (error) {
|
|
314
|
+
request.report(`${hook.mod.name}: ${request.event} .catch handler skipped: ${failureOf(error).line}`);
|
|
315
|
+
}
|
|
316
|
+
finally {
|
|
317
|
+
handlerAbandoned = true;
|
|
318
|
+
clock.stop();
|
|
319
|
+
}
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
return runFrom(0, request.input);
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../src/chain.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAwB9C,mDAAmD;AACnD,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,QAAgB;QAC1B,KAAK,CAAC,gBAAgB,QAAQ,WAAW,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAaX;IACQ;IAbX,KAAK,GAAG,CAAC,CAAC;IACV,SAAS,CAAqB;IAC9B,MAAM,GAAG,CAAC,CAAC;IACX,OAAO,GAAG,KAAK,CAAC;IAChB,KAAK,CAA4C;IACxC,QAAQ,GAAG,OAAO,CAAC,aAAa,EAAS,CAAC;IAE3D;;;OAGG;IACH,YACW,EAAU,EACF,MAAoB,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE;QADnD,OAAE,GAAF,EAAE,C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