@evalops/maestro 0.10.18 → 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/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 +135 -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 +49158 -26161
- 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/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 +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -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 +119 -0
- package/dist/platform/a2a-client.d.ts.map +1 -1
- package/dist/platform/a2a-client.js +413 -24
- package/dist/platform/a2a-client.js.map +1 -1
- 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.map +1 -1
- package/dist/platform/client.js +3 -12
- 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
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
58
58
|
|
|
59
59
|
Maestro also supports OpenAI, OpenAI Codex with ChatGPT login, Google, OpenRouter, Azure OpenAI, GitHub Copilot, Groq, xAI, Cerebras, and managed EvalOps auth. See [Models](docs/MODELS.md) for provider-specific setup and overrides.
|
|
60
60
|
|
|
61
|
-
For Codex subscription models, run `maestro codex login`
|
|
61
|
+
For Codex subscription models, run `maestro codex login` to Sign in with ChatGPT through the Codex app-server, then select models under the `openai-codex` provider such as `openai-codex/gpt-5.5`.
|
|
62
62
|
|
|
63
63
|
2. Launch the interface you want:
|
|
64
64
|
|
|
@@ -75,6 +75,7 @@ maestro web
|
|
|
75
75
|
- Keys and config: `~/.maestro/keys.json`, `~/.maestro/config.json`
|
|
76
76
|
- MCP servers: `~/.maestro/mcp.json` or `.maestro/mcp.json`
|
|
77
77
|
- Hooks: `~/.maestro/hooks.json` or `.maestro/hooks.json`
|
|
78
|
+
- Skills: `maestro skill new <name>`, `maestro skill lint .maestro/skills`
|
|
78
79
|
- Agent instructions: `AGENT.md`, `.maestro/APPEND_SYSTEM.md`, `~/.maestro/agent/AGENT.md`
|
|
79
80
|
|
|
80
81
|
## Safety Model
|
|
@@ -96,6 +97,7 @@ See [Safety](docs/SAFETY.md) and the [Threat Model](docs/THREAT_MODEL.md) for th
|
|
|
96
97
|
| Understand approvals and sandboxing | [Safety](docs/SAFETY.md) |
|
|
97
98
|
| Run the browser interface | [Web UI Guide](docs/WEB_UI.md) |
|
|
98
99
|
| Set up MCP servers | [MCP Guide](docs/MCP_GUIDE.md) |
|
|
100
|
+
| Package reusable skills | [Skill Cookbook](docs/cookbook/skills/README.md) |
|
|
99
101
|
| Work on the repo as a contributor | [Contributor Runbook](docs/CONTRIBUTOR_RUNBOOK.md) |
|
|
100
102
|
| Integrate Maestro headlessly | [Headless protocol](docs/protocols/headless.md) |
|
|
101
103
|
| Bring any coding agent into EvalOps | [Any-Agent Control Plane](docs/design/ANY_AGENT_CONTROL_PLANE.md) |
|
|
@@ -110,10 +112,63 @@ git clone https://github.com/evalops/maestro.git
|
|
|
110
112
|
cd maestro
|
|
111
113
|
bun install
|
|
112
114
|
npx nx run maestro:build --skip-nx-cache
|
|
115
|
+
npm run smoke:local-e2e
|
|
113
116
|
npx nx run maestro:test --skip-nx-cache
|
|
114
117
|
npx nx run maestro:evals --skip-nx-cache
|
|
115
118
|
```
|
|
116
119
|
|
|
120
|
+
`npm run smoke:local-e2e` is credential-free after build: it checks help,
|
|
121
|
+
version, the headless protocol handshake, and deterministic mock-agent
|
|
122
|
+
read/write/search/edit flows through the built CLI.
|
|
123
|
+
|
|
124
|
+
For the browser UI without local API keys or Redis, use the local-only dev
|
|
125
|
+
profile:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
make web-local
|
|
129
|
+
curl http://localhost:8080/api/models
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
To prove Maestro works against a local Cerebro stack, keep sibling checkouts and
|
|
133
|
+
run:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
gh repo clone evalops/cerebro ../cerebro
|
|
137
|
+
make cerebro-e2e-doctor
|
|
138
|
+
make cerebro-e2e
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
To actually use the two repos together locally, start Cerebro from Maestro and
|
|
142
|
+
export the same Cerebro/MCP env into the Maestro terminal:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
make cerebro-dev
|
|
146
|
+
|
|
147
|
+
# In another Maestro terminal:
|
|
148
|
+
eval "$(make -s cerebro-env)"
|
|
149
|
+
make run-ts
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
That target delegates to Cerebro's `make local-maestro-e2e` with
|
|
153
|
+
`LOCAL_MAESTRO_REPO` set to the current Maestro checkout. It builds and smokes
|
|
154
|
+
Maestro, emits Maestro's canonical Platform replay, publishes it through local
|
|
155
|
+
NATS, and verifies Cerebro graph projection plus MCP recall from the generated
|
|
156
|
+
session traffic. `make cerebro-e2e-doctor` checks the Cerebro checkout, Docker
|
|
157
|
+
Compose, the replay generator, and Cerebro's own local-E2E doctor before the
|
|
158
|
+
full smoke starts. It also checks the effective local Cerebro URL, MCP URL, and
|
|
159
|
+
workspace from `.env` or exported environment values, then verifies that the
|
|
160
|
+
configured API port is free before the self-contained smoke starts. The default
|
|
161
|
+
URL is `http://localhost:18080`; use `LOCAL_BASE_URL`/`MAESTRO_CEREBRO_URL` plus
|
|
162
|
+
matching Cerebro `LOCAL_HTTP_PORT` overrides when that port is occupied. Set
|
|
163
|
+
`LOCAL_CEREBRO_REPO=/path/to/cerebro` when the checkout is not a sibling
|
|
164
|
+
directory. If your machine cannot surface OTEL collector debug logs, run
|
|
165
|
+
`LOCAL_ASSERT_OTEL=false make cerebro-e2e`.
|
|
166
|
+
|
|
167
|
+
For direct local Maestro runs against an already-running Cerebro dev stack,
|
|
168
|
+
`make cerebro-env` prints copyable exports derived from `.env` or shell
|
|
169
|
+
overrides. The Makefile exports those vars to `make` targets so `make run-ts`,
|
|
170
|
+
`make web-local`, and local smokes all see the same configuration.
|
|
171
|
+
|
|
117
172
|
Need Redis or PostgreSQL for a specific workflow? Start from `docker-compose.yml` and use the [Contributor Runbook](docs/CONTRIBUTOR_RUNBOOK.md) for the rest of the repo workflow.
|
|
118
173
|
|
|
119
174
|
## Repository Layout
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { GuardedFilesPolicySettings } from "@evalops/contracts";
|
|
2
|
+
import { type Clock } from "../utils/clock.js";
|
|
1
3
|
/**
|
|
2
4
|
* Action Approval System
|
|
3
5
|
*
|
|
@@ -38,6 +40,8 @@ export interface ActionApprovalRequest {
|
|
|
38
40
|
args: unknown;
|
|
39
41
|
/** Human-readable reason why approval is required */
|
|
40
42
|
reason: string;
|
|
43
|
+
/** Unix timestamp in milliseconds when this approval lifecycle was emitted */
|
|
44
|
+
startedAtMs?: number;
|
|
41
45
|
/** Optional Platform correlation for shared approval and audit surfaces */
|
|
42
46
|
platform?: {
|
|
43
47
|
source: "approvals_service" | "tool_execution";
|
|
@@ -55,6 +59,8 @@ export interface ActionApprovalDecision {
|
|
|
55
59
|
reason?: string;
|
|
56
60
|
/** Who made the decision: automated policy or human user */
|
|
57
61
|
resolvedBy: "policy" | "user";
|
|
62
|
+
/** Unix timestamp in milliseconds when this approval lifecycle resolved */
|
|
63
|
+
resolvedAtMs?: number;
|
|
58
64
|
}
|
|
59
65
|
/**
|
|
60
66
|
* Serializable snapshot of PII tracking state.
|
|
@@ -96,6 +102,8 @@ export interface ActionApprovalContext {
|
|
|
96
102
|
/** Tool interacts with external/untrusted systems */
|
|
97
103
|
openWorldHint?: boolean;
|
|
98
104
|
};
|
|
105
|
+
/** User/org guarded-files override policy for this run */
|
|
106
|
+
guardedFiles?: GuardedFilesPolicySettings;
|
|
99
107
|
};
|
|
100
108
|
/** User context for permission-based policies */
|
|
101
109
|
user?: {
|
|
@@ -142,9 +150,10 @@ export type ActionFirewallVerdict = {
|
|
|
142
150
|
*/
|
|
143
151
|
export declare class ActionApprovalService {
|
|
144
152
|
private mode;
|
|
153
|
+
protected readonly clock: Clock;
|
|
145
154
|
/** Map of request ID -> pending entry awaiting decision */
|
|
146
155
|
private pending;
|
|
147
|
-
constructor(mode?: ApprovalMode);
|
|
156
|
+
constructor(mode?: ApprovalMode, clock?: Clock);
|
|
148
157
|
/** Update the approval mode at runtime */
|
|
149
158
|
setMode(mode: ApprovalMode): void;
|
|
150
159
|
/** Get the current approval mode */
|
|
@@ -163,7 +172,7 @@ export declare class ActionApprovalService {
|
|
|
163
172
|
* @param signal - Optional abort signal to cancel the request
|
|
164
173
|
* @returns Promise that resolves with the approval decision
|
|
165
174
|
*/
|
|
166
|
-
requestApproval(request: ActionApprovalRequest, signal?: AbortSignal): Promise<ActionApprovalDecision>;
|
|
175
|
+
requestApproval(request: ActionApprovalRequest, signal?: AbortSignal, clock?: Pick<Clock, "now">): Promise<ActionApprovalDecision>;
|
|
167
176
|
/**
|
|
168
177
|
* Approve a pending request. Called by UI or API when user approves.
|
|
169
178
|
* @returns true if request was found and resolved, false if not pending
|
|
@@ -194,5 +203,6 @@ export declare class ActionApprovalService {
|
|
|
194
203
|
* Handles cleanup and removal from pending map.
|
|
195
204
|
*/
|
|
196
205
|
private resolveEntry;
|
|
206
|
+
protected withResolvedAt(decision: ActionApprovalDecision, clock?: Pick<Clock, "now">): ActionApprovalDecision;
|
|
197
207
|
}
|
|
198
208
|
//# sourceMappingURL=action-approval.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-approval.d.ts","sourceRoot":"","sources":["../../src/agent/action-approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAmD;AACnD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW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Y;IAIvB,4EAA4E;IAC5E,uBAAuB,IAAI,OAAO;IAIlC;;;;;;;;;;;OAWG;IACG,eAAe,CACpB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,CAAC,EAAE,WAAW,EACpB,KAAK,GAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAc,GACpC,OAAO,CAAC,sBAAsB,CAAC;IAyElC;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO;IAQ3C;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO;IAQ1C;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,GAAG,OAAO;IAI9D;;;OAGG;IACH,YAAY,CAAC,MAAM,SAAuB,GAAG,IAAI;IAUjD;;;OAGG;IACH,kBAAkB,IAAI,qBAAqB,EAAE;IAI7C;;;OAGG;IACH,OAAO,CAAC,YAAY;IAUpB,SAAS,CAAC,cAAc,CACvB,QAAQ,EAAE,sBAAsB,EAChC,KAAK,GAAE,IAAI,CAAC,KAAK,EAAE,KAAK,CAAc,GACpC,sBAAsB;CAKzB"}
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Action Approval System
|
|
3
|
-
*
|
|
4
|
-
* This module implements the approval workflow for risky tool executions.
|
|
5
|
-
* When tools are flagged as requiring approval (by the action firewall or
|
|
6
|
-
* tool configuration), this system manages the approval lifecycle.
|
|
7
|
-
*
|
|
8
|
-
* Three approval modes are supported:
|
|
9
|
-
* - auto: Automatically approve all requests (for trusted/automated workflows)
|
|
10
|
-
* - prompt: Queue requests and wait for user decision (default for interactive)
|
|
11
|
-
* - fail: Automatically reject all requests (for strict security contexts)
|
|
12
|
-
*
|
|
13
|
-
* The approval flow:
|
|
14
|
-
* 1. Agent prepares a tool call
|
|
15
|
-
* 2. Action firewall evaluates and may require approval
|
|
16
|
-
* 3. ActionApprovalService.requestApproval() is called
|
|
17
|
-
* 4. In "prompt" mode, request is queued and awaits user decision
|
|
18
|
-
* 5. User approves/denies via the UI or API
|
|
19
|
-
* 6. Decision is returned to the agent to proceed or abort
|
|
20
|
-
*/
|
|
1
|
+
import { systemClock } from "../utils/clock.js";
|
|
21
2
|
/**
|
|
22
3
|
* Manages the approval workflow for risky tool executions.
|
|
23
4
|
*
|
|
@@ -29,8 +10,9 @@
|
|
|
29
10
|
* when the agent run is cancelled.
|
|
30
11
|
*/
|
|
31
12
|
export class ActionApprovalService {
|
|
32
|
-
constructor(mode = "prompt") {
|
|
13
|
+
constructor(mode = "prompt", clock = systemClock) {
|
|
33
14
|
this.mode = mode;
|
|
15
|
+
this.clock = clock;
|
|
34
16
|
/** Map of request ID -> pending entry awaiting decision */
|
|
35
17
|
this.pending = new Map();
|
|
36
18
|
}
|
|
@@ -58,36 +40,37 @@ export class ActionApprovalService {
|
|
|
58
40
|
* @param signal - Optional abort signal to cancel the request
|
|
59
41
|
* @returns Promise that resolves with the approval decision
|
|
60
42
|
*/
|
|
61
|
-
async requestApproval(request, signal) {
|
|
43
|
+
async requestApproval(request, signal, clock = this.clock) {
|
|
62
44
|
// Fast path for auto mode - no queuing needed
|
|
63
45
|
if (this.mode === "auto") {
|
|
64
|
-
return {
|
|
46
|
+
return this.withResolvedAt({
|
|
65
47
|
approved: true,
|
|
66
48
|
reason: "Auto-approved by policy",
|
|
67
49
|
resolvedBy: "policy",
|
|
68
|
-
};
|
|
50
|
+
}, clock);
|
|
69
51
|
}
|
|
70
52
|
// Fast path for fail mode - immediate rejection
|
|
71
53
|
if (this.mode === "fail") {
|
|
72
|
-
return {
|
|
54
|
+
return this.withResolvedAt({
|
|
73
55
|
approved: false,
|
|
74
56
|
reason: "Denied by approval policy",
|
|
75
57
|
resolvedBy: "policy",
|
|
76
|
-
};
|
|
58
|
+
}, clock);
|
|
77
59
|
}
|
|
78
60
|
// Check if already aborted before queuing
|
|
79
61
|
if (signal?.aborted) {
|
|
80
|
-
return {
|
|
62
|
+
return this.withResolvedAt({
|
|
81
63
|
approved: false,
|
|
82
64
|
reason: "Run aborted",
|
|
83
65
|
resolvedBy: "policy",
|
|
84
|
-
};
|
|
66
|
+
}, clock);
|
|
85
67
|
}
|
|
86
68
|
// Prompt mode: queue the request and wait for user decision
|
|
87
69
|
return await new Promise((resolve) => {
|
|
88
70
|
const entry = {
|
|
89
71
|
request,
|
|
90
72
|
resolve: () => { }, // Placeholder, replaced below
|
|
73
|
+
stampResolvedAt: (decision) => this.withResolvedAt(decision, clock),
|
|
91
74
|
};
|
|
92
75
|
// Wrap resolver to ensure cleanup on resolution
|
|
93
76
|
entry.resolve = (decision) => {
|
|
@@ -100,12 +83,11 @@ export class ActionApprovalService {
|
|
|
100
83
|
if (!this.pending.has(request.id))
|
|
101
84
|
return;
|
|
102
85
|
this.pending.delete(request.id);
|
|
103
|
-
entry.
|
|
104
|
-
resolve({
|
|
86
|
+
entry.resolve(entry.stampResolvedAt({
|
|
105
87
|
approved: false,
|
|
106
88
|
reason: "Run aborted",
|
|
107
89
|
resolvedBy: "policy",
|
|
108
|
-
});
|
|
90
|
+
}));
|
|
109
91
|
};
|
|
110
92
|
entry.cleanup = () => signal.removeEventListener("abort", onAbort);
|
|
111
93
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -173,8 +155,13 @@ export class ActionApprovalService {
|
|
|
173
155
|
return false;
|
|
174
156
|
}
|
|
175
157
|
this.pending.delete(id);
|
|
176
|
-
entry.resolve(decision);
|
|
158
|
+
entry.resolve(entry.stampResolvedAt(decision));
|
|
177
159
|
return true;
|
|
178
160
|
}
|
|
161
|
+
withResolvedAt(decision, clock = this.clock) {
|
|
162
|
+
return decision.resolvedAtMs === undefined
|
|
163
|
+
? { ...decision, resolvedAtMs: clock.now() }
|
|
164
|
+
: decision;
|
|
165
|
+
}
|
|
179
166
|
}
|
|
180
167
|
//# sourceMappingURL=action-approval.js.map
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B,OAAO,IAAI,CAAC;IACb,CAAC;CACD","sourcesContent":["/**\n * Action Approval System\n *\n * This module implements the approval workflow for risky tool executions.\n * When tools are flagged as requiring approval (by the action firewall or\n * tool configuration), this system manages the approval lifecycle.\n *\n * Three approval modes are supported:\n * - auto: Automatically approve all requests (for trusted/automated workflows)\n * - prompt: Queue requests and wait for user decision (default for interactive)\n * - fail: Automatically reject all requests (for strict security contexts)\n *\n * The approval flow:\n * 1. Agent prepares a tool call\n * 2. Action firewall evaluates and may require approval\n * 3. ActionApprovalService.requestApproval() is called\n * 4. In \"prompt\" mode, request is queued and awaits user decision\n * 5. User approves/denies via the UI or API\n * 6. Decision is returned to the agent to proceed or abort\n */\n\n/** Determines how approval requests are handled */\nexport type ApprovalMode = \"auto\" | \"prompt\" | \"fail\";\n\n/**\n * Represents a pending approval request for a tool execution.\n */\nexport interface ActionApprovalRequest {\n\t/** Unique identifier for this request */\n\tid: string;\n\t/** Name of the tool requesting approval */\n\ttoolName: string;\n\t/** Optional human-facing label for the tool */\n\tdisplayName?: string;\n\t/** Optional compact summary of the requested action */\n\tsummaryLabel?: string;\n\t/** Optional present-tense action description for approval UI */\n\tactionDescription?: string;\n\t/** Arguments the tool will be called with */\n\targs: unknown;\n\t/** Human-readable reason why approval is required */\n\treason: string;\n\t/** Optional Platform correlation for shared approval and audit surfaces */\n\tplatform?: {\n\t\tsource: \"approvals_service\" | \"tool_execution\";\n\t\ttoolExecutionId?: string;\n\t\tapprovalRequestId?: string;\n\t};\n}\n\n/**\n * The decision made for an approval request.\n */\nexport interface ActionApprovalDecision {\n\t/** Whether the action was approved */\n\tapproved: boolean;\n\t/** Optional explanation for the decision */\n\treason?: string;\n\t/** Who made the decision: automated policy or human user */\n\tresolvedBy: \"policy\" | \"user\";\n}\n\n/**\n * Serializable snapshot of PII tracking state.\n * Used to persist and restore workflow state across sessions.\n */\nexport interface WorkflowStateSnapshot {\n\t/** List of PII artifacts that are pending redaction */\n\tpendingPii: Array<{\n\t\tid: string;\n\t\tlabel: string;\n\t\tsourceToolCallId: string;\n\t\tredacted: boolean;\n\t\tparents?: string[];\n\t}>;\n\t/** Artifact IDs that were redacted but never captured (indicates bugs) */\n\torphanedRedactions: string[];\n}\n\n/**\n * Full context provided to the action firewall for approval decisions.\n * Includes the action itself plus ambient context about the workflow.\n */\nexport interface ActionApprovalContext {\n\t/** Name of the tool being executed */\n\ttoolName: string;\n\t/** Arguments for the tool call */\n\targs: unknown;\n\t/** Additional metadata for policy evaluation */\n\tmetadata?: {\n\t\t/** Current PII tracking state for data protection policies */\n\t\tworkflowState?: WorkflowStateSnapshot;\n\t\t/** MCP tool annotations that hint at tool behavior */\n\t\tannotations?: {\n\t\t\t/** Tool only reads data, doesn't modify state */\n\t\t\treadOnlyHint?: boolean;\n\t\t\t/** Tool may cause irreversible changes */\n\t\t\tdestructiveHint?: boolean;\n\t\t\t/** Tool can be safely retried */\n\t\t\tidempotentHint?: boolean;\n\t\t\t/** Tool interacts with external/untrusted systems */\n\t\t\topenWorldHint?: boolean;\n\t\t};\n\t};\n\t/** User context for permission-based policies */\n\tuser?: {\n\t\tid: string;\n\t\torgId: string;\n\t};\n\t/** Session context for time/scope-based policies */\n\tsession?: {\n\t\tid: string;\n\t\tstartedAt: Date;\n\t};\n\t/** The user's original request (for intent-matching policies) */\n\tuserIntent?: string;\n}\n\n/**\n * Verdict from the action firewall after evaluating a tool call.\n *\n * - allow: Tool can proceed without approval\n * - require_approval: Tool needs user approval before execution\n * - block: Tool is denied and cannot be executed\n */\nexport type ActionFirewallVerdict =\n\t| { action: \"allow\" }\n\t| { action: \"require_approval\"; ruleId: string; reason: string }\n\t| {\n\t\t\taction: \"block\";\n\t\t\truleId: string;\n\t\t\treason: string;\n\t\t\t/** Suggested steps to resolve the block */\n\t\t\tremediation?: string;\n\t };\n\n/**\n * Internal entry for a pending approval request.\n * Stores the promise resolver and cleanup callback.\n */\ntype PendingEntry = {\n\t/** The approval request details */\n\trequest: ActionApprovalRequest;\n\t/** Resolver function to complete the approval promise */\n\tresolve: (decision: ActionApprovalDecision) => void;\n\t/** Cleanup callback to remove abort listeners */\n\tcleanup?: () => void;\n};\n\n/**\n * Manages the approval workflow for risky tool executions.\n *\n * In \"prompt\" mode, this service queues approval requests and returns\n * a promise that resolves when the user makes a decision. The UI/API\n * can call approve() or deny() to resolve pending requests.\n *\n * The service also handles abort signals to clean up pending requests\n * when the agent run is cancelled.\n */\nexport class ActionApprovalService {\n\t/** Map of request ID -> pending entry awaiting decision */\n\tprivate pending = new Map<string, PendingEntry>();\n\n\tconstructor(private mode: ApprovalMode = \"prompt\") {}\n\n\t/** Update the approval mode at runtime */\n\tsetMode(mode: ApprovalMode): void {\n\t\tthis.mode = mode;\n\t}\n\n\t/** Get the current approval mode */\n\tgetMode(): ApprovalMode {\n\t\treturn this.mode;\n\t}\n\n\t/** Check if this mode requires user interaction (UI should show prompts) */\n\trequiresUserInteraction(): boolean {\n\t\treturn this.mode === \"prompt\";\n\t}\n\n\t/**\n\t * Request approval for an action.\n\t *\n\t * Behavior depends on the current mode:\n\t * - auto: Immediately returns approved\n\t * - fail: Immediately returns denied\n\t * - prompt: Queues request and waits for user decision\n\t *\n\t * @param request - The approval request details\n\t * @param signal - Optional abort signal to cancel the request\n\t * @returns Promise that resolves with the approval decision\n\t */\n\tasync requestApproval(\n\t\trequest: ActionApprovalRequest,\n\t\tsignal?: AbortSignal,\n\t): Promise<ActionApprovalDecision> {\n\t\t// Fast path for auto mode - no queuing needed\n\t\tif (this.mode === \"auto\") {\n\t\t\treturn {\n\t\t\t\tapproved: true,\n\t\t\t\treason: \"Auto-approved by policy\",\n\t\t\t\tresolvedBy: \"policy\",\n\t\t\t};\n\t\t}\n\n\t\t// Fast path for fail mode - immediate rejection\n\t\tif (this.mode === \"fail\") {\n\t\t\treturn {\n\t\t\t\tapproved: false,\n\t\t\t\treason: \"Denied by approval policy\",\n\t\t\t\tresolvedBy: \"policy\",\n\t\t\t};\n\t\t}\n\n\t\t// Check if already aborted before queuing\n\t\tif (signal?.aborted) {\n\t\t\treturn {\n\t\t\t\tapproved: false,\n\t\t\t\treason: \"Run aborted\",\n\t\t\t\tresolvedBy: \"policy\",\n\t\t\t};\n\t\t}\n\n\t\t// Prompt mode: queue the request and wait for user decision\n\t\treturn await new Promise<ActionApprovalDecision>((resolve) => {\n\t\t\tconst entry: PendingEntry = {\n\t\t\t\trequest,\n\t\t\t\tresolve: () => {}, // Placeholder, replaced below\n\t\t\t};\n\n\t\t\t// Wrap resolver to ensure cleanup on resolution\n\t\t\tentry.resolve = (decision) => {\n\t\t\t\tentry.cleanup?.();\n\t\t\t\tresolve(decision);\n\t\t\t};\n\n\t\t\t// Set up abort handling to auto-deny if the run is cancelled\n\t\t\tif (signal) {\n\t\t\t\tconst onAbort = () => {\n\t\t\t\t\tif (!this.pending.has(request.id)) return;\n\t\t\t\t\tthis.pending.delete(request.id);\n\t\t\t\t\tentry.cleanup?.();\n\t\t\t\t\tresolve({\n\t\t\t\t\t\tapproved: false,\n\t\t\t\t\t\treason: \"Run aborted\",\n\t\t\t\t\t\tresolvedBy: \"policy\",\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\tentry.cleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t}\n\n\t\t\t// Add to pending map - UI can query this to show approval prompts\n\t\t\tthis.pending.set(request.id, entry);\n\t\t});\n\t}\n\n\t/**\n\t * Approve a pending request. Called by UI or API when user approves.\n\t * @returns true if request was found and resolved, false if not pending\n\t */\n\tapprove(id: string, note?: string): boolean {\n\t\treturn this.resolve(id, {\n\t\t\tapproved: true,\n\t\t\treason: note ?? \"Approved\",\n\t\t\tresolvedBy: \"user\",\n\t\t});\n\t}\n\n\t/**\n\t * Deny a pending request. Called by UI or API when user denies.\n\t * @returns true if request was found and resolved, false if not pending\n\t */\n\tdeny(id: string, reason?: string): boolean {\n\t\treturn this.resolve(id, {\n\t\t\tapproved: false,\n\t\t\treason: reason ?? \"Denied\",\n\t\t\tresolvedBy: \"user\",\n\t\t});\n\t}\n\n\t/**\n\t * Resolve a pending request with an explicit decision.\n\t * Used by remote/server adapters that need policy-driven cancellation.\n\t */\n\tresolve(id: string, decision: ActionApprovalDecision): boolean {\n\t\treturn this.resolveEntry(id, decision);\n\t}\n\n\t/**\n\t * Clear all pending requests with a denial.\n\t * Called when the session ends or is reset.\n\t */\n\tclearPending(reason = \"Approval cancelled\"): void {\n\t\tfor (const id of Array.from(this.pending.keys())) {\n\t\t\tthis.resolve(id, {\n\t\t\t\tapproved: false,\n\t\t\t\treason: reason,\n\t\t\t\tresolvedBy: \"policy\",\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Get all currently pending approval requests.\n\t * Used by UI to display approval prompts.\n\t */\n\tgetPendingRequests(): ActionApprovalRequest[] {\n\t\treturn Array.from(this.pending.values()).map((entry) => entry.request);\n\t}\n\n\t/**\n\t * Internal helper to resolve a pending entry with a decision.\n\t * Handles cleanup and removal from pending map.\n\t */\n\tprivate resolveEntry(id: string, decision: ActionApprovalDecision): boolean {\n\t\tconst entry = this.pending.get(id);\n\t\tif (!entry) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.pending.delete(id);\n\t\tentry.resolve(decision);\n\t\treturn true;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"action-approval.js","sourceRoot":"","sources":["../../src/agent/action-approval.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA+J5D;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAqB;IAIjC,YACS,OAAqB,QAAQ,EAClB,QAAe,WAAW;QADrC,SAAI,GAAJ,IAAI,CAAyB;QAClB,UAAK,GAAL,KAAK,CAAqB;QAL9C,2DAA2D;QACnD,YAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAK/C,CAAC;IAEJ,0CAA0C;IAC1C,OAAO,CAAC,IAAkB;QACzB,IAAI,CAAC,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O,QAAQ,CAAC,YAAY,KAAK,SAAS;YACzC,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC,GAAG,EAAE,EAAE;YAC5C,CAAC,CAAC,QAAQ,CAAC;IACb,CAAC;CACD","sourcesContent":["import type { GuardedFilesPolicySettings } from \"@evalops/contracts\";\nimport { type Clock, systemClock } from \"../utils/clock.js\";\n\n/**\n * Action Approval System\n *\n * This module implements the approval workflow for risky tool executions.\n * When tools are flagged as requiring approval (by the action firewall or\n * tool configuration), this system manages the approval lifecycle.\n *\n * Three approval modes are supported:\n * - auto: Automatically approve all requests (for trusted/automated workflows)\n * - prompt: Queue requests and wait for user decision (default for interactive)\n * - fail: Automatically reject all requests (for strict security contexts)\n *\n * The approval flow:\n * 1. Agent prepares a tool call\n * 2. Action firewall evaluates and may require approval\n * 3. ActionApprovalService.requestApproval() is called\n * 4. In \"prompt\" mode, request is queued and awaits user decision\n * 5. User approves/denies via the UI or API\n * 6. Decision is returned to the agent to proceed or abort\n */\n\n/** Determines how approval requests are handled */\nexport type ApprovalMode = \"auto\" | \"prompt\" | \"fail\";\n\n/**\n * Represents a pending approval request for a tool execution.\n */\nexport interface ActionApprovalRequest {\n\t/** Unique identifier for this request */\n\tid: string;\n\t/** Name of the tool requesting approval */\n\ttoolName: string;\n\t/** Optional human-facing label for the tool */\n\tdisplayName?: string;\n\t/** Optional compact summary of the requested action */\n\tsummaryLabel?: string;\n\t/** Optional present-tense action description for approval UI */\n\tactionDescription?: string;\n\t/** Arguments the tool will be called with */\n\targs: unknown;\n\t/** Human-readable reason why approval is required */\n\treason: string;\n\t/** Unix timestamp in milliseconds when this approval lifecycle was emitted */\n\tstartedAtMs?: number;\n\t/** Optional Platform correlation for shared approval and audit surfaces */\n\tplatform?: {\n\t\tsource: \"approvals_service\" | \"tool_execution\";\n\t\ttoolExecutionId?: string;\n\t\tapprovalRequestId?: string;\n\t};\n}\n\n/**\n * The decision made for an approval request.\n */\nexport interface ActionApprovalDecision {\n\t/** Whether the action was approved */\n\tapproved: boolean;\n\t/** Optional explanation for the decision */\n\treason?: string;\n\t/** Who made the decision: automated policy or human user */\n\tresolvedBy: \"policy\" | \"user\";\n\t/** Unix timestamp in milliseconds when this approval lifecycle resolved */\n\tresolvedAtMs?: number;\n}\n\n/**\n * Serializable snapshot of PII tracking state.\n * Used to persist and restore workflow state across sessions.\n */\nexport interface WorkflowStateSnapshot {\n\t/** List of PII artifacts that are pending redaction */\n\tpendingPii: Array<{\n\t\tid: string;\n\t\tlabel: string;\n\t\tsourceToolCallId: string;\n\t\tredacted: boolean;\n\t\tparents?: string[];\n\t}>;\n\t/** Artifact IDs that were redacted but never captured (indicates bugs) */\n\torphanedRedactions: string[];\n}\n\n/**\n * Full context provided to the action firewall for approval decisions.\n * Includes the action itself plus ambient context about the workflow.\n */\nexport interface ActionApprovalContext {\n\t/** Name of the tool being executed */\n\ttoolName: string;\n\t/** Arguments for the tool call */\n\targs: unknown;\n\t/** Additional metadata for policy evaluation */\n\tmetadata?: {\n\t\t/** Current PII tracking state for data protection policies */\n\t\tworkflowState?: WorkflowStateSnapshot;\n\t\t/** MCP tool annotations that hint at tool behavior */\n\t\tannotations?: {\n\t\t\t/** Tool only reads data, doesn't modify state */\n\t\t\treadOnlyHint?: boolean;\n\t\t\t/** Tool may cause irreversible changes */\n\t\t\tdestructiveHint?: boolean;\n\t\t\t/** Tool can be safely retried */\n\t\t\tidempotentHint?: boolean;\n\t\t\t/** Tool interacts with external/untrusted systems */\n\t\t\topenWorldHint?: boolean;\n\t\t};\n\t\t/** User/org guarded-files override policy for this run */\n\t\tguardedFiles?: GuardedFilesPolicySettings;\n\t};\n\t/** User context for permission-based policies */\n\tuser?: {\n\t\tid: string;\n\t\torgId: string;\n\t};\n\t/** Session context for time/scope-based policies */\n\tsession?: {\n\t\tid: string;\n\t\tstartedAt: Date;\n\t};\n\t/** The user's original request (for intent-matching policies) */\n\tuserIntent?: string;\n}\n\n/**\n * Verdict from the action firewall after evaluating a tool call.\n *\n * - allow: Tool can proceed without approval\n * - require_approval: Tool needs user approval before execution\n * - block: Tool is denied and cannot be executed\n */\nexport type ActionFirewallVerdict =\n\t| { action: \"allow\" }\n\t| { action: \"require_approval\"; ruleId: string; reason: string }\n\t| {\n\t\t\taction: \"block\";\n\t\t\truleId: string;\n\t\t\treason: string;\n\t\t\t/** Suggested steps to resolve the block */\n\t\t\tremediation?: string;\n\t };\n\n/**\n * Internal entry for a pending approval request.\n * Stores the promise resolver and cleanup callback.\n */\ntype PendingEntry = {\n\t/** The approval request details */\n\trequest: ActionApprovalRequest;\n\t/** Resolver function to complete the approval promise */\n\tresolve: (decision: ActionApprovalDecision) => void;\n\t/** Stamps the decision using the request's time source */\n\tstampResolvedAt: (decision: ActionApprovalDecision) => ActionApprovalDecision;\n\t/** Cleanup callback to remove abort listeners */\n\tcleanup?: () => void;\n};\n\n/**\n * Manages the approval workflow for risky tool executions.\n *\n * In \"prompt\" mode, this service queues approval requests and returns\n * a promise that resolves when the user makes a decision. The UI/API\n * can call approve() or deny() to resolve pending requests.\n *\n * The service also handles abort signals to clean up pending requests\n * when the agent run is cancelled.\n */\nexport class ActionApprovalService {\n\t/** Map of request ID -> pending entry awaiting decision */\n\tprivate pending = new Map<string, PendingEntry>();\n\n\tconstructor(\n\t\tprivate mode: ApprovalMode = \"prompt\",\n\t\tprotected readonly clock: Clock = systemClock,\n\t) {}\n\n\t/** Update the approval mode at runtime */\n\tsetMode(mode: ApprovalMode): void {\n\t\tthis.mode = mode;\n\t}\n\n\t/** Get the current approval mode */\n\tgetMode(): ApprovalMode {\n\t\treturn this.mode;\n\t}\n\n\t/** Check if this mode requires user interaction (UI should show prompts) */\n\trequiresUserInteraction(): boolean {\n\t\treturn this.mode === \"prompt\";\n\t}\n\n\t/**\n\t * Request approval for an action.\n\t *\n\t * Behavior depends on the current mode:\n\t * - auto: Immediately returns approved\n\t * - fail: Immediately returns denied\n\t * - prompt: Queues request and waits for user decision\n\t *\n\t * @param request - The approval request details\n\t * @param signal - Optional abort signal to cancel the request\n\t * @returns Promise that resolves with the approval decision\n\t */\n\tasync requestApproval(\n\t\trequest: ActionApprovalRequest,\n\t\tsignal?: AbortSignal,\n\t\tclock: Pick<Clock, \"now\"> = this.clock,\n\t): Promise<ActionApprovalDecision> {\n\t\t// Fast path for auto mode - no queuing needed\n\t\tif (this.mode === \"auto\") {\n\t\t\treturn this.withResolvedAt(\n\t\t\t\t{\n\t\t\t\t\tapproved: true,\n\t\t\t\t\treason: \"Auto-approved by policy\",\n\t\t\t\t\tresolvedBy: \"policy\",\n\t\t\t\t},\n\t\t\t\tclock,\n\t\t\t);\n\t\t}\n\n\t\t// Fast path for fail mode - immediate rejection\n\t\tif (this.mode === \"fail\") {\n\t\t\treturn this.withResolvedAt(\n\t\t\t\t{\n\t\t\t\t\tapproved: false,\n\t\t\t\t\treason: \"Denied by approval policy\",\n\t\t\t\t\tresolvedBy: \"policy\",\n\t\t\t\t},\n\t\t\t\tclock,\n\t\t\t);\n\t\t}\n\n\t\t// Check if already aborted before queuing\n\t\tif (signal?.aborted) {\n\t\t\treturn this.withResolvedAt(\n\t\t\t\t{\n\t\t\t\t\tapproved: false,\n\t\t\t\t\treason: \"Run aborted\",\n\t\t\t\t\tresolvedBy: \"policy\",\n\t\t\t\t},\n\t\t\t\tclock,\n\t\t\t);\n\t\t}\n\n\t\t// Prompt mode: queue the request and wait for user decision\n\t\treturn await new Promise<ActionApprovalDecision>((resolve) => {\n\t\t\tconst entry: PendingEntry = {\n\t\t\t\trequest,\n\t\t\t\tresolve: () => {}, // Placeholder, replaced below\n\t\t\t\tstampResolvedAt: (decision) => this.withResolvedAt(decision, clock),\n\t\t\t};\n\n\t\t\t// Wrap resolver to ensure cleanup on resolution\n\t\t\tentry.resolve = (decision) => {\n\t\t\t\tentry.cleanup?.();\n\t\t\t\tresolve(decision);\n\t\t\t};\n\n\t\t\t// Set up abort handling to auto-deny if the run is cancelled\n\t\t\tif (signal) {\n\t\t\t\tconst onAbort = () => {\n\t\t\t\t\tif (!this.pending.has(request.id)) return;\n\t\t\t\t\tthis.pending.delete(request.id);\n\t\t\t\t\tentry.resolve(\n\t\t\t\t\t\tentry.stampResolvedAt({\n\t\t\t\t\t\t\tapproved: false,\n\t\t\t\t\t\t\treason: \"Run aborted\",\n\t\t\t\t\t\t\tresolvedBy: \"policy\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t\tentry.cleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\t\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t\t}\n\n\t\t\t// Add to pending map - UI can query this to show approval prompts\n\t\t\tthis.pending.set(request.id, entry);\n\t\t});\n\t}\n\n\t/**\n\t * Approve a pending request. Called by UI or API when user approves.\n\t * @returns true if request was found and resolved, false if not pending\n\t */\n\tapprove(id: string, note?: string): boolean {\n\t\treturn this.resolve(id, {\n\t\t\tapproved: true,\n\t\t\treason: note ?? \"Approved\",\n\t\t\tresolvedBy: \"user\",\n\t\t});\n\t}\n\n\t/**\n\t * Deny a pending request. Called by UI or API when user denies.\n\t * @returns true if request was found and resolved, false if not pending\n\t */\n\tdeny(id: string, reason?: string): boolean {\n\t\treturn this.resolve(id, {\n\t\t\tapproved: false,\n\t\t\treason: reason ?? \"Denied\",\n\t\t\tresolvedBy: \"user\",\n\t\t});\n\t}\n\n\t/**\n\t * Resolve a pending request with an explicit decision.\n\t * Used by remote/server adapters that need policy-driven cancellation.\n\t */\n\tresolve(id: string, decision: ActionApprovalDecision): boolean {\n\t\treturn this.resolveEntry(id, decision);\n\t}\n\n\t/**\n\t * Clear all pending requests with a denial.\n\t * Called when the session ends or is reset.\n\t */\n\tclearPending(reason = \"Approval cancelled\"): void {\n\t\tfor (const id of Array.from(this.pending.keys())) {\n\t\t\tthis.resolve(id, {\n\t\t\t\tapproved: false,\n\t\t\t\treason: reason,\n\t\t\t\tresolvedBy: \"policy\",\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Get all currently pending approval requests.\n\t * Used by UI to display approval prompts.\n\t */\n\tgetPendingRequests(): ActionApprovalRequest[] {\n\t\treturn Array.from(this.pending.values()).map((entry) => entry.request);\n\t}\n\n\t/**\n\t * Internal helper to resolve a pending entry with a decision.\n\t * Handles cleanup and removal from pending map.\n\t */\n\tprivate resolveEntry(id: string, decision: ActionApprovalDecision): boolean {\n\t\tconst entry = this.pending.get(id);\n\t\tif (!entry) {\n\t\t\treturn false;\n\t\t}\n\t\tthis.pending.delete(id);\n\t\tentry.resolve(entry.stampResolvedAt(decision));\n\t\treturn true;\n\t}\n\n\tprotected withResolvedAt(\n\t\tdecision: ActionApprovalDecision,\n\t\tclock: Pick<Clock, \"now\"> = this.clock,\n\t): ActionApprovalDecision {\n\t\treturn decision.resolvedAtMs === undefined\n\t\t\t? { ...decision, resolvedAtMs: clock.now() }\n\t\t\t: decision;\n\t}\n}\n"]}
|
package/dist/agent/agent.d.ts
CHANGED
|
@@ -485,6 +485,7 @@ export declare class Agent {
|
|
|
485
485
|
private enqueueFollowUpMessageSync;
|
|
486
486
|
private primeToolBatch;
|
|
487
487
|
private emitToolBatchSummary;
|
|
488
|
+
private handleToolPhaseSummary;
|
|
488
489
|
private resolvePendingToolCalls;
|
|
489
490
|
generateSummary(history: Message[], prompt: string, systemPrompt?: string, modelOverride?: Model<Api>, signal?: AbortSignal): Promise<AssistantMessage>;
|
|
490
491
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agent/agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AAwBH,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACN,KAAK,oBAAoB,EAGzB,MAAM,0BAA0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chSummaryMessage(summaryLabels) {
|
|
|
245
245
|
timestamp: Date.now(),
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
|
+
function buildPromptOnlyBatchShapingFeedbackMessage(hint) {
|
|
249
|
+
return {
|
|
250
|
+
role: "user",
|
|
251
|
+
content: [
|
|
252
|
+
{
|
|
253
|
+
type: "text",
|
|
254
|
+
text: `The following is transient tool batching feedback for the next assistant turn:\n- ${hint}`,
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
timestamp: Date.now(),
|
|
258
|
+
};
|
|
259
|
+
}
|
|
248
260
|
/**
|
|
249
261
|
* Ensures prior assistant messages remain provider-compatible when switching models mid-session.
|
|
250
262
|
*
|
|
@@ -1331,6 +1343,10 @@ export class Agent {
|
|
|
1331
1343
|
else if (event.type === "tool_execution_end") {
|
|
1332
1344
|
this.handleToolExecutionEnd(event);
|
|
1333
1345
|
}
|
|
1346
|
+
else if (event.type === "tool_phase_summary") {
|
|
1347
|
+
this.handleToolPhaseSummary(event);
|
|
1348
|
+
this.emit(event);
|
|
1349
|
+
}
|
|
1334
1350
|
else if (event.type === "turn_end") {
|
|
1335
1351
|
if (this.shouldWithholdRecoverableOverflowError(event.message) ||
|
|
1336
1352
|
(isAssistantMessage(event.message) &&
|
|
@@ -1511,6 +1527,10 @@ export class Agent {
|
|
|
1511
1527
|
else if (event.type === "tool_execution_end") {
|
|
1512
1528
|
this.handleToolExecutionEnd(event);
|
|
1513
1529
|
}
|
|
1530
|
+
else if (event.type === "tool_phase_summary") {
|
|
1531
|
+
this.handleToolPhaseSummary(event);
|
|
1532
|
+
this.emit(event);
|
|
1533
|
+
}
|
|
1514
1534
|
else if (event.type === "turn_end") {
|
|
1515
1535
|
if (this.shouldWithholdRecoverableOverflowError(event.message) ||
|
|
1516
1536
|
(isAssistantMessage(event.message) &&
|
|
@@ -1933,6 +1953,12 @@ export class Agent {
|
|
|
1933
1953
|
this.promptOnlyQueue.push(buildPromptOnlyToolBatchSummaryMessage(summaryLabels));
|
|
1934
1954
|
}
|
|
1935
1955
|
}
|
|
1956
|
+
handleToolPhaseSummary(event) {
|
|
1957
|
+
const feedback = event.batchShapingFeedback;
|
|
1958
|
+
if (feedback?.avoidableSingleton && feedback.hint.trim().length > 0) {
|
|
1959
|
+
this.promptOnlyQueue.push(buildPromptOnlyBatchShapingFeedbackMessage(feedback.hint.trim()));
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1936
1962
|
resolvePendingToolCalls(reason) {
|
|
1937
1963
|
for (const [toolCallId, info] of this._state.pendingToolCalls.entries()) {
|
|
1938
1964
|
const abortedResult = {
|