macro-agent 0.0.11 → 0.0.12
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/.macro-agent/teams/self-driving/prompts/grinder.md +27 -0
- package/.macro-agent/teams/self-driving/prompts/judge.md +27 -0
- package/.macro-agent/teams/self-driving/prompts/planner.md +33 -0
- package/.macro-agent/teams/self-driving/roles/grinder.yaml +17 -0
- package/.macro-agent/teams/self-driving/roles/judge.yaml +24 -0
- package/.macro-agent/teams/self-driving/roles/planner.yaml +18 -0
- package/.macro-agent/teams/self-driving/team.yaml +103 -0
- package/.macro-agent/teams/structured/prompts/developer.md +26 -0
- package/.macro-agent/teams/structured/prompts/lead.md +25 -0
- package/.macro-agent/teams/structured/prompts/reviewer.md +24 -0
- package/.macro-agent/teams/structured/roles/developer.yaml +12 -0
- package/.macro-agent/teams/structured/roles/lead.yaml +11 -0
- package/.macro-agent/teams/structured/roles/reviewer.yaml +19 -0
- package/.macro-agent/teams/structured/team.yaml +89 -0
- package/.sudocode/issues.jsonl +6 -0
- package/.sudocode/specs.jsonl +7 -0
- package/CLAUDE.md +110 -30
- package/README.md +60 -3
- package/dist/acp/macro-agent.d.ts +4 -0
- package/dist/acp/macro-agent.d.ts.map +1 -1
- package/dist/acp/macro-agent.js +50 -4
- package/dist/acp/macro-agent.js.map +1 -1
- package/dist/acp/session-mapper.d.ts +20 -1
- package/dist/acp/session-mapper.d.ts.map +1 -1
- package/dist/acp/session-mapper.js +90 -1
- package/dist/acp/session-mapper.js.map +1 -1
- package/dist/acp/types.d.ts +24 -1
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js.map +1 -1
- package/dist/agent/agent-manager.d.ts +25 -1
- package/dist/agent/agent-manager.d.ts.map +1 -1
- package/dist/agent/agent-manager.js +93 -7
- package/dist/agent/agent-manager.js.map +1 -1
- package/dist/agent/types.d.ts +22 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/agent-detection/command-builder.d.ts +30 -0
- package/dist/agent-detection/command-builder.d.ts.map +1 -0
- package/dist/agent-detection/command-builder.js +71 -0
- package/dist/agent-detection/command-builder.js.map +1 -0
- package/dist/agent-detection/detector.d.ts +84 -0
- package/dist/agent-detection/detector.d.ts.map +1 -0
- package/dist/agent-detection/detector.js +240 -0
- package/dist/agent-detection/detector.js.map +1 -0
- package/dist/agent-detection/index.d.ts +12 -0
- package/dist/agent-detection/index.d.ts.map +1 -0
- package/dist/agent-detection/index.js +14 -0
- package/dist/agent-detection/index.js.map +1 -0
- package/dist/agent-detection/registry.d.ts +53 -0
- package/dist/agent-detection/registry.d.ts.map +1 -0
- package/dist/agent-detection/registry.js +177 -0
- package/dist/agent-detection/registry.js.map +1 -0
- package/dist/agent-detection/types.d.ts +121 -0
- package/dist/agent-detection/types.d.ts.map +1 -0
- package/dist/agent-detection/types.js +20 -0
- package/dist/agent-detection/types.js.map +1 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +95 -0
- package/dist/api/server.js.map +1 -1
- package/dist/cli/index.js +29 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp.js +38 -0
- package/dist/cli/mcp.js.map +1 -1
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/project-config.d.ts +46 -0
- package/dist/config/project-config.d.ts.map +1 -0
- package/dist/config/project-config.js +68 -0
- package/dist/config/project-config.js.map +1 -0
- package/dist/lifecycle/cascade.d.ts +1 -1
- package/dist/lifecycle/cascade.d.ts.map +1 -1
- package/dist/lifecycle/handlers/index.d.ts +4 -0
- package/dist/lifecycle/handlers/index.d.ts.map +1 -1
- package/dist/lifecycle/handlers/index.js +2 -0
- package/dist/lifecycle/handlers/index.js.map +1 -1
- package/dist/lifecycle/handlers/worker.d.ts +4 -0
- package/dist/lifecycle/handlers/worker.d.ts.map +1 -1
- package/dist/lifecycle/handlers/worker.js +35 -3
- package/dist/lifecycle/handlers/worker.js.map +1 -1
- package/dist/map/adapter/acp-over-map.d.ts.map +1 -1
- package/dist/map/adapter/acp-over-map.js +32 -2
- package/dist/map/adapter/acp-over-map.js.map +1 -1
- package/dist/map/adapter/event-translator.d.ts.map +1 -1
- package/dist/map/adapter/event-translator.js +1 -0
- package/dist/map/adapter/event-translator.js.map +1 -1
- 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/index.d.ts +10 -1
- package/dist/map/adapter/extensions/index.d.ts.map +1 -1
- package/dist/map/adapter/extensions/index.js +39 -0
- package/dist/map/adapter/extensions/index.js.map +1 -1
- 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/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/mcp/mcp-server.d.ts +6 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -1
- package/dist/mcp/mcp-server.js +45 -0
- package/dist/mcp/mcp-server.js.map +1 -1
- 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.d.ts +11 -2
- package/dist/mcp/tools/done.d.ts.map +1 -1
- package/dist/mcp/tools/done.js +15 -10
- package/dist/mcp/tools/done.js.map +1 -1
- 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/metrics/index.d.ts +2 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +2 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/metrics.d.ts +79 -0
- package/dist/metrics/metrics.d.ts.map +1 -0
- package/dist/metrics/metrics.js +166 -0
- package/dist/metrics/metrics.js.map +1 -0
- package/dist/roles/capabilities.d.ts +1 -0
- package/dist/roles/capabilities.d.ts.map +1 -1
- package/dist/roles/capabilities.js +3 -0
- package/dist/roles/capabilities.js.map +1 -1
- package/dist/roles/types.d.ts +1 -1
- package/dist/roles/types.d.ts.map +1 -1
- package/dist/router/message-router.d.ts +41 -0
- package/dist/router/message-router.d.ts.map +1 -1
- package/dist/router/message-router.js +136 -5
- package/dist/router/message-router.js.map +1 -1
- package/dist/store/event-store.d.ts +8 -1
- package/dist/store/event-store.d.ts.map +1 -1
- package/dist/store/event-store.js +120 -4
- package/dist/store/event-store.js.map +1 -1
- package/dist/store/types/agents.d.ts +1 -1
- package/dist/store/types/agents.d.ts.map +1 -1
- package/dist/store/types/events.d.ts +1 -1
- package/dist/store/types/events.d.ts.map +1 -1
- package/dist/store/types/events.js.map +1 -1
- package/dist/store/types/index.d.ts +1 -0
- package/dist/store/types/index.d.ts.map +1 -1
- package/dist/store/types/index.js +1 -0
- package/dist/store/types/index.js.map +1 -1
- 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/tasks.d.ts +2 -0
- package/dist/store/types/tasks.d.ts.map +1 -1
- package/dist/task/backend/memory.d.ts +4 -1
- package/dist/task/backend/memory.d.ts.map +1 -1
- package/dist/task/backend/memory.js +81 -0
- package/dist/task/backend/memory.js.map +1 -1
- package/dist/task/backend/types.d.ts +30 -0
- package/dist/task/backend/types.d.ts.map +1 -1
- package/dist/task/backend/types.js.map +1 -1
- package/dist/teams/index.d.ts +4 -0
- package/dist/teams/index.d.ts.map +1 -0
- package/dist/teams/index.js +4 -0
- package/dist/teams/index.js.map +1 -0
- package/dist/teams/team-loader.d.ts +20 -0
- package/dist/teams/team-loader.d.ts.map +1 -0
- package/dist/teams/team-loader.js +293 -0
- package/dist/teams/team-loader.js.map +1 -0
- package/dist/teams/team-runtime.d.ts +139 -0
- package/dist/teams/team-runtime.d.ts.map +1 -0
- package/dist/teams/team-runtime.js +613 -0
- package/dist/teams/team-runtime.js.map +1 -0
- package/dist/teams/types.d.ts +266 -0
- package/dist/teams/types.d.ts.map +1 -0
- package/dist/teams/types.js +20 -0
- package/dist/teams/types.js.map +1 -0
- package/dist/workspace/dataplane-adapter.d.ts +1 -1
- package/dist/workspace/dataplane-adapter.d.ts.map +1 -1
- package/dist/workspace/dataplane-adapter.js +1 -1
- package/dist/workspace/dataplane-adapter.js.map +1 -1
- package/dist/workspace/index.d.ts +1 -1
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/strategies/index.d.ts +6 -0
- package/dist/workspace/strategies/index.d.ts.map +1 -0
- package/dist/workspace/strategies/index.js +5 -0
- package/dist/workspace/strategies/index.js.map +1 -0
- package/dist/workspace/strategies/optimistic.d.ts +26 -0
- package/dist/workspace/strategies/optimistic.d.ts.map +1 -0
- package/dist/workspace/strategies/optimistic.js +121 -0
- package/dist/workspace/strategies/optimistic.js.map +1 -0
- package/dist/workspace/strategies/queue.d.ts +26 -0
- package/dist/workspace/strategies/queue.d.ts.map +1 -0
- package/dist/workspace/strategies/queue.js +67 -0
- package/dist/workspace/strategies/queue.js.map +1 -0
- package/dist/workspace/strategies/registry.d.ts +37 -0
- package/dist/workspace/strategies/registry.d.ts.map +1 -0
- package/dist/workspace/strategies/registry.js +63 -0
- package/dist/workspace/strategies/registry.js.map +1 -0
- package/dist/workspace/strategies/trunk.d.ts +20 -0
- package/dist/workspace/strategies/trunk.d.ts.map +1 -0
- package/dist/workspace/strategies/trunk.js +108 -0
- package/dist/workspace/strategies/trunk.js.map +1 -0
- package/dist/workspace/strategies/types.d.ts +104 -0
- package/dist/workspace/strategies/types.d.ts.map +1 -0
- package/dist/workspace/strategies/types.js +11 -0
- package/dist/workspace/strategies/types.js.map +1 -0
- package/dist/workspace/types.d.ts +1 -1
- package/dist/workspace/types.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.d.ts +1 -1
- package/dist/workspace/workspace-manager.d.ts.map +1 -1
- package/docs/implementation-details.md +1127 -0
- package/docs/implementation-summary.md +448 -0
- package/docs/plan-self-driving-support.md +433 -0
- package/docs/spec-self-driving-support.md +462 -0
- package/docs/team-templates.md +860 -0
- package/docs/teams.md +233 -0
- package/package.json +4 -2
- package/src/acp/__tests__/integration.test.ts +161 -1
- package/src/acp/__tests__/macro-agent.test.ts +95 -0
- package/src/acp/__tests__/session-persistence.test.ts +276 -0
- package/src/acp/macro-agent.ts +79 -7
- package/src/acp/session-mapper.ts +108 -1
- package/src/acp/types.ts +33 -1
- package/src/agent/agent-manager.ts +158 -6
- package/src/agent/types.ts +27 -0
- package/src/agent-detection/__tests__/command-builder.test.ts +336 -0
- package/src/agent-detection/__tests__/detector.test.ts +768 -0
- package/src/agent-detection/__tests__/registry.test.ts +254 -0
- package/src/agent-detection/command-builder.ts +90 -0
- package/src/agent-detection/detector.ts +307 -0
- package/src/agent-detection/index.ts +36 -0
- package/src/agent-detection/registry.ts +200 -0
- package/src/agent-detection/types.ts +184 -0
- package/src/api/server.ts +110 -0
- package/src/cli/index.ts +44 -0
- package/src/cli/mcp.ts +47 -0
- package/src/config/index.ts +9 -0
- package/src/config/project-config.ts +107 -0
- package/src/lifecycle/cascade.ts +1 -1
- package/src/lifecycle/handlers/index.ts +8 -0
- package/src/lifecycle/handlers/worker.ts +48 -3
- package/src/map/adapter/__tests__/extensions.test.ts +359 -0
- package/src/map/adapter/__tests__/workspace-files.test.ts +673 -0
- package/src/map/adapter/acp-over-map.ts +45 -2
- package/src/map/adapter/event-translator.ts +1 -0
- package/src/map/adapter/extensions/agent-detection.ts +201 -0
- package/src/map/adapter/extensions/index.ts +63 -0
- package/src/map/adapter/extensions/resume.ts +114 -0
- package/src/map/adapter/extensions/workspace-files.ts +449 -0
- package/src/mcp/mcp-server.ts +67 -0
- package/src/mcp/tools/claim_task.ts +86 -0
- package/src/mcp/tools/done.ts +24 -10
- package/src/mcp/tools/list_claimable_tasks.ts +93 -0
- package/src/mcp/tools/unclaim_task.ts +71 -0
- package/src/metrics/index.ts +9 -0
- package/src/metrics/metrics.ts +280 -0
- package/src/roles/capabilities.ts +3 -0
- package/src/roles/types.ts +2 -1
- package/src/router/__tests__/message-router.test.ts +561 -0
- package/src/router/message-router.ts +223 -6
- package/src/store/event-store.ts +151 -3
- package/src/store/types/agents.ts +1 -1
- package/src/store/types/events.ts +2 -1
- package/src/store/types/index.ts +1 -0
- package/src/store/types/sessions.ts +53 -0
- package/src/store/types/tasks.ts +3 -0
- package/src/task/backend/memory.ts +116 -0
- package/src/task/backend/types.ts +43 -0
- package/src/teams/__tests__/cross-subsystem.integration.test.ts +983 -0
- package/src/teams/__tests__/e2e/team-runtime.e2e.test.ts +553 -0
- package/src/teams/__tests__/team-system.test.ts +1280 -0
- package/src/teams/index.ts +13 -0
- package/src/teams/team-loader.ts +434 -0
- package/src/teams/team-runtime.ts +727 -0
- package/src/teams/types.ts +377 -0
- package/src/workspace/dataplane-adapter.ts +1 -1
- package/src/workspace/index.ts +1 -1
- package/src/workspace/strategies/index.ts +18 -0
- package/src/workspace/strategies/optimistic.ts +136 -0
- package/src/workspace/strategies/queue.ts +81 -0
- package/src/workspace/strategies/registry.ts +89 -0
- package/src/workspace/strategies/trunk.ts +123 -0
- package/src/workspace/strategies/types.ts +145 -0
- package/src/workspace/types.ts +1 -1
- package/src/workspace/workspace-manager.ts +1 -1
- package/.claude/settings.local.json +0 -59
- package/dist/map/utils/address-translation.d.ts +0 -99
- package/dist/map/utils/address-translation.d.ts.map +0 -1
- package/dist/map/utils/address-translation.js +0 -285
- package/dist/map/utils/address-translation.js.map +0 -1
- package/dist/map/utils/index.d.ts +0 -7
- package/dist/map/utils/index.d.ts.map +0 -1
- package/dist/map/utils/index.js +0 -7
- package/dist/map/utils/index.js.map +0 -1
- package/references/acp-factory-ref/CHANGELOG.md +0 -33
- package/references/acp-factory-ref/LICENSE +0 -21
- package/references/acp-factory-ref/README.md +0 -341
- package/references/acp-factory-ref/package-lock.json +0 -3102
- package/references/acp-factory-ref/package.json +0 -96
- package/references/acp-factory-ref/python/CHANGELOG.md +0 -33
- package/references/acp-factory-ref/python/LICENSE +0 -21
- package/references/acp-factory-ref/python/Makefile +0 -57
- package/references/acp-factory-ref/python/README.md +0 -253
- package/references/acp-factory-ref/python/pyproject.toml +0 -73
- package/references/acp-factory-ref/python/tests/__init__.py +0 -0
- package/references/acp-factory-ref/python/tests/e2e/__init__.py +0 -1
- package/references/acp-factory-ref/python/tests/e2e/test_codex_e2e.py +0 -349
- package/references/acp-factory-ref/python/tests/e2e/test_gemini_e2e.py +0 -165
- package/references/acp-factory-ref/python/tests/e2e/test_opencode_e2e.py +0 -296
- package/references/acp-factory-ref/python/tests/test_client_handler.py +0 -543
- package/references/acp-factory-ref/python/tests/test_pushable.py +0 -199
- package/references/claude-code-acp/.github/workflows/ci.yml +0 -45
- package/references/claude-code-acp/.github/workflows/publish.yml +0 -34
- package/references/claude-code-acp/.prettierrc.json +0 -4
- package/references/claude-code-acp/CHANGELOG.md +0 -249
- package/references/claude-code-acp/LICENSE +0 -222
- package/references/claude-code-acp/README.md +0 -53
- package/references/claude-code-acp/docs/RELEASES.md +0 -24
- package/references/claude-code-acp/eslint.config.js +0 -48
- package/references/claude-code-acp/package-lock.json +0 -4570
- package/references/claude-code-acp/package.json +0 -88
- package/references/claude-code-acp/scripts/release.sh +0 -119
- package/references/claude-code-acp/src/acp-agent.ts +0 -2065
- package/references/claude-code-acp/src/index.ts +0 -26
- package/references/claude-code-acp/src/lib.ts +0 -38
- package/references/claude-code-acp/src/mcp-server.ts +0 -911
- package/references/claude-code-acp/src/settings.ts +0 -522
- package/references/claude-code-acp/src/tests/.claude/commands/quick-math.md +0 -5
- package/references/claude-code-acp/src/tests/.claude/commands/say-hello.md +0 -6
- package/references/claude-code-acp/src/tests/acp-agent-fork.test.ts +0 -479
- package/references/claude-code-acp/src/tests/acp-agent.test.ts +0 -1502
- package/references/claude-code-acp/src/tests/extract-lines.test.ts +0 -103
- package/references/claude-code-acp/src/tests/fork-session.test.ts +0 -335
- package/references/claude-code-acp/src/tests/replace-and-calculate-location.test.ts +0 -334
- package/references/claude-code-acp/src/tests/settings.test.ts +0 -617
- package/references/claude-code-acp/src/tests/skills-options.test.ts +0 -187
- package/references/claude-code-acp/src/tests/tools.test.ts +0 -318
- package/references/claude-code-acp/src/tests/typescript-declarations.test.ts +0 -558
- package/references/claude-code-acp/src/tools.ts +0 -819
- package/references/claude-code-acp/src/utils.ts +0 -171
- package/references/claude-code-acp/tsconfig.json +0 -18
- package/references/claude-code-acp/vitest.config.ts +0 -19
- package/references/multi-agent-protocol/.sudocode/issues.jsonl +0 -111
- package/references/multi-agent-protocol/.sudocode/specs.jsonl +0 -13
- package/references/multi-agent-protocol/LICENSE +0 -21
- package/references/multi-agent-protocol/README.md +0 -113
- package/references/multi-agent-protocol/docs/00-design-specification.md +0 -496
- package/references/multi-agent-protocol/docs/01-open-questions.md +0 -1050
- package/references/multi-agent-protocol/docs/02-wire-protocol.md +0 -296
- package/references/multi-agent-protocol/docs/03-streaming-semantics.md +0 -252
- package/references/multi-agent-protocol/docs/04-error-handling.md +0 -231
- package/references/multi-agent-protocol/docs/05-connection-model.md +0 -244
- package/references/multi-agent-protocol/docs/06-visibility-permissions.md +0 -243
- package/references/multi-agent-protocol/docs/07-federation.md +0 -259
- package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +0 -253
- package/references/multi-agent-protocol/docs/09-authentication.md +0 -680
- package/references/multi-agent-protocol/docs/10-mail-protocol.md +0 -553
- package/references/multi-agent-protocol/docs/agent-iam-integration.md +0 -877
- package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +0 -459
- package/references/multi-agent-protocol/docs/git-transport-draft.md +0 -251
- package/references/multi-agent-protocol/docs-site/Gemfile +0 -22
- package/references/multi-agent-protocol/docs-site/README.md +0 -82
- package/references/multi-agent-protocol/docs-site/_config.yml +0 -91
- package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +0 -20
- package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +0 -42
- package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +0 -34
- package/references/multi-agent-protocol/docs-site/examples/full-integration.md +0 -510
- package/references/multi-agent-protocol/docs-site/examples/index.md +0 -138
- package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +0 -282
- package/references/multi-agent-protocol/docs-site/examples/task-queue.md +0 -399
- package/references/multi-agent-protocol/docs-site/getting-started/index.md +0 -98
- package/references/multi-agent-protocol/docs-site/getting-started/installation.md +0 -219
- package/references/multi-agent-protocol/docs-site/getting-started/overview.md +0 -172
- package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +0 -237
- package/references/multi-agent-protocol/docs-site/index.md +0 -136
- package/references/multi-agent-protocol/docs-site/protocol/authentication.md +0 -391
- package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +0 -376
- package/references/multi-agent-protocol/docs-site/protocol/design.md +0 -284
- package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +0 -312
- package/references/multi-agent-protocol/docs-site/protocol/federation.md +0 -449
- package/references/multi-agent-protocol/docs-site/protocol/index.md +0 -129
- package/references/multi-agent-protocol/docs-site/protocol/permissions.md +0 -398
- package/references/multi-agent-protocol/docs-site/protocol/streaming.md +0 -353
- package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +0 -369
- package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +0 -357
- package/references/multi-agent-protocol/docs-site/sdk/api/client.md +0 -380
- package/references/multi-agent-protocol/docs-site/sdk/api/index.md +0 -62
- package/references/multi-agent-protocol/docs-site/sdk/api/server.md +0 -453
- package/references/multi-agent-protocol/docs-site/sdk/api/types.md +0 -468
- package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +0 -375
- package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +0 -405
- package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +0 -352
- package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +0 -89
- package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +0 -360
- package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +0 -446
- package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +0 -363
- package/references/multi-agent-protocol/docs-site/sdk/index.md +0 -206
- package/references/multi-agent-protocol/package-lock.json +0 -3886
- package/references/multi-agent-protocol/package.json +0 -56
- package/references/multi-agent-protocol/schema/meta.json +0 -467
- package/references/multi-agent-protocol/schema/schema.json +0 -2558
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Error Handling
|
|
3
|
-
parent: Protocol
|
|
4
|
-
nav_order: 5
|
|
5
|
-
description: "Error taxonomy, codes, and recovery mechanisms"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Error Handling
|
|
9
|
-
{: .no_toc }
|
|
10
|
-
|
|
11
|
-
Error taxonomy, failure modes, and recovery mechanisms.
|
|
12
|
-
{: .fs-6 .fw-300 }
|
|
13
|
-
|
|
14
|
-
## Table of contents
|
|
15
|
-
{: .no_toc .text-delta }
|
|
16
|
-
|
|
17
|
-
1. TOC
|
|
18
|
-
{:toc}
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Design Goals
|
|
23
|
-
|
|
24
|
-
1. **Graceful degradation** - Partial failures don't cascade to total failure
|
|
25
|
-
2. **Clear error taxonomy** - Distinct error types with actionable codes
|
|
26
|
-
3. **Recovery semantics** - Well-defined reconnection and replay behavior
|
|
27
|
-
4. **Federation resilience** - Cross-system failures handled gracefully
|
|
28
|
-
5. **Observability** - Errors are traceable and debuggable
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## Error Structure
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
interface MAPError {
|
|
36
|
-
code: number; // Numeric code
|
|
37
|
-
category: MAPErrorCategory;
|
|
38
|
-
message: string; // Human-readable
|
|
39
|
-
|
|
40
|
-
details?: {
|
|
41
|
-
agentId?: string;
|
|
42
|
-
messageId?: string;
|
|
43
|
-
method?: string;
|
|
44
|
-
retryable?: boolean;
|
|
45
|
-
retryAfter?: number; // Milliseconds
|
|
46
|
-
recoveryHint?: string;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
traceId?: string;
|
|
50
|
-
timestamp?: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
type MAPErrorCategory =
|
|
54
|
-
| "protocol" // Wire protocol violations
|
|
55
|
-
| "auth" // Authentication/authorization
|
|
56
|
-
| "routing" // Message delivery failures
|
|
57
|
-
| "agent" // Agent lifecycle errors
|
|
58
|
-
| "resource" // Resource exhaustion
|
|
59
|
-
| "federation" // Cross-system errors
|
|
60
|
-
| "internal"; // Server internal errors
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Error Codes
|
|
66
|
-
|
|
67
|
-
### Protocol Errors (-32xxx)
|
|
68
|
-
|
|
69
|
-
JSON-RPC compatible error codes:
|
|
70
|
-
|
|
71
|
-
| Code | Name | Description |
|
|
72
|
-
|:-----|:-----|:------------|
|
|
73
|
-
| -32700 | PARSE_ERROR | Invalid JSON |
|
|
74
|
-
| -32600 | INVALID_REQUEST | Invalid request structure |
|
|
75
|
-
| -32601 | METHOD_NOT_FOUND | Method does not exist |
|
|
76
|
-
| -32602 | INVALID_PARAMS | Invalid method parameters |
|
|
77
|
-
| -32603 | INTERNAL_ERROR | Internal server error |
|
|
78
|
-
|
|
79
|
-
### Authentication Errors (1xxx)
|
|
80
|
-
|
|
81
|
-
| Code | Name | Description | Retryable |
|
|
82
|
-
|:-----|:-----|:------------|:----------|
|
|
83
|
-
| 1000 | AUTH_REQUIRED | Authentication required | Yes (with credentials) |
|
|
84
|
-
| 1001 | AUTH_FAILED | Invalid credentials | No |
|
|
85
|
-
| 1002 | AUTH_EXPIRED | Token expired | Yes (with refresh) |
|
|
86
|
-
| 1003 | PERMISSION_DENIED | Insufficient permissions | No |
|
|
87
|
-
|
|
88
|
-
### Routing Errors (2xxx)
|
|
89
|
-
|
|
90
|
-
| Code | Name | Description | Retryable |
|
|
91
|
-
|:-----|:-----|:------------|:----------|
|
|
92
|
-
| 2000 | AGENT_NOT_FOUND | Target agent doesn't exist | No |
|
|
93
|
-
| 2001 | AGENT_STOPPED | Target agent has stopped | No |
|
|
94
|
-
| 2002 | AGENT_BUSY | Target agent at capacity | Yes |
|
|
95
|
-
| 2003 | SCOPE_NOT_FOUND | Target scope doesn't exist | No |
|
|
96
|
-
| 2004 | NO_RECIPIENTS | No valid recipients | No |
|
|
97
|
-
| 2005 | PERMISSION_DENIED | Cannot message target | No |
|
|
98
|
-
| 2006 | DELIVERY_FAILED | Message delivery failed | Yes |
|
|
99
|
-
| 2007 | DELIVERY_TIMEOUT | Delivery timed out | Yes |
|
|
100
|
-
|
|
101
|
-
### Agent Lifecycle Errors (3xxx)
|
|
102
|
-
|
|
103
|
-
| Code | Name | Description | Retryable |
|
|
104
|
-
|:-----|:-----|:------------|:----------|
|
|
105
|
-
| 3000 | AGENT_EXISTS | Agent ID already registered | No |
|
|
106
|
-
| 3001 | INVALID_PARENT | Parent agent doesn't exist | No |
|
|
107
|
-
| 3002 | HIERARCHY_CYCLE | Would create cycle in hierarchy | No |
|
|
108
|
-
| 3003 | MAX_AGENTS_EXCEEDED | System at capacity | Yes |
|
|
109
|
-
| 3004 | INVALID_STATE | Invalid state transition | No |
|
|
110
|
-
| 3005 | SPAWN_FAILED | Child agent spawn failed | Yes |
|
|
111
|
-
|
|
112
|
-
### Resource Errors (4xxx)
|
|
113
|
-
|
|
114
|
-
| Code | Name | Description | Retryable |
|
|
115
|
-
|:-----|:-----|:------------|:----------|
|
|
116
|
-
| 4000 | RATE_LIMITED | Too many requests | Yes |
|
|
117
|
-
| 4001 | QUOTA_EXCEEDED | Resource quota exceeded | No |
|
|
118
|
-
| 4002 | BUFFER_OVERFLOW | Event buffer overflow | Yes |
|
|
119
|
-
| 4003 | MAX_SUBSCRIPTIONS | Subscription limit reached | No |
|
|
120
|
-
| 4004 | MESSAGE_TOO_LARGE | Payload exceeds limit | No |
|
|
121
|
-
|
|
122
|
-
### Federation Errors (5xxx)
|
|
123
|
-
|
|
124
|
-
| Code | Name | Description | Retryable |
|
|
125
|
-
|:-----|:-----|:------------|:----------|
|
|
126
|
-
| 5000 | PEER_UNREACHABLE | Cannot connect to peer | Yes |
|
|
127
|
-
| 5001 | PEER_TIMEOUT | Peer response timeout | Yes |
|
|
128
|
-
| 5002 | PEER_REJECTED | Peer rejected connection | No |
|
|
129
|
-
| 5003 | ROUTING_FAILED | Cross-system routing failed | Yes |
|
|
130
|
-
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
## Agent Failure Modes
|
|
134
|
-
|
|
135
|
-
### 1. Graceful Shutdown
|
|
136
|
-
|
|
137
|
-
```
|
|
138
|
-
Agent: sends shutdown intent
|
|
139
|
-
Server: drains queue, notifies parent, cleans up
|
|
140
|
-
Recovery: None needed (intentional)
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### 2. Crash (Unexpected Termination)
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
Detection: Heartbeat timeout, process exit
|
|
147
|
-
Server: Marks stopped, notifies parent, orphan handling
|
|
148
|
-
Recovery: Restart with same ID or spawn replacement
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### 3. Hang (Unresponsive)
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
Detection: Request timeout, no heartbeat
|
|
155
|
-
Server: Marks blocked, notifies parent
|
|
156
|
-
Recovery: Force restart or manual intervention
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### 4. Error Loop (Repeated Failures)
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
Detection: Error rate threshold exceeded
|
|
163
|
-
Server: Circuit breaker, reduce routing
|
|
164
|
-
Recovery: Exponential backoff restart
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Orphan Handling
|
|
170
|
-
|
|
171
|
-
When an agent fails, its children and pending work must be handled:
|
|
172
|
-
|
|
173
|
-
```typescript
|
|
174
|
-
interface OrphanPolicy {
|
|
175
|
-
tasks: "reassign" | "return_to_parent" | "fail" | "hold";
|
|
176
|
-
children: "cascade_stop" | "reparent" | "orphan";
|
|
177
|
-
messages: "drop" | "bounce" | "redirect";
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Default Policy
|
|
182
|
-
|
|
183
|
-
```typescript
|
|
184
|
-
const DEFAULT_ORPHAN_POLICY: OrphanPolicy = {
|
|
185
|
-
tasks: "return_to_parent",
|
|
186
|
-
children: "cascade_stop",
|
|
187
|
-
messages: "bounce"
|
|
188
|
-
};
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## Circuit Breakers
|
|
194
|
-
|
|
195
|
-
Per-agent circuit breakers prevent cascading failures:
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
interface CircuitBreakerState {
|
|
199
|
-
agentId: string;
|
|
200
|
-
state: "closed" | "open" | "half-open";
|
|
201
|
-
|
|
202
|
-
// Thresholds
|
|
203
|
-
failureThreshold: number; // Failures to open
|
|
204
|
-
successThreshold: number; // Successes to close
|
|
205
|
-
timeout: number; // Time before half-open
|
|
206
|
-
|
|
207
|
-
// Counters
|
|
208
|
-
failureCount: number;
|
|
209
|
-
successCount: number;
|
|
210
|
-
lastFailure: number;
|
|
211
|
-
lastStateChange: number;
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Circuit Breaker States
|
|
216
|
-
|
|
217
|
-
```mermaid
|
|
218
|
-
stateDiagram-v2
|
|
219
|
-
[*] --> CLOSED
|
|
220
|
-
CLOSED --> OPEN: failure threshold
|
|
221
|
-
OPEN --> HALF_OPEN: timeout
|
|
222
|
-
HALF_OPEN --> CLOSED: success
|
|
223
|
-
HALF_OPEN --> OPEN: failure
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Retry Policies
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
interface RetryPolicy {
|
|
232
|
-
maxAttempts: number;
|
|
233
|
-
backoff: {
|
|
234
|
-
type: "exponential" | "linear" | "constant";
|
|
235
|
-
initial: number; // Initial delay (ms)
|
|
236
|
-
max: number; // Maximum delay (ms)
|
|
237
|
-
multiplier?: number; // For exponential
|
|
238
|
-
};
|
|
239
|
-
retryableErrors: number[];
|
|
240
|
-
nonRetryableErrors: number[];
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Default policy
|
|
244
|
-
const DEFAULT_RETRY: RetryPolicy = {
|
|
245
|
-
maxAttempts: 3,
|
|
246
|
-
backoff: {
|
|
247
|
-
type: "exponential",
|
|
248
|
-
initial: 1000,
|
|
249
|
-
max: 30000,
|
|
250
|
-
multiplier: 2
|
|
251
|
-
},
|
|
252
|
-
retryableErrors: [2002, 2007, 4000, 5001],
|
|
253
|
-
nonRetryableErrors: [1001, 1003, 2000, 3002]
|
|
254
|
-
};
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## Reconnection Protocol
|
|
260
|
-
|
|
261
|
-
```mermaid
|
|
262
|
-
sequenceDiagram
|
|
263
|
-
participant Client
|
|
264
|
-
participant Server
|
|
265
|
-
|
|
266
|
-
Server--xClient: Connection Lost
|
|
267
|
-
Note over Client: Backoff: 1s, 2s, 4s, 8s...
|
|
268
|
-
Client->>Server: Reconnect Attempt
|
|
269
|
-
Server-->>Client: Connection Accept
|
|
270
|
-
Client->>Server: map/reconnect {lastEventId, subscriptions}
|
|
271
|
-
Server-->>Client: Reconnect Response {missedEvents, newState}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
## Distributed Tracing
|
|
277
|
-
|
|
278
|
-
All errors include tracing context:
|
|
279
|
-
|
|
280
|
-
```typescript
|
|
281
|
-
interface TracingContext {
|
|
282
|
-
traceId: string; // Unique trace identifier
|
|
283
|
-
spanId: string; // Current span
|
|
284
|
-
parentSpanId?: string;
|
|
285
|
-
baggage?: Record<string, string>;
|
|
286
|
-
}
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
Errors propagate tracing information:
|
|
290
|
-
|
|
291
|
-
```typescript
|
|
292
|
-
{
|
|
293
|
-
"error": {
|
|
294
|
-
"code": 2006,
|
|
295
|
-
"category": "routing",
|
|
296
|
-
"message": "Delivery failed: agent_001 not responding",
|
|
297
|
-
"details": {
|
|
298
|
-
"agentId": "agent_001",
|
|
299
|
-
"retryable": true,
|
|
300
|
-
"retryAfter": 5000
|
|
301
|
-
},
|
|
302
|
-
"traceId": "abc123def456"
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
---
|
|
308
|
-
|
|
309
|
-
## Next Steps
|
|
310
|
-
|
|
311
|
-
- [Authentication](./authentication.html) - Auth error handling
|
|
312
|
-
- [Federation](./federation.html) - Cross-system error handling
|