macro-agent 0.2.4 → 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 +189 -67
- package/dist/agent/agent-manager-v2.js.map +1 -1
- package/dist/agent/agent-manager.d.ts +17 -0
- package/dist/agent/agent-manager.d.ts.map +1 -1
- package/dist/agent/agent-manager.js.map +1 -1
- package/dist/agent/types.d.ts +21 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.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/macro-agent-backend.d.ts.map +1 -1
- package/dist/cognitive/macro-agent-backend.js +37 -8
- package/dist/cognitive/macro-agent-backend.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/cognitive/types.d.ts +24 -0
- package/dist/cognitive/types.d.ts.map +1 -1
- 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 +5 -1
- 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/mail-bridge.d.ts +7 -0
- package/dist/map/mail-bridge.d.ts.map +1 -1
- package/dist/map/mail-bridge.js +39 -9
- package/dist/map/mail-bridge.js.map +1 -1
- 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 +31 -93
- 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/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.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 -2021
- package/src/agent/agent-manager.ts +0 -386
- 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 -459
- 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 -520
- 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 -370
- package/src/cognitive/session-converter.ts +0 -151
- package/src/cognitive/types.ts +0 -163
- 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 -115
- 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 -284
- 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 -215
- 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 -920
- 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,433 +0,0 @@
|
|
|
1
|
-
# Self-Driving Codebases Support
|
|
2
|
-
|
|
3
|
-
Plan for enabling macro-agent to support Cursor-style autonomous multi-agent workflows through a modular team template layer and a set of new primitives.
|
|
4
|
-
|
|
5
|
-
## Context
|
|
6
|
-
|
|
7
|
-
macro-agent currently provides a structured, correctness-oriented multi-agent orchestration system with four built-in roles (Worker, Integrator, Coordinator, Monitor), workspace isolation via git worktrees, a serialized merge queue, and push-based task assignment.
|
|
8
|
-
|
|
9
|
-
Cursor's ["Towards Self-Driving Codebases"](https://cursor.com/blog/self-driving-codebases) demonstrates a different paradigm: hundreds of agents running autonomously for weeks, committing directly to trunk, tolerating transient errors, and self-converging without centralized integration gates. Their system uses Planners (continuous exploration + task creation), Workers (pull tasks, grind, push), and Judges (periodic quality evaluation).
|
|
10
|
-
|
|
11
|
-
The goal is to enable macro-agent to support **both** paradigms — the existing structured mode and a self-driving mode — through a modular team template layer and a set of new primitives. macro-agent's core remains role-agnostic; the self-driving patterns are expressed as a loadable team configuration on top.
|
|
12
|
-
|
|
13
|
-
## Goals
|
|
14
|
-
|
|
15
|
-
1. **Team Templates**: A modular system for loading pre-configured agent team structures that define roles, spawn patterns, integration strategies, and coordination protocols — without modifying macro-agent core.
|
|
16
|
-
2. **Task Pull Model**: Primitives for agents to discover and claim available tasks, enabling decoupled planning/execution and elastic scaling.
|
|
17
|
-
3. **Pluggable Integration Strategies**: A strategy interface that the worker done() handler dispatches to, with built-in implementations for merge-queue, trunk-based, and optimistic integration — and the ability to register custom strategies.
|
|
18
|
-
4. **Session Continuations**: Persist agent session history so long-running agents can be resumed across process restarts, enabling multi-day autonomous operation.
|
|
19
|
-
5. **Autonomous Observability**: Metrics primitives for monitoring throughput, error rates, and convergence during long-running multi-agent runs.
|
|
20
|
-
|
|
21
|
-
## Non-Goals
|
|
22
|
-
|
|
23
|
-
- Rewriting the existing role system — team templates compose on top of it
|
|
24
|
-
- Building a full dashboard UI — only the data/API layer
|
|
25
|
-
- Implementing specific team templates beyond one reference "self-driving" template
|
|
26
|
-
- Changing the ACP/process model — session continuations are about history, not in-process agent lifecycle
|
|
27
|
-
- Horizontal scaling across machines — single-machine focus for now
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Design Decisions
|
|
32
|
-
|
|
33
|
-
### D1: Team Templates as Configuration, Not Code
|
|
34
|
-
|
|
35
|
-
Team templates are directories of YAML configuration files that compose roles, define spawn graphs, set integration strategies, and configure coordination protocols. They are loaded by the existing `RoleRegistry` layered config system and a new `TeamLoader`.
|
|
36
|
-
|
|
37
|
-
**Alternatives considered**:
|
|
38
|
-
- **Programmatic API**: Define teams in TypeScript. More flexible but requires code changes for each team shape. Rejected — config is more accessible and shareable.
|
|
39
|
-
- **Single monolithic config**: One file per team. Rejected — doesn't compose well with the existing layered role override system.
|
|
40
|
-
|
|
41
|
-
**Rationale**: The existing `.multiagent/roles/*.yaml` pattern already supports custom roles with inheritance. Team templates extend this with a `team.yaml` manifest that declares which roles participate, how they're spawned, and what strategies they use. The same role definitions work in both structured and self-driving modes — only the orchestration layer differs.
|
|
42
|
-
|
|
43
|
-
### D2: Task Pull via `claim_task` with Optimistic Locking
|
|
44
|
-
|
|
45
|
-
Add a `claim_task` MCP tool and corresponding `TaskBackend.claim()` method. Workers call `claim_task` with optional filters (status, tags, role). The backend atomically transitions the task from `pending`/`ready` to `assigned` using optimistic locking (compare-and-swap on version/status). If the claim fails (another worker got it), the worker retries or picks a different task.
|
|
46
|
-
|
|
47
|
-
**Alternatives considered**:
|
|
48
|
-
- **Central dispatcher**: A coordinator assigns tasks to workers. This is the current push model — works but creates a bottleneck at scale.
|
|
49
|
-
- **Message-based bidding**: Workers bid on tasks via messages, coordinator selects winner. Too much round-trip overhead for high-throughput scenarios.
|
|
50
|
-
|
|
51
|
-
**Rationale**: Pull-based with optimistic locking is the simplest model that scales. No coordinator bottleneck, no bidding overhead. Workers are autonomous — they claim, execute, and report. The task backend is the only coordination point, and SQLite handles contention well for single-machine deployments.
|
|
52
|
-
|
|
53
|
-
### D3: Integration Strategy as a Pluggable Interface
|
|
54
|
-
|
|
55
|
-
Integration is handled through an `IntegrationStrategy` interface that the worker `done()` handler dispatches to. The interface has a single responsibility: take a worker's completed work and land it on the integration branch.
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
/**
|
|
59
|
-
* Pluggable integration strategy interface.
|
|
60
|
-
*
|
|
61
|
-
* Implementations control how worker changes are landed onto
|
|
62
|
-
* the integration branch. The worker done() handler dispatches
|
|
63
|
-
* to the active strategy instead of hardcoding merge queue logic.
|
|
64
|
-
*/
|
|
65
|
-
interface IntegrationStrategy {
|
|
66
|
-
/** Unique identifier for this strategy */
|
|
67
|
-
readonly name: string;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Land a worker's completed changes onto the integration branch.
|
|
71
|
-
*
|
|
72
|
-
* @returns Result indicating success, conflict, or abandonment
|
|
73
|
-
*/
|
|
74
|
-
land(request: LandRequest): Promise<LandResult>;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Called when the strategy is initialized for a stream.
|
|
78
|
-
* Opportunity to set up any backing resources (queues, branches, etc).
|
|
79
|
-
*/
|
|
80
|
-
initialize?(streamId: string, config: Record<string, unknown>): Promise<void>;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Called when the strategy is torn down.
|
|
84
|
-
*/
|
|
85
|
-
close?(): Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
interface LandRequest {
|
|
89
|
-
/** Stream (integration branch) this targets */
|
|
90
|
-
streamId: string;
|
|
91
|
-
/** Worker's branch containing changes */
|
|
92
|
-
workerBranch: string;
|
|
93
|
-
/** Target integration branch */
|
|
94
|
-
integrationBranch: string;
|
|
95
|
-
/** ID of the worker agent */
|
|
96
|
-
workerAgentId: string;
|
|
97
|
-
/** Task ID this completes */
|
|
98
|
-
taskId: string;
|
|
99
|
-
/** Workspace path for git operations */
|
|
100
|
-
workspacePath: string;
|
|
101
|
-
/** Strategy-specific options from team config */
|
|
102
|
-
options?: Record<string, unknown>;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
type LandResult =
|
|
106
|
-
| { status: 'landed'; mergeCommit: string }
|
|
107
|
-
| { status: 'conflict'; conflictFiles: string[]; action: 'abandoned' | 'queued_for_resolution' }
|
|
108
|
-
| { status: 'retry_exhausted'; attempts: number }
|
|
109
|
-
| { status: 'failed'; error: string };
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Three built-in implementations, plus support for custom strategies:
|
|
113
|
-
|
|
114
|
-
| Strategy | Class | Behavior |
|
|
115
|
-
|----------|-------|----------|
|
|
116
|
-
| `queue` | `QueueIntegrationStrategy` | Wraps existing `MergeQueueInterface`. Submits merge request to queue; integrator processes serially. Current behavior, no changes. |
|
|
117
|
-
| `trunk` | `TrunkIntegrationStrategy` | Direct push to integration branch. On conflict: rebase and retry up to `maxRetries` times. On exhaustion: `conflictAction` determines abandon vs. resolve. |
|
|
118
|
-
| `optimistic` | `OptimisticIntegrationStrategy` | Push immediately. Emit `validation:requested` event. Background validator checks CI; creates fixup tasks on failure; snapshots green branch on success. |
|
|
119
|
-
| custom | User-provided | Register via `IntegrationStrategyRegistry.register(name, factory)`. Factory receives config from `team.yaml`. |
|
|
120
|
-
|
|
121
|
-
**Alternatives considered**:
|
|
122
|
-
- **Per-agent strategy**: Each worker chooses its integration approach. Rejected — creates unpredictable behavior and merge chaos.
|
|
123
|
-
- **Hardcoded strategy selection via switch/case**: Simpler but not extensible. Rejected — users need to implement custom strategies for their specific CI/CD pipelines.
|
|
124
|
-
- **Hardcoded trunk-only**: Remove merge queue entirely. Rejected — existing users depend on the queue for correctness.
|
|
125
|
-
|
|
126
|
-
**Rationale**: A pluggable interface makes integration strategies a first-class extension point. The `queue` strategy wraps existing behavior with zero changes. The worker `done()` handler becomes simpler — it delegates to `strategy.land()` instead of containing merge queue logic directly. Custom strategies can implement organization-specific workflows (e.g., PR-based integration, CI-gated merge, staging branch promotion).
|
|
127
|
-
|
|
128
|
-
**Integration with worker done() handler**: Today, the worker handler in `src/lifecycle/handlers/worker.ts` directly submits to the merge queue (Step 4, lines ~229-387). This gets replaced with:
|
|
129
|
-
|
|
130
|
-
```typescript
|
|
131
|
-
// Step 4: Land changes via integration strategy
|
|
132
|
-
if (args.status === 'completed' && context.workspacePath) {
|
|
133
|
-
const strategy = deps.integrationStrategy; // injected via WorkerHandlerDeps
|
|
134
|
-
const result = await strategy.land({
|
|
135
|
-
streamId: context.streamId,
|
|
136
|
-
workerBranch: sourceBranch,
|
|
137
|
-
integrationBranch: targetBranch,
|
|
138
|
-
workerAgentId: context.agentId,
|
|
139
|
-
taskId: context.taskId,
|
|
140
|
-
workspacePath: context.workspacePath,
|
|
141
|
-
});
|
|
142
|
-
// Handle result...
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### D4: Session Continuations via Persisted Conversation History
|
|
147
|
-
|
|
148
|
-
Agent session history (the conversation transcript with the LLM) is persisted to the EventStore. When an agent needs to resume (after a crash, timeout, or deliberate pause), a new process is spawned with the prior conversation loaded as context. The agent receives a resume prompt explaining it's continuing a previous session.
|
|
149
|
-
|
|
150
|
-
This is explicitly NOT about keeping a process alive forever. Long-running operation means: work -> pause -> resume -> work -> pause -> resume, potentially across days.
|
|
151
|
-
|
|
152
|
-
**Alternatives considered**:
|
|
153
|
-
- **Keep processes alive**: Run agent processes indefinitely. Rejected — processes crash, machines restart, and context windows fill up. Resumption is more robust than persistence.
|
|
154
|
-
- **Checkpoint-based**: Save structured state (current task, progress, decisions). Rejected — too lossy. The conversation transcript IS the state; structured checkpoints can't capture the nuance of in-flight reasoning.
|
|
155
|
-
|
|
156
|
-
**Rationale**: Long-running agents are about continuing session history, not keeping processes alive. This aligns with how Claude Code already works — sessions can be resumed. We just need to persist the transcript and provide a clean resume mechanism at the macro-agent level.
|
|
157
|
-
|
|
158
|
-
### D5: Observability as EventStore Materialized Views
|
|
159
|
-
|
|
160
|
-
Add new materialized views to the EventStore for autonomous operation metrics:
|
|
161
|
-
- **Throughput view**: commits/hour, tasks completed/hour, tasks created/hour (sliding window)
|
|
162
|
-
- **Health view**: build pass rate, error rate, agent utilization (active/idle/blocked)
|
|
163
|
-
- **Convergence view**: time-to-fix after breakage, conflict frequency
|
|
164
|
-
|
|
165
|
-
These are computed from existing events (spawn, terminate, task status changes, merge events). No new event types needed — just new projections over existing data.
|
|
166
|
-
|
|
167
|
-
**Alternatives considered**:
|
|
168
|
-
- **External metrics system**: Export to Prometheus/Grafana. Rejected for now — adds infrastructure dependency. Can be added later as an adapter.
|
|
169
|
-
- **Per-query computation**: Calculate metrics on demand from raw events. Rejected — too slow for dashboards with thousands of events.
|
|
170
|
-
|
|
171
|
-
**Rationale**: The EventStore already supports materialized views (agent view, task view, message queue). Adding metric views follows the same pattern. The API server can expose these via new endpoints, and a future dashboard can consume them.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Architecture
|
|
176
|
-
|
|
177
|
-
### Team Template System
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
181
|
-
│ Team Template │
|
|
182
|
-
│ .multiagent/teams/self-driving/ │
|
|
183
|
-
│ ├── team.yaml # Manifest: roles, strategy, config │
|
|
184
|
-
│ ├── roles/ # Role overrides/extensions │
|
|
185
|
-
│ │ ├── planner.yaml # extends: coordinator │
|
|
186
|
-
│ │ ├── grinder.yaml # extends: worker │
|
|
187
|
-
│ │ └── judge.yaml # extends: monitor │
|
|
188
|
-
│ └── prompts/ # Custom prompt templates │
|
|
189
|
-
│ ├── planner.md │
|
|
190
|
-
│ └── judge.md │
|
|
191
|
-
└───────────────────────────┬─────────────────────────────────┘
|
|
192
|
-
│ TeamLoader.load()
|
|
193
|
-
┌───────────────────────────▼─────────────────────────────────┐
|
|
194
|
-
│ Team Runtime │
|
|
195
|
-
│ - Registers roles into RoleRegistry │
|
|
196
|
-
│ - Selects IntegrationStrategy from registry │
|
|
197
|
-
│ - Sets up task backend with pull/push mode │
|
|
198
|
-
│ - Initializes observability views │
|
|
199
|
-
│ - Provides team-aware system prompt context │
|
|
200
|
-
└───────────────────────────┬─────────────────────────────────┘
|
|
201
|
-
│
|
|
202
|
-
┌───────────────────┼───────────────────┐
|
|
203
|
-
▼ ▼ ▼
|
|
204
|
-
RoleRegistry IntegrationStrategy TaskBackend
|
|
205
|
-
(roles added) Registry (strategy) (claim enabled)
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Team Manifest Schema (team.yaml)
|
|
209
|
-
|
|
210
|
-
```yaml
|
|
211
|
-
name: self-driving
|
|
212
|
-
description: "Cursor-style autonomous codebase development"
|
|
213
|
-
version: 1
|
|
214
|
-
|
|
215
|
-
# Roles this team uses (references files in roles/ or built-ins)
|
|
216
|
-
roles:
|
|
217
|
-
- planner # Custom role extending coordinator
|
|
218
|
-
- grinder # Custom role extending worker
|
|
219
|
-
- judge # Custom role extending monitor
|
|
220
|
-
|
|
221
|
-
# How the team bootstraps
|
|
222
|
-
bootstrap:
|
|
223
|
-
root:
|
|
224
|
-
role: planner
|
|
225
|
-
config:
|
|
226
|
-
model: sonnet
|
|
227
|
-
prompt: "prompts/planner.md"
|
|
228
|
-
companions:
|
|
229
|
-
- role: judge
|
|
230
|
-
config:
|
|
231
|
-
model: haiku
|
|
232
|
-
|
|
233
|
-
# Integration strategy for this team
|
|
234
|
-
integration:
|
|
235
|
-
strategy: trunk # queue | trunk | optimistic | <custom-name>
|
|
236
|
-
config: # Passed to strategy.initialize()
|
|
237
|
-
maxRetries: 3
|
|
238
|
-
conflictAction: abandon
|
|
239
|
-
|
|
240
|
-
# Task configuration
|
|
241
|
-
tasks:
|
|
242
|
-
mode: pull # push | pull
|
|
243
|
-
pull:
|
|
244
|
-
idleTimeout: 300
|
|
245
|
-
claimFilters:
|
|
246
|
-
status: [pending]
|
|
247
|
-
maxConcurrentPerAgent: 1
|
|
248
|
-
|
|
249
|
-
# Observability
|
|
250
|
-
observability:
|
|
251
|
-
metricsWindow: 3600
|
|
252
|
-
snapshotInterval: 300
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### Integration Strategy Architecture
|
|
256
|
-
|
|
257
|
-
```
|
|
258
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
259
|
-
│ Worker done() Handler │
|
|
260
|
-
│ (src/lifecycle/handlers/worker.ts) │
|
|
261
|
-
│ │
|
|
262
|
-
│ Step 4: Land changes │
|
|
263
|
-
│ strategy.land(request) ──────────────────┐ │
|
|
264
|
-
└───────────────────────────────────────────┤ │
|
|
265
|
-
▼ │
|
|
266
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
267
|
-
│ IntegrationStrategyRegistry │
|
|
268
|
-
│ .get(name) → IntegrationStrategy │
|
|
269
|
-
│ .register(name, factory) → void │
|
|
270
|
-
│ │
|
|
271
|
-
│ Built-in: │
|
|
272
|
-
│ ┌──────────────┬──────────────┬────────────────┐ │
|
|
273
|
-
│ │ queue │ trunk │ optimistic │ │
|
|
274
|
-
│ │ │ │ │ │
|
|
275
|
-
│ │ Wraps │ Direct push │ Push + async │ │
|
|
276
|
-
│ │ MergeQueue │ + rebase │ validation │ │
|
|
277
|
-
│ │ Interface │ + retry │ + fixup tasks │ │
|
|
278
|
-
│ └──────────────┴──────────────┴────────────────┘ │
|
|
279
|
-
│ │
|
|
280
|
-
│ Custom: │
|
|
281
|
-
│ ┌────────────────────────────────┐ │
|
|
282
|
-
│ │ pr-based, staging-promote, │ │
|
|
283
|
-
│ │ ci-gated, ... │ │
|
|
284
|
-
│ └────────────────────────────────┘ │
|
|
285
|
-
└─────────────────────────────────────────────────────────────┘
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Data Flow: Self-Driving Mode
|
|
289
|
-
|
|
290
|
-
```
|
|
291
|
-
1. Team boots → Planner + Judge spawned
|
|
292
|
-
2. Planner explores codebase → creates tasks in TaskBackend
|
|
293
|
-
3. Planner spawns N workers (or pool auto-scales)
|
|
294
|
-
4. Workers claim tasks (pull model):
|
|
295
|
-
claim_task() → work → commit → strategy.land() → done() → claim_task()
|
|
296
|
-
5. On conflict: strategy-specific handling (rebase+retry for trunk, fixup task for optimistic)
|
|
297
|
-
6. On failure: task marked failed, re-enters pool for retry
|
|
298
|
-
7. Judge runs periodically:
|
|
299
|
-
- Checks build/test status
|
|
300
|
-
- Creates fixup tasks for failures
|
|
301
|
-
- Snapshots "green" state to release branch
|
|
302
|
-
8. Planner monitors progress:
|
|
303
|
-
- Creates new tasks as areas are completed
|
|
304
|
-
- Adjusts priorities based on convergence
|
|
305
|
-
- Spawns/terminates workers based on queue depth
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
|
-
## Affected Code
|
|
311
|
-
|
|
312
|
-
| Area | Files | Change Type |
|
|
313
|
-
|------|-------|-------------|
|
|
314
|
-
| Team system | `src/teams/` (new module) | New: types, loader, runtime |
|
|
315
|
-
| Integration strategies | `src/workspace/strategies/` (new) | New: interface, registry, 3 implementations |
|
|
316
|
-
| Task pull | `src/task/backend/types.ts`, `memory.ts` | Modified: claim(), unclaim(), tags |
|
|
317
|
-
| MCP tools | `src/mcp/tools/` (3 new tools) | New: claim_task, unclaim_task, list_claimable_tasks |
|
|
318
|
-
| Worker lifecycle | `src/lifecycle/handlers/worker.ts` | Modified: dispatch to strategy instead of direct merge queue |
|
|
319
|
-
| Agent manager | `src/agent/agent-manager.ts` | Modified: team context propagation, resume() |
|
|
320
|
-
| System prompts | `src/agent/system-prompt.ts` | Modified: team-aware prompt generation |
|
|
321
|
-
| EventStore | `src/store/` | Modified: session history, metric views |
|
|
322
|
-
| CLI | `src/cli/index.ts` | Modified: --team flag |
|
|
323
|
-
| API | `src/api/server.ts` | Modified: metrics + team status endpoints |
|
|
324
|
-
| Capabilities | `src/roles/capabilities.ts` | Modified: task.claim capability |
|
|
325
|
-
|
|
326
|
-
---
|
|
327
|
-
|
|
328
|
-
## Risks / Trade-offs
|
|
329
|
-
|
|
330
|
-
| Risk | Impact | Mitigation |
|
|
331
|
-
|------|--------|------------|
|
|
332
|
-
| Trunk-based integration can break the build | Workers see broken state, waste tokens | Judge creates fixup tasks quickly; optimistic strategy adds async validation |
|
|
333
|
-
| Task claim contention under high concurrency | Workers waste cycles on failed claims | Randomized backoff; claim with multiple candidates |
|
|
334
|
-
| Session continuations bloat EventStore | Large conversation transcripts stored | Compress transcripts; configurable retention policy |
|
|
335
|
-
| Team templates add configuration complexity | Users confused by two config systems | Clear docs; templates are optional; existing roles still work standalone |
|
|
336
|
-
| Backward compatibility | Existing coordinator/integrator/worker flows break | `queue` strategy is the default; team templates are additive |
|
|
337
|
-
| Custom integration strategies with bugs | Broken landing corrupts integration branch | Strategy receives a sandboxed workspace; failures are recoverable |
|
|
338
|
-
|
|
339
|
-
## Open Questions
|
|
340
|
-
|
|
341
|
-
1. **Should team templates be shareable packages?** (e.g., `npm install @macro-agent/team-self-driving`) — Deferred to future work. Start with local directory convention.
|
|
342
|
-
2. **Should the Judge role have write access to create a "green" branch?** — Yes, but only `git.branch.create` + `git.push` on a specific release branch, not arbitrary write access.
|
|
343
|
-
3. **How much session history should be loaded on resume?** — Start with last N messages (configurable), with option to load full transcript. Context window limits are the practical constraint.
|
|
344
|
-
4. **Should workers in pull mode be able to reject a claimed task?** — Yes, via `unclaim_task` which returns it to `pending`.
|
|
345
|
-
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## Implementation Phases
|
|
349
|
-
|
|
350
|
-
### Phase 1: Team Template System (Foundation)
|
|
351
|
-
|
|
352
|
-
Everything else builds on this. Delivers the modular team loading layer.
|
|
353
|
-
|
|
354
|
-
- [ ] 1.1 Define `TeamManifest` TypeScript types in `src/teams/types.ts` — covers team.yaml schema: name, description, version, roles, bootstrap, integration, tasks, observability sections
|
|
355
|
-
- [ ] 1.2 Implement `TeamLoader` in `src/teams/team-loader.ts` — reads `.multiagent/teams/<name>/` directory, parses `team.yaml`, validates schema, reads role YAML files, reads prompt template files
|
|
356
|
-
- [ ] 1.3 Implement `TeamRuntime` in `src/teams/team-runtime.ts` — takes a parsed `TeamManifest` and wires it into the system: registers roles into RoleRegistry, selects integration strategy, sets TaskBackend mode, stores active team state
|
|
357
|
-
- [ ] 1.4 Add team context to `AgentManager.spawn()` — propagate `MACRO_TEAM_NAME`, `MACRO_INTEGRATION_STRATEGY`, `MACRO_TASK_MODE` environment variables; include team section in system prompt generation
|
|
358
|
-
- [ ] 1.5 Add `--team <name>` flag to CLI start command — loads team via TeamLoader, initializes TeamRuntime, then proceeds with existing boot flow
|
|
359
|
-
- [ ] 1.6 Implement team bootstrap — after TeamRuntime initializes, spawn root agent and companion agents per manifest `bootstrap` section
|
|
360
|
-
- [ ] 1.7 Add `GET /api/team` endpoint — returns active team config or `{ active: false }`
|
|
361
|
-
- [ ] 1.8 Write unit tests for TeamLoader (manifest parsing, validation, defaults) and TeamRuntime (role registration, config propagation)
|
|
362
|
-
- [ ] 1.9 Write integration test: load a test team template, verify roles registered, agents spawned with correct env vars and prompts
|
|
363
|
-
- [ ] 1.10 Create reference team template `.multiagent/teams/self-driving/` with team.yaml, planner/grinder/judge role definitions, and prompt templates
|
|
364
|
-
|
|
365
|
-
### Phase 2: Pluggable Integration Strategies (can parallelize with Phase 3)
|
|
366
|
-
|
|
367
|
-
Depends on: Phase 1 (team template sets `integration.strategy`)
|
|
368
|
-
|
|
369
|
-
- [ ] 2.1 Define `IntegrationStrategy` interface and `LandRequest`/`LandResult` types in `src/workspace/strategies/types.ts`
|
|
370
|
-
- [ ] 2.2 Implement `IntegrationStrategyRegistry` in `src/workspace/strategies/registry.ts` — register/get strategies by name, factory pattern accepting config from team.yaml
|
|
371
|
-
- [ ] 2.3 Implement `QueueIntegrationStrategy` in `src/workspace/strategies/queue.ts` — wraps existing `MergeQueueInterface`, same behavior as current worker done() handler Step 4
|
|
372
|
-
- [ ] 2.4 Implement `TrunkIntegrationStrategy` in `src/workspace/strategies/trunk.ts` — commit, push to integration branch, rebase-and-retry on conflict, max retries, configurable conflict action (abandon/resolve)
|
|
373
|
-
- [ ] 2.5 Implement `OptimisticIntegrationStrategy` in `src/workspace/strategies/optimistic.ts` — push immediately, emit validation request event, background validator logic
|
|
374
|
-
- [ ] 2.6 Refactor worker `done()` handler to dispatch to `IntegrationStrategy.land()` instead of directly using merge queue — add `integrationStrategy` to `WorkerHandlerDeps`
|
|
375
|
-
- [ ] 2.7 Wire strategy selection into `TeamRuntime` — look up strategy by name from registry, initialize with stream config
|
|
376
|
-
- [ ] 2.8 Register built-in strategies in module init — queue, trunk, optimistic available by default
|
|
377
|
-
- [ ] 2.9 Ensure `queue` strategy is backward-compatible default — verify all existing merge queue tests pass unchanged
|
|
378
|
-
- [ ] 2.10 Write unit tests for each strategy (queue passthrough, trunk push/rebase/retry/exhaust, optimistic push/validate/fixup)
|
|
379
|
-
- [ ] 2.11 Write integration test: run workers with each strategy, verify correct landing behavior
|
|
380
|
-
|
|
381
|
-
### Phase 3: Task Pull Model (can parallelize with Phase 2)
|
|
382
|
-
|
|
383
|
-
Depends on: Phase 1 (team template sets `tasks.mode: pull`)
|
|
384
|
-
|
|
385
|
-
- [ ] 3.1 Add `tags` field to task types in `src/task/backend/types.ts` and `src/store/types/tasks.ts`
|
|
386
|
-
- [ ] 3.2 Implement `claim(agentId, filters?)` on `TaskBackend` interface — atomic find-and-assign with optimistic locking
|
|
387
|
-
- [ ] 3.3 Implement `claim()` in `InMemoryTaskBackend` — scan pending tasks matching filters, CAS on status
|
|
388
|
-
- [ ] 3.4 Implement `unclaim(agentId, taskId, reason?)` on `TaskBackend` interface and `InMemoryTaskBackend`
|
|
389
|
-
- [ ] 3.5 Add `task.claim` capability to `src/roles/capabilities.ts` capability-tool map
|
|
390
|
-
- [ ] 3.6 Implement `claim_task` MCP tool in `src/mcp/tools/claim_task.ts` — schema, handler calling TaskBackend.claim(), response formatting
|
|
391
|
-
- [ ] 3.7 Implement `unclaim_task` MCP tool in `src/mcp/tools/unclaim_task.ts`
|
|
392
|
-
- [ ] 3.8 Implement `list_claimable_tasks` MCP tool in `src/mcp/tools/list_claimable_tasks.ts`
|
|
393
|
-
- [ ] 3.9 Register new tools in `src/mcp/mcp-server.ts` with `task.claim` capability gating
|
|
394
|
-
- [ ] 3.10 Modify worker `done()` handler — when task mode is `pull` and status is `completed`, do NOT set `shouldTerminate: true`; allow the worker to continue its claim loop
|
|
395
|
-
- [ ] 3.11 Add idle timeout logic — worker tracks last successful claim time; if idle timeout exceeded, self-terminate with `done({ status: "completed", summary: "idle exit" })`
|
|
396
|
-
- [ ] 3.12 Write unit tests for claim/unclaim (including contention), MCP tools, and pull-mode done handler
|
|
397
|
-
- [ ] 3.13 Write integration test: spawn workers in pull mode, create tasks, verify workers claim and complete them, verify idle timeout termination
|
|
398
|
-
|
|
399
|
-
### Phase 4: Session Continuations
|
|
400
|
-
|
|
401
|
-
Depends on: Phase 1 (team template configures `lifecycle.continuation`)
|
|
402
|
-
|
|
403
|
-
- [ ] 4.1 Define session history event type in `src/store/types/events.ts` — `session_history` event with transcript, message count, token estimate
|
|
404
|
-
- [ ] 4.2 Implement session history storage in EventStore — `storeSessionHistory(agentId, transcript)` and `getSessionHistory(agentId, options?)`
|
|
405
|
-
- [ ] 4.3 Add session history persistence to agent termination flow in `AgentManager.terminate()` — when `lifecycle.continuation` is enabled for the role, persist the transcript
|
|
406
|
-
- [ ] 4.4 Add periodic checkpoint persistence — after each agent tool-call round-trip, persist incremental session state (if continuation enabled)
|
|
407
|
-
- [ ] 4.5 Implement `AgentManager.resume(agentId, options?)` — load session history, apply context window limits, generate resume prompt, spawn new agent process with history as initial context
|
|
408
|
-
- [ ] 4.6 Add `lifecycle.continuation` to `RoleDefinition` type and capability checks
|
|
409
|
-
- [ ] 4.7 Add `continuations` section to team manifest schema and TeamRuntime propagation
|
|
410
|
-
- [ ] 4.8 Write unit tests for session storage/retrieval, context window limiting, resume prompt generation
|
|
411
|
-
- [ ] 4.9 Write integration test: spawn agent, terminate, resume, verify context continuity
|
|
412
|
-
|
|
413
|
-
### Phase 5: Autonomous Observability
|
|
414
|
-
|
|
415
|
-
Depends on: Phase 1 (team template configures `observability`), partially Phases 2+3 (task/commit metrics)
|
|
416
|
-
|
|
417
|
-
- [ ] 5.1 Define metric event types in `src/store/types/events.ts` — `metric.task_completed`, `metric.commit_pushed`, `metric.conflict_detected`
|
|
418
|
-
- [ ] 5.2 Emit metric events from done() handlers, integration strategies, and conflict detection paths
|
|
419
|
-
- [ ] 5.3 Implement throughput materialized view in EventStore — sliding window computation over task and commit metric events
|
|
420
|
-
- [ ] 5.4 Implement utilization materialized view in EventStore — derived from agent state transitions (spawn, claim, done, terminate)
|
|
421
|
-
- [ ] 5.5 Implement error rate materialized view in EventStore — derived from task.failed and conflict events
|
|
422
|
-
- [ ] 5.6 Add `GET /api/metrics/throughput`, `GET /api/metrics/utilization`, `GET /api/metrics/errors` endpoints to API server
|
|
423
|
-
- [ ] 5.7 Write unit tests for each materialized view (window computation, edge cases)
|
|
424
|
-
- [ ] 5.8 Write integration test: run a multi-agent session, query metrics endpoints, verify counts match actual activity
|
|
425
|
-
|
|
426
|
-
### Phase 6: Reference Templates and Documentation
|
|
427
|
-
|
|
428
|
-
Depends on: All previous phases
|
|
429
|
-
|
|
430
|
-
- [ ] 6.1 Finalize the `self-driving` reference team template with tested role definitions and prompts
|
|
431
|
-
- [ ] 6.2 Create a `structured` reference template codifying the existing coordinator/integrator/worker pattern as a team template
|
|
432
|
-
- [ ] 6.3 Add team template documentation to `docs/teams.md` — schema reference, custom strategy guide, how to create custom templates, examples
|
|
433
|
-
- [ ] 6.4 Run end-to-end test with self-driving template: planner creates tasks, workers claim and execute, judge monitors quality, trunk integration, metrics reporting
|
package/docs/roadmap-v2-gaps.md
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
# V2 Roadmap: Deferred Gaps
|
|
2
|
-
|
|
3
|
-
> Post-migration backlog from the V1→V2 subsystem extraction.
|
|
4
|
-
> Each item was intentionally scoped out of the initial migration.
|
|
5
|
-
> Ordered by priority (what to build next).
|
|
6
|
-
|
|
7
|
-
## Phase A: External Connectivity
|
|
8
|
-
|
|
9
|
-
The entire network layer was deleted. V2 is CLI-only. These items restore programmatic and remote access.
|
|
10
|
-
|
|
11
|
-
### A1. REST API Server
|
|
12
|
-
**Priority:** High
|
|
13
|
-
**Effort:** Medium
|
|
14
|
-
**Why:** No programmatic HTTP access to the system. Dashboards, monitoring tools, and IDE integrations can't connect.
|
|
15
|
-
|
|
16
|
-
What V1 had:
|
|
17
|
-
- Express routes: GET/POST agents, tasks, teams, metrics, hierarchy
|
|
18
|
-
- WebSocket subscriptions for real-time agent/task/turn events
|
|
19
|
-
- Health endpoints
|
|
20
|
-
|
|
21
|
-
What V2 needs:
|
|
22
|
-
- Express (or Hono/Fastify) server in `src/api/`
|
|
23
|
-
- Routes that delegate to `MacroAgentSystemV2` services (agentManager, inboxAdapter, tasksAdapter, triggerSystem)
|
|
24
|
-
- Optional — can run standalone or embedded in boot-v2
|
|
25
|
-
|
|
26
|
-
Key decisions:
|
|
27
|
-
- Framework choice (Express is still a dep candidate, or go lighter)
|
|
28
|
-
- WebSocket for real-time updates (subscribe to inbox delivery events + agent lifecycle)
|
|
29
|
-
- Auth model (token-based, same as V1's `agentTokenManager`)
|
|
30
|
-
|
|
31
|
-
### A2. ACP WebSocket Server
|
|
32
|
-
**Priority:** High (if IDE/remote integration needed)
|
|
33
|
-
**Effort:** High
|
|
34
|
-
**Why:** The Agent Communication Protocol over WebSocket was how external tools (IDEs, remote agents) interacted with macro-agent. Without it, only local CLI access works.
|
|
35
|
-
|
|
36
|
-
What V1 had:
|
|
37
|
-
- `websocket-server.ts` — Multi-client WebSocket server at `/acp`
|
|
38
|
-
- `macro-agent.ts` — ACP agent implementation (initialize, newSession, loadSession, prompt, cancel, extensions)
|
|
39
|
-
- `session-mapper.ts` — Maps ACP session IDs to internal agent IDs
|
|
40
|
-
- Extension methods: `_macro/spawnAgent`, `_macro/getHierarchy`, `_macro/sendPeerMessage`, etc.
|
|
41
|
-
|
|
42
|
-
What V2 needs:
|
|
43
|
-
- WebSocket server wrapping `AgentManager` + `InboxAdapter` + `ControlServer`
|
|
44
|
-
- ACP protocol handler translating JSON-RPC to V2 service calls
|
|
45
|
-
- Session management (session → head manager mapping)
|
|
46
|
-
- Extension methods updated for V2 (no EventStore, use adapters)
|
|
47
|
-
|
|
48
|
-
Dependencies: A1 (shares the HTTP server)
|
|
49
|
-
|
|
50
|
-
### A3. MAP Protocol Bridge
|
|
51
|
-
**Priority:** Medium
|
|
52
|
-
**Effort:** Medium
|
|
53
|
-
**Why:** MAP (Multi-Agent Protocol) was the standard interop layer for connecting to other agent systems. With agent-inbox embedded, MAP support partially exists (inbox speaks MAP natively), but there's no server-side MAP endpoint for external MAP clients to connect to.
|
|
54
|
-
|
|
55
|
-
What V1 had:
|
|
56
|
-
- `map/adapter/` — Full MAP JSON-RPC adapter with connection/subscription lifecycle
|
|
57
|
-
- `map/federation/` — Cross-system message relay
|
|
58
|
-
|
|
59
|
-
What V2 can leverage:
|
|
60
|
-
- agent-inbox already supports MAP via `MapClient` and federation
|
|
61
|
-
- The gap is exposing macro-agent's MAP endpoint to external clients
|
|
62
|
-
- Could be as simple as wiring agent-inbox's MAP server to the HTTP/WS server from A1
|
|
63
|
-
|
|
64
|
-
### A4. Peer-to-Peer Multi-Instance
|
|
65
|
-
**Priority:** Low
|
|
66
|
-
**Effort:** High
|
|
67
|
-
**Why:** P2P communication between separate macro-agent instances. Only needed for distributed deployments.
|
|
68
|
-
|
|
69
|
-
What V1 had:
|
|
70
|
-
- `PeerManager` with WebSocket and local transports
|
|
71
|
-
- `CapabilityManager` for delegating capabilities across instances
|
|
72
|
-
|
|
73
|
-
What V2 can leverage:
|
|
74
|
-
- agent-inbox federation (encrypted P2P via agentic-mesh)
|
|
75
|
-
- Each macro-agent instance embeds its own agent-inbox
|
|
76
|
-
- Federation connects inboxes across instances automatically
|
|
77
|
-
|
|
78
|
-
The messaging layer is covered by inbox federation. The gap is coordination-level operations (spawn on remote instance, cross-instance hierarchy queries). This is a new design problem, not a restore.
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Phase B: Operational Gaps
|
|
83
|
-
|
|
84
|
-
Features that affect reliability and observability in production.
|
|
85
|
-
|
|
86
|
-
### B1. Metrics and Observability
|
|
87
|
-
**Priority:** High (for production)
|
|
88
|
-
**Effort:** Medium
|
|
89
|
-
**Why:** No aggregate throughput, utilization, or error metrics. Can't answer "how many tasks completed per hour?" or "which agents are idle?"
|
|
90
|
-
|
|
91
|
-
What V1 had:
|
|
92
|
-
- `ThroughputMetrics` — tasks completed/failed/created per time window, avg completion time
|
|
93
|
-
- `UtilizationMetrics` — active agents by role/state
|
|
94
|
-
- `ErrorMetrics` — errors by type/agent
|
|
95
|
-
|
|
96
|
-
What V2 needs:
|
|
97
|
-
- `src/metrics/` module that reads from AgentStore + ControlServer health data
|
|
98
|
-
- Counters: tasks created/completed/failed (from tasksAdapter or opentasks events)
|
|
99
|
-
- Gauges: running agents by role, active sessions, queue depth
|
|
100
|
-
- Histograms: task completion time, agent lifetime
|
|
101
|
-
- Export format: Prometheus-compatible or simple JSON endpoint (ties into A1)
|
|
102
|
-
|
|
103
|
-
### B2. Event Deduplication
|
|
104
|
-
**Priority:** Medium
|
|
105
|
-
**Effort:** Low
|
|
106
|
-
**Why:** Rapid inbox messages to the same agent can cause alert storms. V1's `deduplication.ts` used slot-based dedup to coalesce rapid events.
|
|
107
|
-
|
|
108
|
-
What V2 needs:
|
|
109
|
-
- Add dedup layer in `trigger-system-v2.ts` delivery handler
|
|
110
|
-
- Before enqueuing, check if an event with the same `sourceKey` was recently processed
|
|
111
|
-
- Simple time-window dedup: `Map<sourceKey, lastSeenTimestamp>` with TTL
|
|
112
|
-
|
|
113
|
-
Implementation: ~50 lines in the delivery handler. The `SystemEventQueue` already supports `sourceKey` for dedup hints — just need to check it before enqueuing.
|
|
114
|
-
|
|
115
|
-
### B3. Automated Health Check Escalation
|
|
116
|
-
**Priority:** Medium
|
|
117
|
-
**Effort:** Low
|
|
118
|
-
**Why:** V2 tracks heartbeats from MCP subprocesses via ControlServer but doesn't act on stale heartbeats automatically.
|
|
119
|
-
|
|
120
|
-
What V1 had:
|
|
121
|
-
- `HealthCheckService` — periodic check loop, consecutive failure counting, STALE_AGENT signal emission, zombie session cleanup
|
|
122
|
-
|
|
123
|
-
What V2 needs:
|
|
124
|
-
- Periodic loop in `boot-v2.ts` or `agent-manager-v2.ts` that calls `controlServer.getUnhealthyAgents(60000)`
|
|
125
|
-
- For unhealthy agents: emit warning via inbox to parent, optionally terminate after N missed heartbeats
|
|
126
|
-
- ~30 lines of `setInterval` logic
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Phase C: Feature Gaps
|
|
131
|
-
|
|
132
|
-
Capabilities that existed in V1 but were not essential for the V2 architecture migration.
|
|
133
|
-
|
|
134
|
-
### C1. Integrator Resolver Spawning
|
|
135
|
-
**Priority:** Medium
|
|
136
|
-
**Effort:** Medium
|
|
137
|
-
**Why:** V1's integrator done handler could detect merge conflicts and automatically spawn a "worker.resolver" agent to fix them. V2's integrator handler just emits `INTEGRATOR_DONE`.
|
|
138
|
-
|
|
139
|
-
What V1 had:
|
|
140
|
-
- `handleIntegratorDone()` processed merge queue, attempted merges, detected conflicts
|
|
141
|
-
- On conflict: spawned `worker.resolver` with conflict context, MR ID, resolver branch
|
|
142
|
-
- Resolver worked in a worktree, committed fix, emitted `RESOLVER_DONE`
|
|
143
|
-
- Integrator then merged the resolver's branch inline
|
|
144
|
-
|
|
145
|
-
What V2 needs:
|
|
146
|
-
- Re-add conflict detection to the integrator's done flow or to `AgentManagerV2.terminate()`
|
|
147
|
-
- Spawn resolver worker with workspace on conflict branch
|
|
148
|
-
- This ties into the workspace isolation flow
|
|
149
|
-
|
|
150
|
-
### C2. wait_for_activity MCP Tool
|
|
151
|
-
**Priority:** Low
|
|
152
|
-
**Effort:** Low
|
|
153
|
-
**Why:** Agents could block until a matching event occurred (e.g., "wait for child to complete"). V2 agents must poll `check_inbox` instead.
|
|
154
|
-
|
|
155
|
-
What V2 could do:
|
|
156
|
-
- Add `wait_for_activity` tool to `mcp-server-v2.ts`
|
|
157
|
-
- Implementation: poll `inboxAdapter.checkInbox()` with a timeout loop
|
|
158
|
-
- Or: use control socket to subscribe to events from main process
|
|
159
|
-
|
|
160
|
-
### C3. AI Router Strategy
|
|
161
|
-
**Priority:** Low
|
|
162
|
-
**Effort:** Medium
|
|
163
|
-
**Why:** V1 could fork a Claude session to make routing decisions for trigger events. Expensive but powerful for complex routing.
|
|
164
|
-
|
|
165
|
-
What V2 has:
|
|
166
|
-
- Pluggable `RoutingStrategy` interface already exists
|
|
167
|
-
- `registerStrategy()` API is available
|
|
168
|
-
|
|
169
|
-
What's needed:
|
|
170
|
-
- Implement `AIRouterStrategy` that spawns a lightweight Claude session
|
|
171
|
-
- Provide system state (agents, tasks, recent events) as context
|
|
172
|
-
- Parse routing decision from response
|
|
173
|
-
- Register via `triggerSystem.router.registerStrategy()`
|
|
174
|
-
|
|
175
|
-
### C4. Store Change Subscriptions
|
|
176
|
-
**Priority:** Low
|
|
177
|
-
**Effort:** Medium
|
|
178
|
-
**Why:** V1's EventStore had `onAgentChange()` and `onTaskChange()` subscriptions that components used for reactive updates. V2 has no equivalent.
|
|
179
|
-
|
|
180
|
-
What V2 does instead:
|
|
181
|
-
- Agent lifecycle callbacks via `agentManager.onLifecycleEvent()`
|
|
182
|
-
- Inbox delivery events via `inboxAdapter.onDelivery()`
|
|
183
|
-
- These cover the main reactive use cases
|
|
184
|
-
|
|
185
|
-
What's missing:
|
|
186
|
-
- No way to subscribe to AgentStore changes from outside the main process
|
|
187
|
-
- MCP subprocesses can't be notified when an agent's state changes
|
|
188
|
-
|
|
189
|
-
Low priority because the main use cases are covered by existing callbacks.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Implementation Order
|
|
194
|
-
|
|
195
|
-
```
|
|
196
|
-
Immediate (high value, low effort):
|
|
197
|
-
B2. Event Deduplication (~50 lines)
|
|
198
|
-
B3. Health Check Escalation (~30 lines)
|
|
199
|
-
|
|
200
|
-
Next sprint (high value):
|
|
201
|
-
B1. Metrics/Observability
|
|
202
|
-
A1. REST API Server
|
|
203
|
-
|
|
204
|
-
When needed:
|
|
205
|
-
A2. ACP WebSocket Server
|
|
206
|
-
C1. Integrator Resolver Spawning
|
|
207
|
-
|
|
208
|
-
Later:
|
|
209
|
-
A3. MAP Protocol Bridge
|
|
210
|
-
C2. wait_for_activity Tool
|
|
211
|
-
C3. AI Router Strategy
|
|
212
|
-
C4. Store Change Subscriptions
|
|
213
|
-
|
|
214
|
-
Not until distributed deployment:
|
|
215
|
-
A4. Peer-to-Peer Multi-Instance
|
|
216
|
-
```
|