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
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* claim_task() MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Allows agents with `task.claim` capability to claim the next available task.
|
|
5
|
+
* Used in the pull model where agents autonomously pick up work.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp/tools/claim_task
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Schema
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const ClaimTaskSchema = {
|
|
14
|
+
tags: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Only claim tasks with at least one matching tag"),
|
|
18
|
+
root_tasks_only: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Only claim root tasks (no parent)"),
|
|
22
|
+
};
|
|
23
|
+
export function createClaimTaskHandler(context, deps) {
|
|
24
|
+
return async (args) => {
|
|
25
|
+
if (!deps.taskBackend.claim) {
|
|
26
|
+
return {
|
|
27
|
+
claimed: false,
|
|
28
|
+
message: "Task backend does not support claim operations",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const filter = {};
|
|
32
|
+
if (args.tags)
|
|
33
|
+
filter.tags = args.tags;
|
|
34
|
+
if (args.root_tasks_only)
|
|
35
|
+
filter.rootTasksOnly = args.root_tasks_only;
|
|
36
|
+
const task = await deps.taskBackend.claim(context.agent_id, filter);
|
|
37
|
+
if (!task) {
|
|
38
|
+
return {
|
|
39
|
+
claimed: false,
|
|
40
|
+
message: "No claimable tasks available",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
claimed: true,
|
|
45
|
+
task,
|
|
46
|
+
message: `Claimed task ${task.id}: ${task.description}`,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// =============================================================================
|
|
51
|
+
// Tool Info
|
|
52
|
+
// =============================================================================
|
|
53
|
+
export const CLAIM_TASK_TOOL_INFO = {
|
|
54
|
+
name: "claim_task",
|
|
55
|
+
description: "Claim the next available task from the task pool. Returns the claimed task or null if none available. Requires task.claim capability.",
|
|
56
|
+
schema: ClaimTaskSchema,
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=claim_task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claim_task.js","sourceRoot":"","sources":["../../../src/mcp/tools/claim_task.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,C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MAAM,EAAE,eAAe;CACxB,CAAC"}
|
package/dist/mcp/tools/done.d.ts
CHANGED
|
@@ -47,15 +47,24 @@ export interface DoneToolDeps {
|
|
|
47
47
|
/** Get merge queue for coordinating worker merges */
|
|
48
48
|
getMergeQueue?(): AllHandlerDeps["mergeQueue"];
|
|
49
49
|
};
|
|
50
|
+
/** Optional RoleRegistry for capability-based done() checks */
|
|
51
|
+
roleRegistry?: import("../../roles/types.js").RoleRegistry;
|
|
50
52
|
/** Optional MailService for recording completion turns */
|
|
51
53
|
mailService?: import("../../mail/mail-service.js").MailService;
|
|
52
54
|
/** Optional ConversationMap for agent-to-conversation lookup */
|
|
53
55
|
conversationMap?: import("../../mail/conversation-map.js").ConversationMap;
|
|
56
|
+
/** Optional integration strategy (from team config) */
|
|
57
|
+
integrationStrategy?: import("../../workspace/strategies/types.js").IntegrationStrategy;
|
|
58
|
+
/** Optional task mode from team config */
|
|
59
|
+
taskMode?: "push" | "pull";
|
|
54
60
|
}
|
|
55
61
|
/**
|
|
56
|
-
* Check if an agent has the lifecycle.done capability
|
|
62
|
+
* Check if an agent has the lifecycle.done capability.
|
|
63
|
+
*
|
|
64
|
+
* Uses RoleRegistry for capability resolution, supporting both built-in
|
|
65
|
+
* roles and team-defined roles that extend them.
|
|
57
66
|
*/
|
|
58
|
-
export declare function hasLifecycleDoneCapability(eventStore: EventStore, agentId: string): {
|
|
67
|
+
export declare function hasLifecycleDoneCapability(eventStore: EventStore, agentId: string, roleRegistry?: import("../../roles/types.js").RoleRegistry): {
|
|
59
68
|
hasCapability: boolean;
|
|
60
69
|
role: string;
|
|
61
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"done.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/done.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;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CAAC;CAC5B;AAMD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,OAAO,sBAAsB,EAAE,YAAY,GACzD;IAAE,aAAa,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA4B1C;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,MAAM,EACZ,gBAAgB,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,GAClD,gBAAgB,CAwBlB;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,IAC1D,MAAM;IAClB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,UAAU,CAAC,CAqJxB;AAMD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAK1B,CAAC"}
|
package/dist/mcp/tools/done.js
CHANGED
|
@@ -37,27 +37,30 @@ export const DoneSchema = {
|
|
|
37
37
|
// Capability Check
|
|
38
38
|
// =============================================================================
|
|
39
39
|
/**
|
|
40
|
-
* Check if an agent has the lifecycle.done capability
|
|
40
|
+
* Check if an agent has the lifecycle.done capability.
|
|
41
|
+
*
|
|
42
|
+
* Uses RoleRegistry for capability resolution, supporting both built-in
|
|
43
|
+
* roles and team-defined roles that extend them.
|
|
41
44
|
*/
|
|
42
|
-
export function hasLifecycleDoneCapability(eventStore, agentId) {
|
|
45
|
+
export function hasLifecycleDoneCapability(eventStore, agentId, roleRegistry) {
|
|
43
46
|
// Get the agent to find their role
|
|
44
47
|
const agent = eventStore.getAgent(agentId);
|
|
45
48
|
if (!agent) {
|
|
46
49
|
return { hasCapability: false, role: "unknown" };
|
|
47
50
|
}
|
|
48
|
-
// Get the agent's role (set at spawn time) or default to "worker"
|
|
49
|
-
// In the future, this should query the RoleRegistry for full capability lookup
|
|
50
51
|
const role = agent.role ?? "worker";
|
|
51
|
-
//
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
// Use RoleRegistry for capability lookup when available
|
|
53
|
+
if (roleRegistry) {
|
|
54
|
+
const hasCapability = roleRegistry.hasCapability(role, "lifecycle.done");
|
|
55
|
+
return { hasCapability, role };
|
|
56
|
+
}
|
|
57
|
+
// Fallback: check base role via prefix match against known built-in roles
|
|
54
58
|
const rolesWithDoneCapability = new Set([
|
|
55
59
|
"worker",
|
|
56
60
|
"worker.resolver",
|
|
57
61
|
"integrator",
|
|
58
62
|
"monitor",
|
|
59
63
|
]);
|
|
60
|
-
// Check exact match or prefix match
|
|
61
64
|
const hasCapability = rolesWithDoneCapability.has(role) ||
|
|
62
65
|
rolesWithDoneCapability.has(role.split(".")[0]);
|
|
63
66
|
return { hasCapability, role };
|
|
@@ -99,11 +102,11 @@ export function buildLifecycleContext(toolContext, eventStore, role, workspaceMa
|
|
|
99
102
|
*/
|
|
100
103
|
export function createDoneHandler(context, deps) {
|
|
101
104
|
return async (args) => {
|
|
102
|
-
const { eventStore, agentManager, messageRouter, taskManager, workspaceManager, mailService, conversationMap } = deps;
|
|
105
|
+
const { eventStore, agentManager, messageRouter, taskManager, workspaceManager, roleRegistry, mailService, conversationMap } = deps;
|
|
103
106
|
// ─────────────────────────────────────────────────────────────────────────
|
|
104
107
|
// Step 1: Check capability
|
|
105
108
|
// ─────────────────────────────────────────────────────────────────────────
|
|
106
|
-
const { hasCapability, role } = hasLifecycleDoneCapability(eventStore, context.agent_id);
|
|
109
|
+
const { hasCapability, role } = hasLifecycleDoneCapability(eventStore, context.agent_id, roleRegistry);
|
|
107
110
|
if (!hasCapability) {
|
|
108
111
|
return {
|
|
109
112
|
success: false,
|
|
@@ -201,6 +204,8 @@ export function createDoneHandler(context, deps) {
|
|
|
201
204
|
getWorkspacePath: workspaceManager
|
|
202
205
|
? (agentId) => workspaceManager.getWorkspace(agentId)?.path
|
|
203
206
|
: undefined,
|
|
207
|
+
integrationStrategy: deps.integrationStrategy,
|
|
208
|
+
taskMode: deps.taskMode,
|
|
204
209
|
};
|
|
205
210
|
const handlerResult = await dispatchDone(lifecycleContext, doneArgs, cleanupStatus, handlerDeps);
|
|
206
211
|
// ─────────────────────────────────────────────────────────────────────────
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"done.js","sourceRoot":"","sources":["../../../src/mcp/tools/done.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAuB,MAAM,mCAAmC,CAAC;AAEtF,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;SACpD,QAAQ,CAAC,uCAAuC,CAAC;IACpD,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,OAAO,EAAE,CAAC;SACP,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CAAC,+BAA+B,CAAC;IAC5C,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,oDAAoD,CAAC;CACl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;YACnB,aAAa;YACb,QAAQ,EAAE,aAAa,CAAC,QAAQ;SACjC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM;IACZ,WAAW,EACT,sIAAsI;IACxI,MAAM,EAAE,UAAU;CACnB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_claimable_tasks() MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists tasks available for claiming. Allows agents to preview
|
|
5
|
+
* what's in the task pool before claiming.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp/tools/list_claimable_tasks
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import type { TaskBackend, ExtendedTask } from "../../task/backend/types.js";
|
|
11
|
+
import type { ToolContext } from "../types.js";
|
|
12
|
+
export declare const ListClaimableTasksSchema: {
|
|
13
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
root_tasks_only: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
};
|
|
17
|
+
export interface ListClaimableTasksDeps {
|
|
18
|
+
taskBackend: TaskBackend;
|
|
19
|
+
}
|
|
20
|
+
export declare function createListClaimableTasksHandler(_context: ToolContext, deps: ListClaimableTasksDeps): (args: {
|
|
21
|
+
tags?: string[];
|
|
22
|
+
root_tasks_only?: boolean;
|
|
23
|
+
limit?: number;
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
tasks: ExtendedTask[];
|
|
26
|
+
count: number;
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const LIST_CLAIMABLE_TASKS_TOOL_INFO: {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
schema: {
|
|
33
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
root_tasks_only: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=list_claimable_tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_claimable_tasks.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/list_claimable_tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAe,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C,eAAO,MAAM,wBAAwB;;;;CAapC,CAAC;AAMF,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,sBAAsB,IAEd,MAAM;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC;IACV,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CA6BH;AAMD,eAAO,MAAM,8BAA8B;;;;;;;;CAK1C,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* list_claimable_tasks() MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Lists tasks available for claiming. Allows agents to preview
|
|
5
|
+
* what's in the task pool before claiming.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp/tools/list_claimable_tasks
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Schema
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const ListClaimableTasksSchema = {
|
|
14
|
+
tags: z
|
|
15
|
+
.array(z.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Only list tasks with at least one matching tag"),
|
|
18
|
+
root_tasks_only: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Only list root tasks (no parent)"),
|
|
22
|
+
limit: z
|
|
23
|
+
.number()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Maximum number of tasks to return (default: 20)"),
|
|
26
|
+
};
|
|
27
|
+
export function createListClaimableTasksHandler(_context, deps) {
|
|
28
|
+
return async (args) => {
|
|
29
|
+
if (!deps.taskBackend.listClaimable) {
|
|
30
|
+
return {
|
|
31
|
+
tasks: [],
|
|
32
|
+
count: 0,
|
|
33
|
+
message: "Task backend does not support listClaimable operations",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const filter = {};
|
|
37
|
+
if (args.tags)
|
|
38
|
+
filter.tags = args.tags;
|
|
39
|
+
if (args.root_tasks_only)
|
|
40
|
+
filter.rootTasksOnly = args.root_tasks_only;
|
|
41
|
+
let tasks = await deps.taskBackend.listClaimable(filter);
|
|
42
|
+
const limit = args.limit ?? 20;
|
|
43
|
+
if (tasks.length > limit) {
|
|
44
|
+
tasks = tasks.slice(0, limit);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
tasks,
|
|
48
|
+
count: tasks.length,
|
|
49
|
+
message: tasks.length > 0
|
|
50
|
+
? `Found ${tasks.length} claimable task(s)`
|
|
51
|
+
: "No claimable tasks available",
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
// =============================================================================
|
|
56
|
+
// Tool Info
|
|
57
|
+
// =============================================================================
|
|
58
|
+
export const LIST_CLAIMABLE_TASKS_TOOL_INFO = {
|
|
59
|
+
name: "list_claimable_tasks",
|
|
60
|
+
description: "List tasks available for claiming. Shows pending, unblocked, unassigned tasks. Requires task.claim capability.",
|
|
61
|
+
schema: ListClaimableTasksSchema,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=list_claimable_tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list_claimable_tasks.js","sourceRoot":"","sources":["../../../src/mcp/tools/list_claimable_tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,CAAC;SACJ,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,eAAe,EAAE,CAAC;SACf,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,QAAQ,CAAC,kCAAkC,CAAC;IAC/C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,iDAAiD,CAAC;CAC/D,CAAC;AAUF,MAAM,UAAU,+BAA+B,CAC7C,QAAqB,EACrB,IAA4B;IAE5B,OAAO,KAAK,EAAE,IAIb,EAIE,EAAE;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,CAAC;YACpC,OAAO;gBACL,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,CAAC;gBACR,OAAO,EAAE,wDAAwD;aAClE,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAgB,EAAE,CAAC;QAC/B,IAAI,IAAI,CAAC,IAAI;YAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACvC,IAAI,IAAI,CAAC,eAAe;YAAE,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC;QAEtE,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QAEzD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;YACzB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,OAAO;YACL,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,OAAO,EACL,KAAK,CAAC,MAAM,GAAG,CAAC;gBACd,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,oBAAoB;gBAC3C,CAAC,CAAC,8BAA8B;SACrC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,gHAAgH;IAClH,MAAM,EAAE,wBAAwB;CACjC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* unclaim_task() MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Allows agents with `task.claim` capability to release a claimed task
|
|
5
|
+
* back to the pending pool.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp/tools/unclaim_task
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import type { TaskBackend } from "../../task/backend/types.js";
|
|
11
|
+
import type { ToolContext } from "../types.js";
|
|
12
|
+
export declare const UnclaimTaskSchema: {
|
|
13
|
+
task_id: z.ZodString;
|
|
14
|
+
};
|
|
15
|
+
export interface UnclaimTaskDeps {
|
|
16
|
+
taskBackend: TaskBackend;
|
|
17
|
+
}
|
|
18
|
+
export declare function createUnclaimTaskHandler(_context: ToolContext, deps: UnclaimTaskDeps): (args: {
|
|
19
|
+
task_id: string;
|
|
20
|
+
}) => Promise<{
|
|
21
|
+
success: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const UNCLAIM_TASK_TOOL_INFO: {
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
schema: {
|
|
28
|
+
task_id: z.ZodString;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=unclaim_task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unclaim_task.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/unclaim_task.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM/C,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAMF,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,WAAW,EACrB,IAAI,EAAE,eAAe,IAEP,MAAM;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,KAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAqBH;AAMD,eAAO,MAAM,sBAAsB;;;;;;CAKlC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* unclaim_task() MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Allows agents with `task.claim` capability to release a claimed task
|
|
5
|
+
* back to the pending pool.
|
|
6
|
+
*
|
|
7
|
+
* @module mcp/tools/unclaim_task
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Schema
|
|
12
|
+
// =============================================================================
|
|
13
|
+
export const UnclaimTaskSchema = {
|
|
14
|
+
task_id: z.string().describe("ID of the task to unclaim"),
|
|
15
|
+
};
|
|
16
|
+
export function createUnclaimTaskHandler(_context, deps) {
|
|
17
|
+
return async (args) => {
|
|
18
|
+
if (!deps.taskBackend.unclaim) {
|
|
19
|
+
return {
|
|
20
|
+
success: false,
|
|
21
|
+
message: "Task backend does not support unclaim operations",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
await deps.taskBackend.unclaim(args.task_id);
|
|
26
|
+
return {
|
|
27
|
+
success: true,
|
|
28
|
+
message: `Task ${args.task_id} unclaimed and returned to pending pool`,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
return {
|
|
33
|
+
success: false,
|
|
34
|
+
message: `Failed to unclaim task: ${error instanceof Error ? error.message : String(error)}`,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// =============================================================================
|
|
40
|
+
// Tool Info
|
|
41
|
+
// =============================================================================
|
|
42
|
+
export const UNCLAIM_TASK_TOOL_INFO = {
|
|
43
|
+
name: "unclaim_task",
|
|
44
|
+
description: "Release a claimed task back to the pending pool so another agent can pick it up. Requires task.claim capability.",
|
|
45
|
+
schema: UnclaimTaskSchema,
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=unclaim_task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unclaim_task.js","sourceRoot":"","sources":["../../../src/mcp/tools/unclaim_task.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,gFAAgF;AAChF,SAAS;AACT,gFAAgF;AAEhF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CAC1D,CAAC;AAUF,MAAM,UAAU,wBAAwB,CACtC,QAAqB,EACrB,IAAqB;IAErB,OAAO,KAAK,EAAE,IAEb,EAGE,EAAE;QACH,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;YAC9B,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,kDAAkD;aAC5D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC7C,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,QAAQ,IAAI,CAAC,OAAO,yCAAyC;aACvE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aAC7F,CAAC;QACJ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,kHAAkH;IACpH,MAAM,EAAE,iBAAiB;CAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,UAAU,GAChB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,GAKhB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metrics Module
|
|
3
|
+
*
|
|
4
|
+
* Computes throughput, utilization, and error metrics from EventStore data.
|
|
5
|
+
* No new events needed — aggregates existing spawn, terminate, task, and
|
|
6
|
+
* status events.
|
|
7
|
+
*
|
|
8
|
+
* @module metrics/metrics
|
|
9
|
+
*/
|
|
10
|
+
import type { EventStore } from "../store/event-store.js";
|
|
11
|
+
export interface ThroughputMetrics {
|
|
12
|
+
/** Tasks completed in the time window */
|
|
13
|
+
tasksCompleted: number;
|
|
14
|
+
/** Tasks failed in the time window */
|
|
15
|
+
tasksFailed: number;
|
|
16
|
+
/** Total tasks created in the time window */
|
|
17
|
+
tasksCreated: number;
|
|
18
|
+
/** Average completion time in ms (completed tasks only) */
|
|
19
|
+
avgCompletionTimeMs: number | null;
|
|
20
|
+
/** Tasks per minute (completed) */
|
|
21
|
+
completedPerMinute: number;
|
|
22
|
+
/** Time window start */
|
|
23
|
+
windowStart: number;
|
|
24
|
+
/** Time window end */
|
|
25
|
+
windowEnd: number;
|
|
26
|
+
}
|
|
27
|
+
export interface UtilizationMetrics {
|
|
28
|
+
/** Currently running agents */
|
|
29
|
+
activeAgents: number;
|
|
30
|
+
/** Total agents spawned in the time window */
|
|
31
|
+
totalSpawned: number;
|
|
32
|
+
/** Total agents stopped in the time window */
|
|
33
|
+
totalStopped: number;
|
|
34
|
+
/** Agents by role */
|
|
35
|
+
agentsByRole: Record<string, number>;
|
|
36
|
+
/** Agents by state */
|
|
37
|
+
agentsByState: Record<string, number>;
|
|
38
|
+
}
|
|
39
|
+
export interface ErrorMetrics {
|
|
40
|
+
/** Total errors in the time window */
|
|
41
|
+
totalErrors: number;
|
|
42
|
+
/** Errors by type */
|
|
43
|
+
errorsByType: Record<string, number>;
|
|
44
|
+
/** Recent errors (last N) */
|
|
45
|
+
recentErrors: ErrorEntry[];
|
|
46
|
+
}
|
|
47
|
+
export interface ErrorEntry {
|
|
48
|
+
/** Timestamp */
|
|
49
|
+
timestamp: number;
|
|
50
|
+
/** Agent ID */
|
|
51
|
+
agentId: string;
|
|
52
|
+
/** Error type/category */
|
|
53
|
+
type: string;
|
|
54
|
+
/** Error summary */
|
|
55
|
+
summary: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Compute throughput metrics for a time window.
|
|
59
|
+
*
|
|
60
|
+
* @param eventStore - EventStore to query
|
|
61
|
+
* @param windowMs - Time window in milliseconds (default: 5 minutes)
|
|
62
|
+
*/
|
|
63
|
+
export declare function getThroughputMetrics(eventStore: EventStore, windowMs?: number): ThroughputMetrics;
|
|
64
|
+
/**
|
|
65
|
+
* Compute utilization metrics (current snapshot + window).
|
|
66
|
+
*
|
|
67
|
+
* @param eventStore - EventStore to query
|
|
68
|
+
* @param windowMs - Time window for spawn/stop counts (default: 5 minutes)
|
|
69
|
+
*/
|
|
70
|
+
export declare function getUtilizationMetrics(eventStore: EventStore, windowMs?: number): UtilizationMetrics;
|
|
71
|
+
/**
|
|
72
|
+
* Compute error metrics for a time window.
|
|
73
|
+
*
|
|
74
|
+
* @param eventStore - EventStore to query
|
|
75
|
+
* @param windowMs - Time window in milliseconds (default: 30 minutes)
|
|
76
|
+
* @param maxRecent - Maximum recent errors to return (default: 20)
|
|
77
|
+
*/
|
|
78
|
+
export declare function getErrorMetrics(eventStore: EventStore, windowMs?: number, maxRecent?: number): ErrorMetrics;
|
|
79
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/metrics/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAO1D,MAAM,WAAW,iBAAiB;IAChC,yCAAy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