@evalops/maestro 0.10.17 → 0.10.20
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/README.md +56 -1
- package/dist/agent/action-approval.d.ts +12 -2
- package/dist/agent/action-approval.d.ts.map +1 -1
- package/dist/agent/action-approval.js +19 -32
- package/dist/agent/action-approval.js.map +1 -1
- package/dist/agent/agent.d.ts +1 -0
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +26 -0
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/compaction.d.ts +2 -0
- package/dist/agent/compaction.d.ts.map +1 -1
- package/dist/agent/compaction.js +4 -2
- package/dist/agent/compaction.js.map +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/modes.d.ts +56 -4
- package/dist/agent/modes.d.ts.map +1 -1
- package/dist/agent/modes.js +163 -2
- package/dist/agent/modes.js.map +1 -1
- package/dist/agent/prompt-recovery.d.ts.map +1 -1
- package/dist/agent/prompt-recovery.js +1 -3
- package/dist/agent/prompt-recovery.js.map +1 -1
- package/dist/agent/providers/anthropic.d.ts.map +1 -1
- package/dist/agent/providers/anthropic.js +9 -1
- package/dist/agent/providers/anthropic.js.map +1 -1
- package/dist/agent/providers/codex-app-server.d.ts +12 -0
- package/dist/agent/providers/codex-app-server.d.ts.map +1 -0
- package/dist/agent/providers/codex-app-server.js +788 -0
- package/dist/agent/providers/codex-app-server.js.map +1 -0
- package/dist/agent/providers/google-gemini-cli.js +14 -3
- package/dist/agent/providers/google.js +22 -3
- package/dist/agent/providers/scripted.d.ts +11 -0
- package/dist/agent/providers/scripted.d.ts.map +1 -0
- package/dist/agent/providers/scripted.js +399 -0
- package/dist/agent/providers/scripted.js.map +1 -0
- package/dist/agent/providers/vertex.js +14 -3
- package/dist/agent/scenario-source.d.ts +19 -0
- package/dist/agent/scenario-source.d.ts.map +1 -0
- package/dist/agent/scenario-source.js +112 -0
- package/dist/agent/scenario-source.js.map +1 -0
- package/dist/agent/subagent-specs.d.ts +1 -1
- package/dist/agent/subagent-specs.js +1 -1
- package/dist/agent/subagent-specs.js.map +1 -1
- package/dist/agent/swarm/executor.d.ts +25 -0
- package/dist/agent/swarm/executor.d.ts.map +1 -1
- package/dist/agent/swarm/executor.js +795 -20
- package/dist/agent/swarm/executor.js.map +1 -1
- package/dist/agent/swarm/runtime-events.d.ts +11 -0
- package/dist/agent/swarm/runtime-events.d.ts.map +1 -0
- package/dist/agent/swarm/runtime-events.js +26 -0
- package/dist/agent/swarm/runtime-events.js.map +1 -0
- package/dist/agent/swarm/types.d.ts +78 -0
- package/dist/agent/swarm/types.d.ts.map +1 -1
- package/dist/agent/swarm/types.js.map +1 -1
- package/dist/agent/tracing.d.ts +1 -1
- package/dist/agent/tracing.d.ts.map +1 -1
- package/dist/agent/tracing.js +17 -9
- package/dist/agent/tracing.js.map +1 -1
- package/dist/agent/transport/create-provider-stream.d.ts.map +1 -1
- package/dist/agent/transport/create-provider-stream.js +14 -0
- package/dist/agent/transport/create-provider-stream.js.map +1 -1
- package/dist/agent/transport/stable-stringify.d.ts +2 -0
- package/dist/agent/transport/stable-stringify.d.ts.map +1 -0
- package/dist/agent/transport/stable-stringify.js +14 -0
- package/dist/agent/transport/stable-stringify.js.map +1 -0
- package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -1
- package/dist/agent/transport/tool-execution-bridge.js +2 -15
- package/dist/agent/transport/tool-execution-bridge.js.map +1 -1
- package/dist/agent/transport/tool-safety-pipeline.d.ts +5 -1
- package/dist/agent/transport/tool-safety-pipeline.d.ts.map +1 -1
- package/dist/agent/transport/tool-safety-pipeline.js +184 -36
- package/dist/agent/transport/tool-safety-pipeline.js.map +1 -1
- package/dist/agent/transport.d.ts +8 -0
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/transport.js +1613 -68
- package/dist/agent/transport.js.map +1 -1
- package/dist/agent/types.d.ts +170 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/api/enterprise-routes.d.ts.map +1 -1
- package/dist/api/enterprise-routes.js +34 -3
- package/dist/api/enterprise-routes.js.map +1 -1
- package/dist/app-server/in-process-client.d.ts +32 -0
- package/dist/app-server/in-process-client.d.ts.map +1 -0
- package/dist/app-server/in-process-client.js +73 -0
- package/dist/app-server/in-process-client.js.map +1 -0
- package/dist/app-server/session-api.d.ts +36 -0
- package/dist/app-server/session-api.d.ts.map +1 -0
- package/dist/app-server/session-api.js +713 -0
- package/dist/app-server/session-api.js.map +1 -0
- package/dist/approvals/platform-action-approval.d.ts +3 -1
- package/dist/approvals/platform-action-approval.d.ts.map +1 -1
- package/dist/approvals/platform-action-approval.js +16 -9
- package/dist/approvals/platform-action-approval.js.map +1 -1
- package/dist/approvals/service-client.d.ts.map +1 -1
- package/dist/approvals/service-client.js +7 -7
- package/dist/approvals/service-client.js.map +1 -1
- package/dist/audit/logger.d.ts +4 -4
- package/dist/bootstrap/agent-creation-setup.d.ts +4 -0
- package/dist/bootstrap/agent-creation-setup.d.ts.map +1 -1
- package/dist/bootstrap/agent-creation-setup.js +3 -1
- package/dist/bootstrap/agent-creation-setup.js.map +1 -1
- package/dist/bootstrap/auth-setup.js +1 -1
- package/dist/bootstrap/auth-setup.js.map +1 -1
- package/dist/bootstrap/event-subscriptions-setup.d.ts +6 -0
- package/dist/bootstrap/event-subscriptions-setup.d.ts.map +1 -1
- package/dist/bootstrap/event-subscriptions-setup.js +26 -2
- package/dist/bootstrap/event-subscriptions-setup.js.map +1 -1
- package/dist/bootstrap/model-resolution-setup.d.ts.map +1 -1
- package/dist/bootstrap/model-resolution-setup.js +4 -1
- package/dist/bootstrap/model-resolution-setup.js.map +1 -1
- package/dist/bootstrap/tools-setup.d.ts +2 -1
- package/dist/bootstrap/tools-setup.d.ts.map +1 -1
- package/dist/bootstrap/tools-setup.js +5 -1
- package/dist/bootstrap/tools-setup.js.map +1 -1
- package/dist/cli/args.d.ts +9 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +130 -5
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/a2a.d.ts +9 -0
- package/dist/cli/commands/a2a.d.ts.map +1 -0
- package/dist/cli/commands/a2a.js +1714 -0
- package/dist/cli/commands/a2a.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +16 -2
- package/dist/cli/commands/agents.d.ts.map +1 -1
- package/dist/cli/commands/agents.js +223 -35
- package/dist/cli/commands/agents.js.map +1 -1
- package/dist/cli/commands/codex.d.ts +1 -1
- package/dist/cli/commands/codex.d.ts.map +1 -1
- package/dist/cli/commands/codex.js +145 -39
- package/dist/cli/commands/codex.js.map +1 -1
- package/dist/cli/commands/context.d.ts +10 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +176 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/hosted-runner.d.ts +1 -0
- package/dist/cli/commands/hosted-runner.d.ts.map +1 -1
- package/dist/cli/commands/hosted-runner.js +9 -1
- package/dist/cli/commands/hosted-runner.js.map +1 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +6 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/modes.d.ts +8 -0
- package/dist/cli/commands/modes.d.ts.map +1 -0
- package/dist/cli/commands/modes.js +151 -0
- package/dist/cli/commands/modes.js.map +1 -0
- package/dist/cli/commands/operating-plane.d.ts +14 -0
- package/dist/cli/commands/operating-plane.d.ts.map +1 -0
- package/dist/cli/commands/operating-plane.js +160 -0
- package/dist/cli/commands/operating-plane.js.map +1 -0
- package/dist/cli/commands/run.d.ts +87 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +356 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/scenario.d.ts +7 -0
- package/dist/cli/commands/scenario.d.ts.map +1 -0
- package/dist/cli/commands/scenario.js +195 -0
- package/dist/cli/commands/scenario.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +7 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +286 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/headless-protocol.d.ts +55 -1
- package/dist/cli/headless-protocol.d.ts.map +1 -1
- package/dist/cli/headless-protocol.js +446 -7
- package/dist/cli/headless-protocol.js.map +1 -1
- package/dist/cli/headless-runtime-selection.d.ts +38 -0
- package/dist/cli/headless-runtime-selection.d.ts.map +1 -0
- package/dist/cli/headless-runtime-selection.js +48 -0
- package/dist/cli/headless-runtime-selection.js.map +1 -0
- package/dist/cli/headless.d.ts +5 -1
- package/dist/cli/headless.d.ts.map +1 -1
- package/dist/cli/headless.js +11 -1
- package/dist/cli/headless.js.map +1 -1
- package/dist/cli/help.d.ts +3 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +136 -30
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/system-prompt.d.ts +22 -4
- package/dist/cli/system-prompt.d.ts.map +1 -1
- package/dist/cli/system-prompt.js +224 -127
- package/dist/cli/system-prompt.js.map +1 -1
- package/dist/cli-tui/commands/a2a-handlers.d.ts +7 -0
- package/dist/cli-tui/commands/a2a-handlers.d.ts.map +1 -0
- package/dist/cli-tui/commands/a2a-handlers.js +160 -0
- package/dist/cli-tui/commands/a2a-handlers.js.map +1 -0
- package/dist/cli-tui/commands/command-catalog.d.ts.map +1 -1
- package/dist/cli-tui/commands/command-catalog.js +15 -0
- package/dist/cli-tui/commands/command-catalog.js.map +1 -1
- package/dist/cli-tui/commands/command-registry-adapter.js +10 -1
- package/dist/cli-tui/commands/command-registry-adapter.js.map +1 -1
- package/dist/cli-tui/commands/handlers/mode-handler.d.ts.map +1 -1
- package/dist/cli-tui/commands/handlers/mode-handler.js +22 -10
- package/dist/cli-tui/commands/handlers/mode-handler.js.map +1 -1
- package/dist/cli-tui/commands/mcp-handlers.d.ts.map +1 -1
- package/dist/cli-tui/commands/mcp-handlers.js +6 -5
- package/dist/cli-tui/commands/mcp-handlers.js.map +1 -1
- package/dist/cli-tui/commands/types.d.ts +1 -0
- package/dist/cli-tui/commands/types.d.ts.map +1 -1
- package/dist/cli-tui/commands/types.js.map +1 -1
- package/dist/cli-tui/commands/utility-handlers.d.ts +4 -0
- package/dist/cli-tui/commands/utility-handlers.d.ts.map +1 -1
- package/dist/cli-tui/commands/utility-handlers.js +45 -6
- package/dist/cli-tui/commands/utility-handlers.js.map +1 -1
- package/dist/cli-tui/run/run-shell-command.d.ts.map +1 -1
- package/dist/cli-tui/run/run-shell-command.js +14 -5
- package/dist/cli-tui/run/run-shell-command.js.map +1 -1
- package/dist/cli-tui/run/streaming-shell-command.d.ts.map +1 -1
- package/dist/cli-tui/run/streaming-shell-command.js +14 -5
- package/dist/cli-tui/run/streaming-shell-command.js.map +1 -1
- package/dist/cli-tui/selectors/model-selector.d.ts +1 -0
- package/dist/cli-tui/selectors/model-selector.d.ts.map +1 -1
- package/dist/cli-tui/selectors/model-selector.js +6 -2
- package/dist/cli-tui/selectors/model-selector.js.map +1 -1
- package/dist/cli-tui/tui-renderer/command-registry-options.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer/command-registry-options.js +5 -0
- package/dist/cli-tui/tui-renderer/command-registry-options.js.map +1 -1
- package/dist/cli-tui/utils/commands/review-prompt.d.ts +1 -1
- package/dist/cli-tui/utils/commands/review-prompt.d.ts.map +1 -1
- package/dist/cli-tui/utils/commands/review-prompt.js +8 -3
- package/dist/cli-tui/utils/commands/review-prompt.js.map +1 -1
- package/dist/cli-tui/utils/runtime-badges.d.ts +1 -0
- package/dist/cli-tui/utils/runtime-badges.d.ts.map +1 -1
- package/dist/cli-tui/utils/runtime-badges.js +7 -0
- package/dist/cli-tui/utils/runtime-badges.js.map +1 -1
- package/dist/cli-tui/utils/text-formatting.d.ts +1 -0
- package/dist/cli-tui/utils/text-formatting.d.ts.map +1 -1
- package/dist/cli-tui/utils/text-formatting.js +5 -0
- package/dist/cli-tui/utils/text-formatting.js.map +1 -1
- package/dist/cli.js +49209 -26165
- package/dist/cli.js.map +1 -1
- package/dist/codex/app-server-client.d.ts +139 -0
- package/dist/codex/app-server-client.d.ts.map +1 -0
- package/dist/codex/app-server-client.js +352 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/compatibility.d.ts +48 -0
- package/dist/codex/compatibility.d.ts.map +1 -0
- package/dist/codex/compatibility.js +344 -0
- package/dist/codex/compatibility.js.map +1 -0
- package/dist/codex/subagent-dispatch-table.d.ts +66 -0
- package/dist/codex/subagent-dispatch-table.d.ts.map +1 -0
- package/dist/codex/subagent-dispatch-table.js +127 -0
- package/dist/codex/subagent-dispatch-table.js.map +1 -0
- package/dist/codex/subagent-workgraph.d.ts +56 -0
- package/dist/codex/subagent-workgraph.d.ts.map +1 -0
- package/dist/codex/subagent-workgraph.js +89 -0
- package/dist/codex/subagent-workgraph.js.map +1 -0
- package/dist/config/constants.d.ts +3 -1
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +9 -0
- package/dist/config/constants.js.map +1 -1
- package/dist/config/feature-flags.d.ts +10 -1
- package/dist/config/feature-flags.d.ts.map +1 -1
- package/dist/config/feature-flags.js +17 -6
- package/dist/config/feature-flags.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/config/toml-config.d.ts +32 -0
- package/dist/config/toml-config.d.ts.map +1 -1
- package/dist/config/toml-config.js +152 -43
- package/dist/config/toml-config.js.map +1 -1
- package/dist/connectors/service-client.d.ts.map +1 -1
- package/dist/connectors/service-client.js +4 -7
- package/dist/connectors/service-client.js.map +1 -1
- package/dist/context/manifest-types.d.ts +59 -0
- package/dist/context/manifest-types.d.ts.map +1 -0
- package/dist/context/manifest-types.js +2 -0
- package/dist/context/manifest-types.js.map +1 -0
- package/dist/context/manifest.d.ts +16 -0
- package/dist/context/manifest.d.ts.map +1 -0
- package/dist/context/manifest.js +503 -0
- package/dist/context/manifest.js.map +1 -0
- package/dist/db/schema.d.ts +10 -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 +1 -0
- package/dist/evalops/agent-bootstrap.d.ts.map +1 -1
- package/dist/evalops/agent-bootstrap.js +41 -1
- package/dist/evalops/agent-bootstrap.js.map +1 -1
- package/dist/evalops/env-aliases.d.ts +13 -0
- package/dist/evalops/env-aliases.d.ts.map +1 -0
- package/dist/evalops/env-aliases.js +60 -0
- package/dist/evalops/env-aliases.js.map +1 -0
- package/dist/evalops/managed-context.d.ts.map +1 -1
- package/dist/evalops/managed-context.js +28 -62
- package/dist/evalops/managed-context.js.map +1 -1
- package/dist/guardian/config.d.ts.map +1 -1
- package/dist/guardian/config.js +1 -0
- package/dist/guardian/config.js.map +1 -1
- package/dist/guardian/runner.d.ts +2 -0
- package/dist/guardian/runner.d.ts.map +1 -1
- package/dist/guardian/runner.js +105 -2
- package/dist/guardian/runner.js.map +1 -1
- package/dist/guardian/types.d.ts +1 -0
- package/dist/guardian/types.d.ts.map +1 -1
- package/dist/guardian/types.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +267 -55
- package/dist/main.js.map +1 -1
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +89 -7
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/manager.d.ts +5 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +159 -4
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/platform-plugin.d.ts.map +1 -1
- package/dist/mcp/platform-plugin.js +9 -26
- package/dist/mcp/platform-plugin.js.map +1 -1
- package/dist/mcp/schema.d.ts +15 -0
- package/dist/mcp/schema.d.ts.map +1 -1
- package/dist/mcp/schema.js +24 -0
- package/dist/mcp/schema.js.map +1 -1
- package/dist/mcp/tool-bridge.d.ts +39 -10
- package/dist/mcp/tool-bridge.d.ts.map +1 -1
- package/dist/mcp/tool-bridge.js +101 -24
- package/dist/mcp/tool-bridge.js.map +1 -1
- package/dist/mcp/types.d.ts +27 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/mcp/types.js.map +1 -1
- package/dist/mcp/workspace-trust.d.ts +10 -0
- package/dist/mcp/workspace-trust.d.ts.map +1 -0
- package/dist/mcp/workspace-trust.js +295 -0
- package/dist/mcp/workspace-trust.js.map +1 -0
- package/dist/memory/service-client.d.ts +1 -0
- package/dist/memory/service-client.d.ts.map +1 -1
- package/dist/memory/service-client.js +194 -9
- package/dist/memory/service-client.js.map +1 -1
- package/dist/models/builtin.d.ts.map +1 -1
- package/dist/models/builtin.js +66 -25
- package/dist/models/builtin.js.map +1 -1
- package/dist/models/config-loader.d.ts +10 -10
- package/dist/models/config-loader.d.ts.map +1 -1
- package/dist/models/config-loader.js +2 -0
- package/dist/models/config-loader.js.map +1 -1
- package/dist/models/registry.d.ts +1 -0
- package/dist/models/registry.d.ts.map +1 -1
- package/dist/models/registry.js +1 -0
- package/dist/models/registry.js.map +1 -1
- package/dist/oauth/device-identity.d.ts.map +1 -1
- package/dist/oauth/device-identity.js +1 -3
- package/dist/oauth/device-identity.js.map +1 -1
- package/dist/oauth/evalops.d.ts.map +1 -1
- package/dist/oauth/evalops.js +2 -5
- package/dist/oauth/evalops.js.map +1 -1
- package/dist/opentelemetry.d.ts.map +1 -1
- package/dist/opentelemetry.js +12 -12
- package/dist/opentelemetry.js.map +1 -1
- package/dist/package-version.d.ts +2 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +11 -0
- package/dist/package-version.js.map +1 -0
- package/dist/packages/constants.d.ts +3 -0
- package/dist/packages/constants.d.ts.map +1 -0
- package/dist/packages/constants.js +3 -0
- package/dist/packages/constants.js.map +1 -0
- package/dist/packages/inspection.d.ts.map +1 -1
- package/dist/packages/inspection.js +2 -1
- package/dist/packages/inspection.js.map +1 -1
- package/dist/packages/search.d.ts.map +1 -1
- package/dist/packages/search.js +1 -1
- package/dist/packages/search.js.map +1 -1
- package/dist/platform/a2a-capability-market.d.ts +21 -0
- package/dist/platform/a2a-capability-market.d.ts.map +1 -0
- package/dist/platform/a2a-capability-market.js +176 -0
- package/dist/platform/a2a-capability-market.js.map +1 -0
- package/dist/platform/a2a-client.d.ts +217 -0
- package/dist/platform/a2a-client.d.ts.map +1 -0
- package/dist/platform/a2a-client.js +589 -0
- package/dist/platform/a2a-client.js.map +1 -0
- package/dist/platform/a2a-fleet.d.ts +41 -0
- package/dist/platform/a2a-fleet.d.ts.map +1 -0
- package/dist/platform/a2a-fleet.js +109 -0
- package/dist/platform/a2a-fleet.js.map +1 -0
- package/dist/platform/a2a-maestro-peer.d.ts +20 -0
- package/dist/platform/a2a-maestro-peer.d.ts.map +1 -0
- package/dist/platform/a2a-maestro-peer.js +176 -0
- package/dist/platform/a2a-maestro-peer.js.map +1 -0
- package/dist/platform/a2a-peer-pairing.d.ts +107 -0
- package/dist/platform/a2a-peer-pairing.d.ts.map +1 -0
- package/dist/platform/a2a-peer-pairing.js +489 -0
- package/dist/platform/a2a-peer-pairing.js.map +1 -0
- package/dist/platform/a2a-peer-registry.d.ts +68 -0
- package/dist/platform/a2a-peer-registry.d.ts.map +1 -0
- package/dist/platform/a2a-peer-registry.js +320 -0
- package/dist/platform/a2a-peer-registry.js.map +1 -0
- package/dist/platform/a2a-task-ledger.d.ts +86 -0
- package/dist/platform/a2a-task-ledger.d.ts.map +1 -0
- package/dist/platform/a2a-task-ledger.js +546 -0
- package/dist/platform/a2a-task-ledger.js.map +1 -0
- package/dist/platform/a2a-work-graph.d.ts +43 -0
- package/dist/platform/a2a-work-graph.d.ts.map +1 -0
- package/dist/platform/a2a-work-graph.js +267 -0
- package/dist/platform/a2a-work-graph.js.map +1 -0
- package/dist/platform/agent-registry-client.d.ts +327 -0
- package/dist/platform/agent-registry-client.d.ts.map +1 -0
- package/dist/platform/agent-registry-client.js +803 -0
- package/dist/platform/agent-registry-client.js.map +1 -0
- package/dist/platform/agent-runtime-client.d.ts +135 -1
- package/dist/platform/agent-runtime-client.d.ts.map +1 -1
- package/dist/platform/agent-runtime-client.js +467 -10
- package/dist/platform/agent-runtime-client.js.map +1 -1
- package/dist/platform/cerebro-facts-client.d.ts.map +1 -1
- package/dist/platform/cerebro-facts-client.js +4 -7
- package/dist/platform/cerebro-facts-client.js.map +1 -1
- package/dist/platform/client.d.ts +2 -0
- package/dist/platform/client.d.ts.map +1 -1
- package/dist/platform/client.js +7 -14
- package/dist/platform/client.js.map +1 -1
- package/dist/platform/core-services.d.ts +68 -0
- package/dist/platform/core-services.d.ts.map +1 -1
- package/dist/platform/core-services.js +68 -0
- package/dist/platform/core-services.js.map +1 -1
- package/dist/platform/fermata-eval-client.d.ts +195 -0
- package/dist/platform/fermata-eval-client.d.ts.map +1 -0
- package/dist/platform/fermata-eval-client.js +146 -0
- package/dist/platform/fermata-eval-client.js.map +1 -0
- package/dist/platform/fermata-scenario-suite.d.ts +99 -0
- package/dist/platform/fermata-scenario-suite.d.ts.map +1 -0
- package/dist/platform/fermata-scenario-suite.js +459 -0
- package/dist/platform/fermata-scenario-suite.js.map +1 -0
- package/dist/platform/maestro-timeline-client.d.ts.map +1 -1
- package/dist/platform/maestro-timeline-client.js +5 -11
- package/dist/platform/maestro-timeline-client.js.map +1 -1
- package/dist/platform/operating-plane-client.d.ts +156 -0
- package/dist/platform/operating-plane-client.d.ts.map +1 -0
- package/dist/platform/operating-plane-client.js +131 -0
- package/dist/platform/operating-plane-client.js.map +1 -0
- package/dist/platform/operating-plane-summary.d.ts +47 -0
- package/dist/platform/operating-plane-summary.d.ts.map +1 -0
- package/dist/platform/operating-plane-summary.js +209 -0
- package/dist/platform/operating-plane-summary.js.map +1 -0
- package/dist/platform/tool-execution-client.d.ts.map +1 -1
- package/dist/platform/tool-execution-client.js +4 -11
- package/dist/platform/tool-execution-client.js.map +1 -1
- package/dist/prompts/service-client.d.ts.map +1 -1
- package/dist/prompts/service-client.js +3 -5
- package/dist/prompts/service-client.js.map +1 -1
- package/dist/prompts/system-prompt.d.ts +3 -0
- package/dist/prompts/system-prompt.d.ts.map +1 -1
- package/dist/prompts/system-prompt.js +13 -3
- package/dist/prompts/system-prompt.js.map +1 -1
- package/dist/prompts/types.d.ts +2 -0
- package/dist/prompts/types.d.ts.map +1 -1
- package/dist/prompts/types.js.map +1 -1
- package/dist/providers/api-keys.d.ts +1 -1
- package/dist/providers/api-keys.d.ts.map +1 -1
- package/dist/providers/api-keys.js +2 -1
- package/dist/providers/api-keys.js.map +1 -1
- package/dist/providers/auth.d.ts.map +1 -1
- package/dist/providers/auth.js +48 -25
- package/dist/providers/auth.js.map +1 -1
- package/dist/remote-runner/attach-client.d.ts.map +1 -1
- package/dist/remote-runner/attach-client.js +1 -0
- package/dist/remote-runner/attach-client.js.map +1 -1
- package/dist/remote-runner/client.d.ts.map +1 -1
- package/dist/remote-runner/client.js +4 -7
- package/dist/remote-runner/client.js.map +1 -1
- package/dist/rpc/rpc-types.d.ts.map +1 -1
- package/dist/rpc/rpc-types.js +1 -0
- package/dist/rpc/rpc-types.js.map +1 -1
- package/dist/safety/action-firewall.d.ts.map +1 -1
- package/dist/safety/action-firewall.js +69 -6
- package/dist/safety/action-firewall.js.map +1 -1
- package/dist/safety/attack-patterns.d.ts.map +1 -1
- package/dist/safety/attack-patterns.js +31 -14
- package/dist/safety/attack-patterns.js.map +1 -1
- package/dist/safety/bash-parser.d.ts.map +1 -1
- package/dist/safety/bash-parser.js +4 -3
- package/dist/safety/bash-parser.js.map +1 -1
- package/dist/safety/execpolicy.d.ts +15 -3
- package/dist/safety/execpolicy.d.ts.map +1 -1
- package/dist/safety/execpolicy.js +248 -37
- package/dist/safety/execpolicy.js.map +1 -1
- package/dist/safety/governance-service-client.d.ts.map +1 -1
- package/dist/safety/governance-service-client.js +4 -7
- package/dist/safety/governance-service-client.js.map +1 -1
- package/dist/safety/guarded-files.d.ts +34 -0
- package/dist/safety/guarded-files.d.ts.map +1 -0
- package/dist/safety/guarded-files.js +372 -0
- package/dist/safety/guarded-files.js.map +1 -0
- package/dist/safety/loop-detector.d.ts.map +1 -1
- package/dist/safety/loop-detector.js +6 -1
- package/dist/safety/loop-detector.js.map +1 -1
- package/dist/safety/permission-profile.d.ts +47 -0
- package/dist/safety/permission-profile.d.ts.map +1 -0
- package/dist/safety/permission-profile.js +349 -0
- package/dist/safety/permission-profile.js.map +1 -0
- package/dist/safety/safety-middleware.d.ts +5 -1
- package/dist/safety/safety-middleware.d.ts.map +1 -1
- package/dist/safety/safety-middleware.js +3 -2
- package/dist/safety/safety-middleware.js.map +1 -1
- package/dist/safety/suspicious-patterns.d.ts.map +1 -1
- package/dist/safety/suspicious-patterns.js +12 -7
- package/dist/safety/suspicious-patterns.js.map +1 -1
- package/dist/safety/tool-categorization.js +1 -1
- package/dist/safety/tool-categorization.js.map +1 -1
- package/dist/safety/validators/path-policy-validator.d.ts.map +1 -1
- package/dist/safety/validators/path-policy-validator.js +7 -0
- package/dist/safety/validators/path-policy-validator.js.map +1 -1
- package/dist/sandbox/index.d.ts +6 -1
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +30 -4
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/native-sandbox.d.ts +3 -0
- package/dist/sandbox/native-sandbox.d.ts.map +1 -1
- package/dist/sandbox/native-sandbox.js +139 -18
- package/dist/sandbox/native-sandbox.js.map +1 -1
- package/dist/sentry.d.ts +17 -0
- package/dist/sentry.d.ts.map +1 -0
- package/dist/sentry.js +91 -0
- package/dist/sentry.js.map +1 -0
- package/dist/server/agent-runtime-ledger.d.ts +141 -0
- package/dist/server/agent-runtime-ledger.d.ts.map +1 -0
- package/dist/server/agent-runtime-ledger.js +334 -0
- package/dist/server/agent-runtime-ledger.js.map +1 -0
- package/dist/server/agent-trajectory-inspection.d.ts +104 -0
- package/dist/server/agent-trajectory-inspection.d.ts.map +1 -0
- package/dist/server/agent-trajectory-inspection.js +168 -0
- package/dist/server/agent-trajectory-inspection.js.map +1 -0
- package/dist/server/agent-trajectory-replay.d.ts +56 -0
- package/dist/server/agent-trajectory-replay.d.ts.map +1 -0
- package/dist/server/agent-trajectory-replay.js +214 -0
- package/dist/server/agent-trajectory-replay.js.map +1 -0
- package/dist/server/agent-trajectory-scenarios.d.ts +109 -0
- package/dist/server/agent-trajectory-scenarios.d.ts.map +1 -0
- package/dist/server/agent-trajectory-scenarios.js +822 -0
- package/dist/server/agent-trajectory-scenarios.js.map +1 -0
- package/dist/server/agent-trajectory-scorers.d.ts +61 -0
- package/dist/server/agent-trajectory-scorers.d.ts.map +1 -0
- package/dist/server/agent-trajectory-scorers.js +162 -0
- package/dist/server/agent-trajectory-scorers.js.map +1 -0
- package/dist/server/agent-trajectory-validation.d.ts +7 -0
- package/dist/server/agent-trajectory-validation.d.ts.map +1 -0
- package/dist/server/agent-trajectory-validation.js +101 -0
- package/dist/server/agent-trajectory-validation.js.map +1 -0
- package/dist/server/agent-trajectory.d.ts +50 -0
- package/dist/server/agent-trajectory.d.ts.map +1 -0
- package/dist/server/agent-trajectory.js +159 -0
- package/dist/server/agent-trajectory.js.map +1 -0
- package/dist/server/app-context.d.ts +18 -0
- package/dist/server/app-context.d.ts.map +1 -1
- package/dist/server/app-context.js.map +1 -1
- package/dist/server/handlers/headless-sessions.d.ts.map +1 -1
- package/dist/server/handlers/headless-sessions.js +64 -27
- package/dist/server/handlers/headless-sessions.js.map +1 -1
- package/dist/server/handlers/health.d.ts +6 -0
- package/dist/server/handlers/health.d.ts.map +1 -1
- package/dist/server/handlers/health.js +6 -0
- package/dist/server/handlers/health.js.map +1 -1
- package/dist/server/handlers/hosted-runner-drain.d.ts +69 -1
- package/dist/server/handlers/hosted-runner-drain.d.ts.map +1 -1
- package/dist/server/handlers/hosted-runner-drain.js +309 -18
- package/dist/server/handlers/hosted-runner-drain.js.map +1 -1
- package/dist/server/handlers/hosted-runner-identity.d.ts +16 -0
- package/dist/server/handlers/hosted-runner-identity.d.ts.map +1 -1
- package/dist/server/handlers/hosted-runner-identity.js +43 -0
- package/dist/server/handlers/hosted-runner-identity.js.map +1 -1
- package/dist/server/handlers/mode.d.ts.map +1 -1
- package/dist/server/handlers/mode.js +3 -1
- package/dist/server/handlers/mode.js.map +1 -1
- package/dist/server/handlers/pending-requests.d.ts.map +1 -1
- package/dist/server/handlers/pending-requests.js +336 -51
- package/dist/server/handlers/pending-requests.js.map +1 -1
- package/dist/server/handlers/platform-a2a-push.d.ts +6 -0
- package/dist/server/handlers/platform-a2a-push.d.ts.map +1 -0
- package/dist/server/handlers/platform-a2a-push.js +136 -0
- package/dist/server/handlers/platform-a2a-push.js.map +1 -0
- package/dist/server/handlers/sessions.d.ts.map +1 -1
- package/dist/server/handlers/sessions.js +21 -1
- package/dist/server/handlers/sessions.js.map +1 -1
- package/dist/server/headless-runtime-service.d.ts +9 -2
- package/dist/server/headless-runtime-service.d.ts.map +1 -1
- package/dist/server/headless-runtime-service.js +39 -0
- package/dist/server/headless-runtime-service.js.map +1 -1
- package/dist/server/hosted-agent-runtime-progress.d.ts +144 -0
- package/dist/server/hosted-agent-runtime-progress.d.ts.map +1 -0
- package/dist/server/hosted-agent-runtime-progress.js +1650 -0
- package/dist/server/hosted-agent-runtime-progress.js.map +1 -0
- package/dist/server/hosted-runner-lease.d.ts +41 -0
- package/dist/server/hosted-runner-lease.d.ts.map +1 -0
- package/dist/server/hosted-runner-lease.js +140 -0
- package/dist/server/hosted-runner-lease.js.map +1 -0
- package/dist/server/hosted-session-manager.d.ts +16 -8
- package/dist/server/hosted-session-manager.d.ts.map +1 -1
- package/dist/server/hosted-session-manager.js +98 -76
- package/dist/server/hosted-session-manager.js.map +1 -1
- package/dist/server/junit-xml.d.ts +2 -0
- package/dist/server/junit-xml.d.ts.map +1 -0
- package/dist/server/junit-xml.js +9 -0
- package/dist/server/junit-xml.js.map +1 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +6 -0
- package/dist/server/routes.js.map +1 -1
- package/dist/server/scenario-recorder.d.ts +56 -0
- package/dist/server/scenario-recorder.d.ts.map +1 -0
- package/dist/server/scenario-recorder.js +109 -0
- package/dist/server/scenario-recorder.js.map +1 -0
- package/dist/server/scripted-scenario-runner.d.ts +46 -0
- package/dist/server/scripted-scenario-runner.d.ts.map +1 -0
- package/dist/server/scripted-scenario-runner.js +190 -0
- package/dist/server/scripted-scenario-runner.js.map +1 -0
- package/dist/server/server-middlewares.d.ts +6 -2
- package/dist/server/server-middlewares.d.ts.map +1 -1
- package/dist/server/server-middlewares.js +8 -2
- package/dist/server/server-middlewares.js.map +1 -1
- package/dist/server/server-request-manager.d.ts +9 -1
- package/dist/server/server-request-manager.d.ts.map +1 -1
- package/dist/server/server-request-manager.js +49 -4
- package/dist/server/server-request-manager.js.map +1 -1
- package/dist/services/intelligent-router/service.d.ts +2 -0
- package/dist/services/intelligent-router/service.d.ts.map +1 -1
- package/dist/services/intelligent-router/service.js +4 -0
- package/dist/services/intelligent-router/service.js.map +1 -1
- package/dist/services/service-authority.d.ts +25 -0
- package/dist/services/service-authority.d.ts.map +1 -0
- package/dist/services/service-authority.js +143 -0
- package/dist/services/service-authority.js.map +1 -0
- package/dist/services/workspace-config/service.d.ts +2 -0
- package/dist/services/workspace-config/service.d.ts.map +1 -1
- package/dist/services/workspace-config/service.js +4 -0
- package/dist/services/workspace-config/service.js.map +1 -1
- package/dist/session/manager.d.ts +8 -2
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +19 -4
- package/dist/session/manager.js.map +1 -1
- package/dist/session/session-branch.d.ts.map +1 -1
- package/dist/session/session-branch.js +5 -1
- package/dist/session/session-branch.js.map +1 -1
- package/dist/session/session-catalog.d.ts +7 -2
- package/dist/session/session-catalog.d.ts.map +1 -1
- package/dist/session/session-catalog.js +13 -2
- package/dist/session/session-catalog.js.map +1 -1
- package/dist/session/session-context.d.ts +6 -2
- package/dist/session/session-context.d.ts.map +1 -1
- package/dist/session/session-context.js +44 -4
- package/dist/session/session-context.js.map +1 -1
- package/dist/session/session-graph-projection.d.ts +32 -0
- package/dist/session/session-graph-projection.d.ts.map +1 -0
- package/dist/session/session-graph-projection.js +133 -0
- package/dist/session/session-graph-projection.js.map +1 -0
- package/dist/session/types.d.ts +18 -0
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +8 -0
- package/dist/session/types.js.map +1 -1
- package/dist/session/wire-format.generated.d.ts +3 -0
- package/dist/session/wire-format.generated.d.ts.map +1 -1
- package/dist/session/wire-format.generated.js +20 -0
- package/dist/session/wire-format.generated.js.map +1 -1
- package/dist/skills/eval-harness.d.ts +38 -0
- package/dist/skills/eval-harness.d.ts.map +1 -0
- package/dist/skills/eval-harness.js +112 -0
- package/dist/skills/eval-harness.js.map +1 -0
- package/dist/skills/index.d.ts +5 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +5 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/linter.d.ts +36 -0
- package/dist/skills/linter.d.ts.map +1 -0
- package/dist/skills/linter.js +398 -0
- package/dist/skills/linter.js.map +1 -0
- package/dist/skills/loader.d.ts +36 -6
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +169 -86
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/package-contract.d.ts +45 -0
- package/dist/skills/package-contract.d.ts.map +1 -0
- package/dist/skills/package-contract.js +153 -0
- package/dist/skills/package-contract.js.map +1 -0
- package/dist/skills/runtime-activation.d.ts +68 -0
- package/dist/skills/runtime-activation.d.ts.map +1 -0
- package/dist/skills/runtime-activation.js +228 -0
- package/dist/skills/runtime-activation.js.map +1 -0
- package/dist/skills/service-client.d.ts.map +1 -1
- package/dist/skills/service-client.js +3 -4
- package/dist/skills/service-client.js.map +1 -1
- package/dist/skills/tool.d.ts.map +1 -1
- package/dist/skills/tool.js +2 -0
- package/dist/skills/tool.js.map +1 -1
- package/dist/skills/types.d.ts +14 -0
- package/dist/skills/types.d.ts.map +1 -1
- package/dist/skills/types.js.map +1 -1
- package/dist/telemetry/agent-operating-plane-context.d.ts +24 -0
- package/dist/telemetry/agent-operating-plane-context.d.ts.map +1 -0
- package/dist/telemetry/agent-operating-plane-context.js +54 -0
- package/dist/telemetry/agent-operating-plane-context.js.map +1 -0
- package/dist/telemetry/beacon.d.ts +24 -0
- package/dist/telemetry/beacon.d.ts.map +1 -0
- package/dist/telemetry/beacon.js +115 -0
- package/dist/telemetry/beacon.js.map +1 -0
- package/dist/telemetry/cli-command-aggregator.d.ts +36 -0
- package/dist/telemetry/cli-command-aggregator.d.ts.map +1 -0
- package/dist/telemetry/cli-command-aggregator.js +251 -0
- package/dist/telemetry/cli-command-aggregator.js.map +1 -0
- package/dist/telemetry/cli-startup.d.ts +21 -0
- package/dist/telemetry/cli-startup.d.ts.map +1 -0
- package/dist/telemetry/cli-startup.js +83 -0
- package/dist/telemetry/cli-startup.js.map +1 -0
- package/dist/telemetry/disablement.d.ts +13 -0
- package/dist/telemetry/disablement.d.ts.map +1 -0
- package/dist/telemetry/disablement.js +19 -0
- package/dist/telemetry/disablement.js.map +1 -0
- package/dist/telemetry/index.d.ts +6 -2
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +6 -2
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/maestro-event-bus.d.ts +52 -0
- package/dist/telemetry/maestro-event-bus.d.ts.map +1 -1
- package/dist/telemetry/maestro-event-bus.js +179 -3
- package/dist/telemetry/maestro-event-bus.js.map +1 -1
- package/dist/telemetry/maestro-event-catalog.d.ts +3 -1
- package/dist/telemetry/maestro-event-catalog.d.ts.map +1 -1
- package/dist/telemetry/maestro-event-catalog.js +2 -0
- package/dist/telemetry/maestro-event-catalog.js.map +1 -1
- package/dist/telemetry/maestro-platform-replay-fixture.d.ts.map +1 -1
- package/dist/telemetry/maestro-platform-replay-fixture.js +74 -9
- package/dist/telemetry/maestro-platform-replay-fixture.js.map +1 -1
- package/dist/telemetry/maestro-publisher-conformance-fixture.d.ts +1 -1
- package/dist/telemetry/maestro-publisher-conformance-fixture.d.ts.map +1 -1
- package/dist/telemetry/maestro-publisher-conformance-fixture.js +46 -11
- package/dist/telemetry/maestro-publisher-conformance-fixture.js.map +1 -1
- package/dist/telemetry/mcp-beacon.d.ts +20 -0
- package/dist/telemetry/mcp-beacon.d.ts.map +1 -0
- package/dist/telemetry/mcp-beacon.js +54 -0
- package/dist/telemetry/mcp-beacon.js.map +1 -0
- package/dist/telemetry/metadata-normalization.d.ts +7 -0
- package/dist/telemetry/metadata-normalization.d.ts.map +1 -0
- package/dist/telemetry/metadata-normalization.js +189 -0
- package/dist/telemetry/metadata-normalization.js.map +1 -0
- package/dist/telemetry/meter-service-client.d.ts.map +1 -1
- package/dist/telemetry/meter-service-client.js +5 -10
- package/dist/telemetry/meter-service-client.js.map +1 -1
- package/dist/telemetry/metrics.d.ts +123 -0
- package/dist/telemetry/metrics.d.ts.map +1 -0
- package/dist/telemetry/metrics.js +184 -0
- package/dist/telemetry/metrics.js.map +1 -0
- package/dist/telemetry/turn-tracker.d.ts +1 -0
- package/dist/telemetry/turn-tracker.d.ts.map +1 -1
- package/dist/telemetry/turn-tracker.js +22 -1
- package/dist/telemetry/turn-tracker.js.map +1 -1
- package/dist/telemetry/wide-events.d.ts +31 -1
- package/dist/telemetry/wide-events.d.ts.map +1 -1
- package/dist/telemetry/wide-events.js +229 -1
- package/dist/telemetry/wide-events.js.map +1 -1
- package/dist/telemetry.d.ts +39 -3
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +160 -3
- package/dist/telemetry.js.map +1 -1
- package/dist/testing/test-verification-hook.d.ts.map +1 -1
- package/dist/testing/test-verification-hook.js +34 -21
- package/dist/testing/test-verification-hook.js.map +1 -1
- package/dist/tools/apply-patch-parser.d.ts +26 -0
- package/dist/tools/apply-patch-parser.d.ts.map +1 -0
- package/dist/tools/apply-patch-parser.js +146 -0
- package/dist/tools/apply-patch-parser.js.map +1 -0
- package/dist/tools/apply-patch.d.ts +42 -0
- package/dist/tools/apply-patch.d.ts.map +1 -0
- package/dist/tools/apply-patch.js +648 -0
- package/dist/tools/apply-patch.js.map +1 -0
- package/dist/tools/ask-user.d.ts +1 -0
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/background/tool-handler.d.ts +1 -0
- package/dist/tools/background/tool-handler.d.ts.map +1 -1
- package/dist/tools/bash.d.ts +1 -0
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/codesearch.d.ts +1 -0
- package/dist/tools/codesearch.d.ts.map +1 -1
- package/dist/tools/conductor-client.d.ts +1 -0
- package/dist/tools/conductor-client.d.ts.map +1 -1
- package/dist/tools/conductor-client.js +63 -0
- package/dist/tools/conductor-client.js.map +1 -1
- package/dist/tools/diff.d.ts +1 -0
- package/dist/tools/diff.d.ts.map +1 -1
- package/dist/tools/edit.d.ts +1 -0
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/extract-document.d.ts +1 -0
- package/dist/tools/extract-document.d.ts.map +1 -1
- package/dist/tools/find.d.ts +10 -0
- package/dist/tools/find.d.ts.map +1 -1
- package/dist/tools/find.js +236 -27
- package/dist/tools/find.js.map +1 -1
- package/dist/tools/gh.d.ts +3 -0
- package/dist/tools/gh.d.ts.map +1 -1
- package/dist/tools/index.d.ts +50 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list.d.ts +1 -0
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/notebook.d.ts +1 -0
- package/dist/tools/notebook.d.ts.map +1 -1
- package/dist/tools/oracle.d.ts +1 -0
- package/dist/tools/oracle.d.ts.map +1 -1
- package/dist/tools/oracle.js +17 -32
- package/dist/tools/oracle.js.map +1 -1
- package/dist/tools/parallel-execution.d.ts +13 -2
- package/dist/tools/parallel-execution.d.ts.map +1 -1
- package/dist/tools/parallel-execution.js +178 -7
- package/dist/tools/parallel-execution.js.map +1 -1
- package/dist/tools/parallel-ripgrep.d.ts +1 -0
- package/dist/tools/parallel-ripgrep.d.ts.map +1 -1
- package/dist/tools/pipeline.d.ts +4 -0
- package/dist/tools/pipeline.d.ts.map +1 -1
- package/dist/tools/read.d.ts +1 -0
- package/dist/tools/read.d.ts.map +1 -1
- package/dist/tools/search.d.ts +1 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/status.d.ts +1 -0
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/todo.d.ts +1 -0
- package/dist/tools/todo.d.ts.map +1 -1
- package/dist/tools/tool-dsl.d.ts +5 -1
- package/dist/tools/tool-dsl.d.ts.map +1 -1
- package/dist/tools/tool-dsl.js +1 -0
- package/dist/tools/tool-dsl.js.map +1 -1
- package/dist/tools/tool-result-cache.d.ts.map +1 -1
- package/dist/tools/tool-result-cache.js +1 -0
- package/dist/tools/tool-result-cache.js.map +1 -1
- package/dist/tools/typebox-tool.d.ts.map +1 -1
- package/dist/tools/typebox-tool.js +3 -0
- package/dist/tools/typebox-tool.js.map +1 -1
- package/dist/tools/webfetch.d.ts +1 -0
- package/dist/tools/webfetch.d.ts.map +1 -1
- package/dist/tools/websearch.d.ts +1 -0
- package/dist/tools/websearch.d.ts.map +1 -1
- package/dist/tools/write.d.ts +1 -0
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/utils/abort-error.d.ts +2 -0
- package/dist/utils/abort-error.d.ts.map +1 -0
- package/dist/utils/abort-error.js +7 -0
- package/dist/utils/abort-error.js.map +1 -0
- package/dist/utils/downstream.d.ts.map +1 -1
- package/dist/utils/downstream.js +4 -0
- package/dist/utils/downstream.js.map +1 -1
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +14 -3
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/path-containment.d.ts +2 -0
- package/dist/utils/path-containment.d.ts.map +1 -0
- package/dist/utils/path-containment.js +14 -0
- package/dist/utils/path-containment.js.map +1 -0
- package/dist/utils/prompt-safe-text.d.ts +7 -0
- package/dist/utils/prompt-safe-text.d.ts.map +1 -0
- package/dist/utils/prompt-safe-text.js +44 -0
- package/dist/utils/prompt-safe-text.js.map +1 -0
- package/dist/version.json +2 -2
- package/dist/web-server.d.ts.map +1 -1
- package/dist/web-server.js +32 -7
- package/dist/web-server.js.map +1 -1
- package/dist/workspace/root-resolver.d.ts +4 -1
- package/dist/workspace/root-resolver.d.ts.map +1 -1
- package/dist/workspace/root-resolver.js +16 -6
- package/dist/workspace/root-resolver.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/advisor-effort.d.ts +8 -0
- package/node_modules/@evalops/contracts/dist/advisor-effort.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/advisor-effort.js +35 -0
- package/node_modules/@evalops/contracts/dist/advisor-effort.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/delegation-prompt.d.ts +10 -0
- package/node_modules/@evalops/contracts/dist/delegation-prompt.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/delegation-prompt.js +48 -0
- package/node_modules/@evalops/contracts/dist/delegation-prompt.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/guarded-files-settings.d.ts +20 -0
- package/node_modules/@evalops/contracts/dist/guarded-files-settings.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/guarded-files-settings.js +147 -0
- package/node_modules/@evalops/contracts/dist/guarded-files-settings.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/headless-protocol-generated.d.ts +2 -0
- package/node_modules/@evalops/contracts/dist/headless-protocol-generated.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/headless-protocol-generated.js +1 -0
- package/node_modules/@evalops/contracts/dist/headless-protocol-generated.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.d.ts +280 -5
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.js +36 -1
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/index.d.ts +15 -1
- package/node_modules/@evalops/contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/index.js +6 -0
- package/node_modules/@evalops/contracts/dist/index.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts +593 -0
- package/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/maestro-app-server.js +218 -0
- package/node_modules/@evalops/contracts/dist/maestro-app-server.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/proto/maestro/v1/headless_pb.d.ts +91 -0
- package/node_modules/@evalops/contracts/dist/proto/maestro/v1/headless_pb.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/proto/maestro/v1/headless_pb.js +92 -61
- package/node_modules/@evalops/contracts/dist/proto/maestro/v1/headless_pb.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/runtime-app-server.d.ts +3 -0
- package/node_modules/@evalops/contracts/dist/runtime-app-server.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/runtime-constraints.d.ts +28 -0
- package/node_modules/@evalops/contracts/dist/runtime-constraints.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/runtime-constraints.js +71 -0
- package/node_modules/@evalops/contracts/dist/runtime-constraints.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.d.ts +7 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/runtime-server-request.js +2 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/scenario.d.ts +191 -0
- package/node_modules/@evalops/contracts/dist/scenario.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/scenario.js +4 -0
- package/node_modules/@evalops/contracts/dist/scenario.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/schemas.d.ts +17 -3
- package/node_modules/@evalops/contracts/dist/schemas.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/schemas.js +16 -0
- package/node_modules/@evalops/contracts/dist/schemas.js.map +1 -1
- package/node_modules/@evalops/contracts/package.json +1 -1
- package/node_modules/@evalops/tui/package.json +1 -1
- package/package.json +41 -7
- package/skills/incident-triage/SKILL.md +40 -0
- package/skills/incident-triage/mcp.json +14 -0
- package/skills/incident-triage/reference/triage.md +20 -0
- package/skills/incident-triage/toolbox/incident-timeline +22 -0
- package/skills/incident-triage/toolbox/incident-timeline.cmd +16 -0
- package/skills/pr-review/SKILL.md +40 -0
- package/skills/pr-review/mcp.json +14 -0
- package/skills/pr-review/reference/rubric.md +20 -0
- package/skills/pr-review/toolbox/review-summary +20 -0
- package/skills/pr-review/toolbox/review-summary.cmd +14 -0
- package/skills/release-verification/SKILL.md +40 -0
- package/skills/release-verification/mcp.json +15 -0
- package/skills/release-verification/reference/checklist.md +21 -0
- package/skills/release-verification/toolbox/release-readiness +18 -0
- package/skills/release-verification/toolbox/release-readiness.cmd +12 -0
|
@@ -0,0 +1,1714 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { selectA2ACapabilityPeer } from "../../platform/a2a-capability-market.js";
|
|
4
|
+
import { buildA2AUserMessage, discoverA2AAgentCard, getA2ATask, sendA2AMessage, } from "../../platform/a2a-client.js";
|
|
5
|
+
import { inspectA2AFleet } from "../../platform/a2a-fleet.js";
|
|
6
|
+
import { buildMaestroA2APeerProjection, defaultMaestroA2ACapabilities, } from "../../platform/a2a-maestro-peer.js";
|
|
7
|
+
import { createA2APeerPairingPayload, createA2APeerPairingPayloadFromAgentCard, decodeA2APeerPairingCode, encodeA2APeerPairingCode, resolveA2AAgentCardUrl, } from "../../platform/a2a-peer-pairing.js";
|
|
8
|
+
import { listA2APeers, loadA2APeerRegistry, normalizePeerName, resolveA2APeer, saveA2APeerRegistry, upsertA2APeerFromPairingPayload, } from "../../platform/a2a-peer-registry.js";
|
|
9
|
+
import { extractA2ATaskText, getA2ATaskLedgerPath, isActionRequiredA2AState, isFinalA2AState, isTerminalA2AState, listA2ATaskEntries, loadA2ATaskLedger, recordA2ATaskReply, recordA2ATaskStart, updateA2ATaskInLedger, } from "../../platform/a2a-task-ledger.js";
|
|
10
|
+
import { extractA2AWorkGraphMetadata, formatA2AWorkGraphCodexSubagents, formatA2AWorkGraphSummary, } from "../../platform/a2a-work-graph.js";
|
|
11
|
+
import { PlatformA2ADelegationTaskControlModeValue, PlatformAgentStatusValue, controlA2ADelegationTaskWithPlatform, delegateAgentWithPlatform, getA2ADelegationGraphWithPlatform, heartbeatAgentWithPlatform, isAgentAlreadyExistsError, listA2APeerCandidatesWithPlatform, registerAgentWithPlatform, updateAgentWithPlatform, } from "../../platform/agent-registry-client.js";
|
|
12
|
+
import { getEnvValue } from "../../platform/client.js";
|
|
13
|
+
import { isAbortError } from "../../utils/abort-error.js";
|
|
14
|
+
const DEFAULT_WAIT_MS = 300_000;
|
|
15
|
+
const DEFAULT_WAIT_INTERVAL_MS = 5_000;
|
|
16
|
+
const A2A_VALUE_FLAGS_BY_SUBCOMMAND = {
|
|
17
|
+
accept: [
|
|
18
|
+
"--name",
|
|
19
|
+
"--organization-id",
|
|
20
|
+
"--registry",
|
|
21
|
+
"--token-env",
|
|
22
|
+
"--token-file",
|
|
23
|
+
"--workspace-id",
|
|
24
|
+
],
|
|
25
|
+
card: ["--registry", "--timeout-ms"],
|
|
26
|
+
discover: [
|
|
27
|
+
"--capability",
|
|
28
|
+
"--limit",
|
|
29
|
+
"--offset",
|
|
30
|
+
"--registry",
|
|
31
|
+
"--skill",
|
|
32
|
+
"--status",
|
|
33
|
+
"--surface",
|
|
34
|
+
"--workspace-id",
|
|
35
|
+
],
|
|
36
|
+
delegate: [
|
|
37
|
+
"--capability",
|
|
38
|
+
"--cwd",
|
|
39
|
+
"--from-agent-id",
|
|
40
|
+
"--interval-ms",
|
|
41
|
+
"--limit",
|
|
42
|
+
"--max-wait-ms",
|
|
43
|
+
"--objective-id",
|
|
44
|
+
"--offset",
|
|
45
|
+
"--registry",
|
|
46
|
+
"--reason",
|
|
47
|
+
"--role",
|
|
48
|
+
"--skill",
|
|
49
|
+
"--status",
|
|
50
|
+
"--surface",
|
|
51
|
+
"--tasks",
|
|
52
|
+
"--timeout-ms",
|
|
53
|
+
"--to-agent-id",
|
|
54
|
+
"--workspace-id",
|
|
55
|
+
"--workflow-run-id",
|
|
56
|
+
"--workflow-step-id",
|
|
57
|
+
],
|
|
58
|
+
coordinate: [
|
|
59
|
+
"--interval-ms",
|
|
60
|
+
"--max-wait-ms",
|
|
61
|
+
"--registry",
|
|
62
|
+
"--reply",
|
|
63
|
+
"--tasks",
|
|
64
|
+
"--timeout-ms",
|
|
65
|
+
],
|
|
66
|
+
control: [
|
|
67
|
+
"--child-run-id",
|
|
68
|
+
"--delegation-id",
|
|
69
|
+
"--idempotency-key",
|
|
70
|
+
"--message",
|
|
71
|
+
"--mode",
|
|
72
|
+
"--subagent-lane-id",
|
|
73
|
+
"--target-run-id",
|
|
74
|
+
"--work-item-id",
|
|
75
|
+
"--workspace-id",
|
|
76
|
+
],
|
|
77
|
+
fleet: ["--registry", "--tasks", "--timeout-ms"],
|
|
78
|
+
graph: [
|
|
79
|
+
"--delegation-id",
|
|
80
|
+
"--limit",
|
|
81
|
+
"--max-depth",
|
|
82
|
+
"--root",
|
|
83
|
+
"--root-delegation-id",
|
|
84
|
+
"--workspace-id",
|
|
85
|
+
],
|
|
86
|
+
offer: [
|
|
87
|
+
"--agent-card-url",
|
|
88
|
+
"--base-url",
|
|
89
|
+
"--name",
|
|
90
|
+
"--peer-id",
|
|
91
|
+
"--ttl-minutes",
|
|
92
|
+
"--url",
|
|
93
|
+
],
|
|
94
|
+
peers: ["--registry"],
|
|
95
|
+
register: [
|
|
96
|
+
"--agent-card-etag",
|
|
97
|
+
"--agent-card-hash",
|
|
98
|
+
"--agent-card-url",
|
|
99
|
+
"--agent-id",
|
|
100
|
+
"--capabilities",
|
|
101
|
+
"--description",
|
|
102
|
+
"--internal-url",
|
|
103
|
+
"--name",
|
|
104
|
+
"--owner-id",
|
|
105
|
+
"--protocol-version",
|
|
106
|
+
"--public-url",
|
|
107
|
+
"--security-schemes",
|
|
108
|
+
"--status",
|
|
109
|
+
"--surface",
|
|
110
|
+
"--surface-types",
|
|
111
|
+
"--type",
|
|
112
|
+
"--url",
|
|
113
|
+
"--workspace-id",
|
|
114
|
+
],
|
|
115
|
+
reply: [
|
|
116
|
+
"--interval-ms",
|
|
117
|
+
"--max-wait-ms",
|
|
118
|
+
"--registry",
|
|
119
|
+
"--tasks",
|
|
120
|
+
"--timeout-ms",
|
|
121
|
+
],
|
|
122
|
+
send: ["--interval-ms", "--max-wait-ms", "--registry", "--timeout-ms"],
|
|
123
|
+
tasks: ["--registry", "--tasks", "--timeout-ms"],
|
|
124
|
+
wait: [
|
|
125
|
+
"--interval-ms",
|
|
126
|
+
"--max-wait-ms",
|
|
127
|
+
"--registry",
|
|
128
|
+
"--tasks",
|
|
129
|
+
"--timeout-ms",
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
const A2A_BOOLEAN_FLAGS_BY_SUBCOMMAND = {
|
|
133
|
+
accept: ["--default"],
|
|
134
|
+
coordinate: ["--json", "--refresh", "--wait", "--work-graph"],
|
|
135
|
+
delegate: [
|
|
136
|
+
"--discover",
|
|
137
|
+
"--platform",
|
|
138
|
+
"--prefer-internal",
|
|
139
|
+
"--wait",
|
|
140
|
+
"--work-graph",
|
|
141
|
+
],
|
|
142
|
+
discover: ["--default", "--import", "--json", "--prefer-internal"],
|
|
143
|
+
fleet: ["--json"],
|
|
144
|
+
graph: ["--json"],
|
|
145
|
+
register: ["--heartbeat-only", "--json", "--no-heartbeat", "--update-only"],
|
|
146
|
+
reply: ["--wait", "--work-graph"],
|
|
147
|
+
send: ["--wait", "--work-graph"],
|
|
148
|
+
tasks: ["--json", "--refresh", "--work-graph"],
|
|
149
|
+
wait: ["--work-graph"],
|
|
150
|
+
};
|
|
151
|
+
const A2A_COLLECT_VALUE_FLAGS_BY_SUBCOMMAND = {
|
|
152
|
+
coordinate: ["--reply"],
|
|
153
|
+
control: ["--message"],
|
|
154
|
+
};
|
|
155
|
+
const A2A_LEADING_VALUE_FLAGS = new Set(Object.values(A2A_VALUE_FLAGS_BY_SUBCOMMAND).flat());
|
|
156
|
+
const A2A_LEADING_BOOLEAN_FLAGS = new Set(Object.values(A2A_BOOLEAN_FLAGS_BY_SUBCOMMAND).flat());
|
|
157
|
+
export async function handleA2ACommand(args) {
|
|
158
|
+
const parsed = parseA2AArgs(args);
|
|
159
|
+
const subcommand = canonicalA2ASubcommand(parsed.positionals.shift());
|
|
160
|
+
switch (subcommand) {
|
|
161
|
+
case "offer":
|
|
162
|
+
case "pair":
|
|
163
|
+
case "create":
|
|
164
|
+
await handleA2AOffer(parsed);
|
|
165
|
+
return;
|
|
166
|
+
case "accept":
|
|
167
|
+
await handleA2AAccept(parsed);
|
|
168
|
+
return;
|
|
169
|
+
case "peers":
|
|
170
|
+
case "list":
|
|
171
|
+
await handleA2APeers(parsed);
|
|
172
|
+
return;
|
|
173
|
+
case "discover":
|
|
174
|
+
await handleA2ADiscover(parsed);
|
|
175
|
+
return;
|
|
176
|
+
case "register":
|
|
177
|
+
await handleA2ARegister(parsed);
|
|
178
|
+
return;
|
|
179
|
+
case "fleet":
|
|
180
|
+
await handleA2AFleet(parsed);
|
|
181
|
+
return;
|
|
182
|
+
case "card":
|
|
183
|
+
await handleA2ACard(parsed);
|
|
184
|
+
return;
|
|
185
|
+
case "send":
|
|
186
|
+
await handleA2ASend(parsed);
|
|
187
|
+
return;
|
|
188
|
+
case "delegate":
|
|
189
|
+
case "delegation":
|
|
190
|
+
await handleA2ADelegate(parsed);
|
|
191
|
+
return;
|
|
192
|
+
case "control":
|
|
193
|
+
await handleA2AControl(parsed);
|
|
194
|
+
return;
|
|
195
|
+
case "graph":
|
|
196
|
+
await handleA2AGraph(parsed);
|
|
197
|
+
return;
|
|
198
|
+
case "reply":
|
|
199
|
+
case "continue":
|
|
200
|
+
await handleA2AReply(parsed);
|
|
201
|
+
return;
|
|
202
|
+
case "coordinate":
|
|
203
|
+
await handleA2ACoordinate(parsed);
|
|
204
|
+
return;
|
|
205
|
+
case "tasks":
|
|
206
|
+
await handleA2ATasks(parsed);
|
|
207
|
+
return;
|
|
208
|
+
case "wait":
|
|
209
|
+
await handleA2AWait(parsed);
|
|
210
|
+
return;
|
|
211
|
+
default:
|
|
212
|
+
printA2AHelp();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
export function parseA2AArgs(args) {
|
|
216
|
+
const flags = new Map();
|
|
217
|
+
const positionals = [];
|
|
218
|
+
const subcommandIndex = findA2ASubcommandIndex(args);
|
|
219
|
+
const subcommand = subcommandIndex >= 0
|
|
220
|
+
? canonicalA2ASubcommand(args[subcommandIndex])
|
|
221
|
+
: "help";
|
|
222
|
+
const valueFlags = new Set(A2A_VALUE_FLAGS_BY_SUBCOMMAND[subcommand] ?? []);
|
|
223
|
+
const booleanFlags = new Set(A2A_BOOLEAN_FLAGS_BY_SUBCOMMAND[subcommand] ?? []);
|
|
224
|
+
if (subcommand === "delegate" && args.includes("--platform")) {
|
|
225
|
+
booleanFlags.add("--json");
|
|
226
|
+
}
|
|
227
|
+
const collectValueFlags = new Set(A2A_COLLECT_VALUE_FLAGS_BY_SUBCOMMAND[subcommand] ?? []);
|
|
228
|
+
for (let index = 0; index < args.length; index++) {
|
|
229
|
+
const arg = args[index];
|
|
230
|
+
if (!arg)
|
|
231
|
+
continue;
|
|
232
|
+
if (arg === "--") {
|
|
233
|
+
positionals.push(...args.slice(index + 1));
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
if (arg.startsWith("--")) {
|
|
237
|
+
const [flag, inlineValue] = arg.split("=", 2);
|
|
238
|
+
if (!flag) {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (index < subcommandIndex &&
|
|
242
|
+
!valueFlags.has(flag) &&
|
|
243
|
+
!booleanFlags.has(flag) &&
|
|
244
|
+
(A2A_LEADING_VALUE_FLAGS.has(flag) ||
|
|
245
|
+
A2A_LEADING_BOOLEAN_FLAGS.has(flag))) {
|
|
246
|
+
if (A2A_LEADING_VALUE_FLAGS.has(flag) && inlineValue === undefined) {
|
|
247
|
+
index++;
|
|
248
|
+
}
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (!valueFlags.has(flag) && !booleanFlags.has(flag)) {
|
|
252
|
+
positionals.push(arg);
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
if (inlineValue !== undefined) {
|
|
256
|
+
if (collectValueFlags.has(flag) && !inlineValue.trim()) {
|
|
257
|
+
throw new Error(collectValueFlagMissingTextMessage(flag, subcommand));
|
|
258
|
+
}
|
|
259
|
+
flags.set(flag, inlineValue);
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
if (booleanFlags.has(flag)) {
|
|
263
|
+
flags.set(flag, true);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (collectValueFlags.has(flag)) {
|
|
267
|
+
const values = [];
|
|
268
|
+
while (args[index + 1] && args[index + 1] !== "--") {
|
|
269
|
+
const next = args[index + 1];
|
|
270
|
+
const [nextFlag] = next.split("=", 2);
|
|
271
|
+
if (next.startsWith("--") &&
|
|
272
|
+
nextFlag &&
|
|
273
|
+
(valueFlags.has(nextFlag) || booleanFlags.has(nextFlag))) {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
values.push(next);
|
|
277
|
+
index++;
|
|
278
|
+
}
|
|
279
|
+
const value = values.join(" ").trim();
|
|
280
|
+
if (!value) {
|
|
281
|
+
throw new Error(collectValueFlagMissingTextMessage(flag, subcommand));
|
|
282
|
+
}
|
|
283
|
+
flags.set(flag, value);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const next = args[index + 1];
|
|
287
|
+
if (next && next !== "--") {
|
|
288
|
+
flags.set(flag, next);
|
|
289
|
+
index++;
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
flags.set(flag, true);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
positionals.push(arg);
|
|
296
|
+
}
|
|
297
|
+
return { flags, positionals };
|
|
298
|
+
}
|
|
299
|
+
function collectValueFlagMissingTextMessage(flag, subcommand) {
|
|
300
|
+
const usage = subcommand === "coordinate" && flag === "--reply"
|
|
301
|
+
? "\nUsage: maestro a2a coordinate [peer] --reply <text> [--wait]"
|
|
302
|
+
: "";
|
|
303
|
+
return `${flag} requires text${usage}`;
|
|
304
|
+
}
|
|
305
|
+
function findA2ASubcommandIndex(args) {
|
|
306
|
+
for (let index = 0; index < args.length; index++) {
|
|
307
|
+
const arg = args[index];
|
|
308
|
+
if (!arg || arg === "--") {
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
if (!arg.startsWith("--")) {
|
|
312
|
+
return index;
|
|
313
|
+
}
|
|
314
|
+
const [flag = "", inlineValue] = arg.split("=", 2);
|
|
315
|
+
if (A2A_LEADING_VALUE_FLAGS.has(flag) && inlineValue === undefined) {
|
|
316
|
+
index++;
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
if (A2A_LEADING_VALUE_FLAGS.has(flag) ||
|
|
320
|
+
A2A_LEADING_BOOLEAN_FLAGS.has(flag)) {
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
return -1;
|
|
326
|
+
}
|
|
327
|
+
function canonicalA2ASubcommand(input) {
|
|
328
|
+
switch (input?.toLowerCase()) {
|
|
329
|
+
case "pair":
|
|
330
|
+
case "create":
|
|
331
|
+
return "offer";
|
|
332
|
+
case "list":
|
|
333
|
+
return "peers";
|
|
334
|
+
case "delegation":
|
|
335
|
+
return "delegate";
|
|
336
|
+
case "continue":
|
|
337
|
+
return "reply";
|
|
338
|
+
case "publish":
|
|
339
|
+
return "register";
|
|
340
|
+
default:
|
|
341
|
+
return input?.toLowerCase() ?? "help";
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
async function handleA2AOffer(parsed) {
|
|
345
|
+
const baseUrl = stringFlag(parsed, "--url") ?? stringFlag(parsed, "--base-url");
|
|
346
|
+
const agentCardUrl = resolveA2AAgentCardUrl(stringFlag(parsed, "--agent-card-url") ??
|
|
347
|
+
baseUrl ??
|
|
348
|
+
getEnvValue([
|
|
349
|
+
"MAESTRO_A2A_PUBLIC_URL",
|
|
350
|
+
"MAESTRO_CONTROL_PUBLIC_URL",
|
|
351
|
+
"MAESTRO_A2A_URL",
|
|
352
|
+
"MAESTRO_CONTROL_URL",
|
|
353
|
+
]) ??
|
|
354
|
+
fail("Provide --url or set MAESTRO_A2A_PUBLIC_URL."));
|
|
355
|
+
const transportUrl = baseUrlFromAgentCardUrl(agentCardUrl);
|
|
356
|
+
const ttlMs = minutesFlag(parsed, "--ttl-minutes") ?? 30 * 60 * 1000;
|
|
357
|
+
const peerId = stringFlag(parsed, "--peer-id");
|
|
358
|
+
const displayName = stringFlag(parsed, "--name");
|
|
359
|
+
let agentCard = null;
|
|
360
|
+
try {
|
|
361
|
+
agentCard = await discoverA2AAgentCard({
|
|
362
|
+
baseUrl: transportUrl,
|
|
363
|
+
timeoutMs: 2_500,
|
|
364
|
+
maxAttempts: 1,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
if (!displayName) {
|
|
369
|
+
throw new Error(`Could not fetch Agent Card at ${agentCardUrl}: ${errorMessage(error)}. Pass --name to create an offline pairing code.`);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const payload = agentCard
|
|
373
|
+
? createA2APeerPairingPayloadFromAgentCard({
|
|
374
|
+
agentCard,
|
|
375
|
+
agentCardUrl,
|
|
376
|
+
displayName,
|
|
377
|
+
peerId,
|
|
378
|
+
ttlMs,
|
|
379
|
+
})
|
|
380
|
+
: createA2APeerPairingPayload({
|
|
381
|
+
displayName: displayName ?? "Maestro A2A Peer",
|
|
382
|
+
agentCardUrl,
|
|
383
|
+
transportUrl,
|
|
384
|
+
peerId,
|
|
385
|
+
ttlMs,
|
|
386
|
+
});
|
|
387
|
+
const code = encodeA2APeerPairingCode(payload);
|
|
388
|
+
console.log(code);
|
|
389
|
+
console.error(chalk.dim(`Pairing code for ${payload.displayName}; expires ${payload.expiresAt}. No token or bearer secret is embedded.`));
|
|
390
|
+
}
|
|
391
|
+
async function handleA2AAccept(parsed) {
|
|
392
|
+
const code = parsed.positionals.shift() ?? fail("Usage: maestro a2a accept <code>");
|
|
393
|
+
const payload = decodeA2APeerPairingCode(code);
|
|
394
|
+
const result = await upsertA2APeerFromPairingPayload(payload, {
|
|
395
|
+
name: stringFlag(parsed, "--name"),
|
|
396
|
+
makeDefault: booleanFlag(parsed, "--default"),
|
|
397
|
+
tokenEnv: stringFlag(parsed, "--token-env"),
|
|
398
|
+
tokenFile: stringFlag(parsed, "--token-file"),
|
|
399
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
400
|
+
organizationId: stringFlag(parsed, "--organization-id"),
|
|
401
|
+
path: stringFlag(parsed, "--registry"),
|
|
402
|
+
});
|
|
403
|
+
console.log(`Registered A2A peer ${chalk.bold(result.name)} at ${result.entry.url}`);
|
|
404
|
+
console.log(chalk.dim(`Registry: ${result.path}`));
|
|
405
|
+
if (!result.entry.tokenEnv && !result.entry.tokenFile) {
|
|
406
|
+
console.log(chalk.dim("No token source configured; add --token-env or --token-file if the peer requires Authorization."));
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
async function handleA2APeers(parsed) {
|
|
410
|
+
const { path, registry } = await listA2APeers({
|
|
411
|
+
path: stringFlag(parsed, "--registry"),
|
|
412
|
+
});
|
|
413
|
+
console.log(`A2A peers (${path})`);
|
|
414
|
+
const entries = Object.entries(registry.peers).sort(([left], [right]) => left.localeCompare(right));
|
|
415
|
+
if (entries.length === 0) {
|
|
416
|
+
console.log(chalk.dim(" No peers registered. Run maestro a2a accept <code>."));
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
for (const [name, peer] of entries) {
|
|
420
|
+
const marker = registry.defaultPeer === name ? "*" : " ";
|
|
421
|
+
const tokenSource = peer.tokenEnv
|
|
422
|
+
? ` token=env:${peer.tokenEnv}`
|
|
423
|
+
: peer.tokenFile
|
|
424
|
+
? " token=file"
|
|
425
|
+
: "";
|
|
426
|
+
console.log(`${marker} ${name} ${chalk.dim(peer.url)}${tokenSource}${peer.displayName ? chalk.dim(` (${peer.displayName})`) : ""}`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
async function handleA2ADiscover(parsed) {
|
|
430
|
+
const candidates = await listA2APeerCandidatesWithPlatform({
|
|
431
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
432
|
+
capability: stringFlag(parsed, "--capability"),
|
|
433
|
+
surface: stringFlag(parsed, "--surface"),
|
|
434
|
+
status: stringFlag(parsed, "--status"),
|
|
435
|
+
limit: numberFlag(parsed, "--limit"),
|
|
436
|
+
offset: nonNegativeNumberFlag(parsed, "--offset"),
|
|
437
|
+
skillId: stringFlag(parsed, "--skill"),
|
|
438
|
+
preferInternalEndpoint: booleanFlag(parsed, "--prefer-internal"),
|
|
439
|
+
});
|
|
440
|
+
if (!candidates) {
|
|
441
|
+
fail("Agent Registry service is not configured. Set AGENT_REGISTRY_SERVICE_URL, AGENT_REGISTRY_SERVICE_TOKEN, AGENT_REGISTRY_ORGANIZATION_ID, and AGENT_REGISTRY_WORKSPACE_ID.");
|
|
442
|
+
}
|
|
443
|
+
const imported = booleanFlag(parsed, "--import")
|
|
444
|
+
? await importDiscoveredA2APeers(parsed, candidates)
|
|
445
|
+
: [];
|
|
446
|
+
if (booleanFlag(parsed, "--json")) {
|
|
447
|
+
console.log(JSON.stringify({
|
|
448
|
+
peers: candidates.map(discoveredPeerJson),
|
|
449
|
+
imported,
|
|
450
|
+
}, null, 2));
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
console.log("Platform A2A peers");
|
|
454
|
+
if (candidates.length === 0) {
|
|
455
|
+
console.log(chalk.dim(" No Platform agents expose A2A peer endpoints."));
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
for (const candidate of candidates) {
|
|
459
|
+
const label = candidate.agent.name ?? candidate.agent.id ?? candidate.endpointUrl;
|
|
460
|
+
const skillSummary = candidate.skills.map((skill) => skill.id).join(", ");
|
|
461
|
+
console.log(`${chalk.bold(label)} ${chalk.dim(candidate.endpointUrl)}${candidate.agent.status ? chalk.dim(` ${candidate.agent.status}`) : ""}`);
|
|
462
|
+
if (candidate.agent.id || candidate.protocolBinding) {
|
|
463
|
+
console.log(chalk.dim(` ${[
|
|
464
|
+
candidate.agent.id ? `agent=${candidate.agent.id}` : undefined,
|
|
465
|
+
candidate.protocolBinding
|
|
466
|
+
? `binding=${candidate.protocolBinding}`
|
|
467
|
+
: undefined,
|
|
468
|
+
candidate.protocolVersion
|
|
469
|
+
? `version=${candidate.protocolVersion}`
|
|
470
|
+
: undefined,
|
|
471
|
+
]
|
|
472
|
+
.filter(Boolean)
|
|
473
|
+
.join(" ")}`));
|
|
474
|
+
}
|
|
475
|
+
if (skillSummary) {
|
|
476
|
+
console.log(chalk.dim(` skills=${skillSummary}`));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
if (imported.length > 0) {
|
|
480
|
+
console.log(chalk.dim(`Imported ${imported.length} peer(s).`));
|
|
481
|
+
console.log(chalk.dim(`Registry: ${imported[0]?.path}`));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async function handleA2ARegister(parsed) {
|
|
485
|
+
const heartbeatOnly = booleanFlag(parsed, "--heartbeat-only");
|
|
486
|
+
const agentId = stringFlag(parsed, "--agent-id") ??
|
|
487
|
+
getEnvValue([
|
|
488
|
+
"MAESTRO_A2A_AGENT_ID",
|
|
489
|
+
"MAESTRO_AGENT_ID",
|
|
490
|
+
"EVALOPS_AGENT_ID",
|
|
491
|
+
]);
|
|
492
|
+
const name = stringFlag(parsed, "--name") ??
|
|
493
|
+
getEnvValue(["MAESTRO_A2A_AGENT_NAME", "MAESTRO_AGENT_NAME"]) ??
|
|
494
|
+
"Maestro A2A Peer";
|
|
495
|
+
const description = stringFlag(parsed, "--description") ??
|
|
496
|
+
getEnvValue([
|
|
497
|
+
"MAESTRO_A2A_AGENT_DESCRIPTION",
|
|
498
|
+
"MAESTRO_AGENT_DESCRIPTION",
|
|
499
|
+
]) ??
|
|
500
|
+
"Maestro peer exposing governed Codex subagent lanes through A2A.";
|
|
501
|
+
const workspaceId = stringFlag(parsed, "--workspace-id");
|
|
502
|
+
const capabilities = stringListFlag(parsed, "--capabilities", defaultMaestroA2ACapabilities());
|
|
503
|
+
const surfaces = stringListFlag(parsed, "--surface", ["a2a", "maestro"]);
|
|
504
|
+
const surfaceTypes = stringListFlag(parsed, "--surface-types", [
|
|
505
|
+
"SURFACE_MAESTRO",
|
|
506
|
+
]);
|
|
507
|
+
const publicEndpointUrl = heartbeatOnly
|
|
508
|
+
? undefined
|
|
509
|
+
: (stringFlag(parsed, "--public-url") ??
|
|
510
|
+
stringFlag(parsed, "--url") ??
|
|
511
|
+
getEnvValue([
|
|
512
|
+
"MAESTRO_A2A_PUBLIC_URL",
|
|
513
|
+
"MAESTRO_CONTROL_PUBLIC_URL",
|
|
514
|
+
"MAESTRO_A2A_URL",
|
|
515
|
+
"MAESTRO_CONTROL_URL",
|
|
516
|
+
]) ??
|
|
517
|
+
fail("Provide --url or set MAESTRO_A2A_PUBLIC_URL."));
|
|
518
|
+
const a2a = publicEndpointUrl
|
|
519
|
+
? buildMaestroA2APeerProjection({
|
|
520
|
+
publicEndpointUrl,
|
|
521
|
+
internalEndpointUrl: stringFlag(parsed, "--internal-url") ??
|
|
522
|
+
getEnvValue([
|
|
523
|
+
"MAESTRO_A2A_INTERNAL_URL",
|
|
524
|
+
"MAESTRO_CONTROL_INTERNAL_URL",
|
|
525
|
+
]),
|
|
526
|
+
agentCardUrl: stringFlag(parsed, "--agent-card-url"),
|
|
527
|
+
protocolVersion: stringFlag(parsed, "--protocol-version"),
|
|
528
|
+
agentCardETag: stringFlag(parsed, "--agent-card-etag"),
|
|
529
|
+
agentCardHash: stringFlag(parsed, "--agent-card-hash"),
|
|
530
|
+
securitySchemes: stringListFlag(parsed, "--security-schemes", [
|
|
531
|
+
"evalops-agent-token",
|
|
532
|
+
]),
|
|
533
|
+
attributes: {
|
|
534
|
+
publishedBy: "maestro a2a register",
|
|
535
|
+
},
|
|
536
|
+
})
|
|
537
|
+
: undefined;
|
|
538
|
+
const updateOnly = booleanFlag(parsed, "--update-only");
|
|
539
|
+
const shouldHeartbeat = !booleanFlag(parsed, "--no-heartbeat");
|
|
540
|
+
if (heartbeatOnly && !shouldHeartbeat) {
|
|
541
|
+
fail("--heartbeat-only cannot be combined with --no-heartbeat.");
|
|
542
|
+
}
|
|
543
|
+
let operation = "registered";
|
|
544
|
+
let agent;
|
|
545
|
+
if (heartbeatOnly) {
|
|
546
|
+
if (!agentId) {
|
|
547
|
+
fail("Usage: maestro a2a register --heartbeat-only --agent-id <id>");
|
|
548
|
+
}
|
|
549
|
+
operation = "heartbeat";
|
|
550
|
+
}
|
|
551
|
+
else if (updateOnly) {
|
|
552
|
+
if (!agentId) {
|
|
553
|
+
fail("Usage: maestro a2a register --update-only --agent-id <id> --url <base-url>");
|
|
554
|
+
}
|
|
555
|
+
const updated = await updateAgentWithPlatform({
|
|
556
|
+
workspaceId,
|
|
557
|
+
id: agentId,
|
|
558
|
+
name,
|
|
559
|
+
description,
|
|
560
|
+
capabilities,
|
|
561
|
+
surfaces,
|
|
562
|
+
surfaceTypes,
|
|
563
|
+
a2a,
|
|
564
|
+
});
|
|
565
|
+
if (!updated) {
|
|
566
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
567
|
+
}
|
|
568
|
+
operation = "updated";
|
|
569
|
+
agent = updated.agent;
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
try {
|
|
573
|
+
const registered = await registerAgentWithPlatform({
|
|
574
|
+
workspaceId,
|
|
575
|
+
id: agentId,
|
|
576
|
+
name,
|
|
577
|
+
description,
|
|
578
|
+
agentType: stringFlag(parsed, "--type") ?? "maestro",
|
|
579
|
+
capabilities,
|
|
580
|
+
surfaces,
|
|
581
|
+
surfaceTypes,
|
|
582
|
+
ownerId: stringFlag(parsed, "--owner-id"),
|
|
583
|
+
a2a,
|
|
584
|
+
});
|
|
585
|
+
if (!registered) {
|
|
586
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
587
|
+
}
|
|
588
|
+
agent = registered.agent;
|
|
589
|
+
}
|
|
590
|
+
catch (error) {
|
|
591
|
+
if (!agentId || !isAgentAlreadyExistsError(error)) {
|
|
592
|
+
throw error;
|
|
593
|
+
}
|
|
594
|
+
const updated = await updateAgentWithPlatform({
|
|
595
|
+
workspaceId,
|
|
596
|
+
id: agentId,
|
|
597
|
+
name,
|
|
598
|
+
description,
|
|
599
|
+
capabilities,
|
|
600
|
+
surfaces,
|
|
601
|
+
surfaceTypes,
|
|
602
|
+
a2a,
|
|
603
|
+
});
|
|
604
|
+
if (!updated) {
|
|
605
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
606
|
+
}
|
|
607
|
+
operation = "updated";
|
|
608
|
+
agent = updated.agent;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const resolvedAgentId = agent?.id ?? agentId ?? fail("Agent Registry did not return an agent id.");
|
|
612
|
+
const heartbeat = shouldHeartbeat
|
|
613
|
+
? await heartbeatAgentWithPlatform({
|
|
614
|
+
workspaceId,
|
|
615
|
+
agentId: resolvedAgentId,
|
|
616
|
+
status: stringFlag(parsed, "--status") ?? PlatformAgentStatusValue.Idle,
|
|
617
|
+
surface: surfaces[0],
|
|
618
|
+
surfaceType: surfaceTypes[0],
|
|
619
|
+
a2a,
|
|
620
|
+
})
|
|
621
|
+
: null;
|
|
622
|
+
if (shouldHeartbeat && !heartbeat) {
|
|
623
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
624
|
+
}
|
|
625
|
+
if (booleanFlag(parsed, "--json")) {
|
|
626
|
+
console.log(JSON.stringify({
|
|
627
|
+
operation,
|
|
628
|
+
agentId: resolvedAgentId,
|
|
629
|
+
agent,
|
|
630
|
+
heartbeat,
|
|
631
|
+
a2a,
|
|
632
|
+
}, null, 2));
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
const verb = operation === "registered" ? "Registered" : "Updated";
|
|
636
|
+
console.log(operation === "heartbeat"
|
|
637
|
+
? `Sent Platform A2A heartbeat for ${chalk.bold(resolvedAgentId)}${a2a ? ` at ${a2a.publicEndpointUrl}` : ""}`
|
|
638
|
+
: `${verb} Platform A2A peer ${chalk.bold(resolvedAgentId)} at ${a2a?.publicEndpointUrl ?? publicEndpointUrl}`);
|
|
639
|
+
console.log(chalk.dim(`Skills: ${a2a?.skills?.map((skill) => skill.id).join(", ") ?? "none"}`));
|
|
640
|
+
if (heartbeat?.nextHeartbeatBy) {
|
|
641
|
+
console.log(chalk.dim(`Next heartbeat by: ${heartbeat.nextHeartbeatBy}`));
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
async function importDiscoveredA2APeers(parsed, candidates) {
|
|
645
|
+
const registryPath = stringFlag(parsed, "--registry");
|
|
646
|
+
const registry = await loadA2APeerRegistry({ path: registryPath });
|
|
647
|
+
const now = new Date().toISOString();
|
|
648
|
+
const makeDefault = booleanFlag(parsed, "--default");
|
|
649
|
+
let defaultAssigned = false;
|
|
650
|
+
const importedNames = new Set();
|
|
651
|
+
const imported = [];
|
|
652
|
+
candidates.forEach((candidate, index) => {
|
|
653
|
+
const name = uniqueDiscoveredPeerName({
|
|
654
|
+
baseName: discoveredPeerName(candidate, index),
|
|
655
|
+
candidate,
|
|
656
|
+
importedNames,
|
|
657
|
+
peers: registry.peers,
|
|
658
|
+
});
|
|
659
|
+
const previous = registry.peers[name];
|
|
660
|
+
const entry = {
|
|
661
|
+
...previous,
|
|
662
|
+
url: candidate.endpointUrl,
|
|
663
|
+
displayName: candidate.agent.name ?? previous?.displayName,
|
|
664
|
+
agentCardUrl: candidate.agentCardUrl ?? previous?.agentCardUrl,
|
|
665
|
+
protocolBinding: candidate.protocolBinding ?? previous?.protocolBinding,
|
|
666
|
+
protocolVersion: candidate.protocolVersion ?? previous?.protocolVersion,
|
|
667
|
+
workspaceId: candidate.agent.workspaceId ?? previous?.workspaceId,
|
|
668
|
+
agentId: candidate.agent.id ?? previous?.agentId,
|
|
669
|
+
capabilities: {
|
|
670
|
+
...previous?.capabilities,
|
|
671
|
+
...(candidate.pushNotifications === undefined
|
|
672
|
+
? {}
|
|
673
|
+
: { pushNotifications: candidate.pushNotifications }),
|
|
674
|
+
},
|
|
675
|
+
skills: candidate.skills.length > 0
|
|
676
|
+
? candidate.skills.map((skill) => ({
|
|
677
|
+
id: skill.id,
|
|
678
|
+
name: skill.name ?? skill.id,
|
|
679
|
+
...(skill.description ? { description: skill.description } : {}),
|
|
680
|
+
...(skill.tags ? { tags: skill.tags } : {}),
|
|
681
|
+
...(skill.inputModes ? { inputModes: skill.inputModes } : {}),
|
|
682
|
+
...(skill.outputModes ? { outputModes: skill.outputModes } : {}),
|
|
683
|
+
...(skill.requiredContextGrants
|
|
684
|
+
? { requiredContextGrants: skill.requiredContextGrants }
|
|
685
|
+
: {}),
|
|
686
|
+
...(skill.approvalPolicyRef
|
|
687
|
+
? { approvalPolicyRef: skill.approvalPolicyRef }
|
|
688
|
+
: {}),
|
|
689
|
+
...(skill.maxAutonomy ? { maxAutonomy: skill.maxAutonomy } : {}),
|
|
690
|
+
...(skill.requiredArtifactKinds
|
|
691
|
+
? { requiredArtifactKinds: skill.requiredArtifactKinds }
|
|
692
|
+
: {}),
|
|
693
|
+
...(skill.optionalArtifactKinds
|
|
694
|
+
? { optionalArtifactKinds: skill.optionalArtifactKinds }
|
|
695
|
+
: {}),
|
|
696
|
+
...(skill.allowedTaskClasses
|
|
697
|
+
? { allowedTaskClasses: skill.allowedTaskClasses }
|
|
698
|
+
: {}),
|
|
699
|
+
...(skill.deniedTaskClasses
|
|
700
|
+
? { deniedTaskClasses: skill.deniedTaskClasses }
|
|
701
|
+
: {}),
|
|
702
|
+
...(skill.attributes ? { attributes: skill.attributes } : {}),
|
|
703
|
+
...(skill.metadata ? { metadata: skill.metadata } : {}),
|
|
704
|
+
}))
|
|
705
|
+
: previous?.skills,
|
|
706
|
+
metadata: compactA2APeerMetadata({
|
|
707
|
+
...previous?.metadata,
|
|
708
|
+
source: "platform-agent-registry",
|
|
709
|
+
platformAgentId: candidate.agent.id,
|
|
710
|
+
platformAgentType: candidate.agent.agentType,
|
|
711
|
+
platformAgentStatus: candidate.agent.status,
|
|
712
|
+
selectedEndpoint: candidate.endpointKind,
|
|
713
|
+
a2aPushNotifications: candidate.pushNotifications,
|
|
714
|
+
}),
|
|
715
|
+
createdAt: previous?.createdAt ?? now,
|
|
716
|
+
updatedAt: now,
|
|
717
|
+
};
|
|
718
|
+
registry.peers[name] = entry;
|
|
719
|
+
if ((makeDefault || !registry.defaultPeer) && !defaultAssigned) {
|
|
720
|
+
registry.defaultPeer = name;
|
|
721
|
+
defaultAssigned = true;
|
|
722
|
+
}
|
|
723
|
+
imported.push({
|
|
724
|
+
name,
|
|
725
|
+
path: "",
|
|
726
|
+
url: entry.url,
|
|
727
|
+
...(entry.agentId ? { agentId: entry.agentId } : {}),
|
|
728
|
+
});
|
|
729
|
+
});
|
|
730
|
+
return saveA2APeerRegistry(registry, { path: registryPath }).then((path) => imported.map((entry) => ({ ...entry, path })));
|
|
731
|
+
}
|
|
732
|
+
async function handleA2ACard(parsed) {
|
|
733
|
+
const peerName = parsed.positionals.shift();
|
|
734
|
+
const peer = await resolveA2APeer(peerName, {
|
|
735
|
+
path: stringFlag(parsed, "--registry"),
|
|
736
|
+
});
|
|
737
|
+
const card = await discoverA2AAgentCard(peer.config);
|
|
738
|
+
console.log(JSON.stringify(card, null, 2));
|
|
739
|
+
}
|
|
740
|
+
async function handleA2AFleet(parsed) {
|
|
741
|
+
const fleet = await inspectA2AFleet({
|
|
742
|
+
registryPath: stringFlag(parsed, "--registry"),
|
|
743
|
+
tasksPath: stringFlag(parsed, "--tasks"),
|
|
744
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
745
|
+
});
|
|
746
|
+
if (booleanFlag(parsed, "--json")) {
|
|
747
|
+
console.log(JSON.stringify(fleet, null, 2));
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
console.log(`A2A fleet (${fleet.registryPath})`);
|
|
751
|
+
if (fleet.peers.length === 0) {
|
|
752
|
+
console.log(chalk.dim(" No peers registered. Run maestro a2a accept <code>."));
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
for (const peer of fleet.peers) {
|
|
756
|
+
const status = peer.status === "online" ? chalk.green("online") : chalk.yellow("down");
|
|
757
|
+
const label = peer.displayName
|
|
758
|
+
? `${peer.name} (${peer.displayName})`
|
|
759
|
+
: peer.name;
|
|
760
|
+
console.log(`${status} ${chalk.bold(label)} ${chalk.dim(peer.url)}`);
|
|
761
|
+
if (peer.model || peer.cwd || peer.auth) {
|
|
762
|
+
console.log(chalk.dim(` ${[
|
|
763
|
+
peer.model ? `model=${peer.model}` : undefined,
|
|
764
|
+
peer.cwd ? `cwd=${peer.cwd}` : undefined,
|
|
765
|
+
peer.auth ? `auth=${peer.auth}` : undefined,
|
|
766
|
+
]
|
|
767
|
+
.filter(Boolean)
|
|
768
|
+
.join(" ")}`));
|
|
769
|
+
}
|
|
770
|
+
if (peer.lastTask) {
|
|
771
|
+
console.log(chalk.dim(` last=${peer.lastTask.id} ${peer.lastTask.state} ${peer.lastTask.text}`));
|
|
772
|
+
}
|
|
773
|
+
if (peer.error) {
|
|
774
|
+
console.log(chalk.dim(` error=${peer.error}`));
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
async function handleA2ASend(parsed) {
|
|
779
|
+
const peerName = parsed.positionals.shift() ?? fail("Usage: maestro a2a send <peer> <text>");
|
|
780
|
+
const text = parsed.positionals.join(" ").trim();
|
|
781
|
+
if (!text) {
|
|
782
|
+
fail("Usage: maestro a2a send <peer> <text>");
|
|
783
|
+
}
|
|
784
|
+
const peer = await resolveA2APeer(peerName, {
|
|
785
|
+
path: stringFlag(parsed, "--registry"),
|
|
786
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
787
|
+
});
|
|
788
|
+
const wait = booleanFlag(parsed, "--wait");
|
|
789
|
+
const sent = await sendA2AMessage(peer.config, {
|
|
790
|
+
message: buildA2AUserMessage({
|
|
791
|
+
messageId: `maestro-a2a-message-${randomUUID()}`,
|
|
792
|
+
contextId: `maestro-a2a-context-${randomUUID()}`,
|
|
793
|
+
text,
|
|
794
|
+
metadata: {
|
|
795
|
+
requestKind: "maestro-peer-message",
|
|
796
|
+
relayPeer: peer.name,
|
|
797
|
+
},
|
|
798
|
+
}),
|
|
799
|
+
...(wait ? { configuration: { returnImmediately: true } } : {}),
|
|
800
|
+
});
|
|
801
|
+
const task = wait
|
|
802
|
+
? await waitForA2ATask(peer.config, sent.task.id, parsed)
|
|
803
|
+
: sent.task;
|
|
804
|
+
printTask(task, {
|
|
805
|
+
includeWorkGraphDetails: booleanFlag(parsed, "--work-graph"),
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
async function handleA2ADelegate(parsed) {
|
|
809
|
+
if (booleanFlag(parsed, "--platform")) {
|
|
810
|
+
await handleA2APlatformDelegate(parsed);
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
const discover = booleanFlag(parsed, "--discover");
|
|
814
|
+
const peerName = discover
|
|
815
|
+
? undefined
|
|
816
|
+
: (parsed.positionals.shift() ??
|
|
817
|
+
fail("Usage: maestro a2a delegate <peer> <text>"));
|
|
818
|
+
const text = parsed.positionals.join(" ").trim();
|
|
819
|
+
if (!text) {
|
|
820
|
+
fail(discover
|
|
821
|
+
? "Usage: maestro a2a delegate --discover --skill <skill-id> <text>"
|
|
822
|
+
: "Usage: maestro a2a delegate <peer> <text>");
|
|
823
|
+
}
|
|
824
|
+
const peer = discover
|
|
825
|
+
? await resolveDiscoveredA2ADelegatePeer(parsed)
|
|
826
|
+
: await resolveA2APeer(peerName, {
|
|
827
|
+
path: stringFlag(parsed, "--registry"),
|
|
828
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
829
|
+
});
|
|
830
|
+
const wait = booleanFlag(parsed, "--wait");
|
|
831
|
+
const role = stringFlag(parsed, "--role");
|
|
832
|
+
const cwd = stringFlag(parsed, "--cwd") ?? process.cwd();
|
|
833
|
+
const messageId = `maestro-a2a-message-${randomUUID()}`;
|
|
834
|
+
const contextId = `maestro-a2a-context-${randomUUID()}`;
|
|
835
|
+
const skillId = stringFlag(parsed, "--skill");
|
|
836
|
+
const skill = selectA2APeerSkill(peer.entry.skills, skillId);
|
|
837
|
+
const delegationMetadata = buildA2ADelegationMetadata({
|
|
838
|
+
peerName: peer.name,
|
|
839
|
+
role,
|
|
840
|
+
cwd,
|
|
841
|
+
skillId,
|
|
842
|
+
skill,
|
|
843
|
+
discoverySource: discover ? "platform-agent-registry" : undefined,
|
|
844
|
+
});
|
|
845
|
+
const ledgerMetadata = buildA2ADelegationLedgerMetadata({
|
|
846
|
+
peerName: peer.name,
|
|
847
|
+
role,
|
|
848
|
+
cwd,
|
|
849
|
+
skillId,
|
|
850
|
+
discoverySource: discover ? "platform-agent-registry" : undefined,
|
|
851
|
+
});
|
|
852
|
+
const sent = await sendA2AMessage(peer.config, {
|
|
853
|
+
message: buildA2AUserMessage({
|
|
854
|
+
messageId,
|
|
855
|
+
contextId,
|
|
856
|
+
text,
|
|
857
|
+
metadata: delegationMetadata,
|
|
858
|
+
}),
|
|
859
|
+
configuration: { returnImmediately: true },
|
|
860
|
+
});
|
|
861
|
+
console.log(`Delegated to ${chalk.bold(peer.name)} as task ${sent.task.id}`);
|
|
862
|
+
await persistA2ALedgerBestEffort("record delegated task locally", () => recordA2ATaskStart({
|
|
863
|
+
path: stringFlag(parsed, "--tasks"),
|
|
864
|
+
peer: peer.name,
|
|
865
|
+
peerDisplayName: peer.entry.displayName,
|
|
866
|
+
task: sent.task,
|
|
867
|
+
text,
|
|
868
|
+
messageId,
|
|
869
|
+
contextId,
|
|
870
|
+
kind: "delegation",
|
|
871
|
+
role,
|
|
872
|
+
cwd,
|
|
873
|
+
metadata: ledgerMetadata,
|
|
874
|
+
}));
|
|
875
|
+
const task = wait
|
|
876
|
+
? await waitForA2ATask(peer.config, sent.task.id, parsed)
|
|
877
|
+
: sent.task;
|
|
878
|
+
if (wait) {
|
|
879
|
+
await persistA2ALedgerBestEffort("sync delegated task result locally", () => updateA2ATaskInLedger({
|
|
880
|
+
path: stringFlag(parsed, "--tasks"),
|
|
881
|
+
peer: peer.name,
|
|
882
|
+
task,
|
|
883
|
+
}));
|
|
884
|
+
}
|
|
885
|
+
printTask(task, {
|
|
886
|
+
includeWorkGraphDetails: booleanFlag(parsed, "--work-graph"),
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
async function handleA2APlatformDelegate(parsed) {
|
|
890
|
+
const text = parsed.positionals.join(" ").trim();
|
|
891
|
+
if (!text) {
|
|
892
|
+
fail("Usage: maestro a2a delegate --platform --from-agent-id <agent-id> [--to-agent-id <agent-id>|--capability <capability>] --skill <skill-id> <text>");
|
|
893
|
+
}
|
|
894
|
+
const fromAgentId = stringFlag(parsed, "--from-agent-id") ??
|
|
895
|
+
getEnvValue([
|
|
896
|
+
"MAESTRO_A2A_AGENT_ID",
|
|
897
|
+
"MAESTRO_AGENT_ID",
|
|
898
|
+
"MAESTRO_EVALOPS_AGENT_ID",
|
|
899
|
+
"EVALOPS_AGENT_ID",
|
|
900
|
+
]) ??
|
|
901
|
+
fail("Provide --from-agent-id or set MAESTRO_A2A_AGENT_ID/MAESTRO_AGENT_ID.");
|
|
902
|
+
const toAgentId = stringFlag(parsed, "--to-agent-id");
|
|
903
|
+
const requiredCapability = stringFlag(parsed, "--capability");
|
|
904
|
+
const skillId = stringFlag(parsed, "--skill");
|
|
905
|
+
if (!toAgentId && !requiredCapability && !skillId) {
|
|
906
|
+
fail("Provide --to-agent-id, --capability, or --skill for Platform routing.");
|
|
907
|
+
}
|
|
908
|
+
const role = stringFlag(parsed, "--role");
|
|
909
|
+
const cwd = stringFlag(parsed, "--cwd") ?? process.cwd();
|
|
910
|
+
const requestedAt = new Date().toISOString();
|
|
911
|
+
const result = await delegateAgentWithPlatform({
|
|
912
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
913
|
+
fromAgentId,
|
|
914
|
+
toAgentId,
|
|
915
|
+
requiredCapability,
|
|
916
|
+
a2aSkillId: skillId,
|
|
917
|
+
objectiveId: stringFlag(parsed, "--objective-id"),
|
|
918
|
+
workflowRunId: stringFlag(parsed, "--workflow-run-id"),
|
|
919
|
+
workflowStepId: stringFlag(parsed, "--workflow-step-id"),
|
|
920
|
+
contextPayload: {
|
|
921
|
+
requestKind: "maestro-peer-delegation",
|
|
922
|
+
transport: "platform-a2a",
|
|
923
|
+
prompt: text,
|
|
924
|
+
source: "maestro-cli",
|
|
925
|
+
requestedAt,
|
|
926
|
+
...(role ? { role } : {}),
|
|
927
|
+
...(cwd ? { cwd } : {}),
|
|
928
|
+
...(skillId ? { a2aSkillId: skillId } : {}),
|
|
929
|
+
...(requiredCapability ? { requiredCapability } : {}),
|
|
930
|
+
},
|
|
931
|
+
reason: stringFlag(parsed, "--reason") ??
|
|
932
|
+
platformDelegationReason(text, skillId, requiredCapability),
|
|
933
|
+
});
|
|
934
|
+
if (!result) {
|
|
935
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
936
|
+
}
|
|
937
|
+
if (booleanFlag(parsed, "--json")) {
|
|
938
|
+
console.log(JSON.stringify(result, null, 2));
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
const delegation = result.delegation;
|
|
942
|
+
console.log(`Platform A2A delegation ${chalk.bold(delegation?.id ?? "(submitted)")}: ${delegation?.status ?? "submitted"}`);
|
|
943
|
+
console.log(chalk.dim(`From: ${fromAgentId}`));
|
|
944
|
+
if (delegation?.toAgentId ?? toAgentId) {
|
|
945
|
+
console.log(chalk.dim(`To: ${delegation?.toAgentId ?? toAgentId}`));
|
|
946
|
+
}
|
|
947
|
+
if (delegation?.a2aTaskId) {
|
|
948
|
+
console.log(chalk.dim(`Remote task: ${delegation.a2aTaskId}`));
|
|
949
|
+
}
|
|
950
|
+
if (delegation?.a2aEndpointUrl) {
|
|
951
|
+
console.log(chalk.dim(`Endpoint: ${delegation.a2aEndpointUrl}`));
|
|
952
|
+
}
|
|
953
|
+
if (delegation?.a2aDispatchStatus) {
|
|
954
|
+
console.log(chalk.dim(`Dispatch: ${delegation.a2aDispatchStatus}`));
|
|
955
|
+
}
|
|
956
|
+
if (delegation?.a2aResumeWaitContracts?.length) {
|
|
957
|
+
console.log(chalk.dim(`Resume waits: ${delegation.a2aResumeWaitContracts.length}`));
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
function platformDelegationReason(text, skillId, requiredCapability) {
|
|
961
|
+
const target = skillId ?? requiredCapability ?? "a2a peer";
|
|
962
|
+
const compact = text.replace(/\s+/g, " ").trim();
|
|
963
|
+
return `maestro a2a delegate ${target}: ${compact.slice(0, 120)}`;
|
|
964
|
+
}
|
|
965
|
+
async function handleA2AControl(parsed) {
|
|
966
|
+
const delegationId = stringFlag(parsed, "--delegation-id") ??
|
|
967
|
+
parsed.positionals.shift() ??
|
|
968
|
+
fail("Usage: maestro a2a control <delegation-id> --mode <mode> [message]");
|
|
969
|
+
const mode = normalizeA2AControlMode(stringFlag(parsed, "--mode") ??
|
|
970
|
+
parsed.positionals.shift() ??
|
|
971
|
+
fail("Provide --mode steer|followup|collect|interrupt|cancel"));
|
|
972
|
+
const message = stringFlag(parsed, "--message") ?? parsed.positionals.join(" ").trim();
|
|
973
|
+
const result = await controlA2ADelegationTaskWithPlatform({
|
|
974
|
+
delegationId,
|
|
975
|
+
mode,
|
|
976
|
+
message: message || undefined,
|
|
977
|
+
idempotencyKey: stringFlag(parsed, "--idempotency-key"),
|
|
978
|
+
targetRunId: stringFlag(parsed, "--target-run-id"),
|
|
979
|
+
childRunId: stringFlag(parsed, "--child-run-id"),
|
|
980
|
+
subagentLaneId: stringFlag(parsed, "--subagent-lane-id"),
|
|
981
|
+
workItemId: stringFlag(parsed, "--work-item-id"),
|
|
982
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
983
|
+
metadata: {
|
|
984
|
+
source: "maestro-cli",
|
|
985
|
+
requestedAt: new Date().toISOString(),
|
|
986
|
+
},
|
|
987
|
+
});
|
|
988
|
+
if (!result) {
|
|
989
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
990
|
+
}
|
|
991
|
+
console.log(`Control ${chalk.bold(result.remoteTask?.controlId ?? "(queued)")}: ${result.remoteTask?.state ?? "submitted"}`);
|
|
992
|
+
if (result.remoteTask?.taskId) {
|
|
993
|
+
console.log(chalk.dim(`Task: ${result.remoteTask.taskId}`));
|
|
994
|
+
}
|
|
995
|
+
if (result.delegation?.id) {
|
|
996
|
+
console.log(chalk.dim(`Delegation: ${result.delegation.id}`));
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
async function handleA2AGraph(parsed) {
|
|
1000
|
+
const delegationId = stringFlag(parsed, "--delegation-id") ?? parsed.positionals.shift();
|
|
1001
|
+
const rootDelegationId = stringFlag(parsed, "--root-delegation-id") ?? stringFlag(parsed, "--root");
|
|
1002
|
+
if (!delegationId && !rootDelegationId) {
|
|
1003
|
+
fail("Usage: maestro a2a graph <delegation-id> [--root <root-delegation-id>] [--json]");
|
|
1004
|
+
}
|
|
1005
|
+
const result = await getA2ADelegationGraphWithPlatform({
|
|
1006
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
1007
|
+
delegationId,
|
|
1008
|
+
rootDelegationId,
|
|
1009
|
+
maxDepth: nonNegativeNumberFlag(parsed, "--max-depth"),
|
|
1010
|
+
limit: nonNegativeNumberFlag(parsed, "--limit"),
|
|
1011
|
+
});
|
|
1012
|
+
if (!result) {
|
|
1013
|
+
fail(agentRegistryNotConfiguredMessage());
|
|
1014
|
+
}
|
|
1015
|
+
if (booleanFlag(parsed, "--json")) {
|
|
1016
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1017
|
+
return;
|
|
1018
|
+
}
|
|
1019
|
+
console.log(`Platform A2A delegation graph ${result.rootDelegationId ? chalk.dim(result.rootDelegationId) : ""}`.trim());
|
|
1020
|
+
const summary = [
|
|
1021
|
+
result.total !== undefined ? `total=${result.total}` : undefined,
|
|
1022
|
+
result.truncated !== undefined
|
|
1023
|
+
? `truncated=${result.truncated}`
|
|
1024
|
+
: undefined,
|
|
1025
|
+
result.missingParentDelegationIds?.length
|
|
1026
|
+
? `missing_parents=${result.missingParentDelegationIds.length}`
|
|
1027
|
+
: undefined,
|
|
1028
|
+
]
|
|
1029
|
+
.filter(Boolean)
|
|
1030
|
+
.join(" ");
|
|
1031
|
+
if (summary) {
|
|
1032
|
+
console.log(chalk.dim(` ${summary}`));
|
|
1033
|
+
}
|
|
1034
|
+
if (result.nodes.length === 0) {
|
|
1035
|
+
console.log(chalk.dim(" No delegation graph nodes returned."));
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
for (const node of result.nodes) {
|
|
1039
|
+
const delegation = node.delegation;
|
|
1040
|
+
const label = delegation?.id ??
|
|
1041
|
+
(node.depth !== undefined ? `depth-${node.depth}` : "delegation");
|
|
1042
|
+
console.log(`${chalk.bold(label)} ${chalk.dim([
|
|
1043
|
+
node.depth !== undefined ? `depth=${node.depth}` : undefined,
|
|
1044
|
+
delegation?.status,
|
|
1045
|
+
node.terminal ? "terminal" : undefined,
|
|
1046
|
+
node.childCount !== undefined
|
|
1047
|
+
? `children=${node.childCount}`
|
|
1048
|
+
: undefined,
|
|
1049
|
+
]
|
|
1050
|
+
.filter(Boolean)
|
|
1051
|
+
.join(" "))}`);
|
|
1052
|
+
const lineage = delegation?.a2aDelegationChain?.join(" -> ");
|
|
1053
|
+
const taskId = delegation?.a2aTaskId;
|
|
1054
|
+
if (taskId || lineage) {
|
|
1055
|
+
console.log(chalk.dim(` ${[
|
|
1056
|
+
taskId ? `task=${taskId}` : undefined,
|
|
1057
|
+
lineage ? `lineage=${lineage}` : undefined,
|
|
1058
|
+
]
|
|
1059
|
+
.filter(Boolean)
|
|
1060
|
+
.join(" ")}`));
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
if (result.edges.length > 0) {
|
|
1064
|
+
console.log(chalk.dim(` edges=${result.edges.length}`));
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
async function resolveDiscoveredA2ADelegatePeer(parsed) {
|
|
1068
|
+
const skillId = stringFlag(parsed, "--skill");
|
|
1069
|
+
if (!skillId) {
|
|
1070
|
+
fail("Usage: maestro a2a delegate --discover --skill <skill-id> <text>");
|
|
1071
|
+
}
|
|
1072
|
+
const candidates = await listA2APeerCandidatesWithPlatform({
|
|
1073
|
+
workspaceId: stringFlag(parsed, "--workspace-id"),
|
|
1074
|
+
capability: stringFlag(parsed, "--capability"),
|
|
1075
|
+
surface: stringFlag(parsed, "--surface") ?? "a2a",
|
|
1076
|
+
status: stringFlag(parsed, "--status") ?? PlatformAgentStatusValue.Idle,
|
|
1077
|
+
limit: numberFlag(parsed, "--limit") ?? 10,
|
|
1078
|
+
offset: nonNegativeNumberFlag(parsed, "--offset"),
|
|
1079
|
+
skillId,
|
|
1080
|
+
preferInternalEndpoint: booleanFlag(parsed, "--prefer-internal"),
|
|
1081
|
+
});
|
|
1082
|
+
if (!candidates) {
|
|
1083
|
+
fail("Agent Registry service is not configured. Set AGENT_REGISTRY_SERVICE_URL, AGENT_REGISTRY_SERVICE_TOKEN, AGENT_REGISTRY_ORGANIZATION_ID, and AGENT_REGISTRY_WORKSPACE_ID.");
|
|
1084
|
+
}
|
|
1085
|
+
if (candidates.length === 0) {
|
|
1086
|
+
fail(`No Platform A2A peers advertise skill ${skillId}.`);
|
|
1087
|
+
}
|
|
1088
|
+
const selected = selectA2ACapabilityPeer(candidates, {
|
|
1089
|
+
skillId,
|
|
1090
|
+
preferInternalEndpoint: booleanFlag(parsed, "--prefer-internal"),
|
|
1091
|
+
});
|
|
1092
|
+
const candidate = selected?.candidate;
|
|
1093
|
+
if (!candidate || !selected) {
|
|
1094
|
+
fail(`No Platform A2A peers advertise skill ${skillId}.`);
|
|
1095
|
+
}
|
|
1096
|
+
const imported = await importDiscoveredA2APeers(parsed, [candidate]);
|
|
1097
|
+
const importedPeer = imported[0];
|
|
1098
|
+
if (!importedPeer) {
|
|
1099
|
+
fail(`Could not import Platform A2A peer for skill ${skillId}.`);
|
|
1100
|
+
}
|
|
1101
|
+
console.log(chalk.dim(`Selected Platform A2A peer ${importedPeer.name} (${importedPeer.url}) for ${skillId}`));
|
|
1102
|
+
console.log(chalk.dim(`Capability score: ${selected.score} (${selected.reasons.join(", ")})`));
|
|
1103
|
+
return resolveA2APeer(importedPeer.name, {
|
|
1104
|
+
path: stringFlag(parsed, "--registry"),
|
|
1105
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
function selectA2APeerSkill(skills, skillId) {
|
|
1109
|
+
if (!skillId) {
|
|
1110
|
+
return undefined;
|
|
1111
|
+
}
|
|
1112
|
+
return skills?.find((skill) => skill.id === skillId);
|
|
1113
|
+
}
|
|
1114
|
+
function buildA2ADelegationMetadata(input) {
|
|
1115
|
+
const skill = input.skill;
|
|
1116
|
+
const subagentRequestMetadataPath = a2ASkillRequestMetadataPath(skill);
|
|
1117
|
+
const subagentRequest = input.skillId
|
|
1118
|
+
? {
|
|
1119
|
+
skillId: input.skillId,
|
|
1120
|
+
...(skill?.name ? { skillName: skill.name } : {}),
|
|
1121
|
+
...(skill?.description ? { description: skill.description } : {}),
|
|
1122
|
+
...(input.role ? { role: input.role } : {}),
|
|
1123
|
+
...(input.cwd ? { cwd: input.cwd } : {}),
|
|
1124
|
+
...(skill?.requiredContextGrants
|
|
1125
|
+
? { requiredContextGrants: skill.requiredContextGrants }
|
|
1126
|
+
: {}),
|
|
1127
|
+
...(skill?.approvalPolicyRef
|
|
1128
|
+
? { approvalPolicyRef: skill.approvalPolicyRef }
|
|
1129
|
+
: {}),
|
|
1130
|
+
...(skill?.maxAutonomy ? { maxAutonomy: skill.maxAutonomy } : {}),
|
|
1131
|
+
...(skill?.requiredArtifactKinds
|
|
1132
|
+
? { requiredArtifactKinds: skill.requiredArtifactKinds }
|
|
1133
|
+
: {}),
|
|
1134
|
+
...(skill?.optionalArtifactKinds
|
|
1135
|
+
? { optionalArtifactKinds: skill.optionalArtifactKinds }
|
|
1136
|
+
: {}),
|
|
1137
|
+
...(skill?.allowedTaskClasses
|
|
1138
|
+
? { allowedTaskClasses: skill.allowedTaskClasses }
|
|
1139
|
+
: {}),
|
|
1140
|
+
...(skill?.deniedTaskClasses
|
|
1141
|
+
? { deniedTaskClasses: skill.deniedTaskClasses }
|
|
1142
|
+
: {}),
|
|
1143
|
+
...(skill?.attributes ? { attributes: skill.attributes } : {}),
|
|
1144
|
+
...(skill?.metadata ? { metadata: skill.metadata } : {}),
|
|
1145
|
+
}
|
|
1146
|
+
: undefined;
|
|
1147
|
+
return {
|
|
1148
|
+
requestKind: "maestro-peer-delegation",
|
|
1149
|
+
relayPeer: input.peerName,
|
|
1150
|
+
...(input.role ? { delegationRole: input.role } : {}),
|
|
1151
|
+
...(input.cwd ? { delegationCwd: input.cwd } : {}),
|
|
1152
|
+
...(input.discoverySource
|
|
1153
|
+
? { discoverySource: input.discoverySource }
|
|
1154
|
+
: {}),
|
|
1155
|
+
...(input.skillId ? { a2aSkillId: input.skillId } : {}),
|
|
1156
|
+
...(subagentRequest
|
|
1157
|
+
? { [subagentRequestMetadataPath]: subagentRequest }
|
|
1158
|
+
: {}),
|
|
1159
|
+
};
|
|
1160
|
+
}
|
|
1161
|
+
function a2ASkillRequestMetadataPath(skill) {
|
|
1162
|
+
return (stringMetadataValue(skill?.metadata, "requestMetadataPath") ??
|
|
1163
|
+
stringMetadataValue(skill?.metadata, "request_metadata_path") ??
|
|
1164
|
+
stringMetadataValue(skill?.attributes, "requestMetadataPath") ??
|
|
1165
|
+
stringMetadataValue(skill?.attributes, "request_metadata_path") ??
|
|
1166
|
+
"evalops.subagentRequest");
|
|
1167
|
+
}
|
|
1168
|
+
function stringMetadataValue(record, key) {
|
|
1169
|
+
const value = record?.[key];
|
|
1170
|
+
if (typeof value !== "string") {
|
|
1171
|
+
return undefined;
|
|
1172
|
+
}
|
|
1173
|
+
const trimmed = value.trim();
|
|
1174
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
1175
|
+
}
|
|
1176
|
+
function buildA2ADelegationLedgerMetadata(input) {
|
|
1177
|
+
return compactA2APeerMetadata({
|
|
1178
|
+
requestKind: "maestro-peer-delegation",
|
|
1179
|
+
relayPeer: input.peerName,
|
|
1180
|
+
delegationRole: input.role,
|
|
1181
|
+
delegationCwd: input.cwd,
|
|
1182
|
+
discoverySource: input.discoverySource,
|
|
1183
|
+
a2aSkillId: input.skillId,
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
async function handleA2AReply(parsed) {
|
|
1187
|
+
const peerName = parsed.positionals.shift() ??
|
|
1188
|
+
fail("Usage: maestro a2a reply <peer> <task-id> <text>");
|
|
1189
|
+
const taskId = parsed.positionals.shift() ??
|
|
1190
|
+
fail("Usage: maestro a2a reply <peer> <task-id> <text>");
|
|
1191
|
+
const text = parsed.positionals.join(" ").trim();
|
|
1192
|
+
if (!text) {
|
|
1193
|
+
fail("Usage: maestro a2a reply <peer> <task-id> <text>");
|
|
1194
|
+
}
|
|
1195
|
+
const peer = await resolveA2APeer(peerName, {
|
|
1196
|
+
path: stringFlag(parsed, "--registry"),
|
|
1197
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1198
|
+
});
|
|
1199
|
+
const existing = await loadA2AReplyLedgerEntry(parsed, peer.name, taskId);
|
|
1200
|
+
const wait = booleanFlag(parsed, "--wait");
|
|
1201
|
+
const messageId = `maestro-a2a-message-${randomUUID()}`;
|
|
1202
|
+
const sent = await sendA2AMessage(peer.config, {
|
|
1203
|
+
message: buildA2AUserMessage({
|
|
1204
|
+
messageId,
|
|
1205
|
+
contextId: existing?.contextId,
|
|
1206
|
+
taskId,
|
|
1207
|
+
text,
|
|
1208
|
+
metadata: {
|
|
1209
|
+
requestKind: "maestro-peer-task-reply",
|
|
1210
|
+
relayPeer: peer.name,
|
|
1211
|
+
referencedTaskId: taskId,
|
|
1212
|
+
},
|
|
1213
|
+
}),
|
|
1214
|
+
configuration: { returnImmediately: true },
|
|
1215
|
+
});
|
|
1216
|
+
console.log(`Replied to ${chalk.bold(peer.name)} task ${sent.task.id}`);
|
|
1217
|
+
await persistA2ALedgerBestEffort("record task reply locally", () => recordA2ATaskReply({
|
|
1218
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1219
|
+
peer: peer.name,
|
|
1220
|
+
peerDisplayName: peer.entry.displayName,
|
|
1221
|
+
task: sent.task,
|
|
1222
|
+
text,
|
|
1223
|
+
messageId,
|
|
1224
|
+
metadata: {
|
|
1225
|
+
requestKind: "maestro-peer-task-reply",
|
|
1226
|
+
relayPeer: peer.name,
|
|
1227
|
+
referencedTaskId: taskId,
|
|
1228
|
+
},
|
|
1229
|
+
}));
|
|
1230
|
+
const task = wait
|
|
1231
|
+
? await waitForA2ATask(peer.config, sent.task.id, parsed)
|
|
1232
|
+
: sent.task;
|
|
1233
|
+
if (wait) {
|
|
1234
|
+
await persistA2ALedgerBestEffort("sync replied task result locally", () => updateA2ATaskInLedger({
|
|
1235
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1236
|
+
peer: peer.name,
|
|
1237
|
+
task,
|
|
1238
|
+
}));
|
|
1239
|
+
}
|
|
1240
|
+
printTask(task, {
|
|
1241
|
+
includeWorkGraphDetails: booleanFlag(parsed, "--work-graph"),
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1244
|
+
async function handleA2ACoordinate(parsed) {
|
|
1245
|
+
const peerName = parsed.positionals.shift();
|
|
1246
|
+
if (parsed.positionals.length > 0) {
|
|
1247
|
+
fail("Usage: maestro a2a coordinate [peer] [--reply <text>] [--wait]");
|
|
1248
|
+
}
|
|
1249
|
+
const replyText = stringFlag(parsed, "--reply");
|
|
1250
|
+
if (parsed.flags.has("--reply") && !replyText) {
|
|
1251
|
+
fail("Usage: maestro a2a coordinate [peer] --reply <text> [--wait]");
|
|
1252
|
+
}
|
|
1253
|
+
if (replyText) {
|
|
1254
|
+
await handleA2ACoordinateReply(parsed, peerName, replyText);
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
await refreshA2ANonFinalTaskLedger(parsed, peerName);
|
|
1258
|
+
const ledger = await loadA2ATaskLedger({
|
|
1259
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1260
|
+
});
|
|
1261
|
+
const tasks = actionableA2ATaskEntries(ledger, peerName);
|
|
1262
|
+
if (booleanFlag(parsed, "--json")) {
|
|
1263
|
+
console.log(JSON.stringify({
|
|
1264
|
+
path: getA2ATaskLedgerPath(stringFlag(parsed, "--tasks")),
|
|
1265
|
+
tasks: tasks.map((entry) => ({
|
|
1266
|
+
id: entry.id,
|
|
1267
|
+
kind: entry.kind,
|
|
1268
|
+
peer: entry.peer,
|
|
1269
|
+
taskId: entry.taskId,
|
|
1270
|
+
contextId: entry.contextId,
|
|
1271
|
+
state: entry.state,
|
|
1272
|
+
text: entry.text,
|
|
1273
|
+
responseText: entry.responseText,
|
|
1274
|
+
workGraph: entry.workGraph,
|
|
1275
|
+
updatedAt: entry.updatedAt,
|
|
1276
|
+
})),
|
|
1277
|
+
}, null, 2));
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
console.log(`A2A coordinate (${getA2ATaskLedgerPath(stringFlag(parsed, "--tasks"))})`);
|
|
1281
|
+
if (tasks.length === 0) {
|
|
1282
|
+
console.log(chalk.dim(" No actionable A2A tasks require coordination."));
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
for (const task of tasks) {
|
|
1286
|
+
console.log(`${task.peer} ${chalk.bold(task.taskId)} ${task.state} ${chalk.dim(task.updatedAt)}`);
|
|
1287
|
+
console.log(chalk.dim(` ${task.text}`));
|
|
1288
|
+
if (task.responseText) {
|
|
1289
|
+
console.log(` ${task.responseText}`);
|
|
1290
|
+
}
|
|
1291
|
+
printLedgerWorkGraph(task, booleanFlag(parsed, "--work-graph"));
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
async function handleA2ACoordinateReply(parsed, peerName, text) {
|
|
1295
|
+
await refreshA2ANonFinalTaskLedger(parsed, peerName);
|
|
1296
|
+
const ledger = await loadA2ATaskLedger({
|
|
1297
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1298
|
+
});
|
|
1299
|
+
const entry = selectCoordinateReplyTask(ledger, peerName);
|
|
1300
|
+
if (!entry) {
|
|
1301
|
+
fail("No actionable A2A task is waiting for coordinator input.");
|
|
1302
|
+
}
|
|
1303
|
+
const peer = await resolveA2APeer(entry.peer, {
|
|
1304
|
+
path: stringFlag(parsed, "--registry"),
|
|
1305
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1306
|
+
});
|
|
1307
|
+
const messageId = `maestro-a2a-message-${randomUUID()}`;
|
|
1308
|
+
const sent = await sendA2AMessage(peer.config, {
|
|
1309
|
+
message: buildA2AUserMessage({
|
|
1310
|
+
messageId,
|
|
1311
|
+
contextId: entry.contextId,
|
|
1312
|
+
taskId: entry.taskId,
|
|
1313
|
+
text,
|
|
1314
|
+
metadata: {
|
|
1315
|
+
requestKind: "maestro-peer-coordinate-reply",
|
|
1316
|
+
relayPeer: peer.name,
|
|
1317
|
+
referencedTaskId: entry.taskId,
|
|
1318
|
+
},
|
|
1319
|
+
}),
|
|
1320
|
+
configuration: { returnImmediately: true },
|
|
1321
|
+
});
|
|
1322
|
+
const replyTask = {
|
|
1323
|
+
...sent.task,
|
|
1324
|
+
id: entry.taskId,
|
|
1325
|
+
contextId: sent.task.contextId ?? entry.contextId,
|
|
1326
|
+
};
|
|
1327
|
+
const json = booleanFlag(parsed, "--json");
|
|
1328
|
+
if (!json) {
|
|
1329
|
+
console.log(`Coordinated ${chalk.bold(peer.name)} task ${entry.taskId}`);
|
|
1330
|
+
}
|
|
1331
|
+
await persistA2ALedgerBestEffort("record coordinate reply locally", () => recordA2ATaskReply({
|
|
1332
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1333
|
+
peer: peer.name,
|
|
1334
|
+
peerDisplayName: peer.entry.displayName,
|
|
1335
|
+
task: replyTask,
|
|
1336
|
+
text,
|
|
1337
|
+
messageId,
|
|
1338
|
+
metadata: {
|
|
1339
|
+
requestKind: "maestro-peer-coordinate-reply",
|
|
1340
|
+
relayPeer: peer.name,
|
|
1341
|
+
referencedTaskId: entry.taskId,
|
|
1342
|
+
},
|
|
1343
|
+
}));
|
|
1344
|
+
const task = booleanFlag(parsed, "--wait")
|
|
1345
|
+
? await waitForA2ATask(peer.config, entry.taskId, parsed)
|
|
1346
|
+
: replyTask;
|
|
1347
|
+
if (booleanFlag(parsed, "--wait")) {
|
|
1348
|
+
await persistA2ALedgerBestEffort("sync coordinate task result locally", () => updateA2ATaskInLedger({
|
|
1349
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1350
|
+
peer: peer.name,
|
|
1351
|
+
task,
|
|
1352
|
+
}));
|
|
1353
|
+
}
|
|
1354
|
+
if (json) {
|
|
1355
|
+
console.log(JSON.stringify({ peer: peer.name, task }, null, 2));
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
printTask(task, {
|
|
1359
|
+
includeWorkGraphDetails: booleanFlag(parsed, "--work-graph"),
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
function actionableA2ATaskEntries(ledger, peerName) {
|
|
1363
|
+
return listA2ATaskEntries(ledger, { peer: peerName }).filter((entry) => isActionRequiredA2AState(entry.state));
|
|
1364
|
+
}
|
|
1365
|
+
function selectCoordinateReplyTask(ledger, peerName) {
|
|
1366
|
+
const tasks = actionableA2ATaskEntries(ledger, peerName);
|
|
1367
|
+
if (tasks.length > 1) {
|
|
1368
|
+
fail("Multiple actionable A2A tasks found; use `maestro a2a reply <peer> <task-id> <text>`.");
|
|
1369
|
+
}
|
|
1370
|
+
return tasks[0];
|
|
1371
|
+
}
|
|
1372
|
+
async function loadA2AReplyLedgerEntry(parsed, peerName, taskId) {
|
|
1373
|
+
try {
|
|
1374
|
+
const ledger = await loadA2ATaskLedger({
|
|
1375
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1376
|
+
});
|
|
1377
|
+
return listA2ATaskEntries(ledger, { peer: peerName }).find((entry) => entry.taskId === taskId);
|
|
1378
|
+
}
|
|
1379
|
+
catch (error) {
|
|
1380
|
+
if (isAbortError(error)) {
|
|
1381
|
+
throw error;
|
|
1382
|
+
}
|
|
1383
|
+
console.error(chalk.yellow(`A2A task ledger warning: could not load task reply context: ${errorMessage(error)}`));
|
|
1384
|
+
return undefined;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
async function handleA2ATasks(parsed) {
|
|
1388
|
+
const peerName = parsed.positionals.shift();
|
|
1389
|
+
if (booleanFlag(parsed, "--refresh")) {
|
|
1390
|
+
await refreshA2ATaskLedger(parsed, peerName);
|
|
1391
|
+
}
|
|
1392
|
+
const ledger = await loadA2ATaskLedger({
|
|
1393
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1394
|
+
});
|
|
1395
|
+
const tasks = listA2ATaskEntries(ledger, { peer: peerName });
|
|
1396
|
+
if (booleanFlag(parsed, "--json")) {
|
|
1397
|
+
console.log(JSON.stringify({
|
|
1398
|
+
path: getA2ATaskLedgerPath(stringFlag(parsed, "--tasks")),
|
|
1399
|
+
tasks: tasks.map((entry) => ({
|
|
1400
|
+
id: entry.id,
|
|
1401
|
+
kind: entry.kind,
|
|
1402
|
+
peer: entry.peer,
|
|
1403
|
+
taskId: entry.taskId,
|
|
1404
|
+
state: entry.state,
|
|
1405
|
+
text: entry.text,
|
|
1406
|
+
responseText: entry.responseText,
|
|
1407
|
+
workGraph: entry.workGraph,
|
|
1408
|
+
updatedAt: entry.updatedAt,
|
|
1409
|
+
})),
|
|
1410
|
+
}, null, 2));
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
console.log(`A2A tasks (${getA2ATaskLedgerPath(stringFlag(parsed, "--tasks"))})`);
|
|
1414
|
+
if (tasks.length === 0) {
|
|
1415
|
+
console.log(chalk.dim(" No delegated tasks recorded yet."));
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
for (const task of tasks) {
|
|
1419
|
+
console.log(`${task.peer} ${chalk.bold(task.taskId)} ${task.state} ${chalk.dim(task.updatedAt)}`);
|
|
1420
|
+
console.log(chalk.dim(` ${task.text}`));
|
|
1421
|
+
if (task.responseText) {
|
|
1422
|
+
console.log(` ${task.responseText}`);
|
|
1423
|
+
}
|
|
1424
|
+
printLedgerWorkGraph(task, booleanFlag(parsed, "--work-graph"));
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
async function handleA2AWait(parsed) {
|
|
1428
|
+
const peerName = parsed.positionals.shift() ??
|
|
1429
|
+
fail("Usage: maestro a2a wait <peer> <task-id>");
|
|
1430
|
+
const taskId = parsed.positionals.shift() ??
|
|
1431
|
+
fail("Usage: maestro a2a wait <peer> <task-id>");
|
|
1432
|
+
const peer = await resolveA2APeer(peerName, {
|
|
1433
|
+
path: stringFlag(parsed, "--registry"),
|
|
1434
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1435
|
+
});
|
|
1436
|
+
const task = await waitForA2ATask(peer.config, taskId, parsed);
|
|
1437
|
+
await persistA2ALedgerBestEffort("sync task result locally", () => updateA2ATaskInLedger({
|
|
1438
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1439
|
+
peer: peer.name,
|
|
1440
|
+
task,
|
|
1441
|
+
}));
|
|
1442
|
+
printTask(task, {
|
|
1443
|
+
includeWorkGraphDetails: booleanFlag(parsed, "--work-graph"),
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
async function refreshA2ATaskLedger(parsed, peerFilter) {
|
|
1447
|
+
const ledger = await loadA2ATaskLedger({
|
|
1448
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1449
|
+
});
|
|
1450
|
+
for (const entry of listA2ATaskEntries(ledger, { peer: peerFilter })) {
|
|
1451
|
+
if (isTerminalA2AState(entry.state)) {
|
|
1452
|
+
continue;
|
|
1453
|
+
}
|
|
1454
|
+
const peer = await resolveA2APeer(entry.peer, {
|
|
1455
|
+
path: stringFlag(parsed, "--registry"),
|
|
1456
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1457
|
+
});
|
|
1458
|
+
const task = await getA2ATask(peer.config, entry.taskId);
|
|
1459
|
+
await updateA2ATaskInLedger({
|
|
1460
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1461
|
+
peer: entry.peer,
|
|
1462
|
+
task,
|
|
1463
|
+
});
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
async function refreshA2ANonFinalTaskLedger(parsed, peerFilter) {
|
|
1467
|
+
const ledger = await loadA2ATaskLedger({
|
|
1468
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1469
|
+
});
|
|
1470
|
+
for (const entry of listA2ATaskEntries(ledger, { peer: peerFilter })) {
|
|
1471
|
+
if (isFinalA2AState(entry.state)) {
|
|
1472
|
+
continue;
|
|
1473
|
+
}
|
|
1474
|
+
try {
|
|
1475
|
+
const peer = await resolveA2APeer(entry.peer, {
|
|
1476
|
+
path: stringFlag(parsed, "--registry"),
|
|
1477
|
+
timeoutMs: numberFlag(parsed, "--timeout-ms"),
|
|
1478
|
+
});
|
|
1479
|
+
const task = await getA2ATask(peer.config, entry.taskId);
|
|
1480
|
+
await updateA2ATaskInLedger({
|
|
1481
|
+
path: stringFlag(parsed, "--tasks"),
|
|
1482
|
+
peer: entry.peer,
|
|
1483
|
+
task,
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
catch (error) {
|
|
1487
|
+
if (isAbortError(error)) {
|
|
1488
|
+
throw error;
|
|
1489
|
+
}
|
|
1490
|
+
console.error(chalk.yellow(`A2A coordinate warning: could not refresh ${entry.peer} task ${entry.taskId}: ${errorMessage(error)}`));
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
async function waitForA2ATask(config, taskId, parsed) {
|
|
1495
|
+
const maxWaitMs = numberFlag(parsed, "--max-wait-ms") ?? DEFAULT_WAIT_MS;
|
|
1496
|
+
const intervalMs = numberFlag(parsed, "--interval-ms") ?? DEFAULT_WAIT_INTERVAL_MS;
|
|
1497
|
+
const deadline = Date.now() + maxWaitMs;
|
|
1498
|
+
let lastTask = await getA2ATask(config, taskId);
|
|
1499
|
+
while (!isTerminalA2AState(lastTask.status.state) && Date.now() < deadline) {
|
|
1500
|
+
await sleep(intervalMs);
|
|
1501
|
+
lastTask = await getA2ATask(config, taskId);
|
|
1502
|
+
}
|
|
1503
|
+
if (!isTerminalA2AState(lastTask.status.state)) {
|
|
1504
|
+
throw new Error(`Timed out waiting for A2A task ${taskId}; last state ${lastTask.status.state}`);
|
|
1505
|
+
}
|
|
1506
|
+
return lastTask;
|
|
1507
|
+
}
|
|
1508
|
+
function printTask(task, options = {}) {
|
|
1509
|
+
console.log(`Task ${task.id}: ${task.status.state}`);
|
|
1510
|
+
const text = a2aTaskText(task);
|
|
1511
|
+
if (text) {
|
|
1512
|
+
console.log(text);
|
|
1513
|
+
}
|
|
1514
|
+
printTaskWorkGraph(task, Boolean(options.includeWorkGraphDetails));
|
|
1515
|
+
}
|
|
1516
|
+
function a2aTaskText(task) {
|
|
1517
|
+
return extractA2ATaskText(task);
|
|
1518
|
+
}
|
|
1519
|
+
function printTaskWorkGraph(task, includeDetails) {
|
|
1520
|
+
printWorkGraphLines(extractA2AWorkGraphMetadata(task), includeDetails);
|
|
1521
|
+
}
|
|
1522
|
+
function printLedgerWorkGraph(entry, includeDetails) {
|
|
1523
|
+
printWorkGraphLines(entry.workGraph, includeDetails);
|
|
1524
|
+
}
|
|
1525
|
+
function printWorkGraphLines(workGraph, includeDetails) {
|
|
1526
|
+
const summary = formatA2AWorkGraphSummary(workGraph);
|
|
1527
|
+
if (summary) {
|
|
1528
|
+
console.log(chalk.dim(` ${summary}`));
|
|
1529
|
+
}
|
|
1530
|
+
if (!includeDetails) {
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
const codexSubagents = formatA2AWorkGraphCodexSubagents(workGraph);
|
|
1534
|
+
if (codexSubagents) {
|
|
1535
|
+
console.log(chalk.dim(` ${codexSubagents}`));
|
|
1536
|
+
}
|
|
1537
|
+
if (workGraph?.correlationPath) {
|
|
1538
|
+
console.log(chalk.dim(` Correlation: ${workGraph.correlationPath}`));
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
export const isA2AWaitCompletionState = isTerminalA2AState;
|
|
1542
|
+
function discoveredPeerJson(candidate) {
|
|
1543
|
+
return {
|
|
1544
|
+
...(candidate.agent.id ? { agentId: candidate.agent.id } : {}),
|
|
1545
|
+
...(candidate.agent.name ? { name: candidate.agent.name } : {}),
|
|
1546
|
+
...(candidate.agent.status ? { status: candidate.agent.status } : {}),
|
|
1547
|
+
endpointUrl: candidate.endpointUrl,
|
|
1548
|
+
...(candidate.endpointKind ? { endpointKind: candidate.endpointKind } : {}),
|
|
1549
|
+
...(candidate.agentCardUrl ? { agentCardUrl: candidate.agentCardUrl } : {}),
|
|
1550
|
+
...(candidate.protocolBinding
|
|
1551
|
+
? { protocolBinding: candidate.protocolBinding }
|
|
1552
|
+
: {}),
|
|
1553
|
+
...(candidate.protocolVersion
|
|
1554
|
+
? { protocolVersion: candidate.protocolVersion }
|
|
1555
|
+
: {}),
|
|
1556
|
+
skills: candidate.skills,
|
|
1557
|
+
...(candidate.supportedExtensions
|
|
1558
|
+
? { supportedExtensions: candidate.supportedExtensions }
|
|
1559
|
+
: {}),
|
|
1560
|
+
...(candidate.pushNotifications === undefined
|
|
1561
|
+
? {}
|
|
1562
|
+
: { pushNotifications: candidate.pushNotifications }),
|
|
1563
|
+
};
|
|
1564
|
+
}
|
|
1565
|
+
function discoveredPeerName(candidate, index) {
|
|
1566
|
+
const raw = candidate.agent.id ??
|
|
1567
|
+
candidate.agent.name ??
|
|
1568
|
+
`platform-a2a-peer-${index + 1}`;
|
|
1569
|
+
const sanitized = raw
|
|
1570
|
+
.trim()
|
|
1571
|
+
.replace(/[^A-Za-z0-9_.-]+/gu, "-")
|
|
1572
|
+
.replace(/^-+|-+$/gu, "")
|
|
1573
|
+
.slice(0, 80) || `platform-a2a-peer-${index + 1}`;
|
|
1574
|
+
return normalizePeerName(sanitized);
|
|
1575
|
+
}
|
|
1576
|
+
function uniqueDiscoveredPeerName(input) {
|
|
1577
|
+
for (let suffix = 1; suffix <= 100; suffix++) {
|
|
1578
|
+
const name = suffix === 1 ? input.baseName : suffixedPeerName(input.baseName, suffix);
|
|
1579
|
+
const existing = input.peers[name];
|
|
1580
|
+
const hasSameAgentId = Boolean(existing?.agentId &&
|
|
1581
|
+
input.candidate.agent.id &&
|
|
1582
|
+
existing.agentId === input.candidate.agent.id);
|
|
1583
|
+
const hasSameEndpoint = existing?.url === input.candidate.endpointUrl;
|
|
1584
|
+
if (!input.importedNames.has(name) &&
|
|
1585
|
+
(!existing || hasSameAgentId || hasSameEndpoint)) {
|
|
1586
|
+
input.importedNames.add(name);
|
|
1587
|
+
return name;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
throw new Error(`Could not derive a unique A2A peer name for ${input.baseName}`);
|
|
1591
|
+
}
|
|
1592
|
+
function suffixedPeerName(baseName, suffix) {
|
|
1593
|
+
const suffixText = `-${suffix}`;
|
|
1594
|
+
return normalizePeerName(`${baseName.slice(0, 80 - suffixText.length)}${suffixText}`);
|
|
1595
|
+
}
|
|
1596
|
+
function compactA2APeerMetadata(record) {
|
|
1597
|
+
const entries = Object.entries(record).filter((entry) => entry[1] !== undefined);
|
|
1598
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
1599
|
+
}
|
|
1600
|
+
function baseUrlFromAgentCardUrl(agentCardUrl) {
|
|
1601
|
+
const parsed = new URL(agentCardUrl);
|
|
1602
|
+
parsed.pathname = parsed.pathname.replace(/\/\.well-known\/agent-card\.json$/u, "");
|
|
1603
|
+
parsed.search = "";
|
|
1604
|
+
parsed.hash = "";
|
|
1605
|
+
return parsed.toString().replace(/\/+$/u, "");
|
|
1606
|
+
}
|
|
1607
|
+
function stringFlag(parsed, name) {
|
|
1608
|
+
const value = parsed.flags.get(name);
|
|
1609
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
1610
|
+
}
|
|
1611
|
+
function stringListFlag(parsed, name, fallback) {
|
|
1612
|
+
const value = stringFlag(parsed, name);
|
|
1613
|
+
if (!value) {
|
|
1614
|
+
return fallback;
|
|
1615
|
+
}
|
|
1616
|
+
const parsedValues = value
|
|
1617
|
+
.split(",")
|
|
1618
|
+
.map((item) => item.trim())
|
|
1619
|
+
.filter(Boolean);
|
|
1620
|
+
return parsedValues.length > 0 ? parsedValues : fallback;
|
|
1621
|
+
}
|
|
1622
|
+
function numberFlag(parsed, name) {
|
|
1623
|
+
const value = stringFlag(parsed, name);
|
|
1624
|
+
if (!value) {
|
|
1625
|
+
return undefined;
|
|
1626
|
+
}
|
|
1627
|
+
const parsedValue = Number(value);
|
|
1628
|
+
if (!Number.isFinite(parsedValue) || parsedValue <= 0) {
|
|
1629
|
+
throw new Error(`${name} must be a positive number`);
|
|
1630
|
+
}
|
|
1631
|
+
return parsedValue;
|
|
1632
|
+
}
|
|
1633
|
+
function nonNegativeNumberFlag(parsed, name) {
|
|
1634
|
+
const value = stringFlag(parsed, name);
|
|
1635
|
+
if (!value) {
|
|
1636
|
+
return undefined;
|
|
1637
|
+
}
|
|
1638
|
+
const parsedValue = Number(value);
|
|
1639
|
+
if (!Number.isFinite(parsedValue) || parsedValue < 0) {
|
|
1640
|
+
throw new Error(`${name} must be a non-negative number`);
|
|
1641
|
+
}
|
|
1642
|
+
return parsedValue;
|
|
1643
|
+
}
|
|
1644
|
+
function minutesFlag(parsed, name) {
|
|
1645
|
+
const value = numberFlag(parsed, name);
|
|
1646
|
+
return value === undefined ? undefined : value * 60 * 1000;
|
|
1647
|
+
}
|
|
1648
|
+
function booleanFlag(parsed, name) {
|
|
1649
|
+
return parsed.flags.get(name) === true;
|
|
1650
|
+
}
|
|
1651
|
+
async function persistA2ALedgerBestEffort(description, action) {
|
|
1652
|
+
try {
|
|
1653
|
+
await action();
|
|
1654
|
+
}
|
|
1655
|
+
catch (error) {
|
|
1656
|
+
if (isAbortError(error)) {
|
|
1657
|
+
throw error;
|
|
1658
|
+
}
|
|
1659
|
+
console.error(chalk.yellow(`A2A task ledger warning: could not ${description}: ${errorMessage(error)}`));
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
function fail(message) {
|
|
1663
|
+
throw new Error(message);
|
|
1664
|
+
}
|
|
1665
|
+
function sleep(ms) {
|
|
1666
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1667
|
+
}
|
|
1668
|
+
function errorMessage(error) {
|
|
1669
|
+
return error instanceof Error ? error.message : String(error);
|
|
1670
|
+
}
|
|
1671
|
+
function agentRegistryNotConfiguredMessage() {
|
|
1672
|
+
return "Agent Registry service is not configured. Set AGENT_REGISTRY_SERVICE_URL, AGENT_REGISTRY_SERVICE_TOKEN, AGENT_REGISTRY_ORGANIZATION_ID, and AGENT_REGISTRY_WORKSPACE_ID, or pass --workspace-id with shared EvalOps credentials.";
|
|
1673
|
+
}
|
|
1674
|
+
function normalizeA2AControlMode(value) {
|
|
1675
|
+
switch (value.toLowerCase()) {
|
|
1676
|
+
case "steer":
|
|
1677
|
+
return PlatformA2ADelegationTaskControlModeValue.Steer;
|
|
1678
|
+
case "followup":
|
|
1679
|
+
case "follow-up":
|
|
1680
|
+
return PlatformA2ADelegationTaskControlModeValue.Followup;
|
|
1681
|
+
case "collect":
|
|
1682
|
+
return PlatformA2ADelegationTaskControlModeValue.Collect;
|
|
1683
|
+
case "interrupt":
|
|
1684
|
+
return PlatformA2ADelegationTaskControlModeValue.Interrupt;
|
|
1685
|
+
case "cancel":
|
|
1686
|
+
return PlatformA2ADelegationTaskControlModeValue.Cancel;
|
|
1687
|
+
default:
|
|
1688
|
+
throw new Error(`Unsupported A2A control mode: ${value}`);
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
function printA2AHelp() {
|
|
1692
|
+
console.log(`Usage:
|
|
1693
|
+
maestro a2a offer --url <base-url> [--name <display-name>] [--peer-id <id>]
|
|
1694
|
+
maestro a2a accept <pairing-code> [--name <peer>] [--default] [--token-env ENV]
|
|
1695
|
+
maestro a2a peers
|
|
1696
|
+
maestro a2a discover [--capability <capability>] [--skill <skill-id>] [--import]
|
|
1697
|
+
maestro a2a register --url <base-url> [--agent-id <id>] [--workspace-id <id>] [--json]
|
|
1698
|
+
maestro a2a fleet [--json]
|
|
1699
|
+
maestro a2a card <peer>
|
|
1700
|
+
maestro a2a coordinate [peer] [--reply <text>] [--wait] [--json] [--work-graph]
|
|
1701
|
+
maestro a2a delegate <peer> <text> [--role <role>] [--cwd <path>] [--wait] [--work-graph]
|
|
1702
|
+
maestro a2a delegate --discover --skill <skill-id> <text> [--capability <capability>] [--prefer-internal]
|
|
1703
|
+
maestro a2a delegate --platform --from-agent-id <agent-id> [--to-agent-id <agent-id>|--capability <capability>] --skill <skill-id> <text> [--json]
|
|
1704
|
+
maestro a2a control <delegation-id> --mode steer|followup|collect|interrupt|cancel [--workspace-id <id>] [message]
|
|
1705
|
+
maestro a2a graph <delegation-id> [--workspace-id <id>] [--json]
|
|
1706
|
+
maestro a2a reply <peer> <task-id> <text> [--wait] [--work-graph]
|
|
1707
|
+
maestro a2a send <peer> <text> [--wait] [--work-graph]
|
|
1708
|
+
maestro a2a tasks [peer] [--json] [--refresh] [--work-graph]
|
|
1709
|
+
maestro a2a wait <peer> <task-id> [--work-graph]
|
|
1710
|
+
|
|
1711
|
+
Pairing codes carry Agent Card and transport coordinates only. Configure auth with
|
|
1712
|
+
--token-env or --token-file when accepting a peer; bearer tokens are never embedded.`);
|
|
1713
|
+
}
|
|
1714
|
+
//# sourceMappingURL=a2a.js.map
|