@xrkseek/harness-cli 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin/classify.js +1 -1
- package/dist/plugin/classify.js.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts +15 -3
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.js +8 -2
- package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/cancel-finalize.d.ts +6 -3
- package/node_modules/@xrkseek/core-agent-loop/dist/cancel-finalize.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/cancel-finalize.js +50 -4
- package/node_modules/@xrkseek/core-agent-loop/dist/cancel-finalize.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +23 -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 +223 -43
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/llm-retry.d.ts +32 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/llm-retry.d.ts.map +1 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/llm-retry.js +92 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/llm-retry.js.map +1 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts +18 -8
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js +187 -29
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js.map +1 -1
- package/node_modules/@xrkseek/core-session/README.md +1 -1
- package/node_modules/@xrkseek/core-session/dist/chunk-pack.d.ts +18 -4
- package/node_modules/@xrkseek/core-session/dist/chunk-pack.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/chunk-pack.js +114 -34
- package/node_modules/@xrkseek/core-session/dist/chunk-pack.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js +24 -4
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/dangling.d.ts +28 -1
- package/node_modules/@xrkseek/core-session/dist/dangling.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/dangling.js +35 -5
- package/node_modules/@xrkseek/core-session/dist/dangling.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.d.ts +3 -2
- package/node_modules/@xrkseek/core-session/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.js +3 -2
- package/node_modules/@xrkseek/core-session/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/latch.d.ts +1 -1
- package/node_modules/@xrkseek/core-session/dist/latch.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/latch.js +2 -2
- package/node_modules/@xrkseek/core-session/dist/latch.js.map +1 -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 +44 -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 +1 -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 +10 -5
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/surface-fold.d.ts +5 -0
- package/node_modules/@xrkseek/core-session/dist/surface-fold.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/surface-fold.js +29 -3
- package/node_modules/@xrkseek/core-session/dist/surface-fold.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/tool-result-prune.d.ts +35 -0
- package/node_modules/@xrkseek/core-session/dist/tool-result-prune.d.ts.map +1 -0
- package/node_modules/@xrkseek/core-session/dist/tool-result-prune.js +99 -0
- package/node_modules/@xrkseek/core-session/dist/tool-result-prune.js.map +1 -0
- package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/index.js +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.d.ts +15 -2
- package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.js +38 -4
- package/node_modules/@xrkseek/core-system-prompt/dist/three-layer.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/abort.d.ts +5 -0
- package/node_modules/@xrkseek/core-tools/dist/abort.d.ts.map +1 -0
- package/node_modules/@xrkseek/core-tools/dist/abort.js +14 -0
- package/node_modules/@xrkseek/core-tools/dist/abort.js.map +1 -0
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts +32 -1
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/definition.js +1 -0
- package/node_modules/@xrkseek/core-tools/dist/definition.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/execution-mode.d.ts +15 -0
- package/node_modules/@xrkseek/core-tools/dist/execution-mode.d.ts.map +1 -0
- package/node_modules/@xrkseek/core-tools/dist/execution-mode.js +17 -0
- package/node_modules/@xrkseek/core-tools/dist/execution-mode.js.map +1 -0
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts +2 -0
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.js +2 -0
- package/node_modules/@xrkseek/core-tools/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/pipeline.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/pipeline.js +36 -10
- package/node_modules/@xrkseek/core-tools/dist/pipeline.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/types.d.ts +7 -0
- package/node_modules/@xrkseek/core-tools/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/types.js.map +1 -1
- 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-lsp/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-lsp/dist/tools.js +1 -0
- package/node_modules/@xrkseek/exec-lsp/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/index.js +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/registry.d.ts +5 -0
- package/node_modules/@xrkseek/exec-pty/dist/registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/registry.js +17 -1
- package/node_modules/@xrkseek/exec-pty/dist/registry.js.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/render.d.ts +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/render.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/render.js +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/render.js.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-pty/dist/tools.js +15 -4
- package/node_modules/@xrkseek/exec-pty/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js +4 -0
- package/node_modules/@xrkseek/exec-shell/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/search-providers.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/tools.js +2 -0
- package/node_modules/@xrkseek/exec-web/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/llm/dist/failure.d.ts +45 -0
- package/node_modules/@xrkseek/llm/dist/failure.d.ts.map +1 -0
- package/node_modules/@xrkseek/llm/dist/failure.js +115 -0
- package/node_modules/@xrkseek/llm/dist/failure.js.map +1 -0
- package/node_modules/@xrkseek/llm/dist/index.d.ts +80 -1
- package/node_modules/@xrkseek/llm/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm/dist/index.js +167 -2
- package/node_modules/@xrkseek/llm/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm/dist/retry-policy.d.ts +23 -0
- package/node_modules/@xrkseek/llm/dist/retry-policy.d.ts.map +1 -0
- package/node_modules/@xrkseek/llm/dist/retry-policy.js +74 -0
- package/node_modules/@xrkseek/llm/dist/retry-policy.js.map +1 -0
- package/node_modules/@xrkseek/llm-anthropic/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-anthropic/dist/index.js +152 -22
- package/node_modules/@xrkseek/llm-anthropic/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/README.md +3 -3
- package/node_modules/@xrkseek/llm-deepseek/dist/index.d.ts +32 -2
- package/node_modules/@xrkseek/llm-deepseek/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-deepseek/dist/index.js +59 -5
- package/node_modules/@xrkseek/llm-deepseek/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-gemini/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-gemini/dist/index.js +18 -8
- package/node_modules/@xrkseek/llm-gemini/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-openai-compatible/dist/deepseek-thinking.d.ts +16 -0
- package/node_modules/@xrkseek/llm-openai-compatible/dist/deepseek-thinking.d.ts.map +1 -0
- package/node_modules/@xrkseek/llm-openai-compatible/dist/deepseek-thinking.js +40 -0
- package/node_modules/@xrkseek/llm-openai-compatible/dist/deepseek-thinking.js.map +1 -0
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.d.ts +9 -1
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.js +78 -21
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.js +18 -8
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/registry.js +6 -4
- package/node_modules/@xrkseek/llm-registry/dist/registry.js.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/routing-adapter.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-registry/dist/routing-adapter.js +15 -3
- package/node_modules/@xrkseek/llm-registry/dist/routing-adapter.js.map +1 -1
- package/node_modules/@xrkseek/llm-replay/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-replay/dist/index.js +4 -1
- package/node_modules/@xrkseek/llm-replay/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/client.d.ts +3 -1
- package/node_modules/@xrkseek/mcp/dist/client.d.ts.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/client.js +31 -7
- package/node_modules/@xrkseek/mcp/dist/client.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/index.d.ts +2 -2
- package/node_modules/@xrkseek/mcp/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/index.js +1 -1
- package/node_modules/@xrkseek/mcp/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/register.d.ts.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/register.js +3 -0
- package/node_modules/@xrkseek/mcp/dist/register.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/types.d.ts +10 -0
- package/node_modules/@xrkseek/mcp/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +21 -3
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +31 -8
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/preset.d.ts +3 -2
- package/node_modules/@xrkseek/preset-minimal/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/preset.js +13 -7
- 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/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js +5 -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/dist/index.d.ts +3 -1
- package/node_modules/@xrkseek/protocol/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/index.js +3 -1
- package/node_modules/@xrkseek/protocol/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts +72 -0
- package/node_modules/@xrkseek/protocol/dist/json-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/json-schema.js +99 -0
- package/node_modules/@xrkseek/protocol/dist/json-schema.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/messages.d.ts +7 -0
- package/node_modules/@xrkseek/protocol/dist/messages.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts +110 -6
- package/node_modules/@xrkseek/protocol/dist/session-events.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/session-events.js +23 -0
- package/node_modules/@xrkseek/protocol/dist/session-events.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/tools.d.ts +15 -0
- package/node_modules/@xrkseek/protocol/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/tools.js +6 -1
- package/node_modules/@xrkseek/protocol/dist/tools.js.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.d.ts.map +1 -1
- package/node_modules/@xrkseek/protocol/dist/validate.js +234 -1
- package/node_modules/@xrkseek/protocol/dist/validate.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.d.ts +2 -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 +26 -8
- package/node_modules/@xrkseek/server-face/dist/adapt/wire-event.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/goal-store.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/goal-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/goal-store.js +1 -1
- package/node_modules/@xrkseek/server-face/dist/goal-store.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +2 -2
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-resolve.js +1 -1
- package/node_modules/@xrkseek/server-face/dist/llm-resolve.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/registry.d.ts +12 -50
- package/node_modules/@xrkseek/server-face/dist/projections/registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/registry.js +4 -146
- package/node_modules/@xrkseek/server-face/dist/projections/registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-breakdown.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-breakdown.js +13 -11
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-breakdown.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-pressure.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-pressure.js +27 -25
- package/node_modules/@xrkseek/server-face/dist/projections/units/context-pressure.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/image-limits.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/image-limits.js +31 -29
- package/node_modules/@xrkseek/server-face/dist/projections/units/image-limits.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.js +27 -25
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/plan.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/plan.js +12 -10
- package/node_modules/@xrkseek/server-face/dist/projections/units/plan.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 +20 -14
- 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/session-stats.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/session-stats.js +27 -25
- package/node_modules/@xrkseek/server-face/dist/projections/units/session-stats.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 +9 -7
- package/node_modules/@xrkseek/server-face/dist/projections/units/title.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/todos.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/todos.js +25 -23
- package/node_modules/@xrkseek/server-face/dist/projections/units/todos.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/token-usage.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/token-usage.js +14 -12
- package/node_modules/@xrkseek/server-face/dist/projections/units/token-usage.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 +4 -2
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts +8 -13
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +29 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-list.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/skill-list.js +1 -0
- package/node_modules/@xrkseek/server-face/dist/skill-list.js.map +1 -1
- package/node_modules/@xrkseek/server-face/package.json +1 -0
- package/node_modules/@xrkseek/server-host/dist/agent-cache.js +1 -1
- package/node_modules/@xrkseek/server-host/dist/agent-cache.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +8 -0
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +39 -1
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/session-projection/README.md +22 -0
- package/node_modules/@xrkseek/session-projection/dist/index.d.ts +100 -0
- package/node_modules/@xrkseek/session-projection/dist/index.d.ts.map +1 -0
- package/node_modules/@xrkseek/session-projection/dist/index.js +241 -0
- package/node_modules/@xrkseek/session-projection/dist/index.js.map +1 -0
- package/node_modules/@xrkseek/session-projection/dist/types.d.ts +20 -0
- package/node_modules/@xrkseek/session-projection/dist/types.d.ts.map +1 -0
- package/node_modules/@xrkseek/session-projection/dist/types.js +9 -0
- package/node_modules/@xrkseek/session-projection/dist/types.js.map +1 -0
- package/node_modules/@xrkseek/session-projection/package.json +31 -0
- package/node_modules/@xrkseek/workspace/README.md +3 -23
- package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts +62 -0
- package/node_modules/@xrkseek/workspace/dist/durable-inject.d.ts.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/durable-inject.js +146 -0
- package/node_modules/@xrkseek/workspace/dist/durable-inject.js.map +1 -0
- package/node_modules/@xrkseek/workspace/dist/index.d.ts +25 -13
- package/node_modules/@xrkseek/workspace/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/index.js +77 -17
- package/node_modules/@xrkseek/workspace/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skill-tools.js +7 -0
- package/node_modules/@xrkseek/workspace/dist/skill-tools.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skills.d.ts +12 -1
- package/node_modules/@xrkseek/workspace/dist/skills.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/skills.js +42 -4
- package/node_modules/@xrkseek/workspace/dist/skills.js.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/slash.d.ts.map +1 -1
- package/node_modules/@xrkseek/workspace/dist/slash.js +2 -0
- package/node_modules/@xrkseek/workspace/dist/slash.js.map +1 -1
- package/node_modules/@xrkseek/workspace/package.json +2 -1
- package/package.json +3 -1
- package/product-web/assets/index-CcF0Sxxg.js +297 -0
- package/product-web/assets/index-CcF0Sxxg.js.map +1 -0
- package/product-web/assets/langs/{php-9bx0az3O.js → php-DY2VakOf.js} +2 -2
- package/product-web/assets/langs/{php-9bx0az3O.js.map → php-DY2VakOf.js.map} +1 -1
- package/product-web/assets/langs/{ruby-HDLHRjSL.js → ruby-hwtoiFmS.js} +2 -2
- package/product-web/assets/langs/{ruby-HDLHRjSL.js.map → ruby-hwtoiFmS.js.map} +1 -1
- package/product-web/assets/{vendor-CeMKrCZm.js → vendor-CldRVjca.js} +35 -36
- package/product-web/assets/vendor-CldRVjca.js.map +1 -0
- package/product-web/boot.json +1 -1
- package/product-web/index.html +2 -2
- package/product-web/plugins/@xrkseek/client-locale/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-runtime/client.js +37 -1
- package/product-web/plugins/@xrkseek/client-ui-agent-preset/client.js +37 -37
- package/product-web/plugins/@xrkseek/client-ui-commands/client.js +8 -8
- package/product-web/plugins/@xrkseek/client-ui-conversation/client.js +172 -186
- package/product-web/plugins/@xrkseek/client-ui-deliverables/client.js +5 -5
- package/product-web/plugins/@xrkseek/client-ui-directory-picker-browse/client.js +30 -30
- package/product-web/plugins/@xrkseek/client-ui-goal/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-input-trigger/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-jobs/client.js +10 -10
- package/product-web/plugins/@xrkseek/client-ui-layout/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-message-feedback/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-model-selection/client.js +16 -16
- package/product-web/plugins/@xrkseek/client-ui-permission-presets/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-plan/client.js +2 -2
- package/product-web/plugins/@xrkseek/client-ui-settings-general/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-settings-models/client.js +55 -55
- package/product-web/plugins/@xrkseek/client-ui-settings-plugin-inventory/client.js +13 -13
- package/product-web/plugins/@xrkseek/client-ui-settings-plugins/client.js +134 -63
- package/product-web/plugins/@xrkseek/client-ui-sidebar/client.js +14 -14
- package/product-web/plugins/@xrkseek/client-ui-skill/client.js +11 -11
- package/product-web/plugins/@xrkseek/client-ui-subagent/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-theme/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-tool/client.js +43 -43
- package/product-web/plugins/@xrkseek/client-ui-trajectory/client.js +166 -145
- package/product-web/plugins/@xrkseek/client-ui-user-questions/client.js +30 -30
- package/product-web/plugins/@xrkseek/client-ui-workflow-run/client.js +16 -16
- package/product-web/plugins/@xrkseek/client-ui-workspace/client.js +56 -56
- package/node_modules/@xrkseek/server-face/dist/dsh-schema.d.ts +0 -35
- package/node_modules/@xrkseek/server-face/dist/dsh-schema.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/dsh-schema.js +0 -116
- package/node_modules/@xrkseek/server-face/dist/dsh-schema.js.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/envelope.d.ts +0 -23
- package/node_modules/@xrkseek/server-face/dist/envelope.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/envelope.js +0 -51
- package/node_modules/@xrkseek/server-face/dist/envelope.js.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/rpc-error.d.ts +0 -15
- package/node_modules/@xrkseek/server-face/dist/rpc-error.d.ts.map +0 -1
- package/node_modules/@xrkseek/server-face/dist/rpc-error.js +0 -247
- package/node_modules/@xrkseek/server-face/dist/rpc-error.js.map +0 -1
- package/product-web/assets/index-BwSJq-Ch.js +0 -112
- package/product-web/assets/index-BwSJq-Ch.js.map +0 -1
- package/product-web/assets/vendor-CeMKrCZm.js.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-projection seam: drive registry + dual type tables.
|
|
3
|
+
* No Cordis — Host Face (or any carrier) owns wiring; domains register pure units.
|
|
4
|
+
*/
|
|
5
|
+
import type { SessionEvent } from "@xrkseek/protocol";
|
|
6
|
+
import type { SessionProjectionMap, SessionProjectionStateMap } from "./types.js";
|
|
7
|
+
export type { SessionProjectionMap, SessionProjectionStateMap, } from "./types.js";
|
|
8
|
+
/** Client view for one unit (state → wire). Omit on the definition for host-only. */
|
|
9
|
+
export interface ProjectionWire<S, V> {
|
|
10
|
+
/**
|
|
11
|
+
* State → wire payload.
|
|
12
|
+
* Must be synchronous.
|
|
13
|
+
*/
|
|
14
|
+
view(state: S): V;
|
|
15
|
+
/** Validate wire payload before it leaves the host. */
|
|
16
|
+
parse(value: unknown): V;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One domain's state-driven unit. Framework drives `apply`; domain owns only
|
|
20
|
+
* the fold. Omit {@link wire} for host-only keys (`stateOf` / checkpoint only).
|
|
21
|
+
*/
|
|
22
|
+
export interface ProjectionDefinition<K extends string, S, V = unknown> {
|
|
23
|
+
readonly key: K;
|
|
24
|
+
/**
|
|
25
|
+
* Persisted-cache invalidation version. Bump when serialized state fields or
|
|
26
|
+
* fold semantics change.
|
|
27
|
+
*/
|
|
28
|
+
readonly stateVersion: number;
|
|
29
|
+
init(): S;
|
|
30
|
+
/**
|
|
31
|
+
* Pure transition. Return the **same reference** when unchanged
|
|
32
|
+
* (`Object.is`) so the change feed stays quiet.
|
|
33
|
+
*/
|
|
34
|
+
apply(state: S, event: SessionEvent): S;
|
|
35
|
+
/** Client view. Omit for host-only units. */
|
|
36
|
+
readonly wire?: ProjectionWire<S, V>;
|
|
37
|
+
}
|
|
38
|
+
export interface ProjectionSnapshot {
|
|
39
|
+
/** Seq of last event reflected; `-1` for empty log. */
|
|
40
|
+
readonly asOfSeq: number;
|
|
41
|
+
/** Whole current client values (wired keys + sidecars only). */
|
|
42
|
+
readonly values: Readonly<Partial<SessionProjectionMap>> & Readonly<Record<string, unknown>>;
|
|
43
|
+
}
|
|
44
|
+
export interface ProjectionCheckpointRow {
|
|
45
|
+
readonly ver: number;
|
|
46
|
+
readonly seq: number;
|
|
47
|
+
readonly val: unknown;
|
|
48
|
+
}
|
|
49
|
+
export type ProjectionCheckpoint = Record<string, ProjectionCheckpointRow>;
|
|
50
|
+
export type ProjectionChangeListener = (sessionId: string, key: string, value: unknown, seq: number) => void;
|
|
51
|
+
export interface SessionProjectionRegistryOptions {
|
|
52
|
+
/** Live log reader (Face seq = 1-based index in this array). */
|
|
53
|
+
getEvents(sessionId: string): readonly SessionEvent[];
|
|
54
|
+
}
|
|
55
|
+
export interface SessionProjectionRegistry {
|
|
56
|
+
register<K extends string, S, V>(definition: ProjectionDefinition<K, S, V>): () => void;
|
|
57
|
+
onChanged(listener: ProjectionChangeListener): () => void;
|
|
58
|
+
/**
|
|
59
|
+
* Drive every unit with one committed event at host seq.
|
|
60
|
+
* Call after `session/event` is minted for the same seq.
|
|
61
|
+
*/
|
|
62
|
+
drive(sessionId: string, event: SessionEvent, seq: number): void;
|
|
63
|
+
/** Client-visible cut: wired keys + sidecars only. */
|
|
64
|
+
snapshot(sessionId: string): ProjectionSnapshot;
|
|
65
|
+
/**
|
|
66
|
+
* Borrow live host fold state for one key. Callers must not mutate.
|
|
67
|
+
* `undefined` when the key is not registered (DSH `stateOf`).
|
|
68
|
+
*/
|
|
69
|
+
stateOf(sessionId: string, key: string): unknown | undefined;
|
|
70
|
+
/** Persistable host states for every registered unit (wired + host-only). */
|
|
71
|
+
checkpoint(sessionId: string): ProjectionCheckpoint;
|
|
72
|
+
/**
|
|
73
|
+
* Seq to pass persistence `readFrom` before {@link restore} (DSH cold ladder).
|
|
74
|
+
* `undefined` when no unit is registered.
|
|
75
|
+
*/
|
|
76
|
+
restoreFloor(checkpoint: ProjectionCheckpoint): number | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Zero-I/O view of checkpoint rows for wired keys with matching `stateVersion`.
|
|
79
|
+
*/
|
|
80
|
+
viewCheckpoint(checkpoint: ProjectionCheckpoint): Partial<SessionProjectionMap> & Record<string, unknown>;
|
|
81
|
+
/**
|
|
82
|
+
* Cold fold: seed from checkpoint when usable, replay `events` tail.
|
|
83
|
+
* Face watermarks: event i in `events` has seq `baseSeq + i` (1-based).
|
|
84
|
+
*/
|
|
85
|
+
restore(checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: number): {
|
|
86
|
+
snapshot: ProjectionSnapshot;
|
|
87
|
+
checkpoint: ProjectionCheckpoint;
|
|
88
|
+
};
|
|
89
|
+
/** Registered unit keys + sidecar keys (any session). */
|
|
90
|
+
keys(): readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* Host-computed overlay (e.g. `goal`). Included in snapshots and change feed.
|
|
93
|
+
* `null` is a published value; `undefined` removes the sidecar.
|
|
94
|
+
*/
|
|
95
|
+
setSidecar(sessionId: string, key: string, value: unknown, seq: number): void;
|
|
96
|
+
}
|
|
97
|
+
export declare function createSessionProjectionRegistry(options: SessionProjectionRegistryOptions): SessionProjectionRegistry;
|
|
98
|
+
/** @deprecated Prefer {@link SessionProjectionStateMap} declare-merge from host units. */
|
|
99
|
+
export type HostProjectionStateMap = SessionProjectionStateMap;
|
|
100
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EACV,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAEpB,qFAAqF;AACrF,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EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,MAAM,GACV,IAAI,CAAC;CACT;AAoCD,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CAgO3B;AAED,0FAA0F;AAC1F,MAAM,MAAM,sBAAsB,GAAG,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-projection seam: drive registry + dual type tables.
|
|
3
|
+
* No Cordis — Host Face (or any carrier) owns wiring; domains register pure units.
|
|
4
|
+
*/
|
|
5
|
+
function eraseDefinition(definition) {
|
|
6
|
+
const wire = definition.wire;
|
|
7
|
+
if (wire) {
|
|
8
|
+
return {
|
|
9
|
+
key: definition.key,
|
|
10
|
+
stateVersion: definition.stateVersion,
|
|
11
|
+
wired: true,
|
|
12
|
+
init: () => definition.init(),
|
|
13
|
+
apply: (state, event) => definition.apply(state, event),
|
|
14
|
+
view: (state) => wire.view(state),
|
|
15
|
+
parse: (value) => wire.parse(value),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
key: definition.key,
|
|
20
|
+
stateVersion: definition.stateVersion,
|
|
21
|
+
wired: false,
|
|
22
|
+
init: () => definition.init(),
|
|
23
|
+
apply: (state, event) => definition.apply(state, event),
|
|
24
|
+
view: () => {
|
|
25
|
+
throw new Error(`projection ${JSON.stringify(definition.key)} is host-only (no wire)`);
|
|
26
|
+
},
|
|
27
|
+
parse: () => {
|
|
28
|
+
throw new Error(`projection ${JSON.stringify(definition.key)} is host-only (no wire)`);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function createSessionProjectionRegistry(options) {
|
|
33
|
+
const registrations = new Map();
|
|
34
|
+
const listeners = new Set();
|
|
35
|
+
const sidecars = new Map();
|
|
36
|
+
function buildCell(def, events) {
|
|
37
|
+
let state = def.init();
|
|
38
|
+
for (const event of events)
|
|
39
|
+
state = def.apply(state, event);
|
|
40
|
+
return {
|
|
41
|
+
state,
|
|
42
|
+
observedSeq: events.length === 0 ? -1 : events.length,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function cellFor(registration, sessionId) {
|
|
46
|
+
let cell = registration.cells.get(sessionId);
|
|
47
|
+
if (cell === undefined) {
|
|
48
|
+
cell = buildCell(registration.def, options.getEvents(sessionId));
|
|
49
|
+
registration.cells.set(sessionId, cell);
|
|
50
|
+
}
|
|
51
|
+
return cell;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
register(definition) {
|
|
55
|
+
if (!Number.isSafeInteger(definition.stateVersion) ||
|
|
56
|
+
definition.stateVersion < 0) {
|
|
57
|
+
throw new Error(`projection ${JSON.stringify(definition.key)} stateVersion must be a non-negative integer`);
|
|
58
|
+
}
|
|
59
|
+
const key = definition.key;
|
|
60
|
+
const existing = registrations.get(key);
|
|
61
|
+
if (existing === undefined) {
|
|
62
|
+
registrations.set(key, {
|
|
63
|
+
def: eraseDefinition(definition),
|
|
64
|
+
cells: new Map(),
|
|
65
|
+
refs: 1,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
if (existing.def.stateVersion !== definition.stateVersion) {
|
|
70
|
+
throw new Error(`projection key ${JSON.stringify(key)} already registered at stateVersion ${existing.def.stateVersion}; refusing ${definition.stateVersion}`);
|
|
71
|
+
}
|
|
72
|
+
existing.refs += 1;
|
|
73
|
+
}
|
|
74
|
+
let alive = true;
|
|
75
|
+
return () => {
|
|
76
|
+
if (!alive)
|
|
77
|
+
return;
|
|
78
|
+
alive = false;
|
|
79
|
+
const live = registrations.get(key);
|
|
80
|
+
if (live === undefined)
|
|
81
|
+
return;
|
|
82
|
+
live.refs -= 1;
|
|
83
|
+
if (live.refs === 0)
|
|
84
|
+
registrations.delete(key);
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
onChanged(listener) {
|
|
88
|
+
listeners.add(listener);
|
|
89
|
+
return () => {
|
|
90
|
+
listeners.delete(listener);
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
drive(sessionId, event, seq) {
|
|
94
|
+
for (const registration of registrations.values()) {
|
|
95
|
+
let cell = registration.cells.get(sessionId);
|
|
96
|
+
if (cell === undefined) {
|
|
97
|
+
const all = options.getEvents(sessionId);
|
|
98
|
+
const prefix = all.slice(0, seq - 1);
|
|
99
|
+
cell = buildCell(registration.def, prefix);
|
|
100
|
+
registration.cells.set(sessionId, cell);
|
|
101
|
+
}
|
|
102
|
+
const next = registration.def.apply(cell.state, event);
|
|
103
|
+
const changed = !Object.is(next, cell.state);
|
|
104
|
+
cell.state = next;
|
|
105
|
+
cell.observedSeq = seq;
|
|
106
|
+
if (changed && registration.def.wired && listeners.size > 0) {
|
|
107
|
+
const value = registration.def.parse(registration.def.view(next));
|
|
108
|
+
for (const listener of listeners) {
|
|
109
|
+
listener(sessionId, registration.def.key, value, seq);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
snapshot(sessionId) {
|
|
115
|
+
const events = options.getEvents(sessionId);
|
|
116
|
+
const values = {};
|
|
117
|
+
for (const registration of registrations.values()) {
|
|
118
|
+
if (!registration.def.wired)
|
|
119
|
+
continue;
|
|
120
|
+
const cell = cellFor(registration, sessionId);
|
|
121
|
+
values[registration.def.key] = registration.def.parse(registration.def.view(cell.state));
|
|
122
|
+
}
|
|
123
|
+
const extra = sidecars.get(sessionId);
|
|
124
|
+
if (extra) {
|
|
125
|
+
for (const [key, value] of extra)
|
|
126
|
+
values[key] = value;
|
|
127
|
+
}
|
|
128
|
+
const asOfSeq = events.length === 0 ? -1 : events.length;
|
|
129
|
+
return { asOfSeq, values };
|
|
130
|
+
},
|
|
131
|
+
stateOf(sessionId, key) {
|
|
132
|
+
const registration = registrations.get(key);
|
|
133
|
+
if (registration === undefined)
|
|
134
|
+
return undefined;
|
|
135
|
+
return cellFor(registration, sessionId).state;
|
|
136
|
+
},
|
|
137
|
+
restoreFloor(checkpoint) {
|
|
138
|
+
let floor;
|
|
139
|
+
for (const registration of registrations.values()) {
|
|
140
|
+
const row = checkpoint[registration.def.key];
|
|
141
|
+
const need = row !== undefined && row.ver === registration.def.stateVersion
|
|
142
|
+
? Math.max(row.seq + 1, 0)
|
|
143
|
+
: 0;
|
|
144
|
+
floor = floor === undefined ? need : Math.min(floor, need);
|
|
145
|
+
}
|
|
146
|
+
return floor === undefined ? undefined : Math.max(floor - 1, 0);
|
|
147
|
+
},
|
|
148
|
+
viewCheckpoint(checkpoint) {
|
|
149
|
+
const values = {};
|
|
150
|
+
for (const registration of registrations.values()) {
|
|
151
|
+
const def = registration.def;
|
|
152
|
+
if (!def.wired)
|
|
153
|
+
continue;
|
|
154
|
+
const row = checkpoint[def.key];
|
|
155
|
+
if (row === undefined || row.ver !== def.stateVersion)
|
|
156
|
+
continue;
|
|
157
|
+
try {
|
|
158
|
+
values[def.key] = def.parse(def.view(row.val));
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// malformed row → omit key (cold consumer refolds)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return values;
|
|
165
|
+
},
|
|
166
|
+
restore(checkpoint, events, baseSeq) {
|
|
167
|
+
const endSeq = events.length === 0 ? baseSeq - 1 : baseSeq + events.length - 1;
|
|
168
|
+
const values = {};
|
|
169
|
+
const refreshed = {};
|
|
170
|
+
for (const registration of registrations.values()) {
|
|
171
|
+
const def = registration.def;
|
|
172
|
+
const row = checkpoint[def.key];
|
|
173
|
+
const usable = row !== undefined &&
|
|
174
|
+
row.ver === def.stateVersion &&
|
|
175
|
+
row.seq >= baseSeq - 1 &&
|
|
176
|
+
row.seq <= endSeq;
|
|
177
|
+
if (!usable && baseSeq > 0) {
|
|
178
|
+
throw new Error(`session projection ${JSON.stringify(def.key)} cannot restore from seq ${baseSeq}: ` +
|
|
179
|
+
"its checkpoint row is missing, version-mismatched, or beyond the supplied log end; re-read from seq 0");
|
|
180
|
+
}
|
|
181
|
+
let state = usable ? row.val : def.init();
|
|
182
|
+
const from = usable ? row.seq : baseSeq - 1;
|
|
183
|
+
for (let i = 0; i < events.length; i++) {
|
|
184
|
+
const seq = baseSeq + i;
|
|
185
|
+
if (seq > from)
|
|
186
|
+
state = def.apply(state, events[i]);
|
|
187
|
+
}
|
|
188
|
+
if (def.wired)
|
|
189
|
+
values[def.key] = def.parse(def.view(state));
|
|
190
|
+
refreshed[def.key] = {
|
|
191
|
+
ver: def.stateVersion,
|
|
192
|
+
seq: endSeq,
|
|
193
|
+
val: state,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
snapshot: { asOfSeq: endSeq, values },
|
|
198
|
+
checkpoint: refreshed,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
checkpoint(sessionId) {
|
|
202
|
+
const rows = {};
|
|
203
|
+
for (const registration of registrations.values()) {
|
|
204
|
+
const cell = cellFor(registration, sessionId);
|
|
205
|
+
rows[registration.def.key] = {
|
|
206
|
+
ver: registration.def.stateVersion,
|
|
207
|
+
seq: cell.observedSeq,
|
|
208
|
+
val: structuredClone(cell.state),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
return rows;
|
|
212
|
+
},
|
|
213
|
+
keys() {
|
|
214
|
+
const extra = new Set();
|
|
215
|
+
for (const map of sidecars.values()) {
|
|
216
|
+
for (const k of map.keys())
|
|
217
|
+
extra.add(k);
|
|
218
|
+
}
|
|
219
|
+
return [...new Set([...registrations.keys(), ...extra])];
|
|
220
|
+
},
|
|
221
|
+
setSidecar(sessionId, key, value, seq) {
|
|
222
|
+
let map = sidecars.get(sessionId);
|
|
223
|
+
if (value === undefined) {
|
|
224
|
+
map?.delete(key);
|
|
225
|
+
if (map && map.size === 0)
|
|
226
|
+
sidecars.delete(sessionId);
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
if (!map) {
|
|
230
|
+
map = new Map();
|
|
231
|
+
sidecars.set(sessionId, map);
|
|
232
|
+
}
|
|
233
|
+
map.set(key, value);
|
|
234
|
+
}
|
|
235
|
+
for (const listener of listeners) {
|
|
236
|
+
listener(sessionId, key, value ?? null, seq);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmJH,SAAS,eAAe,CACtB,UAAyC;IAEzC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IAC7B,IAAI,IAAI,EAAE,CAAC;QACT,OAAO;YACL,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,YAAY,EAAE,UAAU,CAAC,YAAY;YACrC,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;YAC7B,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAU,EAAE,KAAK,CAAC;YAC5D,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAU,CAAC;YACtC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;SACpC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,YAAY,EAAE,UAAU,CAAC,YAAY;QACrC,KAAK,EAAE,KAAK;QACZ,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE;QAC7B,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAU,EAAE,KAAK,CAAC;QAC5D,IAAI,EAAE,GAAG,EA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E,GAAG,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge-extensible projection type tables.
|
|
3
|
+
* Client carriers / stubs declare-merge {@link SessionProjectionMap}.
|
|
4
|
+
* Host fold packages declare-merge {@link SessionProjectionStateMap}.
|
|
5
|
+
*
|
|
6
|
+
* @module @xrkseek/session-projection/types
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Client-visible whole values (wire JSON). Rendering belongs to the slot /
|
|
10
|
+
* UI layer, never this seam.
|
|
11
|
+
*/
|
|
12
|
+
export interface SessionProjectionMap {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Host fold states. Every client-visible key also appears here; host-only
|
|
16
|
+
* keys appear only here. Values must be plain JSON if a cache is attached.
|
|
17
|
+
*/
|
|
18
|
+
export interface SessionProjectionStateMap {
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AAEH,MAAM,WAAW,oBAAoB;CAAG;AAExC;;;GAGG;AAEH,MAAM,WAAW,yBAAyB;CAAG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge-extensible projection type tables.
|
|
3
|
+
* Client carriers / stubs declare-merge {@link SessionProjectionMap}.
|
|
4
|
+
* Host fold packages declare-merge {@link SessionProjectionStateMap}.
|
|
5
|
+
*
|
|
6
|
+
* @module @xrkseek/session-projection/types
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xrkseek/session-projection",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./types": {
|
|
12
|
+
"types": "./dist/types.d.ts",
|
|
13
|
+
"import": "./dist/types.js",
|
|
14
|
+
"default": "./dist/types.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@xrkseek/protocol": "workspace:*"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/xrkseek/XRK-harness.git",
|
|
28
|
+
"directory": "packages/session/session-projection"
|
|
29
|
+
},
|
|
30
|
+
"private": true
|
|
31
|
+
}
|
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
# @xrkseek/workspace
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Workspace product inject, skills, recipes, slash expand, tool-output persist.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`createWorkspaceInjector` · `resolveWorkspaceInject` · `appendWorkspaceInjectsIfChanged` — see `docs/workspace-inject.md`.
|
|
6
6
|
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
Order: assistant → context → rules → skills cards (`SKILL.md` name+description) → subagents.
|
|
10
|
-
Full skill bodies are loaded by the `skill` tool (`createSkillTools`), not injected.
|
|
11
|
-
Skills auto-import from existing `.claude|.cursor|.agents|.codex|.xrk/skills` (and user-home twins); missing roots are skipped.
|
|
12
|
-
Default product dir for assistant/rules/recipes: `{root}/.xrk` (never repo-root `AGENTS.md`; not required for skills).
|
|
13
|
-
|
|
14
|
-
Presets (`minimal` / `harness`) wire inject into three-layer `workspaceBlocks` by default.
|
|
15
|
-
|
|
16
|
-
## Tool output persist
|
|
17
|
-
|
|
18
|
-
`createWorkspaceToolOutputPersist({ root })` writes full truncated tool bodies under
|
|
19
|
-
`.xrk/tool-outputs/` for `boundToolOutput` markers.
|
|
20
|
-
|
|
21
|
-
See `docs/tool-output-bound.md`.
|
|
22
|
-
|
|
23
|
-
## Recipes / slash
|
|
24
|
-
|
|
25
|
-
`createSlashResolver` / `tryApplySlashRecipe` / `tryApplySlashSkill` / `loadOfficeRecipes` — see `docs/slash-recipes.md`.
|
|
26
|
-
|
|
27
|
-
Presets wire `{productDir}/recipes` and `/skill-name` into `assemble.resolveSlash` when assemble is on (`slashRecipes: false` skips recipes only).
|
|
7
|
+
Presets (`minimal` / `harness`) append durable `user/message` injects (skill catalog + agent-instructions) at turn start by default. System persona stays separate for prompt-cache stability. `previewInject` still returns markdown `blocks`.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SessionEvent, UserMessageSource, WorkspaceBudgetTruncation } from "@xrkseek/protocol";
|
|
2
|
+
import type { SkillSummary } from "./skills.js";
|
|
3
|
+
export interface WorkspaceBudgetEvent {
|
|
4
|
+
readonly type: "workspace/budget-truncation";
|
|
5
|
+
readonly section: string;
|
|
6
|
+
readonly originalChars: number;
|
|
7
|
+
readonly keptChars: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function digestWorkspaceText(text: string): string;
|
|
10
|
+
export declare function budgetEventsToTruncations(events: readonly WorkspaceBudgetEvent[]): readonly WorkspaceBudgetTruncation[];
|
|
11
|
+
/** DSH-shaped model-facing skill catalog (progressive disclosure). */
|
|
12
|
+
export declare function formatAvailableSkillsXml(skills: readonly SkillSummary[]): string;
|
|
13
|
+
export interface DurableSkillCatalogPayload {
|
|
14
|
+
readonly content: string;
|
|
15
|
+
readonly digest: string;
|
|
16
|
+
readonly source: Extract<UserMessageSource, {
|
|
17
|
+
kind: "skill-catalog";
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
export interface DurableInstructionsPayload {
|
|
21
|
+
readonly content: string;
|
|
22
|
+
readonly digest: string;
|
|
23
|
+
readonly source: Extract<UserMessageSource, {
|
|
24
|
+
kind: "agent-instructions";
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
export interface WorkspaceDurableInject {
|
|
28
|
+
/** Preview / durable instructions markdown (no skill cards). */
|
|
29
|
+
readonly instructionBlocks: readonly string[];
|
|
30
|
+
/** Full legacy blocks including skill cards (previewInject). */
|
|
31
|
+
readonly blocks: readonly string[];
|
|
32
|
+
readonly events: readonly WorkspaceBudgetEvent[];
|
|
33
|
+
readonly skillCatalog?: DurableSkillCatalogPayload;
|
|
34
|
+
readonly instructions?: DurableInstructionsPayload;
|
|
35
|
+
}
|
|
36
|
+
export interface InstructionChange {
|
|
37
|
+
readonly action: "set" | "merge" | "clear";
|
|
38
|
+
readonly path?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function buildSkillCatalogPayload(skills: readonly SkillSummary[], budgetEvents: readonly WorkspaceBudgetEvent[], options?: {
|
|
41
|
+
readonly update?: boolean;
|
|
42
|
+
}): DurableSkillCatalogPayload | undefined;
|
|
43
|
+
export declare function buildInstructionsPayload(blocks: readonly string[], changes: readonly InstructionChange[], budgetEvents: readonly WorkspaceBudgetEvent[]): DurableInstructionsPayload | undefined;
|
|
44
|
+
export interface LatestWorkspaceInjectDigests {
|
|
45
|
+
readonly skillCatalog?: string;
|
|
46
|
+
readonly instructions?: string;
|
|
47
|
+
}
|
|
48
|
+
/** Last-wins digests from durable inject `user/message` events. */
|
|
49
|
+
export declare function foldLatestWorkspaceInjectDigests(events: readonly SessionEvent[]): LatestWorkspaceInjectDigests;
|
|
50
|
+
export interface WorkspaceInjectAppend {
|
|
51
|
+
readonly content: string;
|
|
52
|
+
readonly source: UserMessageSource;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Decide which durable injects to append (digest change or first sighting).
|
|
56
|
+
* Empty catalog after a prior catalog appends a replacement empty row.
|
|
57
|
+
*/
|
|
58
|
+
export declare function planWorkspaceInjectAppends(input: {
|
|
59
|
+
readonly durable: WorkspaceDurableInject;
|
|
60
|
+
readonly previous: LatestWorkspaceInjectDigests;
|
|
61
|
+
}): readonly WorkspaceInjectAppend[];
|
|
62
|
+
//# sourceMappingURL=durable-inject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-inject.d.ts","sourceRoot":"","sources":["../src/durable-inject.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,oBAAoB,EAAE,GACtC,SAAS,yBAAyB,EAAE,CAMtC;AAED,sEAAsE;AACtE,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,YAAY,EAAE,GAC9B,MAAM,CAaR;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;CACxE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