macro-agent 0.0.11 → 0.0.13
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 +5 -3
- 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,449 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Federation
|
|
3
|
-
parent: Protocol
|
|
4
|
-
nav_order: 8
|
|
5
|
-
description: "System-to-system communication and distributed architectures"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Federation
|
|
9
|
-
{: .no_toc }
|
|
10
|
-
|
|
11
|
-
Multi-system communication enabling distributed multi-agent architectures.
|
|
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. **Internal transparency, external opacity** - Each system is transparent internally but appears as a single entity externally
|
|
25
|
-
2. **MAP-native federation** - Systems communicate via MAP protocol, not A2A
|
|
26
|
-
3. **Gateway pattern** - Dedicated agents handle inter-system routing
|
|
27
|
-
4. **Selective exposure** - Each system controls what's visible to peers
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Federation Model
|
|
32
|
-
|
|
33
|
-
```mermaid
|
|
34
|
-
flowchart LR
|
|
35
|
-
subgraph Alpha["MAP System 'Alpha'"]
|
|
36
|
-
A1["Agent A"]
|
|
37
|
-
A2["Agent B"]
|
|
38
|
-
A3["Agent C"]
|
|
39
|
-
GW1["Gateway"]
|
|
40
|
-
A1 --> GW1
|
|
41
|
-
A2 --> GW1
|
|
42
|
-
A3 --> GW1
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
subgraph Beta["MAP System 'Beta'"]
|
|
46
|
-
B1["Agent X"]
|
|
47
|
-
B2["Agent Y"]
|
|
48
|
-
B3["Agent Z"]
|
|
49
|
-
GW2["Gateway"]
|
|
50
|
-
B1 --> GW2
|
|
51
|
-
B2 --> GW2
|
|
52
|
-
B3 --> GW2
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
GW1 <-->|"MAP Protocol"| GW2
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Why MAP for Federation (not A2A)?
|
|
61
|
-
|
|
62
|
-
| Aspect | A2A | MAP Federation |
|
|
63
|
-
|:-------|:----|:---------------|
|
|
64
|
-
| Visibility | Opaque peers | Configurable exposure |
|
|
65
|
-
| Streaming | Task-focused | Full event streams |
|
|
66
|
-
| Structure | Flat | Can expose partial hierarchy |
|
|
67
|
-
| Discovery | Agent Cards | Direct connection |
|
|
68
|
-
| Use case | Cross-org | Same-org distributed |
|
|
69
|
-
|
|
70
|
-
{: .highlight }
|
|
71
|
-
MAP federation is for **systems that trust each other** and want shared visibility.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Federation Configuration
|
|
76
|
-
|
|
77
|
-
```typescript
|
|
78
|
-
interface MAPFederationConfig {
|
|
79
|
-
enabled: boolean;
|
|
80
|
-
systemId: string;
|
|
81
|
-
|
|
82
|
-
systemInfo: {
|
|
83
|
-
name: string;
|
|
84
|
-
version: string;
|
|
85
|
-
endpoint: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
peers: MAPPeerConfig[];
|
|
89
|
-
exposure: MAPFederationExposure;
|
|
90
|
-
security: MAPFederationSecurity;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
interface MAPPeerConfig {
|
|
94
|
-
systemId: string;
|
|
95
|
-
endpoint: string;
|
|
96
|
-
|
|
97
|
-
connection: {
|
|
98
|
-
autoConnect: boolean;
|
|
99
|
-
reconnect: boolean;
|
|
100
|
-
healthCheckInterval: number;
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
accepts: {
|
|
104
|
-
messageTypes: string[];
|
|
105
|
-
maxMessagesPerMinute: number;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
auth: {
|
|
109
|
-
method: "mutual-tls" | "bearer" | "api-key";
|
|
110
|
-
credentials: unknown;
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
interface MAPFederationExposure {
|
|
115
|
-
agents: {
|
|
116
|
-
expose: "none" | "gateway" | "tagged" | "all";
|
|
117
|
-
tags?: string[];
|
|
118
|
-
};
|
|
119
|
-
scopes: {
|
|
120
|
-
expose: "none" | "tagged" | "all";
|
|
121
|
-
tags?: string[];
|
|
122
|
-
};
|
|
123
|
-
events: {
|
|
124
|
-
expose: string[];
|
|
125
|
-
};
|
|
126
|
-
structure: boolean;
|
|
127
|
-
}
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## Gateway Agent Pattern
|
|
133
|
-
|
|
134
|
-
Each system has a gateway agent that:
|
|
135
|
-
|
|
136
|
-
1. **Handles connections** from peer systems
|
|
137
|
-
2. **Routes messages** between internal agents and peers
|
|
138
|
-
3. **Enforces exposure policies**
|
|
139
|
-
4. **Translates addresses** between systems
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
interface GatewayAgent {
|
|
143
|
-
id: string;
|
|
144
|
-
role: "gateway";
|
|
145
|
-
|
|
146
|
-
// Connected peers
|
|
147
|
-
peers: Map<string, PeerConnection>;
|
|
148
|
-
|
|
149
|
-
// Exposure rules
|
|
150
|
-
exposure: MAPFederationExposure;
|
|
151
|
-
|
|
152
|
-
// Message routing
|
|
153
|
-
routeToRemote(message: MAPMessage, peerId: string): Promise<void>;
|
|
154
|
-
routeFromRemote(message: MAPMessage, peerId: string): Promise<void>;
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Federation Protocol
|
|
161
|
-
|
|
162
|
-
### Connection Establishment
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
{
|
|
166
|
-
"method": "map/federation/connect",
|
|
167
|
-
"params": {
|
|
168
|
-
"systemId": "alpha",
|
|
169
|
-
"systemInfo": {
|
|
170
|
-
"name": "Alpha System",
|
|
171
|
-
"version": "1.0.0",
|
|
172
|
-
"endpoint": "wss://alpha.example.com/map"
|
|
173
|
-
},
|
|
174
|
-
"protocolVersion": "2025-01-01",
|
|
175
|
-
"auth": {
|
|
176
|
-
"method": "mutual-tls",
|
|
177
|
-
"certificate": "..."
|
|
178
|
-
},
|
|
179
|
-
"exposure": {
|
|
180
|
-
"agents": { "expose": "tagged", "tags": ["public"] },
|
|
181
|
-
"scopes": { "expose": "tagged", "tags": ["federation"] },
|
|
182
|
-
"events": { "expose": ["message.sent", "agent.state"] }
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Response
|
|
188
|
-
{
|
|
189
|
-
"result": {
|
|
190
|
-
"accepted": true,
|
|
191
|
-
"peerId": "peer_alpha_001",
|
|
192
|
-
"peerExposure": {
|
|
193
|
-
"agents": { "expose": "tagged", "tags": ["public"] },
|
|
194
|
-
"scopes": { "expose": "tagged", "tags": ["shared"] },
|
|
195
|
-
"events": { "expose": ["message.sent"] }
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Cross-System Messaging
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
{
|
|
205
|
-
"method": "map/federation/send",
|
|
206
|
-
"params": {
|
|
207
|
-
"peerId": "beta",
|
|
208
|
-
"message": {
|
|
209
|
-
"from": { "system": "alpha", "agent": "agent_a" },
|
|
210
|
-
"to": { "system": "beta", "agent": "agent_x" },
|
|
211
|
-
"payload": {
|
|
212
|
-
"type": "task_request",
|
|
213
|
-
"data": { ... }
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
"meta": {
|
|
217
|
-
"ttl": 30000,
|
|
218
|
-
"requireAck": true
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## Federated Addressing
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
type MAPFederatedAddress =
|
|
230
|
-
// Specific agent in specific system
|
|
231
|
-
| { system: string; agent: string }
|
|
232
|
-
|
|
233
|
-
// Scope in specific system
|
|
234
|
-
| { system: string; scope: string }
|
|
235
|
-
|
|
236
|
-
// Role in specific system
|
|
237
|
-
| { system: string; role: string }
|
|
238
|
-
|
|
239
|
-
// Broadcast to all federated systems
|
|
240
|
-
| { federation: true }
|
|
241
|
-
|
|
242
|
-
// Broadcast to specific systems
|
|
243
|
-
| { federation: true; systems: string[] }
|
|
244
|
-
|
|
245
|
-
// Route through gateway
|
|
246
|
-
| { gateway: string; target: MAPAddress };
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### Address Resolution
|
|
250
|
-
|
|
251
|
-
```typescript
|
|
252
|
-
// Local agent
|
|
253
|
-
{ agent: "agent_001" }
|
|
254
|
-
|
|
255
|
-
// Remote agent
|
|
256
|
-
{ system: "beta", agent: "agent_x" }
|
|
257
|
-
|
|
258
|
-
// Remote scope
|
|
259
|
-
{ system: "beta", scope: "shared_workspace" }
|
|
260
|
-
|
|
261
|
-
// All federation peers
|
|
262
|
-
{ federation: true }
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
---
|
|
266
|
-
|
|
267
|
-
## Use Cases
|
|
268
|
-
|
|
269
|
-
### Use Case 1: Distributed Workload
|
|
270
|
-
|
|
271
|
-
Alpha handles task coordination, Beta handles execution:
|
|
272
|
-
|
|
273
|
-
```mermaid
|
|
274
|
-
flowchart LR
|
|
275
|
-
subgraph Alpha["Alpha System"]
|
|
276
|
-
Coord["Coordinator"]
|
|
277
|
-
GW1["Gateway"]
|
|
278
|
-
Dash["Dashboard"]
|
|
279
|
-
Coord --> GW1
|
|
280
|
-
GW1 --> Dash
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
subgraph Beta["Beta System"]
|
|
284
|
-
GW2["Gateway"]
|
|
285
|
-
Ex1["Executor 1"]
|
|
286
|
-
Ex2["Executor 2"]
|
|
287
|
-
GW2 --> Ex1
|
|
288
|
-
GW2 --> Ex2
|
|
289
|
-
end
|
|
290
|
-
|
|
291
|
-
GW1 -->|"tasks"| GW2
|
|
292
|
-
GW2 -->|"results"| GW1
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### Use Case 2: Regional Distribution
|
|
296
|
-
|
|
297
|
-
Each region has its own MAP system:
|
|
298
|
-
|
|
299
|
-
```mermaid
|
|
300
|
-
flowchart TB
|
|
301
|
-
subgraph US["US Region"]
|
|
302
|
-
USA["Agents"]
|
|
303
|
-
USGW["Gateway"]
|
|
304
|
-
USA --> USGW
|
|
305
|
-
end
|
|
306
|
-
|
|
307
|
-
subgraph EU["EU Region"]
|
|
308
|
-
EUA["Agents"]
|
|
309
|
-
EUGW["Gateway"]
|
|
310
|
-
EUA --> EUGW
|
|
311
|
-
end
|
|
312
|
-
|
|
313
|
-
subgraph Asia["Asia Region"]
|
|
314
|
-
AsiaA["Agents"]
|
|
315
|
-
AsiaGW["Gateway"]
|
|
316
|
-
AsiaA --> AsiaGW
|
|
317
|
-
end
|
|
318
|
-
|
|
319
|
-
USGW <--> EUGW
|
|
320
|
-
EUGW <--> AsiaGW
|
|
321
|
-
USGW <--> AsiaGW
|
|
322
|
-
|
|
323
|
-
Coord["Global Coordination"]
|
|
324
|
-
USGW -.-> Coord
|
|
325
|
-
EUGW -.-> Coord
|
|
326
|
-
AsiaGW -.-> Coord
|
|
327
|
-
```
|
|
328
|
-
|
|
329
|
-
### Use Case 3: Secure Computation
|
|
330
|
-
|
|
331
|
-
Sensitive work isolated in secure system:
|
|
332
|
-
|
|
333
|
-
```mermaid
|
|
334
|
-
flowchart LR
|
|
335
|
-
subgraph Public["Public System"]
|
|
336
|
-
User["User Agent"]
|
|
337
|
-
PGW["Gateway"]
|
|
338
|
-
Agg["Aggregator"]
|
|
339
|
-
User --> PGW
|
|
340
|
-
PGW --> Agg
|
|
341
|
-
end
|
|
342
|
-
|
|
343
|
-
subgraph Secure["Secure System (airgapped)"]
|
|
344
|
-
SGW["Gateway"]
|
|
345
|
-
Proc["Processor"]
|
|
346
|
-
SGW --> Proc
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
PGW -->|"encrypted"| SGW
|
|
350
|
-
SGW -->|"results"| PGW
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## Security
|
|
356
|
-
|
|
357
|
-
### Authentication
|
|
358
|
-
|
|
359
|
-
```typescript
|
|
360
|
-
interface FederationSecurity {
|
|
361
|
-
// Required auth for peer connections
|
|
362
|
-
auth: {
|
|
363
|
-
required: true;
|
|
364
|
-
methods: ["mutual-tls", "bearer"];
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
// Message signing
|
|
368
|
-
signing: {
|
|
369
|
-
enabled: true;
|
|
370
|
-
algorithm: "RS256";
|
|
371
|
-
keyRotationInterval: 86400; // 24 hours
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
// Rate limiting per peer
|
|
375
|
-
rateLimiting: {
|
|
376
|
-
messagesPerMinute: 1000;
|
|
377
|
-
connectionsPerPeer: 5;
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
### Message Signing
|
|
383
|
-
|
|
384
|
-
```typescript
|
|
385
|
-
interface SignedFederationMessage {
|
|
386
|
-
message: MAPMessage;
|
|
387
|
-
signature: {
|
|
388
|
-
algorithm: string;
|
|
389
|
-
keyId: string;
|
|
390
|
-
value: string;
|
|
391
|
-
timestamp: number;
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
---
|
|
397
|
-
|
|
398
|
-
## Failure Handling
|
|
399
|
-
|
|
400
|
-
### Peer Unavailable
|
|
401
|
-
|
|
402
|
-
```typescript
|
|
403
|
-
// Queue messages for later delivery
|
|
404
|
-
{
|
|
405
|
-
"method": "map/federation/queue",
|
|
406
|
-
"params": {
|
|
407
|
-
"peerId": "beta",
|
|
408
|
-
"message": { ... },
|
|
409
|
-
"options": {
|
|
410
|
-
"maxRetries": 5,
|
|
411
|
-
"retryDelay": 5000,
|
|
412
|
-
"expireAfter": 3600000 // 1 hour
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
### Reconnection
|
|
419
|
-
|
|
420
|
-
```typescript
|
|
421
|
-
// Automatic reconnection with state sync
|
|
422
|
-
{
|
|
423
|
-
"method": "map/federation/reconnect",
|
|
424
|
-
"params": {
|
|
425
|
-
"peerId": "beta",
|
|
426
|
-
"lastEventId": "evt_abc123",
|
|
427
|
-
"queuedMessages": 15
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
---
|
|
433
|
-
|
|
434
|
-
## Federation vs A2A: When to Use Which
|
|
435
|
-
|
|
436
|
-
| Scenario | Use | Reason |
|
|
437
|
-
|:---------|:----|:-------|
|
|
438
|
-
| Internal distributed system | MAP Federation | Need visibility, trust exists |
|
|
439
|
-
| Cross-organization work | A2A | Different trust domains |
|
|
440
|
-
| Multi-region deployment | MAP Federation | Same org, need coordination |
|
|
441
|
-
| Partner integration | A2A | Maintain separation |
|
|
442
|
-
| Development/staging sync | MAP Federation | Full visibility needed |
|
|
443
|
-
|
|
444
|
-
---
|
|
445
|
-
|
|
446
|
-
## Next Steps
|
|
447
|
-
|
|
448
|
-
- [Design](./design.html) - Overall protocol architecture
|
|
449
|
-
- [Authentication](./authentication.html) - Federation auth details
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Protocol
|
|
3
|
-
nav_order: 3
|
|
4
|
-
has_children: true
|
|
5
|
-
description: "MAP Protocol Specification"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Protocol Specification
|
|
9
|
-
|
|
10
|
-
The complete specification for the Multi-Agent Protocol.
|
|
11
|
-
{: .fs-6 .fw-300 }
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Overview
|
|
16
|
-
|
|
17
|
-
MAP is a JSON-RPC 2.0 based protocol designed for **observing, coordinating, and routing messages within multi-agent AI systems**. Unlike protocols designed for single-agent interaction (ACP) or peer-to-peer agent delegation (A2A), MAP provides a **window into** a multi-agent system with visibility into its internal structure, agent relationships, and message flows.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Core Sections
|
|
22
|
-
|
|
23
|
-
| Section | Description |
|
|
24
|
-
|:--------|:------------|
|
|
25
|
-
| [Design](./design.html) | Core architecture, philosophy, and participant model |
|
|
26
|
-
| [Wire Protocol](./wire-protocol.html) | JSON-RPC message format and transport bindings |
|
|
27
|
-
| [Streaming](./streaming.html) | Event subscriptions, filtering, and replay |
|
|
28
|
-
| [Connection Model](./connection-model.html) | Connection lifecycle and client patterns |
|
|
29
|
-
| [Error Handling](./error-handling.html) | Error taxonomy and recovery mechanisms |
|
|
30
|
-
| [Authentication](./authentication.html) | Authentication methods and flows |
|
|
31
|
-
| [Permissions](./permissions.html) | 4-layer visibility and permission model |
|
|
32
|
-
| [Federation](./federation.html) | System-to-system communication |
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Protocol Methods
|
|
37
|
-
|
|
38
|
-
The protocol defines **27 methods** across three tiers:
|
|
39
|
-
|
|
40
|
-
### Core (Required)
|
|
41
|
-
|
|
42
|
-
These methods MUST be implemented by all MAP-compliant servers:
|
|
43
|
-
|
|
44
|
-
| Method | Description |
|
|
45
|
-
|:-------|:------------|
|
|
46
|
-
| `map/connect` | Establish connection and negotiate capabilities |
|
|
47
|
-
| `map/disconnect` | Clean shutdown with optional cascade |
|
|
48
|
-
| `map/send` | Send message to agents, scopes, or roles |
|
|
49
|
-
| `map/subscribe` | Subscribe to event streams with filtering |
|
|
50
|
-
| `map/unsubscribe` | Cancel active subscriptions |
|
|
51
|
-
| `map/agents/list` | List registered agents |
|
|
52
|
-
| `map/agents/get` | Get details for specific agent |
|
|
53
|
-
|
|
54
|
-
### Structure (Recommended)
|
|
55
|
-
|
|
56
|
-
These methods enable full agent lifecycle and scope management:
|
|
57
|
-
|
|
58
|
-
**Agent Lifecycle:**
|
|
59
|
-
- `map/agents/register` - Register a new agent
|
|
60
|
-
- `map/agents/spawn` - Create child agent
|
|
61
|
-
- `map/agents/unregister` - Remove agent from system
|
|
62
|
-
- `map/agents/update` - Update agent metadata
|
|
63
|
-
- `map/agents/stop` - Request agent termination
|
|
64
|
-
- `map/agents/suspend` - Pause agent processing
|
|
65
|
-
- `map/agents/resume` - Resume suspended agent
|
|
66
|
-
|
|
67
|
-
**Scope Management:**
|
|
68
|
-
- `map/scopes/create` - Create new scope
|
|
69
|
-
- `map/scopes/join` - Join a scope
|
|
70
|
-
- `map/scopes/leave` - Leave a scope
|
|
71
|
-
- `map/scopes/list` - List available scopes
|
|
72
|
-
|
|
73
|
-
### Extensions (Optional)
|
|
74
|
-
|
|
75
|
-
**Federation:**
|
|
76
|
-
- `map/federation/connect` - Establish peer connection
|
|
77
|
-
- `map/federation/route` - Route to remote system
|
|
78
|
-
|
|
79
|
-
**Session Management:**
|
|
80
|
-
- `map/sessions/list` - List active sessions
|
|
81
|
-
- `map/sessions/get` - Get session details
|
|
82
|
-
|
|
83
|
-
**Steering:**
|
|
84
|
-
- `map/inject` - Inject context into agent
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Design Principles
|
|
89
|
-
|
|
90
|
-
1. **Topology is configuration, not protocol** - Same protocol supports hierarchical orchestration and peer collaboration
|
|
91
|
-
2. **Unified messaging with metadata** - One message type with metadata that specializes behavior
|
|
92
|
-
3. **Visibility is first-class** - Agents and scopes have explicit visibility settings
|
|
93
|
-
4. **Lifecycle is descriptive, not prescriptive** - Protocol records lifecycle metadata; implementations decide enforcement
|
|
94
|
-
5. **Extensibility at every layer** - States, lifecycle patterns, visibility levels are all extensible
|
|
95
|
-
6. **Unified participant model** - Agents and clients speak the same protocol
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Quick Reference
|
|
100
|
-
|
|
101
|
-
### Message Types
|
|
102
|
-
|
|
103
|
-
```typescript
|
|
104
|
-
// Request (expects response)
|
|
105
|
-
{ jsonrpc: "2.0", id: string, method: string, params?: unknown }
|
|
106
|
-
|
|
107
|
-
// Response
|
|
108
|
-
{ jsonrpc: "2.0", id: string, result?: unknown, error?: MAPError }
|
|
109
|
-
|
|
110
|
-
// Notification (no response)
|
|
111
|
-
{ jsonrpc: "2.0", method: string, params?: unknown }
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Participant Types
|
|
115
|
-
|
|
116
|
-
| Type | Role | Capabilities |
|
|
117
|
-
|:-----|:-----|:-------------|
|
|
118
|
-
| **Agent** | Worker | Register, send/receive, join scopes, spawn children |
|
|
119
|
-
| **Client** | Observer | Subscribe, query, send messages (with permission) |
|
|
120
|
-
| **Gateway** | Bridge | Route between federated systems |
|
|
121
|
-
|
|
122
|
-
### Transport Bindings
|
|
123
|
-
|
|
124
|
-
| Transport | Use Case | Framing |
|
|
125
|
-
|:----------|:---------|:--------|
|
|
126
|
-
| WebSocket | Remote clients, federation | JSON messages |
|
|
127
|
-
| stdio | Subprocess agents | NDJSON (newline-delimited) |
|
|
128
|
-
| In-process | Co-located agents | Direct object passing |
|
|
129
|
-
| HTTP + SSE | Stateless clients | POST + Server-Sent Events |
|