@namzu/sdk 0.1.8 → 0.3.0
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 +69 -2
- package/dist/agents/ReactiveAgent.d.ts.map +1 -1
- package/dist/agents/ReactiveAgent.js +5 -2
- package/dist/agents/ReactiveAgent.js.map +1 -1
- package/dist/agents/RouterAgent.d.ts.map +1 -1
- package/dist/agents/RouterAgent.js +3 -0
- package/dist/agents/RouterAgent.js.map +1 -1
- package/dist/agents/SupervisorAgent.d.ts.map +1 -1
- package/dist/agents/SupervisorAgent.js +21 -5
- package/dist/agents/SupervisorAgent.js.map +1 -1
- package/dist/bridge/a2a/index.d.ts +1 -1
- package/dist/bridge/a2a/index.d.ts.map +1 -1
- package/dist/bridge/a2a/index.js +1 -1
- package/dist/bridge/a2a/index.js.map +1 -1
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +6 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/a2a/message.d.ts +0 -2
- package/dist/bridge/a2a/message.d.ts.map +1 -1
- package/dist/bridge/a2a/message.js +0 -26
- package/dist/bridge/a2a/message.js.map +1 -1
- package/dist/bridge/a2a/task.d.ts +5 -4
- package/dist/bridge/a2a/task.d.ts.map +1 -1
- package/dist/bridge/a2a/task.js +4 -4
- package/dist/bridge/a2a/task.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +6 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/constants/a2a/index.d.ts +2 -2
- package/dist/constants/a2a/index.d.ts.map +1 -1
- package/dist/constants/a2a/index.js.map +1 -1
- package/dist/contracts/api.d.ts +14 -27
- package/dist/contracts/api.d.ts.map +1 -1
- package/dist/contracts/ids.d.ts +1 -1
- package/dist/contracts/ids.d.ts.map +1 -1
- package/dist/contracts/index.d.ts +3 -3
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -1
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/schemas.d.ts +1 -31
- package/dist/contracts/schemas.d.ts.map +1 -1
- package/dist/contracts/schemas.js +1 -7
- package/dist/contracts/schemas.js.map +1 -1
- package/dist/gateway/local.d.ts.map +1 -1
- package/dist/gateway/local.js +6 -0
- package/dist/gateway/local.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/manager/agent/__tests__/lifecycle.test.d.ts +2 -0
- package/dist/manager/agent/__tests__/lifecycle.test.d.ts.map +1 -0
- package/dist/manager/agent/__tests__/lifecycle.test.js +316 -0
- package/dist/manager/agent/__tests__/lifecycle.test.js.map +1 -0
- package/dist/manager/agent/lifecycle.d.ts +67 -3
- package/dist/manager/agent/lifecycle.d.ts.map +1 -1
- package/dist/manager/agent/lifecycle.js +375 -14
- package/dist/manager/agent/lifecycle.js.map +1 -1
- package/dist/manager/index.d.ts +2 -0
- package/dist/manager/index.d.ts.map +1 -1
- package/dist/manager/index.js +1 -0
- package/dist/manager/index.js.map +1 -1
- package/dist/manager/run/persistence.d.ts +10 -1
- package/dist/manager/run/persistence.d.ts.map +1 -1
- package/dist/manager/run/persistence.js +20 -0
- package/dist/manager/run/persistence.js.map +1 -1
- package/dist/manager/thread/__tests__/lifecycle.test.d.ts +2 -0
- package/dist/manager/thread/__tests__/lifecycle.test.d.ts.map +1 -0
- package/dist/manager/thread/__tests__/lifecycle.test.js +216 -0
- package/dist/manager/thread/__tests__/lifecycle.test.js.map +1 -0
- package/dist/manager/thread/lifecycle.d.ts +105 -0
- package/dist/manager/thread/lifecycle.d.ts.map +1 -0
- package/dist/manager/thread/lifecycle.js +186 -0
- package/dist/manager/thread/lifecycle.js.map +1 -0
- package/dist/rag/retriever.js +2 -2
- package/dist/run/reporter.d.ts.map +1 -1
- package/dist/run/reporter.js +25 -0
- package/dist/run/reporter.js.map +1 -1
- package/dist/runtime/query/__tests__/context.test.d.ts +2 -0
- package/dist/runtime/query/__tests__/context.test.d.ts.map +1 -0
- package/dist/runtime/query/__tests__/context.test.js +85 -0
- package/dist/runtime/query/__tests__/context.test.js.map +1 -0
- package/dist/runtime/query/context-cache.d.ts +3 -3
- package/dist/runtime/query/context-cache.d.ts.map +1 -1
- package/dist/runtime/query/context-cache.js +2 -2
- package/dist/runtime/query/context-cache.js.map +1 -1
- package/dist/runtime/query/context.d.ts +45 -1
- package/dist/runtime/query/context.d.ts.map +1 -1
- package/dist/runtime/query/context.js +50 -8
- package/dist/runtime/query/context.js.map +1 -1
- package/dist/runtime/query/events.d.ts.map +1 -1
- package/dist/runtime/query/events.js +8 -0
- package/dist/runtime/query/events.js.map +1 -1
- package/dist/runtime/query/index.d.ts +22 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +11 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/session/__tests__/integration/_fixtures.d.ts +122 -0
- package/dist/session/__tests__/integration/_fixtures.d.ts.map +1 -0
- package/dist/session/__tests__/integration/_fixtures.js +215 -0
- package/dist/session/__tests__/integration/_fixtures.js.map +1 -0
- package/dist/session/__tests__/integration/archive-gate.test.d.ts +15 -0
- package/dist/session/__tests__/integration/archive-gate.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/archive-gate.test.js +214 -0
- package/dist/session/__tests__/integration/archive-gate.test.js.map +1 -0
- package/dist/session/__tests__/integration/capacity-caps.test.d.ts +13 -0
- package/dist/session/__tests__/integration/capacity-caps.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/capacity-caps.test.js +123 -0
- package/dist/session/__tests__/integration/capacity-caps.test.js.map +1 -0
- package/dist/session/__tests__/integration/e2e-spawn.test.d.ts +18 -0
- package/dist/session/__tests__/integration/e2e-spawn.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/e2e-spawn.test.js +238 -0
- package/dist/session/__tests__/integration/e2e-spawn.test.js.map +1 -0
- package/dist/session/__tests__/integration/event-stream-ordering.test.d.ts +15 -0
- package/dist/session/__tests__/integration/event-stream-ordering.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/event-stream-ordering.test.js +330 -0
- package/dist/session/__tests__/integration/event-stream-ordering.test.js.map +1 -0
- package/dist/session/__tests__/integration/handoff-broadcast-e2e.test.d.ts +12 -0
- package/dist/session/__tests__/integration/handoff-broadcast-e2e.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/handoff-broadcast-e2e.test.js +182 -0
- package/dist/session/__tests__/integration/handoff-broadcast-e2e.test.js.map +1 -0
- package/dist/session/__tests__/integration/handoff-illegal-transition.test.d.ts +18 -0
- package/dist/session/__tests__/integration/handoff-illegal-transition.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/handoff-illegal-transition.test.js +156 -0
- package/dist/session/__tests__/integration/handoff-illegal-transition.test.js.map +1 -0
- package/dist/session/__tests__/integration/handoff-single-e2e.test.d.ts +15 -0
- package/dist/session/__tests__/integration/handoff-single-e2e.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/handoff-single-e2e.test.js +179 -0
- package/dist/session/__tests__/integration/handoff-single-e2e.test.js.map +1 -0
- package/dist/session/__tests__/integration/hierarchy-lifecycle.test.d.ts +12 -0
- package/dist/session/__tests__/integration/hierarchy-lifecycle.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/hierarchy-lifecycle.test.js +158 -0
- package/dist/session/__tests__/integration/hierarchy-lifecycle.test.js.map +1 -0
- package/dist/session/__tests__/integration/migration-filesystem.test.d.ts +11 -0
- package/dist/session/__tests__/integration/migration-filesystem.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/migration-filesystem.test.js +140 -0
- package/dist/session/__tests__/integration/migration-filesystem.test.js.map +1 -0
- package/dist/session/__tests__/integration/migration-id-prefix.test.d.ts +13 -0
- package/dist/session/__tests__/integration/migration-id-prefix.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/migration-id-prefix.test.js +84 -0
- package/dist/session/__tests__/integration/migration-id-prefix.test.js.map +1 -0
- package/dist/session/__tests__/integration/prev-artifact-dag.test.d.ts +14 -0
- package/dist/session/__tests__/integration/prev-artifact-dag.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/prev-artifact-dag.test.js +242 -0
- package/dist/session/__tests__/integration/prev-artifact-dag.test.js.map +1 -0
- package/dist/session/__tests__/integration/retention-archive.test.d.ts +12 -0
- package/dist/session/__tests__/integration/retention-archive.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/retention-archive.test.js +187 -0
- package/dist/session/__tests__/integration/retention-archive.test.js.map +1 -0
- package/dist/session/__tests__/integration/spawn-rollback.test.d.ts +26 -0
- package/dist/session/__tests__/integration/spawn-rollback.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/spawn-rollback.test.js +236 -0
- package/dist/session/__tests__/integration/spawn-rollback.test.js.map +1 -0
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.d.ts +18 -0
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.js +201 -0
- package/dist/session/__tests__/integration/summary-materialization-e2e.test.js.map +1 -0
- package/dist/session/__tests__/integration/tenant-isolation.test.d.ts +14 -0
- package/dist/session/__tests__/integration/tenant-isolation.test.d.ts.map +1 -0
- package/dist/session/__tests__/integration/tenant-isolation.test.js +189 -0
- package/dist/session/__tests__/integration/tenant-isolation.test.js.map +1 -0
- package/dist/session/errors.d.ts +139 -0
- package/dist/session/errors.d.ts.map +1 -0
- package/dist/session/errors.js +107 -0
- package/dist/session/errors.js.map +1 -0
- package/dist/session/events/index.d.ts +4 -0
- package/dist/session/events/index.d.ts.map +1 -0
- package/dist/session/events/index.js +8 -0
- package/dist/session/events/index.js.map +1 -0
- package/dist/session/events/schema-version.d.ts +13 -0
- package/dist/session/events/schema-version.d.ts.map +1 -0
- package/dist/session/events/schema-version.js +12 -0
- package/dist/session/events/schema-version.js.map +1 -0
- package/dist/session/events/types.d.ts +64 -0
- package/dist/session/events/types.d.ts.map +1 -0
- package/dist/session/events/types.js +2 -0
- package/dist/session/events/types.js.map +1 -0
- package/dist/session/handoff/__tests__/broadcast.test.d.ts +2 -0
- package/dist/session/handoff/__tests__/broadcast.test.d.ts.map +1 -0
- package/dist/session/handoff/__tests__/broadcast.test.js +261 -0
- package/dist/session/handoff/__tests__/broadcast.test.js.map +1 -0
- package/dist/session/handoff/__tests__/capacity.test.d.ts +2 -0
- package/dist/session/handoff/__tests__/capacity.test.d.ts.map +1 -0
- package/dist/session/handoff/__tests__/capacity.test.js +103 -0
- package/dist/session/handoff/__tests__/capacity.test.js.map +1 -0
- package/dist/session/handoff/__tests__/single.test.d.ts +2 -0
- package/dist/session/handoff/__tests__/single.test.d.ts.map +1 -0
- package/dist/session/handoff/__tests__/single.test.js +239 -0
- package/dist/session/handoff/__tests__/single.test.js.map +1 -0
- package/dist/session/handoff/assignment.d.ts +71 -0
- package/dist/session/handoff/assignment.d.ts.map +1 -0
- package/dist/session/handoff/assignment.js +11 -0
- package/dist/session/handoff/assignment.js.map +1 -0
- package/dist/session/handoff/broadcast.d.ts +54 -0
- package/dist/session/handoff/broadcast.d.ts.map +1 -0
- package/dist/session/handoff/broadcast.js +311 -0
- package/dist/session/handoff/broadcast.js.map +1 -0
- package/dist/session/handoff/capacity.d.ts +66 -0
- package/dist/session/handoff/capacity.d.ts.map +1 -0
- package/dist/session/handoff/capacity.js +60 -0
- package/dist/session/handoff/capacity.js.map +1 -0
- package/dist/session/handoff/events.d.ts +66 -0
- package/dist/session/handoff/events.d.ts.map +1 -0
- package/dist/session/handoff/events.js +13 -0
- package/dist/session/handoff/events.js.map +1 -0
- package/dist/session/handoff/index.d.ts +12 -0
- package/dist/session/handoff/index.d.ts.map +1 -0
- package/dist/session/handoff/index.js +9 -0
- package/dist/session/handoff/index.js.map +1 -0
- package/dist/session/handoff/single.d.ts +69 -0
- package/dist/session/handoff/single.d.ts.map +1 -0
- package/dist/session/handoff/single.js +229 -0
- package/dist/session/handoff/single.js.map +1 -0
- package/dist/session/handoff/version.d.ts +52 -0
- package/dist/session/handoff/version.d.ts.map +1 -0
- package/dist/session/handoff/version.js +36 -0
- package/dist/session/handoff/version.js.map +1 -0
- package/dist/session/hierarchy/__tests__/session.test.d.ts +2 -0
- package/dist/session/hierarchy/__tests__/session.test.d.ts.map +1 -0
- package/dist/session/hierarchy/__tests__/session.test.js +69 -0
- package/dist/session/hierarchy/__tests__/session.test.js.map +1 -0
- package/dist/session/hierarchy/actor.d.ts +26 -0
- package/dist/session/hierarchy/actor.d.ts.map +1 -0
- package/dist/session/hierarchy/actor.js +2 -0
- package/dist/session/hierarchy/actor.js.map +1 -0
- package/dist/session/hierarchy/index.d.ts +9 -0
- package/dist/session/hierarchy/index.d.ts.map +1 -0
- package/dist/session/hierarchy/index.js +4 -0
- package/dist/session/hierarchy/index.js.map +1 -0
- package/dist/session/hierarchy/lineage.d.ts +15 -0
- package/dist/session/hierarchy/lineage.d.ts.map +1 -0
- package/dist/session/hierarchy/lineage.js +2 -0
- package/dist/session/hierarchy/lineage.js.map +1 -0
- package/dist/session/hierarchy/project.d.ts +40 -0
- package/dist/session/hierarchy/project.d.ts.map +1 -0
- package/dist/session/hierarchy/project.js +2 -0
- package/dist/session/hierarchy/project.js.map +1 -0
- package/dist/session/hierarchy/session.d.ts +71 -0
- package/dist/session/hierarchy/session.d.ts.map +1 -0
- package/dist/session/hierarchy/session.js +51 -0
- package/dist/session/hierarchy/session.js.map +1 -0
- package/dist/session/hierarchy/sub-session.d.ts +76 -0
- package/dist/session/hierarchy/sub-session.d.ts.map +1 -0
- package/dist/session/hierarchy/sub-session.js +2 -0
- package/dist/session/hierarchy/sub-session.js.map +1 -0
- package/dist/session/hierarchy/tenant.d.ts +13 -0
- package/dist/session/hierarchy/tenant.d.ts.map +1 -0
- package/dist/session/hierarchy/tenant.js +2 -0
- package/dist/session/hierarchy/tenant.js.map +1 -0
- package/dist/session/hierarchy/thread.d.ts +54 -0
- package/dist/session/hierarchy/thread.d.ts.map +1 -0
- package/dist/session/hierarchy/thread.js +2 -0
- package/dist/session/hierarchy/thread.js.map +1 -0
- package/dist/session/index.d.ts +10 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +15 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/intervention/__tests__/prev-artifact.test.d.ts +2 -0
- package/dist/session/intervention/__tests__/prev-artifact.test.d.ts.map +1 -0
- package/dist/session/intervention/__tests__/prev-artifact.test.js +179 -0
- package/dist/session/intervention/__tests__/prev-artifact.test.js.map +1 -0
- package/dist/session/intervention/index.d.ts +3 -0
- package/dist/session/intervention/index.d.ts.map +1 -0
- package/dist/session/intervention/index.js +8 -0
- package/dist/session/intervention/index.js.map +1 -0
- package/dist/session/intervention/prev-artifact.d.ts +103 -0
- package/dist/session/intervention/prev-artifact.d.ts.map +1 -0
- package/dist/session/intervention/prev-artifact.js +112 -0
- package/dist/session/intervention/prev-artifact.js.map +1 -0
- package/dist/session/migration/__tests__/filesystem.test.d.ts +2 -0
- package/dist/session/migration/__tests__/filesystem.test.d.ts.map +1 -0
- package/dist/session/migration/__tests__/filesystem.test.js +188 -0
- package/dist/session/migration/__tests__/filesystem.test.js.map +1 -0
- package/dist/session/migration/__tests__/id-prefix.test.d.ts +2 -0
- package/dist/session/migration/__tests__/id-prefix.test.d.ts.map +1 -0
- package/dist/session/migration/__tests__/id-prefix.test.js +83 -0
- package/dist/session/migration/__tests__/id-prefix.test.js.map +1 -0
- package/dist/session/migration/__tests__/marker.test.d.ts +2 -0
- package/dist/session/migration/__tests__/marker.test.d.ts.map +1 -0
- package/dist/session/migration/__tests__/marker.test.js +75 -0
- package/dist/session/migration/__tests__/marker.test.js.map +1 -0
- package/dist/session/migration/errors.d.ts +26 -0
- package/dist/session/migration/errors.d.ts.map +1 -0
- package/dist/session/migration/errors.js +22 -0
- package/dist/session/migration/errors.js.map +1 -0
- package/dist/session/migration/filesystem.d.ts +94 -0
- package/dist/session/migration/filesystem.d.ts.map +1 -0
- package/dist/session/migration/filesystem.js +319 -0
- package/dist/session/migration/filesystem.js.map +1 -0
- package/dist/session/migration/id-prefix.d.ts +93 -0
- package/dist/session/migration/id-prefix.d.ts.map +1 -0
- package/dist/session/migration/id-prefix.js +111 -0
- package/dist/session/migration/id-prefix.js.map +1 -0
- package/dist/session/migration/index.d.ts +8 -0
- package/dist/session/migration/index.d.ts.map +1 -0
- package/dist/session/migration/index.js +8 -0
- package/dist/session/migration/index.js.map +1 -0
- package/dist/session/migration/marker.d.ts +57 -0
- package/dist/session/migration/marker.d.ts.map +1 -0
- package/dist/session/migration/marker.js +111 -0
- package/dist/session/migration/marker.js.map +1 -0
- package/dist/session/retention/__tests__/archive.test.d.ts +2 -0
- package/dist/session/retention/__tests__/archive.test.d.ts.map +1 -0
- package/dist/session/retention/__tests__/archive.test.js +253 -0
- package/dist/session/retention/__tests__/archive.test.js.map +1 -0
- package/dist/session/retention/__tests__/disk-backend.test.d.ts +2 -0
- package/dist/session/retention/__tests__/disk-backend.test.d.ts.map +1 -0
- package/dist/session/retention/__tests__/disk-backend.test.js +154 -0
- package/dist/session/retention/__tests__/disk-backend.test.js.map +1 -0
- package/dist/session/retention/archive-backend-ref.d.ts +18 -0
- package/dist/session/retention/archive-backend-ref.d.ts.map +1 -0
- package/dist/session/retention/archive-backend-ref.js +2 -0
- package/dist/session/retention/archive-backend-ref.js.map +1 -0
- package/dist/session/retention/archive.d.ts +130 -0
- package/dist/session/retention/archive.d.ts.map +1 -0
- package/dist/session/retention/archive.js +203 -0
- package/dist/session/retention/archive.js.map +1 -0
- package/dist/session/retention/backend.d.ts +101 -0
- package/dist/session/retention/backend.d.ts.map +1 -0
- package/dist/session/retention/backend.js +15 -0
- package/dist/session/retention/backend.js.map +1 -0
- package/dist/session/retention/disk-backend.d.ts +59 -0
- package/dist/session/retention/disk-backend.d.ts.map +1 -0
- package/dist/session/retention/disk-backend.js +236 -0
- package/dist/session/retention/disk-backend.js.map +1 -0
- package/dist/session/retention/index.d.ts +9 -0
- package/dist/session/retention/index.d.ts.map +1 -0
- package/dist/session/retention/index.js +6 -0
- package/dist/session/retention/index.js.map +1 -0
- package/dist/session/retention/policy.d.ts +49 -0
- package/dist/session/retention/policy.d.ts.map +1 -0
- package/dist/session/retention/policy.js +21 -0
- package/dist/session/retention/policy.js.map +1 -0
- package/dist/session/summary/__tests__/materialize.test.d.ts +2 -0
- package/dist/session/summary/__tests__/materialize.test.d.ts.map +1 -0
- package/dist/session/summary/__tests__/materialize.test.js +270 -0
- package/dist/session/summary/__tests__/materialize.test.js.map +1 -0
- package/dist/session/summary/deliverable.d.ts +74 -0
- package/dist/session/summary/deliverable.d.ts.map +1 -0
- package/dist/session/summary/deliverable.js +20 -0
- package/dist/session/summary/deliverable.js.map +1 -0
- package/dist/session/summary/index.d.ts +6 -0
- package/dist/session/summary/index.d.ts.map +1 -0
- package/dist/session/summary/index.js +9 -0
- package/dist/session/summary/index.js.map +1 -0
- package/dist/session/summary/materialize.d.ts +82 -0
- package/dist/session/summary/materialize.d.ts.map +1 -0
- package/dist/session/summary/materialize.js +117 -0
- package/dist/session/summary/materialize.js.map +1 -0
- package/dist/session/summary/ref.d.ts +91 -0
- package/dist/session/summary/ref.d.ts.map +1 -0
- package/dist/session/summary/ref.js +51 -0
- package/dist/session/summary/ref.js.map +1 -0
- package/dist/session/workspace/__tests__/git-worktree.test.d.ts +2 -0
- package/dist/session/workspace/__tests__/git-worktree.test.d.ts.map +1 -0
- package/dist/session/workspace/__tests__/git-worktree.test.js +244 -0
- package/dist/session/workspace/__tests__/git-worktree.test.js.map +1 -0
- package/dist/session/workspace/__tests__/path-builder.test.d.ts +2 -0
- package/dist/session/workspace/__tests__/path-builder.test.d.ts.map +1 -0
- package/dist/session/workspace/__tests__/path-builder.test.js +37 -0
- package/dist/session/workspace/__tests__/path-builder.test.js.map +1 -0
- package/dist/session/workspace/driver.d.ts +55 -0
- package/dist/session/workspace/driver.d.ts.map +1 -0
- package/dist/session/workspace/driver.js +12 -0
- package/dist/session/workspace/driver.js.map +1 -0
- package/dist/session/workspace/git-worktree.d.ts +65 -0
- package/dist/session/workspace/git-worktree.d.ts.map +1 -0
- package/dist/session/workspace/git-worktree.js +156 -0
- package/dist/session/workspace/git-worktree.js.map +1 -0
- package/dist/session/workspace/index.d.ts +8 -0
- package/dist/session/workspace/index.d.ts.map +1 -0
- package/dist/session/workspace/index.js +7 -0
- package/dist/session/workspace/index.js.map +1 -0
- package/dist/session/workspace/path-builder.d.ts +50 -0
- package/dist/session/workspace/path-builder.d.ts.map +1 -0
- package/dist/session/workspace/path-builder.js +50 -0
- package/dist/session/workspace/path-builder.js.map +1 -0
- package/dist/session/workspace/ref.d.ts +46 -0
- package/dist/session/workspace/ref.d.ts.map +1 -0
- package/dist/session/workspace/ref.js +11 -0
- package/dist/session/workspace/ref.js.map +1 -0
- package/dist/session/workspace/registry.d.ts +26 -0
- package/dist/session/workspace/registry.d.ts.map +1 -0
- package/dist/session/workspace/registry.js +35 -0
- package/dist/session/workspace/registry.js.map +1 -0
- package/dist/store/index.d.ts +0 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +0 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/session/__tests__/disk.test.d.ts +2 -0
- package/dist/store/session/__tests__/disk.test.d.ts.map +1 -0
- package/dist/store/session/__tests__/disk.test.js +267 -0
- package/dist/store/session/__tests__/disk.test.js.map +1 -0
- package/dist/store/session/__tests__/memory.test.d.ts +2 -0
- package/dist/store/session/__tests__/memory.test.d.ts.map +1 -0
- package/dist/store/session/__tests__/memory.test.js +258 -0
- package/dist/store/session/__tests__/memory.test.js.map +1 -0
- package/dist/store/session/disk.d.ts +86 -0
- package/dist/store/session/disk.d.ts.map +1 -0
- package/dist/store/session/disk.js +818 -0
- package/dist/store/session/disk.js.map +1 -0
- package/dist/store/session/index.d.ts +7 -0
- package/dist/store/session/index.d.ts.map +1 -0
- package/dist/store/session/index.js +10 -0
- package/dist/store/session/index.js.map +1 -0
- package/dist/store/session/linkage.d.ts +38 -0
- package/dist/store/session/linkage.d.ts.map +1 -0
- package/dist/store/session/linkage.js +64 -0
- package/dist/store/session/linkage.js.map +1 -0
- package/dist/store/session/memory.d.ts +49 -0
- package/dist/store/session/memory.d.ts.map +1 -0
- package/dist/store/session/memory.js +335 -0
- package/dist/store/session/memory.js.map +1 -0
- package/dist/store/session/messages.d.ts +20 -0
- package/dist/store/session/messages.d.ts.map +1 -0
- package/dist/store/session/messages.js +12 -0
- package/dist/store/session/messages.js.map +1 -0
- package/dist/store/thread/disk.d.ts +41 -0
- package/dist/store/thread/disk.d.ts.map +1 -0
- package/dist/store/thread/disk.js +229 -0
- package/dist/store/thread/disk.js.map +1 -0
- package/dist/store/thread/index.d.ts +4 -0
- package/dist/store/thread/index.d.ts.map +1 -0
- package/dist/store/thread/index.js +6 -0
- package/dist/store/thread/index.js.map +1 -0
- package/dist/store/thread/memory.d.ts +23 -0
- package/dist/store/thread/memory.d.ts.map +1 -0
- package/dist/store/thread/memory.js +90 -0
- package/dist/store/thread/memory.js.map +1 -0
- package/dist/tools/builtins/__tests__/structuredOutput.example.d.ts +1 -1
- package/dist/types/agent/base.d.ts +24 -1
- package/dist/types/agent/base.d.ts.map +1 -1
- package/dist/types/agent/factory.d.ts +8 -2
- package/dist/types/agent/factory.d.ts.map +1 -1
- package/dist/types/agent/task.d.ts +57 -2
- package/dist/types/agent/task.d.ts.map +1 -1
- package/dist/types/agent/task.js.map +1 -1
- package/dist/types/ids/index.d.ts +22 -3
- package/dist/types/ids/index.d.ts.map +1 -1
- package/dist/types/ids/index.js +8 -1
- package/dist/types/ids/index.js.map +1 -1
- package/dist/types/invocation/__tests__/state.test.js +36 -29
- package/dist/types/invocation/__tests__/state.test.js.map +1 -1
- package/dist/types/invocation/index.d.ts +20 -4
- package/dist/types/invocation/index.d.ts.map +1 -1
- package/dist/types/invocation/index.js +10 -7
- package/dist/types/invocation/index.js.map +1 -1
- package/dist/types/rag/retrieval.d.ts +4 -3
- package/dist/types/rag/retrieval.d.ts.map +1 -1
- package/dist/types/run/config.d.ts +12 -1
- package/dist/types/run/config.d.ts.map +1 -1
- package/dist/types/run/events.d.ts +26 -1
- package/dist/types/run/events.d.ts.map +1 -1
- package/dist/types/run/index.d.ts.map +1 -1
- package/dist/types/run/index.js +8 -0
- package/dist/types/run/index.js.map +1 -1
- package/dist/types/run/metadata.d.ts +12 -2
- package/dist/types/run/metadata.d.ts.map +1 -1
- package/dist/types/run/status.d.ts +26 -0
- package/dist/types/run/status.d.ts.map +1 -0
- package/dist/types/run/status.js +2 -0
- package/dist/types/run/status.js.map +1 -0
- package/dist/types/session/ids.d.ts +9 -0
- package/dist/types/session/ids.d.ts.map +1 -0
- package/dist/types/session/ids.js +9 -0
- package/dist/types/session/ids.js.map +1 -0
- package/dist/types/session/index.d.ts +3 -0
- package/dist/types/session/index.d.ts.map +1 -0
- package/dist/types/session/index.js +5 -0
- package/dist/types/session/index.js.map +1 -0
- package/dist/types/session/store.d.ts +210 -0
- package/dist/types/session/store.d.ts.map +1 -0
- package/dist/types/session/store.js +9 -0
- package/dist/types/session/store.js.map +1 -0
- package/dist/types/thread/index.d.ts +2 -0
- package/dist/types/thread/index.d.ts.map +1 -0
- package/dist/types/thread/index.js +5 -0
- package/dist/types/thread/index.js.map +1 -0
- package/dist/types/thread/store.d.ts +86 -0
- package/dist/types/thread/store.d.ts.map +1 -0
- package/dist/types/thread/store.js +22 -0
- package/dist/types/thread/store.js.map +1 -0
- package/dist/utils/id.d.ts +8 -2
- package/dist/utils/id.d.ts.map +1 -1
- package/dist/utils/id.js +22 -4
- package/dist/utils/id.js.map +1 -1
- package/package.json +6 -11
- package/src/agents/ReactiveAgent.ts +7 -2
- package/src/agents/RouterAgent.ts +5 -0
- package/src/agents/SupervisorAgent.ts +29 -6
- package/src/bridge/a2a/index.ts +0 -1
- package/src/bridge/a2a/mapper.ts +7 -0
- package/src/bridge/a2a/message.ts +0 -32
- package/src/bridge/a2a/task.ts +9 -8
- package/src/bridge/sse/mapper.ts +8 -1
- package/src/constants/a2a/index.ts +2 -2
- package/src/contracts/api.ts +14 -30
- package/src/contracts/ids.ts +1 -1
- package/src/contracts/index.ts +3 -7
- package/src/contracts/schemas.ts +1 -8
- package/src/gateway/local.ts +6 -0
- package/src/index.ts +14 -4
- package/src/manager/agent/__tests__/lifecycle.test.ts +473 -0
- package/src/manager/agent/lifecycle.ts +515 -21
- package/src/manager/index.ts +3 -0
- package/src/manager/run/persistence.ts +26 -1
- package/src/manager/thread/__tests__/lifecycle.test.ts +286 -0
- package/src/manager/thread/lifecycle.ts +217 -0
- package/src/rag/retriever.ts +2 -2
- package/src/run/reporter.ts +28 -0
- package/src/runtime/query/__tests__/context.test.ts +102 -0
- package/src/runtime/query/context-cache.ts +4 -4
- package/src/runtime/query/context.ts +98 -9
- package/src/runtime/query/events.ts +8 -0
- package/src/runtime/query/index.ts +38 -1
- package/src/session/__tests__/integration/_fixtures.ts +310 -0
- package/src/session/__tests__/integration/archive-gate.test.ts +288 -0
- package/src/session/__tests__/integration/capacity-caps.test.ts +171 -0
- package/src/session/__tests__/integration/e2e-spawn.test.ts +296 -0
- package/src/session/__tests__/integration/event-stream-ordering.test.ts +410 -0
- package/src/session/__tests__/integration/handoff-broadcast-e2e.test.ts +271 -0
- package/src/session/__tests__/integration/handoff-illegal-transition.test.ts +214 -0
- package/src/session/__tests__/integration/handoff-single-e2e.test.ts +251 -0
- package/src/session/__tests__/integration/hierarchy-lifecycle.test.ts +240 -0
- package/src/session/__tests__/integration/migration-filesystem.test.ts +209 -0
- package/src/session/__tests__/integration/migration-id-prefix.test.ts +101 -0
- package/src/session/__tests__/integration/prev-artifact-dag.test.ts +325 -0
- package/src/session/__tests__/integration/retention-archive.test.ts +233 -0
- package/src/session/__tests__/integration/spawn-rollback.test.ts +313 -0
- package/src/session/__tests__/integration/summary-materialization-e2e.test.ts +239 -0
- package/src/session/__tests__/integration/tenant-isolation.test.ts +292 -0
- package/src/session/errors.ts +159 -0
- package/src/session/events/index.ts +16 -0
- package/src/session/events/schema-version.ts +13 -0
- package/src/session/events/types.ts +71 -0
- package/src/session/handoff/__tests__/broadcast.test.ts +378 -0
- package/src/session/handoff/__tests__/capacity.test.ts +129 -0
- package/src/session/handoff/__tests__/single.test.ts +333 -0
- package/src/session/handoff/assignment.ts +74 -0
- package/src/session/handoff/broadcast.ts +406 -0
- package/src/session/handoff/capacity.ts +121 -0
- package/src/session/handoff/events.ts +72 -0
- package/src/session/handoff/index.ts +29 -0
- package/src/session/handoff/single.ts +310 -0
- package/src/session/handoff/version.ts +59 -0
- package/src/session/hierarchy/__tests__/session.test.ts +100 -0
- package/src/session/hierarchy/actor.ts +17 -0
- package/src/session/hierarchy/index.ts +18 -0
- package/src/session/hierarchy/lineage.ts +15 -0
- package/src/session/hierarchy/project.ts +41 -0
- package/src/session/hierarchy/session.ts +109 -0
- package/src/session/hierarchy/sub-session.ts +92 -0
- package/src/session/hierarchy/tenant.ts +13 -0
- package/src/session/hierarchy/thread.ts +55 -0
- package/src/session/index.ts +15 -0
- package/src/session/intervention/__tests__/prev-artifact.test.ts +234 -0
- package/src/session/intervention/index.ts +16 -0
- package/src/session/intervention/prev-artifact.ts +180 -0
- package/src/session/migration/__tests__/filesystem.test.ts +263 -0
- package/src/session/migration/__tests__/id-prefix.test.ts +101 -0
- package/src/session/migration/__tests__/marker.test.ts +84 -0
- package/src/session/migration/errors.ts +23 -0
- package/src/session/migration/filesystem.ts +401 -0
- package/src/session/migration/id-prefix.ts +141 -0
- package/src/session/migration/index.ts +38 -0
- package/src/session/migration/marker.ts +131 -0
- package/src/session/retention/__tests__/archive.test.ts +318 -0
- package/src/session/retention/__tests__/disk-backend.test.ts +180 -0
- package/src/session/retention/archive-backend-ref.ts +17 -0
- package/src/session/retention/archive.ts +281 -0
- package/src/session/retention/backend.ts +107 -0
- package/src/session/retention/disk-backend.ts +304 -0
- package/src/session/retention/index.ts +16 -0
- package/src/session/retention/policy.ts +53 -0
- package/src/session/summary/__tests__/materialize.test.ts +343 -0
- package/src/session/summary/deliverable.ts +84 -0
- package/src/session/summary/index.ts +31 -0
- package/src/session/summary/materialize.ts +169 -0
- package/src/session/summary/ref.ts +104 -0
- package/src/session/workspace/__tests__/git-worktree.test.ts +258 -0
- package/src/session/workspace/__tests__/path-builder.test.ts +51 -0
- package/src/session/workspace/driver.ts +60 -0
- package/src/session/workspace/git-worktree.ts +209 -0
- package/src/session/workspace/index.ts +25 -0
- package/src/session/workspace/path-builder.ts +71 -0
- package/src/session/workspace/ref.ts +50 -0
- package/src/session/workspace/registry.ts +42 -0
- package/src/store/index.ts +0 -3
- package/src/store/session/__tests__/disk.test.ts +397 -0
- package/src/store/session/__tests__/memory.test.ts +402 -0
- package/src/store/session/disk.ts +976 -0
- package/src/store/session/index.ts +13 -0
- package/src/store/session/linkage.ts +80 -0
- package/src/store/session/memory.ts +412 -0
- package/src/store/session/messages.ts +21 -0
- package/src/store/thread/disk.ts +261 -0
- package/src/store/thread/index.ts +7 -0
- package/src/store/thread/memory.ts +104 -0
- package/src/types/agent/base.ts +27 -1
- package/src/types/agent/factory.ts +8 -3
- package/src/types/agent/task.ts +66 -2
- package/src/types/ids/index.ts +34 -3
- package/src/types/invocation/__tests__/state.test.ts +37 -29
- package/src/types/invocation/index.ts +26 -10
- package/src/types/rag/retrieval.ts +4 -3
- package/src/types/run/config.ts +13 -1
- package/src/types/run/events.ts +36 -1
- package/src/types/run/index.ts +8 -0
- package/src/types/run/metadata.ts +12 -2
- package/src/types/run/status.ts +33 -0
- package/src/types/session/ids.ts +23 -0
- package/src/types/session/index.ts +27 -0
- package/src/types/session/store.ts +252 -0
- package/src/types/thread/index.ts +5 -0
- package/src/types/thread/store.ts +92 -0
- package/src/utils/id.ts +34 -4
- package/dist/store/conversation/memory.d.ts +0 -21
- package/dist/store/conversation/memory.d.ts.map +0 -1
- package/dist/store/conversation/memory.js +0 -86
- package/dist/store/conversation/memory.js.map +0 -1
- package/dist/types/conversation/index.d.ts +0 -7
- package/dist/types/conversation/index.d.ts.map +0 -1
- package/dist/types/conversation/index.js +0 -2
- package/dist/types/conversation/index.js.map +0 -1
- package/src/store/conversation/memory.ts +0 -121
- package/src/types/conversation/index.ts +0 -8
|
@@ -84,6 +84,11 @@ export class RouterAgent extends AbstractAgent<RouterAgentConfig, RouterAgentRes
|
|
|
84
84
|
targetRoute = fallback
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
if (!config.invocationState) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
'RouterAgent requires invocationState with tenantId in config (session-hierarchy.md §12.1).',
|
|
90
|
+
)
|
|
91
|
+
}
|
|
87
92
|
const childInvocationState = deriveChildState(config.invocationState, this.metadata.id)
|
|
88
93
|
const delegateResult = await targetRoute.agent.run(
|
|
89
94
|
input,
|
|
@@ -3,6 +3,7 @@ import { LocalTaskGateway } from '../gateway/local.js'
|
|
|
3
3
|
import { ToolRegistry } from '../registry/tool/execute.js'
|
|
4
4
|
import { drainQuery } from '../runtime/query/index.js'
|
|
5
5
|
import type { LaunchedTaskMeta } from '../runtime/query/iteration/phases/context.js'
|
|
6
|
+
import type { ActorRef } from '../session/hierarchy/actor.js'
|
|
6
7
|
import { buildCoordinatorTools } from '../tools/coordinator/index.js'
|
|
7
8
|
import type { TaskGateway } from '../types/agent/gateway.js'
|
|
8
9
|
import type {
|
|
@@ -12,7 +13,7 @@ import type {
|
|
|
12
13
|
SupervisorAgentResult,
|
|
13
14
|
} from '../types/agent/index.js'
|
|
14
15
|
import type { AgentTaskContext } from '../types/agent/task.js'
|
|
15
|
-
import type {
|
|
16
|
+
import type { AgentId, TaskId } from '../types/ids/index.js'
|
|
16
17
|
import { deriveChildState } from '../types/invocation/index.js'
|
|
17
18
|
import type { RunEventListener } from '../types/run/index.js'
|
|
18
19
|
import { ZERO_COST } from '../utils/cost.js'
|
|
@@ -42,8 +43,20 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
42
43
|
const startTime = Date.now()
|
|
43
44
|
const runId = this.createRunId()
|
|
44
45
|
|
|
45
|
-
if (!config.threadId) {
|
|
46
|
-
throw new Error(
|
|
46
|
+
if (!config.sessionId || !config.threadId || !config.projectId || !config.tenantId) {
|
|
47
|
+
throw new Error(
|
|
48
|
+
'SupervisorAgent requires sessionId, threadId, projectId, and tenantId in config (session-hierarchy.md §12.1).',
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
const sessionId = config.sessionId
|
|
52
|
+
const threadId = config.threadId
|
|
53
|
+
const projectId = config.projectId
|
|
54
|
+
const tenantId = config.tenantId
|
|
55
|
+
|
|
56
|
+
const parentActor: ActorRef = {
|
|
57
|
+
kind: 'agent',
|
|
58
|
+
agentId: this.metadata.id as AgentId,
|
|
59
|
+
tenantId,
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
let gateway: TaskGateway
|
|
@@ -71,7 +84,11 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
71
84
|
remaining: config.tokenBudget,
|
|
72
85
|
},
|
|
73
86
|
factoryOptions: mergedFactoryOptions,
|
|
74
|
-
|
|
87
|
+
tenantId,
|
|
88
|
+
threadId,
|
|
89
|
+
sessionId,
|
|
90
|
+
projectId,
|
|
91
|
+
parentActor,
|
|
75
92
|
}
|
|
76
93
|
gateway = new LocalTaskGateway(config.agentManager, taskContext, listener, input)
|
|
77
94
|
} else {
|
|
@@ -99,7 +116,10 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
99
116
|
tools.register(tool)
|
|
100
117
|
}
|
|
101
118
|
|
|
102
|
-
const childInvocationState = deriveChildState(
|
|
119
|
+
const childInvocationState = deriveChildState(
|
|
120
|
+
config.invocationState ?? { tenantId },
|
|
121
|
+
this.metadata.id,
|
|
122
|
+
)
|
|
103
123
|
|
|
104
124
|
const run = await drainQuery(
|
|
105
125
|
{
|
|
@@ -119,7 +139,10 @@ export class SupervisorAgent extends AbstractAgent<SupervisorAgentConfig, Superv
|
|
|
119
139
|
workingDirectory: input.workingDirectory,
|
|
120
140
|
messages: input.messages,
|
|
121
141
|
signal: input.signal,
|
|
122
|
-
|
|
142
|
+
sessionId,
|
|
143
|
+
threadId,
|
|
144
|
+
projectId,
|
|
145
|
+
tenantId,
|
|
123
146
|
runId,
|
|
124
147
|
parentRunId: config.parentRunId,
|
|
125
148
|
depth: config.depth,
|
package/src/bridge/a2a/index.ts
CHANGED
package/src/bridge/a2a/mapper.ts
CHANGED
|
@@ -157,6 +157,13 @@ const MAPPING: {
|
|
|
157
157
|
sandbox_created: null,
|
|
158
158
|
sandbox_exec: null,
|
|
159
159
|
sandbox_destroyed: null,
|
|
160
|
+
|
|
161
|
+
// Sub-session lifecycle events (session-hierarchy.md §10.4). These are
|
|
162
|
+
// in-flight visibility signals for the kernel bus; the A2A bridge does not
|
|
163
|
+
// surface them today.
|
|
164
|
+
subsession_spawned: null,
|
|
165
|
+
subsession_messaged: null,
|
|
166
|
+
subsession_idled: null,
|
|
160
167
|
}
|
|
161
168
|
|
|
162
169
|
export function mapRunToA2AEvent(event: RunEvent, contextId?: string): A2AStreamEvent | null {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ThreadMessage } from '../../contracts/index.js'
|
|
2
1
|
import type { A2AMessage, A2AMessageRole, A2APart, TextPart } from '../../types/a2a/index.js'
|
|
3
2
|
import type { Message, MessageRole } from '../../types/message/index.js'
|
|
4
3
|
|
|
@@ -48,37 +47,6 @@ export function messageToA2A(msg: Message): A2AMessage {
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
export function threadMessageToA2A(msg: ThreadMessage): A2AMessage {
|
|
52
|
-
const parts: A2APart[] = []
|
|
53
|
-
|
|
54
|
-
if (msg.content) {
|
|
55
|
-
parts.push({ kind: 'text', text: msg.content })
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (msg.tool_calls) {
|
|
59
|
-
for (const tc of msg.tool_calls) {
|
|
60
|
-
parts.push({
|
|
61
|
-
kind: 'data',
|
|
62
|
-
data: {
|
|
63
|
-
toolCallId: tc.id,
|
|
64
|
-
name: tc.function.name,
|
|
65
|
-
arguments: tc.function.arguments,
|
|
66
|
-
},
|
|
67
|
-
mimeType: 'application/x-namzu-tool-call',
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (parts.length === 0) {
|
|
73
|
-
parts.push({ kind: 'text', text: '' })
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return {
|
|
77
|
-
role: toA2ARole(msg.role),
|
|
78
|
-
parts,
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
50
|
export function extractTextFromA2AMessage(msg: A2AMessage): string {
|
|
83
51
|
return msg.parts
|
|
84
52
|
.filter((p): p is TextPart => p.kind === 'text')
|
package/src/bridge/a2a/task.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RUN_STATUS_TO_A2A, TERMINAL_STATES } from '../../constants/a2a/index.js'
|
|
2
|
-
import type { Run, RunConfig,
|
|
2
|
+
import type { Run, RunConfig, WireRunStatus } from '../../contracts/index.js'
|
|
3
3
|
import type {
|
|
4
4
|
A2AArtifact,
|
|
5
5
|
A2AMessage,
|
|
@@ -8,13 +8,14 @@ import type {
|
|
|
8
8
|
A2ATaskState,
|
|
9
9
|
A2ATaskStatus,
|
|
10
10
|
} from '../../types/a2a/index.js'
|
|
11
|
-
import {
|
|
11
|
+
import type { Message } from '../../types/message/index.js'
|
|
12
|
+
import { extractTextFromA2AMessage, messageToA2A } from './message.js'
|
|
12
13
|
|
|
13
14
|
export function isTerminalState(state: A2ATaskState): boolean {
|
|
14
15
|
return TERMINAL_STATES.has(state)
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export function runStatusToA2AState(status:
|
|
18
|
+
export function runStatusToA2AState(status: WireRunStatus): A2ATaskState {
|
|
18
19
|
return RUN_STATUS_TO_A2A[status]
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -53,12 +54,12 @@ function buildArtifacts(run: Run): A2AArtifact[] | undefined {
|
|
|
53
54
|
]
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
export function runToA2ATask(run: Run, messages?: readonly
|
|
57
|
+
export function runToA2ATask(run: Run, messages?: readonly Message[]): A2ATask {
|
|
57
58
|
return {
|
|
58
59
|
id: run.id,
|
|
59
|
-
contextId: run.
|
|
60
|
+
contextId: run.project_id ?? undefined,
|
|
60
61
|
status: buildTaskStatus(run),
|
|
61
|
-
history: messages?.map(
|
|
62
|
+
history: messages?.map(messageToA2A),
|
|
62
63
|
artifacts: buildArtifacts(run),
|
|
63
64
|
metadata: {
|
|
64
65
|
agent_id: run.agent_id,
|
|
@@ -71,7 +72,7 @@ export function runToA2ATask(run: Run, messages?: readonly ThreadMessage[]): A2A
|
|
|
71
72
|
export interface CreateRunFromA2A {
|
|
72
73
|
readonly agentId: string
|
|
73
74
|
readonly input: string
|
|
74
|
-
readonly
|
|
75
|
+
readonly projectId?: string
|
|
75
76
|
readonly config: RunConfig
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -99,7 +100,7 @@ export function a2aMessageToCreateRun(
|
|
|
99
100
|
return {
|
|
100
101
|
agentId,
|
|
101
102
|
input,
|
|
102
|
-
|
|
103
|
+
projectId: params.contextId,
|
|
103
104
|
config,
|
|
104
105
|
}
|
|
105
106
|
}
|
package/src/bridge/sse/mapper.ts
CHANGED
|
@@ -272,6 +272,13 @@ const MAPPING: {
|
|
|
272
272
|
wire: 'sandbox.destroyed',
|
|
273
273
|
transform: (e, runId) => ({ run_id: runId, sandbox_id: e.sandboxId }),
|
|
274
274
|
},
|
|
275
|
+
|
|
276
|
+
// Sub-session lifecycle events (session-hierarchy.md §10.4). These are
|
|
277
|
+
// in-flight signals carried on the kernel bus; the SSE wire surface does
|
|
278
|
+
// not emit them today.
|
|
279
|
+
subsession_spawned: null,
|
|
280
|
+
subsession_messaged: null,
|
|
281
|
+
subsession_idled: null,
|
|
275
282
|
}
|
|
276
283
|
|
|
277
284
|
export function mapRunToStreamEvent(event: RunEvent, runId: RunId): MappedStreamEvent | null {
|
|
@@ -283,7 +290,7 @@ export function mapRunToStreamEvent(event: RunEvent, runId: RunId): MappedStream
|
|
|
283
290
|
runId,
|
|
284
291
|
)
|
|
285
292
|
|
|
286
|
-
const annotated = event as Record<string, unknown>
|
|
293
|
+
const annotated = event as unknown as Record<string, unknown>
|
|
287
294
|
if ('sourceAgentId' in annotated && annotated.sourceAgentId) {
|
|
288
295
|
data.source_agent_id = annotated.sourceAgentId
|
|
289
296
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WireRunStatus } from '../../contracts/index.js'
|
|
2
2
|
import type { A2ATaskState } from '../../types/a2a/index.js'
|
|
3
3
|
|
|
4
4
|
export const A2A_PROTOCOL_VERSION = '0.3.0'
|
|
5
5
|
|
|
6
|
-
export const RUN_STATUS_TO_A2A: Record<
|
|
6
|
+
export const RUN_STATUS_TO_A2A: Record<WireRunStatus, A2ATaskState> = {
|
|
7
7
|
queued: 'pending',
|
|
8
8
|
running: 'running',
|
|
9
9
|
completed: 'completed',
|
package/src/contracts/api.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentCapabilities, AgentType } from '../types/agent/base.js'
|
|
2
2
|
import type { MessageRole } from '../types/message/index.js'
|
|
3
3
|
import type { StopReason } from '../types/run/events.js'
|
|
4
|
-
import type {
|
|
4
|
+
import type { ProjectId, RunId, SessionId } from './ids.js'
|
|
5
5
|
|
|
6
6
|
export type { MessageRole, StopReason, AgentType, AgentCapabilities }
|
|
7
7
|
|
|
@@ -27,14 +27,6 @@ export interface AgentInfo {
|
|
|
27
27
|
capabilities?: AgentCapabilities
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export interface Thread {
|
|
31
|
-
id: ThreadId
|
|
32
|
-
created_at: ISOTimestamp
|
|
33
|
-
updated_at: ISOTimestamp
|
|
34
|
-
metadata: Record<string, string>
|
|
35
|
-
message_count: number
|
|
36
|
-
}
|
|
37
|
-
|
|
38
30
|
export interface ToolCallInfo {
|
|
39
31
|
id: string
|
|
40
32
|
type: 'function'
|
|
@@ -44,30 +36,22 @@ export interface ToolCallInfo {
|
|
|
44
36
|
}
|
|
45
37
|
}
|
|
46
38
|
|
|
47
|
-
export interface ThreadMessage {
|
|
48
|
-
id: MessageId
|
|
49
|
-
thread_id: ThreadId
|
|
50
|
-
role: MessageRole
|
|
51
|
-
content: string | null
|
|
52
|
-
created_at: ISOTimestamp
|
|
53
|
-
run_id?: RunId
|
|
54
|
-
tool_call_id?: string
|
|
55
|
-
tool_calls?: ToolCallInfo[]
|
|
56
|
-
metadata?: Record<string, unknown>
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface CreateThreadRequest {
|
|
60
|
-
metadata?: Record<string, string>
|
|
61
|
-
messages?: CreateMessageRequest[]
|
|
62
|
-
}
|
|
63
|
-
|
|
64
39
|
export interface CreateMessageRequest {
|
|
65
40
|
role: 'user'
|
|
66
41
|
content: string
|
|
67
42
|
metadata?: Record<string, unknown>
|
|
68
43
|
}
|
|
69
44
|
|
|
70
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Wire-side run status for HTTP / A2A / SSE payloads.
|
|
47
|
+
*
|
|
48
|
+
* Distinct from the domain {@link import('../types/run/status.js').RunStatus}
|
|
49
|
+
* which models the kernel state machine. The wire enum collapses domain
|
|
50
|
+
* variants onto the HTTP-facing shape (e.g. domain `succeeded` → wire
|
|
51
|
+
* `completed`; domain `awaiting_hitl*` → wire `running`; domain
|
|
52
|
+
* `awaiting_subsession` → wire `running`).
|
|
53
|
+
*/
|
|
54
|
+
export type WireRunStatus =
|
|
71
55
|
| 'queued'
|
|
72
56
|
| 'running'
|
|
73
57
|
| 'completed'
|
|
@@ -83,11 +67,11 @@ export type RunStopReason = StopReason
|
|
|
83
67
|
|
|
84
68
|
export interface Run {
|
|
85
69
|
id: RunId
|
|
86
|
-
|
|
70
|
+
project_id: ProjectId | null
|
|
87
71
|
session_id?: SessionId
|
|
88
72
|
agent_id: string
|
|
89
73
|
agent_name?: string
|
|
90
|
-
status:
|
|
74
|
+
status: WireRunStatus
|
|
91
75
|
stop_reason?: RunStopReason
|
|
92
76
|
created_at: ISOTimestamp
|
|
93
77
|
started_at?: ISOTimestamp
|
|
@@ -111,7 +95,7 @@ export interface RunHierarchyNode {
|
|
|
111
95
|
run_id: RunId
|
|
112
96
|
agent_id: string
|
|
113
97
|
depth: number
|
|
114
|
-
status:
|
|
98
|
+
status: WireRunStatus
|
|
115
99
|
children: RunHierarchyNode[]
|
|
116
100
|
}
|
|
117
101
|
|
package/src/contracts/ids.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ProjectId, RunId, MessageId, SessionId } from '../types/ids/index.js'
|
package/src/contracts/index.ts
CHANGED
|
@@ -10,12 +10,9 @@ export type {
|
|
|
10
10
|
ISOTimestamp,
|
|
11
11
|
AgentDefaults,
|
|
12
12
|
AgentInfo,
|
|
13
|
-
Thread,
|
|
14
13
|
ToolCallInfo,
|
|
15
|
-
ThreadMessage,
|
|
16
|
-
CreateThreadRequest,
|
|
17
14
|
CreateMessageRequest,
|
|
18
|
-
|
|
15
|
+
WireRunStatus,
|
|
19
16
|
RunStopReason,
|
|
20
17
|
Run,
|
|
21
18
|
RunHierarchyNode,
|
|
@@ -32,15 +29,14 @@ export type {
|
|
|
32
29
|
ApiError,
|
|
33
30
|
} from './api.js'
|
|
34
31
|
|
|
35
|
-
export type {
|
|
32
|
+
export type { ProjectId, RunId, MessageId, SessionId } from './ids.js'
|
|
36
33
|
|
|
37
34
|
export {
|
|
38
|
-
|
|
35
|
+
ProjectIdSchema,
|
|
39
36
|
RunIdSchema,
|
|
40
37
|
MessageIdSchema,
|
|
41
38
|
RunConfigSchema,
|
|
42
39
|
CreateMessageSchema,
|
|
43
|
-
CreateThreadSchema,
|
|
44
40
|
CreateRunSchema,
|
|
45
41
|
CreateStatelessRunSchema,
|
|
46
42
|
PaginationSchema,
|
package/src/contracts/schemas.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const ProjectIdSchema = z.string().regex(/^prj_[a-z0-9]+$/, 'Invalid project ID format')
|
|
4
4
|
export const RunIdSchema = z.string().regex(/^run_[a-z0-9]+$/, 'Invalid run ID format')
|
|
5
5
|
export const MessageIdSchema = z.string().regex(/^msg_[a-z0-9]+$/, 'Invalid message ID format')
|
|
6
6
|
|
|
@@ -24,13 +24,6 @@ export const CreateMessageSchema = z
|
|
|
24
24
|
})
|
|
25
25
|
.strict()
|
|
26
26
|
|
|
27
|
-
export const CreateThreadSchema = z
|
|
28
|
-
.object({
|
|
29
|
-
metadata: z.record(z.string()).optional(),
|
|
30
|
-
messages: z.array(CreateMessageSchema).optional(),
|
|
31
|
-
})
|
|
32
|
-
.strict()
|
|
33
|
-
|
|
34
27
|
export const CreateRunSchema = z
|
|
35
28
|
.object({
|
|
36
29
|
agent_id: z.string().min(1, 'agent_id is required'),
|
package/src/gateway/local.ts
CHANGED
|
@@ -40,6 +40,12 @@ export class LocalTaskGateway implements TaskGateway {
|
|
|
40
40
|
taskStore: this.parentInput?.taskStore,
|
|
41
41
|
runtimeToolOverrides: this.parentInput?.runtimeToolOverrides,
|
|
42
42
|
},
|
|
43
|
+
// Phase 6: spawn scope propagates from the gateway's task context.
|
|
44
|
+
// The caller built it at SupervisorAgent boundary (§12.1).
|
|
45
|
+
parentSessionId: this.taskContext.sessionId,
|
|
46
|
+
tenantId: this.taskContext.tenantId,
|
|
47
|
+
projectId: this.taskContext.projectId,
|
|
48
|
+
parentActor: this.taskContext.parentActor,
|
|
43
49
|
},
|
|
44
50
|
{ ...this.taskContext, budgetTracker: { ...this.taskContext.budgetTracker } },
|
|
45
51
|
this.listener,
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,11 @@ export * from './types/common/index.js'
|
|
|
23
23
|
export * from './types/tool/index.js'
|
|
24
24
|
export * from './types/permission/index.js'
|
|
25
25
|
export * from './types/run/index.js'
|
|
26
|
+
// Domain `RunStatus` (session-hierarchy.md §4.6 state machine). Re-exported
|
|
27
|
+
// explicitly because `types/run/index.js` intentionally skips `status.js` to
|
|
28
|
+
// avoid colliding with the deprecated wire alias in `contracts/api.ts`
|
|
29
|
+
// (renamed to `WireRunStatus` in 0.2.0 — Phase 9 Known Delta #2).
|
|
30
|
+
export type { RunStatus } from './types/run/status.js'
|
|
26
31
|
export * from './types/provider/index.js'
|
|
27
32
|
export * from './types/agent/index.js'
|
|
28
33
|
export * from './types/decision/index.js'
|
|
@@ -37,7 +42,6 @@ export * from './types/execution/index.js'
|
|
|
37
42
|
export * from './types/connector/index.js'
|
|
38
43
|
export * from './types/skills/index.js'
|
|
39
44
|
export * from './types/a2a/index.js'
|
|
40
|
-
export * from './types/conversation/index.js'
|
|
41
45
|
export * from './types/router/index.js'
|
|
42
46
|
export * from './types/advisory/index.js'
|
|
43
47
|
export * from './types/memory/index.js'
|
|
@@ -46,6 +50,10 @@ export * from './types/sandbox/index.js'
|
|
|
46
50
|
export * from './types/structured-output/index.js'
|
|
47
51
|
export * from './types/invocation/index.js'
|
|
48
52
|
export * from './types/computer-use/index.js'
|
|
53
|
+
// Session hierarchy types (Phase 9 — public API freeze for 0.2.0).
|
|
54
|
+
// Types-only re-export; runtime primitives come via `./session/index.js`
|
|
55
|
+
// and `./store/session/index.js` below.
|
|
56
|
+
export type * from './types/session/index.js'
|
|
49
57
|
|
|
50
58
|
export {
|
|
51
59
|
AdvisorRegistry,
|
|
@@ -131,8 +139,6 @@ export {
|
|
|
131
139
|
InMemoryTaskStore,
|
|
132
140
|
DiskTaskStore,
|
|
133
141
|
type DiskTaskStoreConfig,
|
|
134
|
-
InMemoryConversationStore,
|
|
135
|
-
type InMemoryConversationStoreConfig,
|
|
136
142
|
InMemoryMemoryIndex,
|
|
137
143
|
InMemoryMemoryStore,
|
|
138
144
|
DiskMemoryStore,
|
|
@@ -291,7 +297,6 @@ export {
|
|
|
291
297
|
runStatusToA2AState,
|
|
292
298
|
a2aMessageToCreateRun,
|
|
293
299
|
messageToA2A,
|
|
294
|
-
threadMessageToA2A,
|
|
295
300
|
extractTextFromA2AMessage,
|
|
296
301
|
a2aMessageToInput,
|
|
297
302
|
mapRunToA2AEvent,
|
|
@@ -332,6 +337,11 @@ export {
|
|
|
332
337
|
export type { PlatformMetrics } from './telemetry/index.js'
|
|
333
338
|
export * from './telemetry/attributes.js'
|
|
334
339
|
|
|
340
|
+
// Session hierarchy runtime primitives (Phase 9 — public API freeze for 0.2.0).
|
|
341
|
+
// Convention #4: root barrel imports sub-barrels only, never concrete files.
|
|
342
|
+
export * from './session/index.js'
|
|
343
|
+
export * from './store/session/index.js'
|
|
344
|
+
|
|
335
345
|
export {
|
|
336
346
|
WorkingStateManager,
|
|
337
347
|
serializeState,
|