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,376 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Connection Model
|
|
3
|
-
parent: Protocol
|
|
4
|
-
nav_order: 4
|
|
5
|
-
description: "Connection lifecycle and client patterns"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Connection Model
|
|
9
|
-
{: .no_toc }
|
|
10
|
-
|
|
11
|
-
How clients connect to MAP systems and the flexibility of subscription patterns.
|
|
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 Principles
|
|
23
|
-
|
|
24
|
-
1. **Single protocol, multiple patterns** - Same wire protocol supports ACP-like single-agent focus through full system observation
|
|
25
|
-
2. **Subscription-driven visibility** - What you see depends on what you subscribe to
|
|
26
|
-
3. **SDK, not protocol, handles conversion** - Protocol stays simple; SDK provides utilities for common patterns
|
|
27
|
-
4. **Multi-agent system is the endpoint** - Clients connect to the system, not individual agents
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Connection Lifecycle
|
|
32
|
-
|
|
33
|
-
### Phase 1: Transport Connection
|
|
34
|
-
|
|
35
|
-
```mermaid
|
|
36
|
-
sequenceDiagram
|
|
37
|
-
participant Client
|
|
38
|
-
participant MAP System
|
|
39
|
-
|
|
40
|
-
Client->>MAP System: Transport Connect (WebSocket, stdio, etc.)
|
|
41
|
-
MAP System-->>Client: Transport Accept
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Phase 2: MAP Handshake
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
// Client sends connect request
|
|
48
|
-
{
|
|
49
|
-
"method": "map/connect",
|
|
50
|
-
"params": {
|
|
51
|
-
"clientId": "client_001",
|
|
52
|
-
"clientInfo": {
|
|
53
|
-
"name": "my-dashboard",
|
|
54
|
-
"version": "1.0.0"
|
|
55
|
-
},
|
|
56
|
-
"protocolVersion": "2025-01-01",
|
|
57
|
-
"requestedCapabilities": {
|
|
58
|
-
"streaming": true,
|
|
59
|
-
"maxSubscriptions": 10,
|
|
60
|
-
"federation": false
|
|
61
|
-
},
|
|
62
|
-
"auth": {
|
|
63
|
-
"method": "bearer",
|
|
64
|
-
"credential": "..."
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Server responds
|
|
70
|
-
{
|
|
71
|
-
"result": {
|
|
72
|
-
"sessionId": "session_abc123",
|
|
73
|
-
"participantId": "client_001",
|
|
74
|
-
"serverCapabilities": {
|
|
75
|
-
"streaming": true,
|
|
76
|
-
"maxSubscriptions": 100,
|
|
77
|
-
"federation": true,
|
|
78
|
-
"replay": true
|
|
79
|
-
},
|
|
80
|
-
"systemInfo": {
|
|
81
|
-
"name": "MAP Server",
|
|
82
|
-
"version": "1.0.0",
|
|
83
|
-
"agents": 15
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Client Types
|
|
92
|
-
|
|
93
|
-
### Operator Client
|
|
94
|
-
|
|
95
|
-
Full control over the system.
|
|
96
|
-
|
|
97
|
-
**Typical permissions:**
|
|
98
|
-
- Full visibility to all agents, scopes, events
|
|
99
|
-
- Can send messages to any agent
|
|
100
|
-
- Can register/unregister agents
|
|
101
|
-
- Can steer agents (inject context)
|
|
102
|
-
- Can create/delete scopes
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
const client = new ClientConnection(stream, {
|
|
106
|
-
name: "operator-console",
|
|
107
|
-
permissions: "operator"
|
|
108
|
-
});
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Observer Client
|
|
112
|
-
|
|
113
|
-
Read-only visibility into the system.
|
|
114
|
-
|
|
115
|
-
**Typical permissions:**
|
|
116
|
-
- Full or scoped visibility
|
|
117
|
-
- Cannot send messages
|
|
118
|
-
- Cannot modify agents or scopes
|
|
119
|
-
- Useful for dashboards, monitoring
|
|
120
|
-
|
|
121
|
-
```typescript
|
|
122
|
-
const client = new ClientConnection(stream, {
|
|
123
|
-
name: "monitoring-dashboard",
|
|
124
|
-
permissions: "observer"
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Agent Client
|
|
129
|
-
|
|
130
|
-
An agent connecting to participate in the system.
|
|
131
|
-
|
|
132
|
-
**Typical permissions:**
|
|
133
|
-
- Visibility scoped to hierarchy/relationships
|
|
134
|
-
- Can send messages to permitted agents
|
|
135
|
-
- Receives messages addressed to itself
|
|
136
|
-
- Cannot see full system structure (unless permitted)
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
const agent = new AgentConnection(stream, {
|
|
140
|
-
name: "worker-agent",
|
|
141
|
-
role: "processor"
|
|
142
|
-
});
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Subscription Patterns
|
|
148
|
-
|
|
149
|
-
### Pattern 1: Single-Agent Focus (ACP-like)
|
|
150
|
-
|
|
151
|
-
Observe only one agent:
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
await client.subscribe({
|
|
155
|
-
filter: { agents: ["agent_001"] },
|
|
156
|
-
streams: ["messages", "state"]
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Pattern 2: Multi-Agent Dashboard
|
|
161
|
-
|
|
162
|
-
Observe specific agents:
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
await client.subscribe({
|
|
166
|
-
filter: {
|
|
167
|
-
agents: ["worker_001", "worker_002", "coordinator"]
|
|
168
|
-
},
|
|
169
|
-
streams: ["messages", "state"]
|
|
170
|
-
});
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Pattern 3: Role-Based Observation
|
|
174
|
-
|
|
175
|
-
Observe all agents with specific roles:
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
await client.subscribe({
|
|
179
|
-
filter: { roles: ["worker"] },
|
|
180
|
-
streams: ["messages", "state"]
|
|
181
|
-
});
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Pattern 4: Full System Observation
|
|
185
|
-
|
|
186
|
-
See everything:
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
await client.subscribe({
|
|
190
|
-
filter: {}, // Empty filter = no filtering
|
|
191
|
-
streams: ["messages", "state", "structure"]
|
|
192
|
-
});
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Pattern 5: Hierarchical Observation
|
|
196
|
-
|
|
197
|
-
Observe an agent and all its descendants:
|
|
198
|
-
|
|
199
|
-
```typescript
|
|
200
|
-
await client.subscribe({
|
|
201
|
-
filter: { subtree: "coordinator_001" },
|
|
202
|
-
streams: ["messages", "state", "tasks"]
|
|
203
|
-
});
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Connection State Management
|
|
209
|
-
|
|
210
|
-
```mermaid
|
|
211
|
-
stateDiagram-v2
|
|
212
|
-
[*] --> INITIAL
|
|
213
|
-
INITIAL --> CONNECTING: connect
|
|
214
|
-
CONNECTING --> ACTIVE: ready
|
|
215
|
-
CONNECTING --> CLOSED: handshake failure
|
|
216
|
-
ACTIVE --> CLOSED: disconnect
|
|
217
|
-
ACTIVE --> RECONNECT: error
|
|
218
|
-
RECONNECT --> ACTIVE: reconnect success
|
|
219
|
-
RECONNECT --> CLOSED: max retries exceeded
|
|
220
|
-
CLOSED --> [*]
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### State Transitions
|
|
224
|
-
|
|
225
|
-
| From | Event | To |
|
|
226
|
-
|:-----|:------|:---|
|
|
227
|
-
| INITIAL | `connect()` | CONNECTING |
|
|
228
|
-
| CONNECTING | handshake success | ACTIVE |
|
|
229
|
-
| CONNECTING | handshake failure | CLOSED |
|
|
230
|
-
| ACTIVE | connection lost | RECONNECT |
|
|
231
|
-
| ACTIVE | `disconnect()` | CLOSED |
|
|
232
|
-
| RECONNECT | reconnect success | ACTIVE |
|
|
233
|
-
| RECONNECT | max retries | CLOSED |
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## Reconnection
|
|
238
|
-
|
|
239
|
-
### Automatic Reconnection
|
|
240
|
-
|
|
241
|
-
```typescript
|
|
242
|
-
const client = new ClientConnection(stream, {
|
|
243
|
-
name: "my-client",
|
|
244
|
-
reconnect: {
|
|
245
|
-
enabled: true,
|
|
246
|
-
maxAttempts: 5,
|
|
247
|
-
baseDelay: 1000,
|
|
248
|
-
maxDelay: 30000,
|
|
249
|
-
backoffMultiplier: 2
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### Reconnection Protocol
|
|
255
|
-
|
|
256
|
-
```mermaid
|
|
257
|
-
sequenceDiagram
|
|
258
|
-
participant Client
|
|
259
|
-
participant Server
|
|
260
|
-
|
|
261
|
-
Server--xClient: Connection Lost
|
|
262
|
-
Note over Client: Backoff: 1s, 2s, 4s, 8s...
|
|
263
|
-
Client->>Server: Reconnect Attempt
|
|
264
|
-
Server-->>Client: Connection Accept
|
|
265
|
-
Client->>Server: map/reconnect {sessionId, lastEventId}
|
|
266
|
-
Server-->>Client: Reconnect Response {restored, missedEvents}
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Session Restoration
|
|
270
|
-
|
|
271
|
-
```typescript
|
|
272
|
-
{
|
|
273
|
-
"method": "map/reconnect",
|
|
274
|
-
"params": {
|
|
275
|
-
"sessionId": "session_abc123",
|
|
276
|
-
"lastEventId": "evt_xyz789",
|
|
277
|
-
"subscriptions": ["sub_001", "sub_002"]
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// Response
|
|
282
|
-
{
|
|
283
|
-
"result": {
|
|
284
|
-
"restored": true,
|
|
285
|
-
"sessionId": "session_abc123",
|
|
286
|
-
"subscriptions": {
|
|
287
|
-
"sub_001": { "restored": true, "missedEvents": 15 },
|
|
288
|
-
"sub_002": { "restored": true, "missedEvents": 3 }
|
|
289
|
-
},
|
|
290
|
-
"replayAvailable": true
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## SDK Utilities
|
|
298
|
-
|
|
299
|
-
### ACP Session Adapter
|
|
300
|
-
|
|
301
|
-
Convert MAP connection to ACP-compatible session:
|
|
302
|
-
|
|
303
|
-
```typescript
|
|
304
|
-
// Create ACP-compatible session from MAP connection
|
|
305
|
-
const session = client.createACPSession("agent_001");
|
|
306
|
-
|
|
307
|
-
// Now use ACP-like API
|
|
308
|
-
await session.prompt("Hello, world");
|
|
309
|
-
for await (const chunk of session.stream()) {
|
|
310
|
-
console.log(chunk);
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### Stream Aggregator
|
|
315
|
-
|
|
316
|
-
Combine multiple subscriptions:
|
|
317
|
-
|
|
318
|
-
```typescript
|
|
319
|
-
const aggregated = client.aggregateStreams([sub1, sub2, sub3]);
|
|
320
|
-
|
|
321
|
-
for await (const event of aggregated) {
|
|
322
|
-
console.log(event.subscriptionId, event.event);
|
|
323
|
-
}
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### Agent Proxy
|
|
327
|
-
|
|
328
|
-
Create a proxy object for an agent:
|
|
329
|
-
|
|
330
|
-
```typescript
|
|
331
|
-
const agent = client.createAgentProxy("agent_001");
|
|
332
|
-
|
|
333
|
-
// Direct method calls become messages
|
|
334
|
-
await agent.send({ type: "task", data: "..." });
|
|
335
|
-
|
|
336
|
-
// State is automatically updated
|
|
337
|
-
console.log(agent.state); // "busy"
|
|
338
|
-
|
|
339
|
-
// Events are surfaced
|
|
340
|
-
agent.on("stateChange", (prev, curr) => {
|
|
341
|
-
console.log(`State: ${prev} → ${curr}`);
|
|
342
|
-
});
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
## Capability Negotiation
|
|
348
|
-
|
|
349
|
-
Clients and servers negotiate capabilities during connection:
|
|
350
|
-
|
|
351
|
-
```typescript
|
|
352
|
-
interface CapabilityNegotiation {
|
|
353
|
-
// Client requests
|
|
354
|
-
requested: {
|
|
355
|
-
streaming: boolean;
|
|
356
|
-
maxSubscriptions: number;
|
|
357
|
-
federation: boolean;
|
|
358
|
-
replay: boolean;
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
// Server grants (may be less than requested)
|
|
362
|
-
granted: {
|
|
363
|
-
streaming: boolean;
|
|
364
|
-
maxSubscriptions: number;
|
|
365
|
-
federation: boolean;
|
|
366
|
-
replay: boolean;
|
|
367
|
-
};
|
|
368
|
-
}
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
---
|
|
372
|
-
|
|
373
|
-
## Next Steps
|
|
374
|
-
|
|
375
|
-
- [Error Handling](./error-handling.html) - Handling connection failures
|
|
376
|
-
- [Authentication](./authentication.html) - Authentication flows
|
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Design
|
|
3
|
-
parent: Protocol
|
|
4
|
-
nav_order: 1
|
|
5
|
-
description: "MAP protocol design philosophy and architecture"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Protocol Design
|
|
9
|
-
{: .no_toc }
|
|
10
|
-
|
|
11
|
-
Core architecture, design philosophy, and the unified participant model.
|
|
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 Philosophy
|
|
23
|
-
|
|
24
|
-
**Primary Abstraction**: The agent and its relationships to other agents, followed by the messages that flow between them.
|
|
25
|
-
|
|
26
|
-
**Core Principle**: MAP treats the multi-agent system as a **transparent, observable entity** rather than an opaque black box. Clients connecting via MAP can see (with appropriate permissions) the internal structure and activity of the system.
|
|
27
|
-
|
|
28
|
-
### Key Design Principles
|
|
29
|
-
|
|
30
|
-
1. **Topology is configuration, not protocol** - The same protocol supports hierarchical orchestration (like Claude Code's Task agents) and peer collaboration
|
|
31
|
-
2. **Unified messaging with metadata** - One message type with metadata that specializes behavior (task delegation, peer messaging, broadcast)
|
|
32
|
-
3. **Visibility is first-class** - Agents and scopes have explicit visibility settings; "parent-only" visibility enables hidden sub-agents
|
|
33
|
-
4. **Lifecycle is descriptive, not prescriptive** - Protocol records lifecycle metadata; implementations decide how to enforce it
|
|
34
|
-
5. **Extensibility at every layer** - States, lifecycle patterns, visibility levels, and message metadata are all extensible
|
|
35
|
-
6. **Unified participant model** - Agents and clients speak the same protocol; difference is in capabilities and visibility, not in the wire format
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## What MAP Is NOT
|
|
40
|
-
|
|
41
|
-
- **Not ACP**: ACP is client ↔ single agent. MAP is client ↔ multi-agent system.
|
|
42
|
-
- **Not A2A**: A2A is peer agent ↔ peer agent (opaque). MAP is for internal systems with visibility.
|
|
43
|
-
- **Not a replacement**: MAP complements ACP/A2A. Agents can use ACP for client interaction, A2A for external peers, and MAP for internal coordination.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Protocol Landscape
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
51
|
-
│ Agent Protocol Ecosystem │
|
|
52
|
-
├─────────────────────────────────────────────────────────────────────────────┤
|
|
53
|
-
│ │
|
|
54
|
-
│ Protocol Relationship Visibility Primary Use │
|
|
55
|
-
│ ──────── ──────────── ────────── ─────────── │
|
|
56
|
-
│ MCP Agent → Tool N/A Tool invocation │
|
|
57
|
-
│ ACP Client → Agent Opaque Single-agent sessions │
|
|
58
|
-
│ A2A Agent → Agent (peer) Opaque Cross-org delegation │
|
|
59
|
-
│ MAP Client → System Transparent Internal orchestration │
|
|
60
|
-
│ Agent → Agent (internal) │
|
|
61
|
-
│ │
|
|
62
|
-
└─────────────────────────────────────────────────────────────────────────────┘
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Integration Patterns
|
|
66
|
-
|
|
67
|
-
**Pattern 1: MAP + ACP (Hybrid Client)**
|
|
68
|
-
```
|
|
69
|
-
Client uses ACP for single-agent focus, MAP for system awareness.
|
|
70
|
-
The MAP SDK can convert MAP streams into ACP-compatible sessions.
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
**Pattern 2: MAP + A2A (Federated Systems)**
|
|
74
|
-
```
|
|
75
|
-
Internal coordination via MAP.
|
|
76
|
-
External peer communication via A2A.
|
|
77
|
-
Individual agents can participate in both.
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Pattern 3: MAP-to-MAP (System Federation)**
|
|
81
|
-
```
|
|
82
|
-
Two MAP systems can communicate via their exposed message channels.
|
|
83
|
-
Each system remains internally transparent, externally opaque.
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Unified Participant Model
|
|
89
|
-
|
|
90
|
-
A core design principle of MAP is that **agents and clients speak the same protocol**. The difference is not in the wire format, but in:
|
|
91
|
-
|
|
92
|
-
- **Capabilities**: What actions they can perform
|
|
93
|
-
- **Visibility**: What they can see
|
|
94
|
-
- **Transport**: How they connect
|
|
95
|
-
|
|
96
|
-
This enables:
|
|
97
|
-
- Consistent semantics across all participants
|
|
98
|
-
- Federation as a natural extension (remote agents are just participants)
|
|
99
|
-
- Hierarchical composition (agents can be servers to their children)
|
|
100
|
-
- Transport optimization without protocol changes
|
|
101
|
-
|
|
102
|
-
### Participant Types
|
|
103
|
-
|
|
104
|
-
```typescript
|
|
105
|
-
interface MAPParticipant {
|
|
106
|
-
id: string;
|
|
107
|
-
type: "agent" | "client" | "system" | "gateway";
|
|
108
|
-
|
|
109
|
-
// What this participant can see
|
|
110
|
-
visibility: MAPParticipantVisibility;
|
|
111
|
-
|
|
112
|
-
// What this participant can do
|
|
113
|
-
capabilities: MAPParticipantCapabilities;
|
|
114
|
-
|
|
115
|
-
// How this participant is connected
|
|
116
|
-
transport: MAPTransport;
|
|
117
|
-
|
|
118
|
-
// Session information
|
|
119
|
-
session?: MAPSession;
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Capability Matrix
|
|
124
|
-
|
|
125
|
-
| Capability | Client | Agent | System | Gateway |
|
|
126
|
-
|:-----------|:-------|:------|:-------|:--------|
|
|
127
|
-
| canObserve | ✓ | ✓* | ✓ | ✓* |
|
|
128
|
-
| canQuery | ✓ | ✓* | ✓ | ✓* |
|
|
129
|
-
| canSend | ✓* | ✓ | ✓ | ✓ |
|
|
130
|
-
| canReceive | ✗ | ✓ | ✓ | ✓ |
|
|
131
|
-
| canBroadcast | ✗ | ✓* | ✓ | ✗ |
|
|
132
|
-
| canSpawn | ✗ | ✓ | ✓ | ✗ |
|
|
133
|
-
| canRegister | ✗ | ✓* | ✓ | ✗ |
|
|
134
|
-
| canSteer | ✓* | ✓* | ✓ | ✗ |
|
|
135
|
-
| canCreateScopes | ✗ | ✓* | ✓ | ✗ |
|
|
136
|
-
|
|
137
|
-
✓ = default yes, ✗ = default no, * = depends on permissions
|
|
138
|
-
{: .fs-2 }
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Core Objects
|
|
143
|
-
|
|
144
|
-
### Agent
|
|
145
|
-
|
|
146
|
-
The fundamental unit in the system:
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
interface MAPAgent {
|
|
150
|
-
id: string;
|
|
151
|
-
name?: string;
|
|
152
|
-
|
|
153
|
-
// Relationships
|
|
154
|
-
parent?: string; // Hierarchical parent
|
|
155
|
-
relationships?: MAPRelationship[]; // Other connections
|
|
156
|
-
|
|
157
|
-
// State (extensible)
|
|
158
|
-
state: MAPAgentState;
|
|
159
|
-
|
|
160
|
-
// Classification
|
|
161
|
-
role?: string;
|
|
162
|
-
scopes: string[];
|
|
163
|
-
|
|
164
|
-
// Visibility
|
|
165
|
-
visibility?: MAPVisibility;
|
|
166
|
-
|
|
167
|
-
// Lifecycle
|
|
168
|
-
lifecycle?: MAPAgentLifecycle;
|
|
169
|
-
|
|
170
|
-
// Metadata
|
|
171
|
-
metadata?: Record<string, unknown>;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
type MAPAgentState =
|
|
175
|
-
| "registered" // Known to system, not yet active
|
|
176
|
-
| "active" // Running and responsive
|
|
177
|
-
| "busy" // Active but processing
|
|
178
|
-
| "idle" // Active but waiting
|
|
179
|
-
| "suspended" // Paused, can be resumed
|
|
180
|
-
| "stopping" // Shutting down gracefully
|
|
181
|
-
| "stopped" // Terminated
|
|
182
|
-
| "failed"; // Error state
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Message
|
|
186
|
-
|
|
187
|
-
Messages flow between agents:
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
interface MAPMessage {
|
|
191
|
-
id: string;
|
|
192
|
-
from: string;
|
|
193
|
-
to: MAPAddress;
|
|
194
|
-
payload: unknown;
|
|
195
|
-
meta?: {
|
|
196
|
-
priority?: "low" | "normal" | "high" | "urgent";
|
|
197
|
-
delivery?: "inject" | "interrupt" | "queue" | "best-effort";
|
|
198
|
-
ttl?: number;
|
|
199
|
-
requireAck?: boolean;
|
|
200
|
-
};
|
|
201
|
-
timestamp: number;
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Scope
|
|
206
|
-
|
|
207
|
-
Logical groupings for agents:
|
|
208
|
-
|
|
209
|
-
```typescript
|
|
210
|
-
interface MAPScope {
|
|
211
|
-
id: string;
|
|
212
|
-
name?: string;
|
|
213
|
-
type: "room" | "topic" | "project" | "custom";
|
|
214
|
-
members: string[];
|
|
215
|
-
visibility?: MAPVisibility;
|
|
216
|
-
permissions?: MAPScopePermissions;
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## Hierarchical Composition
|
|
223
|
-
|
|
224
|
-
Agents can be both clients (to their parent/system) and servers (to their children):
|
|
225
|
-
|
|
226
|
-
```mermaid
|
|
227
|
-
flowchart TB
|
|
228
|
-
Client["External Client<br/>(dashboard)"]
|
|
229
|
-
|
|
230
|
-
subgraph System["MAP System"]
|
|
231
|
-
Coordinator["Coordinator<br/>• Receives from client<br/>• Routes to children"]
|
|
232
|
-
WorkerA["Worker A<br/>• Participant<br/>• Has children"]
|
|
233
|
-
WorkerB["Worker B<br/>• Participant"]
|
|
234
|
-
SubAgent["Sub-agent<br/>• Leaf node<br/>(Claude Code pattern)"]
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
Client -->|"MAP (websocket)"| Coordinator
|
|
238
|
-
Coordinator -->|"MAP (inprocess)"| WorkerA
|
|
239
|
-
Coordinator -->|"MAP (inprocess)"| WorkerB
|
|
240
|
-
WorkerA -->|"MAP (stdio)"| SubAgent
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## Transport Layer
|
|
246
|
-
|
|
247
|
-
MAP is transport-agnostic. The protocol defines message format and semantics; the transport layer handles delivery.
|
|
248
|
-
|
|
249
|
-
### Transport Interface
|
|
250
|
-
|
|
251
|
-
```typescript
|
|
252
|
-
interface MAPTransport {
|
|
253
|
-
type: string;
|
|
254
|
-
|
|
255
|
-
// Send a message or request
|
|
256
|
-
send(frame: MAPFrame): Promise<void>;
|
|
257
|
-
|
|
258
|
-
// Receive messages/events
|
|
259
|
-
receive(): AsyncIterable<MAPFrame>;
|
|
260
|
-
|
|
261
|
-
// Connection lifecycle
|
|
262
|
-
close(): Promise<void>;
|
|
263
|
-
|
|
264
|
-
// Connection state
|
|
265
|
-
state: "connecting" | "connected" | "disconnected" | "error";
|
|
266
|
-
}
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Built-in Transport Bindings
|
|
270
|
-
|
|
271
|
-
| Transport | Use Case | Framing |
|
|
272
|
-
|:----------|:---------|:--------|
|
|
273
|
-
| WebSocket | Remote clients, federation | JSON messages |
|
|
274
|
-
| stdio | Subprocess agents (Claude Code) | NDJSON (newline-delimited) |
|
|
275
|
-
| In-process | Co-located agents | Direct object passing |
|
|
276
|
-
| HTTP + SSE | Stateless clients | POST + Server-Sent Events |
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## Next Steps
|
|
281
|
-
|
|
282
|
-
- [Wire Protocol](./wire-protocol.html) - JSON-RPC message format
|
|
283
|
-
- [Streaming](./streaming.html) - Event subscriptions and filtering
|
|
284
|
-
- [Permissions](./permissions.html) - 4-layer visibility model
|