macro-agent 0.2.5 → 0.2.6
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/LICENSE +1 -1
- package/README.md +30 -56
- package/dist/acp/websocket-server.d.ts +6 -0
- package/dist/acp/websocket-server.d.ts.map +1 -1
- package/dist/acp/websocket-server.js +13 -0
- package/dist/acp/websocket-server.js.map +1 -1
- package/dist/acp/websocket-stream.d.ts +30 -0
- package/dist/acp/websocket-stream.d.ts.map +1 -0
- package/dist/acp/websocket-stream.js +118 -0
- package/dist/acp/websocket-stream.js.map +1 -0
- package/dist/activity/deduplication.d.ts +85 -0
- package/dist/activity/deduplication.d.ts.map +1 -0
- package/dist/activity/deduplication.js +149 -0
- package/dist/activity/deduplication.js.map +1 -0
- package/dist/activity/index.d.ts +16 -0
- package/dist/activity/index.d.ts.map +1 -0
- package/dist/activity/index.js +17 -0
- package/dist/activity/index.js.map +1 -0
- package/dist/activity/relevance.d.ts +81 -0
- package/dist/activity/relevance.d.ts.map +1 -0
- package/dist/activity/relevance.js +161 -0
- package/dist/activity/relevance.js.map +1 -0
- package/dist/activity/types.d.ts +169 -0
- package/dist/activity/types.d.ts.map +1 -0
- package/dist/activity/types.js +33 -0
- package/dist/activity/types.js.map +1 -0
- package/dist/activity/watcher.d.ts +64 -0
- package/dist/activity/watcher.d.ts.map +1 -0
- package/dist/activity/watcher.js +212 -0
- package/dist/activity/watcher.js.map +1 -0
- package/dist/adapters/federation.d.ts +8 -1
- package/dist/adapters/federation.d.ts.map +1 -1
- package/dist/adapters/federation.js +33 -2
- package/dist/adapters/federation.js.map +1 -1
- package/dist/agent/agent-manager-v2.d.ts.map +1 -1
- package/dist/agent/agent-manager-v2.js +7 -24
- package/dist/agent/agent-manager-v2.js.map +1 -1
- package/dist/agent/wake.d.ts +85 -0
- package/dist/agent/wake.d.ts.map +1 -0
- package/dist/agent/wake.js +278 -0
- package/dist/agent/wake.js.map +1 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +41 -25
- package/dist/api/server.js.map +1 -1
- package/dist/api/types.d.ts +6 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/auth/server-auth.d.ts +43 -0
- package/dist/auth/server-auth.d.ts.map +1 -0
- package/dist/auth/server-auth.js +80 -0
- package/dist/auth/server-auth.js.map +1 -0
- package/dist/auth/token.d.ts +4 -0
- package/dist/auth/token.d.ts.map +1 -1
- package/dist/auth/token.js +7 -6
- package/dist/auth/token.js.map +1 -1
- package/dist/boot-v2.d.ts +6 -3
- package/dist/boot-v2.d.ts.map +1 -1
- package/dist/boot-v2.js +44 -25
- package/dist/boot-v2.js.map +1 -1
- package/dist/cognitive/team-lifecycle.d.ts +82 -0
- package/dist/cognitive/team-lifecycle.d.ts.map +1 -0
- package/dist/cognitive/team-lifecycle.js +121 -0
- package/dist/cognitive/team-lifecycle.js.map +1 -0
- package/dist/cognitive/trajectory-extractor.d.ts +25 -0
- package/dist/cognitive/trajectory-extractor.d.ts.map +1 -0
- package/dist/cognitive/trajectory-extractor.js +134 -0
- package/dist/cognitive/trajectory-extractor.js.map +1 -0
- package/dist/control/control-server.d.ts.map +1 -1
- package/dist/control/control-server.js +10 -0
- package/dist/control/control-server.js.map +1 -1
- package/dist/dispatch/mail-inbound-consumer.d.ts.map +1 -1
- package/dist/dispatch/mail-inbound-consumer.js +43 -10
- package/dist/dispatch/mail-inbound-consumer.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/lifecycle/handlers/generic.d.ts +27 -0
- package/dist/lifecycle/handlers/generic.d.ts.map +1 -0
- package/dist/lifecycle/handlers/generic.js +56 -0
- package/dist/lifecycle/handlers/generic.js.map +1 -0
- package/dist/lifecycle/handlers/index.d.ts +51 -0
- package/dist/lifecycle/handlers/index.d.ts.map +1 -0
- package/dist/lifecycle/handlers/index.js +110 -0
- package/dist/lifecycle/handlers/index.js.map +1 -0
- package/dist/lifecycle/handlers/integrator.d.ts +81 -0
- package/dist/lifecycle/handlers/integrator.d.ts.map +1 -0
- package/dist/lifecycle/handlers/integrator.js +451 -0
- package/dist/lifecycle/handlers/integrator.js.map +1 -0
- package/dist/lifecycle/handlers/monitor.d.ts +29 -0
- package/dist/lifecycle/handlers/monitor.d.ts.map +1 -0
- package/dist/lifecycle/handlers/monitor.js +79 -0
- package/dist/lifecycle/handlers/monitor.js.map +1 -0
- package/dist/lifecycle/handlers/worker.d.ts +56 -0
- package/dist/lifecycle/handlers/worker.d.ts.map +1 -0
- package/dist/lifecycle/handlers/worker.js +381 -0
- package/dist/lifecycle/handlers/worker.js.map +1 -0
- package/dist/lifecycle/handlers-v2.d.ts +0 -2
- package/dist/lifecycle/handlers-v2.d.ts.map +1 -1
- package/dist/lifecycle/handlers-v2.js +4 -55
- package/dist/lifecycle/handlers-v2.js.map +1 -1
- package/dist/mail/conversation-map.d.ts +33 -0
- package/dist/mail/conversation-map.d.ts.map +1 -0
- package/dist/mail/conversation-map.js +61 -0
- package/dist/mail/conversation-map.js.map +1 -0
- package/dist/mail/index.d.ts +11 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +11 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/mail-service.d.ts +85 -0
- package/dist/mail/mail-service.d.ts.map +1 -0
- package/dist/mail/mail-service.js +121 -0
- package/dist/mail/mail-service.js.map +1 -0
- package/dist/mail/stores/eventstore-conversation-store.d.ts +40 -0
- package/dist/mail/stores/eventstore-conversation-store.d.ts.map +1 -0
- package/dist/mail/stores/eventstore-conversation-store.js +131 -0
- package/dist/mail/stores/eventstore-conversation-store.js.map +1 -0
- package/dist/mail/stores/eventstore-participant-store.d.ts +43 -0
- package/dist/mail/stores/eventstore-participant-store.d.ts.map +1 -0
- package/dist/mail/stores/eventstore-participant-store.js +145 -0
- package/dist/mail/stores/eventstore-participant-store.js.map +1 -0
- package/dist/mail/stores/eventstore-thread-store.d.ts +46 -0
- package/dist/mail/stores/eventstore-thread-store.d.ts.map +1 -0
- package/dist/mail/stores/eventstore-thread-store.js +118 -0
- package/dist/mail/stores/eventstore-thread-store.js.map +1 -0
- package/dist/mail/stores/eventstore-turn-store.d.ts +47 -0
- package/dist/mail/stores/eventstore-turn-store.d.ts.map +1 -0
- package/dist/mail/stores/eventstore-turn-store.js +153 -0
- package/dist/mail/stores/eventstore-turn-store.js.map +1 -0
- package/dist/mail/stores/index.d.ts +12 -0
- package/dist/mail/stores/index.d.ts.map +1 -0
- package/dist/mail/stores/index.js +12 -0
- package/dist/mail/stores/index.js.map +1 -0
- package/dist/mail/stores/types.d.ts +146 -0
- package/dist/mail/stores/types.d.ts.map +1 -0
- package/dist/mail/stores/types.js +13 -0
- package/dist/mail/stores/types.js.map +1 -0
- package/dist/mail/turn-recorder.d.ts +30 -0
- package/dist/mail/turn-recorder.d.ts.map +1 -0
- package/dist/mail/turn-recorder.js +98 -0
- package/dist/mail/turn-recorder.js.map +1 -0
- package/dist/map/adapter/acp-over-map.d.ts +115 -0
- package/dist/map/adapter/acp-over-map.d.ts.map +1 -0
- package/dist/map/adapter/acp-over-map.js +1024 -0
- package/dist/map/adapter/acp-over-map.js.map +1 -0
- package/dist/map/adapter/connection-manager.d.ts +150 -0
- package/dist/map/adapter/connection-manager.d.ts.map +1 -0
- package/dist/map/adapter/connection-manager.js +207 -0
- package/dist/map/adapter/connection-manager.js.map +1 -0
- package/dist/map/adapter/event-log.d.ts +87 -0
- package/dist/map/adapter/event-log.d.ts.map +1 -0
- package/dist/map/adapter/event-log.js +122 -0
- package/dist/map/adapter/event-log.js.map +1 -0
- package/dist/map/adapter/event-translator.d.ts +85 -0
- package/dist/map/adapter/event-translator.d.ts.map +1 -0
- package/dist/map/adapter/event-translator.js +295 -0
- package/dist/map/adapter/event-translator.js.map +1 -0
- package/dist/map/adapter/extensions/agent-detection.d.ts +49 -0
- package/dist/map/adapter/extensions/agent-detection.d.ts.map +1 -0
- package/dist/map/adapter/extensions/agent-detection.js +91 -0
- package/dist/map/adapter/extensions/agent-detection.js.map +1 -0
- package/dist/map/adapter/extensions/agent-lifecycle.d.ts +82 -0
- package/dist/map/adapter/extensions/agent-lifecycle.d.ts.map +1 -0
- package/dist/map/adapter/extensions/agent-lifecycle.js +164 -0
- package/dist/map/adapter/extensions/agent-lifecycle.js.map +1 -0
- package/dist/map/adapter/extensions/cognitive.d.ts +27 -0
- package/dist/map/adapter/extensions/cognitive.d.ts.map +1 -0
- package/dist/map/adapter/extensions/cognitive.js +158 -0
- package/dist/map/adapter/extensions/cognitive.js.map +1 -0
- package/dist/map/adapter/extensions/index.d.ts +95 -0
- package/dist/map/adapter/extensions/index.d.ts.map +1 -0
- package/dist/map/adapter/extensions/index.js +228 -0
- package/dist/map/adapter/extensions/index.js.map +1 -0
- package/dist/map/adapter/extensions/mcp-bridge.d.ts +57 -0
- package/dist/map/adapter/extensions/mcp-bridge.d.ts.map +1 -0
- package/dist/map/adapter/extensions/mcp-bridge.js +745 -0
- package/dist/map/adapter/extensions/mcp-bridge.js.map +1 -0
- package/dist/map/adapter/extensions/resume.d.ts +47 -0
- package/dist/map/adapter/extensions/resume.d.ts.map +1 -0
- package/dist/map/adapter/extensions/resume.js +59 -0
- package/dist/map/adapter/extensions/resume.js.map +1 -0
- package/dist/map/adapter/extensions/streams.d.ts +95 -0
- package/dist/map/adapter/extensions/streams.d.ts.map +1 -0
- package/dist/map/adapter/extensions/streams.js +515 -0
- package/dist/map/adapter/extensions/streams.js.map +1 -0
- package/dist/map/adapter/extensions/task.d.ts +40 -0
- package/dist/map/adapter/extensions/task.d.ts.map +1 -0
- package/dist/map/adapter/extensions/task.js +197 -0
- package/dist/map/adapter/extensions/task.js.map +1 -0
- package/dist/map/adapter/extensions/update-metadata.d.ts +29 -0
- package/dist/map/adapter/extensions/update-metadata.d.ts.map +1 -0
- package/dist/map/adapter/extensions/update-metadata.js +67 -0
- package/dist/map/adapter/extensions/update-metadata.js.map +1 -0
- package/dist/map/adapter/extensions/wake.d.ts +60 -0
- package/dist/map/adapter/extensions/wake.d.ts.map +1 -0
- package/dist/map/adapter/extensions/wake.js +144 -0
- package/dist/map/adapter/extensions/wake.js.map +1 -0
- package/dist/map/adapter/extensions/workspace-files.d.ts +42 -0
- package/dist/map/adapter/extensions/workspace-files.d.ts.map +1 -0
- package/dist/map/adapter/extensions/workspace-files.js +338 -0
- package/dist/map/adapter/extensions/workspace-files.js.map +1 -0
- package/dist/map/adapter/extensions/workspace.d.ts +57 -0
- package/dist/map/adapter/extensions/workspace.d.ts.map +1 -0
- package/dist/map/adapter/extensions/workspace.js +81 -0
- package/dist/map/adapter/extensions/workspace.js.map +1 -0
- package/dist/map/adapter/index.d.ts +20 -0
- package/dist/map/adapter/index.d.ts.map +1 -0
- package/dist/map/adapter/index.js +40 -0
- package/dist/map/adapter/index.js.map +1 -0
- package/dist/map/adapter/interface.d.ts +450 -0
- package/dist/map/adapter/interface.d.ts.map +1 -0
- package/dist/map/adapter/interface.js +24 -0
- package/dist/map/adapter/interface.js.map +1 -0
- package/dist/map/adapter/mail-handler-adapter.d.ts +27 -0
- package/dist/map/adapter/mail-handler-adapter.d.ts.map +1 -0
- package/dist/map/adapter/mail-handler-adapter.js +292 -0
- package/dist/map/adapter/mail-handler-adapter.js.map +1 -0
- package/dist/map/adapter/map-adapter.d.ts +200 -0
- package/dist/map/adapter/map-adapter.d.ts.map +1 -0
- package/dist/map/adapter/map-adapter.js +1199 -0
- package/dist/map/adapter/map-adapter.js.map +1 -0
- package/dist/map/adapter/rpc-handler.d.ts +263 -0
- package/dist/map/adapter/rpc-handler.d.ts.map +1 -0
- package/dist/map/adapter/rpc-handler.js +365 -0
- package/dist/map/adapter/rpc-handler.js.map +1 -0
- package/dist/map/adapter/subscription-manager.d.ts +174 -0
- package/dist/map/adapter/subscription-manager.d.ts.map +1 -0
- package/dist/map/adapter/subscription-manager.js +248 -0
- package/dist/map/adapter/subscription-manager.js.map +1 -0
- package/dist/map/adapter/types.d.ts +194 -0
- package/dist/map/adapter/types.d.ts.map +1 -0
- package/dist/map/adapter/types.js +27 -0
- package/dist/map/adapter/types.js.map +1 -0
- package/dist/map/adapter/websocket-integration.d.ts +113 -0
- package/dist/map/adapter/websocket-integration.d.ts.map +1 -0
- package/dist/map/adapter/websocket-integration.js +134 -0
- package/dist/map/adapter/websocket-integration.js.map +1 -0
- package/dist/map/cascade-action-handler.d.ts.map +1 -1
- package/dist/map/cascade-action-handler.js +19 -5
- package/dist/map/cascade-action-handler.js.map +1 -1
- package/dist/map/federation/envelope.d.ts +98 -0
- package/dist/map/federation/envelope.d.ts.map +1 -0
- package/dist/map/federation/envelope.js +160 -0
- package/dist/map/federation/envelope.js.map +1 -0
- package/dist/map/federation/federation-handler.d.ts +50 -0
- package/dist/map/federation/federation-handler.d.ts.map +1 -0
- package/dist/map/federation/federation-handler.js +306 -0
- package/dist/map/federation/federation-handler.js.map +1 -0
- package/dist/map/federation/index.d.ts +14 -0
- package/dist/map/federation/index.d.ts.map +1 -0
- package/dist/map/federation/index.js +13 -0
- package/dist/map/federation/index.js.map +1 -0
- package/dist/map/federation/types.d.ts +239 -0
- package/dist/map/federation/types.d.ts.map +1 -0
- package/dist/map/federation/types.js +23 -0
- package/dist/map/federation/types.js.map +1 -0
- package/dist/map/server.d.ts.map +1 -1
- package/dist/map/server.js +17 -2
- package/dist/map/server.js.map +1 -1
- package/dist/map/types.d.ts +6 -0
- package/dist/map/types.d.ts.map +1 -1
- package/dist/mcp/map-client.d.ts +39 -0
- package/dist/mcp/map-client.d.ts.map +1 -0
- package/dist/mcp/map-client.js +129 -0
- package/dist/mcp/map-client.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts +72 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -0
- package/dist/mcp/mcp-server.js +1027 -0
- package/dist/mcp/mcp-server.js.map +1 -0
- package/dist/mcp/tools/claim_task.d.ts +35 -0
- package/dist/mcp/tools/claim_task.d.ts.map +1 -0
- package/dist/mcp/tools/claim_task.js +58 -0
- package/dist/mcp/tools/claim_task.js.map +1 -0
- package/dist/mcp/tools/done-v2.d.ts +0 -1
- package/dist/mcp/tools/done-v2.d.ts.map +1 -1
- package/dist/mcp/tools/done-v2.js +0 -1
- package/dist/mcp/tools/done-v2.js.map +1 -1
- package/dist/mcp/tools/done.d.ts +102 -0
- package/dist/mcp/tools/done.d.ts.map +1 -0
- package/dist/mcp/tools/done.js +253 -0
- package/dist/mcp/tools/done.js.map +1 -0
- package/dist/mcp/tools/inject_context.d.ts +61 -0
- package/dist/mcp/tools/inject_context.d.ts.map +1 -0
- package/dist/mcp/tools/inject_context.js +123 -0
- package/dist/mcp/tools/inject_context.js.map +1 -0
- package/dist/mcp/tools/list_claimable_tasks.d.ts +38 -0
- package/dist/mcp/tools/list_claimable_tasks.d.ts.map +1 -0
- package/dist/mcp/tools/list_claimable_tasks.js +63 -0
- package/dist/mcp/tools/list_claimable_tasks.js.map +1 -0
- package/dist/mcp/tools/unclaim_task.d.ts +31 -0
- package/dist/mcp/tools/unclaim_task.d.ts.map +1 -0
- package/dist/mcp/tools/unclaim_task.js +47 -0
- package/dist/mcp/tools/unclaim_task.js.map +1 -0
- package/dist/mcp/tools/wait_for_activity.d.ts +60 -0
- package/dist/mcp/tools/wait_for_activity.d.ts.map +1 -0
- package/dist/mcp/tools/wait_for_activity.js +135 -0
- package/dist/mcp/tools/wait_for_activity.js.map +1 -0
- package/dist/monitor/health-check-service.d.ts +143 -0
- package/dist/monitor/health-check-service.d.ts.map +1 -0
- package/dist/monitor/health-check-service.js +240 -0
- package/dist/monitor/health-check-service.js.map +1 -0
- package/dist/monitor/index.d.ts +14 -0
- package/dist/monitor/index.d.ts.map +1 -0
- package/dist/monitor/index.js +14 -0
- package/dist/monitor/index.js.map +1 -0
- package/dist/monitor/stall-detector.d.ts +109 -0
- package/dist/monitor/stall-detector.d.ts.map +1 -0
- package/dist/monitor/stall-detector.js +152 -0
- package/dist/monitor/stall-detector.js.map +1 -0
- package/dist/peer/capability-manager.d.ts +56 -0
- package/dist/peer/capability-manager.d.ts.map +1 -0
- package/dist/peer/capability-manager.js +186 -0
- package/dist/peer/capability-manager.js.map +1 -0
- package/dist/peer/encapsulation-manager.d.ts +190 -0
- package/dist/peer/encapsulation-manager.d.ts.map +1 -0
- package/dist/peer/encapsulation-manager.js +486 -0
- package/dist/peer/encapsulation-manager.js.map +1 -0
- package/dist/peer/federation-manager.d.ts +223 -0
- package/dist/peer/federation-manager.d.ts.map +1 -0
- package/dist/peer/federation-manager.js +528 -0
- package/dist/peer/federation-manager.js.map +1 -0
- package/dist/peer/hierarchy-errors.d.ts +208 -0
- package/dist/peer/hierarchy-errors.d.ts.map +1 -0
- package/dist/peer/hierarchy-errors.js +268 -0
- package/dist/peer/hierarchy-errors.js.map +1 -0
- package/dist/peer/hierarchy-protocol.d.ts +159 -0
- package/dist/peer/hierarchy-protocol.d.ts.map +1 -0
- package/dist/peer/hierarchy-protocol.js +142 -0
- package/dist/peer/hierarchy-protocol.js.map +1 -0
- package/dist/peer/index.d.ts +15 -0
- package/dist/peer/index.d.ts.map +1 -0
- package/dist/peer/index.js +15 -0
- package/dist/peer/index.js.map +1 -0
- package/dist/peer/peer-manager.d.ts +99 -0
- package/dist/peer/peer-manager.d.ts.map +1 -0
- package/dist/peer/peer-manager.js +333 -0
- package/dist/peer/peer-manager.js.map +1 -0
- package/dist/peer/task-delegation.d.ts +189 -0
- package/dist/peer/task-delegation.d.ts.map +1 -0
- package/dist/peer/task-delegation.js +303 -0
- package/dist/peer/task-delegation.js.map +1 -0
- package/dist/peer/transports/index.d.ts +8 -0
- package/dist/peer/transports/index.d.ts.map +1 -0
- package/dist/peer/transports/index.js +8 -0
- package/dist/peer/transports/index.js.map +1 -0
- package/dist/peer/transports/local-transport.d.ts +56 -0
- package/dist/peer/transports/local-transport.d.ts.map +1 -0
- package/dist/peer/transports/local-transport.js +263 -0
- package/dist/peer/transports/local-transport.js.map +1 -0
- package/dist/peer/transports/websocket-transport.d.ts +86 -0
- package/dist/peer/transports/websocket-transport.d.ts.map +1 -0
- package/dist/peer/transports/websocket-transport.js +338 -0
- package/dist/peer/transports/websocket-transport.js.map +1 -0
- package/dist/peer/types.d.ts +268 -0
- package/dist/peer/types.d.ts.map +1 -0
- package/dist/peer/types.js +36 -0
- package/dist/peer/types.js.map +1 -0
- package/dist/router/address-resolver.d.ts +102 -0
- package/dist/router/address-resolver.d.ts.map +1 -0
- package/dist/router/address-resolver.js +198 -0
- package/dist/router/address-resolver.js.map +1 -0
- package/dist/router/broadcast.d.ts +53 -0
- package/dist/router/broadcast.d.ts.map +1 -0
- package/dist/router/broadcast.js +75 -0
- package/dist/router/broadcast.js.map +1 -0
- package/dist/router/channels.d.ts +148 -0
- package/dist/router/channels.d.ts.map +1 -0
- package/dist/router/channels.js +126 -0
- package/dist/router/channels.js.map +1 -0
- package/dist/router/index.d.ts +21 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +18 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/message-router.d.ts +197 -0
- package/dist/router/message-router.d.ts.map +1 -0
- package/dist/router/message-router.js +903 -0
- package/dist/router/message-router.js.map +1 -0
- package/dist/router/message-types.d.ts +183 -0
- package/dist/router/message-types.d.ts.map +1 -0
- package/dist/router/message-types.js +79 -0
- package/dist/router/message-types.js.map +1 -0
- package/dist/router/role-resolver.d.ts +67 -0
- package/dist/router/role-resolver.d.ts.map +1 -0
- package/dist/router/role-resolver.js +106 -0
- package/dist/router/role-resolver.js.map +1 -0
- package/dist/router/signals.d.ts +253 -0
- package/dist/router/signals.d.ts.map +1 -0
- package/dist/router/signals.js +53 -0
- package/dist/router/signals.js.map +1 -0
- package/dist/router/types.d.ts +191 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +34 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router/wake.d.ts +111 -0
- package/dist/router/wake.d.ts.map +1 -0
- package/dist/router/wake.js +180 -0
- package/dist/router/wake.js.map +1 -0
- package/dist/server/combined-server.d.ts +95 -0
- package/dist/server/combined-server.d.ts.map +1 -0
- package/dist/server/combined-server.js +335 -0
- package/dist/server/combined-server.js.map +1 -0
- package/dist/steering/index.d.ts +11 -0
- package/dist/steering/index.d.ts.map +1 -0
- package/dist/steering/index.js +11 -0
- package/dist/steering/index.js.map +1 -0
- package/dist/steering/inject.d.ts +39 -0
- package/dist/steering/inject.d.ts.map +1 -0
- package/dist/steering/inject.js +197 -0
- package/dist/steering/inject.js.map +1 -0
- package/dist/steering/types.d.ts +100 -0
- package/dist/steering/types.d.ts.map +1 -0
- package/dist/steering/types.js +11 -0
- package/dist/steering/types.js.map +1 -0
- package/dist/store/backends/index.d.ts +11 -0
- package/dist/store/backends/index.d.ts.map +1 -0
- package/dist/store/backends/index.js +15 -0
- package/dist/store/backends/index.js.map +1 -0
- package/dist/store/backends/json-backend.d.ts +23 -0
- package/dist/store/backends/json-backend.d.ts.map +1 -0
- package/dist/store/backends/json-backend.js +220 -0
- package/dist/store/backends/json-backend.js.map +1 -0
- package/dist/store/backends/memory-backend.d.ts +12 -0
- package/dist/store/backends/memory-backend.d.ts.map +1 -0
- package/dist/store/backends/memory-backend.js +205 -0
- package/dist/store/backends/memory-backend.js.map +1 -0
- package/dist/store/backends/sqlite-backend.d.ts +27 -0
- package/dist/store/backends/sqlite-backend.d.ts.map +1 -0
- package/dist/store/backends/sqlite-backend.js +231 -0
- package/dist/store/backends/sqlite-backend.js.map +1 -0
- package/dist/store/backends/tinybase-backend.d.ts +22 -0
- package/dist/store/backends/tinybase-backend.d.ts.map +1 -0
- package/dist/store/backends/tinybase-backend.js +203 -0
- package/dist/store/backends/tinybase-backend.js.map +1 -0
- package/dist/store/backends/types.d.ts +175 -0
- package/dist/store/backends/types.d.ts.map +1 -0
- package/dist/store/backends/types.js +28 -0
- package/dist/store/backends/types.js.map +1 -0
- package/dist/store/event-store.d.ts +128 -0
- package/dist/store/event-store.d.ts.map +1 -0
- package/dist/store/event-store.js +1751 -0
- package/dist/store/event-store.js.map +1 -0
- package/dist/store/instance.d.ts +290 -0
- package/dist/store/instance.d.ts.map +1 -0
- package/dist/store/instance.js +363 -0
- package/dist/store/instance.js.map +1 -0
- package/dist/store/migrations.d.ts +41 -0
- package/dist/store/migrations.d.ts.map +1 -0
- package/dist/store/migrations.js +79 -0
- package/dist/store/migrations.js.map +1 -0
- package/dist/store/test-utils.d.ts +63 -0
- package/dist/store/test-utils.d.ts.map +1 -0
- package/dist/store/test-utils.js +63 -0
- package/dist/store/test-utils.js.map +1 -0
- package/dist/store/types/config.d.ts +16 -0
- package/dist/store/types/config.d.ts.map +1 -0
- package/dist/store/types/config.js +8 -0
- package/dist/store/types/config.js.map +1 -0
- package/dist/store/types/conversations.d.ts +91 -0
- package/dist/store/types/conversations.d.ts.map +1 -0
- package/dist/store/types/conversations.js +8 -0
- package/dist/store/types/conversations.js.map +1 -0
- package/dist/store/types/sessions.d.ts +44 -0
- package/dist/store/types/sessions.d.ts.map +1 -0
- package/dist/store/types/sessions.js +9 -0
- package/dist/store/types/sessions.js.map +1 -0
- package/dist/store/types.d.ts +115 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +6 -0
- package/dist/store/types.js.map +1 -0
- package/dist/task/backend/index.d.ts +93 -0
- package/dist/task/backend/index.d.ts.map +1 -0
- package/dist/task/backend/index.js +178 -0
- package/dist/task/backend/index.js.map +1 -0
- package/dist/task/backend/memory.d.ts +70 -0
- package/dist/task/backend/memory.d.ts.map +1 -0
- package/dist/task/backend/memory.js +621 -0
- package/dist/task/backend/memory.js.map +1 -0
- package/dist/task/backend/opentasks/backend.d.ts +140 -0
- package/dist/task/backend/opentasks/backend.d.ts.map +1 -0
- package/dist/task/backend/opentasks/backend.js +1023 -0
- package/dist/task/backend/opentasks/backend.js.map +1 -0
- package/dist/task/backend/opentasks/client.d.ts +337 -0
- package/dist/task/backend/opentasks/client.d.ts.map +1 -0
- package/dist/task/backend/opentasks/client.js +225 -0
- package/dist/task/backend/opentasks/client.js.map +1 -0
- package/dist/task/backend/opentasks/daemon-manager.d.ts +89 -0
- package/dist/task/backend/opentasks/daemon-manager.d.ts.map +1 -0
- package/dist/task/backend/opentasks/daemon-manager.js +195 -0
- package/dist/task/backend/opentasks/daemon-manager.js.map +1 -0
- package/dist/task/backend/opentasks/index.d.ts +21 -0
- package/dist/task/backend/opentasks/index.d.ts.map +1 -0
- package/dist/task/backend/opentasks/index.js +21 -0
- package/dist/task/backend/opentasks/index.js.map +1 -0
- package/dist/task/backend/opentasks/mapping.d.ts +48 -0
- package/dist/task/backend/opentasks/mapping.d.ts.map +1 -0
- package/dist/task/backend/opentasks/mapping.js +77 -0
- package/dist/task/backend/opentasks/mapping.js.map +1 -0
- package/dist/task/backend/sudocode/__tests__/integration/test-utils.d.ts +54 -0
- package/dist/task/backend/sudocode/__tests__/integration/test-utils.d.ts.map +1 -0
- package/dist/task/backend/sudocode/__tests__/integration/test-utils.js +88 -0
- package/dist/task/backend/sudocode/__tests__/integration/test-utils.js.map +1 -0
- package/dist/task/backend/sudocode/backend.d.ts +155 -0
- package/dist/task/backend/sudocode/backend.d.ts.map +1 -0
- package/dist/task/backend/sudocode/backend.js +942 -0
- package/dist/task/backend/sudocode/backend.js.map +1 -0
- package/dist/task/backend/sudocode/client.d.ts +303 -0
- package/dist/task/backend/sudocode/client.d.ts.map +1 -0
- package/dist/task/backend/sudocode/client.js +101 -0
- package/dist/task/backend/sudocode/client.js.map +1 -0
- package/dist/task/backend/sudocode/index.d.ts +19 -0
- package/dist/task/backend/sudocode/index.d.ts.map +1 -0
- package/dist/task/backend/sudocode/index.js +17 -0
- package/dist/task/backend/sudocode/index.js.map +1 -0
- package/dist/task/backend/sudocode/mapping.d.ts +51 -0
- package/dist/task/backend/sudocode/mapping.d.ts.map +1 -0
- package/dist/task/backend/sudocode/mapping.js +86 -0
- package/dist/task/backend/sudocode/mapping.js.map +1 -0
- package/dist/task/backend/sudocode/server-client.d.ts +56 -0
- package/dist/task/backend/sudocode/server-client.d.ts.map +1 -0
- package/dist/task/backend/sudocode/server-client.js +367 -0
- package/dist/task/backend/sudocode/server-client.js.map +1 -0
- package/dist/task/backend/sudocode/standalone-client.d.ts +91 -0
- package/dist/task/backend/sudocode/standalone-client.d.ts.map +1 -0
- package/dist/task/backend/sudocode/standalone-client.js +476 -0
- package/dist/task/backend/sudocode/standalone-client.js.map +1 -0
- package/dist/task/backend/sudocode/sync-policy.d.ts +166 -0
- package/dist/task/backend/sudocode/sync-policy.d.ts.map +1 -0
- package/dist/task/backend/sudocode/sync-policy.js +221 -0
- package/dist/task/backend/sudocode/sync-policy.js.map +1 -0
- package/dist/task/backend/sudocode/tools.d.ts +87 -0
- package/dist/task/backend/sudocode/tools.d.ts.map +1 -0
- package/dist/task/backend/sudocode/tools.js +743 -0
- package/dist/task/backend/sudocode/tools.js.map +1 -0
- package/dist/task/backend/tool-provider.d.ts +56 -0
- package/dist/task/backend/tool-provider.d.ts.map +1 -0
- package/dist/task/backend/tool-provider.js +424 -0
- package/dist/task/backend/tool-provider.js.map +1 -0
- package/dist/task/backend/types.d.ts +297 -0
- package/dist/task/backend/types.d.ts.map +1 -0
- package/dist/task/backend/types.js +27 -0
- package/dist/task/backend/types.js.map +1 -0
- package/dist/task/backend/unified-tool-provider.d.ts +57 -0
- package/dist/task/backend/unified-tool-provider.d.ts.map +1 -0
- package/dist/task/backend/unified-tool-provider.js +623 -0
- package/dist/task/backend/unified-tool-provider.js.map +1 -0
- package/dist/task/index.d.ts +7 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +7 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/retry-policy.d.ts +89 -0
- package/dist/task/retry-policy.d.ts.map +1 -0
- package/dist/task/retry-policy.js +160 -0
- package/dist/task/retry-policy.js.map +1 -0
- package/dist/task/task-manager.d.ts +70 -0
- package/dist/task/task-manager.d.ts.map +1 -0
- package/dist/task/task-manager.js +319 -0
- package/dist/task/task-manager.js.map +1 -0
- package/dist/task/types.d.ts +72 -0
- package/dist/task/types.d.ts.map +1 -0
- package/dist/task/types.js +33 -0
- package/dist/task/types.js.map +1 -0
- package/dist/teams/team-loader.d.ts +2 -1
- package/dist/teams/team-loader.d.ts.map +1 -1
- package/dist/teams/team-loader.js +2 -1
- package/dist/teams/team-loader.js.map +1 -1
- package/dist/teams/team-manager.d.ts +101 -0
- package/dist/teams/team-manager.d.ts.map +1 -0
- package/dist/teams/team-manager.js +260 -0
- package/dist/teams/team-manager.js.map +1 -0
- package/dist/teams/team-runtime-v2.d.ts +0 -3
- package/dist/teams/team-runtime-v2.d.ts.map +1 -1
- package/dist/teams/team-runtime-v2.js +8 -87
- package/dist/teams/team-runtime-v2.js.map +1 -1
- package/dist/teams/team-runtime.d.ts +245 -0
- package/dist/teams/team-runtime.d.ts.map +1 -0
- package/dist/teams/team-runtime.js +1023 -0
- package/dist/teams/team-runtime.js.map +1 -0
- package/dist/trigger/router/index.d.ts +11 -0
- package/dist/trigger/router/index.d.ts.map +1 -0
- package/dist/trigger/router/index.js +10 -0
- package/dist/trigger/router/index.js.map +1 -0
- package/dist/trigger/router/strategies/ai-router-strategy.d.ts +34 -0
- package/dist/trigger/router/strategies/ai-router-strategy.d.ts.map +1 -0
- package/dist/trigger/router/strategies/ai-router-strategy.js +359 -0
- package/dist/trigger/router/strategies/ai-router-strategy.js.map +1 -0
- package/dist/trigger/router/strategies/direct-strategy.d.ts +32 -0
- package/dist/trigger/router/strategies/direct-strategy.d.ts.map +1 -0
- package/dist/trigger/router/strategies/direct-strategy.js +119 -0
- package/dist/trigger/router/strategies/direct-strategy.js.map +1 -0
- package/dist/trigger/router/strategies/index.d.ts +11 -0
- package/dist/trigger/router/strategies/index.d.ts.map +1 -0
- package/dist/trigger/router/strategies/index.js +11 -0
- package/dist/trigger/router/strategies/index.js.map +1 -0
- package/dist/trigger/router/strategies/role-strategy.d.ts +39 -0
- package/dist/trigger/router/strategies/role-strategy.d.ts.map +1 -0
- package/dist/trigger/router/strategies/role-strategy.js +207 -0
- package/dist/trigger/router/strategies/role-strategy.js.map +1 -0
- package/dist/trigger/router/trigger-router.d.ts +54 -0
- package/dist/trigger/router/trigger-router.d.ts.map +1 -0
- package/dist/trigger/router/trigger-router.js +362 -0
- package/dist/trigger/router/trigger-router.js.map +1 -0
- package/dist/trigger/router/types.d.ts +225 -0
- package/dist/trigger/router/types.d.ts.map +1 -0
- package/dist/trigger/router/types.js +10 -0
- package/dist/trigger/router/types.js.map +1 -0
- package/dist/trigger/sources/cron/cron-service.d.ts.map +1 -1
- package/dist/trigger/sources/cron/cron-service.js +6 -3
- package/dist/trigger/sources/cron/cron-service.js.map +1 -1
- package/dist/trigger/trigger-system.d.ts +77 -0
- package/dist/trigger/trigger-system.d.ts.map +1 -0
- package/dist/trigger/trigger-system.js +84 -0
- package/dist/trigger/trigger-system.js.map +1 -0
- package/dist/util/git-safety.d.ts +33 -0
- package/dist/util/git-safety.d.ts.map +1 -0
- package/dist/util/git-safety.js +94 -0
- package/dist/util/git-safety.js.map +1 -0
- package/dist/workspace/dataplane-adapter.d.ts +260 -0
- package/dist/workspace/dataplane-adapter.d.ts.map +1 -0
- package/dist/workspace/dataplane-adapter.js +416 -0
- package/dist/workspace/dataplane-adapter.js.map +1 -0
- package/dist/workspace/index.d.ts +0 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +0 -2
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/landing/direct-push.d.ts.map +1 -1
- package/dist/workspace/landing/direct-push.js +22 -7
- package/dist/workspace/landing/direct-push.js.map +1 -1
- package/dist/workspace/landing/queue-to-branch.d.ts.map +1 -1
- package/dist/workspace/landing/queue-to-branch.js +1 -3
- package/dist/workspace/landing/queue-to-branch.js.map +1 -1
- package/dist/workspace/types.d.ts +0 -13
- package/dist/workspace/types.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.d.ts +0 -11
- package/dist/workspace/workspace-manager.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.js +0 -30
- package/dist/workspace/workspace-manager.js.map +1 -1
- package/package.json +28 -2
- package/templates/teams/self-driving/prompts/grinder.md +1 -0
- package/templates/teams/self-driving/prompts/judge.md +1 -0
- package/templates/teams/self-driving/prompts/planner.md +1 -0
- package/templates/teams/self-driving/roles/grinder.yaml +15 -0
- package/templates/teams/self-driving/roles/judge.yaml +10 -0
- package/templates/teams/self-driving/roles/planner.yaml +16 -0
- package/.claude/commands/openspec/apply.md +0 -23
- package/.claude/commands/openspec/archive.md +0 -27
- package/.claude/commands/openspec/proposal.md +0 -28
- package/.claude/settings.json +0 -133
- package/.gitattributes +0 -3
- package/.opentasks/config.json +0 -9
- package/.opentasks/graph.jsonl +0 -0
- package/.sessionlog/settings.json +0 -4
- package/.sudocode/issues.jsonl +0 -183
- package/.sudocode/specs.jsonl +0 -56
- package/AGENTS.md +0 -18
- package/CLAUDE.md +0 -923
- package/docs/architecture.md +0 -508
- package/docs/configuration.md +0 -323
- package/docs/conflict-recovery.md +0 -472
- package/docs/design/task-dispatcher.md +0 -880
- package/docs/design-subsystem-extraction.md +0 -627
- package/docs/git-cascade-integration-gaps.md +0 -678
- package/docs/implementation-details.md +0 -1127
- package/docs/implementation-summary.md +0 -448
- package/docs/lifecycle-events-design.md +0 -111
- package/docs/mail-integration.md +0 -608
- package/docs/openhive-capability-summary.md +0 -415
- package/docs/openhive-integration.md +0 -415
- package/docs/plan-self-driving-support.md +0 -433
- package/docs/roadmap-v2-gaps.md +0 -216
- package/docs/spec-self-driving-support.md +0 -462
- package/docs/team-templates.md +0 -860
- package/docs/teams.md +0 -306
- package/docs/trigger-system-design.md +0 -333
- package/docs/troubleshooting.md +0 -489
- package/docs/workspace-interfaces.md +0 -731
- package/docs/workspace-redesign-plan.md +0 -302
- package/examples/distributed-peer-communication.ts +0 -202
- package/examples/local-peer-communication.ts +0 -165
- package/index.js +0 -2
- package/mvp_docs/agent-execution-system.md +0 -347
- package/mvp_docs/agent-interface.md +0 -580
- package/mvp_docs/data-structures.md +0 -701
- package/mvp_docs/dynamic-meta-orchestration.md +0 -116
- package/mvp_docs/multi-agent-interaction-design.md +0 -779
- package/mvp_docs/mvp-implementation-plan.md +0 -1148
- package/renovate.json5 +0 -6
- package/scripts/test-acp-integration.ts +0 -422
- package/src/__tests__/boot-v2.test.ts +0 -631
- package/src/__tests__/e2e/acp-over-map-live.e2e.test.ts +0 -496
- package/src/__tests__/e2e/acp-over-map.e2e.test.ts +0 -457
- package/src/__tests__/e2e/agent-lifecycle.e2e.test.ts +0 -770
- package/src/__tests__/e2e/auto-sync.e2e.test.ts +0 -257
- package/src/__tests__/e2e/bootstrap.e2e.test.ts +0 -319
- package/src/__tests__/e2e/cascade-rebase.e2e.test.ts +0 -254
- package/src/__tests__/e2e/cc-swarm-bridge.e2e.test.ts +0 -253
- package/src/__tests__/e2e/cli-run.e2e.test.ts +0 -167
- package/src/__tests__/e2e/cognitive-workspace.e2e.test.ts +0 -282
- package/src/__tests__/e2e/dispatch-coordination.e2e.test.ts +0 -495
- package/src/__tests__/e2e/dispatch-live.e2e.test.ts +0 -564
- package/src/__tests__/e2e/dispatch-opentasks.e2e.test.ts +0 -496
- package/src/__tests__/e2e/dispatch-phase2-live.e2e.test.ts +0 -456
- package/src/__tests__/e2e/dispatch-phase2.e2e.test.ts +0 -386
- package/src/__tests__/e2e/dispatch.e2e.test.ts +0 -376
- package/src/__tests__/e2e/done-scenarios.e2e.test.ts +0 -322
- package/src/__tests__/e2e/live-agent.e2e.test.ts +0 -1330
- package/src/__tests__/e2e/map-server.e2e.test.ts +0 -128
- package/src/__tests__/e2e/map-sidecar.e2e.test.ts +0 -139
- package/src/__tests__/e2e/opentasks-integration.e2e.test.ts +0 -280
- package/src/__tests__/e2e/pull-mode.e2e.test.ts +0 -632
- package/src/__tests__/e2e/resume-continue.e2e.test.ts +0 -312
- package/src/__tests__/e2e/self-driving-v3.e2e.test.ts +0 -197
- package/src/__tests__/e2e/spawn-resolver.e2e.test.ts +0 -200
- package/src/__tests__/e2e/swarmkit-integration.e2e.test.ts +0 -562
- package/src/__tests__/e2e/swarmkit-live.e2e.test.ts +0 -1049
- package/src/__tests__/e2e/trajectory-tracking.e2e.test.ts +0 -258
- package/src/__tests__/e2e/trigger-wake.e2e.test.ts +0 -257
- package/src/__tests__/e2e/workspace-lifecycle.e2e.test.ts +0 -383
- package/src/__tests__/e2e/workspace-v3.e2e.test.ts +0 -413
- package/src/acp/__tests__/claude-code-replay.test.ts +0 -225
- package/src/acp/__tests__/macro-agent.test.ts +0 -387
- package/src/acp/__tests__/session-mapper.test.ts +0 -152
- package/src/acp/__tests__/websocket-server.test.ts +0 -194
- package/src/acp/claude-code-replay.ts +0 -208
- package/src/acp/index.ts +0 -32
- package/src/acp/macro-agent.ts +0 -995
- package/src/acp/map-bridge.ts +0 -193
- package/src/acp/session-mapper.ts +0 -116
- package/src/acp/types.ts +0 -99
- package/src/acp/websocket-server.ts +0 -213
- package/src/adapters/__tests__/federation.test.ts +0 -256
- package/src/adapters/__tests__/inbox-adapter.test.ts +0 -316
- package/src/adapters/__tests__/tasks-adapter.test.ts +0 -270
- package/src/adapters/federation.ts +0 -185
- package/src/adapters/inbox-adapter.ts +0 -292
- package/src/adapters/inbox-client-adapter.ts +0 -173
- package/src/adapters/index.ts +0 -44
- package/src/adapters/opentasks-daemon.ts +0 -252
- package/src/adapters/tasks-adapter.ts +0 -330
- package/src/adapters/types.ts +0 -286
- package/src/agent/__tests__/agent-manager-topology.test.ts +0 -73
- package/src/agent/__tests__/agent-manager-v2.completion-signal.test.ts +0 -284
- package/src/agent/__tests__/agent-manager-v2.permission-interception.test.ts +0 -296
- package/src/agent/__tests__/agent-manager-v2.permissions.test.ts +0 -233
- package/src/agent/__tests__/agent-manager-v2.test.ts +0 -614
- package/src/agent/__tests__/agent-store.test.ts +0 -465
- package/src/agent/__tests__/task-ref-resolution.test.ts +0 -231
- package/src/agent/agent-manager-v2.ts +0 -2187
- package/src/agent/agent-manager.ts +0 -403
- package/src/agent/agent-store.ts +0 -409
- package/src/agent/index.ts +0 -7
- package/src/agent/prompts/coordinator-signals.ts +0 -115
- package/src/agent/prompts/index.ts +0 -7
- package/src/agent/system-prompt.ts +0 -298
- package/src/agent/types.ts +0 -480
- package/src/agent-detection/__tests__/command-builder.test.ts +0 -336
- package/src/agent-detection/__tests__/detector.test.ts +0 -768
- package/src/agent-detection/__tests__/registry.test.ts +0 -254
- package/src/agent-detection/command-builder.ts +0 -90
- package/src/agent-detection/detector.ts +0 -307
- package/src/agent-detection/index.ts +0 -36
- package/src/agent-detection/registry.ts +0 -200
- package/src/agent-detection/types.ts +0 -184
- package/src/api/__tests__/server.test.ts +0 -292
- package/src/api/index.ts +0 -8
- package/src/api/server.ts +0 -380
- package/src/api/types.ts +0 -39
- package/src/auth/__tests__/token.test.ts +0 -100
- package/src/auth/index.ts +0 -1
- package/src/auth/token.ts +0 -82
- package/src/boot-v2.ts +0 -1343
- package/src/cli/__tests__/stable-instance-id.test.ts +0 -57
- package/src/cli/acp.ts +0 -101
- package/src/cli/inbox-mcp-proxy.ts +0 -56
- package/src/cli/index.ts +0 -566
- package/src/cli/mcp.ts +0 -305
- package/src/cli/parse-args.ts +0 -54
- package/src/cli/stable-instance-id.ts +0 -14
- package/src/cognitive/__tests__/macro-agent-backend.test.ts +0 -673
- package/src/cognitive/__tests__/session-converter.test.ts +0 -423
- package/src/cognitive/__tests__/workspace-handler.test.ts +0 -221
- package/src/cognitive/analyst-role.ts +0 -59
- package/src/cognitive/index.ts +0 -49
- package/src/cognitive/macro-agent-backend.ts +0 -402
- package/src/cognitive/session-converter.ts +0 -151
- package/src/cognitive/types.ts +0 -187
- package/src/cognitive/workspace-handler.ts +0 -163
- package/src/config/index.ts +0 -9
- package/src/config/project-config.ts +0 -294
- package/src/control/__tests__/control-resilience.test.ts +0 -251
- package/src/control/__tests__/control-socket.test.ts +0 -240
- package/src/control/control-client.ts +0 -337
- package/src/control/control-server.ts +0 -298
- package/src/control/index.ts +0 -17
- package/src/control/types.ts +0 -95
- package/src/dispatch/CLAUDE.md +0 -129
- package/src/dispatch/__tests__/loadout-translation.test.ts +0 -141
- package/src/dispatch/__tests__/mail-inbound-consumer.integration.test.ts +0 -519
- package/src/dispatch/__tests__/mail-inbound-consumer.test.ts +0 -800
- package/src/dispatch/__tests__/mail-inbound-reuse-consumer.test.ts +0 -575
- package/src/dispatch/__tests__/permission-evaluator.test.ts +0 -196
- package/src/dispatch/__tests__/permission-overlay.test.ts +0 -56
- package/src/dispatch/__tests__/permissions-handler.test.ts +0 -168
- package/src/dispatch/__tests__/spawn-agent-handler.test.ts +0 -282
- package/src/dispatch/loadout-translation.ts +0 -138
- package/src/dispatch/mail-inbound-consumer.ts +0 -560
- package/src/dispatch/mail-inbound-reuse-consumer.ts +0 -479
- package/src/dispatch/permission-evaluator.ts +0 -191
- package/src/dispatch/permission-overlay.ts +0 -89
- package/src/dispatch/permissions-handler.ts +0 -112
- package/src/dispatch/spawn-agent-handler.ts +0 -160
- package/src/index.ts +0 -117
- package/src/integrations/__tests__/context-builder.test.ts +0 -218
- package/src/integrations/__tests__/sessionlog.test.ts +0 -498
- package/src/integrations/__tests__/skilltree.test.ts +0 -136
- package/src/integrations/context-builder.ts +0 -280
- package/src/integrations/sessionlog.ts +0 -194
- package/src/integrations/skilltree.ts +0 -184
- package/src/lifecycle/__tests__/cascade-consolidation.test.ts +0 -240
- package/src/lifecycle/__tests__/handlers-v2.test.ts +0 -565
- package/src/lifecycle/cascade.ts +0 -335
- package/src/lifecycle/cleanup.ts +0 -373
- package/src/lifecycle/handlers-v2.ts +0 -508
- package/src/lifecycle/index.ts +0 -76
- package/src/lifecycle/types.ts +0 -260
- package/src/map/__tests__/cascade-bridge.test.ts +0 -229
- package/src/map/__tests__/cascade-diff-server.test.ts +0 -434
- package/src/map/__tests__/emit-event.test.ts +0 -71
- package/src/map/__tests__/lifecycle-bridge.test.ts +0 -430
- package/src/map/__tests__/mail-bridge.test.ts +0 -321
- package/src/map/__tests__/permission-forwarding.test.ts +0 -143
- package/src/map/__tests__/sidecar-diff-install-smoke.test.ts +0 -90
- package/src/map/__tests__/sidecar-integration.test.ts +0 -190
- package/src/map/__tests__/task-bridge.test.ts +0 -153
- package/src/map/__tests__/trajectory-reporter.test.ts +0 -173
- package/src/map/acp-bridge.ts +0 -293
- package/src/map/cascade-action-handler.ts +0 -205
- package/src/map/cascade-bridge.ts +0 -339
- package/src/map/cascade-diff-server.ts +0 -404
- package/src/map/cc-swarm-hooks.ts +0 -242
- package/src/map/coordination-handler.ts +0 -232
- package/src/map/index.ts +0 -18
- package/src/map/lifecycle-bridge.ts +0 -236
- package/src/map/mail-bridge.ts +0 -263
- package/src/map/repo-workspace.ts +0 -82
- package/src/map/server.ts +0 -758
- package/src/map/sidecar.ts +0 -826
- package/src/map/task-bridge.ts +0 -89
- package/src/map/trajectory-reporter.ts +0 -124
- package/src/map/types.ts +0 -304
- package/src/mcp/__tests__/mcp-server-v2.test.ts +0 -236
- package/src/mcp/index.ts +0 -6
- package/src/mcp/mcp-server-v2.ts +0 -485
- package/src/mcp/tools/done-v2.ts +0 -213
- package/src/mcp/types.ts +0 -432
- package/src/metrics/__tests__/metrics.test.ts +0 -205
- package/src/metrics/index.ts +0 -13
- package/src/metrics/metrics.ts +0 -151
- package/src/metrics/types.ts +0 -63
- package/src/roles/__tests__/config-loader.test.ts +0 -540
- package/src/roles/builtin/coordinator.ts +0 -75
- package/src/roles/builtin/generic.ts +0 -39
- package/src/roles/builtin/index.ts +0 -51
- package/src/roles/builtin/integrator.ts +0 -62
- package/src/roles/builtin/monitor.ts +0 -65
- package/src/roles/builtin/worker.ts +0 -134
- package/src/roles/capabilities.ts +0 -257
- package/src/roles/config-loader.ts +0 -405
- package/src/roles/index.ts +0 -141
- package/src/roles/registry.ts +0 -713
- package/src/roles/types.ts +0 -344
- package/src/store/index.ts +0 -8
- package/src/store/types/agents.ts +0 -69
- package/src/store/types/events.ts +0 -91
- package/src/store/types/index.ts +0 -9
- package/src/store/types/messages.ts +0 -32
- package/src/store/types/primitives.ts +0 -9
- package/src/store/types/tasks.ts +0 -124
- package/src/teams/__tests__/team-manager-v2.test.ts +0 -425
- package/src/teams/__tests__/team-runtime-v2.test.ts +0 -402
- package/src/teams/index.ts +0 -29
- package/src/teams/seed-defaults.ts +0 -83
- package/src/teams/team-loader.ts +0 -476
- package/src/teams/team-manager-v2.ts +0 -343
- package/src/teams/team-runtime-v2.ts +0 -943
- package/src/teams/types.ts +0 -276
- package/src/trigger/__tests__/cron-service.test.ts +0 -548
- package/src/trigger/__tests__/scheduler.test.ts +0 -371
- package/src/trigger/__tests__/system-event-queue.test.ts +0 -147
- package/src/trigger/__tests__/trigger-system-v2.test.ts +0 -257
- package/src/trigger/__tests__/wake-manager.test.ts +0 -356
- package/src/trigger/__tests__/webhook-handler.test.ts +0 -567
- package/src/trigger/index.ts +0 -110
- package/src/trigger/queue/index.ts +0 -21
- package/src/trigger/queue/system-event-queue.ts +0 -232
- package/src/trigger/queue/types.ts +0 -149
- package/src/trigger/sources/cron/cron-service.ts +0 -499
- package/src/trigger/sources/cron/index.ts +0 -41
- package/src/trigger/sources/cron/scheduler.ts +0 -344
- package/src/trigger/sources/cron/types.ts +0 -333
- package/src/trigger/sources/index.ts +0 -10
- package/src/trigger/sources/webhook/index.ts +0 -25
- package/src/trigger/sources/webhook/types.ts +0 -205
- package/src/trigger/sources/webhook/webhook-handler.ts +0 -410
- package/src/trigger/strategies/ai-router.ts +0 -170
- package/src/trigger/trigger-system-v2.ts +0 -536
- package/src/trigger/types.ts +0 -228
- package/src/trigger/wake/index.ts +0 -22
- package/src/trigger/wake/types.ts +0 -162
- package/src/trigger/wake/wake-manager.ts +0 -390
- package/src/workspace/__tests__/git-cascade-adapter.test.ts +0 -563
- package/src/workspace/__tests__/land-dispatch.test.ts +0 -214
- package/src/workspace/__tests__/self-driving-yaml.test.ts +0 -122
- package/src/workspace/__tests__/shared-worktree-refcount.test.ts +0 -154
- package/src/workspace/__tests__/standalone-mode.test.ts +0 -118
- package/src/workspace/__tests__/workspace-manager-v3.test.ts +0 -245
- package/src/workspace/__tests__/yaml-schema.test.ts +0 -210
- package/src/workspace/config.ts +0 -165
- package/src/workspace/git-cascade-adapter.ts +0 -1213
- package/src/workspace/index.ts +0 -110
- package/src/workspace/landing/__tests__/strategies.test.ts +0 -184
- package/src/workspace/landing/direct-push.ts +0 -91
- package/src/workspace/landing/index.ts +0 -40
- package/src/workspace/landing/merge-to-parent.ts +0 -229
- package/src/workspace/landing/optimistic-push.ts +0 -36
- package/src/workspace/landing/queue-to-branch.ts +0 -108
- package/src/workspace/merge-queue/__tests__/conflict-resolution-git.e2e.test.ts +0 -641
- package/src/workspace/merge-queue/__tests__/conflict-resolution.test.ts +0 -707
- package/src/workspace/merge-queue/__tests__/merge-queue-concurrent.test.ts +0 -628
- package/src/workspace/merge-queue/__tests__/merge-queue-edge-cases.test.ts +0 -1217
- package/src/workspace/merge-queue/__tests__/merge-queue.test.ts +0 -506
- package/src/workspace/merge-queue/__tests__/real-git-operations.e2e.test.ts +0 -556
- package/src/workspace/merge-queue/__tests__/resolver-flow.test.ts +0 -472
- package/src/workspace/merge-queue/index.ts +0 -38
- package/src/workspace/merge-queue/merge-queue.ts +0 -585
- package/src/workspace/merge-queue/schema.ts +0 -98
- package/src/workspace/merge-queue/types.ts +0 -316
- package/src/workspace/pool/__tests__/worktree-pool.integration.test.ts +0 -1281
- package/src/workspace/pool/__tests__/worktree-pool.test.ts +0 -590
- package/src/workspace/pool/index.ts +0 -26
- package/src/workspace/pool/types.ts +0 -276
- package/src/workspace/pool/worktree-pool.ts +0 -659
- package/src/workspace/recovery/__tests__/auto-resolve-integration.test.ts +0 -127
- package/src/workspace/recovery/__tests__/spawn-resolver.test.ts +0 -139
- package/src/workspace/recovery/__tests__/strategies.test.ts +0 -145
- package/src/workspace/recovery/abandon.ts +0 -51
- package/src/workspace/recovery/auto-resolve.ts +0 -119
- package/src/workspace/recovery/defer.ts +0 -23
- package/src/workspace/recovery/escalate.ts +0 -30
- package/src/workspace/recovery/index.ts +0 -58
- package/src/workspace/recovery/spawn-resolver.ts +0 -152
- package/src/workspace/recovery/types.ts +0 -54
- package/src/workspace/strategies/index.ts +0 -18
- package/src/workspace/strategies/optimistic.ts +0 -139
- package/src/workspace/strategies/queue.ts +0 -81
- package/src/workspace/strategies/registry.ts +0 -89
- package/src/workspace/strategies/trunk.ts +0 -123
- package/src/workspace/strategies/types.ts +0 -145
- package/src/workspace/topology/__tests__/yaml-driven.test.ts +0 -345
- package/src/workspace/topology/index.ts +0 -18
- package/src/workspace/topology/no-workspace.ts +0 -39
- package/src/workspace/topology/types.ts +0 -116
- package/src/workspace/topology/yaml-driven.ts +0 -316
- package/src/workspace/types-v3.ts +0 -162
- package/src/workspace/types.ts +0 -541
- package/src/workspace/workspace-manager.ts +0 -1577
- package/src/workspace/yaml-schema.ts +0 -216
- package/test_fixtures/README.md +0 -425
- package/test_fixtures/fixtures/behaviors/coordinators.ts +0 -196
- package/test_fixtures/fixtures/behaviors/index.ts +0 -62
- package/test_fixtures/fixtures/behaviors/integrators.ts +0 -143
- package/test_fixtures/fixtures/behaviors/monitors.ts +0 -199
- package/test_fixtures/fixtures/behaviors/workers.ts +0 -348
- package/test_fixtures/fixtures/index.ts +0 -7
- package/test_fixtures/fixtures/projects/index.ts +0 -23
- package/test_fixtures/fixtures/projects/project-with-specs.ts +0 -44
- package/test_fixtures/fixtures/projects/typescript-project.ts +0 -200
- package/test_fixtures/fixtures/repos/index.ts +0 -6
- package/test_fixtures/fixtures/repos/temp-repo-factory.ts +0 -299
- package/test_fixtures/fixtures/repos/types.ts +0 -174
- package/test_fixtures/harness/assertions/harness-assertions.ts +0 -752
- package/test_fixtures/harness/assertions/index.ts +0 -8
- package/test_fixtures/harness/index.ts +0 -15
- package/test_fixtures/harness/simulator/agent-simulator.ts +0 -768
- package/test_fixtures/harness/simulator/behavior-executor.ts +0 -580
- package/test_fixtures/harness/simulator/index.ts +0 -14
- package/test_fixtures/harness/simulator/types.ts +0 -459
- package/test_fixtures/harness/test-harness.ts +0 -770
- package/test_fixtures/harness/timing/event-stepper.ts +0 -344
- package/test_fixtures/harness/timing/index.ts +0 -8
- package/tsconfig.json +0 -21
- package/vitest.config.ts +0 -30
- package/vitest.e2e.config.ts +0 -28
- package/vitest.setup.ts +0 -12
|
@@ -1,731 +0,0 @@
|
|
|
1
|
-
# Workspace Interfaces (Draft)
|
|
2
|
-
|
|
3
|
-
Concrete TypeScript sketches for the redesigned workspace layer described in `docs/git-cascade-integration-gaps.md`. This file is the interface contract; the narrative doc is the rationale.
|
|
4
|
-
|
|
5
|
-
**Status**: draft for iteration. Not yet implemented. Not yet ported to call sites.
|
|
6
|
-
|
|
7
|
-
Three things are defined here:
|
|
8
|
-
|
|
9
|
-
1. **`WorkspaceManager`** — stream-first API that sits above git-cascade. Used by programmatic consumers (cognitive-core), TopologyPolicy compilers, and MCP tool handlers.
|
|
10
|
-
2. **`TopologyPolicy`** — compiles team YAML (`macro_agent.workspace`) into spawn-time workspace decisions and lifecycle hooks. The compiler is the only thing that reads YAML; everything downstream sees resolved policy objects.
|
|
11
|
-
3. **`LandingStrategy`** — pluggable landing algorithm. Strategies register globally; YAML role config picks which strategy each stream uses.
|
|
12
|
-
|
|
13
|
-
Plus supporting surfaces:
|
|
14
|
-
|
|
15
|
-
- **YAML Zod schema** for `macro_agent.workspace` validation.
|
|
16
|
-
- **MCP tool schemas** for agent-facing workspace tools.
|
|
17
|
-
- **Built-in registrations** (5 landing strategies, 5 topology policies).
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 1. Core primitives
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
// Identity types
|
|
25
|
-
export type AgentId = string;
|
|
26
|
-
export type StreamId = string;
|
|
27
|
-
export type ChangeId = string;
|
|
28
|
-
export type QueueEntryId = string;
|
|
29
|
-
|
|
30
|
-
// Pseudo-principals for entities that aren't real agents (team roots, system owners).
|
|
31
|
-
// Tagged via prefix; never terminates.
|
|
32
|
-
export type PseudoAgentId =
|
|
33
|
-
| `team:${string}`
|
|
34
|
-
| `system:${string}`;
|
|
35
|
-
|
|
36
|
-
export type Principal = AgentId | PseudoAgentId;
|
|
37
|
-
|
|
38
|
-
export const isPseudo = (p: Principal): p is PseudoAgentId =>
|
|
39
|
-
p.startsWith("team:") || p.startsWith("system:");
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## 2. Stream & worktree types
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
export type StreamStatus = "active" | "merged" | "abandoned" | "conflicted" | "paused";
|
|
48
|
-
|
|
49
|
-
export interface Stream {
|
|
50
|
-
id: StreamId;
|
|
51
|
-
name: string;
|
|
52
|
-
ownerId: Principal;
|
|
53
|
-
parentStreamId?: StreamId;
|
|
54
|
-
baseCommit: string;
|
|
55
|
-
branch: string;
|
|
56
|
-
status: StreamStatus;
|
|
57
|
-
metadata: Record<string, unknown>;
|
|
58
|
-
createdAt: number;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export interface StreamNode {
|
|
62
|
-
stream: Stream;
|
|
63
|
-
children: StreamNode[];
|
|
64
|
-
activeTaskCount: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface Change {
|
|
68
|
-
id: ChangeId;
|
|
69
|
-
streamId: StreamId;
|
|
70
|
-
currentCommit: string;
|
|
71
|
-
historicalCommits: string[];
|
|
72
|
-
status: "active" | "merged" | "dropped";
|
|
73
|
-
createdAt: number;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface StreamSpec {
|
|
77
|
-
name: string;
|
|
78
|
-
ownerId: Principal;
|
|
79
|
-
parent?: StreamId; // fork from this stream (takes precedence)
|
|
80
|
-
forkFrom?: string; // otherwise fork from this branch
|
|
81
|
-
metadata?: Record<string, unknown>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface Worktree {
|
|
85
|
-
agentId: Principal;
|
|
86
|
-
path: string;
|
|
87
|
-
streamId?: StreamId; // worktrees may be detached
|
|
88
|
-
branch: string;
|
|
89
|
-
pooled: boolean;
|
|
90
|
-
sharedWithAgents: AgentId[]; // ref-counted shares
|
|
91
|
-
createdAt: number;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface AllocateWorktreeOpts {
|
|
95
|
-
agentId: Principal;
|
|
96
|
-
streamId?: StreamId;
|
|
97
|
-
baseDir?: string;
|
|
98
|
-
pooled?: boolean;
|
|
99
|
-
sharedWithAgent?: AgentId; // if set, co-locates on that agent's worktree; ref-counted
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## 3. Results & conflict types
|
|
106
|
-
|
|
107
|
-
```ts
|
|
108
|
-
export type ConflictStrategy = "abort" | "ours" | "theirs" | "defer" | "agent";
|
|
109
|
-
export type CascadeStrategy = "stop_on_conflict" | "skip_conflicting" | "defer_conflicts";
|
|
110
|
-
|
|
111
|
-
export interface MergeResult {
|
|
112
|
-
success: boolean;
|
|
113
|
-
mergeCommit?: string;
|
|
114
|
-
changeIds?: ChangeId[];
|
|
115
|
-
conflictId?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export interface RebaseResult {
|
|
119
|
-
success: boolean;
|
|
120
|
-
rebasedCommits?: string[];
|
|
121
|
-
conflictId?: string;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export interface CascadeResult {
|
|
125
|
-
rootStreamId: StreamId;
|
|
126
|
-
succeeded: StreamId[];
|
|
127
|
-
failed: Array<{ streamId: StreamId; conflictId?: string; error?: string }>;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface ConflictRecord {
|
|
131
|
-
id: string;
|
|
132
|
-
streamId: StreamId;
|
|
133
|
-
sourceCommit?: string;
|
|
134
|
-
targetCommit?: string;
|
|
135
|
-
paths: string[];
|
|
136
|
-
createdAt: number;
|
|
137
|
-
resolvedAt?: number;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export interface ReconcileResult {
|
|
141
|
-
streamsChecked: number;
|
|
142
|
-
streamsFixed: number;
|
|
143
|
-
worktreesOrphaned: number;
|
|
144
|
-
worktreesCleaned: number;
|
|
145
|
-
poolEntriesPurged: number;
|
|
146
|
-
errors: Array<{ context: string; message: string }>;
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## 4. Events
|
|
153
|
-
|
|
154
|
-
All three control layers (YAML-compiled, MCP tools, programmatic) emit the same stream.
|
|
155
|
-
|
|
156
|
-
```ts
|
|
157
|
-
export type WorkspaceEvent =
|
|
158
|
-
| { kind: "stream.created"; streamId: StreamId; ownerId: Principal; parentStreamId?: StreamId }
|
|
159
|
-
| { kind: "stream.committed"; streamId: StreamId; commit: string; changeId: ChangeId; agentId: Principal }
|
|
160
|
-
| { kind: "stream.merged"; sourceStreamId: StreamId; targetStreamId: StreamId; mergeCommit: string }
|
|
161
|
-
| { kind: "stream.conflicted"; streamId: StreamId; conflictId: string }
|
|
162
|
-
| { kind: "stream.abandoned"; streamId: StreamId; reason?: string }
|
|
163
|
-
| { kind: "stream.paused"; streamId: StreamId; reason?: string }
|
|
164
|
-
| { kind: "stream.resumed"; streamId: StreamId }
|
|
165
|
-
| { kind: "worktree.allocated"; agentId: Principal; path: string; streamId?: StreamId }
|
|
166
|
-
| { kind: "worktree.deallocated"; agentId: Principal; path: string }
|
|
167
|
-
| { kind: "worktree.shared"; ownerAgentId: AgentId; sharingAgentId: AgentId; path: string }
|
|
168
|
-
| { kind: "landing.started"; agentId: AgentId; streamId: StreamId; strategyName: string }
|
|
169
|
-
| { kind: "landing.completed"; agentId: AgentId; streamId: StreamId; result: MergeResult | RebaseResult }
|
|
170
|
-
| { kind: "cascade.started"; rootStreamId: StreamId }
|
|
171
|
-
| { kind: "cascade.completed"; result: CascadeResult };
|
|
172
|
-
|
|
173
|
-
export type WorkspaceEventCallback = (e: WorkspaceEvent) => void;
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## 5. `WorkspaceManager` interface
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
export interface WorkspaceManager {
|
|
182
|
-
// ── Stream management ──────────────────────────────────────────
|
|
183
|
-
createStream(spec: StreamSpec): StreamId;
|
|
184
|
-
|
|
185
|
-
forkStream(opts: {
|
|
186
|
-
parentStreamId: StreamId;
|
|
187
|
-
name: string;
|
|
188
|
-
ownerId: Principal;
|
|
189
|
-
metadata?: Record<string, unknown>;
|
|
190
|
-
}): StreamId;
|
|
191
|
-
|
|
192
|
-
mergeStream(opts: {
|
|
193
|
-
sourceStreamId: StreamId;
|
|
194
|
-
targetStreamId: StreamId;
|
|
195
|
-
agentId: Principal;
|
|
196
|
-
worktree: string;
|
|
197
|
-
}): MergeResult;
|
|
198
|
-
|
|
199
|
-
syncWithParent(opts: {
|
|
200
|
-
streamId: StreamId;
|
|
201
|
-
agentId: Principal;
|
|
202
|
-
worktree: string;
|
|
203
|
-
onConflict?: ConflictStrategy;
|
|
204
|
-
}): RebaseResult;
|
|
205
|
-
|
|
206
|
-
rebaseOntoStream(opts: {
|
|
207
|
-
streamId: StreamId;
|
|
208
|
-
targetStreamId: StreamId;
|
|
209
|
-
agentId: Principal;
|
|
210
|
-
worktree: string;
|
|
211
|
-
onConflict?: ConflictStrategy;
|
|
212
|
-
}): RebaseResult;
|
|
213
|
-
|
|
214
|
-
cascadeRebase(opts: {
|
|
215
|
-
rootStreamId: StreamId;
|
|
216
|
-
strategy: CascadeStrategy;
|
|
217
|
-
worktreeProvider: (streamId: StreamId) => string | null;
|
|
218
|
-
}): CascadeResult;
|
|
219
|
-
|
|
220
|
-
abandonStream(streamId: StreamId, opts?: { cascade?: boolean; reason?: string }): void;
|
|
221
|
-
pauseStream(streamId: StreamId, reason?: string): void;
|
|
222
|
-
resumeStream(streamId: StreamId): void;
|
|
223
|
-
|
|
224
|
-
getStream(streamId: StreamId): Stream | null;
|
|
225
|
-
listStreams(filter?: { ownerId?: Principal; status?: StreamStatus; parentStreamId?: StreamId }): Stream[];
|
|
226
|
-
getStreamHierarchy(rootStreamId?: StreamId): StreamNode | StreamNode[];
|
|
227
|
-
getDependents(streamId: StreamId): StreamId[];
|
|
228
|
-
|
|
229
|
-
// ── Changes (Change-Id tracking) ───────────────────────────────
|
|
230
|
-
commitChanges(opts: {
|
|
231
|
-
agentId: Principal;
|
|
232
|
-
streamId: StreamId;
|
|
233
|
-
worktree: string;
|
|
234
|
-
message: string;
|
|
235
|
-
}): { commit: string; changeId: ChangeId };
|
|
236
|
-
|
|
237
|
-
markChangesMerged(changeIds: ChangeId[]): void;
|
|
238
|
-
getChange(changeId: ChangeId): Change | null;
|
|
239
|
-
getChangeByCommit(commit: string): Change | null;
|
|
240
|
-
|
|
241
|
-
// ── Worktree management ────────────────────────────────────────
|
|
242
|
-
allocateWorktree(opts: AllocateWorktreeOpts): Worktree;
|
|
243
|
-
deallocateWorktree(agentId: Principal): void;
|
|
244
|
-
getWorktreeForAgent(agentId: Principal): Worktree | null;
|
|
245
|
-
listWorktrees(): Worktree[];
|
|
246
|
-
|
|
247
|
-
// ── Conflicts ──────────────────────────────────────────────────
|
|
248
|
-
getConflictForStream(streamId: StreamId): ConflictRecord | null;
|
|
249
|
-
resolveConflict(opts: { conflictId: string; resolvedBy: Principal; resolutionCommit?: string }): void;
|
|
250
|
-
|
|
251
|
-
// ── Landing ────────────────────────────────────────────────────
|
|
252
|
-
registerLandingStrategy(strategy: LandingStrategy): void;
|
|
253
|
-
unregisterLandingStrategy(name: string): void;
|
|
254
|
-
getLandingStrategy(name: string): LandingStrategy | null;
|
|
255
|
-
|
|
256
|
-
land(opts: {
|
|
257
|
-
agentId: AgentId;
|
|
258
|
-
streamId: StreamId;
|
|
259
|
-
strategyName?: string;
|
|
260
|
-
targetStreamId?: StreamId;
|
|
261
|
-
strategyConfig?: Record<string, unknown>;
|
|
262
|
-
}): Promise<MergeResult>;
|
|
263
|
-
|
|
264
|
-
// ── Merge queue (delegates to git-cascade's built-in) ──────────
|
|
265
|
-
addToMergeQueue(opts: {
|
|
266
|
-
streamId: StreamId;
|
|
267
|
-
targetBranch: string;
|
|
268
|
-
priority?: number;
|
|
269
|
-
}): QueueEntryId;
|
|
270
|
-
|
|
271
|
-
getNextToMerge(targetBranch?: string): MergeQueueEntry | null;
|
|
272
|
-
markMergeQueueReady(entryId: QueueEntryId): void;
|
|
273
|
-
cancelMergeQueueEntry(entryId: QueueEntryId): void;
|
|
274
|
-
getMergeQueuePosition(streamId: StreamId, targetBranch?: string): number | null;
|
|
275
|
-
|
|
276
|
-
// ── Reconciliation & health ────────────────────────────────────
|
|
277
|
-
reconcile(): ReconcileResult;
|
|
278
|
-
healthCheck(): HealthCheckResult;
|
|
279
|
-
|
|
280
|
-
// ── Events ─────────────────────────────────────────────────────
|
|
281
|
-
onEvent(cb: WorkspaceEventCallback): () => void;
|
|
282
|
-
|
|
283
|
-
// ── Lifecycle ──────────────────────────────────────────────────
|
|
284
|
-
close(): void;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export interface MergeQueueEntry {
|
|
288
|
-
id: QueueEntryId;
|
|
289
|
-
streamId: StreamId;
|
|
290
|
-
targetBranch: string;
|
|
291
|
-
status: "pending" | "ready" | "in_progress" | "merged" | "cancelled" | "failed";
|
|
292
|
-
priority: number;
|
|
293
|
-
submittedAt: number;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export interface HealthCheckResult {
|
|
297
|
-
streamsActive: number;
|
|
298
|
-
streamsArchived: number;
|
|
299
|
-
agentsActive: number;
|
|
300
|
-
staleLocks: number;
|
|
301
|
-
incompleteOperations: number;
|
|
302
|
-
orphanedConflicts: number;
|
|
303
|
-
orphanedWorktrees: number;
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## 6. `LandingStrategy` interface
|
|
310
|
-
|
|
311
|
-
```ts
|
|
312
|
-
export interface LandingContext {
|
|
313
|
-
agentId: AgentId;
|
|
314
|
-
streamId: StreamId;
|
|
315
|
-
sourceWorktree: string;
|
|
316
|
-
targetStreamId?: StreamId;
|
|
317
|
-
strategyConfig?: Record<string, unknown>; // from YAML `landing_config`
|
|
318
|
-
workspaceManager: WorkspaceManager;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export interface LandingStrategy {
|
|
322
|
-
readonly name: string;
|
|
323
|
-
|
|
324
|
-
// Optional: strategy decides if it applies given the context
|
|
325
|
-
canLand?(ctx: LandingContext): boolean;
|
|
326
|
-
|
|
327
|
-
// Execute the landing
|
|
328
|
-
land(ctx: LandingContext): Promise<MergeResult>;
|
|
329
|
-
|
|
330
|
-
// Optional lifecycle hooks
|
|
331
|
-
initialize?(): Promise<void>;
|
|
332
|
-
close?(): Promise<void>;
|
|
333
|
-
}
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### 6.1 Built-in strategies
|
|
337
|
-
|
|
338
|
-
```ts
|
|
339
|
-
// merge-to-parent: merge sourceStream → targetStream (or parent of source).
|
|
340
|
-
// On success: optionally cascadeRebase if strategyConfig.cascade === true.
|
|
341
|
-
// Used by: peer swarm, long-lived feature, solo stack.
|
|
342
|
-
|
|
343
|
-
// queue-to-branch: add to merge queue; return immediately. Actual merge is drained
|
|
344
|
-
// by an integrator-capable agent calling processMergeQueue / merge_stream.
|
|
345
|
-
// strategyConfig: { target: "stream:<id>" | "branch:<name>" | "role:<role>" }.
|
|
346
|
-
// Used by: triad (workers), pipeline (coders).
|
|
347
|
-
|
|
348
|
-
// cherry-pick-stack: createStackFromStream + cherryPickStackToTarget. Preserves
|
|
349
|
-
// commit identity via Change-Ids. strategyConfig: { target_branch: string }.
|
|
350
|
-
// Used by: stacked-diff review workflows.
|
|
351
|
-
|
|
352
|
-
// direct-push: rebase onto target + push. Raw execSync (current trunk strategy).
|
|
353
|
-
// strategyConfig: { target_branch: string; max_retries?: number }.
|
|
354
|
-
// Used by: trunk-based flows without a merge queue.
|
|
355
|
-
|
|
356
|
-
// optimistic-push: direct-push + emit `validation:requested` event.
|
|
357
|
-
// Validation delegated to a judge role.
|
|
358
|
-
// Used by: self-driving team today.
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
Strategy registration happens once at boot; all 5 are registered by default. Teams pick via YAML `landing: <strategy_name>`.
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
## 7. `TopologyPolicy` interface
|
|
366
|
-
|
|
367
|
-
```ts
|
|
368
|
-
export interface TopologyPolicy {
|
|
369
|
-
readonly name: string;
|
|
370
|
-
|
|
371
|
-
onTeamStart(ctx: TeamStartContext): Promise<TeamStartPlan>;
|
|
372
|
-
onAgentSpawn(ctx: SpawnContext): Promise<WorkspaceDecision>;
|
|
373
|
-
onAgentComplete(ctx: AgentCompleteContext): Promise<void>;
|
|
374
|
-
onTeamStop(ctx: TeamStopContext): Promise<void>;
|
|
375
|
-
|
|
376
|
-
// Optional: subscribed if the topology cares about parent stream updates
|
|
377
|
-
onParentStreamAdvanced?(ctx: ParentAdvancedContext): Promise<void>;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
export interface TeamStartContext {
|
|
381
|
-
teamName: string;
|
|
382
|
-
teamId: string; // instance id
|
|
383
|
-
manifest: TeamManifest; // openteams-resolved
|
|
384
|
-
workspaceConfig: TeamWorkspaceConfig; // macro-agent's Zod-validated section
|
|
385
|
-
workspaceManager: WorkspaceManager;
|
|
386
|
-
inboxAdapter: InboxAdapter;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
export interface TeamStartPlan {
|
|
390
|
-
teamStreamId?: StreamId; // the team's root stream if created
|
|
391
|
-
additionalStreams?: StreamId[];
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export interface SpawnContext {
|
|
395
|
-
agentId: AgentId;
|
|
396
|
-
role: string;
|
|
397
|
-
roleConfig: RoleWorkspaceConfig; // parsed YAML for this role
|
|
398
|
-
parent?: AgentId;
|
|
399
|
-
parentStreamId?: StreamId;
|
|
400
|
-
teamStreamId?: StreamId;
|
|
401
|
-
workspaceManager: WorkspaceManager;
|
|
402
|
-
options: SpawnAgentOptions;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
export type WorkspaceDecision =
|
|
406
|
-
| { kind: "none" }
|
|
407
|
-
| { kind: "share-parent-cwd" }
|
|
408
|
-
| { kind: "share-with-agent"; agentId: AgentId; worktreeRole?: "read" | "write" }
|
|
409
|
-
| { kind: "attach-to-stream"; streamId: StreamId; worktree: WorktreeOpts }
|
|
410
|
-
| { kind: "new-stream"; streamSpec: StreamSpec; worktree: WorktreeOpts };
|
|
411
|
-
|
|
412
|
-
export interface WorktreeOpts {
|
|
413
|
-
baseDir?: string;
|
|
414
|
-
pooled?: boolean;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
export interface AgentCompleteContext {
|
|
418
|
-
agentId: AgentId;
|
|
419
|
-
role: string;
|
|
420
|
-
reason: "completed" | "failed" | "cascade" | "interrupted";
|
|
421
|
-
streamId?: StreamId;
|
|
422
|
-
workspaceManager: WorkspaceManager;
|
|
423
|
-
landingResult?: MergeResult;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export interface TeamStopContext {
|
|
427
|
-
teamName: string;
|
|
428
|
-
teamStreamId?: StreamId;
|
|
429
|
-
onTeamComplete: "keep" | "merge_to_main" | "abandon";
|
|
430
|
-
workspaceManager: WorkspaceManager;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
export interface ParentAdvancedContext {
|
|
434
|
-
parentStreamId: StreamId;
|
|
435
|
-
childStreamIds: StreamId[];
|
|
436
|
-
workspaceManager: WorkspaceManager;
|
|
437
|
-
triggerSystem: TriggerSystemV2;
|
|
438
|
-
}
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
### 7.1 Built-in topology policies
|
|
442
|
-
|
|
443
|
-
```ts
|
|
444
|
-
// YamlDrivenTopology: the default. Compiles TeamWorkspaceConfig into
|
|
445
|
-
// per-spawn decisions by looking up role config. Covers peer-swarm,
|
|
446
|
-
// triad, pipeline, research, long-lived, solo-stack via YAML alone.
|
|
447
|
-
|
|
448
|
-
// CognitiveCoreTopology: minimal policy for cognitive-core's analyst
|
|
449
|
-
// workflow; spawns analysts with no stream, allocates detached worktrees.
|
|
450
|
-
// Skips YAML; configured programmatically.
|
|
451
|
-
|
|
452
|
-
// NoWorkspaceTopology: returns { kind: "none" } for everything. Used when
|
|
453
|
-
// no workspace is needed but the team still needs structured spawning.
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
`YamlDrivenTopology` is the primary; the others are escape hatches for library consumers.
|
|
457
|
-
|
|
458
|
-
---
|
|
459
|
-
|
|
460
|
-
## 8. YAML Zod schema (`macro_agent.workspace`)
|
|
461
|
-
|
|
462
|
-
```ts
|
|
463
|
-
import { z } from "zod";
|
|
464
|
-
|
|
465
|
-
export const StreamLineageSchema = z.enum([
|
|
466
|
-
"from_team_root", // attach to existing team root (no new stream)
|
|
467
|
-
"fork_from_team_root", // fork new stream off team root
|
|
468
|
-
"fork_from_parent", // fork new stream off spawner's stream
|
|
469
|
-
"independent", // fork new stream off main branch
|
|
470
|
-
"track_existing_branch",// track an existing branch (no new stream/<id>)
|
|
471
|
-
]);
|
|
472
|
-
|
|
473
|
-
export const LandingStrategyNameSchema = z.enum([
|
|
474
|
-
"merge_to_parent_stream",
|
|
475
|
-
"queue_to_branch",
|
|
476
|
-
"cherry_pick_stack",
|
|
477
|
-
"direct_push",
|
|
478
|
-
"optimistic_push",
|
|
479
|
-
"none",
|
|
480
|
-
]);
|
|
481
|
-
|
|
482
|
-
export const ConflictStrategySchema = z.enum(["abort", "ours", "theirs", "defer", "agent"]);
|
|
483
|
-
|
|
484
|
-
export const WorkspaceKindSchema = z.enum([
|
|
485
|
-
"new_stream",
|
|
486
|
-
"attach_to_team_root",
|
|
487
|
-
"share_with_agent",
|
|
488
|
-
"share_parent_cwd",
|
|
489
|
-
"none",
|
|
490
|
-
]);
|
|
491
|
-
|
|
492
|
-
export const AllocationSchema = z.enum([
|
|
493
|
-
"new_worktree",
|
|
494
|
-
"inherit_parent_cwd",
|
|
495
|
-
"pooled_worktree",
|
|
496
|
-
]);
|
|
497
|
-
|
|
498
|
-
export const OnParentAdvancedSchema = z.enum([
|
|
499
|
-
"sync_with_parent",
|
|
500
|
-
"none",
|
|
501
|
-
]);
|
|
502
|
-
|
|
503
|
-
export const OnTeamCompleteSchema = z.enum([
|
|
504
|
-
"keep",
|
|
505
|
-
"merge_to_main",
|
|
506
|
-
"abandon",
|
|
507
|
-
]);
|
|
508
|
-
|
|
509
|
-
export const RoleWorkspaceConfigSchema = z.object({
|
|
510
|
-
workspace: WorkspaceKindSchema,
|
|
511
|
-
stream_lineage: StreamLineageSchema.optional(),
|
|
512
|
-
allocation: AllocationSchema.optional(),
|
|
513
|
-
landing: LandingStrategyNameSchema.optional(),
|
|
514
|
-
landing_config: z.record(z.unknown()).optional(),
|
|
515
|
-
on_conflict: ConflictStrategySchema.optional(),
|
|
516
|
-
cascade_on_parent_update: z.boolean().optional(),
|
|
517
|
-
on_parent_advanced: OnParentAdvancedSchema.optional(),
|
|
518
|
-
share_with: z.string().optional(), // role name — for workspace: share_with_agent
|
|
519
|
-
track_branch: z.string().optional(), // branch name — for stream_lineage: track_existing_branch
|
|
520
|
-
}).superRefine((val, ctx) => {
|
|
521
|
-
if (val.workspace === "share_with_agent" && !val.share_with) {
|
|
522
|
-
ctx.addIssue({ code: "custom", message: "share_with is required when workspace=share_with_agent" });
|
|
523
|
-
}
|
|
524
|
-
if (val.stream_lineage === "track_existing_branch" && !val.track_branch) {
|
|
525
|
-
ctx.addIssue({ code: "custom", message: "track_branch is required when stream_lineage=track_existing_branch" });
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
|
|
529
|
-
export const PoolConfigSchema = z.object({
|
|
530
|
-
enabled: z.boolean().default(true),
|
|
531
|
-
max_size: z.number().default(10),
|
|
532
|
-
reuse_across_streams: z.boolean().default(false),
|
|
533
|
-
}).optional();
|
|
534
|
-
|
|
535
|
-
export const DefaultStreamSchema = z.object({
|
|
536
|
-
fork_from: z.string().default("main"),
|
|
537
|
-
name_template: z.string().default("{team}"),
|
|
538
|
-
change_id_tracking: z.boolean().default(true),
|
|
539
|
-
}).optional();
|
|
540
|
-
|
|
541
|
-
export const TeamWorkspaceConfigSchema = z.object({
|
|
542
|
-
default_stream: DefaultStreamSchema,
|
|
543
|
-
on_team_complete: OnTeamCompleteSchema.default("keep"),
|
|
544
|
-
pool: PoolConfigSchema,
|
|
545
|
-
roles: z.record(z.string(), RoleWorkspaceConfigSchema),
|
|
546
|
-
capabilities: z.record(z.string(), z.array(z.string())).optional(),
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
export type TeamWorkspaceConfig = z.infer<typeof TeamWorkspaceConfigSchema>;
|
|
550
|
-
export type RoleWorkspaceConfig = z.infer<typeof RoleWorkspaceConfigSchema>;
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
Loaded from `TeamManifest.macro_agent.workspace`. Validated once at team start; errors rejected loudly.
|
|
554
|
-
|
|
555
|
-
---
|
|
556
|
-
|
|
557
|
-
## 9. MCP tool schemas
|
|
558
|
-
|
|
559
|
-
Registered per-role based on capabilities in team YAML. Tool filtering already exists in `mcp-server-v2.ts` via `isToolAllowedForRole()`.
|
|
560
|
-
|
|
561
|
-
```ts
|
|
562
|
-
import { z } from "zod";
|
|
563
|
-
|
|
564
|
-
// ── Capability: workspace.commit ──────────────────────────────────
|
|
565
|
-
export const commitToolInput = z.object({
|
|
566
|
-
message: z.string().min(1),
|
|
567
|
-
});
|
|
568
|
-
// Handler: commitChanges({ agentId, streamId: ctx.streamId, worktree: ctx.cwd, message })
|
|
569
|
-
// → returns { commit, changeId }
|
|
570
|
-
|
|
571
|
-
// ── Capability: workspace.land ────────────────────────────────────
|
|
572
|
-
export const landToolInput = z.object({
|
|
573
|
-
strategy: z.string().optional(), // override role default
|
|
574
|
-
targetStreamId: z.string().optional(),
|
|
575
|
-
strategyConfig: z.record(z.unknown()).optional(),
|
|
576
|
-
});
|
|
577
|
-
// Handler: workspaceManager.land({ agentId, streamId: ctx.streamId, ... })
|
|
578
|
-
|
|
579
|
-
// ── Capability: workspace.fork ────────────────────────────────────
|
|
580
|
-
export const forkStreamToolInput = z.object({
|
|
581
|
-
name: z.string().min(1),
|
|
582
|
-
parent: z.string().optional(), // defaults to current stream
|
|
583
|
-
});
|
|
584
|
-
// Handler: forkStream + allocateWorktree + implicitly moves agent's active stream
|
|
585
|
-
|
|
586
|
-
// ── Capability: workspace.sync ────────────────────────────────────
|
|
587
|
-
export const syncWithParentToolInput = z.object({
|
|
588
|
-
onConflict: ConflictStrategySchema.optional(),
|
|
589
|
-
});
|
|
590
|
-
// Handler: syncWithParent({ streamId: ctx.streamId, ... })
|
|
591
|
-
|
|
592
|
-
// ── Capability: workspace.merge ───────────────────────────────────
|
|
593
|
-
export const mergeStreamToolInput = z.object({
|
|
594
|
-
sourceStreamId: z.string(),
|
|
595
|
-
targetStreamId: z.string().optional(),
|
|
596
|
-
});
|
|
597
|
-
// Handler: mergeStream(...). For integrator roles draining queue.
|
|
598
|
-
|
|
599
|
-
// ── Capability: merge_queue.drain ─────────────────────────────────
|
|
600
|
-
export const nextMergeRequestToolInput = z.object({
|
|
601
|
-
targetBranch: z.string().optional(),
|
|
602
|
-
});
|
|
603
|
-
// Handler: getNextToMerge(targetBranch) + mark in_progress
|
|
604
|
-
|
|
605
|
-
export const markMergeCompleteToolInput = z.object({
|
|
606
|
-
entryId: z.string(),
|
|
607
|
-
mergeCommit: z.string().optional(),
|
|
608
|
-
success: z.boolean(),
|
|
609
|
-
error: z.string().optional(),
|
|
610
|
-
});
|
|
611
|
-
// Handler: updates queue entry state
|
|
612
|
-
|
|
613
|
-
// ── Capability: workspace.cascade ─────────────────────────────────
|
|
614
|
-
export const requestCascadeToolInput = z.object({
|
|
615
|
-
rootStreamId: z.string(),
|
|
616
|
-
strategy: z.enum(["stop_on_conflict", "skip_conflicting", "defer_conflicts"]).optional(),
|
|
617
|
-
});
|
|
618
|
-
// Handler: cascadeRebase({ rootStreamId, strategy, worktreeProvider })
|
|
619
|
-
|
|
620
|
-
// ── Capability: workspace.read (always available if role has any workspace cap) ─
|
|
621
|
-
export const streamStatusToolInput = z.object({
|
|
622
|
-
streamId: z.string().optional(), // defaults to agent's current stream
|
|
623
|
-
includeHierarchy: z.boolean().default(false),
|
|
624
|
-
});
|
|
625
|
-
// Handler: getStream + listStreams(filter) + optionally getStreamHierarchy
|
|
626
|
-
|
|
627
|
-
export const checkoutStreamToolInput = z.object({
|
|
628
|
-
streamId: z.string(),
|
|
629
|
-
});
|
|
630
|
-
// Handler: switches agent's active stream (for returning to parent after fork+land).
|
|
631
|
-
// Capability gate: workspace.fork OR workspace.sync.
|
|
632
|
-
```
|
|
633
|
-
|
|
634
|
-
### 9.1 Capability → tool mapping
|
|
635
|
-
|
|
636
|
-
| Capability | Tools registered |
|
|
637
|
-
|---|---|
|
|
638
|
-
| `workspace.commit` | `commit` |
|
|
639
|
-
| `workspace.land` | `land` |
|
|
640
|
-
| `workspace.fork` | `fork_stream`, `checkout_stream` |
|
|
641
|
-
| `workspace.sync` | `sync_with_parent` |
|
|
642
|
-
| `workspace.merge` | `merge_stream` |
|
|
643
|
-
| `workspace.cascade` | `request_cascade` |
|
|
644
|
-
| `workspace.read` | `stream_status` |
|
|
645
|
-
| `merge_queue.drain` | `next_merge_request`, `mark_merge_complete` |
|
|
646
|
-
|
|
647
|
-
---
|
|
648
|
-
|
|
649
|
-
## 10. Boot integration
|
|
650
|
-
|
|
651
|
-
```ts
|
|
652
|
-
// boot-v2.ts — new path
|
|
653
|
-
export async function bootV2(config: BootV2Config): Promise<MacroAgentSystemV2> {
|
|
654
|
-
// ... existing setup (agentStore, inbox, tasks, etc.) ...
|
|
655
|
-
|
|
656
|
-
// Load team config if provided
|
|
657
|
-
let teamManifest: TeamManifest | null = null;
|
|
658
|
-
let workspaceConfig: TeamWorkspaceConfig | null = null;
|
|
659
|
-
if (config.team) {
|
|
660
|
-
teamManifest = await loadTeamManifest(config.team);
|
|
661
|
-
const rawWorkspace = teamManifest.macro_agent?.workspace;
|
|
662
|
-
if (rawWorkspace) {
|
|
663
|
-
workspaceConfig = TeamWorkspaceConfigSchema.parse(rawWorkspace);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// Construct WorkspaceManager if any role needs one
|
|
668
|
-
let workspaceManager: WorkspaceManager | undefined;
|
|
669
|
-
if (workspaceConfig || config.workspaceManager) {
|
|
670
|
-
workspaceManager = config.workspaceManager ?? createDefaultWorkspaceManager({
|
|
671
|
-
repoPath: config.cwd,
|
|
672
|
-
pool: workspaceConfig?.pool,
|
|
673
|
-
});
|
|
674
|
-
|
|
675
|
-
// Register built-in landing strategies
|
|
676
|
-
registerBuiltinLandingStrategies(workspaceManager);
|
|
677
|
-
|
|
678
|
-
// Reconcile on boot
|
|
679
|
-
const reconcileResult = workspaceManager.reconcile();
|
|
680
|
-
logReconcile(reconcileResult);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
// Construct agent manager
|
|
684
|
-
const agentManager = createAgentManagerV2({
|
|
685
|
-
// ... existing args ...
|
|
686
|
-
workspaceManager,
|
|
687
|
-
});
|
|
688
|
-
|
|
689
|
-
// Construct topology policy
|
|
690
|
-
let topologyPolicy: TopologyPolicy | undefined;
|
|
691
|
-
if (workspaceConfig && workspaceManager) {
|
|
692
|
-
topologyPolicy = new YamlDrivenTopology(workspaceConfig);
|
|
693
|
-
agentManager.setTopologyPolicy(topologyPolicy);
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
// Start team if requested
|
|
697
|
-
if (config.team && teamManifest) {
|
|
698
|
-
const teamManager = new TeamManagerV2({
|
|
699
|
-
agentManager,
|
|
700
|
-
inboxAdapter,
|
|
701
|
-
tasksAdapter,
|
|
702
|
-
workspaceManager,
|
|
703
|
-
topologyPolicy,
|
|
704
|
-
});
|
|
705
|
-
await teamManager.startTeam(teamManifest);
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
// ... rest of boot ...
|
|
709
|
-
}
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
Callers like `cognitive-core` continue to pass their own `workspaceManager` and skip team YAML entirely — they drive the API directly.
|
|
713
|
-
|
|
714
|
-
---
|
|
715
|
-
|
|
716
|
-
## 11. Open gaps in this draft
|
|
717
|
-
|
|
718
|
-
- **`checkout_stream` semantics** — moves agent's *context* (streamId in spawn env), but does it relocate cwd or re-allocate worktree? Needs concrete decision when we implement solo-stack.
|
|
719
|
-
- **`attach-to-stream` worktree** — when workspace kind is `attach_to_team_root`, does the agent get a fresh worktree on team_root's branch, or share with whoever already has one? Default: fresh worktree on the team_root branch.
|
|
720
|
-
- **Conflict recovery hook** — no interface method on `WorkspaceManager` yet for "escalate conflict to recovery strategy." Probably a pluggable `ConflictRecoveryStrategy` parallel to `LandingStrategy`. Deferred.
|
|
721
|
-
- **cascadeRebase triggering from events** — `YamlDrivenTopology` subscribes to `stream.committed` on parent streams when any child has `on_parent_advanced: sync_with_parent`. Needs WakeManager integration for coalescing. Deferred to migration step.
|
|
722
|
-
- **Backward compat shim for cognitive-core** — the existing `DefaultWorkspaceManager` needs to implement both old and new interfaces during migration. TBD once we start migration.
|
|
723
|
-
|
|
724
|
-
---
|
|
725
|
-
|
|
726
|
-
## 12. What's not defined here
|
|
727
|
-
|
|
728
|
-
- **Implementation** of `DefaultWorkspaceManager` — this doc is the interface only.
|
|
729
|
-
- **Migration order** — see `git-cascade-integration-gaps.md` §8.
|
|
730
|
-
- **Conflict recovery strategy interface** — parallel design, out of scope.
|
|
731
|
-
- **cc-swarm integration** — separate follow-up doc.
|