@evalops/maestro 0.10.50 → 0.10.51
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/dist/agent/agent-outcome.d.ts +54 -0
- package/dist/agent/agent-outcome.d.ts.map +1 -0
- package/dist/agent/agent-outcome.js +142 -0
- package/dist/agent/agent-outcome.js.map +1 -0
- package/dist/agent/agent-resume.d.ts.map +1 -1
- package/dist/agent/agent-resume.js +3 -3
- package/dist/agent/agent-resume.js.map +1 -1
- package/dist/agent/agent-run-summary.d.ts +37 -0
- package/dist/agent/agent-run-summary.d.ts.map +1 -0
- package/dist/agent/agent-run-summary.js +15 -0
- package/dist/agent/agent-run-summary.js.map +1 -0
- package/dist/agent/agent-work-board.d.ts +82 -0
- package/dist/agent/agent-work-board.d.ts.map +1 -0
- package/dist/agent/agent-work-board.js +312 -0
- package/dist/agent/agent-work-board.js.map +1 -0
- package/dist/agent/auto-compaction.d.ts +7 -2
- package/dist/agent/auto-compaction.d.ts.map +1 -1
- package/dist/agent/auto-compaction.js +23 -10
- package/dist/agent/auto-compaction.js.map +1 -1
- package/dist/agent/mission-artifacts.d.ts +62 -0
- package/dist/agent/mission-artifacts.d.ts.map +1 -0
- package/dist/agent/mission-artifacts.js +438 -0
- package/dist/agent/mission-artifacts.js.map +1 -0
- package/dist/agent/mission-manifest.d.ts +139 -3
- package/dist/agent/mission-manifest.d.ts.map +1 -1
- package/dist/agent/mission-manifest.js +549 -3
- package/dist/agent/mission-manifest.js.map +1 -1
- package/dist/agent/mission-store.d.ts +80 -0
- package/dist/agent/mission-store.d.ts.map +1 -0
- package/dist/agent/mission-store.js +603 -0
- package/dist/agent/mission-store.js.map +1 -0
- package/dist/agent/modes.d.ts +2 -2
- package/dist/agent/modes.d.ts.map +1 -1
- package/dist/agent/modes.js +10 -3
- package/dist/agent/modes.js.map +1 -1
- package/dist/agent/providers/codex-app-server.d.ts.map +1 -1
- package/dist/agent/providers/codex-app-server.js +1 -3
- package/dist/agent/providers/codex-app-server.js.map +1 -1
- package/dist/agent/providers/google-gemini-cli.js +203 -107
- package/dist/agent/providers/google.js +100 -41
- package/dist/agent/providers/scripted.d.ts.map +1 -1
- package/dist/agent/providers/scripted.js +1 -3
- package/dist/agent/providers/scripted.js.map +1 -1
- package/dist/agent/providers/validation.d.ts.map +1 -1
- package/dist/agent/providers/validation.js +1 -3
- package/dist/agent/providers/validation.js.map +1 -1
- package/dist/agent/providers/vertex.js +203 -107
- package/dist/agent/snapshot-store.d.ts +32 -0
- package/dist/agent/snapshot-store.d.ts.map +1 -0
- package/dist/agent/snapshot-store.js +195 -0
- package/dist/agent/snapshot-store.js.map +1 -0
- package/dist/agent/specialist-profiles.d.ts +36 -0
- package/dist/agent/specialist-profiles.d.ts.map +1 -0
- package/dist/agent/specialist-profiles.js +159 -0
- package/dist/agent/specialist-profiles.js.map +1 -0
- package/dist/agent/subagent-specs.d.ts +4 -1
- package/dist/agent/subagent-specs.d.ts.map +1 -1
- package/dist/agent/subagent-specs.js +81 -8
- package/dist/agent/subagent-specs.js.map +1 -1
- package/dist/agent/swarm/coverage-gate.d.ts +37 -0
- package/dist/agent/swarm/coverage-gate.d.ts.map +1 -0
- package/dist/agent/swarm/coverage-gate.js +48 -0
- package/dist/agent/swarm/coverage-gate.js.map +1 -0
- package/dist/agent/swarm/executor.d.ts +1 -0
- package/dist/agent/swarm/executor.d.ts.map +1 -1
- package/dist/agent/swarm/executor.js +151 -15
- package/dist/agent/swarm/executor.js.map +1 -1
- package/dist/agent/swarm/orchestrator-prompt.d.ts +25 -0
- package/dist/agent/swarm/orchestrator-prompt.d.ts.map +1 -0
- package/dist/agent/swarm/orchestrator-prompt.js +48 -0
- package/dist/agent/swarm/orchestrator-prompt.js.map +1 -0
- package/dist/agent/swarm/plan-parser.d.ts.map +1 -1
- package/dist/agent/swarm/plan-parser.js +27 -2
- package/dist/agent/swarm/plan-parser.js.map +1 -1
- package/dist/agent/swarm/types.d.ts +17 -0
- package/dist/agent/swarm/types.d.ts.map +1 -1
- package/dist/agent/swarm/types.js.map +1 -1
- package/dist/agent/swarm/validation-directive.d.ts +21 -0
- package/dist/agent/swarm/validation-directive.d.ts.map +1 -0
- package/dist/agent/swarm/validation-directive.js +25 -0
- package/dist/agent/swarm/validation-directive.js.map +1 -0
- package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -1
- package/dist/agent/transport/tool-execution-bridge.js +4 -1
- package/dist/agent/transport/tool-execution-bridge.js.map +1 -1
- package/dist/api/enterprise-routes.d.ts.map +1 -1
- package/dist/api/enterprise-routes.js +87 -10
- package/dist/api/enterprise-routes.js.map +1 -1
- package/dist/api/org-settings-merge.d.ts +12 -0
- package/dist/api/org-settings-merge.d.ts.map +1 -0
- package/dist/api/org-settings-merge.js +38 -0
- package/dist/api/org-settings-merge.js.map +1 -0
- package/dist/api/user-settings-merge.d.ts +16 -0
- package/dist/api/user-settings-merge.d.ts.map +1 -0
- package/dist/api/user-settings-merge.js +37 -0
- package/dist/api/user-settings-merge.js.map +1 -0
- package/dist/app-server/daemon-lifecycle-api.d.ts.map +1 -1
- package/dist/app-server/daemon-lifecycle-api.js +1 -3
- package/dist/app-server/daemon-lifecycle-api.js.map +1 -1
- package/dist/app-server/external-agent-import-api.d.ts.map +1 -1
- package/dist/app-server/external-agent-import-api.js +1 -3
- package/dist/app-server/external-agent-import-api.js.map +1 -1
- package/dist/app-server/network-governance-api.d.ts.map +1 -1
- package/dist/app-server/network-governance-api.js +1 -3
- package/dist/app-server/network-governance-api.js.map +1 -1
- package/dist/app-server/plugin-bundle-api.d.ts.map +1 -1
- package/dist/app-server/plugin-bundle-api.js +1 -3
- package/dist/app-server/plugin-bundle-api.js.map +1 -1
- package/dist/app-server/policy-control-api.d.ts.map +1 -1
- package/dist/app-server/policy-control-api.js +1 -3
- package/dist/app-server/policy-control-api.js.map +1 -1
- package/dist/app-server/protocol-modes-api.d.ts.map +1 -1
- package/dist/app-server/protocol-modes-api.js +1 -3
- package/dist/app-server/protocol-modes-api.js.map +1 -1
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +15 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/a2a.d.ts.map +1 -1
- package/dist/cli/commands/a2a.js +1 -3
- package/dist/cli/commands/a2a.js.map +1 -1
- package/dist/cli/commands/agents.d.ts +4 -0
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +149 -0
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/mission.d.ts +4 -0
- package/dist/cli/commands/mission.d.ts.map +1 -0
- package/dist/cli/commands/mission.js +196 -0
- package/dist/cli/commands/mission.js.map +1 -0
- package/dist/cli/commands/value.d.ts +10 -0
- package/dist/cli/commands/value.d.ts.map +1 -0
- package/dist/cli/commands/value.js +33 -0
- package/dist/cli/commands/value.js.map +1 -0
- package/dist/cli/headless-protocol.d.ts.map +1 -1
- package/dist/cli/headless-protocol.js +1 -3
- package/dist/cli/headless-protocol.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +10 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/system-prompt.d.ts.map +1 -1
- package/dist/cli/system-prompt.js +38 -7
- package/dist/cli/system-prompt.js.map +1 -1
- package/dist/cli-runtime.js +7756 -2800
- package/dist/cli-tui/client-tools/client-tool-controller.d.ts.map +1 -1
- package/dist/cli-tui/client-tools/client-tool-controller.js +1 -3
- package/dist/cli-tui/client-tools/client-tool-controller.js.map +1 -1
- package/dist/cli-tui/commands/undo-handlers.d.ts.map +1 -1
- package/dist/cli-tui/commands/undo-handlers.js +7 -2
- package/dist/cli-tui/commands/undo-handlers.js.map +1 -1
- package/dist/cli-tui/tui-renderer/skills-controller.d.ts +3 -0
- package/dist/cli-tui/tui-renderer/skills-controller.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer/skills-controller.js +77 -33
- package/dist/cli-tui/tui-renderer/skills-controller.js.map +1 -1
- package/dist/codex/app-server-client.d.ts.map +1 -1
- package/dist/codex/app-server-client.js +1 -3
- package/dist/codex/app-server-client.js.map +1 -1
- package/dist/codex/compatibility.d.ts.map +1 -1
- package/dist/codex/compatibility.js +1 -3
- package/dist/codex/compatibility.js.map +1 -1
- package/dist/codex/subagent-dispatch-table.d.ts +8 -0
- package/dist/codex/subagent-dispatch-table.d.ts.map +1 -1
- package/dist/codex/subagent-dispatch-table.js +23 -0
- package/dist/codex/subagent-dispatch-table.js.map +1 -1
- package/dist/context/manifest.d.ts.map +1 -1
- package/dist/context/manifest.js +1 -3
- package/dist/context/manifest.js.map +1 -1
- package/dist/conversation/render-model.d.ts +0 -36
- package/dist/conversation/render-model.d.ts.map +1 -1
- package/dist/conversation/render-model.js +1 -3
- package/dist/conversation/render-model.js.map +1 -1
- package/dist/customer-value/ambient-learning.d.ts +75 -0
- package/dist/customer-value/ambient-learning.d.ts.map +1 -0
- package/dist/customer-value/ambient-learning.js +472 -0
- package/dist/customer-value/ambient-learning.js.map +1 -0
- package/dist/customer-value/internal-helpers.d.ts +13 -0
- package/dist/customer-value/internal-helpers.d.ts.map +1 -0
- package/dist/customer-value/internal-helpers.js +70 -0
- package/dist/customer-value/internal-helpers.js.map +1 -0
- package/dist/customer-value/report.d.ts +282 -0
- package/dist/customer-value/report.d.ts.map +1 -0
- package/dist/customer-value/report.js +2085 -0
- package/dist/customer-value/report.js.map +1 -0
- package/dist/db/schema.d.ts +5 -1
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/evalops/agent-bootstrap.d.ts.map +1 -1
- package/dist/evalops/agent-bootstrap.js +1 -3
- package/dist/evalops/agent-bootstrap.js.map +1 -1
- package/dist/evalops/agent-mcp-metadata.d.ts.map +1 -1
- package/dist/evalops/agent-mcp-metadata.js +1 -3
- package/dist/evalops/agent-mcp-metadata.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/installers/maestro-review-workflow.d.ts +38 -0
- package/dist/installers/maestro-review-workflow.d.ts.map +1 -0
- package/dist/installers/maestro-review-workflow.js +163 -0
- package/dist/installers/maestro-review-workflow.js.map +1 -0
- package/dist/load-env.d.ts.map +1 -1
- package/dist/load-env.js +2 -1
- package/dist/load-env.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +92 -3
- package/dist/main.js.map +1 -1
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +1 -3
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/elicitation.d.ts.map +1 -1
- package/dist/mcp/elicitation.js +1 -3
- package/dist/mcp/elicitation.js.map +1 -1
- package/dist/mcp/official-registry.d.ts.map +1 -1
- package/dist/mcp/official-registry.js +1 -3
- package/dist/mcp/official-registry.js.map +1 -1
- package/dist/mcp/workspace-trust.d.ts.map +1 -1
- package/dist/mcp/workspace-trust.js +1 -3
- package/dist/mcp/workspace-trust.js.map +1 -1
- package/dist/memory/service-client.d.ts.map +1 -1
- package/dist/memory/service-client.js +1 -3
- package/dist/memory/service-client.js.map +1 -1
- package/dist/models/config-loader.d.ts.map +1 -1
- package/dist/models/config-loader.js +1 -3
- package/dist/models/config-loader.js.map +1 -1
- package/dist/node_modules/@evalops/contracts/dist/index.d.ts +1 -0
- package/dist/node_modules/@evalops/contracts/dist/index.d.ts.map +1 -1
- package/dist/node_modules/@evalops/contracts/dist/index.js +1 -0
- package/dist/node_modules/@evalops/contracts/dist/index.js.map +1 -1
- package/dist/node_modules/@evalops/contracts/dist/maestro-settings.d.ts +61 -0
- package/dist/node_modules/@evalops/contracts/dist/maestro-settings.d.ts.map +1 -0
- package/dist/node_modules/@evalops/contracts/dist/maestro-settings.js +183 -0
- package/dist/node_modules/@evalops/contracts/dist/maestro-settings.js.map +1 -0
- package/dist/node_modules/@evalops/contracts/package.json +1 -1
- package/dist/node_modules/@evalops/tui/package.json +1 -1
- package/dist/oauth/connectors.d.ts.map +1 -1
- package/dist/oauth/connectors.js +1 -3
- package/dist/oauth/connectors.js.map +1 -1
- package/dist/oauth/evalops.d.ts.map +1 -1
- package/dist/oauth/evalops.js +1 -3
- package/dist/oauth/evalops.js.map +1 -1
- package/dist/platform/a2a-client.d.ts.map +1 -1
- package/dist/platform/a2a-client.js +1 -3
- package/dist/platform/a2a-client.js.map +1 -1
- package/dist/platform/a2a-cockpit.d.ts +1 -0
- package/dist/platform/a2a-cockpit.d.ts.map +1 -1
- package/dist/platform/a2a-cockpit.js +42 -11
- package/dist/platform/a2a-cockpit.js.map +1 -1
- package/dist/platform/a2a-completion-audit.d.ts +1 -1
- package/dist/platform/a2a-completion-audit.d.ts.map +1 -1
- package/dist/platform/a2a-completion-audit.js +7 -11
- package/dist/platform/a2a-completion-audit.js.map +1 -1
- package/dist/platform/a2a-maestro-peer.js +16 -0
- package/dist/platform/a2a-maestro-peer.js.map +1 -1
- package/dist/platform/a2a-peer-pairing.d.ts.map +1 -1
- package/dist/platform/a2a-peer-pairing.js +1 -3
- package/dist/platform/a2a-peer-pairing.js.map +1 -1
- package/dist/platform/a2a-peer-registry.d.ts.map +1 -1
- package/dist/platform/a2a-peer-registry.js +1 -3
- package/dist/platform/a2a-peer-registry.js.map +1 -1
- package/dist/platform/a2a-task-ledger.d.ts +20 -0
- package/dist/platform/a2a-task-ledger.d.ts.map +1 -1
- package/dist/platform/a2a-task-ledger.js +207 -11
- package/dist/platform/a2a-task-ledger.js.map +1 -1
- package/dist/platform/a2a-work-graph.d.ts.map +1 -1
- package/dist/platform/a2a-work-graph.js +1 -3
- package/dist/platform/a2a-work-graph.js.map +1 -1
- package/dist/platform/operating-layer.d.ts.map +1 -1
- package/dist/platform/operating-layer.js +14 -8
- package/dist/platform/operating-layer.js.map +1 -1
- package/dist/platform/tool-execution-client.d.ts.map +1 -1
- package/dist/platform/tool-execution-client.js +19 -2
- package/dist/platform/tool-execution-client.js.map +1 -1
- package/dist/providers/auth.d.ts.map +1 -1
- package/dist/providers/auth.js +1 -3
- package/dist/providers/auth.js.map +1 -1
- package/dist/runtime/env.d.ts +9 -1
- package/dist/runtime/env.d.ts.map +1 -1
- package/dist/runtime/env.js +63 -1
- package/dist/runtime/env.js.map +1 -1
- package/dist/safety/policy.d.ts.map +1 -1
- package/dist/safety/policy.js +1 -4
- package/dist/safety/policy.js.map +1 -1
- package/dist/sandbox/docker-sandbox.d.ts.map +1 -1
- package/dist/sandbox/docker-sandbox.js +6 -1
- package/dist/sandbox/docker-sandbox.js.map +1 -1
- package/dist/server/handlers/hosted-runner-drain.d.ts.map +1 -1
- package/dist/server/handlers/hosted-runner-drain.js +1 -3
- package/dist/server/handlers/hosted-runner-drain.js.map +1 -1
- package/dist/server/handlers/platform-a2a-push.d.ts.map +1 -1
- package/dist/server/handlers/platform-a2a-push.js +53 -2
- package/dist/server/handlers/platform-a2a-push.js.map +1 -1
- package/dist/server/handlers/runtime-app-server-ws.d.ts.map +1 -1
- package/dist/server/handlers/runtime-app-server-ws.js +1 -3
- package/dist/server/handlers/runtime-app-server-ws.js.map +1 -1
- package/dist/server/headless-runtime-service.d.ts +16 -0
- package/dist/server/headless-runtime-service.d.ts.map +1 -1
- package/dist/server/headless-runtime-service.js +232 -206
- package/dist/server/headless-runtime-service.js.map +1 -1
- package/dist/server/hosted-agent-runtime-progress.d.ts.map +1 -1
- package/dist/server/hosted-agent-runtime-progress.js +12 -3
- package/dist/server/hosted-agent-runtime-progress.js.map +1 -1
- package/dist/server/pending-request-payload.d.ts.map +1 -1
- package/dist/server/pending-request-payload.js +1 -3
- package/dist/server/pending-request-payload.js.map +1 -1
- package/dist/server/route-auth.d.ts.map +1 -1
- package/dist/server/route-auth.js +2 -0
- package/dist/server/route-auth.js.map +1 -1
- package/dist/server/session-serialization.d.ts.map +1 -1
- package/dist/server/session-serialization.js +1 -3
- package/dist/server/session-serialization.js.map +1 -1
- package/dist/services/compliance/normalize.d.ts.map +1 -1
- package/dist/services/compliance/normalize.js +1 -3
- package/dist/services/compliance/normalize.js.map +1 -1
- package/dist/services/intelligent-router/normalize.d.ts.map +1 -1
- package/dist/services/intelligent-router/normalize.js +1 -3
- package/dist/services/intelligent-router/normalize.js.map +1 -1
- package/dist/services/revenue-attribution/normalize.d.ts.map +1 -1
- package/dist/services/revenue-attribution/normalize.js +1 -3
- package/dist/services/revenue-attribution/normalize.js.map +1 -1
- package/dist/services/traces/normalize.d.ts.map +1 -1
- package/dist/services/traces/normalize.js +1 -3
- package/dist/services/traces/normalize.js.map +1 -1
- package/dist/services/workspace-config/normalize.d.ts.map +1 -1
- package/dist/services/workspace-config/normalize.js +1 -3
- package/dist/services/workspace-config/normalize.js.map +1 -1
- package/dist/skills/composer.d.ts.map +1 -1
- package/dist/skills/composer.js +13 -1
- package/dist/skills/composer.js.map +1 -1
- package/dist/skills/index.d.ts +1 -0
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -0
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/learned-guidelines.d.ts +33 -0
- package/dist/skills/learned-guidelines.d.ts.map +1 -0
- package/dist/skills/learned-guidelines.js +291 -0
- package/dist/skills/learned-guidelines.js.map +1 -0
- package/dist/skills/linter.d.ts.map +1 -1
- package/dist/skills/linter.js +1 -3
- package/dist/skills/linter.js.map +1 -1
- package/dist/skills/runtime-activation.d.ts +1 -0
- package/dist/skills/runtime-activation.d.ts.map +1 -1
- package/dist/skills/runtime-activation.js +2 -3
- package/dist/skills/runtime-activation.js.map +1 -1
- package/dist/skills/tool.d.ts.map +1 -1
- package/dist/skills/tool.js +26 -21
- package/dist/skills/tool.js.map +1 -1
- package/dist/skills/trust-cache.d.ts +7 -0
- package/dist/skills/trust-cache.d.ts.map +1 -1
- package/dist/skills/trust-cache.js +16 -0
- package/dist/skills/trust-cache.js.map +1 -1
- package/dist/telemetry/agent-workforce-native-event.d.ts.map +1 -1
- package/dist/telemetry/agent-workforce-native-event.js +1 -3
- package/dist/telemetry/agent-workforce-native-event.js.map +1 -1
- package/dist/telemetry/maestro-event-bus.d.ts.map +1 -1
- package/dist/telemetry/maestro-event-bus.js +42 -81
- package/dist/telemetry/maestro-event-bus.js.map +1 -1
- package/dist/telemetry/maestro-platform-replay-fixture.d.ts.map +1 -1
- package/dist/telemetry/maestro-platform-replay-fixture.js +1 -3
- package/dist/telemetry/maestro-platform-replay-fixture.js.map +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +54 -43
- package/dist/telemetry.js.map +1 -1
- package/dist/theme/theme-loader.d.ts.map +1 -1
- package/dist/theme/theme-loader.js +1 -3
- package/dist/theme/theme-loader.js.map +1 -1
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +76 -8
- package/dist/tools/apply-patch.js.map +1 -1
- package/dist/tools/diff-preview.d.ts.map +1 -1
- package/dist/tools/diff-preview.js +10 -1
- package/dist/tools/diff-preview.js.map +1 -1
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +17 -0
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +9 -0
- package/dist/tools/write.js.map +1 -1
- package/dist/undo/tracker.d.ts +5 -0
- package/dist/undo/tracker.d.ts.map +1 -1
- package/dist/undo/tracker.js +13 -0
- package/dist/undo/tracker.js.map +1 -1
- package/dist/utils/fs.d.ts +1 -1
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +29 -2
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/git-stash.d.ts.map +1 -1
- package/dist/utils/git-stash.js +15 -8
- package/dist/utils/git-stash.js.map +1 -1
- package/dist/utils/json.d.ts +11 -0
- package/dist/utils/json.d.ts.map +1 -1
- package/dist/utils/json.js +9 -0
- package/dist/utils/json.js.map +1 -1
- package/dist/utils/shell-env.d.ts.map +1 -1
- package/dist/utils/shell-env.js +2 -0
- package/dist/utils/shell-env.js.map +1 -1
- package/dist/utils/url-extractor-git.d.ts +26 -0
- package/dist/utils/url-extractor-git.d.ts.map +1 -0
- package/dist/utils/url-extractor-git.js +259 -0
- package/dist/utils/url-extractor-git.js.map +1 -0
- package/dist/utils/url-extractor.d.ts.map +1 -1
- package/dist/utils/url-extractor.js +23 -251
- package/dist/utils/url-extractor.js.map +1 -1
- package/dist/version.json +2 -2
- package/package.json +310 -306
- package/skills/incident-triage/SKILL.md +19 -1
- package/skills/install-code-review/SKILL.md +69 -0
- package/skills/security-review/SKILL.md +68 -0
- package/skills/security-review/reference/rubric.md +85 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subagent-specs.js","sourceRoot":"","sources":["../../src/agent/subagent-specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,MAAM,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAcpD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,kCAAkC;IAClC,IAAI,EAAE;QACL,MAAM;QACN,MAAM;QACN,MAAM;QACN,QAAQ;QACR,kBAAkB;QAClB,MAAM;QACN,QAAQ;KACR;IACD,8BAA8B;IAC9B,KAAK,EAAE,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,CAAC;IACxD,sBAAsB;IACtB,KAAK,EAAE,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACnC,6BAA6B;IAC7B,GAAG,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,YAAY,CAAC;IAC5C,wBAAwB;IACxB,WAAW,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;IACjC,mBAAmB;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;IACxC,qBAAqB;IACrB,QAAQ,EAAE,CAAC,QAAQ,CAAC;CACX,CAAC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AW,EAAE,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IAIlC,OAAQ,MAAM,CAAC,OAAO,CAAC,cAAc,CAAoC,CAAC,GAAG,CAC5E,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAClB,IAAI;QACJ,IAAI;KACJ,CAAC,CACF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC/B,QAAsB,EACtB,SAAgC;IAEhC,OAAO;QACN,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC3B,GAAG,SAAS;QACZ,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,QAAQ;QAC9C,WAAW,EAAE,SAAS,CAAC,WAAW,IAAI,sBAAsB;KAC5D,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAA2B;IACvD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IAC7C,CAAC;IAED,IAAI,IAAI,CAAC,mBAAmB,KAAK,SAAS,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;QAC5E,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * Subagent Tool Specifications\n *\n * Defines different subagent types and what tools they have access to.\n * This enables fine-grained control over capabilities for different agent contexts:\n * - explorer: Read-only exploration of codebase\n * - planner: Can read and use todo, but no file modifications\n * - coder: Full coding capabilities\n * - reviewer: Read-only with web access for reviewing code\n * - researcher: Web search and fetch focused\n *\n * Inspired by Amp's subagentSpec/subagentType system.\n */\n\nimport { createLogger } from \"../utils/logger.js\";\nimport { normalizeToolNameForSafety } from \"../utils/safety-normalization.js\";\n\nconst logger = createLogger(\"agent:subagent-specs\");\n\n/**\n * Available subagent types.\n */\nexport type SubagentType =\n\t| \"explorer\"\n\t| \"planner\"\n\t| \"coder\"\n\t| \"reviewer\"\n\t| \"researcher\"\n\t| \"minimal\"\n\t| \"custom\";\n\n/**\n * Tool categories for easier specification.\n */\nexport const TOOL_CATEGORIES = {\n\t/** Read-only file system tools */\n\tread: [\n\t\t\"read\",\n\t\t\"list\",\n\t\t\"find\",\n\t\t\"search\",\n\t\t\"parallel_ripgrep\",\n\t\t\"diff\",\n\t\t\"status\",\n\t],\n\t/** File modification tools */\n\twrite: [\"apply_patch\", \"edit\", \"write\", \"notebook_edit\"],\n\t/** Shell execution */\n\tshell: [\"bash\", \"background_tasks\"],\n\t/** Web and external tools */\n\tweb: [\"websearch\", \"webfetch\", \"codesearch\"],\n\t/** Interactive tools */\n\tinteractive: [\"ask_user\", \"todo\"],\n\t/** GitHub tools */\n\tgithub: [\"gh_pr\", \"gh_issue\", \"gh_repo\"],\n\t/** Advanced tools */\n\tadvanced: [\"oracle\"],\n} as const;\n\n/**\n * Get all tool names from categories.\n */\nfunction toolsFromCategories(\n\t...categories: (keyof typeof TOOL_CATEGORIES)[]\n): string[] {\n\tconst tools: string[] = [];\n\tfor (const cat of categories) {\n\t\ttools.push(...TOOL_CATEGORIES[cat]);\n\t}\n\treturn [...new Set(tools)];\n}\n\n/**\n * Subagent specification defining capabilities.\n */\nexport interface SubagentSpec {\n\t/** Display name */\n\tdisplayName: string;\n\t/** Description of what this subagent is for */\n\tdescription: string;\n\t/** Tools that are allowed (whitelist) */\n\tallowedTools: string[];\n\t/** Tools that are explicitly denied (takes precedence) */\n\tdeniedTools?: string[];\n\t/** Whether MCP servers can provide additional tools */\n\tallowMcp: boolean;\n\t/** Whether toolbox tools are allowed */\n\tallowToolbox: boolean;\n\t/** Maximum number of tool calls per turn */\n\tmaxToolCallsPerTurn?: number;\n\t/** Whether dangerous operations require extra confirmation */\n\trequireConfirmation?: boolean;\n}\n\n/**\n * Default subagent specifications.\n */\nexport const SUBAGENT_SPECS: Record<SubagentType, SubagentSpec> = {\n\texplorer: {\n\t\tdisplayName: \"Explorer\",\n\t\tdescription: \"Read-only codebase exploration - can search and read files\",\n\t\tallowedTools: toolsFromCategories(\"read\", \"advanced\"),\n\t\tdeniedTools: [\"oracle\"], // Explorers shouldn't invoke oracle\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 20,\n\t\trequireConfirmation: false,\n\t},\n\tplanner: {\n\t\tdisplayName: \"Planner\",\n\t\tdescription: \"Planning mode - can read files and manage todos\",\n\t\tallowedTools: [...toolsFromCategories(\"read\", \"interactive\")],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 15,\n\t\trequireConfirmation: false,\n\t},\n\tcoder: {\n\t\tdisplayName: \"Coder\",\n\t\tdescription: \"Full coding capabilities - can read, write, and execute\",\n\t\tallowedTools: toolsFromCategories(\n\t\t\t\"read\",\n\t\t\t\"write\",\n\t\t\t\"shell\",\n\t\t\t\"interactive\",\n\t\t\t\"github\",\n\t\t\t\"advanced\",\n\t\t),\n\t\tallowMcp: true,\n\t\tallowToolbox: true,\n\t\tmaxToolCallsPerTurn: 30,\n\t\trequireConfirmation: true,\n\t},\n\treviewer: {\n\t\tdisplayName: \"Reviewer\",\n\t\tdescription: \"Code review mode - can read files and search web\",\n\t\tallowedTools: [...toolsFromCategories(\"read\", \"web\"), \"ask_user\"],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 15,\n\t\trequireConfirmation: false,\n\t},\n\tresearcher: {\n\t\tdisplayName: \"Researcher\",\n\t\tdescription: \"Research mode - focused on web search and analysis\",\n\t\tallowedTools: [...toolsFromCategories(\"web\", \"read\"), \"ask_user\", \"todo\"],\n\t\tallowMcp: true,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 20,\n\t\trequireConfirmation: false,\n\t},\n\tminimal: {\n\t\tdisplayName: \"Minimal\",\n\t\tdescription: \"Minimal capabilities - only basic read operations\",\n\t\tallowedTools: [\"read\", \"list\", \"search\"],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 10,\n\t\trequireConfirmation: false,\n\t},\n\tcustom: {\n\t\tdisplayName: \"Custom\",\n\t\tdescription: \"User-defined tool specification\",\n\t\tallowedTools: toolsFromCategories(\n\t\t\t\"read\",\n\t\t\t\"write\",\n\t\t\t\"shell\",\n\t\t\t\"interactive\",\n\t\t\t\"advanced\",\n\t\t),\n\t\tallowMcp: true,\n\t\tallowToolbox: true,\n\t\trequireConfirmation: true,\n\t},\n};\n\n/**\n * Get specification for a subagent type.\n */\nexport function getSubagentSpec(type: SubagentType): SubagentSpec {\n\treturn SUBAGENT_SPECS[type];\n}\n\n/**\n * Check if a tool is allowed for a subagent type.\n */\nexport function isToolAllowed(\n\ttoolName: string,\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): boolean {\n\tconst spec = customSpec\n\t\t? { ...SUBAGENT_SPECS[type], ...customSpec }\n\t\t: SUBAGENT_SPECS[type];\n\tconst normalizedToolName = normalizeToolNameForSafety(toolName);\n\tconst deniedTools = spec.deniedTools?.map(normalizeToolNameForSafety) ?? [];\n\tconst allowedTools = spec.allowedTools.map(normalizeToolNameForSafety);\n\n\t// Denied tools take precedence\n\tif (deniedTools.includes(normalizedToolName)) {\n\t\treturn false;\n\t}\n\n\t// Check if in allowed list\n\treturn allowedTools.includes(normalizedToolName);\n}\n\n/**\n * Get the list of allowed tools for a subagent type.\n */\nexport function getAllowedTools(\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): string[] {\n\tconst spec = customSpec\n\t\t? { ...SUBAGENT_SPECS[type], ...customSpec }\n\t\t: SUBAGENT_SPECS[type];\n\n\tlet tools = spec.allowedTools.map(normalizeToolNameForSafety);\n\n\t// Remove denied tools\n\tif (spec.deniedTools) {\n\t\tconst deniedTools = new Set(\n\t\t\tspec.deniedTools.map(normalizeToolNameForSafety),\n\t\t);\n\t\ttools = tools.filter((t) => !deniedTools.has(t));\n\t}\n\n\treturn [...new Set(tools)];\n}\n\n/**\n * Filter a list of tools based on subagent spec.\n */\nexport function filterToolsForSubagent<T extends { name: string }>(\n\ttools: T[],\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): T[] {\n\tconst allowedTools = getAllowedTools(type, customSpec);\n\n\treturn tools.filter((tool) => {\n\t\tconst toolName = normalizeToolNameForSafety(tool.name);\n\t\treturn allowedTools.includes(toolName);\n\t});\n}\n\n/**\n * Current subagent type for the session.\n */\nlet currentSubagentType: SubagentType = \"coder\";\n\n/**\n * Get the current subagent type.\n */\nexport function getCurrentSubagentType(): SubagentType {\n\treturn currentSubagentType;\n}\n\n/**\n * Set the current subagent type.\n */\nexport function setCurrentSubagentType(type: SubagentType): void {\n\tlogger.info(\"Setting subagent type\", { type });\n\tcurrentSubagentType = type;\n}\n\n/**\n * Parse subagent type from string.\n */\nexport function parseSubagentType(typeStr: string): SubagentType | null {\n\tconst normalized = normalizeToolNameForSafety(typeStr);\n\tif (normalized in SUBAGENT_SPECS) {\n\t\treturn normalized as SubagentType;\n\t}\n\treturn null;\n}\n\n/**\n * Get subagent type from environment variable.\n */\nexport function getSubagentTypeFromEnv(): SubagentType {\n\tconst envType = process.env.MAESTRO_SUBAGENT_TYPE?.toLowerCase();\n\tif (envType && envType in SUBAGENT_SPECS) {\n\t\treturn envType as SubagentType;\n\t}\n\treturn \"coder\";\n}\n\n/**\n * Format subagent type for display.\n */\nexport function formatSubagentDisplay(type: SubagentType): string {\n\tconst spec = getSubagentSpec(type);\n\treturn `${spec.displayName} - ${spec.description}`;\n}\n\n/**\n * Get all available subagent types with their specs.\n */\nexport function getAllSubagentTypes(): Array<{\n\ttype: SubagentType;\n\tspec: SubagentSpec;\n}> {\n\treturn (Object.entries(SUBAGENT_SPECS) as [SubagentType, SubagentSpec][]).map(\n\t\t([type, spec]) => ({\n\t\t\ttype,\n\t\t\tspec,\n\t\t}),\n\t);\n}\n\n/**\n * Create a custom subagent spec by merging with a base type.\n */\nexport function createCustomSpec(\n\tbaseType: SubagentType,\n\toverrides: Partial<SubagentSpec>,\n): SubagentSpec {\n\treturn {\n\t\t...SUBAGENT_SPECS[baseType],\n\t\t...overrides,\n\t\tdisplayName: overrides.displayName ?? \"Custom\",\n\t\tdescription: overrides.description ?? \"Custom configuration\",\n\t};\n}\n\n/**\n * Validate a subagent spec.\n */\nexport function validateSpec(spec: Partial<SubagentSpec>): string[] {\n\tconst errors: string[] = [];\n\n\tif (spec.allowedTools && spec.allowedTools.length === 0) {\n\t\terrors.push(\"allowedTools cannot be empty\");\n\t}\n\n\tif (spec.maxToolCallsPerTurn !== undefined && spec.maxToolCallsPerTurn < 1) {\n\t\terrors.push(\"maxToolCallsPerTurn must be at least 1\");\n\t}\n\n\treturn errors;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"subagent-specs.js","sourceRoot":"","sources":["../../src/agent/subagent-specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,MAAM,MAAM,GAAG,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAgBpD,MAAM,yBAAyB,GAAiC;IAC/D,aAAa,EAAE,OAAO;IACtB,aAAa,EAAE,UAAU;IACzB,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,UAAU;IAC3B,kBAAkB,EAAE,OAAO;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,kCAAkC;IAClC,IAAI,EAAE;QACL,M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I,IAAI,CAAC,mBAAmB,KAAK,SAAS,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;QAC5E,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC","sourcesContent":["/**\n * Subagent Tool Specifications\n *\n * Defines different subagent types and what tools they have access to.\n * This enables fine-grained control over capabilities for different agent contexts:\n * - explorer: Read-only exploration of codebase\n * - planner: Can read and use todo, but no file modifications\n * - coder: Full coding capabilities\n * - reviewer: Read-only with web access for reviewing code\n * - researcher: Web search and fetch focused\n * - browser-qa: Browser-based product QA with screenshots and repro evidence\n *\n * Inspired by Amp's subagentSpec/subagentType system.\n */\n\nimport { codexSubagentLaneForType } from \"../codex/subagent-dispatch-table.js\";\nimport { createLogger } from \"../utils/logger.js\";\nimport { normalizeToolNameForSafety } from \"../utils/safety-normalization.js\";\n\nconst logger = createLogger(\"agent:subagent-specs\");\n\n/**\n * Available subagent types.\n */\nexport type SubagentType =\n\t| \"explorer\"\n\t| \"planner\"\n\t| \"coder\"\n\t| \"reviewer\"\n\t| \"test-runner\"\n\t| \"researcher\"\n\t| \"browser-qa\"\n\t| \"minimal\"\n\t| \"custom\";\n\nconst CODEX_LANE_SUBAGENT_TYPES: Record<string, SubagentType> = {\n\t\"code-writer\": \"coder\",\n\t\"code-review\": \"reviewer\",\n\t\"test-runner\": \"test-runner\",\n\t\"browser-qa\": \"browser-qa\",\n\t\"repo-explorer\": \"explorer\",\n\t\"release-shepherd\": \"coder\",\n};\n\n/**\n * Tool categories for easier specification.\n */\nexport const TOOL_CATEGORIES = {\n\t/** Read-only file system tools */\n\tread: [\n\t\t\"read\",\n\t\t\"list\",\n\t\t\"find\",\n\t\t\"search\",\n\t\t\"parallel_ripgrep\",\n\t\t\"diff\",\n\t\t\"status\",\n\t],\n\t/** File modification tools */\n\twrite: [\"apply_patch\", \"edit\", \"write\", \"notebook_edit\"],\n\t/** Shell execution */\n\tshell: [\"bash\", \"background_tasks\"],\n\t/** Web and external tools */\n\tweb: [\"websearch\", \"webfetch\", \"codesearch\"],\n\t/** Browser/product QA tools */\n\tbrowser: [\n\t\t\"agent_browser\",\n\t\t\"browser_open\",\n\t\t\"browser_snapshot\",\n\t\t\"browser_click\",\n\t\t\"browser_fill\",\n\t\t\"browser_type\",\n\t\t\"browser_screenshot\",\n\t\t\"browser_console\",\n\t\t\"browser_record\",\n\t\t\"read_page\",\n\t\t\"search_page\",\n\t\t\"find_on_page\",\n\t\t\"extract_links\",\n\t\t\"wait_for_selector\",\n\t\t\"click_element\",\n\t\t\"type_text\",\n\t\t\"scroll_page\",\n\t\t\"select_element\",\n\t\t\"navigate_to\",\n\t\t\"open_links_in_tabs\",\n\t\t\"highlight_element\",\n\t\t\"browser_operator\",\n\t\t\"mouse_action\",\n\t\t\"pointer_action\",\n\t\t\"keyboard_action\",\n\t\t\"extract_table_data\",\n\t\t\"capture_network\",\n\t\t\"capture_console_errors\",\n\t\t\"collect_diagnostics\",\n\t\t\"extract_document\",\n\t\t\"capture_screenshot\",\n\t\t\"native_click\",\n\t\t\"native_type\",\n\t\t\"native_press\",\n\t\t\"native_key_down\",\n\t\t\"native_key_up\",\n\t],\n\t/** Interactive tools */\n\tinteractive: [\"ask_user\", \"todo\"],\n\t/** GitHub tools */\n\tgithub: [\"gh_pr\", \"gh_issue\", \"gh_repo\"],\n\t/** Advanced tools */\n\tadvanced: [\"oracle\"],\n} as const;\n\n/**\n * Get all tool names from categories.\n */\nfunction toolsFromCategories(\n\t...categories: (keyof typeof TOOL_CATEGORIES)[]\n): string[] {\n\tconst tools: string[] = [];\n\tfor (const cat of categories) {\n\t\ttools.push(...TOOL_CATEGORIES[cat]);\n\t}\n\treturn [...new Set(tools)];\n}\n\n/**\n * Subagent specification defining capabilities.\n */\nexport interface SubagentSpec {\n\t/** Display name */\n\tdisplayName: string;\n\t/** Description of what this subagent is for */\n\tdescription: string;\n\t/** Tools that are allowed (whitelist) */\n\tallowedTools: string[];\n\t/** Tools that are explicitly denied (takes precedence) */\n\tdeniedTools?: string[];\n\t/** Whether MCP servers can provide additional tools */\n\tallowMcp: boolean;\n\t/** Whether toolbox tools are allowed */\n\tallowToolbox: boolean;\n\t/** Maximum number of tool calls per turn */\n\tmaxToolCallsPerTurn?: number;\n\t/** Whether dangerous operations require extra confirmation */\n\trequireConfirmation?: boolean;\n}\n\n/**\n * Default subagent specifications.\n */\nexport const SUBAGENT_SPECS: Record<SubagentType, SubagentSpec> = {\n\texplorer: {\n\t\tdisplayName: \"Explorer\",\n\t\tdescription: \"Read-only codebase exploration - can search and read files\",\n\t\tallowedTools: toolsFromCategories(\"read\", \"advanced\"),\n\t\tdeniedTools: [\"oracle\"], // Explorers shouldn't invoke oracle\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 20,\n\t\trequireConfirmation: false,\n\t},\n\tplanner: {\n\t\tdisplayName: \"Planner\",\n\t\tdescription: \"Planning mode - can read files and manage todos\",\n\t\tallowedTools: [...toolsFromCategories(\"read\", \"interactive\")],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 15,\n\t\trequireConfirmation: false,\n\t},\n\tcoder: {\n\t\tdisplayName: \"Coder\",\n\t\tdescription: \"Full coding capabilities - can read, write, and execute\",\n\t\tallowedTools: toolsFromCategories(\n\t\t\t\"read\",\n\t\t\t\"write\",\n\t\t\t\"shell\",\n\t\t\t\"interactive\",\n\t\t\t\"github\",\n\t\t\t\"advanced\",\n\t\t),\n\t\tallowMcp: true,\n\t\tallowToolbox: true,\n\t\tmaxToolCallsPerTurn: 30,\n\t\trequireConfirmation: true,\n\t},\n\treviewer: {\n\t\tdisplayName: \"Reviewer\",\n\t\tdescription: \"Code review mode - can read files and search web\",\n\t\tallowedTools: [...toolsFromCategories(\"read\", \"web\"), \"ask_user\"],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 15,\n\t\trequireConfirmation: false,\n\t},\n\t\"test-runner\": {\n\t\tdisplayName: \"Test Runner\",\n\t\tdescription: \"Test execution mode - can run checks and inspect results\",\n\t\tallowedTools: [\n\t\t\t...toolsFromCategories(\"read\", \"shell\", \"interactive\"),\n\t\t\t\"webfetch\",\n\t\t],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 20,\n\t\trequireConfirmation: false,\n\t},\n\tresearcher: {\n\t\tdisplayName: \"Researcher\",\n\t\tdescription: \"Research mode - focused on web search and analysis\",\n\t\tallowedTools: [...toolsFromCategories(\"web\", \"read\"), \"ask_user\", \"todo\"],\n\t\tallowMcp: true,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 20,\n\t\trequireConfirmation: false,\n\t},\n\t\"browser-qa\": {\n\t\tdisplayName: \"Browser QA\",\n\t\tdescription:\n\t\t\t\"Product QA mode - explores web surfaces and captures repro evidence\",\n\t\tallowedTools: [\n\t\t\t...toolsFromCategories(\"read\", \"web\", \"browser\"),\n\t\t\t\"bash\",\n\t\t\t\"ask_user\",\n\t\t\t\"todo\",\n\t\t],\n\t\tallowMcp: true,\n\t\tallowToolbox: true,\n\t\tmaxToolCallsPerTurn: 25,\n\t\trequireConfirmation: false,\n\t},\n\tminimal: {\n\t\tdisplayName: \"Minimal\",\n\t\tdescription: \"Minimal capabilities - only basic read operations\",\n\t\tallowedTools: [\"read\", \"list\", \"search\"],\n\t\tallowMcp: false,\n\t\tallowToolbox: false,\n\t\tmaxToolCallsPerTurn: 10,\n\t\trequireConfirmation: false,\n\t},\n\tcustom: {\n\t\tdisplayName: \"Custom\",\n\t\tdescription: \"User-defined tool specification\",\n\t\tallowedTools: toolsFromCategories(\n\t\t\t\"read\",\n\t\t\t\"write\",\n\t\t\t\"shell\",\n\t\t\t\"interactive\",\n\t\t\t\"advanced\",\n\t\t),\n\t\tallowMcp: true,\n\t\tallowToolbox: true,\n\t\trequireConfirmation: true,\n\t},\n};\n\n/**\n * Get specification for a subagent type.\n */\nexport function getSubagentSpec(type: SubagentType): SubagentSpec {\n\treturn SUBAGENT_SPECS[type];\n}\n\n/**\n * Check if a tool is allowed for a subagent type.\n */\nexport function isToolAllowed(\n\ttoolName: string,\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): boolean {\n\tconst spec = customSpec\n\t\t? { ...SUBAGENT_SPECS[type], ...customSpec }\n\t\t: SUBAGENT_SPECS[type];\n\tconst normalizedToolName = normalizeToolNameForSafety(toolName);\n\tconst deniedTools = spec.deniedTools?.map(normalizeToolNameForSafety) ?? [];\n\tconst allowedTools = spec.allowedTools.map(normalizeToolNameForSafety);\n\n\t// Denied tools take precedence\n\tif (deniedTools.includes(normalizedToolName)) {\n\t\treturn false;\n\t}\n\n\t// Check if in allowed list\n\treturn allowedTools.includes(normalizedToolName);\n}\n\n/**\n * Get the list of allowed tools for a subagent type.\n */\nexport function getAllowedTools(\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): string[] {\n\tconst spec = customSpec\n\t\t? { ...SUBAGENT_SPECS[type], ...customSpec }\n\t\t: SUBAGENT_SPECS[type];\n\n\tlet tools = spec.allowedTools.map(normalizeToolNameForSafety);\n\n\t// Remove denied tools\n\tif (spec.deniedTools) {\n\t\tconst deniedTools = new Set(\n\t\t\tspec.deniedTools.map(normalizeToolNameForSafety),\n\t\t);\n\t\ttools = tools.filter((t) => !deniedTools.has(t));\n\t}\n\n\treturn [...new Set(tools)];\n}\n\n/**\n * Filter a list of tools based on subagent spec.\n */\nexport function filterToolsForSubagent<T extends { name: string }>(\n\ttools: T[],\n\ttype: SubagentType,\n\tcustomSpec?: Partial<SubagentSpec>,\n): T[] {\n\tconst allowedTools = getAllowedTools(type, customSpec);\n\n\treturn tools.filter((tool) => {\n\t\tconst toolName = normalizeToolNameForSafety(tool.name);\n\t\treturn allowedTools.includes(toolName);\n\t});\n}\n\n/**\n * Current subagent type for the session.\n */\nlet currentSubagentType: SubagentType = \"coder\";\n\n/**\n * Get the current subagent type.\n */\nexport function getCurrentSubagentType(): SubagentType {\n\treturn currentSubagentType;\n}\n\n/**\n * Set the current subagent type.\n */\nexport function setCurrentSubagentType(type: SubagentType): void {\n\tlogger.info(\"Setting subagent type\", { type });\n\tcurrentSubagentType = type;\n}\n\n/**\n * Parse subagent type from string.\n */\nexport function parseSubagentType(typeStr: string): SubagentType | null {\n\tconst normalized = normalizeToolNameForSafety(typeStr);\n\tconst hyphenated = normalized.replace(/_/g, \"-\");\n\tif (hyphenated in SUBAGENT_SPECS) {\n\t\treturn hyphenated as SubagentType;\n\t}\n\tconst lane = codexSubagentLaneForType(typeStr);\n\treturn lane ? (CODEX_LANE_SUBAGENT_TYPES[lane.laneId] ?? null) : null;\n}\n\n/**\n * Get subagent type from environment variable.\n */\nexport function getSubagentTypeFromEnv(): SubagentType {\n\treturn parseSubagentType(process.env.MAESTRO_SUBAGENT_TYPE ?? \"\") ?? \"coder\";\n}\n\n/**\n * Format subagent type for display.\n */\nexport function formatSubagentDisplay(type: SubagentType): string {\n\tconst spec = getSubagentSpec(type);\n\treturn `${spec.displayName} - ${spec.description}`;\n}\n\n/**\n * Get all available subagent types with their specs.\n */\nexport function getAllSubagentTypes(): Array<{\n\ttype: SubagentType;\n\tspec: SubagentSpec;\n}> {\n\treturn (Object.entries(SUBAGENT_SPECS) as [SubagentType, SubagentSpec][]).map(\n\t\t([type, spec]) => ({\n\t\t\ttype,\n\t\t\tspec,\n\t\t}),\n\t);\n}\n\n/**\n * Create a custom subagent spec by merging with a base type.\n */\nexport function createCustomSpec(\n\tbaseType: SubagentType,\n\toverrides: Partial<SubagentSpec>,\n): SubagentSpec {\n\treturn {\n\t\t...SUBAGENT_SPECS[baseType],\n\t\t...overrides,\n\t\tdisplayName: overrides.displayName ?? \"Custom\",\n\t\tdescription: overrides.description ?? \"Custom configuration\",\n\t};\n}\n\n/**\n * Validate a subagent spec.\n */\nexport function validateSpec(spec: Partial<SubagentSpec>): string[] {\n\tconst errors: string[] = [];\n\n\tif (spec.allowedTools && spec.allowedTools.length === 0) {\n\t\terrors.push(\"allowedTools cannot be empty\");\n\t}\n\n\tif (spec.maxToolCallsPerTurn !== undefined && spec.maxToolCallsPerTurn < 1) {\n\t\terrors.push(\"maxToolCallsPerTurn must be at least 1\");\n\t}\n\n\treturn errors;\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm coverage gate
|
|
3
|
+
*
|
|
4
|
+
* Pre-dispatch check that refuses to start a swarm until its validation
|
|
5
|
+
* contract is fully covered: every assertion claimed by exactly one feature,
|
|
6
|
+
* no duplicate claims, and no claim referencing an unknown assertion.
|
|
7
|
+
*
|
|
8
|
+
* The gate is opt-in: a swarm configured without a validation contract passes
|
|
9
|
+
* unconditionally, preserving existing behavior. When a contract is present,
|
|
10
|
+
* the orchestrator must supply feature claims that cover it (see
|
|
11
|
+
* ./orchestrator-prompt.ts).
|
|
12
|
+
*/
|
|
13
|
+
import { type CoverageReport, type FeatureClaim, type ValidationContract } from "../validation-contract.js";
|
|
14
|
+
export interface SwarmCoverageGateInput {
|
|
15
|
+
/** Mission validation contract; when absent the gate passes unconditionally. */
|
|
16
|
+
validationContract?: ValidationContract;
|
|
17
|
+
/** Feature claims to evaluate against the contract. */
|
|
18
|
+
featureClaims?: FeatureClaim[];
|
|
19
|
+
}
|
|
20
|
+
export interface SwarmCoverageGateResult {
|
|
21
|
+
/** True when there is no contract to gate, or coverage is complete. */
|
|
22
|
+
ok: boolean;
|
|
23
|
+
/** Coverage report, present only when a contract was evaluated. */
|
|
24
|
+
report?: CoverageReport;
|
|
25
|
+
/** Actionable failure message, present only when ok is false. */
|
|
26
|
+
message?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Render an actionable, single-string explanation of why coverage failed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatCoverageGateFailure(report: CoverageReport): string;
|
|
32
|
+
/**
|
|
33
|
+
* Evaluate the coverage gate for a swarm. Passes unconditionally when no
|
|
34
|
+
* validation contract is configured.
|
|
35
|
+
*/
|
|
36
|
+
export declare function evaluateSwarmCoverageGate(input: SwarmCoverageGateInput): SwarmCoverageGateResult;
|
|
37
|
+
//# sourceMappingURL=coverage-gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-gate.d.ts","sourceRoot":"","sources":["../../../src/agent/swarm/coverage-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EAEvB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,sBAAsB;IACtC,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,uDAAuD;IACvD,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACvC,uEAAuE;IACvE,EAAE,EAAE,OAAO,CAAC;IACZ,mEAAmE;IACnE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAuBxE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,sBAAsB,GAC3B,uBAAuB,CAUzB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swarm coverage gate
|
|
3
|
+
*
|
|
4
|
+
* Pre-dispatch check that refuses to start a swarm until its validation
|
|
5
|
+
* contract is fully covered: every assertion claimed by exactly one feature,
|
|
6
|
+
* no duplicate claims, and no claim referencing an unknown assertion.
|
|
7
|
+
*
|
|
8
|
+
* The gate is opt-in: a swarm configured without a validation contract passes
|
|
9
|
+
* unconditionally, preserving existing behavior. When a contract is present,
|
|
10
|
+
* the orchestrator must supply feature claims that cover it (see
|
|
11
|
+
* ./orchestrator-prompt.ts).
|
|
12
|
+
*/
|
|
13
|
+
import { checkCoverage, } from "../validation-contract.js";
|
|
14
|
+
/**
|
|
15
|
+
* Render an actionable, single-string explanation of why coverage failed.
|
|
16
|
+
*/
|
|
17
|
+
export function formatCoverageGateFailure(report) {
|
|
18
|
+
const parts = [
|
|
19
|
+
"Swarm refused to start: the validation contract is not fully covered.",
|
|
20
|
+
];
|
|
21
|
+
if (report.orphans.length > 0) {
|
|
22
|
+
parts.push(`Unclaimed assertions (no feature fulfills them): ${report.orphans.join(", ")}.`);
|
|
23
|
+
}
|
|
24
|
+
if (report.duplicates.length > 0) {
|
|
25
|
+
parts.push(`Assertions claimed more than once or duplicated in the contract: ${report.duplicates.join(", ")}.`);
|
|
26
|
+
}
|
|
27
|
+
if (report.unknownAssertions.length > 0) {
|
|
28
|
+
parts.push(`Features reference assertions absent from the contract: ${report.unknownAssertions.join(", ")}.`);
|
|
29
|
+
}
|
|
30
|
+
parts.push("Every assertion must be claimed by exactly one feature before work begins.");
|
|
31
|
+
return parts.join(" ");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Evaluate the coverage gate for a swarm. Passes unconditionally when no
|
|
35
|
+
* validation contract is configured.
|
|
36
|
+
*/
|
|
37
|
+
export function evaluateSwarmCoverageGate(input) {
|
|
38
|
+
const { validationContract, featureClaims } = input;
|
|
39
|
+
if (!validationContract) {
|
|
40
|
+
return { ok: true };
|
|
41
|
+
}
|
|
42
|
+
const report = checkCoverage(validationContract, featureClaims ?? []);
|
|
43
|
+
if (report.ok) {
|
|
44
|
+
return { ok: true, report };
|
|
45
|
+
}
|
|
46
|
+
return { ok: false, report, message: formatCoverageGateFailure(report) };
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=coverage-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coverage-gate.js","sourceRoot":"","sources":["../../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E,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC;AAC1E,CAAC","sourcesContent":["/**\n * Swarm coverage gate\n *\n * Pre-dispatch check that refuses to start a swarm until its validation\n * contract is fully covered: every assertion claimed by exactly one feature,\n * no duplicate claims, and no claim referencing an unknown assertion.\n *\n * The gate is opt-in: a swarm configured without a validation contract passes\n * unconditionally, preserving existing behavior. When a contract is present,\n * the orchestrator must supply feature claims that cover it (see\n * ./orchestrator-prompt.ts).\n */\n\nimport {\n\ttype CoverageReport,\n\ttype FeatureClaim,\n\ttype ValidationContract,\n\tcheckCoverage,\n} from \"../validation-contract.js\";\n\nexport interface SwarmCoverageGateInput {\n\t/** Mission validation contract; when absent the gate passes unconditionally. */\n\tvalidationContract?: ValidationContract;\n\t/** Feature claims to evaluate against the contract. */\n\tfeatureClaims?: FeatureClaim[];\n}\n\nexport interface SwarmCoverageGateResult {\n\t/** True when there is no contract to gate, or coverage is complete. */\n\tok: boolean;\n\t/** Coverage report, present only when a contract was evaluated. */\n\treport?: CoverageReport;\n\t/** Actionable failure message, present only when ok is false. */\n\tmessage?: string;\n}\n\n/**\n * Render an actionable, single-string explanation of why coverage failed.\n */\nexport function formatCoverageGateFailure(report: CoverageReport): string {\n\tconst parts: string[] = [\n\t\t\"Swarm refused to start: the validation contract is not fully covered.\",\n\t];\n\tif (report.orphans.length > 0) {\n\t\tparts.push(\n\t\t\t`Unclaimed assertions (no feature fulfills them): ${report.orphans.join(\", \")}.`,\n\t\t);\n\t}\n\tif (report.duplicates.length > 0) {\n\t\tparts.push(\n\t\t\t`Assertions claimed more than once or duplicated in the contract: ${report.duplicates.join(\", \")}.`,\n\t\t);\n\t}\n\tif (report.unknownAssertions.length > 0) {\n\t\tparts.push(\n\t\t\t`Features reference assertions absent from the contract: ${report.unknownAssertions.join(\", \")}.`,\n\t\t);\n\t}\n\tparts.push(\n\t\t\"Every assertion must be claimed by exactly one feature before work begins.\",\n\t);\n\treturn parts.join(\" \");\n}\n\n/**\n * Evaluate the coverage gate for a swarm. Passes unconditionally when no\n * validation contract is configured.\n */\nexport function evaluateSwarmCoverageGate(\n\tinput: SwarmCoverageGateInput,\n): SwarmCoverageGateResult {\n\tconst { validationContract, featureClaims } = input;\n\tif (!validationContract) {\n\t\treturn { ok: true };\n\t}\n\tconst report = checkCoverage(validationContract, featureClaims ?? []);\n\tif (report.ok) {\n\t\treturn { ok: true, report };\n\t}\n\treturn { ok: false, report, message: formatCoverageGateFailure(report) };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agent/swarm/executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agent/swarm/executor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmEH,OAAO,KAAK,EAEX,WAAW,EAEX,iBAAiB,EACjB,UAAU,EAKV,MAAM,YAAY,CAAC;AA6WpB;;GAEG;AACH,qBAAa,aAAa;IACzB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,SAAS,CAAwC;IACzD,OAAO,CAAC,cAAc,CAAgD;IACtE,OAAO,CAAC,oBAAoB,CACjB;IACX,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAAqC;IAC1D,OAAO,CAAC,eAAe,CAAkB;gBAE7B,MAAM,EAAE,WAAW;IAwC/B;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,IAAI;IAK/C;;OAEG;IACH,OAAO,CAAC,IAAI;IAmBZ;;OAEG;IACH,QAAQ,IAAI,UAAU;IAItB;;OAEG;IACH,MAAM,IAAI,IAAI;YAoCA,mBAAmB;IAmCjC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IA+FpC;;OAEG;YACW,WAAW;IAyCzB;;OAEG;IACH,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,oCAAoC;IA6B5C;;OAEG;YACW,gBAAgB;IAgE9B,OAAO,CAAC,mBAAmB;IAgD3B,OAAO,CAAC,kBAAkB;IA0C1B,OAAO,CAAC,iBAAiB;IAQzB,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,gBAAgB;YAyDV,uBAAuB;YAgCvB,yCAAyC;YAqFzC,6BAA6B;IAwC3C,OAAO,CAAC,iBAAiB;IAmBzB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,mBAAmB;IA0C3B,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,wBAAwB;YAQlB,aAAa;YAwVb,gBAAgB;IAmM9B,OAAO,CAAC,4BAA4B;IAmDpC,OAAO,CAAC,4BAA4B;YAuEtB,mBAAmB;IA+BjC,OAAO,CAAC,mBAAmB;IA8D3B,OAAO,CAAC,eAAe;YAuDT,uBAAuB;YAyCvB,wBAAwB;IAsBtC;;OAEG;IACH,OAAO,CAAC,oBAAoB;CAe5B;AA4CD;;GAEG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,WAAW,EACnB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,UAAU,CAAC,CAMrB"}
|
|
@@ -11,7 +11,7 @@ import { unlinkSync, writeFileSync } from "node:fs";
|
|
|
11
11
|
import { tmpdir } from "node:os";
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
import { formatDelegation } from "@evalops/contracts";
|
|
14
|
-
import { codexSubagentTypeA2ASkillID } from "../../codex/subagent-dispatch-table.js";
|
|
14
|
+
import { codexSubagentSkillToken, codexSubagentTypeA2ASkillID, } from "../../codex/subagent-dispatch-table.js";
|
|
15
15
|
import { buildEvalOpsDelegationEnvironment, issueEvalOpsDelegationToken, } from "../../oauth/index.js";
|
|
16
16
|
import { rankA2ACapabilityPeers } from "../../platform/a2a-capability-market.js";
|
|
17
17
|
import { buildA2AUserMessage, cancelA2ATask, getA2ATask, normalizeA2ABaseUrl, resolveA2AServiceConfig, sendA2AMessage, } from "../../platform/a2a-client.js";
|
|
@@ -23,8 +23,13 @@ import { getEnvValue, trimString } from "../../platform/client.js";
|
|
|
23
23
|
import { recordA2ADelegationTelemetry as recordA2ADelegationTelemetryEvent, recordSubagentDispatch, } from "../../telemetry.js";
|
|
24
24
|
import { createLogger } from "../../utils/logger.js";
|
|
25
25
|
import { sanitizeWithStaticMask } from "../../utils/secret-redactor.js";
|
|
26
|
+
import { detectMissionSessionRole } from "../mission-artifacts.js";
|
|
26
27
|
import { parseMode, resolveSubagentDispatch, } from "../modes.js";
|
|
28
|
+
import { applySpecialistProfileToPrompt, resolveSpecialistProfile, } from "../specialist-profiles.js";
|
|
29
|
+
import { parseSubagentType } from "../subagent-specs.js";
|
|
30
|
+
import { evaluateSwarmCoverageGate } from "./coverage-gate.js";
|
|
27
31
|
import { publishSwarmRuntimeEvent } from "./runtime-events.js";
|
|
32
|
+
import { buildSwarmValidationDirective } from "./validation-directive.js";
|
|
28
33
|
const logger = createLogger("agent:swarm:executor");
|
|
29
34
|
/** Default timeout per task (5 minutes) */
|
|
30
35
|
const DEFAULT_TASK_TIMEOUT_MS = 5 * 60 * 1000;
|
|
@@ -41,6 +46,7 @@ const A2A_SKILL_PRIMARY_TASK_CLASSES = new Map([
|
|
|
41
46
|
["maestro.subagent.code-writer", "code.implementation"],
|
|
42
47
|
["maestro.subagent.code-review", "code.review"],
|
|
43
48
|
["maestro.subagent.test-runner", "test.execution"],
|
|
49
|
+
["maestro.subagent.browser-qa", "product.qa"],
|
|
44
50
|
["maestro.subagent.repo-explorer", "repo.inspect"],
|
|
45
51
|
["maestro.subagent.release-shepherd", "release.follow-through"],
|
|
46
52
|
]);
|
|
@@ -57,10 +63,18 @@ const SWARM_SUBAGENT_TASK_CLASSES = new Map([
|
|
|
57
63
|
["test", "test.execution"],
|
|
58
64
|
["ci", "test.execution"],
|
|
59
65
|
["ci-monitor", "test.execution"],
|
|
66
|
+
["test-runner", "test.execution"],
|
|
67
|
+
["browser-qa", "product.qa"],
|
|
68
|
+
["browser", "product.qa"],
|
|
69
|
+
["dogfood", "product.qa"],
|
|
70
|
+
["product-qa", "product.qa"],
|
|
71
|
+
["e2e-qa", "browser.e2e"],
|
|
72
|
+
["ux-qa", "ux.repro"],
|
|
60
73
|
["planner", "agent.delegation"],
|
|
61
74
|
["minimal", "agent.delegation"],
|
|
62
75
|
["custom", "agent.delegation"],
|
|
63
76
|
]);
|
|
77
|
+
const A2A_SUBAGENT_TASK_CLASS_OVERRIDES = new Set(["e2e-qa", "ux-qa"]);
|
|
64
78
|
/** Teammate name prefixes for friendly identification */
|
|
65
79
|
const TEAMMATE_NAMES = [
|
|
66
80
|
"Alpha",
|
|
@@ -141,6 +155,13 @@ function cloneConfig(config) {
|
|
|
141
155
|
}
|
|
142
156
|
: undefined,
|
|
143
157
|
tasks: config.tasks.map(cloneTask),
|
|
158
|
+
validationContract: config.validationContract
|
|
159
|
+
? structuredClone(config.validationContract)
|
|
160
|
+
: undefined,
|
|
161
|
+
featureClaims: config.featureClaims?.map((claim) => ({
|
|
162
|
+
...claim,
|
|
163
|
+
fulfills: [...claim.fulfills],
|
|
164
|
+
})),
|
|
144
165
|
};
|
|
145
166
|
}
|
|
146
167
|
function cloneState(state) {
|
|
@@ -280,6 +301,9 @@ function buildDispatchEnv(dispatch, reasoningEffortOverride, runtimeSelection) {
|
|
|
280
301
|
}
|
|
281
302
|
return env;
|
|
282
303
|
}
|
|
304
|
+
function resolveMissionRoleForTeammate() {
|
|
305
|
+
return detectMissionSessionRole() === "validator" ? "validator" : "worker";
|
|
306
|
+
}
|
|
283
307
|
/**
|
|
284
308
|
* SwarmExecutor manages a swarm of parallel agent instances.
|
|
285
309
|
*/
|
|
@@ -421,6 +445,30 @@ export class SwarmExecutor {
|
|
|
421
445
|
* Execute the swarm - runs all tasks with available teammates.
|
|
422
446
|
*/
|
|
423
447
|
async execute() {
|
|
448
|
+
// Pre-dispatch coverage gate: refuse to start when a validation contract
|
|
449
|
+
// is configured but its assertions are not fully covered by feature
|
|
450
|
+
// claims. No-ops when no contract is configured.
|
|
451
|
+
const coverage = evaluateSwarmCoverageGate({
|
|
452
|
+
validationContract: this.state.config.validationContract,
|
|
453
|
+
featureClaims: this.state.config.featureClaims,
|
|
454
|
+
});
|
|
455
|
+
if (!coverage.ok) {
|
|
456
|
+
const error = coverage.message ?? "Swarm coverage gate failed";
|
|
457
|
+
this.state.status = "failed";
|
|
458
|
+
this.state.error = error;
|
|
459
|
+
this.state.completedAt = Date.now();
|
|
460
|
+
this.emit({
|
|
461
|
+
type: "swarm_fail",
|
|
462
|
+
swarmId: this.state.id,
|
|
463
|
+
error,
|
|
464
|
+
});
|
|
465
|
+
this.emit({
|
|
466
|
+
type: "swarm_complete",
|
|
467
|
+
swarmId: this.state.id,
|
|
468
|
+
state: cloneState(this.state),
|
|
469
|
+
});
|
|
470
|
+
return cloneState(this.state);
|
|
471
|
+
}
|
|
424
472
|
this.state.status = "running";
|
|
425
473
|
this.emit({
|
|
426
474
|
type: "swarm_start",
|
|
@@ -554,9 +602,11 @@ export class SwarmExecutor {
|
|
|
554
602
|
async buildTeammateEnv(teammate, task, dispatch, runtimeSelection) {
|
|
555
603
|
const baseEnv = {
|
|
556
604
|
...process.env,
|
|
605
|
+
MAESTRO_MISSION_WORKER: "1",
|
|
557
606
|
MAESTRO_SWARM_MODE: "1",
|
|
558
607
|
MAESTRO_SWARM_ID: this.state.id,
|
|
559
608
|
MAESTRO_TEAMMATE_ID: teammate.id,
|
|
609
|
+
MAESTRO_MISSION_ROLE: resolveMissionRoleForTeammate(),
|
|
560
610
|
...buildDispatchEnv(dispatch, this.state.config.reasoningEffort, runtimeSelection),
|
|
561
611
|
};
|
|
562
612
|
try {
|
|
@@ -591,7 +641,11 @@ export class SwarmExecutor {
|
|
|
591
641
|
}
|
|
592
642
|
resolveTaskDispatch(task, teammate, options = {}) {
|
|
593
643
|
const startedAt = Date.now();
|
|
594
|
-
const
|
|
644
|
+
const requestedSubagentType = task.subagentType ?? this.state.config.subagentType;
|
|
645
|
+
if (!requestedSubagentType) {
|
|
646
|
+
return null;
|
|
647
|
+
}
|
|
648
|
+
const subagentType = parseSubagentType(requestedSubagentType);
|
|
595
649
|
if (!subagentType) {
|
|
596
650
|
return null;
|
|
597
651
|
}
|
|
@@ -706,7 +760,7 @@ export class SwarmExecutor {
|
|
|
706
760
|
config: peer.config,
|
|
707
761
|
skillId,
|
|
708
762
|
taskClass: this.resolveA2ATaskClass(task, options, skillId),
|
|
709
|
-
role:
|
|
763
|
+
role: this.resolveA2ARole(task, options),
|
|
710
764
|
tasksPath: options.tasksPath,
|
|
711
765
|
peerEndpointHash: hashA2AEndpointUrlForTelemetry(peer.config.baseUrl),
|
|
712
766
|
source: "registry",
|
|
@@ -769,7 +823,7 @@ export class SwarmExecutor {
|
|
|
769
823
|
config,
|
|
770
824
|
skillId: selectedSkillId,
|
|
771
825
|
taskClass: this.resolveA2ATaskClass(task, options, selectedSkillId),
|
|
772
|
-
role:
|
|
826
|
+
role: this.resolveA2ARole(task, options),
|
|
773
827
|
tasksPath: options.tasksPath,
|
|
774
828
|
peerAgentId: candidate.agent.id,
|
|
775
829
|
peerEndpointHash: endpointHash,
|
|
@@ -829,20 +883,44 @@ export class SwarmExecutor {
|
|
|
829
883
|
return peer?.entry.skills?.[0]?.id;
|
|
830
884
|
}
|
|
831
885
|
resolveA2ATaskClass(task, options, skillId) {
|
|
886
|
+
const explicitSkill = trimString(task.a2aSkillId) ?? trimString(options.skillId);
|
|
887
|
+
const requestedSubagentType = trimString(task.subagentType ?? this.state.config.subagentType);
|
|
888
|
+
const normalizedRequestedSubagentType = codexSubagentSkillToken(requestedSubagentType);
|
|
889
|
+
const parsedSubagentType = requestedSubagentType
|
|
890
|
+
? parseSubagentType(requestedSubagentType)
|
|
891
|
+
: undefined;
|
|
892
|
+
const subagentType = parsedSubagentType ?? normalizedRequestedSubagentType;
|
|
893
|
+
const mappedSubagentTaskClass = normalizedRequestedSubagentType
|
|
894
|
+
? (SWARM_SUBAGENT_TASK_CLASSES.get(normalizedRequestedSubagentType) ??
|
|
895
|
+
(parsedSubagentType
|
|
896
|
+
? SWARM_SUBAGENT_TASK_CLASSES.get(parsedSubagentType)
|
|
897
|
+
: undefined))
|
|
898
|
+
: undefined;
|
|
899
|
+
if (mappedSubagentTaskClass &&
|
|
900
|
+
normalizedRequestedSubagentType &&
|
|
901
|
+
A2A_SUBAGENT_TASK_CLASS_OVERRIDES.has(normalizedRequestedSubagentType)) {
|
|
902
|
+
return mappedSubagentTaskClass;
|
|
903
|
+
}
|
|
832
904
|
const mappedSkillTaskClass = skillId
|
|
833
905
|
? A2A_SKILL_PRIMARY_TASK_CLASSES.get(skillId)
|
|
834
906
|
: undefined;
|
|
835
907
|
if (mappedSkillTaskClass) {
|
|
836
908
|
return mappedSkillTaskClass;
|
|
837
909
|
}
|
|
838
|
-
if (skillId &&
|
|
839
|
-
(trimString(task.a2aSkillId) || trimString(options.skillId))) {
|
|
910
|
+
if (skillId && explicitSkill) {
|
|
840
911
|
return undefined;
|
|
841
912
|
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
913
|
+
return mappedSubagentTaskClass ?? subagentType ?? requestedSubagentType;
|
|
914
|
+
}
|
|
915
|
+
resolveA2ARole(task, options) {
|
|
916
|
+
const configuredRole = trimString(options.role);
|
|
917
|
+
if (configuredRole) {
|
|
918
|
+
return parseSubagentType(configuredRole) ?? configuredRole;
|
|
919
|
+
}
|
|
920
|
+
const requestedSubagentType = trimString(task.subagentType ?? this.state.config.subagentType);
|
|
921
|
+
return requestedSubagentType
|
|
922
|
+
? (parseSubagentType(requestedSubagentType) ?? requestedSubagentType)
|
|
923
|
+
: undefined;
|
|
846
924
|
}
|
|
847
925
|
teammateIndex(teammate) {
|
|
848
926
|
const index = this.state.teammates.findIndex((item) => item.id === teammate.id);
|
|
@@ -858,18 +936,64 @@ export class SwarmExecutor {
|
|
|
858
936
|
}
|
|
859
937
|
async spawnTeammate(teammate, task) {
|
|
860
938
|
const tmpFile = join(tmpdir(), `${this.state.id}-${toSafeTaskTempBasename(task.id)}`);
|
|
939
|
+
const specialistProfile = task.specialistProfile
|
|
940
|
+
? resolveSpecialistProfile(task.specialistProfile, this.state.config.cwd)
|
|
941
|
+
: null;
|
|
942
|
+
if (task.specialistProfile && !specialistProfile) {
|
|
943
|
+
throw new Error(`specialist profile not found or invalid: ${task.specialistProfile}`);
|
|
944
|
+
}
|
|
861
945
|
const delegationPrompt = {
|
|
862
946
|
goal: `Complete swarm task ${task.id} as teammate "${teammate.name}".`,
|
|
863
947
|
context: `You are teammate "${teammate.name}" in swarm ${this.state.id}, working from plan file ${this.state.config.planFile}.`,
|
|
864
|
-
task: task.prompt,
|
|
948
|
+
task: applySpecialistProfileToPrompt(task.prompt, specialistProfile),
|
|
865
949
|
evidence: task.files?.length
|
|
866
950
|
? task.files.map((file) => `Relevant file: ${file}`)
|
|
867
951
|
: [],
|
|
868
|
-
validation:
|
|
952
|
+
validation: buildSwarmValidationDirective(task.mocksAllowed),
|
|
869
953
|
stoppingCondition: "Stop when the assigned task is complete and report what changed, what you verified, and any blockers. Do not broaden into unrelated tasks.",
|
|
870
954
|
};
|
|
871
955
|
const prompt = formatDelegation(delegationPrompt);
|
|
956
|
+
const requestedSubagentType = task.subagentType ?? this.state.config.subagentType;
|
|
872
957
|
writeFileSync(tmpFile, prompt);
|
|
958
|
+
if (requestedSubagentType && !parseSubagentType(requestedSubagentType)) {
|
|
959
|
+
try {
|
|
960
|
+
unlinkSync(tmpFile);
|
|
961
|
+
}
|
|
962
|
+
catch {
|
|
963
|
+
// Ignore cleanup errors
|
|
964
|
+
}
|
|
965
|
+
const error = `Invalid subagent type: ${requestedSubagentType}`;
|
|
966
|
+
this.state.activeTasks.delete(task.id);
|
|
967
|
+
this.state.failedTasks.add(task.id);
|
|
968
|
+
if (!this.state.config.continueOnFailure) {
|
|
969
|
+
this.state.status = "failed";
|
|
970
|
+
}
|
|
971
|
+
teammate.status = "failed";
|
|
972
|
+
teammate.error = error;
|
|
973
|
+
teammate.completedAt = Date.now();
|
|
974
|
+
teammate.currentTask = undefined;
|
|
975
|
+
this.emit({
|
|
976
|
+
type: "task_fail",
|
|
977
|
+
swarmId: this.state.id,
|
|
978
|
+
teammateId: teammate.id,
|
|
979
|
+
taskId: task.id,
|
|
980
|
+
error,
|
|
981
|
+
});
|
|
982
|
+
this.emit({
|
|
983
|
+
type: "teammate_complete",
|
|
984
|
+
swarmId: this.state.id,
|
|
985
|
+
teammate,
|
|
986
|
+
});
|
|
987
|
+
if (this.state.status === "running" &&
|
|
988
|
+
(this.state.pendingTasks.length > 0 ||
|
|
989
|
+
this.state.activeTasks.size > 0) &&
|
|
990
|
+
this.state.config.continueOnFailure) {
|
|
991
|
+
teammate.status = "pending";
|
|
992
|
+
teammate.error = undefined;
|
|
993
|
+
teammate.completedAt = undefined;
|
|
994
|
+
}
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
873
997
|
const a2aConfig = this.resolveA2AConfig();
|
|
874
998
|
if (a2aConfig) {
|
|
875
999
|
void this.spawnA2ATeammate(teammate, task, prompt, tmpFile, a2aConfig);
|
|
@@ -1153,7 +1277,7 @@ export class SwarmExecutor {
|
|
|
1153
1277
|
route,
|
|
1154
1278
|
taskId: sent.task.id,
|
|
1155
1279
|
});
|
|
1156
|
-
await this.recordA2ASwarmTaskStart(route, task, sent.task, {
|
|
1280
|
+
await this.recordA2ASwarmTaskStart(route, task, sent.task, prompt, {
|
|
1157
1281
|
messageId,
|
|
1158
1282
|
contextId,
|
|
1159
1283
|
});
|
|
@@ -1273,6 +1397,7 @@ export class SwarmExecutor {
|
|
|
1273
1397
|
});
|
|
1274
1398
|
}
|
|
1275
1399
|
buildA2ASwarmMessageMetadata(teammate, task, route) {
|
|
1400
|
+
const missionRole = resolveMissionRoleForTeammate();
|
|
1276
1401
|
const currentDelegationId = `${this.state.id}:${task.id}`;
|
|
1277
1402
|
const contextId = `maestro-swarm:${this.state.id}:${task.id}`;
|
|
1278
1403
|
const lineage = {
|
|
@@ -1292,6 +1417,8 @@ export class SwarmExecutor {
|
|
|
1292
1417
|
cwd: this.state.config.cwd,
|
|
1293
1418
|
taskId: task.id,
|
|
1294
1419
|
swarmId: this.state.id,
|
|
1420
|
+
missionRole,
|
|
1421
|
+
env: { MAESTRO_MISSION_ROLE: missionRole },
|
|
1295
1422
|
}
|
|
1296
1423
|
: undefined;
|
|
1297
1424
|
const peerControl = {
|
|
@@ -1303,6 +1430,11 @@ export class SwarmExecutor {
|
|
|
1303
1430
|
controlModes: ["followup", "steer", "interrupt", "cancel"],
|
|
1304
1431
|
evidenceRequired: ["status", "artifact", "task", "workGraph"],
|
|
1305
1432
|
};
|
|
1433
|
+
const validationPolicy = {
|
|
1434
|
+
schema: "evalops.maestro.swarm-validation-policy.v1",
|
|
1435
|
+
mocksAllowed: task.mocksAllowed === true,
|
|
1436
|
+
mode: task.mocksAllowed === true ? "mocks-allowed" : "real-integrations",
|
|
1437
|
+
};
|
|
1306
1438
|
return {
|
|
1307
1439
|
requestKind: "maestro-swarm-task",
|
|
1308
1440
|
transport: "a2a",
|
|
@@ -1311,6 +1443,8 @@ export class SwarmExecutor {
|
|
|
1311
1443
|
teammateId: teammate.id,
|
|
1312
1444
|
teammateName: teammate.name,
|
|
1313
1445
|
taskId: task.id,
|
|
1446
|
+
missionRole,
|
|
1447
|
+
validation: validationPolicy,
|
|
1314
1448
|
...(route.skillId ? { a2aSkillId: route.skillId } : {}),
|
|
1315
1449
|
...(task.files?.length ? { files: task.files } : {}),
|
|
1316
1450
|
swarm: lineage,
|
|
@@ -1319,8 +1453,10 @@ export class SwarmExecutor {
|
|
|
1319
1453
|
transport: "a2a",
|
|
1320
1454
|
peer: route.name,
|
|
1321
1455
|
peerControl,
|
|
1456
|
+
validation: validationPolicy,
|
|
1322
1457
|
},
|
|
1323
1458
|
"evalops.peerControl": peerControl,
|
|
1459
|
+
"evalops.validation": validationPolicy,
|
|
1324
1460
|
...(subagentRequest
|
|
1325
1461
|
? { "evalops.subagentRequest": subagentRequest }
|
|
1326
1462
|
: {}),
|
|
@@ -1445,14 +1581,14 @@ export class SwarmExecutor {
|
|
|
1445
1581
|
teammate.a2a = undefined;
|
|
1446
1582
|
}
|
|
1447
1583
|
}
|
|
1448
|
-
async recordA2ASwarmTaskStart(route, task, remoteTask, ids) {
|
|
1584
|
+
async recordA2ASwarmTaskStart(route, task, remoteTask, delegatedPrompt, ids) {
|
|
1449
1585
|
try {
|
|
1450
1586
|
await recordA2ATaskStart({
|
|
1451
1587
|
path: route.tasksPath,
|
|
1452
1588
|
peer: route.name,
|
|
1453
1589
|
peerDisplayName: route.displayName,
|
|
1454
1590
|
task: remoteTask,
|
|
1455
|
-
text:
|
|
1591
|
+
text: delegatedPrompt,
|
|
1456
1592
|
messageId: ids.messageId,
|
|
1457
1593
|
contextId: remoteTask.contextId ?? ids.contextId,
|
|
1458
1594
|
kind: "delegation",
|