@namzu/sdk 0.4.1 → 0.4.3
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/CHANGELOG.md +83 -0
- package/dist/__tests__/replay-public-surface.test.d.ts +2 -0
- package/dist/__tests__/replay-public-surface.test.d.ts.map +1 -0
- package/dist/__tests__/replay-public-surface.test.js +45 -0
- package/dist/__tests__/replay-public-surface.test.js.map +1 -0
- package/dist/advisory/context.test.d.ts +16 -0
- package/dist/advisory/context.test.d.ts.map +1 -0
- package/dist/advisory/context.test.js +92 -0
- package/dist/advisory/context.test.js.map +1 -0
- package/dist/advisory/evaluator.test.d.ts +34 -0
- package/dist/advisory/evaluator.test.d.ts.map +1 -0
- package/dist/advisory/evaluator.test.js +172 -0
- package/dist/advisory/evaluator.test.js.map +1 -0
- package/dist/advisory/executor.test.d.ts +35 -0
- package/dist/advisory/executor.test.d.ts.map +1 -0
- package/dist/advisory/executor.test.js +233 -0
- package/dist/advisory/executor.test.js.map +1 -0
- package/dist/advisory/registry.test.d.ts +16 -0
- package/dist/advisory/registry.test.d.ts.map +1 -0
- package/dist/advisory/registry.test.js +62 -0
- package/dist/advisory/registry.test.js.map +1 -0
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/bridge/a2a/agent-card.test.d.ts +24 -0
- package/dist/bridge/a2a/agent-card.test.d.ts.map +1 -0
- package/dist/bridge/a2a/agent-card.test.js +118 -0
- package/dist/bridge/a2a/agent-card.test.js.map +1 -0
- package/dist/bridge/a2a/mapper.test.d.ts +29 -0
- package/dist/bridge/a2a/mapper.test.d.ts.map +1 -0
- package/dist/bridge/a2a/mapper.test.js +265 -0
- package/dist/bridge/a2a/mapper.test.js.map +1 -0
- package/dist/bridge/a2a/message.test.d.ts +20 -0
- package/dist/bridge/a2a/message.test.d.ts.map +1 -0
- package/dist/bridge/a2a/message.test.js +116 -0
- package/dist/bridge/a2a/message.test.js.map +1 -0
- package/dist/bridge/a2a/task.d.ts +2 -2
- package/dist/bridge/a2a/task.d.ts.map +1 -1
- package/dist/bridge/a2a/task.js.map +1 -1
- package/dist/bridge/a2a/task.test.d.ts +29 -0
- package/dist/bridge/a2a/task.test.d.ts.map +1 -0
- package/dist/bridge/a2a/task.test.js +198 -0
- package/dist/bridge/a2a/task.test.js.map +1 -0
- package/dist/bridge/mcp/connector/adapter.test.d.ts +27 -0
- package/dist/bridge/mcp/connector/adapter.test.d.ts.map +1 -0
- package/dist/bridge/mcp/connector/adapter.test.js +203 -0
- package/dist/bridge/mcp/connector/adapter.test.js.map +1 -0
- package/dist/bridge/sse/mapper.test.d.ts +27 -0
- package/dist/bridge/sse/mapper.test.d.ts.map +1 -0
- package/dist/bridge/sse/mapper.test.js +271 -0
- package/dist/bridge/sse/mapper.test.js.map +1 -0
- package/dist/bridge/tools/connector/adapter.test.d.ts +28 -0
- package/dist/bridge/tools/connector/adapter.test.d.ts.map +1 -0
- package/dist/bridge/tools/connector/adapter.test.js +182 -0
- package/dist/bridge/tools/connector/adapter.test.js.map +1 -0
- package/dist/bridge/tools/connector/definitions.test.d.ts +23 -0
- package/dist/bridge/tools/connector/definitions.test.d.ts.map +1 -0
- package/dist/bridge/tools/connector/definitions.test.js +158 -0
- package/dist/bridge/tools/connector/definitions.test.js.map +1 -0
- package/dist/bridge/tools/connector/router.test.d.ts +21 -0
- package/dist/bridge/tools/connector/router.test.d.ts.map +1 -0
- package/dist/bridge/tools/connector/router.test.js +139 -0
- package/dist/bridge/tools/connector/router.test.js.map +1 -0
- package/dist/bus/breaker.test.d.ts +41 -0
- package/dist/bus/breaker.test.d.ts.map +1 -0
- package/dist/bus/breaker.test.js +242 -0
- package/dist/bus/breaker.test.js.map +1 -0
- package/dist/bus/index.test.d.ts +25 -0
- package/dist/bus/index.test.d.ts.map +1 -0
- package/dist/bus/index.test.js +151 -0
- package/dist/bus/index.test.js.map +1 -0
- package/dist/bus/lock.test.d.ts +44 -0
- package/dist/bus/lock.test.d.ts.map +1 -0
- package/dist/bus/lock.test.js +226 -0
- package/dist/bus/lock.test.js.map +1 -0
- package/dist/bus/ownership.test.d.ts +26 -0
- package/dist/bus/ownership.test.d.ts.map +1 -0
- package/dist/bus/ownership.test.js +205 -0
- package/dist/bus/ownership.test.js.map +1 -0
- package/dist/config/runtime.d.ts +24 -25
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/runtime.js.map +1 -1
- package/dist/connector/BaseConnector.test.d.ts +21 -0
- package/dist/connector/BaseConnector.test.d.ts.map +1 -0
- package/dist/connector/BaseConnector.test.js +108 -0
- package/dist/connector/BaseConnector.test.js.map +1 -0
- package/dist/connector/builtins/http.test.d.ts +30 -0
- package/dist/connector/builtins/http.test.d.ts.map +1 -0
- package/dist/connector/builtins/http.test.js +232 -0
- package/dist/connector/builtins/http.test.js.map +1 -0
- package/dist/connector/builtins/webhook.test.d.ts +20 -0
- package/dist/connector/builtins/webhook.test.d.ts.map +1 -0
- package/dist/connector/builtins/webhook.test.js +113 -0
- package/dist/connector/builtins/webhook.test.js.map +1 -0
- package/dist/connector/execution/factory.test.d.ts +16 -0
- package/dist/connector/execution/factory.test.d.ts.map +1 -0
- package/dist/connector/execution/factory.test.js +64 -0
- package/dist/connector/execution/factory.test.js.map +1 -0
- package/dist/connector/execution/remote.test.d.ts +16 -0
- package/dist/connector/execution/remote.test.d.ts.map +1 -0
- package/dist/connector/execution/remote.test.js +53 -0
- package/dist/connector/execution/remote.test.js.map +1 -0
- package/dist/connector/mcp/adapter.test.d.ts +34 -0
- package/dist/connector/mcp/adapter.test.d.ts.map +1 -0
- package/dist/connector/mcp/adapter.test.js +199 -0
- package/dist/connector/mcp/adapter.test.js.map +1 -0
- package/dist/contracts/api.d.ts +2 -2
- package/dist/contracts/api.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +1 -2
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/schemas.d.ts +10 -10
- package/dist/index.d.ts +3 -103
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -89
- package/dist/index.js.map +1 -1
- package/dist/manager/agent/__tests__/lifecycle.test.js.map +1 -1
- package/dist/manager/agent/lifecycle.d.ts +1 -1
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +1 -1
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/run/persistence.d.ts +3 -3
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/manager/thread/__tests__/lifecycle.test.js.map +1 -1
- package/dist/manager/thread/lifecycle.d.ts +1 -1
- package/dist/manager/thread/lifecycle.d.ts.map +1 -1
- package/dist/plugin/loader.d.ts +0 -5
- package/dist/plugin/loader.d.ts.map +1 -1
- package/dist/plugin/loader.js +1 -13
- package/dist/plugin/loader.js.map +1 -1
- package/dist/public-runtime.d.ts +70 -0
- package/dist/public-runtime.d.ts.map +1 -0
- package/dist/public-runtime.js +108 -0
- package/dist/public-runtime.js.map +1 -0
- package/dist/public-tools.d.ts +19 -0
- package/dist/public-tools.d.ts.map +1 -0
- package/dist/public-tools.js +34 -0
- package/dist/public-tools.js.map +1 -0
- package/dist/public-types.d.ts +55 -0
- package/dist/public-types.d.ts.map +1 -0
- package/dist/public-types.js +14 -0
- package/dist/public-types.js.map +1 -0
- package/dist/rag/chunking.test.d.ts +20 -0
- package/dist/rag/chunking.test.d.ts.map +1 -0
- package/dist/rag/chunking.test.js +92 -0
- package/dist/rag/chunking.test.js.map +1 -0
- package/dist/rag/context-assembler.test.d.ts +19 -0
- package/dist/rag/context-assembler.test.d.ts.map +1 -0
- package/dist/rag/context-assembler.test.js +98 -0
- package/dist/rag/context-assembler.test.js.map +1 -0
- package/dist/rag/embedding.test.d.ts +19 -0
- package/dist/rag/embedding.test.d.ts.map +1 -0
- package/dist/rag/embedding.test.js +115 -0
- package/dist/rag/embedding.test.js.map +1 -0
- package/dist/rag/ingestion.test.d.ts +22 -0
- package/dist/rag/ingestion.test.d.ts.map +1 -0
- package/dist/rag/ingestion.test.js +99 -0
- package/dist/rag/ingestion.test.js.map +1 -0
- package/dist/rag/knowledge-base.test.d.ts +17 -0
- package/dist/rag/knowledge-base.test.d.ts.map +1 -0
- package/dist/rag/knowledge-base.test.js +77 -0
- package/dist/rag/knowledge-base.test.js.map +1 -0
- package/dist/rag/rag-tool.d.ts +1 -1
- package/dist/rag/rag-tool.test.d.ts +21 -0
- package/dist/rag/rag-tool.test.d.ts.map +1 -0
- package/dist/rag/rag-tool.test.js +149 -0
- package/dist/rag/rag-tool.test.js.map +1 -0
- package/dist/rag/retriever.test.d.ts +26 -0
- package/dist/rag/retriever.test.d.ts.map +1 -0
- package/dist/rag/retriever.test.js +180 -0
- package/dist/rag/retriever.test.js.map +1 -0
- package/dist/rag/vector-store.test.d.ts +38 -0
- package/dist/rag/vector-store.test.d.ts.map +1 -0
- package/dist/rag/vector-store.test.js +175 -0
- package/dist/rag/vector-store.test.js.map +1 -0
- package/dist/registry/ManagedRegistry.test.d.ts +21 -0
- package/dist/registry/ManagedRegistry.test.d.ts.map +1 -0
- package/dist/registry/ManagedRegistry.test.js +98 -0
- package/dist/registry/ManagedRegistry.test.js.map +1 -0
- package/dist/registry/Registry.test.d.ts +18 -0
- package/dist/registry/Registry.test.d.ts.map +1 -0
- package/dist/registry/Registry.test.js +79 -0
- package/dist/registry/Registry.test.js.map +1 -0
- package/dist/registry/agent/definitions.test.d.ts +15 -0
- package/dist/registry/agent/definitions.test.d.ts.map +1 -0
- package/dist/registry/agent/definitions.test.js +84 -0
- package/dist/registry/agent/definitions.test.js.map +1 -0
- package/dist/registry/connector/definitions.test.d.ts +13 -0
- package/dist/registry/connector/definitions.test.d.ts.map +1 -0
- package/dist/registry/connector/definitions.test.js +41 -0
- package/dist/registry/connector/definitions.test.js.map +1 -0
- package/dist/registry/connector/scoped.test.d.ts +21 -0
- package/dist/registry/connector/scoped.test.d.ts.map +1 -0
- package/dist/registry/connector/scoped.test.js +115 -0
- package/dist/registry/connector/scoped.test.js.map +1 -0
- package/dist/registry/plugin/index.test.d.ts +12 -0
- package/dist/registry/plugin/index.test.d.ts.map +1 -0
- package/dist/registry/plugin/index.test.js +69 -0
- package/dist/registry/plugin/index.test.js.map +1 -0
- package/dist/registry/tool/execute.test.d.ts +42 -0
- package/dist/registry/tool/execute.test.d.ts.map +1 -0
- package/dist/registry/tool/execute.test.js +281 -0
- package/dist/registry/tool/execute.test.js.map +1 -0
- package/dist/run/LimitChecker.d.ts +0 -1
- package/dist/run/LimitChecker.d.ts.map +1 -1
- package/dist/run/LimitChecker.js +0 -6
- package/dist/run/LimitChecker.js.map +1 -1
- package/dist/run/reporter.d.ts +2 -2
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js.map +1 -1
- package/dist/runtime/query/__tests__/checkpoint.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/checkpoint.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/checkpoint.test.js +150 -0
- package/dist/runtime/query/__tests__/checkpoint.test.js.map +1 -0
- package/dist/runtime/query/checkpoint.d.ts +23 -0
- package/dist/runtime/query/checkpoint.d.ts.map +1 -1
- package/dist/runtime/query/checkpoint.js +49 -0
- package/dist/runtime/query/checkpoint.js.map +1 -1
- package/dist/runtime/query/context.d.ts +0 -2
- package/dist/runtime/query/context.d.ts.map +1 -1
- package/dist/runtime/query/context.js +0 -4
- package/dist/runtime/query/context.js.map +1 -1
- package/dist/runtime/query/index.d.ts +3 -3
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/advisory.test.d.ts +42 -0
- package/dist/runtime/query/iteration/phases/advisory.test.d.ts.map +1 -0
- package/dist/runtime/query/iteration/phases/advisory.test.js +334 -0
- package/dist/runtime/query/iteration/phases/advisory.test.js.map +1 -0
- package/dist/runtime/query/replay/__tests__/mutate.test.d.ts +2 -0
- package/dist/runtime/query/replay/__tests__/mutate.test.d.ts.map +1 -0
- package/dist/runtime/query/replay/__tests__/mutate.test.js +123 -0
- package/dist/runtime/query/replay/__tests__/mutate.test.js.map +1 -0
- package/dist/runtime/query/replay/__tests__/prepare.test.d.ts +2 -0
- package/dist/runtime/query/replay/__tests__/prepare.test.d.ts.map +1 -0
- package/dist/runtime/query/replay/__tests__/prepare.test.js +171 -0
- package/dist/runtime/query/replay/__tests__/prepare.test.js.map +1 -0
- package/dist/runtime/query/replay/list.d.ts +24 -0
- package/dist/runtime/query/replay/list.d.ts.map +1 -0
- package/dist/runtime/query/replay/list.js +21 -0
- package/dist/runtime/query/replay/list.js.map +1 -0
- package/dist/runtime/query/replay/mutate.d.ts +17 -0
- package/dist/runtime/query/replay/mutate.d.ts.map +1 -0
- package/dist/runtime/query/replay/mutate.js +62 -0
- package/dist/runtime/query/replay/mutate.js.map +1 -0
- package/dist/runtime/query/replay/prepare.d.ts +56 -0
- package/dist/runtime/query/replay/prepare.d.ts.map +1 -0
- package/dist/runtime/query/replay/prepare.js +65 -0
- package/dist/runtime/query/replay/prepare.js.map +1 -0
- package/dist/runtime/query/result.d.ts +2 -2
- package/dist/runtime/query/result.d.ts.map +1 -1
- package/dist/session/__tests__/integration/_fixtures.d.ts +4 -4
- package/dist/session/__tests__/integration/_fixtures.d.ts.map +1 -1
- package/dist/session/__tests__/integration/_fixtures.js.map +1 -1
- package/dist/session/__tests__/integration/archive-gate.test.js.map +1 -1
- package/dist/session/__tests__/integration/capacity-caps.test.js.map +1 -1
- package/dist/session/__tests__/integration/e2e-spawn.test.js.map +1 -1
- package/dist/session/__tests__/integration/handoff-broadcast-e2e.test.js.map +1 -1
- package/dist/session/__tests__/integration/handoff-single-e2e.test.js.map +1 -1
- package/dist/session/__tests__/integration/prev-artifact-dag.test.js.map +1 -1
- package/dist/session/__tests__/integration/retention-archive.test.js.map +1 -1
- package/dist/session/__tests__/integration/spawn-rollback.test.js.map +1 -1
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.js +1 -1
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.js.map +1 -1
- package/dist/session/errors.d.ts +1 -1
- package/dist/session/errors.d.ts.map +1 -1
- package/dist/session/events/index.d.ts +3 -3
- package/dist/session/events/index.d.ts.map +1 -1
- package/dist/session/events/index.js +3 -2
- package/dist/session/events/index.js.map +1 -1
- package/dist/session/handoff/__tests__/broadcast.test.js.map +1 -1
- package/dist/session/handoff/__tests__/capacity.test.js.map +1 -1
- package/dist/session/handoff/__tests__/single.test.js.map +1 -1
- package/dist/session/handoff/assignment.d.ts +1 -1
- package/dist/session/handoff/assignment.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.d.ts.map +1 -1
- package/dist/session/handoff/broadcast.js.map +1 -1
- package/dist/session/handoff/single.d.ts.map +1 -1
- package/dist/session/handoff/single.js.map +1 -1
- package/dist/session/index.d.ts +0 -1
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +7 -6
- package/dist/session/index.js.map +1 -1
- package/dist/session/intervention/__tests__/prev-artifact.test.js.map +1 -1
- package/dist/session/intervention/prev-artifact.d.ts +1 -1
- package/dist/session/intervention/prev-artifact.d.ts.map +1 -1
- package/dist/session/retention/__tests__/archive.test.js.map +1 -1
- package/dist/session/retention/__tests__/disk-backend.test.js.map +1 -1
- package/dist/session/retention/archive.d.ts +1 -1
- package/dist/session/retention/archive.d.ts.map +1 -1
- package/dist/session/retention/backend.d.ts +4 -4
- package/dist/session/retention/backend.d.ts.map +1 -1
- package/dist/session/retention/disk-backend.d.ts +1 -1
- package/dist/session/retention/disk-backend.d.ts.map +1 -1
- package/dist/session/retention/index.d.ts +3 -3
- package/dist/session/retention/index.d.ts.map +1 -1
- package/dist/session/retention/index.js +4 -2
- package/dist/session/retention/index.js.map +1 -1
- package/dist/session/status/__tests__/derive.test.d.ts +2 -0
- package/dist/session/status/__tests__/derive.test.d.ts.map +1 -0
- package/dist/session/{hierarchy/__tests__/session.test.js → status/__tests__/derive.test.js} +2 -2
- package/dist/session/status/__tests__/derive.test.js.map +1 -0
- package/dist/session/status/derive.d.ts +33 -0
- package/dist/session/status/derive.d.ts.map +1 -0
- package/dist/session/{hierarchy/session.js → status/derive.js} +6 -1
- package/dist/session/status/derive.js.map +1 -0
- package/dist/session/summary/__tests__/materialize.test.js +2 -1
- package/dist/session/summary/__tests__/materialize.test.js.map +1 -1
- package/dist/session/summary/errors.d.ts +43 -0
- package/dist/session/summary/errors.d.ts.map +1 -0
- package/dist/session/summary/errors.js +37 -0
- package/dist/session/summary/errors.js.map +1 -0
- package/dist/session/summary/index.d.ts +4 -3
- package/dist/session/summary/index.d.ts.map +1 -1
- package/dist/session/summary/index.js +5 -4
- package/dist/session/summary/index.js.map +1 -1
- package/dist/session/summary/materialize.d.ts +2 -2
- package/dist/session/summary/materialize.d.ts.map +1 -1
- package/dist/session/summary/materialize.js +2 -1
- package/dist/session/summary/materialize.js.map +1 -1
- package/dist/session/workspace/__tests__/git-worktree.test.js.map +1 -1
- package/dist/session/workspace/driver.d.ts +2 -2
- package/dist/session/workspace/driver.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.d.ts +1 -1
- package/dist/session/workspace/git-worktree.d.ts.map +1 -1
- package/dist/session/workspace/git-worktree.js.map +1 -1
- package/dist/session/workspace/index.d.ts +1 -1
- package/dist/session/workspace/index.d.ts.map +1 -1
- package/dist/session/workspace/index.js +3 -2
- package/dist/session/workspace/index.js.map +1 -1
- package/dist/store/run/disk.d.ts +4 -4
- package/dist/store/run/disk.d.ts.map +1 -1
- package/dist/store/run/disk.js.map +1 -1
- package/dist/store/session/__tests__/disk.test.js.map +1 -1
- package/dist/store/session/__tests__/memory.test.js.map +1 -1
- package/dist/store/session/disk.d.ts +6 -6
- package/dist/store/session/disk.d.ts.map +1 -1
- package/dist/store/session/disk.js +1 -1
- package/dist/store/session/disk.js.map +1 -1
- package/dist/store/session/index.d.ts +1 -1
- package/dist/store/session/index.d.ts.map +1 -1
- package/dist/store/session/index.js +2 -1
- package/dist/store/session/index.js.map +1 -1
- package/dist/store/session/linkage.d.ts +1 -1
- package/dist/store/session/linkage.d.ts.map +1 -1
- package/dist/store/session/memory.d.ts +5 -5
- package/dist/store/session/memory.d.ts.map +1 -1
- package/dist/store/session/memory.js +1 -1
- package/dist/store/session/memory.js.map +1 -1
- package/dist/store/thread/disk.d.ts +1 -1
- package/dist/store/thread/disk.d.ts.map +1 -1
- package/dist/store/thread/memory.d.ts +1 -1
- package/dist/store/thread/memory.d.ts.map +1 -1
- package/dist/telemetry/attributes.d.ts +0 -1
- package/dist/telemetry/attributes.d.ts.map +1 -1
- package/dist/telemetry/attributes.js +0 -3
- package/dist/telemetry/attributes.js.map +1 -1
- package/dist/telemetry/runtime-accessors.d.ts +1 -2
- package/dist/telemetry/runtime-accessors.d.ts.map +1 -1
- package/dist/telemetry/runtime-accessors.js +1 -4
- package/dist/telemetry/runtime-accessors.js.map +1 -1
- package/dist/test-setup.d.ts +22 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +23 -0
- package/dist/test-setup.js.map +1 -0
- package/dist/tools/builtins/bash.d.ts +1 -1
- package/dist/tools/builtins/computer-use.d.ts +4 -4
- package/dist/tools/builtins/edit.d.ts +1 -1
- package/dist/tools/builtins/glob.d.ts +1 -1
- package/dist/tools/builtins/grep.d.ts +1 -1
- package/dist/tools/builtins/ls.d.ts +1 -1
- package/dist/tools/builtins/read-file.d.ts +1 -1
- package/dist/tools/builtins/search-tools.d.ts +1 -1
- package/dist/tools/builtins/write-file.d.ts +1 -1
- package/dist/types/agent/task.d.ts +2 -2
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/{session/hierarchy/project.d.ts → types/project/entity.d.ts} +4 -4
- package/dist/types/project/entity.d.ts.map +1 -0
- package/dist/types/project/entity.js +2 -0
- package/dist/types/project/entity.js.map +1 -0
- package/dist/types/project/index.d.ts +2 -0
- package/dist/types/project/index.d.ts.map +1 -0
- package/dist/types/project/index.js +4 -0
- package/dist/types/project/index.js.map +1 -0
- package/dist/types/retention/archive-backend-ref.d.ts.map +1 -0
- package/dist/types/retention/archive-backend-ref.js.map +1 -0
- package/dist/types/retention/index.d.ts +4 -0
- package/dist/types/retention/index.d.ts.map +1 -0
- package/dist/types/retention/index.js +4 -0
- package/dist/types/retention/index.js.map +1 -0
- package/dist/types/retention/policy.d.ts.map +1 -0
- package/dist/types/retention/policy.js.map +1 -0
- package/dist/types/run/entity.d.ts +56 -0
- package/dist/types/run/entity.d.ts.map +1 -0
- package/dist/types/run/entity.js +2 -0
- package/dist/types/run/entity.js.map +1 -0
- package/dist/types/run/events.d.ts +2 -2
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/index.d.ts +7 -1
- package/dist/types/run/index.d.ts.map +1 -1
- package/dist/types/run/index.js +8 -9
- package/dist/types/run/index.js.map +1 -1
- package/dist/{session/hierarchy → types/run}/lineage.d.ts +1 -1
- package/dist/types/run/lineage.d.ts.map +1 -0
- package/dist/types/run/lineage.js.map +1 -0
- package/dist/types/run/replay.d.ts +53 -0
- package/dist/types/run/replay.d.ts.map +1 -0
- package/dist/types/run/replay.js +15 -0
- package/dist/types/run/replay.js.map +1 -0
- package/dist/types/run/schema-version.d.ts.map +1 -0
- package/dist/types/run/schema-version.js.map +1 -0
- package/dist/{session/events/types.d.ts → types/run/subsession-events.d.ts} +5 -5
- package/dist/types/run/subsession-events.d.ts.map +1 -0
- package/dist/types/run/subsession-events.js +2 -0
- package/dist/types/run/subsession-events.js.map +1 -0
- package/dist/{session/hierarchy → types/session}/actor.d.ts +1 -1
- package/dist/types/session/actor.d.ts.map +1 -0
- package/dist/{session/hierarchy → types/session}/actor.js.map +1 -1
- package/dist/types/session/entity.d.ts +51 -0
- package/dist/types/session/entity.d.ts.map +1 -0
- package/dist/types/session/entity.js +2 -0
- package/dist/types/session/entity.js.map +1 -0
- package/dist/types/session/index.d.ts +4 -0
- package/dist/types/session/index.d.ts.map +1 -1
- package/dist/{store → types}/session/messages.d.ts +2 -2
- package/dist/{store → types}/session/messages.d.ts.map +1 -1
- package/dist/types/session/messages.js.map +1 -0
- package/dist/types/session/store.d.ts +6 -6
- package/dist/types/session/store.d.ts.map +1 -1
- package/dist/{session/hierarchy → types/session}/sub-session.d.ts +9 -9
- package/dist/types/session/sub-session.d.ts.map +1 -0
- package/dist/types/session/sub-session.js.map +1 -0
- package/dist/{session → types}/summary/deliverable.d.ts +2 -2
- package/dist/types/summary/deliverable.d.ts.map +1 -0
- package/dist/types/summary/deliverable.js.map +1 -0
- package/dist/types/summary/index.d.ts +4 -0
- package/dist/types/summary/index.d.ts.map +1 -0
- package/dist/types/summary/index.js +4 -0
- package/dist/types/summary/index.js.map +1 -0
- package/dist/{session → types}/summary/ref.d.ts +9 -36
- package/dist/types/summary/ref.d.ts.map +1 -0
- package/dist/types/summary/ref.js +28 -0
- package/dist/types/summary/ref.js.map +1 -0
- package/dist/{session/hierarchy/tenant.d.ts → types/tenant/entity.d.ts} +2 -2
- package/dist/types/tenant/entity.d.ts.map +1 -0
- package/dist/types/tenant/entity.js +2 -0
- package/dist/types/tenant/entity.js.map +1 -0
- package/dist/types/tenant/index.d.ts +2 -0
- package/dist/types/tenant/index.d.ts.map +1 -0
- package/dist/types/tenant/index.js +4 -0
- package/dist/types/tenant/index.js.map +1 -0
- package/dist/{session/hierarchy/thread.d.ts → types/thread/entity.d.ts} +31 -7
- package/dist/types/thread/entity.d.ts.map +1 -0
- package/dist/types/thread/entity.js +2 -0
- package/dist/types/thread/entity.js.map +1 -0
- package/dist/types/thread/index.d.ts +1 -0
- package/dist/types/thread/index.d.ts.map +1 -1
- package/dist/types/thread/store.d.ts +1 -1
- package/dist/types/thread/store.d.ts.map +1 -1
- package/dist/types/workspace/index.d.ts +2 -0
- package/dist/types/workspace/index.d.ts.map +1 -0
- package/dist/types/workspace/index.js +7 -0
- package/dist/types/workspace/index.js.map +1 -0
- package/dist/{session → types}/workspace/ref.d.ts +1 -1
- package/dist/types/workspace/ref.d.ts.map +1 -0
- package/dist/types/workspace/ref.js.map +1 -0
- package/dist/utils/logger.d.ts +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +5 -0
- package/dist/utils/logger.js.map +1 -1
- package/package.json +4 -1
- package/src/__tests__/replay-public-surface.test.ts +54 -0
- package/src/advisory/context.test.ts +109 -0
- package/src/advisory/evaluator.test.ts +192 -0
- package/src/advisory/executor.test.ts +272 -0
- package/src/advisory/registry.test.ts +75 -0
- package/src/agents/SupervisorAgent.ts +1 -1
- package/src/bridge/a2a/agent-card.test.ts +140 -0
- package/src/bridge/a2a/mapper.test.ts +293 -0
- package/src/bridge/a2a/message.test.ts +138 -0
- package/src/bridge/a2a/task.test.ts +235 -0
- package/src/bridge/a2a/task.ts +4 -4
- package/src/bridge/mcp/connector/adapter.test.ts +230 -0
- package/src/bridge/sse/mapper.test.ts +422 -0
- package/src/bridge/tools/connector/adapter.test.ts +224 -0
- package/src/bridge/tools/connector/definitions.test.ts +183 -0
- package/src/bridge/tools/connector/router.test.ts +159 -0
- package/src/bus/breaker.test.ts +274 -0
- package/src/bus/index.test.ts +183 -0
- package/src/bus/lock.test.ts +265 -0
- package/src/bus/ownership.test.ts +243 -0
- package/src/config/runtime.ts +0 -2
- package/src/connector/BaseConnector.test.ts +130 -0
- package/src/connector/builtins/http.test.ts +290 -0
- package/src/connector/builtins/webhook.test.ts +138 -0
- package/src/connector/execution/factory.test.ts +75 -0
- package/src/connector/execution/remote.test.ts +63 -0
- package/src/connector/mcp/adapter.test.ts +249 -0
- package/src/contracts/api.ts +2 -2
- package/src/contracts/index.ts +1 -3
- package/src/index.ts +11 -362
- package/src/manager/agent/__tests__/lifecycle.test.ts +2 -2
- package/src/manager/agent/lifecycle.ts +5 -5
- package/src/manager/run/persistence.ts +4 -4
- package/src/manager/thread/__tests__/lifecycle.test.ts +1 -1
- package/src/manager/thread/lifecycle.ts +2 -2
- package/src/plugin/loader.ts +0 -16
- package/src/public-runtime.ts +373 -0
- package/src/public-tools.ts +63 -0
- package/src/public-types.ts +156 -0
- package/src/rag/chunking.test.ts +107 -0
- package/src/rag/context-assembler.test.ts +114 -0
- package/src/rag/embedding.test.ts +130 -0
- package/src/rag/ingestion.test.ts +114 -0
- package/src/rag/knowledge-base.test.ts +106 -0
- package/src/rag/rag-tool.test.ts +167 -0
- package/src/rag/retriever.test.ts +210 -0
- package/src/rag/vector-store.test.ts +196 -0
- package/src/registry/ManagedRegistry.test.ts +118 -0
- package/src/registry/Registry.test.ts +91 -0
- package/src/registry/agent/definitions.test.ts +100 -0
- package/src/registry/connector/definitions.test.ts +51 -0
- package/src/registry/connector/scoped.test.ts +129 -0
- package/src/registry/plugin/index.test.ts +85 -0
- package/src/registry/tool/execute.test.ts +330 -0
- package/src/run/LimitChecker.ts +0 -9
- package/src/run/reporter.ts +3 -3
- package/src/runtime/query/__tests__/checkpoint.test.ts +169 -0
- package/src/runtime/query/checkpoint.ts +54 -0
- package/src/runtime/query/context.ts +0 -5
- package/src/runtime/query/index.ts +4 -4
- package/src/runtime/query/iteration/phases/advisory.test.ts +412 -0
- package/src/runtime/query/replay/__tests__/mutate.test.ts +134 -0
- package/src/runtime/query/replay/__tests__/prepare.test.ts +207 -0
- package/src/runtime/query/replay/list.ts +32 -0
- package/src/runtime/query/replay/mutate.ts +76 -0
- package/src/runtime/query/replay/prepare.ts +114 -0
- package/src/runtime/query/result.ts +2 -2
- package/src/session/__tests__/integration/_fixtures.ts +2 -2
- package/src/session/__tests__/integration/archive-gate.test.ts +1 -1
- package/src/session/__tests__/integration/capacity-caps.test.ts +1 -1
- package/src/session/__tests__/integration/e2e-spawn.test.ts +1 -1
- package/src/session/__tests__/integration/handoff-broadcast-e2e.test.ts +1 -1
- package/src/session/__tests__/integration/handoff-single-e2e.test.ts +1 -1
- package/src/session/__tests__/integration/prev-artifact-dag.test.ts +4 -1
- package/src/session/__tests__/integration/retention-archive.test.ts +1 -1
- package/src/session/__tests__/integration/spawn-rollback.test.ts +2 -2
- package/src/session/__tests__/integration/summary-materialization-e2e.test.ts +1 -1
- package/src/session/errors.ts +1 -1
- package/src/session/events/index.ts +5 -4
- package/src/session/handoff/__tests__/broadcast.test.ts +1 -1
- package/src/session/handoff/__tests__/capacity.test.ts +1 -1
- package/src/session/handoff/__tests__/single.test.ts +1 -1
- package/src/session/handoff/assignment.ts +1 -1
- package/src/session/handoff/broadcast.ts +2 -2
- package/src/session/handoff/single.ts +2 -2
- package/src/session/index.ts +7 -6
- package/src/session/intervention/__tests__/prev-artifact.test.ts +4 -1
- package/src/session/intervention/prev-artifact.ts +1 -1
- package/src/session/retention/__tests__/archive.test.ts +3 -3
- package/src/session/retention/__tests__/disk-backend.test.ts +4 -4
- package/src/session/retention/archive.ts +2 -2
- package/src/session/retention/backend.ts +4 -4
- package/src/session/retention/disk-backend.ts +4 -4
- package/src/session/retention/index.ts +6 -4
- package/src/session/{hierarchy/__tests__/session.test.ts → status/__tests__/derive.test.ts} +3 -2
- package/src/session/{hierarchy/session.ts → status/derive.ts} +9 -55
- package/src/session/summary/__tests__/materialize.test.ts +4 -7
- package/src/session/summary/errors.ts +51 -0
- package/src/session/summary/index.ts +7 -10
- package/src/session/summary/materialize.ts +4 -5
- package/src/session/workspace/__tests__/git-worktree.test.ts +1 -1
- package/src/session/workspace/driver.ts +2 -2
- package/src/session/workspace/git-worktree.ts +1 -1
- package/src/session/workspace/index.ts +7 -6
- package/src/store/run/disk.ts +4 -4
- package/src/store/session/__tests__/disk.test.ts +2 -2
- package/src/store/session/__tests__/memory.test.ts +2 -2
- package/src/store/session/disk.ts +12 -12
- package/src/store/session/index.ts +3 -2
- package/src/store/session/linkage.ts +1 -1
- package/src/store/session/memory.ts +6 -6
- package/src/store/thread/disk.ts +1 -1
- package/src/store/thread/memory.ts +1 -1
- package/src/telemetry/attributes.ts +0 -4
- package/src/telemetry/runtime-accessors.ts +1 -5
- package/src/test-setup.ts +24 -0
- package/src/types/agent/task.ts +2 -2
- package/src/{session/hierarchy/project.ts → types/project/entity.ts} +3 -3
- package/src/types/project/index.ts +4 -0
- package/src/types/retention/index.ts +6 -0
- package/src/types/run/entity.ts +63 -0
- package/src/types/run/events.ts +6 -6
- package/src/types/run/index.ts +16 -9
- package/src/{session/hierarchy → types/run}/lineage.ts +1 -1
- package/src/types/run/replay.ts +61 -0
- package/src/{session/events/types.ts → types/run/subsession-events.ts} +4 -4
- package/src/{session/hierarchy → types/session}/actor.ts +1 -1
- package/src/types/session/entity.ts +59 -0
- package/src/types/session/index.ts +15 -0
- package/src/{store → types}/session/messages.ts +2 -2
- package/src/types/session/store.ts +6 -6
- package/src/{session/hierarchy → types/session}/sub-session.ts +9 -9
- package/src/{session → types}/summary/deliverable.ts +2 -2
- package/src/types/summary/index.ts +18 -0
- package/src/{session → types}/summary/ref.ts +9 -44
- package/src/{session/hierarchy/tenant.ts → types/tenant/entity.ts} +1 -1
- package/src/types/tenant/index.ts +4 -0
- package/src/{session/hierarchy/thread.ts → types/thread/entity.ts} +30 -6
- package/src/types/thread/index.ts +1 -0
- package/src/types/thread/store.ts +1 -1
- package/src/types/workspace/index.ts +12 -0
- package/src/{session → types}/workspace/ref.ts +1 -1
- package/src/utils/logger.ts +6 -1
- package/dist/contracts/ids.d.ts +0 -2
- package/dist/contracts/ids.d.ts.map +0 -1
- package/dist/contracts/ids.js +0 -2
- package/dist/contracts/ids.js.map +0 -1
- package/dist/session/events/schema-version.d.ts.map +0 -1
- package/dist/session/events/schema-version.js.map +0 -1
- package/dist/session/events/types.d.ts.map +0 -1
- package/dist/session/events/types.js +0 -2
- package/dist/session/events/types.js.map +0 -1
- package/dist/session/hierarchy/__tests__/session.test.d.ts +0 -2
- package/dist/session/hierarchy/__tests__/session.test.d.ts.map +0 -1
- package/dist/session/hierarchy/__tests__/session.test.js.map +0 -1
- package/dist/session/hierarchy/actor.d.ts.map +0 -1
- package/dist/session/hierarchy/index.d.ts +0 -9
- package/dist/session/hierarchy/index.d.ts.map +0 -1
- package/dist/session/hierarchy/index.js +0 -4
- package/dist/session/hierarchy/index.js.map +0 -1
- package/dist/session/hierarchy/lineage.d.ts.map +0 -1
- package/dist/session/hierarchy/lineage.js.map +0 -1
- package/dist/session/hierarchy/project.d.ts.map +0 -1
- package/dist/session/hierarchy/project.js +0 -2
- package/dist/session/hierarchy/project.js.map +0 -1
- package/dist/session/hierarchy/session.d.ts +0 -71
- package/dist/session/hierarchy/session.d.ts.map +0 -1
- package/dist/session/hierarchy/session.js.map +0 -1
- package/dist/session/hierarchy/sub-session.d.ts.map +0 -1
- package/dist/session/hierarchy/sub-session.js.map +0 -1
- package/dist/session/hierarchy/tenant.d.ts.map +0 -1
- package/dist/session/hierarchy/tenant.js +0 -2
- package/dist/session/hierarchy/tenant.js.map +0 -1
- package/dist/session/hierarchy/thread.d.ts.map +0 -1
- package/dist/session/hierarchy/thread.js +0 -2
- package/dist/session/hierarchy/thread.js.map +0 -1
- package/dist/session/retention/archive-backend-ref.d.ts.map +0 -1
- package/dist/session/retention/archive-backend-ref.js.map +0 -1
- package/dist/session/retention/policy.d.ts.map +0 -1
- package/dist/session/retention/policy.js.map +0 -1
- package/dist/session/summary/deliverable.d.ts.map +0 -1
- package/dist/session/summary/deliverable.js.map +0 -1
- package/dist/session/summary/ref.d.ts.map +0 -1
- package/dist/session/summary/ref.js +0 -51
- package/dist/session/summary/ref.js.map +0 -1
- package/dist/session/workspace/ref.d.ts.map +0 -1
- package/dist/session/workspace/ref.js.map +0 -1
- package/dist/store/session/messages.js.map +0 -1
- package/dist/tools/builtins/__tests__/structuredOutput.example.d.ts +0 -140
- package/dist/tools/builtins/__tests__/structuredOutput.example.d.ts.map +0 -1
- package/dist/tools/builtins/__tests__/structuredOutput.example.js +0 -183
- package/dist/tools/builtins/__tests__/structuredOutput.example.js.map +0 -1
- package/dist/types/run/state.d.ts +0 -30
- package/dist/types/run/state.d.ts.map +0 -1
- package/dist/types/run/state.js +0 -2
- package/dist/types/run/state.js.map +0 -1
- package/src/contracts/ids.ts +0 -1
- package/src/session/hierarchy/index.ts +0 -18
- package/src/tools/builtins/__tests__/structuredOutput.example.ts +0 -221
- package/src/types/run/state.ts +0 -35
- /package/dist/{session → types}/retention/archive-backend-ref.d.ts +0 -0
- /package/dist/{session → types}/retention/archive-backend-ref.js +0 -0
- /package/dist/{session → types}/retention/policy.d.ts +0 -0
- /package/dist/{session → types}/retention/policy.js +0 -0
- /package/dist/{session/hierarchy → types/run}/lineage.js +0 -0
- /package/dist/{session/events → types/run}/schema-version.d.ts +0 -0
- /package/dist/{session/events → types/run}/schema-version.js +0 -0
- /package/dist/{session/hierarchy → types/session}/actor.js +0 -0
- /package/dist/{store → types}/session/messages.js +0 -0
- /package/dist/{session/hierarchy → types/session}/sub-session.js +0 -0
- /package/dist/{session → types}/summary/deliverable.js +0 -0
- /package/dist/{session → types}/workspace/ref.js +0 -0
- /package/src/{session → types}/retention/archive-backend-ref.ts +0 -0
- /package/src/{session → types}/retention/policy.ts +0 -0
- /package/src/{session/events → types/run}/schema-version.ts +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
2
2
|
import { ThreadManager } from '../../../manager/thread/lifecycle.js'
|
|
3
3
|
import { TenantIsolationError } from '../../../session/errors.js'
|
|
4
|
-
import type { ActorRef } from '../../../session/hierarchy/actor.js'
|
|
5
4
|
import {
|
|
6
5
|
type ExecFile,
|
|
7
6
|
type ExecFileResult,
|
|
@@ -11,6 +10,7 @@ import { WorkspaceBackendRegistry } from '../../../session/workspace/registry.js
|
|
|
11
10
|
import { InMemorySessionStore } from '../../../store/session/memory.js'
|
|
12
11
|
import { InMemoryThreadStore } from '../../../store/thread/memory.js'
|
|
13
12
|
import type { AgentId, SessionId, TenantId, UserId } from '../../../types/ids/index.js'
|
|
13
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
14
14
|
import { generateHandoffId } from '../../../utils/id.js'
|
|
15
15
|
import type { HandoffAssignment } from '../assignment.js'
|
|
16
16
|
import { DefaultCapacityValidator } from '../capacity.js'
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { SessionId, TenantId } from '../../types/ids/index.js'
|
|
12
|
+
import type { ActorRef } from '../../types/session/actor.js'
|
|
12
13
|
import type { HandoffId, ProjectId, ThreadId, WorkspaceId } from '../../types/session/ids.js'
|
|
13
|
-
import type { ActorRef } from '../hierarchy/actor.js'
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Handoff mode discriminator. `single` transfers ownership of the source
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
|
|
24
24
|
import type { ThreadManager } from '../../manager/thread/lifecycle.js'
|
|
25
25
|
import type { SessionId, TenantId } from '../../types/ids/index.js'
|
|
26
|
+
import type { Session } from '../../types/session/entity.js'
|
|
26
27
|
import type { SubSessionId } from '../../types/session/ids.js'
|
|
27
28
|
import type { SessionStore } from '../../types/session/store.js'
|
|
29
|
+
import type { WorkspaceRef } from '../../types/workspace/ref.js'
|
|
28
30
|
import { TenantIsolationError } from '../errors.js'
|
|
29
|
-
import type { Session } from '../hierarchy/session.js'
|
|
30
31
|
import type { WorkspaceBackendDriver } from '../workspace/driver.js'
|
|
31
|
-
import type { WorkspaceRef } from '../workspace/ref.js'
|
|
32
32
|
import type { WorkspaceBackendRegistry } from '../workspace/registry.js'
|
|
33
33
|
import type { HandoffAssignment, HandoffOutcome } from './assignment.js'
|
|
34
34
|
import type { CapacityValidator } from './capacity.js'
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
import type { ThreadManager } from '../../manager/thread/lifecycle.js'
|
|
24
24
|
import type { SessionId, TenantId } from '../../types/ids/index.js'
|
|
25
|
+
import type { Session } from '../../types/session/entity.js'
|
|
25
26
|
import type { SessionStore } from '../../types/session/store.js'
|
|
27
|
+
import type { WorkspaceRef } from '../../types/workspace/ref.js'
|
|
26
28
|
import { TenantIsolationError } from '../errors.js'
|
|
27
|
-
import type { Session } from '../hierarchy/session.js'
|
|
28
29
|
import type { WorkspaceBackendDriver } from '../workspace/driver.js'
|
|
29
|
-
import type { WorkspaceRef } from '../workspace/ref.js'
|
|
30
30
|
import type { WorkspaceBackendRegistry } from '../workspace/registry.js'
|
|
31
31
|
import type { HandoffAssignment, HandoffOutcome } from './assignment.js'
|
|
32
32
|
import type { CapacityValidator } from './capacity.js'
|
package/src/session/index.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// Top-level barrel for the session
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Top-level barrel for the session module.
|
|
2
|
+
// Shape types (Project / Thread / Session / SubSession / Actor / Lineage /
|
|
3
|
+
// Tenant) live under `types/` as of ses_010 (2026-04-21); this barrel
|
|
4
|
+
// re-exports only the runtime machinery that lives under `session/*/`
|
|
5
|
+
// (events, workspace, handoff, summary, intervention, migration, retention,
|
|
6
|
+
// status). Consumers of `@namzu/sdk` reach entity shapes through the root
|
|
7
|
+
// barrel directly.
|
|
6
8
|
|
|
7
|
-
export * from './hierarchy/index.js'
|
|
8
9
|
export * from './events/index.js'
|
|
9
10
|
export * from './workspace/index.js'
|
|
10
11
|
export * from './handoff/index.js'
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
import type { SessionId } from '../../../types/ids/index.js'
|
|
3
3
|
import type { DeliverableId, SubSessionId, SummaryId } from '../../../types/session/ids.js'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
DeliverableRef,
|
|
6
|
+
SessionSummaryDeliverable,
|
|
7
|
+
} from '../../../types/summary/deliverable.js'
|
|
5
8
|
import {
|
|
6
9
|
ArtifactRefCycleError,
|
|
7
10
|
type InterventionChainLoader,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import type { SessionId } from '../../types/ids/index.js'
|
|
19
19
|
import type { SubSessionId } from '../../types/session/ids.js'
|
|
20
|
-
import type { DeliverableRef } from '
|
|
20
|
+
import type { DeliverableRef } from '../../types/summary/deliverable.js'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Minimal record the validator needs to step ancestrally from one
|
|
@@ -2,15 +2,15 @@ import { mkdtempSync, rmSync } from 'node:fs'
|
|
|
2
2
|
import { tmpdir } from 'node:os'
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
|
5
|
-
import type { ActorRef } from '../../../session/hierarchy/actor.js'
|
|
6
|
-
import type { SubSession } from '../../../session/hierarchy/sub-session.js'
|
|
7
5
|
import { type ExecFile, GitWorktreeDriver } from '../../../session/workspace/git-worktree.js'
|
|
8
|
-
import type { WorkspaceRef } from '../../../session/workspace/ref.js'
|
|
9
6
|
import { WorkspaceBackendRegistry } from '../../../session/workspace/registry.js'
|
|
10
7
|
import { InMemorySessionStore } from '../../../store/session/memory.js'
|
|
11
8
|
import type { AgentId, TenantId, UserId } from '../../../types/ids/index.js'
|
|
12
9
|
import { createUserMessage } from '../../../types/message/index.js'
|
|
10
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
13
11
|
import type { ThreadId, WorkspaceId } from '../../../types/session/ids.js'
|
|
12
|
+
import type { SubSession } from '../../../types/session/sub-session.js'
|
|
13
|
+
import type { WorkspaceRef } from '../../../types/workspace/ref.js'
|
|
14
14
|
import {
|
|
15
15
|
ArchivalManager,
|
|
16
16
|
ArchiveNotConfiguredError,
|
|
@@ -3,13 +3,13 @@ import { readFile, readdir } from 'node:fs/promises'
|
|
|
3
3
|
import { tmpdir } from 'node:os'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
|
-
import type { SessionMessage } from '../../../store/session/messages.js'
|
|
7
6
|
import type { MessageId, SessionId, TenantId } from '../../../types/ids/index.js'
|
|
8
7
|
import { createUserMessage } from '../../../types/message/index.js'
|
|
8
|
+
import type { ArchiveBackendRef } from '../../../types/retention/archive-backend-ref.js'
|
|
9
9
|
import type { SubSessionId, SummaryId, WorkspaceId } from '../../../types/session/ids.js'
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
10
|
+
import type { SessionMessage } from '../../../types/session/messages.js'
|
|
11
|
+
import type { SessionSummaryRef } from '../../../types/summary/ref.js'
|
|
12
|
+
import type { WorkspaceRef } from '../../../types/workspace/ref.js'
|
|
13
13
|
import { DiskArchiveBackend } from '../disk-backend.js'
|
|
14
14
|
|
|
15
15
|
const tenantA = 'tnt_alpha' as TenantId
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
import type { SessionId, SubSessionId, TenantId } from '../../types/ids/index.js'
|
|
29
29
|
import type { WorkspaceId } from '../../types/session/ids.js'
|
|
30
30
|
import type { SessionStore } from '../../types/session/store.js'
|
|
31
|
-
import type { SubSession, SubSessionStatus } from '
|
|
32
|
-
import type { WorkspaceRef } from '
|
|
31
|
+
import type { SubSession, SubSessionStatus } from '../../types/session/sub-session.js'
|
|
32
|
+
import type { WorkspaceRef } from '../../types/workspace/ref.js'
|
|
33
33
|
import type { WorkspaceBackendRegistry } from '../workspace/registry.js'
|
|
34
34
|
import type { ArchiveBackend, SubSessionTombstone } from './backend.js'
|
|
35
35
|
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* `SessionStore` is the Store it mutates.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import type { SessionMessage } from '../../store/session/messages.js'
|
|
16
15
|
import type { SessionId, SubSessionId, TenantId } from '../../types/ids/index.js'
|
|
16
|
+
import type { ArchiveBackendRef } from '../../types/retention/archive-backend-ref.js'
|
|
17
17
|
import type { SummaryId } from '../../types/session/ids.js'
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
20
|
-
import type {
|
|
18
|
+
import type { SessionMessage } from '../../types/session/messages.js'
|
|
19
|
+
import type { SessionSummaryRef } from '../../types/summary/ref.js'
|
|
20
|
+
import type { WorkspaceRef } from '../../types/workspace/ref.js'
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Output of a successful {@link ArchiveBackend.store} call. `archiveRef` is
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
import { randomBytes } from 'node:crypto'
|
|
30
30
|
import { mkdir, readFile, readdir, rename, unlink, writeFile } from 'node:fs/promises'
|
|
31
31
|
import { join } from 'node:path'
|
|
32
|
-
import type { SessionMessage } from '../../store/session/messages.js'
|
|
33
32
|
import type { SessionId, SubSessionId, TenantId } from '../../types/ids/index.js'
|
|
34
|
-
import type {
|
|
35
|
-
import type {
|
|
36
|
-
import type {
|
|
33
|
+
import type { ArchiveBackendRef } from '../../types/retention/archive-backend-ref.js'
|
|
34
|
+
import type { SessionMessage } from '../../types/session/messages.js'
|
|
35
|
+
import type { SessionSummaryRef } from '../../types/summary/ref.js'
|
|
36
|
+
import type { WorkspaceRef } from '../../types/workspace/ref.js'
|
|
37
37
|
import type { ArchiveBackend, ArchiveInput, ArchiveOutput } from './backend.js'
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// Sub-barrel for the retention/archival module (Convention #4).
|
|
2
|
-
// Concrete types
|
|
2
|
+
// Concrete shape types live under `types/retention/`; runtime machinery
|
|
3
|
+
// (backend contract, manager, disk backend) lives in sibling files under
|
|
4
|
+
// `session/retention/`.
|
|
3
5
|
|
|
4
|
-
export type { ArchiveBackendRef } from '
|
|
5
|
-
export type { RetentionPolicy } from '
|
|
6
|
-
export { RETENTION_POLICY_DISABLED } from '
|
|
6
|
+
export type { ArchiveBackendRef } from '../../types/retention/archive-backend-ref.js'
|
|
7
|
+
export type { RetentionPolicy } from '../../types/retention/policy.js'
|
|
8
|
+
export { RETENTION_POLICY_DISABLED } from '../../types/retention/policy.js'
|
|
7
9
|
export type { ArchiveBackend, ArchiveInput, ArchiveOutput, SubSessionTombstone } from './backend.js'
|
|
8
10
|
export {
|
|
9
11
|
ArchivalManager,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
import type { RunStatus } from '../../../types/run/status.js'
|
|
3
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
4
|
+
import type { Session, SessionStatus } from '../../../types/session/entity.js'
|
|
3
5
|
import type {
|
|
4
6
|
ProjectId,
|
|
5
7
|
SessionId,
|
|
@@ -7,8 +9,7 @@ import type {
|
|
|
7
9
|
ThreadId,
|
|
8
10
|
UserId,
|
|
9
11
|
} from '../../../types/session/ids.js'
|
|
10
|
-
import
|
|
11
|
-
import { type Session, type SessionStatus, deriveStatus } from '../session.js'
|
|
12
|
+
import { deriveStatus } from '../derive.js'
|
|
12
13
|
|
|
13
14
|
const tenant = 'tnt_a' as TenantId
|
|
14
15
|
const project = 'prj_a' as ProjectId
|
|
@@ -1,61 +1,11 @@
|
|
|
1
|
-
import type { SessionId, TenantId } from '../../types/ids/index.js'
|
|
2
|
-
import type { RunStatus } from '../../types/run/status.js'
|
|
3
|
-
import type { ProjectId, ThreadId, WorkspaceId } from '../../types/session/ids.js'
|
|
4
|
-
import type { ActorRef } from './actor.js'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Session lifecycle states. See session-hierarchy.md §4.3 and the state
|
|
8
|
-
* machine in §5.1. `awaiting_merge` is a sub-state of idle used on the
|
|
9
|
-
* broadcast source session (§5.4) between fan-out and all recipients
|
|
10
|
-
* terminalizing.
|
|
11
|
-
*/
|
|
12
|
-
export type SessionStatus =
|
|
13
|
-
| 'active'
|
|
14
|
-
| 'idle'
|
|
15
|
-
| 'locked'
|
|
16
|
-
| 'awaiting_hitl'
|
|
17
|
-
| 'awaiting_merge'
|
|
18
|
-
| 'failed'
|
|
19
|
-
| 'archived'
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Multi-turn work unit owned by exactly one {@link ActorRef} at a time.
|
|
23
|
-
*
|
|
24
|
-
* Scope identifiers:
|
|
25
|
-
* - `threadId` — the topic-level {@link Thread} this Session lives under.
|
|
26
|
-
* Set at creation, immutable; Sessions never move threads.
|
|
27
|
-
* - `projectId` — the {@link Project} the owning Thread belongs to.
|
|
28
|
-
* **Denormalized** from `thread.projectId` at creation time; immutable.
|
|
29
|
-
* Kept on the Session record for ergonomic access (Project-scoped
|
|
30
|
-
* consumers — handoff validators, archival, retention — would otherwise
|
|
31
|
-
* need a second round-trip to ThreadStore on every read). This is NOT
|
|
32
|
-
* a deprecated mirror of a fading field; it is a deliberate
|
|
33
|
-
* denormalization of structurally-immutable derived data.
|
|
34
|
-
*
|
|
35
|
-
* Other invariants (session-hierarchy.md §4.3):
|
|
36
|
-
* - `previousActors` is append-only and publicly read-only; previous
|
|
37
|
-
* owners cannot write to the session again.
|
|
38
|
-
* - `ownerVersion` is the CAS counter for handoff (§6.1 / §6.2 / §6.4).
|
|
39
|
-
* - `workspaceId` is nullable for sessions whose workspace has not yet
|
|
40
|
-
* been provisioned (or has been torn down during archival).
|
|
41
|
-
*/
|
|
42
|
-
export interface Session {
|
|
43
|
-
id: SessionId
|
|
44
|
-
threadId: ThreadId
|
|
45
|
-
projectId: ProjectId
|
|
46
|
-
tenantId: TenantId
|
|
47
|
-
status: SessionStatus
|
|
48
|
-
currentActor: ActorRef | null
|
|
49
|
-
previousActors: readonly ActorRef[]
|
|
50
|
-
workspaceId: WorkspaceId | null
|
|
51
|
-
ownerVersion: number
|
|
52
|
-
createdAt: Date
|
|
53
|
-
updatedAt: Date
|
|
54
|
-
}
|
|
55
|
-
|
|
56
1
|
/**
|
|
57
2
|
* Pure Run→Session fan-in helper per session-hierarchy.md §5.1.
|
|
58
3
|
*
|
|
4
|
+
* Extracted from `session/hierarchy/session.ts` on 2026-04-21 (ses_010 commit
|
|
5
|
+
* 4) so the shape definition can live under `types/session/` while the
|
|
6
|
+
* runtime helper stays in a feature folder — the type-layering rule
|
|
7
|
+
* (`types/` = pure shapes, feature folders = runtime).
|
|
8
|
+
*
|
|
59
9
|
* The precedence (highest first) matches the pattern-doc table:
|
|
60
10
|
* 1. Session-level states that do not fan in from Run status:
|
|
61
11
|
* - `locked` (handoff CAS window) — preserved verbatim
|
|
@@ -75,6 +25,10 @@ export interface Session {
|
|
|
75
25
|
* not a terminal Session state"). Only `failed` runs drive the Session to
|
|
76
26
|
* `failed` when every Run ended that way.
|
|
77
27
|
*/
|
|
28
|
+
|
|
29
|
+
import type { RunStatus } from '../../types/run/status.js'
|
|
30
|
+
import type { Session, SessionStatus } from '../../types/session/entity.js'
|
|
31
|
+
|
|
78
32
|
export function deriveStatus(
|
|
79
33
|
session: Session,
|
|
80
34
|
runs: readonly { status: RunStatus }[],
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
import { TenantIsolationError } from '../../../session/errors.js'
|
|
3
|
-
import type { ActorRef } from '../../../session/hierarchy/actor.js'
|
|
4
3
|
import { InMemorySessionStore } from '../../../store/session/memory.js'
|
|
5
4
|
import type { AgentId, SessionId, TenantId, UserId } from '../../../types/ids/index.js'
|
|
5
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
6
6
|
import type { SummaryId, ThreadId } from '../../../types/session/ids.js'
|
|
7
|
-
import type { DeliverableRef } from '
|
|
7
|
+
import type { DeliverableRef } from '../../../types/summary/deliverable.js'
|
|
8
|
+
import { AGENT_SUMMARY_MAX_CHARS } from '../../../types/summary/ref.js'
|
|
9
|
+
import { AgentSummaryTooLongError, SessionAlreadySummarizedError } from '../errors.js'
|
|
8
10
|
import { SessionSummaryMaterializer } from '../materialize.js'
|
|
9
|
-
import {
|
|
10
|
-
AGENT_SUMMARY_MAX_CHARS,
|
|
11
|
-
AgentSummaryTooLongError,
|
|
12
|
-
SessionAlreadySummarizedError,
|
|
13
|
-
} from '../ref.js'
|
|
14
11
|
|
|
15
12
|
const TEST_THREAD_ID = 'thd_test' as ThreadId
|
|
16
13
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime errors emitted by the session-summary materialization path.
|
|
3
|
+
*
|
|
4
|
+
* Split from `session/summary/ref.ts` on 2026-04-21 (ses_010 commit 1): the
|
|
5
|
+
* shape types moved to `types/summary/ref.ts`; runtime behaviour (error
|
|
6
|
+
* classes, materializer) remains under `session/summary/`. This keeps the
|
|
7
|
+
* type-layering rule consistent — `types/` holds only pure shapes.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { SessionId } from '../../types/ids/index.js'
|
|
11
|
+
import type { SummaryId } from '../../types/session/ids.js'
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Raised by `SessionSummaryMaterializer.materialize` when the provided
|
|
15
|
+
* `agentSummary` exceeds the max-character bound declared at
|
|
16
|
+
* `types/summary/ref.ts#AGENT_SUMMARY_MAX_CHARS`. Convention #5
|
|
17
|
+
* deny-by-default — the kernel does not truncate silently.
|
|
18
|
+
*/
|
|
19
|
+
export class AgentSummaryTooLongError extends Error {
|
|
20
|
+
readonly details: {
|
|
21
|
+
readonly actual: number
|
|
22
|
+
readonly max: number
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor(details: { actual: number; max: number }) {
|
|
26
|
+
super(`agentSummary ${details.actual} chars exceeds max ${details.max}`)
|
|
27
|
+
this.name = 'AgentSummaryTooLongError'
|
|
28
|
+
this.details = details
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Raised when `SessionSummaryMaterializer.materialize` is invoked against a
|
|
34
|
+
* session that already has a persisted summary. Re-materialization would
|
|
35
|
+
* duplicate history — callers wanting to append must open a new intervention
|
|
36
|
+
* sub-session (see session-hierarchy.md §4.5).
|
|
37
|
+
*/
|
|
38
|
+
export class SessionAlreadySummarizedError extends Error {
|
|
39
|
+
readonly details: {
|
|
40
|
+
readonly sessionId: SessionId
|
|
41
|
+
readonly existingSummaryId: SummaryId
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
constructor(details: { sessionId: SessionId; existingSummaryId: SummaryId }) {
|
|
45
|
+
super(
|
|
46
|
+
`Session ${details.sessionId} already has summary ${details.existingSummaryId}; re-materialization rejected`,
|
|
47
|
+
)
|
|
48
|
+
this.name = 'SessionAlreadySummarizedError'
|
|
49
|
+
this.details = details
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Sub-barrel for the session summary module (Convention #4).
|
|
2
2
|
//
|
|
3
3
|
// See session-hierarchy.md §4.7 (SessionSummaryRef shape) and §8.1
|
|
4
|
-
// (kernel-only emission invariant).
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// (kernel-only emission invariant). Shape types live under
|
|
5
|
+
// `types/summary/`; runtime (materializer + error classes) lives in
|
|
6
|
+
// sibling files under `session/summary/`.
|
|
7
7
|
|
|
8
8
|
export type {
|
|
9
9
|
ArtifactBlobDeliverable,
|
|
@@ -12,18 +12,15 @@ export type {
|
|
|
12
12
|
FileDeliverable,
|
|
13
13
|
MessageDeliverable,
|
|
14
14
|
SessionSummaryDeliverable,
|
|
15
|
-
} from '
|
|
16
|
-
export {
|
|
17
|
-
AGENT_SUMMARY_MAX_CHARS,
|
|
18
|
-
AgentSummaryTooLongError,
|
|
19
|
-
SessionAlreadySummarizedError,
|
|
20
|
-
} from './ref.js'
|
|
15
|
+
} from '../../types/summary/deliverable.js'
|
|
16
|
+
export { AGENT_SUMMARY_MAX_CHARS } from '../../types/summary/ref.js'
|
|
21
17
|
export type {
|
|
22
18
|
SessionSummaryKeyDecision,
|
|
23
19
|
SessionSummaryOutcome,
|
|
24
20
|
SessionSummaryOutcomeStatus,
|
|
25
21
|
SessionSummaryRef,
|
|
26
|
-
} from '
|
|
22
|
+
} from '../../types/summary/ref.js'
|
|
23
|
+
export { AgentSummaryTooLongError, SessionAlreadySummarizedError } from './errors.js'
|
|
27
24
|
export { SessionSummaryMaterializer } from './materialize.js'
|
|
28
25
|
export type {
|
|
29
26
|
MaterializeInput,
|
|
@@ -19,18 +19,17 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import type { SessionId, TenantId } from '../../types/ids/index.js'
|
|
22
|
+
import type { Session } from '../../types/session/entity.js'
|
|
22
23
|
import type { SummaryId } from '../../types/session/ids.js'
|
|
23
24
|
import type { SessionStore } from '../../types/session/store.js'
|
|
24
|
-
import type {
|
|
25
|
-
import type { DeliverableRef } from './deliverable.js'
|
|
25
|
+
import type { DeliverableRef } from '../../types/summary/deliverable.js'
|
|
26
26
|
import {
|
|
27
27
|
AGENT_SUMMARY_MAX_CHARS,
|
|
28
|
-
AgentSummaryTooLongError,
|
|
29
|
-
SessionAlreadySummarizedError,
|
|
30
28
|
type SessionSummaryKeyDecision,
|
|
31
29
|
type SessionSummaryOutcome,
|
|
32
30
|
type SessionSummaryRef,
|
|
33
|
-
} from '
|
|
31
|
+
} from '../../types/summary/ref.js'
|
|
32
|
+
import { AgentSummaryTooLongError, SessionAlreadySummarizedError } from './errors.js'
|
|
34
33
|
|
|
35
34
|
/**
|
|
36
35
|
* Dependencies for {@link SessionSummaryMaterializer}. The generator is
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest'
|
|
2
|
+
import type { WorkspaceRef } from '../../../types/workspace/ref.js'
|
|
2
3
|
import { WorkspaceBackendError } from '../../errors.js'
|
|
3
4
|
import {
|
|
4
5
|
type ExecFile,
|
|
@@ -6,7 +7,6 @@ import {
|
|
|
6
7
|
GitWorktreeDriver,
|
|
7
8
|
parseWorktreeList,
|
|
8
9
|
} from '../git-worktree.js'
|
|
9
|
-
import type { WorkspaceRef } from '../ref.js'
|
|
10
10
|
|
|
11
11
|
function stubLogger() {
|
|
12
12
|
return {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* later phase (Convention #10: provider abstraction).
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import type { WorkspaceBackendKind, WorkspaceRef } from '
|
|
12
|
+
import type { WorkspaceBackendKind, WorkspaceRef } from '../../types/workspace/ref.js'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Params for {@link WorkspaceBackendDriver.create}. `baseRef` selects the
|
|
@@ -57,4 +57,4 @@ export interface WorkspaceBackendDriver {
|
|
|
57
57
|
inspect(ref: WorkspaceRef): Promise<WorkspaceInspection>
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export type { WorkspaceBackendKind } from '
|
|
60
|
+
export type { WorkspaceBackendKind } from '../../types/workspace/ref.js'
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import { execFile } from 'node:child_process'
|
|
14
14
|
import { join } from 'node:path'
|
|
15
15
|
import { promisify } from 'node:util'
|
|
16
|
+
import type { GitWorktreeBackendMeta, WorkspaceRef } from '../../types/workspace/ref.js'
|
|
16
17
|
import { generateWorkspaceId } from '../../utils/id.js'
|
|
17
18
|
import type { Logger } from '../../utils/logger.js'
|
|
18
19
|
import { WorkspaceBackendError } from '../errors.js'
|
|
@@ -22,7 +23,6 @@ import type {
|
|
|
22
23
|
WorkspaceBackendDriver,
|
|
23
24
|
WorkspaceInspection,
|
|
24
25
|
} from './driver.js'
|
|
25
|
-
import type { GitWorktreeBackendMeta, WorkspaceRef } from './ref.js'
|
|
26
26
|
|
|
27
27
|
const execFileAsync = promisify(execFile)
|
|
28
28
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// Sub-barrel for the workspace module (Convention #4).
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// Shape types live under `types/workspace/`; runtime machinery (drivers,
|
|
3
|
+
// registry, path-builder, git-worktree) lives in sibling files under
|
|
4
|
+
// `session/workspace/`.
|
|
4
5
|
|
|
5
6
|
export type {
|
|
6
|
-
WorkspaceRef,
|
|
7
|
-
WorkspaceBackendMeta,
|
|
8
|
-
WorkspaceBackendKind,
|
|
9
7
|
GitWorktreeBackendMeta,
|
|
10
|
-
|
|
8
|
+
WorkspaceBackendKind,
|
|
9
|
+
WorkspaceBackendMeta,
|
|
10
|
+
WorkspaceRef,
|
|
11
|
+
} from '../../types/workspace/ref.js'
|
|
11
12
|
|
|
12
13
|
export type {
|
|
13
14
|
WorkspaceBackendDriver,
|
package/src/store/run/disk.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { appendFile, mkdir, readFile, readdir, rename, unlink, writeFile } from 'node:fs/promises'
|
|
2
2
|
import { join } from 'node:path'
|
|
3
3
|
import type { CheckpointId, IterationCheckpoint } from '../../types/hitl/index.js'
|
|
4
|
-
import type {
|
|
4
|
+
import type { Run, RunEvent, RunStoreConfig } from '../../types/run/index.js'
|
|
5
5
|
import { type Logger, getRootLogger } from '../../utils/logger.js'
|
|
6
6
|
|
|
7
7
|
export class RunDiskStore {
|
|
@@ -44,7 +44,7 @@ export class RunDiskStore {
|
|
|
44
44
|
await appendFile(join(dir, 'transcript.jsonl'), line, 'utf-8')
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
async writeRunMeta(run:
|
|
47
|
+
async writeRunMeta(run: Run): Promise<void> {
|
|
48
48
|
const dir = this.requireInit()
|
|
49
49
|
|
|
50
50
|
const meta: Record<string, unknown> = {
|
|
@@ -65,7 +65,7 @@ export class RunDiskStore {
|
|
|
65
65
|
await atomicWriteJson(join(dir, 'run.json'), meta)
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async writeMessages(run:
|
|
68
|
+
async writeMessages(run: Run): Promise<void> {
|
|
69
69
|
const dir = this.requireInit()
|
|
70
70
|
await atomicWriteJson(join(dir, 'messages.json'), run.messages)
|
|
71
71
|
}
|
|
@@ -151,7 +151,7 @@ export class RunDiskStore {
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
async addToIndex(run:
|
|
154
|
+
async addToIndex(run: Run): Promise<void> {
|
|
155
155
|
if (run.parentRunId) return
|
|
156
156
|
|
|
157
157
|
const prev = this.indexLock
|
|
@@ -4,9 +4,9 @@ import { tmpdir } from 'node:os'
|
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
|
|
6
6
|
import { TenantIsolationError } from '../../../session/errors.js'
|
|
7
|
-
import type { ActorRef } from '../../../session/hierarchy/actor.js'
|
|
8
7
|
import type { AgentId, TenantId, UserId } from '../../../types/ids/index.js'
|
|
9
8
|
import { createUserMessage } from '../../../types/message/index.js'
|
|
9
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
10
10
|
import { DiskSessionStore } from '../disk.js'
|
|
11
11
|
|
|
12
12
|
const tenantA = 'tnt_alpha' as TenantId
|
|
@@ -389,9 +389,9 @@ describe('DiskSessionStore', () => {
|
|
|
389
389
|
})
|
|
390
390
|
})
|
|
391
391
|
|
|
392
|
-
import type { SessionSummaryRef } from '../../../session/summary/ref.js'
|
|
393
392
|
// Import after use so tests are self-contained w.r.t. types we already use.
|
|
394
393
|
import type { SessionId } from '../../../types/ids/index.js'
|
|
395
394
|
import type { SummaryId, ThreadId } from '../../../types/session/ids.js'
|
|
395
|
+
import type { SessionSummaryRef } from '../../../types/summary/ref.js'
|
|
396
396
|
|
|
397
397
|
const TEST_THREAD_ID = 'thd_test' as ThreadId
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
import { TenantIsolationError } from '../../../session/errors.js'
|
|
3
|
-
import type { ActorRef } from '../../../session/hierarchy/actor.js'
|
|
4
|
-
import type { SubSession } from '../../../session/hierarchy/sub-session.js'
|
|
5
3
|
import type { AgentId, SessionId, TenantId, UserId } from '../../../types/ids/index.js'
|
|
6
4
|
import { createUserMessage } from '../../../types/message/index.js'
|
|
5
|
+
import type { ActorRef } from '../../../types/session/actor.js'
|
|
7
6
|
import type { ThreadId } from '../../../types/session/ids.js'
|
|
7
|
+
import type { SubSession } from '../../../types/session/sub-session.js'
|
|
8
8
|
import { InMemorySessionStore } from '../memory.js'
|
|
9
9
|
|
|
10
10
|
const TEST_THREAD_ID = 'thd_test' as ThreadId
|
|
@@ -33,19 +33,13 @@ import {
|
|
|
33
33
|
} from 'node:fs/promises'
|
|
34
34
|
import { join } from 'node:path'
|
|
35
35
|
import { TenantIsolationError } from '../../session/errors.js'
|
|
36
|
-
import
|
|
37
|
-
import type { Session } from '../../session/hierarchy/session.js'
|
|
38
|
-
import type { SubSession } from '../../session/hierarchy/sub-session.js'
|
|
39
|
-
import type { DeliverableRef } from '../../session/summary/deliverable.js'
|
|
40
|
-
import { SessionAlreadySummarizedError } from '../../session/summary/ref.js'
|
|
41
|
-
import type {
|
|
42
|
-
SessionSummaryKeyDecision,
|
|
43
|
-
SessionSummaryOutcome,
|
|
44
|
-
SessionSummaryRef,
|
|
45
|
-
} from '../../session/summary/ref.js'
|
|
36
|
+
import { SessionAlreadySummarizedError } from '../../session/summary/errors.js'
|
|
46
37
|
import type { MessageId, SessionId, TenantId } from '../../types/ids/index.js'
|
|
47
38
|
import type { Message } from '../../types/message/index.js'
|
|
39
|
+
import type { Project } from '../../types/project/entity.js'
|
|
40
|
+
import type { Session } from '../../types/session/entity.js'
|
|
48
41
|
import type { ProjectId, SubSessionId, SummaryId, ThreadId } from '../../types/session/ids.js'
|
|
42
|
+
import type { SessionMessage } from '../../types/session/messages.js'
|
|
49
43
|
import type {
|
|
50
44
|
CreateProjectParams,
|
|
51
45
|
CreateSessionParams,
|
|
@@ -53,6 +47,13 @@ import type {
|
|
|
53
47
|
SessionStore,
|
|
54
48
|
SessionView,
|
|
55
49
|
} from '../../types/session/store.js'
|
|
50
|
+
import type { SubSession } from '../../types/session/sub-session.js'
|
|
51
|
+
import type { DeliverableRef } from '../../types/summary/deliverable.js'
|
|
52
|
+
import type {
|
|
53
|
+
SessionSummaryKeyDecision,
|
|
54
|
+
SessionSummaryOutcome,
|
|
55
|
+
SessionSummaryRef,
|
|
56
|
+
} from '../../types/summary/ref.js'
|
|
56
57
|
import {
|
|
57
58
|
generateMessageId,
|
|
58
59
|
generateProjectId,
|
|
@@ -61,7 +62,6 @@ import {
|
|
|
61
62
|
} from '../../utils/id.js'
|
|
62
63
|
import { getAncestry, getChildren, orderChildren } from './linkage.js'
|
|
63
64
|
import type { LinkageView } from './linkage.js'
|
|
64
|
-
import type { SessionMessage } from './messages.js'
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Config for {@link DiskSessionStore}. `rootDir` is absolute; all files live
|
|
@@ -973,4 +973,4 @@ async function atomicWriteJson(filePath: string, value: unknown): Promise<void>
|
|
|
973
973
|
// line is a whole record. This matches pattern doc §13.4 persistence
|
|
974
974
|
// (`messages.json[l]` as append-only event log).
|
|
975
975
|
|
|
976
|
-
export type { SessionMessage } from '
|
|
976
|
+
export type { SessionMessage } from '../../types/session/messages.js'
|