@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
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
// Public runtime surface of `@namzu/sdk`.
|
|
2
|
+
//
|
|
3
|
+
// Every runtime value a consumer might need: classes (agents, managers,
|
|
4
|
+
// stores, registries), functions (helpers, ID generators, runtime entry
|
|
5
|
+
// points), zod schemas, constants, error classes. See §4.2 of
|
|
6
|
+
// `docs.local/sessions/ses_011-sdk-public-surface/design.md`.
|
|
7
|
+
//
|
|
8
|
+
// Rule: no type-only exports here (types live in public-types.ts). No tool
|
|
9
|
+
// definitions or builders (tools live in public-tools.ts).
|
|
10
|
+
|
|
11
|
+
// ─── version + config ────────────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export { VERSION } from './version.js'
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
CompactionConfigSchema,
|
|
17
|
+
PluginRuntimeConfigSchema,
|
|
18
|
+
RUNTIME_DEFAULTS,
|
|
19
|
+
RuntimeConfigSchema,
|
|
20
|
+
SandboxConfigSchema,
|
|
21
|
+
TaskRouterConfigSchema,
|
|
22
|
+
} from './config/runtime.js'
|
|
23
|
+
|
|
24
|
+
// ─── constants ───────────────────────────────────────────────────────────
|
|
25
|
+
|
|
26
|
+
export * from './constants/index.js'
|
|
27
|
+
|
|
28
|
+
// ─── wire schemas + a2a (contracts/) ─────────────────────────────────────
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
CreateMessageSchema,
|
|
32
|
+
CreateRunSchema,
|
|
33
|
+
CreateStatelessRunSchema,
|
|
34
|
+
MessageIdSchema,
|
|
35
|
+
PaginationSchema,
|
|
36
|
+
ProjectIdSchema,
|
|
37
|
+
RunConfigSchema,
|
|
38
|
+
RunIdSchema,
|
|
39
|
+
zodErrorToApiError,
|
|
40
|
+
} from './contracts/schemas.js'
|
|
41
|
+
|
|
42
|
+
export * from './contracts/a2a.js'
|
|
43
|
+
|
|
44
|
+
// ─── ID generators + parsers ─────────────────────────────────────────────
|
|
45
|
+
|
|
46
|
+
export * from './utils/id.js'
|
|
47
|
+
|
|
48
|
+
// ─── utility helpers ─────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
export { accumulateCost, calculateCost, formatCost, ZERO_COST } from './utils/cost.js'
|
|
51
|
+
export { toErrorMessage } from './utils/error.js'
|
|
52
|
+
export { configureLogger, getRootLogger, Logger } from './utils/logger.js'
|
|
53
|
+
export { buildToolResultHashes, hashToolResult } from './utils/hash.js'
|
|
54
|
+
export { compressShellOutput, compressShellOutputFull } from './utils/shell-compress.js'
|
|
55
|
+
export { createChildAbortController } from './utils/abort.js'
|
|
56
|
+
export { memoizeAsync } from './utils/memoize.js'
|
|
57
|
+
export { extractFinalResponse } from './utils/conversation.js'
|
|
58
|
+
|
|
59
|
+
// ─── router, runtime, run ────────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
export { resolveTaskModel } from './router/task-router.js'
|
|
62
|
+
export { drainQuery, query } from './runtime/query/index.js'
|
|
63
|
+
export { ContextCache } from './runtime/query/context-cache.js'
|
|
64
|
+
export { CheckpointManager, projectEmergencyToCheckpoint } from './runtime/query/checkpoint.js'
|
|
65
|
+
export { prepareReplayState } from './runtime/query/replay/prepare.js'
|
|
66
|
+
export { listCheckpoints } from './runtime/query/replay/list.js'
|
|
67
|
+
export { DecisionParser, FallbackResolver } from './runtime/decision/index.js'
|
|
68
|
+
export {
|
|
69
|
+
buildLimitConfig,
|
|
70
|
+
checkLimitsDetailed,
|
|
71
|
+
createRunReporter,
|
|
72
|
+
} from './run/index.js'
|
|
73
|
+
|
|
74
|
+
// ─── personas, skills, advisory ──────────────────────────────────────────
|
|
75
|
+
|
|
76
|
+
export { assembleSystemPrompt, mergePersonas, withSessionContext } from './persona/index.js'
|
|
77
|
+
export { discoverSkills, loadSkill, resolveSkillChain, SkillRegistry } from './skills/index.js'
|
|
78
|
+
export {
|
|
79
|
+
AdvisorRegistry,
|
|
80
|
+
AdvisoryContext,
|
|
81
|
+
AdvisoryExecutor,
|
|
82
|
+
TriggerEvaluator,
|
|
83
|
+
} from './advisory/index.js'
|
|
84
|
+
|
|
85
|
+
// ─── agents ──────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
AbstractAgent,
|
|
89
|
+
ConcurrentInvocationError,
|
|
90
|
+
defineAgent,
|
|
91
|
+
InvocationLock,
|
|
92
|
+
PipelineAgent,
|
|
93
|
+
ReactiveAgent,
|
|
94
|
+
RouterAgent,
|
|
95
|
+
SupervisorAgent,
|
|
96
|
+
} from './agents/index.js'
|
|
97
|
+
|
|
98
|
+
// ─── registries, stores, managers, plugin, gateway ───────────────────────
|
|
99
|
+
|
|
100
|
+
export {
|
|
101
|
+
ActivityStore,
|
|
102
|
+
DiskMemoryStore,
|
|
103
|
+
DiskTaskStore,
|
|
104
|
+
InMemoryMemoryIndex,
|
|
105
|
+
InMemoryMemoryStore,
|
|
106
|
+
InMemoryStore,
|
|
107
|
+
InMemoryTaskStore,
|
|
108
|
+
RunDiskStore,
|
|
109
|
+
} from './store/index.js'
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
AgentRegistry,
|
|
113
|
+
ManagedRegistry,
|
|
114
|
+
PluginRegistry,
|
|
115
|
+
Registry,
|
|
116
|
+
ToolRegistry,
|
|
117
|
+
} from './registry/index.js'
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
discoverAllPluginDirs,
|
|
121
|
+
discoverPlugins,
|
|
122
|
+
loadPluginManifest,
|
|
123
|
+
PluginLifecycleManager,
|
|
124
|
+
PluginResolver,
|
|
125
|
+
} from './plugin/index.js'
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
AgentManager,
|
|
129
|
+
EmergencySaveManager,
|
|
130
|
+
PlanManager,
|
|
131
|
+
RunPersistence,
|
|
132
|
+
} from './manager/index.js'
|
|
133
|
+
|
|
134
|
+
export { LocalTaskGateway } from './gateway/local.js'
|
|
135
|
+
|
|
136
|
+
// ─── providers, sandbox, vault ───────────────────────────────────────────
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
DuplicateProviderError,
|
|
140
|
+
MOCK_CAPABILITIES,
|
|
141
|
+
MockLLMProvider,
|
|
142
|
+
ProviderRegistry,
|
|
143
|
+
registerMock,
|
|
144
|
+
UnknownProviderError,
|
|
145
|
+
} from './provider/index.js'
|
|
146
|
+
|
|
147
|
+
export { LocalSandboxProvider, SandboxProviderFactory } from './sandbox/index.js'
|
|
148
|
+
|
|
149
|
+
export { InMemoryCredentialVault } from './vault/index.js'
|
|
150
|
+
|
|
151
|
+
// ─── RAG runtime (generic; createRAGTool is in public-tools.ts) ──────────
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
assembleRAGContext,
|
|
155
|
+
cosineSimilarity,
|
|
156
|
+
DEFAULT_CHUNKING_CONFIG,
|
|
157
|
+
DEFAULT_RAG_CONTEXT_CONFIG,
|
|
158
|
+
DEFAULT_RETRIEVAL_CONFIG,
|
|
159
|
+
DefaultIngestionPipeline,
|
|
160
|
+
DefaultKnowledgeBase,
|
|
161
|
+
DefaultRetriever,
|
|
162
|
+
InMemoryVectorStore,
|
|
163
|
+
OpenRouterEmbeddingProvider,
|
|
164
|
+
TextChunker,
|
|
165
|
+
} from './rag/index.js'
|
|
166
|
+
|
|
167
|
+
// ─── connectors ──────────────────────────────────────────────────────────
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
BaseConnector,
|
|
171
|
+
BaseExecutionContext,
|
|
172
|
+
ConnectorManager,
|
|
173
|
+
ConnectorRegistry,
|
|
174
|
+
EnvironmentConnectorManager,
|
|
175
|
+
ExecutionContextFactory,
|
|
176
|
+
HttpConnector,
|
|
177
|
+
HttpSseTransport,
|
|
178
|
+
HybridExecutionContext,
|
|
179
|
+
LocalExecutionContext,
|
|
180
|
+
MCPClient,
|
|
181
|
+
MCPConnectorBridge,
|
|
182
|
+
MCPServer,
|
|
183
|
+
MCPToolDiscovery,
|
|
184
|
+
mcpJsonSchemaToZod,
|
|
185
|
+
mcpToolResultToToolResult,
|
|
186
|
+
mcpToolToToolDefinition,
|
|
187
|
+
RemoteExecutionContext,
|
|
188
|
+
ScopedConnectorRegistry,
|
|
189
|
+
StdioTransport,
|
|
190
|
+
TenantConnectorManager,
|
|
191
|
+
toolDefinitionToMCPTool,
|
|
192
|
+
toolResultToMCPToolResult,
|
|
193
|
+
WebhookConnector,
|
|
194
|
+
zodToMCPJsonSchema,
|
|
195
|
+
} from './connector/index.js'
|
|
196
|
+
|
|
197
|
+
// ─── bridges (a2a + sse) ─────────────────────────────────────────────────
|
|
198
|
+
|
|
199
|
+
export {
|
|
200
|
+
a2aMessageToCreateRun,
|
|
201
|
+
a2aMessageToInput,
|
|
202
|
+
buildAgentCard,
|
|
203
|
+
extractTextFromA2AMessage,
|
|
204
|
+
isTerminalState,
|
|
205
|
+
mapRunToA2AEvent,
|
|
206
|
+
mapSessionToA2AEvent,
|
|
207
|
+
messageToA2A,
|
|
208
|
+
runStatusToA2AState,
|
|
209
|
+
runToA2ATask,
|
|
210
|
+
} from './bridge/a2a/index.js'
|
|
211
|
+
|
|
212
|
+
export { mapRunToStreamEvent, mapSessionToStreamEvent } from './bridge/sse/index.js'
|
|
213
|
+
|
|
214
|
+
// ─── bus, verification ───────────────────────────────────────────────────
|
|
215
|
+
|
|
216
|
+
export {
|
|
217
|
+
AgentBus,
|
|
218
|
+
CircuitBreaker,
|
|
219
|
+
EditOwnershipTracker,
|
|
220
|
+
FileLockManager,
|
|
221
|
+
} from './bus/index.js'
|
|
222
|
+
|
|
223
|
+
export { evaluateRule, VerificationGate } from './verification/index.js'
|
|
224
|
+
|
|
225
|
+
// ─── session runtime — explicit named lists, no `export *` ───────────────
|
|
226
|
+
// See §1.5 + §4.2 of design.md. Types flow through public-types.ts.
|
|
227
|
+
|
|
228
|
+
export { RUN_EVENT_SCHEMA_VERSION } from './session/events/index.js'
|
|
229
|
+
|
|
230
|
+
export {
|
|
231
|
+
DefaultPathBuilder,
|
|
232
|
+
GitWorktreeDriver,
|
|
233
|
+
parseWorktreeList,
|
|
234
|
+
WorkspaceBackendRegistry,
|
|
235
|
+
} from './session/workspace/index.js'
|
|
236
|
+
|
|
237
|
+
export {
|
|
238
|
+
DefaultCapacityValidator,
|
|
239
|
+
DelegationCapacityExceeded,
|
|
240
|
+
executeBroadcastHandoff,
|
|
241
|
+
executeSingleHandoff,
|
|
242
|
+
HandoffLockRejected,
|
|
243
|
+
HandoffVersionConflict,
|
|
244
|
+
NOOP_HANDOFF_SINK,
|
|
245
|
+
NOOP_RUN_STATUS_RESOLVER,
|
|
246
|
+
} from './session/handoff/index.js'
|
|
247
|
+
|
|
248
|
+
export {
|
|
249
|
+
AGENT_SUMMARY_MAX_CHARS,
|
|
250
|
+
AgentSummaryTooLongError,
|
|
251
|
+
SessionAlreadySummarizedError,
|
|
252
|
+
SessionSummaryMaterializer,
|
|
253
|
+
} from './session/summary/index.js'
|
|
254
|
+
|
|
255
|
+
export {
|
|
256
|
+
ArtifactRefCycleError,
|
|
257
|
+
InterventionDepthExceeded,
|
|
258
|
+
validatePrevArtifactChain,
|
|
259
|
+
} from './session/intervention/index.js'
|
|
260
|
+
|
|
261
|
+
export {
|
|
262
|
+
acceptLegacyThreadId,
|
|
263
|
+
acquireMigrationLock,
|
|
264
|
+
DefaultFilesystemMigrator,
|
|
265
|
+
FilesystemMigrationError,
|
|
266
|
+
LEGACY_DEFAULT_PROJECT_PREFIX,
|
|
267
|
+
LEGACY_DEFAULT_SESSION_ID,
|
|
268
|
+
LOCK_REL_PATH,
|
|
269
|
+
MARKER_REL_PATH,
|
|
270
|
+
MIGRATION_VERSION,
|
|
271
|
+
NOOP_FILESYSTEM_MIGRATION_SINK,
|
|
272
|
+
NOOP_MIGRATION_WARNING_SINK,
|
|
273
|
+
readMarker,
|
|
274
|
+
rejectLegacyPrefix,
|
|
275
|
+
releaseMigrationLock,
|
|
276
|
+
StalePrefixError,
|
|
277
|
+
WINDOW_OPEN,
|
|
278
|
+
writeMarker,
|
|
279
|
+
} from './session/migration/index.js'
|
|
280
|
+
|
|
281
|
+
export {
|
|
282
|
+
ArchivalManager,
|
|
283
|
+
ArchiveNotConfiguredError,
|
|
284
|
+
ArchiveNotFoundError,
|
|
285
|
+
DiskArchiveBackend,
|
|
286
|
+
RETENTION_POLICY_DISABLED,
|
|
287
|
+
SubSessionNotArchivableError,
|
|
288
|
+
SubSessionNotArchivedError,
|
|
289
|
+
} from './session/retention/index.js'
|
|
290
|
+
|
|
291
|
+
// NOTE: `deriveStatus` intentionally NOT re-exported here — it was not part
|
|
292
|
+
// of the pre-ses_011 public surface. Consumers needing it import from the
|
|
293
|
+
// internal path. Promoting it to public surface requires an explicit
|
|
294
|
+
// follow-up session.
|
|
295
|
+
|
|
296
|
+
export {
|
|
297
|
+
AncestryCycleError,
|
|
298
|
+
TenantIsolationError,
|
|
299
|
+
WorkspaceBackendError,
|
|
300
|
+
} from './session/errors.js'
|
|
301
|
+
|
|
302
|
+
// ─── store/session runtime — explicit named (types live in public-types.ts)
|
|
303
|
+
|
|
304
|
+
export {
|
|
305
|
+
DiskSessionStore,
|
|
306
|
+
getAncestry,
|
|
307
|
+
getChildren,
|
|
308
|
+
InMemorySessionStore,
|
|
309
|
+
orderChildren,
|
|
310
|
+
} from './store/session/index.js'
|
|
311
|
+
|
|
312
|
+
// ─── runtime helpers colocated with shapes under `types/` (§1.5) ─────────
|
|
313
|
+
|
|
314
|
+
export { A2AProtocolError } from './types/a2a/index.js'
|
|
315
|
+
export { isTerminalActivityStatus, resolveActivityTracking } from './types/activity/index.js'
|
|
316
|
+
export { isTerminalAgentTaskState } from './types/agent/task.js'
|
|
317
|
+
export { accumulateTokenUsage, isTerminalStatus } from './types/common/index.js'
|
|
318
|
+
export { assertComputerUseActionType, assertDisplayServer } from './types/computer-use/index.js'
|
|
319
|
+
export { isConnectorActive } from './types/connector/core.js'
|
|
320
|
+
export { CONNECTOR_SCOPE_ORDER } from './types/connector/scope.js'
|
|
321
|
+
export { RoutingResponseSchema } from './types/decision/index.js'
|
|
322
|
+
export { autoApproveHandler } from './types/hitl/index.js'
|
|
323
|
+
export { UNKNOWN_TENANT_ID } from './types/ids/index.js'
|
|
324
|
+
export { deriveChildState } from './types/invocation/index.js'
|
|
325
|
+
export { assertMemoryStatus } from './types/memory/index.js'
|
|
326
|
+
export {
|
|
327
|
+
createAssistantMessage,
|
|
328
|
+
createSystemMessage,
|
|
329
|
+
createToolMessage,
|
|
330
|
+
createUserMessage,
|
|
331
|
+
} from './types/message/index.js'
|
|
332
|
+
export { isTerminalPlanStatus } from './types/plan/index.js'
|
|
333
|
+
export {
|
|
334
|
+
assertPluginContributionType,
|
|
335
|
+
assertPluginHookEvent,
|
|
336
|
+
assertPluginHookResult,
|
|
337
|
+
assertPluginScope,
|
|
338
|
+
assertPluginStatus,
|
|
339
|
+
PluginManifestSchema,
|
|
340
|
+
PluginMCPServerConfigSchema,
|
|
341
|
+
} from './types/plugin/index.js'
|
|
342
|
+
export { EmergencySaveConfigSchema } from './types/run/emergency.js'
|
|
343
|
+
export { MutationNotApplicableError } from './types/run/replay.js'
|
|
344
|
+
export {
|
|
345
|
+
assertSandboxEnvironment,
|
|
346
|
+
assertSandboxStatus,
|
|
347
|
+
} from './types/sandbox/index.js'
|
|
348
|
+
// `SandboxConfigSchema` is already re-exported above from `./config/runtime.js`
|
|
349
|
+
// (the project-wide config barrel surfaces it first). types/sandbox also exports
|
|
350
|
+
// one under the same name; `@namzu/sdk` root barrel exposes one symbol — the
|
|
351
|
+
// config/runtime version is the canonical path. Keep it out of this block.
|
|
352
|
+
export { assertTaskStatus, isTerminalTaskStatus } from './types/task/index.js'
|
|
353
|
+
// NOTE: `VerificationRuleSchema` and `VerificationGateConfigSchema` are NOT
|
|
354
|
+
// re-exported — they were not part of the pre-ses_011 public surface.
|
|
355
|
+
|
|
356
|
+
// ─── compaction runtime ──────────────────────────────────────────────────
|
|
357
|
+
|
|
358
|
+
export {
|
|
359
|
+
buildVerifiedSummary,
|
|
360
|
+
createConversationManager,
|
|
361
|
+
extractFromAssistantMessage,
|
|
362
|
+
extractFromToolCall,
|
|
363
|
+
extractFromToolResult,
|
|
364
|
+
extractFromUserMessage,
|
|
365
|
+
findDanglingMessages,
|
|
366
|
+
findSafeTrimIndex,
|
|
367
|
+
NullManager,
|
|
368
|
+
removeDanglingMessages,
|
|
369
|
+
serializeState,
|
|
370
|
+
SlidingWindowManager,
|
|
371
|
+
StructuredCompactionManager,
|
|
372
|
+
WorkingStateManager,
|
|
373
|
+
} from './compaction/index.js'
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Public tools surface of `@namzu/sdk`.
|
|
2
|
+
//
|
|
3
|
+
// Consumer scenario: "I want to define a tool for my agent, use a built-in
|
|
4
|
+
// tool, or produce Tool objects from a connector / RAG store / task system."
|
|
5
|
+
//
|
|
6
|
+
// Every symbol here produces or defines a Tool in the agent-tool sense.
|
|
7
|
+
// Generic RAG runtime (vector stores, retrievers, embeddings, knowledge
|
|
8
|
+
// base) lives in `public-runtime.ts`; only `createRAGTool` belongs here.
|
|
9
|
+
//
|
|
10
|
+
// See §4.3 of `docs.local/sessions/ses_011-sdk-public-surface/design.md`.
|
|
11
|
+
|
|
12
|
+
// ─── Tool definition primitive ───────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
export { defineTool } from './tools/defineTool.js'
|
|
15
|
+
|
|
16
|
+
// ─── Built-in tools ──────────────────────────────────────────────────────
|
|
17
|
+
|
|
18
|
+
export { getBuiltinTools } from './tools/builtins/index.js'
|
|
19
|
+
export { ReadFileTool } from './tools/builtins/read-file.js'
|
|
20
|
+
export { WriteFileTool } from './tools/builtins/write-file.js'
|
|
21
|
+
export { EditTool } from './tools/builtins/edit.js'
|
|
22
|
+
export { BashTool } from './tools/builtins/bash.js'
|
|
23
|
+
export { GlobTool } from './tools/builtins/glob.js'
|
|
24
|
+
export { GrepTool } from './tools/builtins/grep.js'
|
|
25
|
+
export { LsTool } from './tools/builtins/ls.js'
|
|
26
|
+
export { SearchToolsTool } from './tools/builtins/search-tools.js'
|
|
27
|
+
export {
|
|
28
|
+
createStructuredOutputTool,
|
|
29
|
+
STRUCTURED_OUTPUT_TOOL_NAME,
|
|
30
|
+
} from './tools/builtins/structuredOutput.js'
|
|
31
|
+
export {
|
|
32
|
+
COMPUTER_USE_TOOL_NAME,
|
|
33
|
+
createComputerUseTool,
|
|
34
|
+
} from './tools/builtins/computer-use.js'
|
|
35
|
+
|
|
36
|
+
// ─── Domain tool builders ────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
buildTaskCreateTool,
|
|
40
|
+
buildTaskListTool,
|
|
41
|
+
buildTaskTools,
|
|
42
|
+
buildTaskUpdateTool,
|
|
43
|
+
} from './tools/task/index.js'
|
|
44
|
+
export { buildAdvisoryTools } from './tools/advisory/index.js'
|
|
45
|
+
export { buildMemoryTools } from './tools/memory/index.js'
|
|
46
|
+
export { buildCoordinatorTools } from './tools/coordinator/index.js'
|
|
47
|
+
|
|
48
|
+
// ─── RAG tool builder ────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
export { createRAGTool } from './rag/index.js'
|
|
51
|
+
|
|
52
|
+
// ─── Connector tool bridge ───────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
allConnectorTools,
|
|
56
|
+
connectorInstanceToTools,
|
|
57
|
+
connectorMethodToTool,
|
|
58
|
+
ConnectorToolRouter,
|
|
59
|
+
createConnectorExecuteTool,
|
|
60
|
+
createConnectorListTool,
|
|
61
|
+
createConnectorRouterTool,
|
|
62
|
+
createConnectorTools,
|
|
63
|
+
} from './bridge/tools/connector/index.js'
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// Public types surface of `@namzu/sdk`.
|
|
2
|
+
//
|
|
3
|
+
// Every pure shape a consumer might need for TypeScript type-checking:
|
|
4
|
+
// branded IDs, wire types, domain entities, discriminated unions, store
|
|
5
|
+
// contracts, event unions, config types.
|
|
6
|
+
//
|
|
7
|
+
// Rule: this file contains ONLY `export type` statements. Runtime values
|
|
8
|
+
// (classes, functions, constants, zod schemas, errors) live in
|
|
9
|
+
// `public-runtime.ts`. Tool builders live in `public-tools.ts`.
|
|
10
|
+
//
|
|
11
|
+
// See `docs.local/sessions/ses_011-sdk-public-surface/design.md` for the
|
|
12
|
+
// three-bucket taxonomy and migration rationale.
|
|
13
|
+
|
|
14
|
+
// ─── per-domain shape surfaces ────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
export type * from './types/ids/index.js'
|
|
17
|
+
export type * from './types/message/index.js'
|
|
18
|
+
export type * from './types/common/index.js'
|
|
19
|
+
export type * from './types/tool/index.js'
|
|
20
|
+
export type * from './types/permission/index.js'
|
|
21
|
+
export type * from './types/run/index.js'
|
|
22
|
+
export type * from './types/provider/index.js'
|
|
23
|
+
export type * from './types/agent/index.js'
|
|
24
|
+
export type * from './types/decision/index.js'
|
|
25
|
+
export type * from './types/persona/index.js'
|
|
26
|
+
export type * from './types/activity/index.js'
|
|
27
|
+
export type * from './types/task/index.js'
|
|
28
|
+
export type * from './types/plan/index.js'
|
|
29
|
+
export type * from './types/hitl/index.js'
|
|
30
|
+
export type * from './types/rag/index.js'
|
|
31
|
+
export type * from './types/execution/index.js'
|
|
32
|
+
export type * from './types/connector/index.js'
|
|
33
|
+
export type * from './types/skills/index.js'
|
|
34
|
+
export type * from './types/a2a/index.js'
|
|
35
|
+
export type * from './types/router/index.js'
|
|
36
|
+
export type * from './types/advisory/index.js'
|
|
37
|
+
export type * from './types/memory/index.js'
|
|
38
|
+
export type * from './types/plugin/index.js'
|
|
39
|
+
export type * from './types/sandbox/index.js'
|
|
40
|
+
export type * from './types/structured-output/index.js'
|
|
41
|
+
export type * from './types/invocation/index.js'
|
|
42
|
+
export type * from './types/computer-use/index.js'
|
|
43
|
+
export type * from './types/verification/index.js'
|
|
44
|
+
|
|
45
|
+
// Session-hierarchy type surface (ses_010 moved entities here).
|
|
46
|
+
export type * from './types/session/index.js'
|
|
47
|
+
|
|
48
|
+
// ─── wire surface (contracts/) ────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
export type {
|
|
51
|
+
AgentDefaults,
|
|
52
|
+
AgentInfo,
|
|
53
|
+
ApiError,
|
|
54
|
+
ApiErrorType,
|
|
55
|
+
ApiPermissionMode,
|
|
56
|
+
CreateMessageRequest,
|
|
57
|
+
CreateRunRequest,
|
|
58
|
+
CreateStatelessRunRequest,
|
|
59
|
+
ISOTimestamp,
|
|
60
|
+
PaginatedResponse,
|
|
61
|
+
PaginationParams,
|
|
62
|
+
RunConfig,
|
|
63
|
+
RunHierarchyNode,
|
|
64
|
+
RunStopReason,
|
|
65
|
+
RunUsage,
|
|
66
|
+
StreamEvent,
|
|
67
|
+
StreamEventType,
|
|
68
|
+
ToolCallInfo,
|
|
69
|
+
WireRun,
|
|
70
|
+
WireRunStatus,
|
|
71
|
+
} from './contracts/api.js'
|
|
72
|
+
|
|
73
|
+
// ─── runtime-config type shapes ───────────────────────────────────────────
|
|
74
|
+
|
|
75
|
+
export type {
|
|
76
|
+
CompactionConfig,
|
|
77
|
+
PluginRuntimeConfig,
|
|
78
|
+
RuntimeConfig,
|
|
79
|
+
} from './config/runtime.js'
|
|
80
|
+
|
|
81
|
+
// ─── named type re-exports from mixed runtime+type modules ────────────────
|
|
82
|
+
// These modules contain runtime exports too; those go in public-runtime.ts.
|
|
83
|
+
|
|
84
|
+
export type { AdvisoryCallContext, AdvisoryExecutionResult } from './advisory/index.js'
|
|
85
|
+
|
|
86
|
+
export type { ModelPricing } from './utils/cost.js'
|
|
87
|
+
export type { Logger } from './utils/logger.js'
|
|
88
|
+
export type { ShellCompressOptions, ShellCompressResult } from './utils/shell-compress.js'
|
|
89
|
+
|
|
90
|
+
export type { QueryParams } from './runtime/query/index.js'
|
|
91
|
+
export type { ContextCacheConfig, PromptCacheInput } from './runtime/query/context-cache.js'
|
|
92
|
+
|
|
93
|
+
export type { LimitCheckResult, LimitCheckerState, RunReporter } from './run/index.js'
|
|
94
|
+
|
|
95
|
+
export type { ConcurrencyMode, DefineAgentOptions, Disposable } from './agents/index.js'
|
|
96
|
+
|
|
97
|
+
export type {
|
|
98
|
+
ActivityEvent,
|
|
99
|
+
ActivityEventListener,
|
|
100
|
+
DiskMemoryStoreConfig,
|
|
101
|
+
DiskTaskStoreConfig,
|
|
102
|
+
Identifiable,
|
|
103
|
+
Timestamped,
|
|
104
|
+
} from './store/index.js'
|
|
105
|
+
|
|
106
|
+
export type { ManagedRegistryConfig, ToolExecutionResult } from './registry/index.js'
|
|
107
|
+
|
|
108
|
+
export type { PluginLifecycleManagerConfig } from './plugin/lifecycle.js'
|
|
109
|
+
|
|
110
|
+
export type { PlanApprovalHandler, PlanEvent, PlanEventListener } from './manager/index.js'
|
|
111
|
+
|
|
112
|
+
export type { DefineToolOptions } from './tools/defineTool.js'
|
|
113
|
+
|
|
114
|
+
export type { AdvisoryToolsOptions } from './tools/advisory/index.js'
|
|
115
|
+
|
|
116
|
+
export type { CoordinatorToolsOptions, TaskLaunchedCallback } from './tools/coordinator/index.js'
|
|
117
|
+
|
|
118
|
+
export type {
|
|
119
|
+
ConnectorManagerConfig,
|
|
120
|
+
EnvironmentConnectorManagerConfig,
|
|
121
|
+
EnvironmentConnectorSetup,
|
|
122
|
+
HybridExecutionContextOptions,
|
|
123
|
+
LocalExecutionContextOptions,
|
|
124
|
+
MCPServerResourceProvider,
|
|
125
|
+
MCPServerToolProvider,
|
|
126
|
+
RemoteExecutionContextOptions,
|
|
127
|
+
TenantConnectorManagerConfig,
|
|
128
|
+
} from './connector/index.js'
|
|
129
|
+
|
|
130
|
+
export type {
|
|
131
|
+
ConnectorRouterInput,
|
|
132
|
+
ConnectorToolConfig,
|
|
133
|
+
ConnectorToolRouterConfig,
|
|
134
|
+
ConnectorToolStrategy,
|
|
135
|
+
} from './bridge/tools/connector/index.js'
|
|
136
|
+
|
|
137
|
+
export type { CreateRunFromA2A } from './bridge/a2a/index.js'
|
|
138
|
+
|
|
139
|
+
export type { MappedStreamEvent } from './bridge/sse/index.js'
|
|
140
|
+
|
|
141
|
+
export type { AgentBusConfig } from './bus/index.js'
|
|
142
|
+
|
|
143
|
+
export type { ToolCallContext } from './verification/index.js'
|
|
144
|
+
|
|
145
|
+
export type { DiskSessionStoreConfig, LinkageView } from './store/session/index.js'
|
|
146
|
+
|
|
147
|
+
export type {
|
|
148
|
+
ConversationManager,
|
|
149
|
+
CompactionStrategy,
|
|
150
|
+
DanglingResult,
|
|
151
|
+
FileAction,
|
|
152
|
+
FileSlot,
|
|
153
|
+
PlanSlot,
|
|
154
|
+
ToolResultSlot,
|
|
155
|
+
WorkingState,
|
|
156
|
+
} from './compaction/index.js'
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current-code invariants asserted (2026-04-21, ses_006 Phase 4):
|
|
3
|
+
*
|
|
4
|
+
* - `TextChunker.chunk(content, config)` dispatches by
|
|
5
|
+
* `config.strategy`. Unknown strategy hits an exhaustive-check
|
|
6
|
+
* throw (unreachable via types).
|
|
7
|
+
* - `fixed` strategy: slides a window of `chunkSize` by
|
|
8
|
+
* `chunkSize − chunkOverlap` (min 1) and emits trimmed non-empty
|
|
9
|
+
* slices. Indices are 0-based and contiguous.
|
|
10
|
+
* - `sentence` / `paragraph` strategies split by their separator
|
|
11
|
+
* sets and then merge small parts until the budget fills.
|
|
12
|
+
* - `recursive` strategy: short content returns as a single chunk;
|
|
13
|
+
* otherwise it splits by the first separator that produces >1
|
|
14
|
+
* parts, merges, and recurses into parts that still exceed
|
|
15
|
+
* `chunkSize`. Falls back to `fixed` when no separator splits.
|
|
16
|
+
* - Overlap is applied in `mergeSmallParts` via
|
|
17
|
+
* `current.slice(current.length - chunkOverlap) + part`.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { describe, expect, it } from 'vitest'
|
|
21
|
+
|
|
22
|
+
import type { ChunkingConfig } from '../types/rag/index.js'
|
|
23
|
+
|
|
24
|
+
import { TextChunker } from './chunking.js'
|
|
25
|
+
|
|
26
|
+
const chunker = new TextChunker()
|
|
27
|
+
|
|
28
|
+
describe('TextChunker — fixed', () => {
|
|
29
|
+
const fixed: ChunkingConfig = { strategy: 'fixed', chunkSize: 10, chunkOverlap: 2 }
|
|
30
|
+
|
|
31
|
+
it('emits trimmed non-empty slices with contiguous indices', () => {
|
|
32
|
+
const result = chunker.chunk('0123456789abcdefghij', fixed)
|
|
33
|
+
expect(result).toHaveLength(3)
|
|
34
|
+
expect(result.map((c) => c.index)).toEqual([0, 1, 2])
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('skips whitespace-only slices', () => {
|
|
38
|
+
const result = chunker.chunk('abc def', {
|
|
39
|
+
strategy: 'fixed',
|
|
40
|
+
chunkSize: 5,
|
|
41
|
+
chunkOverlap: 0,
|
|
42
|
+
})
|
|
43
|
+
expect(result.map((c) => c.content)).not.toContain('')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('clamps step to at least 1 when overlap >= chunkSize', () => {
|
|
47
|
+
const result = chunker.chunk('abcdefghij', {
|
|
48
|
+
strategy: 'fixed',
|
|
49
|
+
chunkSize: 3,
|
|
50
|
+
chunkOverlap: 3,
|
|
51
|
+
})
|
|
52
|
+
// step = max(1, 3-3) = 1; eagerly emits many overlapping slices
|
|
53
|
+
expect(result.length).toBeGreaterThan(1)
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
describe('TextChunker — sentence', () => {
|
|
58
|
+
it('splits by sentence separators and merges up to the budget', () => {
|
|
59
|
+
const result = chunker.chunk('First sentence. Second sentence. Third sentence.', {
|
|
60
|
+
strategy: 'sentence',
|
|
61
|
+
chunkSize: 100,
|
|
62
|
+
chunkOverlap: 0,
|
|
63
|
+
})
|
|
64
|
+
expect(result.length).toBeGreaterThanOrEqual(1)
|
|
65
|
+
expect(result[0]?.content).toContain('First sentence')
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('TextChunker — paragraph', () => {
|
|
70
|
+
it('splits by paragraph separators', () => {
|
|
71
|
+
const result = chunker.chunk('para one\n\npara two\n\npara three', {
|
|
72
|
+
strategy: 'paragraph',
|
|
73
|
+
chunkSize: 200,
|
|
74
|
+
chunkOverlap: 0,
|
|
75
|
+
})
|
|
76
|
+
expect(result.length).toBeGreaterThanOrEqual(1)
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
describe('TextChunker — recursive', () => {
|
|
81
|
+
it('short content fits into a single chunk', () => {
|
|
82
|
+
const result = chunker.chunk('tiny', {
|
|
83
|
+
strategy: 'recursive',
|
|
84
|
+
chunkSize: 100,
|
|
85
|
+
chunkOverlap: 0,
|
|
86
|
+
})
|
|
87
|
+
expect(result).toEqual([{ content: 'tiny', index: 0 }])
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
it('long content recursively splits to stay within chunkSize', () => {
|
|
91
|
+
const content = 'paragraph one. more text.\n\nparagraph two. more.'
|
|
92
|
+
const result = chunker.chunk(content, {
|
|
93
|
+
strategy: 'recursive',
|
|
94
|
+
chunkSize: 30,
|
|
95
|
+
chunkOverlap: 0,
|
|
96
|
+
})
|
|
97
|
+
for (const c of result) {
|
|
98
|
+
expect(c.content.length).toBeLessThanOrEqual(30)
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
it('empty or whitespace-only content yields empty result', () => {
|
|
103
|
+
expect(chunker.chunk(' ', { strategy: 'recursive', chunkSize: 10, chunkOverlap: 0 })).toEqual(
|
|
104
|
+
[],
|
|
105
|
+
)
|
|
106
|
+
})
|
|
107
|
+
})
|