@evalops/maestro 0.10.8 → 0.10.10
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 +3 -1
- package/dist/agent/action-approval.d.ts +6 -0
- package/dist/agent/action-approval.d.ts.map +1 -1
- package/dist/agent/action-approval.js.map +1 -1
- package/dist/agent/agent.d.ts +13 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +368 -1
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/auto-compaction.d.ts +4 -4
- package/dist/agent/auto-compaction.d.ts.map +1 -1
- package/dist/agent/auto-compaction.js.map +1 -1
- package/dist/agent/compaction-cleanup.d.ts +2 -0
- package/dist/agent/compaction-cleanup.d.ts.map +1 -1
- package/dist/agent/compaction-cleanup.js +17 -2
- package/dist/agent/compaction-cleanup.js.map +1 -1
- package/dist/agent/compaction.d.ts +3 -1
- package/dist/agent/compaction.d.ts.map +1 -1
- package/dist/agent/compaction.js +10 -2
- package/dist/agent/compaction.js.map +1 -1
- package/dist/agent/context-manager.d.ts +4 -0
- package/dist/agent/context-manager.d.ts.map +1 -1
- package/dist/agent/context-manager.js +8 -0
- package/dist/agent/context-manager.js.map +1 -1
- package/dist/agent/context-providers.d.ts +2 -0
- package/dist/agent/context-providers.d.ts.map +1 -1
- package/dist/agent/context-providers.js +3 -2
- package/dist/agent/context-providers.js.map +1 -1
- package/dist/agent/providers/google-gemini-cli.js +17 -5
- package/dist/agent/providers/google.js +174 -144
- package/dist/agent/providers/openai-codex-responses.d.ts +4 -0
- package/dist/agent/providers/openai-codex-responses.d.ts.map +1 -0
- package/dist/agent/providers/openai-codex-responses.js +637 -0
- package/dist/agent/providers/openai-codex-responses.js.map +1 -0
- package/dist/agent/providers/openai-codex-session.d.ts +18 -0
- package/dist/agent/providers/openai-codex-session.d.ts.map +1 -0
- package/dist/agent/providers/openai-codex-session.js +53 -0
- package/dist/agent/providers/openai-codex-session.js.map +1 -0
- package/dist/agent/providers/openai-responses-sdk.d.ts.map +1 -1
- package/dist/agent/providers/openai-responses-sdk.js +16 -6
- package/dist/agent/providers/openai-responses-sdk.js.map +1 -1
- package/dist/agent/providers/openai-shared.d.ts +12 -5
- package/dist/agent/providers/openai-shared.d.ts.map +1 -1
- package/dist/agent/providers/openai-shared.js +291 -2
- package/dist/agent/providers/openai-shared.js.map +1 -1
- package/dist/agent/providers/openai.d.ts +1 -1
- package/dist/agent/providers/openai.d.ts.map +1 -1
- package/dist/agent/providers/openai.js +48 -20
- package/dist/agent/providers/openai.js.map +1 -1
- package/dist/agent/providers/vertex.js +7 -0
- package/dist/agent/tracing.d.ts +16 -5
- package/dist/agent/tracing.d.ts.map +1 -1
- package/dist/agent/tracing.js +44 -2
- 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 +9 -0
- package/dist/agent/transport/create-provider-stream.js.map +1 -1
- package/dist/agent/transport/tool-execution-bridge.d.ts +86 -0
- package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -0
- package/dist/agent/transport/tool-execution-bridge.js +665 -0
- package/dist/agent/transport/tool-execution-bridge.js.map +1 -0
- package/dist/agent/transport/tool-execution.d.ts +3 -0
- package/dist/agent/transport/tool-execution.d.ts.map +1 -1
- package/dist/agent/transport/tool-execution.js +16 -1
- package/dist/agent/transport/tool-execution.js.map +1 -1
- package/dist/agent/transport/tool-safety-pipeline.d.ts +7 -1
- package/dist/agent/transport/tool-safety-pipeline.d.ts.map +1 -1
- package/dist/agent/transport/tool-safety-pipeline.js +207 -40
- package/dist/agent/transport/tool-safety-pipeline.js.map +1 -1
- package/dist/agent/transport/tool-update-queue.d.ts +2 -0
- package/dist/agent/transport/tool-update-queue.d.ts.map +1 -1
- package/dist/agent/transport/tool-update-queue.js.map +1 -1
- package/dist/agent/transport.d.ts +3 -0
- package/dist/agent/transport.d.ts.map +1 -1
- package/dist/agent/transport.js +96 -16
- package/dist/agent/transport.js.map +1 -1
- package/dist/agent/types.d.ts +50 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/approvals/platform-action-approval.d.ts +32 -0
- package/dist/approvals/platform-action-approval.d.ts.map +1 -0
- package/dist/approvals/platform-action-approval.js +210 -0
- package/dist/approvals/platform-action-approval.js.map +1 -0
- package/dist/approvals/service-client.d.ts +56 -0
- package/dist/approvals/service-client.d.ts.map +1 -0
- package/dist/approvals/service-client.js +316 -0
- package/dist/approvals/service-client.js.map +1 -0
- package/dist/audit/logger.d.ts +4 -4
- package/dist/bootstrap/auth-setup.d.ts +2 -2
- package/dist/bootstrap/auth-setup.d.ts.map +1 -1
- package/dist/bootstrap/auth-setup.js +4 -7
- package/dist/bootstrap/auth-setup.js.map +1 -1
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +28 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/codex.d.ts +2 -0
- package/dist/cli/commands/codex.d.ts.map +1 -0
- package/dist/cli/commands/codex.js +65 -0
- package/dist/cli/commands/codex.js.map +1 -0
- package/dist/cli/commands/config.js +1 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/evalops.d.ts +2 -0
- package/dist/cli/commands/evalops.d.ts.map +1 -0
- package/dist/cli/commands/evalops.js +69 -0
- package/dist/cli/commands/evalops.js.map +1 -0
- package/dist/cli/commands/hosted-runner.d.ts +23 -0
- package/dist/cli/commands/hosted-runner.d.ts.map +1 -0
- package/dist/cli/commands/hosted-runner.js +241 -0
- package/dist/cli/commands/hosted-runner.js.map +1 -0
- package/dist/cli/commands/memory.d.ts.map +1 -1
- package/dist/cli/commands/memory.js +23 -30
- package/dist/cli/commands/memory.js.map +1 -1
- package/dist/cli/commands/remote.d.ts +3 -0
- package/dist/cli/commands/remote.d.ts.map +1 -0
- package/dist/cli/commands/remote.js +631 -0
- package/dist/cli/commands/remote.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +7 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +167 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/headless-protocol.d.ts +16 -1
- package/dist/cli/headless-protocol.d.ts.map +1 -1
- package/dist/cli/headless-protocol.js +60 -4
- package/dist/cli/headless-protocol.js.map +1 -1
- package/dist/cli/headless.d.ts.map +1 -1
- package/dist/cli/headless.js +1 -0
- package/dist/cli/headless.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +36 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/jsonl-writer.d.ts.map +1 -1
- package/dist/cli/jsonl-writer.js +19 -6
- package/dist/cli/jsonl-writer.js.map +1 -1
- package/dist/cli-tui/client-tools/client-tool-controller.d.ts.map +1 -1
- package/dist/cli-tui/client-tools/client-tool-controller.js +17 -1
- package/dist/cli-tui/client-tools/client-tool-controller.js.map +1 -1
- package/dist/cli-tui/commands/access-command.js +1 -1
- package/dist/cli-tui/commands/access-command.js.map +1 -1
- package/dist/cli-tui/commands/audit-command.js +1 -1
- package/dist/cli-tui/commands/audit-command.js.map +1 -1
- package/dist/cli-tui/commands/command-catalog.d.ts +29 -0
- package/dist/cli-tui/commands/command-catalog.d.ts.map +1 -0
- package/dist/cli-tui/commands/command-catalog.js +645 -0
- package/dist/cli-tui/commands/command-catalog.js.map +1 -0
- package/dist/cli-tui/commands/command-registry-adapter.d.ts +12 -0
- package/dist/cli-tui/commands/command-registry-adapter.d.ts.map +1 -0
- package/dist/cli-tui/commands/command-registry-adapter.js +120 -0
- package/dist/cli-tui/commands/command-registry-adapter.js.map +1 -0
- package/dist/cli-tui/commands/command-suite-catalog.d.ts +14 -0
- package/dist/cli-tui/commands/command-suite-catalog.d.ts.map +1 -0
- package/dist/cli-tui/commands/command-suite-catalog.js +147 -0
- package/dist/cli-tui/commands/command-suite-catalog.js.map +1 -0
- package/dist/cli-tui/commands/{grouped-command-handlers.d.ts → command-suite-handlers.d.ts} +27 -26
- package/dist/cli-tui/commands/command-suite-handlers.d.ts.map +1 -0
- package/dist/cli-tui/commands/command-suite-handlers.js +110 -0
- package/dist/cli-tui/commands/command-suite-handlers.js.map +1 -0
- package/dist/cli-tui/commands/hotkeys-command.d.ts +1 -1
- package/dist/cli-tui/commands/hotkeys-command.d.ts.map +1 -1
- package/dist/cli-tui/commands/hotkeys-command.js +2 -2
- package/dist/cli-tui/commands/hotkeys-command.js.map +1 -1
- package/dist/cli-tui/commands/limits-command.js +1 -1
- package/dist/cli-tui/commands/limits-command.js.map +1 -1
- package/dist/cli-tui/commands/pii-command.js +1 -1
- package/dist/cli-tui/commands/pii-command.js.map +1 -1
- package/dist/cli-tui/commands/registry.d.ts +1 -1
- package/dist/cli-tui/commands/registry.d.ts.map +1 -1
- package/dist/cli-tui/commands/registry.js +29 -921
- package/dist/cli-tui/commands/registry.js.map +1 -1
- package/dist/cli-tui/commands/{grouped → subcommands}/auth-commands.d.ts +2 -1
- package/dist/cli-tui/commands/subcommands/auth-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/auth-commands.js +22 -6
- package/dist/cli-tui/commands/subcommands/auth-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/config-commands.d.ts +0 -1
- package/dist/cli-tui/commands/subcommands/config-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/config-commands.js +2 -2
- package/dist/cli-tui/commands/subcommands/config-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/diag-commands.d.ts +1 -2
- package/dist/cli-tui/commands/subcommands/diag-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/diag-commands.js +5 -7
- package/dist/cli-tui/commands/subcommands/diag-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/git-commands.d.ts +0 -2
- package/dist/cli-tui/commands/subcommands/git-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/git-commands.js +2 -2
- package/dist/cli-tui/commands/subcommands/git-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/index.d.ts +2 -2
- package/dist/cli-tui/commands/subcommands/index.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/index.js +2 -2
- package/dist/cli-tui/commands/subcommands/index.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/safety-commands.d.ts +0 -1
- package/dist/cli-tui/commands/subcommands/safety-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/safety-commands.js +12 -12
- package/dist/cli-tui/commands/subcommands/safety-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/session-commands.d.ts +1 -2
- package/dist/cli-tui/commands/subcommands/session-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/session-commands.js +3 -3
- package/dist/cli-tui/commands/subcommands/session-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/tools-commands.d.ts +0 -1
- package/dist/cli-tui/commands/subcommands/tools-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/tools-commands.js +2 -2
- package/dist/cli-tui/commands/subcommands/tools-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/ui-commands.d.ts +0 -1
- package/dist/cli-tui/commands/subcommands/ui-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/ui-commands.js +5 -5
- package/dist/cli-tui/commands/subcommands/ui-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/undo-commands.d.ts +1 -2
- package/dist/cli-tui/commands/subcommands/undo-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/undo-commands.js +6 -6
- package/dist/cli-tui/commands/subcommands/undo-commands.js.map +1 -0
- package/dist/cli-tui/commands/subcommands/usage-commands.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/usage-commands.js +2 -2
- package/dist/cli-tui/commands/subcommands/usage-commands.js.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/utils.d.ts +15 -15
- package/dist/cli-tui/commands/subcommands/utils.d.ts.map +1 -0
- package/dist/cli-tui/commands/{grouped → subcommands}/utils.js +13 -8
- package/dist/cli-tui/commands/subcommands/utils.js.map +1 -0
- package/dist/cli-tui/commands/types.d.ts +3 -3
- 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/editor-view.d.ts +1 -1
- package/dist/cli-tui/editor-view.d.ts.map +1 -1
- package/dist/cli-tui/editor-view.js +1 -1
- package/dist/cli-tui/editor-view.js.map +1 -1
- package/dist/cli-tui/oauth/oauth-flow-controller.d.ts +4 -0
- package/dist/cli-tui/oauth/oauth-flow-controller.d.ts.map +1 -1
- package/dist/cli-tui/oauth/oauth-flow-controller.js +76 -5
- package/dist/cli-tui/oauth/oauth-flow-controller.js.map +1 -1
- package/dist/cli-tui/run/run-controller.d.ts +2 -2
- package/dist/cli-tui/run/run-controller.d.ts.map +1 -1
- package/dist/cli-tui/run/run-controller.js +3 -2
- package/dist/cli-tui/run/run-controller.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 +11 -3
- 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 +11 -3
- package/dist/cli-tui/run/streaming-shell-command.js.map +1 -1
- package/dist/cli-tui/selectors/model-selector.d.ts.map +1 -1
- package/dist/cli-tui/selectors/model-selector.js +1 -0
- package/dist/cli-tui/selectors/model-selector.js.map +1 -1
- package/dist/cli-tui/tui-renderer/agent-event-bridge.d.ts +8 -0
- package/dist/cli-tui/tui-renderer/agent-event-bridge.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer/agent-event-bridge.js +23 -2
- package/dist/cli-tui/tui-renderer/agent-event-bridge.js.map +1 -1
- package/dist/cli-tui/tui-renderer/command-registry-options.d.ts +3 -3
- package/dist/cli-tui/tui-renderer/command-registry-options.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer/command-registry-options.js +12 -2
- package/dist/cli-tui/tui-renderer/command-registry-options.js.map +1 -1
- package/dist/cli-tui/tui-renderer/command-suite-wiring.d.ts +32 -0
- package/dist/cli-tui/tui-renderer/command-suite-wiring.d.ts.map +1 -0
- package/dist/cli-tui/tui-renderer/command-suite-wiring.js +108 -0
- package/dist/cli-tui/tui-renderer/command-suite-wiring.js.map +1 -0
- package/dist/cli-tui/tui-renderer/input-controller.d.ts +2 -2
- package/dist/cli-tui/tui-renderer/input-controller.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer/input-controller.js +2 -2
- package/dist/cli-tui/tui-renderer/input-controller.js.map +1 -1
- package/dist/cli-tui/tui-renderer/ui-state-controller.d.ts +1 -1
- package/dist/cli-tui/tui-renderer/ui-state-controller.js +1 -1
- package/dist/cli-tui/tui-renderer/ui-state-controller.js.map +1 -1
- package/dist/cli-tui/tui-renderer.d.ts +1 -3
- package/dist/cli-tui/tui-renderer.d.ts.map +1 -1
- package/dist/cli-tui/tui-renderer.js +37 -83
- package/dist/cli-tui/tui-renderer.js.map +1 -1
- package/dist/cli-tui/utils/runtime-badges.d.ts +8 -0
- package/dist/cli-tui/utils/runtime-badges.d.ts.map +1 -1
- package/dist/cli-tui/utils/runtime-badges.js +58 -0
- package/dist/cli-tui/utils/runtime-badges.js.map +1 -1
- package/dist/cli.js +41771 -22892
- package/dist/cli.js.map +1 -1
- package/dist/config/env-vars.d.ts +4 -0
- package/dist/config/env-vars.d.ts.map +1 -1
- package/dist/config/env-vars.js +4 -0
- package/dist/config/env-vars.js.map +1 -1
- package/dist/config/feature-flags.d.ts +44 -0
- package/dist/config/feature-flags.d.ts.map +1 -1
- package/dist/config/feature-flags.js +214 -0
- package/dist/config/feature-flags.js.map +1 -1
- package/dist/connectors/service-client.d.ts +98 -0
- package/dist/connectors/service-client.d.ts.map +1 -0
- package/dist/connectors/service-client.js +459 -0
- package/dist/connectors/service-client.js.map +1 -0
- package/dist/conversation/render-model.d.ts.map +1 -1
- package/dist/conversation/render-model.js +53 -3
- package/dist/conversation/render-model.js.map +1 -1
- package/dist/db/health.d.ts +8 -0
- package/dist/db/health.d.ts.map +1 -0
- package/dist/db/health.js +64 -0
- package/dist/db/health.js.map +1 -0
- package/dist/db/migrate.d.ts +301 -0
- package/dist/db/migrate.d.ts.map +1 -1
- package/dist/db/migrate.js +186 -0
- package/dist/db/migrate.js.map +1 -1
- package/dist/db/migrations/0000_initial.sql +308 -0
- package/dist/db/migrations/0001_shared_sessions.sql +18 -0
- package/dist/db/migrations/0002_usage_metrics.sql +28 -0
- package/dist/db/migrations/0003_execution_traces.sql +18 -0
- package/dist/db/migrations/0004_workspace_config.sql +11 -0
- package/dist/db/migrations/0005_revenue_attribution.sql +31 -0
- package/dist/db/migrations/0006_hosted_session_storage.sql +51 -0
- package/dist/db/migrations/0007_reconcile_legacy_audit_hash_cache.sql +24 -0
- package/dist/db/migrations/0008_reconcile_legacy_webhook_deliveries.sql +290 -0
- package/dist/db/migrations/meta/0000_snapshot.json +2438 -0
- package/dist/db/migrations/meta/_journal.json +69 -0
- package/dist/db/schema.d.ts +2232 -844
- package/dist/db/schema.d.ts.map +1 -1
- package/dist/db/schema.js +187 -1
- package/dist/db/schema.js.map +1 -1
- package/dist/export-html.d.ts.map +1 -1
- package/dist/export-html.js +7 -4
- package/dist/export-html.js.map +1 -1
- package/dist/headless/utility-command-manager.d.ts +2 -1
- package/dist/headless/utility-command-manager.d.ts.map +1 -1
- package/dist/headless/utility-command-manager.js +12 -6
- package/dist/headless/utility-command-manager.js.map +1 -1
- package/dist/headless/utility-file-read.d.ts +1 -0
- package/dist/headless/utility-file-read.d.ts.map +1 -1
- package/dist/headless/utility-file-read.js +5 -1
- package/dist/headless/utility-file-read.js.map +1 -1
- package/dist/headless/utility-file-search.d.ts +1 -0
- package/dist/headless/utility-file-search.d.ts.map +1 -1
- package/dist/headless/utility-file-search.js +4 -1
- package/dist/headless/utility-file-search.js.map +1 -1
- package/dist/headless/utility-file-watch-manager.d.ts +2 -1
- package/dist/headless/utility-file-watch-manager.d.ts.map +1 -1
- package/dist/headless/utility-file-watch-manager.js +6 -2
- package/dist/headless/utility-file-watch-manager.js.map +1 -1
- package/dist/headless/workspace-root.d.ts +8 -0
- package/dist/headless/workspace-root.d.ts.map +1 -0
- package/dist/headless/workspace-root.js +74 -0
- package/dist/headless/workspace-root.js.map +1 -0
- package/dist/hooks/notification-hooks.d.ts +5 -0
- package/dist/hooks/notification-hooks.d.ts.map +1 -1
- package/dist/hooks/notification-hooks.js +4 -0
- package/dist/hooks/notification-hooks.js.map +1 -1
- package/dist/lsp/diagnostic-deltas.d.ts +20 -0
- package/dist/lsp/diagnostic-deltas.d.ts.map +1 -0
- package/dist/lsp/diagnostic-deltas.js +92 -0
- package/dist/lsp/diagnostic-deltas.js.map +1 -0
- package/dist/lsp/diagnostic-repair.d.ts +48 -0
- package/dist/lsp/diagnostic-repair.d.ts.map +1 -0
- package/dist/lsp/diagnostic-repair.js +143 -0
- package/dist/lsp/diagnostic-repair.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +122 -37
- package/dist/main.js.map +1 -1
- package/dist/mcp/config.d.ts +4 -2
- package/dist/mcp/config.d.ts.map +1 -1
- package/dist/mcp/config.js +58 -14
- package/dist/mcp/config.js.map +1 -1
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/manager.d.ts +1 -0
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +1 -0
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/platform-plugin.d.ts +3 -0
- package/dist/mcp/platform-plugin.d.ts.map +1 -0
- package/dist/mcp/platform-plugin.js +83 -0
- package/dist/mcp/platform-plugin.js.map +1 -0
- package/dist/mcp/tool-bridge.d.ts +15 -0
- package/dist/mcp/tool-bridge.d.ts.map +1 -1
- package/dist/mcp/tool-bridge.js +194 -6
- package/dist/mcp/tool-bridge.js.map +1 -1
- package/dist/memory/platform-memory-client.d.ts +130 -0
- package/dist/memory/platform-memory-client.d.ts.map +1 -0
- package/dist/memory/platform-memory-client.js +330 -0
- package/dist/memory/platform-memory-client.js.map +1 -0
- package/dist/memory/service-client.d.ts.map +1 -1
- package/dist/memory/service-client.js +1 -2
- package/dist/memory/service-client.js.map +1 -1
- package/dist/models/builtin.d.ts.map +1 -1
- package/dist/models/builtin.js +137 -0
- 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 +1 -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/connectors.d.ts +25 -0
- package/dist/oauth/connectors.d.ts.map +1 -0
- package/dist/oauth/connectors.js +253 -0
- package/dist/oauth/connectors.js.map +1 -0
- package/dist/oauth/device-identity.d.ts +18 -0
- package/dist/oauth/device-identity.d.ts.map +1 -0
- package/dist/oauth/device-identity.js +193 -0
- package/dist/oauth/device-identity.js.map +1 -0
- package/dist/oauth/evalops.d.ts.map +1 -1
- package/dist/oauth/evalops.js +73 -14
- package/dist/oauth/evalops.js.map +1 -1
- package/dist/oauth/index.d.ts +1 -1
- package/dist/oauth/index.d.ts.map +1 -1
- package/dist/oauth/index.js +31 -1
- package/dist/oauth/index.js.map +1 -1
- package/dist/oauth/openai-codex.d.ts +16 -0
- package/dist/oauth/openai-codex.d.ts.map +1 -0
- package/dist/oauth/openai-codex.js +300 -0
- package/dist/oauth/openai-codex.js.map +1 -0
- package/dist/opentelemetry.d.ts.map +1 -1
- package/dist/opentelemetry.js +9 -2
- package/dist/opentelemetry.js.map +1 -1
- package/dist/platform/agent-runtime-client.d.ts +279 -0
- package/dist/platform/agent-runtime-client.d.ts.map +1 -0
- package/dist/platform/agent-runtime-client.js +515 -0
- package/dist/platform/agent-runtime-client.js.map +1 -0
- package/dist/platform/cerebro-facts-client.d.ts +56 -0
- package/dist/platform/cerebro-facts-client.d.ts.map +1 -0
- package/dist/platform/cerebro-facts-client.js +297 -0
- package/dist/platform/cerebro-facts-client.js.map +1 -0
- package/dist/platform/client.d.ts +2 -1
- package/dist/platform/client.d.ts.map +1 -1
- package/dist/platform/client.js +9 -26
- package/dist/platform/client.js.map +1 -1
- package/dist/platform/core-services.d.ts +128 -0
- package/dist/platform/core-services.d.ts.map +1 -1
- package/dist/platform/core-services.js +128 -0
- package/dist/platform/core-services.js.map +1 -1
- package/dist/platform/maestro-timeline-client.d.ts +22 -0
- package/dist/platform/maestro-timeline-client.d.ts.map +1 -0
- package/dist/platform/maestro-timeline-client.js +373 -0
- package/dist/platform/maestro-timeline-client.js.map +1 -0
- package/dist/platform/tool-execution-client.d.ts +104 -0
- package/dist/platform/tool-execution-client.d.ts.map +1 -0
- package/dist/platform/tool-execution-client.js +284 -0
- package/dist/platform/tool-execution-client.js.map +1 -0
- package/dist/prompts/service-client.d.ts.map +1 -1
- package/dist/prompts/service-client.js +5 -2
- package/dist/prompts/service-client.js.map +1 -1
- package/dist/providers/anthropic-auth.d.ts.map +1 -1
- package/dist/providers/anthropic-auth.js +8 -6
- package/dist/providers/anthropic-auth.js.map +1 -1
- package/dist/providers/api-keys.d.ts +1 -0
- package/dist/providers/api-keys.d.ts.map +1 -1
- package/dist/providers/api-keys.js +5 -0
- package/dist/providers/api-keys.js.map +1 -1
- package/dist/providers/auth.d.ts +2 -1
- package/dist/providers/auth.d.ts.map +1 -1
- package/dist/providers/auth.js +26 -3
- package/dist/providers/auth.js.map +1 -1
- package/dist/remote-runner/attach-client.d.ts +41 -0
- package/dist/remote-runner/attach-client.d.ts.map +1 -0
- package/dist/remote-runner/attach-client.js +692 -0
- package/dist/remote-runner/attach-client.js.map +1 -0
- package/dist/remote-runner/client.d.ts +205 -0
- package/dist/remote-runner/client.d.ts.map +1 -0
- package/dist/remote-runner/client.js +633 -0
- package/dist/remote-runner/client.js.map +1 -0
- package/dist/safety/action-firewall.d.ts +6 -1
- package/dist/safety/action-firewall.d.ts.map +1 -1
- package/dist/safety/action-firewall.js +62 -26
- package/dist/safety/action-firewall.js.map +1 -1
- package/dist/safety/governance-service-client.d.ts +36 -0
- package/dist/safety/governance-service-client.d.ts.map +1 -0
- package/dist/safety/governance-service-client.js +279 -0
- package/dist/safety/governance-service-client.js.map +1 -0
- package/dist/safety/policy.d.ts +13 -2
- package/dist/safety/policy.d.ts.map +1 -1
- package/dist/safety/policy.js +474 -52
- package/dist/safety/policy.js.map +1 -1
- package/dist/sdk-tools.d.ts +21 -0
- package/dist/sdk-tools.d.ts.map +1 -1
- package/dist/sdk-tools.js +16 -0
- package/dist/sdk-tools.js.map +1 -1
- package/dist/server/app-context.d.ts +25 -0
- package/dist/server/app-context.d.ts.map +1 -1
- package/dist/server/app-context.js.map +1 -1
- package/dist/server/approval-service.d.ts +7 -8
- package/dist/server/approval-service.d.ts.map +1 -1
- package/dist/server/approval-service.js +12 -24
- package/dist/server/approval-service.js.map +1 -1
- package/dist/server/authz.d.ts +23 -2
- package/dist/server/authz.d.ts.map +1 -1
- package/dist/server/authz.js +153 -17
- package/dist/server/authz.js.map +1 -1
- package/dist/server/handlers/approvals.d.ts.map +1 -1
- package/dist/server/handlers/approvals.js +3 -10
- package/dist/server/handlers/approvals.js.map +1 -1
- package/dist/server/handlers/branch.d.ts.map +1 -1
- package/dist/server/handlers/branch.js +29 -20
- package/dist/server/handlers/branch.js.map +1 -1
- package/dist/server/handlers/bridge.d.ts.map +1 -1
- package/dist/server/handlers/bridge.js +3 -2
- package/dist/server/handlers/bridge.js.map +1 -1
- package/dist/server/handlers/chat-ws.d.ts.map +1 -1
- package/dist/server/handlers/chat-ws.js +23 -31
- package/dist/server/handlers/chat-ws.js.map +1 -1
- package/dist/server/handlers/chat.d.ts.map +1 -1
- package/dist/server/handlers/chat.js +105 -46
- package/dist/server/handlers/chat.js.map +1 -1
- package/dist/server/handlers/compliance.d.ts +3 -0
- package/dist/server/handlers/compliance.d.ts.map +1 -0
- package/dist/server/handlers/compliance.js +53 -0
- package/dist/server/handlers/compliance.js.map +1 -0
- package/dist/server/handlers/context.d.ts.map +1 -1
- package/dist/server/handlers/context.js +3 -8
- package/dist/server/handlers/context.js.map +1 -1
- package/dist/server/handlers/fleet.d.ts +4 -0
- package/dist/server/handlers/fleet.d.ts.map +1 -0
- package/dist/server/handlers/fleet.js +9 -0
- package/dist/server/handlers/fleet.js.map +1 -0
- package/dist/server/handlers/headless-sessions.d.ts +4 -0
- package/dist/server/handlers/headless-sessions.d.ts.map +1 -1
- package/dist/server/handlers/headless-sessions.js +168 -3
- package/dist/server/handlers/headless-sessions.js.map +1 -1
- package/dist/server/handlers/health.d.ts +31 -2
- package/dist/server/handlers/health.d.ts.map +1 -1
- package/dist/server/handlers/health.js +82 -8
- package/dist/server/handlers/health.js.map +1 -1
- package/dist/server/handlers/hosted-runner-drain.d.ts +128 -0
- package/dist/server/handlers/hosted-runner-drain.d.ts.map +1 -0
- package/dist/server/handlers/hosted-runner-drain.js +373 -0
- package/dist/server/handlers/hosted-runner-drain.js.map +1 -0
- package/dist/server/handlers/hosted-runner-identity.d.ts +17 -0
- package/dist/server/handlers/hosted-runner-identity.d.ts.map +1 -0
- package/dist/server/handlers/hosted-runner-identity.js +39 -0
- package/dist/server/handlers/hosted-runner-identity.js.map +1 -0
- package/dist/server/handlers/intelligent-router.d.ts +3 -0
- package/dist/server/handlers/intelligent-router.d.ts.map +1 -0
- package/dist/server/handlers/intelligent-router.js +141 -0
- package/dist/server/handlers/intelligent-router.js.map +1 -0
- package/dist/server/handlers/models.d.ts.map +1 -1
- package/dist/server/handlers/models.js +14 -0
- package/dist/server/handlers/models.js.map +1 -1
- package/dist/server/handlers/pending-requests.d.ts +8 -0
- package/dist/server/handlers/pending-requests.d.ts.map +1 -0
- package/dist/server/handlers/pending-requests.js +149 -0
- package/dist/server/handlers/pending-requests.js.map +1 -0
- package/dist/server/handlers/revenue-attribution.d.ts +3 -0
- package/dist/server/handlers/revenue-attribution.d.ts.map +1 -0
- package/dist/server/handlers/revenue-attribution.js +45 -0
- package/dist/server/handlers/revenue-attribution.js.map +1 -0
- package/dist/server/handlers/runtime-app-server-ws.d.ts +10 -0
- package/dist/server/handlers/runtime-app-server-ws.d.ts.map +1 -0
- package/dist/server/handlers/runtime-app-server-ws.js +206 -0
- package/dist/server/handlers/runtime-app-server-ws.js.map +1 -0
- package/dist/server/handlers/session-artifacts.js +2 -2
- package/dist/server/handlers/session-artifacts.js.map +1 -1
- package/dist/server/handlers/session-attachments.js +3 -3
- package/dist/server/handlers/session-attachments.js.map +1 -1
- package/dist/server/handlers/session-timeline.d.ts +11 -0
- package/dist/server/handlers/session-timeline.d.ts.map +1 -0
- package/dist/server/handlers/session-timeline.js +77 -0
- package/dist/server/handlers/session-timeline.js.map +1 -0
- package/dist/server/handlers/sessions.d.ts +11 -0
- package/dist/server/handlers/sessions.d.ts.map +1 -1
- package/dist/server/handlers/sessions.js +68 -100
- package/dist/server/handlers/sessions.js.map +1 -1
- package/dist/server/handlers/traces.d.ts +3 -0
- package/dist/server/handlers/traces.d.ts.map +1 -0
- package/dist/server/handlers/traces.js +60 -0
- package/dist/server/handlers/traces.js.map +1 -0
- package/dist/server/handlers/usage-analytics.d.ts +3 -0
- package/dist/server/handlers/usage-analytics.d.ts.map +1 -0
- package/dist/server/handlers/usage-analytics.js +40 -0
- package/dist/server/handlers/usage-analytics.js.map +1 -0
- package/dist/server/handlers/workspace-config.d.ts +3 -0
- package/dist/server/handlers/workspace-config.d.ts.map +1 -0
- package/dist/server/handlers/workspace-config.js +62 -0
- package/dist/server/handlers/workspace-config.js.map +1 -0
- package/dist/server/headless-in-process-host.d.ts +8 -1
- package/dist/server/headless-in-process-host.d.ts.map +1 -1
- package/dist/server/headless-in-process-host.js +6 -0
- package/dist/server/headless-in-process-host.js.map +1 -1
- package/dist/server/headless-runtime-service.d.ts +99 -1
- package/dist/server/headless-runtime-service.d.ts.map +1 -1
- package/dist/server/headless-runtime-service.js +286 -23
- package/dist/server/headless-runtime-service.js.map +1 -1
- package/dist/server/hosted-session-manager.d.ts +103 -0
- package/dist/server/hosted-session-manager.d.ts.map +1 -0
- package/dist/server/hosted-session-manager.js +629 -0
- package/dist/server/hosted-session-manager.js.map +1 -0
- package/dist/server/pending-request-payload.d.ts +4 -0
- package/dist/server/pending-request-payload.d.ts.map +1 -0
- package/dist/server/pending-request-payload.js +107 -0
- package/dist/server/pending-request-payload.js.map +1 -0
- package/dist/server/request-context.d.ts +4 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js +9 -0
- package/dist/server/request-context.js.map +1 -1
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +149 -1
- package/dist/server/routes.js.map +1 -1
- package/dist/server/runtime-ws-access.d.ts +16 -0
- package/dist/server/runtime-ws-access.d.ts.map +1 -0
- package/dist/server/runtime-ws-access.js +21 -0
- package/dist/server/runtime-ws-access.js.map +1 -0
- package/dist/server/server-middlewares.d.ts +1 -1
- package/dist/server/server-middlewares.d.ts.map +1 -1
- package/dist/server/server-middlewares.js +35 -27
- package/dist/server/server-middlewares.js.map +1 -1
- package/dist/server/server-request-manager.d.ts +8 -27
- package/dist/server/server-request-manager.d.ts.map +1 -1
- package/dist/server/server-request-manager.js +7 -0
- package/dist/server/server-request-manager.js.map +1 -1
- package/dist/server/server-utils.d.ts +2 -1
- package/dist/server/server-utils.d.ts.map +1 -1
- package/dist/server/server-utils.js +11 -1
- package/dist/server/server-utils.js.map +1 -1
- package/dist/server/session-event-env.d.ts +2 -0
- package/dist/server/session-event-env.d.ts.map +1 -0
- package/dist/server/session-event-env.js +8 -0
- package/dist/server/session-event-env.js.map +1 -0
- package/dist/server/session-initialization.d.ts +25 -4
- package/dist/server/session-initialization.d.ts.map +1 -1
- package/dist/server/session-initialization.js +22 -5
- package/dist/server/session-initialization.js.map +1 -1
- package/dist/server/session-scope.d.ts +4 -0
- package/dist/server/session-scope.d.ts.map +1 -1
- package/dist/server/session-scope.js +44 -4
- package/dist/server/session-scope.js.map +1 -1
- package/dist/server/session-timeline.d.ts +13 -0
- package/dist/server/session-timeline.d.ts.map +1 -0
- package/dist/server/session-timeline.js +566 -0
- package/dist/server/session-timeline.js.map +1 -0
- package/dist/services/compliance/controls.d.ts +6 -0
- package/dist/services/compliance/controls.d.ts.map +1 -0
- package/dist/services/compliance/controls.js +113 -0
- package/dist/services/compliance/controls.js.map +1 -0
- package/dist/services/compliance/index.d.ts +6 -0
- package/dist/services/compliance/index.d.ts.map +1 -0
- package/dist/services/compliance/index.js +5 -0
- package/dist/services/compliance/index.js.map +1 -0
- package/dist/services/compliance/normalize.d.ts +23 -0
- package/dist/services/compliance/normalize.d.ts.map +1 -0
- package/dist/services/compliance/normalize.js +226 -0
- package/dist/services/compliance/normalize.js.map +1 -0
- package/dist/services/compliance/recorder.d.ts +22 -0
- package/dist/services/compliance/recorder.d.ts.map +1 -0
- package/dist/services/compliance/recorder.js +89 -0
- package/dist/services/compliance/recorder.js.map +1 -0
- package/dist/services/compliance/service.d.ts +24 -0
- package/dist/services/compliance/service.d.ts.map +1 -0
- package/dist/services/compliance/service.js +426 -0
- package/dist/services/compliance/service.js.map +1 -0
- package/dist/services/compliance/types.d.ts +185 -0
- package/dist/services/compliance/types.d.ts.map +1 -0
- package/dist/services/compliance/types.js +2 -0
- package/dist/services/compliance/types.js.map +1 -0
- package/dist/services/intelligent-router/index.d.ts +5 -0
- package/dist/services/intelligent-router/index.d.ts.map +1 -0
- package/dist/services/intelligent-router/index.js +5 -0
- package/dist/services/intelligent-router/index.js.map +1 -0
- package/dist/services/intelligent-router/normalize.d.ts +9 -0
- package/dist/services/intelligent-router/normalize.d.ts.map +1 -0
- package/dist/services/intelligent-router/normalize.js +169 -0
- package/dist/services/intelligent-router/normalize.js.map +1 -0
- package/dist/services/intelligent-router/recorder.d.ts +24 -0
- package/dist/services/intelligent-router/recorder.d.ts.map +1 -0
- package/dist/services/intelligent-router/recorder.js +98 -0
- package/dist/services/intelligent-router/recorder.js.map +1 -0
- package/dist/services/intelligent-router/service.d.ts +22 -0
- package/dist/services/intelligent-router/service.d.ts.map +1 -0
- package/dist/services/intelligent-router/service.js +328 -0
- package/dist/services/intelligent-router/service.js.map +1 -0
- package/dist/services/intelligent-router/types.d.ts +98 -0
- package/dist/services/intelligent-router/types.d.ts.map +1 -0
- package/dist/services/intelligent-router/types.js +7 -0
- package/dist/services/intelligent-router/types.js.map +1 -0
- package/dist/services/revenue-attribution/index.d.ts +4 -0
- package/dist/services/revenue-attribution/index.d.ts.map +1 -0
- package/dist/services/revenue-attribution/index.js +4 -0
- package/dist/services/revenue-attribution/index.js.map +1 -0
- package/dist/services/revenue-attribution/normalize.d.ts +13 -0
- package/dist/services/revenue-attribution/normalize.d.ts.map +1 -0
- package/dist/services/revenue-attribution/normalize.js +155 -0
- package/dist/services/revenue-attribution/normalize.js.map +1 -0
- package/dist/services/revenue-attribution/service.d.ts +21 -0
- package/dist/services/revenue-attribution/service.d.ts.map +1 -0
- package/dist/services/revenue-attribution/service.js +248 -0
- package/dist/services/revenue-attribution/service.js.map +1 -0
- package/dist/services/revenue-attribution/types.d.ts +96 -0
- package/dist/services/revenue-attribution/types.d.ts.map +1 -0
- package/dist/services/revenue-attribution/types.js +7 -0
- package/dist/services/revenue-attribution/types.js.map +1 -0
- package/dist/services/traces/index.d.ts +5 -0
- package/dist/services/traces/index.d.ts.map +1 -0
- package/dist/services/traces/index.js +4 -0
- package/dist/services/traces/index.js.map +1 -0
- package/dist/services/traces/normalize.d.ts +20 -0
- package/dist/services/traces/normalize.d.ts.map +1 -0
- package/dist/services/traces/normalize.js +261 -0
- package/dist/services/traces/normalize.js.map +1 -0
- package/dist/services/traces/otel.d.ts +3 -0
- package/dist/services/traces/otel.d.ts.map +1 -0
- package/dist/services/traces/otel.js +173 -0
- package/dist/services/traces/otel.js.map +1 -0
- package/dist/services/traces/service.d.ts +17 -0
- package/dist/services/traces/service.d.ts.map +1 -0
- package/dist/services/traces/service.js +197 -0
- package/dist/services/traces/service.js.map +1 -0
- package/dist/services/traces/types.d.ts +130 -0
- package/dist/services/traces/types.d.ts.map +1 -0
- package/dist/services/traces/types.js +8 -0
- package/dist/services/traces/types.js.map +1 -0
- package/dist/services/usage-analytics/aggregation.d.ts +18 -0
- package/dist/services/usage-analytics/aggregation.d.ts.map +1 -0
- package/dist/services/usage-analytics/aggregation.js +130 -0
- package/dist/services/usage-analytics/aggregation.js.map +1 -0
- package/dist/services/usage-analytics/index.d.ts +5 -0
- package/dist/services/usage-analytics/index.d.ts.map +1 -0
- package/dist/services/usage-analytics/index.js +4 -0
- package/dist/services/usage-analytics/index.js.map +1 -0
- package/dist/services/usage-analytics/recorder.d.ts +16 -0
- package/dist/services/usage-analytics/recorder.d.ts.map +1 -0
- package/dist/services/usage-analytics/recorder.js +128 -0
- package/dist/services/usage-analytics/recorder.js.map +1 -0
- package/dist/services/usage-analytics/service.d.ts +15 -0
- package/dist/services/usage-analytics/service.d.ts.map +1 -0
- package/dist/services/usage-analytics/service.js +210 -0
- package/dist/services/usage-analytics/service.js.map +1 -0
- package/dist/services/usage-analytics/types.d.ts +80 -0
- package/dist/services/usage-analytics/types.d.ts.map +1 -0
- package/dist/services/usage-analytics/types.js +2 -0
- package/dist/services/usage-analytics/types.js.map +1 -0
- package/dist/services/workspace-config/index.d.ts +6 -0
- package/dist/services/workspace-config/index.d.ts.map +1 -0
- package/dist/services/workspace-config/index.js +5 -0
- package/dist/services/workspace-config/index.js.map +1 -0
- package/dist/services/workspace-config/middleware.d.ts +5 -0
- package/dist/services/workspace-config/middleware.d.ts.map +1 -0
- package/dist/services/workspace-config/middleware.js +98 -0
- package/dist/services/workspace-config/middleware.js.map +1 -0
- package/dist/services/workspace-config/normalize.d.ts +17 -0
- package/dist/services/workspace-config/normalize.d.ts.map +1 -0
- package/dist/services/workspace-config/normalize.js +148 -0
- package/dist/services/workspace-config/normalize.js.map +1 -0
- package/dist/services/workspace-config/policy.d.ts +16 -0
- package/dist/services/workspace-config/policy.d.ts.map +1 -0
- package/dist/services/workspace-config/policy.js +77 -0
- package/dist/services/workspace-config/policy.js.map +1 -0
- package/dist/services/workspace-config/service.d.ts +20 -0
- package/dist/services/workspace-config/service.d.ts.map +1 -0
- package/dist/services/workspace-config/service.js +162 -0
- package/dist/services/workspace-config/service.js.map +1 -0
- package/dist/services/workspace-config/types.d.ts +71 -0
- package/dist/services/workspace-config/types.d.ts.map +1 -0
- package/dist/services/workspace-config/types.js +2 -0
- package/dist/services/workspace-config/types.js.map +1 -0
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +10 -0
- package/dist/session/manager.js.map +1 -1
- package/dist/session/migration.d.ts.map +1 -1
- package/dist/session/migration.js +2 -1
- package/dist/session/migration.js.map +1 -1
- package/dist/session/session-memory.d.ts.map +1 -1
- package/dist/session/session-memory.js +7 -1
- package/dist/session/session-memory.js.map +1 -1
- package/dist/session/types.d.ts +1 -2
- package/dist/session/types.d.ts.map +1 -1
- package/dist/session/types.js +1 -22
- package/dist/session/types.js.map +1 -1
- package/dist/session/wire-format.d.ts +7 -0
- package/dist/session/wire-format.d.ts.map +1 -0
- package/dist/session/wire-format.generated.d.ts +95 -0
- package/dist/session/wire-format.generated.d.ts.map +1 -0
- package/dist/session/wire-format.generated.js +111 -0
- package/dist/session/wire-format.generated.js.map +1 -0
- package/dist/session/wire-format.js +145 -0
- package/dist/session/wire-format.js.map +1 -0
- package/dist/shared-memory/client.d.ts.map +1 -1
- package/dist/shared-memory/client.js +22 -22
- package/dist/shared-memory/client.js.map +1 -1
- package/dist/skills/artifact-metadata.d.ts +16 -0
- package/dist/skills/artifact-metadata.d.ts.map +1 -0
- package/dist/skills/artifact-metadata.js +86 -0
- package/dist/skills/artifact-metadata.js.map +1 -0
- package/dist/skills/loader.d.ts +2 -2
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +1 -0
- package/dist/skills/loader.js.map +1 -1
- package/dist/skills/service-client.d.ts +42 -0
- package/dist/skills/service-client.d.ts.map +1 -0
- package/dist/skills/service-client.js +258 -0
- package/dist/skills/service-client.js.map +1 -0
- package/dist/skills/tool.d.ts +3 -0
- package/dist/skills/tool.d.ts.map +1 -1
- package/dist/skills/tool.js +67 -5
- package/dist/skills/tool.js.map +1 -1
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +5 -0
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/maestro-event-bus.d.ts +440 -0
- package/dist/telemetry/maestro-event-bus.d.ts.map +1 -0
- package/dist/telemetry/maestro-event-bus.js +784 -0
- package/dist/telemetry/maestro-event-bus.js.map +1 -0
- package/dist/telemetry/maestro-event-catalog.d.ts +48 -0
- package/dist/telemetry/maestro-event-catalog.d.ts.map +1 -0
- package/dist/telemetry/maestro-event-catalog.js +69 -0
- package/dist/telemetry/maestro-event-catalog.js.map +1 -0
- package/dist/telemetry/maestro-platform-replay-fixture.d.ts +24 -0
- package/dist/telemetry/maestro-platform-replay-fixture.d.ts.map +1 -0
- package/dist/telemetry/maestro-platform-replay-fixture.js +400 -0
- package/dist/telemetry/maestro-platform-replay-fixture.js.map +1 -0
- package/dist/telemetry/maestro-publisher-conformance-fixture.d.ts +29 -0
- package/dist/telemetry/maestro-publisher-conformance-fixture.d.ts.map +1 -0
- package/dist/telemetry/maestro-publisher-conformance-fixture.js +240 -0
- package/dist/telemetry/maestro-publisher-conformance-fixture.js.map +1 -0
- package/dist/telemetry/meter-service-client.d.ts +0 -33
- package/dist/telemetry/meter-service-client.d.ts.map +1 -1
- package/dist/telemetry/meter-service-client.js +22 -50
- package/dist/telemetry/meter-service-client.js.map +1 -1
- package/dist/telemetry/turn-tracker.d.ts.map +1 -1
- package/dist/telemetry/turn-tracker.js +5 -5
- package/dist/telemetry/turn-tracker.js.map +1 -1
- package/dist/telemetry/wide-events.d.ts +8 -0
- package/dist/telemetry/wide-events.d.ts.map +1 -1
- package/dist/telemetry/wide-events.js +28 -0
- package/dist/telemetry/wide-events.js.map +1 -1
- package/dist/telemetry.d.ts +1 -1
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +14 -4
- package/dist/telemetry.js.map +1 -1
- package/dist/timeline/redaction.d.ts +5 -0
- package/dist/timeline/redaction.d.ts.map +1 -0
- package/dist/timeline/redaction.js +119 -0
- package/dist/timeline/redaction.js.map +1 -0
- package/dist/tools/ask-user.d.ts +26 -0
- package/dist/tools/ask-user.d.ts.map +1 -1
- package/dist/tools/ask-user.js +33 -1
- package/dist/tools/ask-user.js.map +1 -1
- package/dist/tools/background/task-types.d.ts +1 -1
- package/dist/tools/edit.d.ts +2 -0
- package/dist/tools/edit.d.ts.map +1 -1
- package/dist/tools/edit.js +27 -7
- package/dist/tools/edit.js.map +1 -1
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/pipeline.d.ts.map +1 -1
- package/dist/tools/pipeline.js +16 -7
- package/dist/tools/pipeline.js.map +1 -1
- package/dist/tools/write.d.ts +2 -0
- package/dist/tools/write.d.ts.map +1 -1
- package/dist/tools/write.js +24 -6
- package/dist/tools/write.js.map +1 -1
- package/dist/tracking/cost-tracker.d.ts +15 -12
- package/dist/tracking/cost-tracker.d.ts.map +1 -1
- package/dist/tracking/cost-tracker.js +29 -40
- package/dist/tracking/cost-tracker.js.map +1 -1
- package/dist/utils/checkpoint-profiler.d.ts +29 -0
- package/dist/utils/checkpoint-profiler.d.ts.map +1 -0
- package/dist/utils/checkpoint-profiler.js +118 -0
- package/dist/utils/checkpoint-profiler.js.map +1 -0
- package/dist/utils/downstream-http.d.ts +21 -0
- package/dist/utils/downstream-http.d.ts.map +1 -0
- package/dist/utils/downstream-http.js +151 -0
- package/dist/utils/downstream-http.js.map +1 -0
- package/dist/utils/downstream.d.ts +18 -0
- package/dist/utils/downstream.d.ts.map +1 -0
- package/dist/utils/downstream.js +47 -0
- package/dist/utils/downstream.js.map +1 -0
- package/dist/utils/logger.d.ts +3 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +12 -1
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/oauth-http.d.ts +8 -0
- package/dist/utils/oauth-http.d.ts.map +1 -0
- package/dist/utils/oauth-http.js +41 -0
- package/dist/utils/oauth-http.js.map +1 -0
- package/dist/utils/path-utils.d.ts +2 -0
- package/dist/utils/path-utils.d.ts.map +1 -0
- package/dist/utils/path-utils.js +12 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/dist/utils/path-validation.d.ts +1 -1
- package/dist/utils/path-validation.d.ts.map +1 -1
- package/dist/utils/path-validation.js +3 -3
- package/dist/utils/path-validation.js.map +1 -1
- package/dist/version.json +2 -2
- package/dist/web-server.d.ts +7 -1
- package/dist/web-server.d.ts.map +1 -1
- package/dist/web-server.js +117 -15
- package/dist/web-server.js.map +1 -1
- package/dist/webhooks/delivery.d.ts.map +1 -1
- package/dist/webhooks/delivery.js +9 -12
- package/dist/webhooks/delivery.js.map +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/descriptors.d.ts +12 -5
- package/node_modules/@bufbuild/protobuf/dist/cjs/from-binary.js +7 -7
- package/node_modules/@bufbuild/protobuf/dist/cjs/from-json.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/from-json.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/reflect/path.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/registry.js +24 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/to-json.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/to-json.js +9 -10
- package/node_modules/@bufbuild/protobuf/dist/cjs/types.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.d.ts +9 -7
- package/node_modules/@bufbuild/protobuf/dist/cjs/wire/binary-encoding.js +18 -8
- package/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.d.ts +4 -2
- package/node_modules/@bufbuild/protobuf/dist/cjs/wire/text-encoding.js +8 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/api_pb.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +2 -2
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.d.ts +37 -23
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/descriptor_pb.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/field_mask_pb.d.ts +32 -36
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.d.ts +65 -0
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/go_features_pb.js +38 -2
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/timestamp_pb.d.ts +5 -5
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/gen/google/protobuf/type_pb.d.ts +3 -3
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/cjs/wkt/wrappers.js +24 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/descriptors.d.ts +12 -5
- package/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +7 -7
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/reflect/path.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/registry.js +24 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +10 -11
- package/node_modules/@bufbuild/protobuf/dist/esm/types.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.d.ts +9 -7
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/binary-encoding.js +18 -8
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.d.ts +4 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +8 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.d.ts +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.d.ts +2 -2
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.d.ts +37 -23
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +1 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.d.ts +32 -36
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.d.ts +65 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +37 -1
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.d.ts +5 -5
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.d.ts +3 -3
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.d.ts +10 -0
- package/node_modules/@bufbuild/protobuf/dist/esm/wkt/wrappers.js +23 -0
- package/node_modules/@bufbuild/protobuf/package.json +1 -1
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.d.ts +305 -2
- 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 +34 -4
- package/node_modules/@evalops/contracts/dist/headless-protocol-schemas.generated.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/index.d.ts +88 -0
- package/node_modules/@evalops/contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/index.js +2 -0
- package/node_modules/@evalops/contracts/dist/index.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/proto/maestro/v1/headless_pb.d.ts +77 -77
- 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 +1 -1
- 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 +182 -0
- package/node_modules/@evalops/contracts/dist/runtime-app-server.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/runtime-app-server.js +83 -0
- package/node_modules/@evalops/contracts/dist/runtime-app-server.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.d.ts +133 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.js +68 -0
- package/node_modules/@evalops/contracts/dist/runtime-server-request.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/schemas.d.ts +178 -0
- package/node_modules/@evalops/contracts/dist/schemas.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/schemas.js +165 -0
- package/node_modules/@evalops/contracts/dist/schemas.js.map +1 -1
- package/node_modules/@evalops/contracts/dist/typebox-utils.d.ts +2 -0
- package/node_modules/@evalops/contracts/dist/typebox-utils.d.ts.map +1 -0
- package/node_modules/@evalops/contracts/dist/typebox-utils.js +5 -0
- package/node_modules/@evalops/contracts/dist/typebox-utils.js.map +1 -0
- package/node_modules/@evalops/contracts/dist/validators.d.ts +4 -1
- package/node_modules/@evalops/contracts/dist/validators.d.ts.map +1 -1
- package/node_modules/@evalops/contracts/dist/validators.js +4 -1
- package/node_modules/@evalops/contracts/dist/validators.js.map +1 -1
- package/node_modules/@evalops/contracts/package.json +1 -1
- package/node_modules/@evalops/tui/package.json +1 -1
- package/node_modules/string-width/index.js +93 -9
- package/node_modules/string-width/package.json +1 -1
- package/package.json +32 -25
- package/dist/cli-tui/commands/grouped/auth-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/auth-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/config-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/config-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/diag-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/diag-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/git-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/git-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/index.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/index.js.map +0 -1
- package/dist/cli-tui/commands/grouped/safety-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/safety-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/session-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/session-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/tools-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/tools-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/ui-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/ui-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/undo-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/undo-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/usage-commands.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/usage-commands.js.map +0 -1
- package/dist/cli-tui/commands/grouped/utils.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped/utils.js.map +0 -1
- package/dist/cli-tui/commands/grouped-command-handlers.d.ts.map +0 -1
- package/dist/cli-tui/commands/grouped-command-handlers.js +0 -135
- package/dist/cli-tui/commands/grouped-command-handlers.js.map +0 -1
- package/dist/cli-tui/tui-renderer/grouped-handlers-wiring.d.ts +0 -78
- package/dist/cli-tui/tui-renderer/grouped-handlers-wiring.d.ts.map +0 -1
- package/dist/cli-tui/tui-renderer/grouped-handlers-wiring.js +0 -129
- package/dist/cli-tui/tui-renderer/grouped-handlers-wiring.js.map +0 -1
- package/node_modules/@evalops/memory/dist/client.d.ts +0 -94
- package/node_modules/@evalops/memory/dist/client.js +0 -503
- package/node_modules/@evalops/memory/gen/proto/dist/memory/v1/memory_pb.d.ts +0 -608
- package/node_modules/@evalops/memory/gen/proto/dist/memory/v1/memory_pb.js +0 -187
- package/node_modules/@evalops/memory/package.json +0 -26
- /package/dist/cli-tui/commands/{grouped → subcommands}/usage-commands.d.ts +0 -0
|
@@ -0,0 +1,665 @@
|
|
|
1
|
+
import { MAESTRO_PLATFORM_RUNTIME_BRIDGE_KILL_SWITCH, isFeatureFlagEnabled, isPlatformRuntimeObserveEnabled, isPlatformToolExecutionBridgeEnabled, } from "../../config/feature-flags.js";
|
|
2
|
+
import { executeToolWithPlatform, recordToolExecutionOutputWithPlatform, resolveToolExecutionServiceConfig, resumeToolExecutionWithPlatform, } from "../../platform/tool-execution-client.js";
|
|
3
|
+
import { isReadOnlyTool } from "../../tools/parallel-execution.js";
|
|
4
|
+
import { createLogger } from "../../utils/logger.js";
|
|
5
|
+
const logger = createLogger("transport:tool-execution-bridge");
|
|
6
|
+
const OBSERVE_OUTPUT_SUMMARY_MAX_LENGTH = 280;
|
|
7
|
+
const METADATA_VALUE_MAX_LENGTH = 512;
|
|
8
|
+
const READ_ONLY_BASH_PREFIXES = [
|
|
9
|
+
"cat",
|
|
10
|
+
"cd",
|
|
11
|
+
"df",
|
|
12
|
+
"du",
|
|
13
|
+
"echo",
|
|
14
|
+
"env",
|
|
15
|
+
"find",
|
|
16
|
+
"git diff",
|
|
17
|
+
"git log",
|
|
18
|
+
"git remote -v",
|
|
19
|
+
"git rev-parse",
|
|
20
|
+
"git show",
|
|
21
|
+
"git status",
|
|
22
|
+
"grep",
|
|
23
|
+
"head",
|
|
24
|
+
"ls",
|
|
25
|
+
"pwd",
|
|
26
|
+
"printenv",
|
|
27
|
+
"ps",
|
|
28
|
+
"rg",
|
|
29
|
+
"sed -n",
|
|
30
|
+
"tail",
|
|
31
|
+
"which",
|
|
32
|
+
].map((value) => value.toLowerCase());
|
|
33
|
+
const BASH_MUTATION_MARKERS = [
|
|
34
|
+
/\bchmod\b/u,
|
|
35
|
+
/\bchown\b/u,
|
|
36
|
+
/\bcp\b/u,
|
|
37
|
+
/\bgit\s+(add|am|apply|branch|checkout|cherry-pick|clean|commit|merge|mv|pull|push|rebase|reset|restore|revert|rm|stash|switch|tag)\b/u,
|
|
38
|
+
/\bmkdir\b/u,
|
|
39
|
+
/\bmv\b/u,
|
|
40
|
+
/\bnpm\s+(install|publish|uninstall|update|version)\b/u,
|
|
41
|
+
/\bpnpm\s+(add|install|remove|update)\b/u,
|
|
42
|
+
/\bpython\b.*-c/u,
|
|
43
|
+
/\brm\b/u,
|
|
44
|
+
/\bsed\s+-i\b/u,
|
|
45
|
+
/\btee\b/u,
|
|
46
|
+
/\btouch\b/u,
|
|
47
|
+
/\byarn\s+(add|install|remove|upgrade)\b/u,
|
|
48
|
+
/\bbun\s+(add|install|remove|update)\b/u,
|
|
49
|
+
/\bkubectl\s+(apply|create|delete|patch|replace|scale)\b/u,
|
|
50
|
+
/\bterraform\s+(apply|destroy|import)\b/u,
|
|
51
|
+
/(^|[^<])>{1,2}/u,
|
|
52
|
+
];
|
|
53
|
+
const READ_ONLY_GIT_BRANCH_ARGS = new Set([
|
|
54
|
+
"--all",
|
|
55
|
+
"--list",
|
|
56
|
+
"--merged",
|
|
57
|
+
"--no-contains",
|
|
58
|
+
"--no-merged",
|
|
59
|
+
"--points-at",
|
|
60
|
+
"--remotes",
|
|
61
|
+
"-a",
|
|
62
|
+
"-l",
|
|
63
|
+
"-r",
|
|
64
|
+
]);
|
|
65
|
+
function trimString(value) {
|
|
66
|
+
const trimmed = value?.trim();
|
|
67
|
+
return trimmed ? trimmed : undefined;
|
|
68
|
+
}
|
|
69
|
+
function getEnvValue(names) {
|
|
70
|
+
for (const name of names) {
|
|
71
|
+
const value = trimString(process.env[name]);
|
|
72
|
+
if (value) {
|
|
73
|
+
return value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
function metadataValue(value) {
|
|
79
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: metadata must neutralize C0 control characters and DEL.
|
|
80
|
+
const normalized = value?.replace(/[\x00-\x1f\x7f]/gu, " ");
|
|
81
|
+
const trimmed = trimString(normalized);
|
|
82
|
+
if (!trimmed) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
if (trimmed.length <= METADATA_VALUE_MAX_LENGTH) {
|
|
86
|
+
return trimmed;
|
|
87
|
+
}
|
|
88
|
+
const suffix = "...";
|
|
89
|
+
const maxPrefixLength = METADATA_VALUE_MAX_LENGTH - suffix.length;
|
|
90
|
+
let prefix = "";
|
|
91
|
+
for (const char of trimmed) {
|
|
92
|
+
if (prefix.length + char.length > maxPrefixLength) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
prefix += char;
|
|
96
|
+
}
|
|
97
|
+
return `${prefix.trimEnd()}${suffix}`;
|
|
98
|
+
}
|
|
99
|
+
function getMetadataEnvValue(names) {
|
|
100
|
+
return metadataValue(getEnvValue(names));
|
|
101
|
+
}
|
|
102
|
+
function getCurrentWorkingDirectory() {
|
|
103
|
+
try {
|
|
104
|
+
return metadataValue(process.cwd());
|
|
105
|
+
}
|
|
106
|
+
catch {
|
|
107
|
+
return undefined;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function buildShellCommandSummary(command) {
|
|
111
|
+
const normalized = command.replace(/\s+/gu, " ").trim();
|
|
112
|
+
if (normalized.length <= 96) {
|
|
113
|
+
return normalized;
|
|
114
|
+
}
|
|
115
|
+
return `${normalized.slice(0, 93).trimEnd()}...`;
|
|
116
|
+
}
|
|
117
|
+
function isReadOnlyBashCommand(command) {
|
|
118
|
+
const normalized = command.replace(/\s+/gu, " ").trim().toLowerCase();
|
|
119
|
+
if (!normalized) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
if (isReadOnlyGitBranchCommand(normalized)) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
if (BASH_MUTATION_MARKERS.some((pattern) => pattern.test(normalized))) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
return READ_ONLY_BASH_PREFIXES.some((prefix) => normalized === prefix || normalized.startsWith(`${prefix} `));
|
|
129
|
+
}
|
|
130
|
+
function isReadOnlyGitBranchCommand(normalized) {
|
|
131
|
+
const parts = normalized.split(" ");
|
|
132
|
+
if (parts[0] !== "git" || parts[1] !== "branch") {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
const args = parts.slice(2);
|
|
136
|
+
if (args.length === 0) {
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
return args.every((arg) => READ_ONLY_GIT_BRANCH_ARGS.has(arg) ||
|
|
140
|
+
arg.startsWith("--format=") ||
|
|
141
|
+
arg.startsWith("--sort="));
|
|
142
|
+
}
|
|
143
|
+
function inferBashRiskLevel(command) {
|
|
144
|
+
const normalized = command.toLowerCase();
|
|
145
|
+
if (/\brm\s+-rf\b/u.test(normalized) ||
|
|
146
|
+
/\bgit\s+push(\s+--force|\s+-f)\b/u.test(normalized) ||
|
|
147
|
+
/\bnpm\s+publish\b/u.test(normalized) ||
|
|
148
|
+
/\bkubectl\s+delete\b/u.test(normalized) ||
|
|
149
|
+
/\bterraform\s+destroy\b/u.test(normalized)) {
|
|
150
|
+
return "RISK_LEVEL_CRITICAL";
|
|
151
|
+
}
|
|
152
|
+
return isReadOnlyBashCommand(command) ? "RISK_LEVEL_LOW" : "RISK_LEVEL_HIGH";
|
|
153
|
+
}
|
|
154
|
+
function normalizeCapabilitySegment(value) {
|
|
155
|
+
return value.replace(/[^a-zA-Z0-9_.-]/gu, "_");
|
|
156
|
+
}
|
|
157
|
+
function parseBridgeMcpToolName(name) {
|
|
158
|
+
const parts = name.split("__");
|
|
159
|
+
if (parts[0] !== "mcp" || parts.length < 2) {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
const server = parts[1];
|
|
163
|
+
if (!server) {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
server,
|
|
168
|
+
tool: parts.length > 2 ? parts.slice(2).join("__") : undefined,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
function classifyToolExecution(toolCall, toolDef, rollout) {
|
|
172
|
+
if (!rollout.observeEnabled && !rollout.governedEnabled) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
if (toolCall.name === "bash") {
|
|
176
|
+
const command = typeof toolCall.arguments.command === "string"
|
|
177
|
+
? toolCall.arguments.command
|
|
178
|
+
: "";
|
|
179
|
+
const isReadOnly = isReadOnlyBashCommand(command);
|
|
180
|
+
const mode = isReadOnly || !rollout.governedEnabled ? "observe" : "governed";
|
|
181
|
+
if (mode === "observe" && !rollout.observeEnabled) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
family: "bash",
|
|
186
|
+
mode,
|
|
187
|
+
riskLevel: inferBashRiskLevel(command),
|
|
188
|
+
tool: {
|
|
189
|
+
namespace: "maestro",
|
|
190
|
+
name: "bash",
|
|
191
|
+
version: process.env.npm_package_version,
|
|
192
|
+
capability: "maestro.tool.bash",
|
|
193
|
+
operation: command ? buildShellCommandSummary(command) : "shell",
|
|
194
|
+
idempotent: isReadOnly,
|
|
195
|
+
mutatesResource: !isReadOnly,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const mcpTool = parseBridgeMcpToolName(toolCall.name);
|
|
200
|
+
if (!mcpTool) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
const mode = rollout.governedEnabled
|
|
204
|
+
? "governed"
|
|
205
|
+
: "observe";
|
|
206
|
+
const toolName = mcpTool.tool ?? toolCall.name;
|
|
207
|
+
const readOnly = isReadOnlyTool(toolCall.name, toolDef?.annotations);
|
|
208
|
+
return {
|
|
209
|
+
family: "mcp",
|
|
210
|
+
mode,
|
|
211
|
+
riskLevel: readOnly ? "RISK_LEVEL_MEDIUM" : "RISK_LEVEL_HIGH",
|
|
212
|
+
tool: {
|
|
213
|
+
namespace: "mcp",
|
|
214
|
+
name: toolName,
|
|
215
|
+
version: process.env.npm_package_version,
|
|
216
|
+
capability: `mcp.${normalizeCapabilitySegment(mcpTool.server)}.${normalizeCapabilitySegment(toolName)}`,
|
|
217
|
+
operation: toolName,
|
|
218
|
+
idempotent: readOnly,
|
|
219
|
+
mutatesResource: !readOnly,
|
|
220
|
+
},
|
|
221
|
+
connector: {
|
|
222
|
+
providerId: mcpTool.server,
|
|
223
|
+
resourceId: mcpTool.server,
|
|
224
|
+
resourceKind: "mcp_server",
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function stableStringify(value) {
|
|
229
|
+
if (Array.isArray(value)) {
|
|
230
|
+
return `[${value.map((item) => stableStringify(item)).join(",")}]`;
|
|
231
|
+
}
|
|
232
|
+
if (value && typeof value === "object") {
|
|
233
|
+
return `{${Object.entries(value)
|
|
234
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
235
|
+
.map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`)
|
|
236
|
+
.join(",")}}`;
|
|
237
|
+
}
|
|
238
|
+
return JSON.stringify(value);
|
|
239
|
+
}
|
|
240
|
+
function cloneRecord(value) {
|
|
241
|
+
return JSON.parse(JSON.stringify(value));
|
|
242
|
+
}
|
|
243
|
+
function scrubText(value) {
|
|
244
|
+
let next = value;
|
|
245
|
+
const redactions = new Set();
|
|
246
|
+
for (const pattern of [
|
|
247
|
+
/\b(gh[pousr]_[A-Za-z0-9_]{20,})\b/gu,
|
|
248
|
+
/\b(Bearer\s+[A-Za-z0-9._-]{16,})\b/giu,
|
|
249
|
+
/\b([A-Za-z0-9_-]{32,})\b/gu,
|
|
250
|
+
]) {
|
|
251
|
+
if (pattern.test(next)) {
|
|
252
|
+
redactions.add("secret_like_token");
|
|
253
|
+
next = next.replace(pattern, "[REDACTED]");
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return { text: next, redactions: [...redactions] };
|
|
257
|
+
}
|
|
258
|
+
function summarizeToolResult(result) {
|
|
259
|
+
const text = result.content
|
|
260
|
+
.filter((part) => part.type === "text")
|
|
261
|
+
.map((part) => part.text)
|
|
262
|
+
.join("\n")
|
|
263
|
+
.trim();
|
|
264
|
+
if (!text) {
|
|
265
|
+
return {
|
|
266
|
+
summary: result.isError
|
|
267
|
+
? "Tool failed without text output"
|
|
268
|
+
: "Tool completed",
|
|
269
|
+
redactions: [],
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
const firstLine = text.split(/\r?\n/u)[0]?.trim() ?? text;
|
|
273
|
+
const shortened = firstLine.length > OBSERVE_OUTPUT_SUMMARY_MAX_LENGTH
|
|
274
|
+
? `${firstLine.slice(0, OBSERVE_OUTPUT_SUMMARY_MAX_LENGTH - 3).trimEnd()}...`
|
|
275
|
+
: firstLine;
|
|
276
|
+
const scrubbed = scrubText(shortened);
|
|
277
|
+
return {
|
|
278
|
+
summary: scrubbed.text,
|
|
279
|
+
redactions: scrubbed.redactions,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
function buildOutputPayload(result, durationMs) {
|
|
283
|
+
const summary = summarizeToolResult(result);
|
|
284
|
+
const safeOutput = {
|
|
285
|
+
status: result.isError ? "failed" : "succeeded",
|
|
286
|
+
tool_name: result.toolName,
|
|
287
|
+
tool_call_id: result.toolCallId,
|
|
288
|
+
summary: summary.summary,
|
|
289
|
+
};
|
|
290
|
+
return {
|
|
291
|
+
safeOutput,
|
|
292
|
+
redactions: summary.redactions,
|
|
293
|
+
contentType: "application/json",
|
|
294
|
+
...(durationMs !== undefined
|
|
295
|
+
? { durationMs: Math.max(0, Math.round(durationMs)) }
|
|
296
|
+
: {}),
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function buildLinkage(cfg, toolCall, organizationId, workspaceId) {
|
|
300
|
+
const sessionId = trimString(cfg.session?.id) ?? getEnvValue(["MAESTRO_SESSION_ID"]);
|
|
301
|
+
const agentRunId = getEnvValue(["MAESTRO_AGENT_RUN_ID"]);
|
|
302
|
+
return {
|
|
303
|
+
workspaceId,
|
|
304
|
+
...(organizationId ? { organizationId } : {}),
|
|
305
|
+
agentId: getEnvValue(["MAESTRO_AGENT_ID"]) ??
|
|
306
|
+
trimString(process.env.npm_package_name) ??
|
|
307
|
+
"maestro",
|
|
308
|
+
...(agentRunId ? { runId: agentRunId } : {}),
|
|
309
|
+
objectiveId: getEnvValue(["MAESTRO_OBJECTIVE_ID"]),
|
|
310
|
+
stepId: toolCall.id,
|
|
311
|
+
actorId: trimString(cfg.user?.id) ?? getEnvValue(["MAESTRO_ACTOR_ID"]),
|
|
312
|
+
surface: getEnvValue(["MAESTRO_SURFACE"]) ?? "maestro",
|
|
313
|
+
channelId: getEnvValue(["MAESTRO_CHANNEL_ID"]),
|
|
314
|
+
correlationId: `${sessionId ?? "session"}:${toolCall.id}`,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function buildRuntimeContextMetadata(linkage) {
|
|
318
|
+
const cwd = getMetadataEnvValue(["MAESTRO_CWD"]) ?? getCurrentWorkingDirectory();
|
|
319
|
+
const workspaceRoot = getMetadataEnvValue([
|
|
320
|
+
"MAESTRO_WORKSPACE_ROOT",
|
|
321
|
+
"WORKSPACE_ROOT",
|
|
322
|
+
]);
|
|
323
|
+
const repositoryRoot = getMetadataEnvValue([
|
|
324
|
+
"MAESTRO_REPOSITORY_ROOT",
|
|
325
|
+
"MAESTRO_REPO_ROOT",
|
|
326
|
+
"GITHUB_WORKSPACE",
|
|
327
|
+
]) ?? workspaceRoot;
|
|
328
|
+
const repository = getMetadataEnvValue([
|
|
329
|
+
"MAESTRO_GIT_REPOSITORY",
|
|
330
|
+
"GITHUB_REPOSITORY",
|
|
331
|
+
"CI_PROJECT_PATH",
|
|
332
|
+
]);
|
|
333
|
+
const gitBranch = getMetadataEnvValue([
|
|
334
|
+
"MAESTRO_GIT_BRANCH",
|
|
335
|
+
"GITHUB_HEAD_REF",
|
|
336
|
+
"GITHUB_REF_NAME",
|
|
337
|
+
"CI_COMMIT_REF_NAME",
|
|
338
|
+
"VERCEL_GIT_COMMIT_REF",
|
|
339
|
+
]);
|
|
340
|
+
const gitCommit = getMetadataEnvValue([
|
|
341
|
+
"MAESTRO_GIT_COMMIT",
|
|
342
|
+
"GITHUB_SHA",
|
|
343
|
+
"CI_COMMIT_SHA",
|
|
344
|
+
"VERCEL_GIT_COMMIT_SHA",
|
|
345
|
+
]);
|
|
346
|
+
return {
|
|
347
|
+
...(linkage.runId ? { maestro_agent_run_id: linkage.runId } : {}),
|
|
348
|
+
maestro_agent_run_step_id: linkage.stepId,
|
|
349
|
+
...(linkage.actorId ? { maestro_actor_id: linkage.actorId } : {}),
|
|
350
|
+
...(linkage.correlationId
|
|
351
|
+
? { maestro_correlation_id: linkage.correlationId }
|
|
352
|
+
: {}),
|
|
353
|
+
...(cwd ? { maestro_cwd: cwd } : {}),
|
|
354
|
+
...(workspaceRoot ? { maestro_workspace_root: workspaceRoot } : {}),
|
|
355
|
+
...(repositoryRoot ? { maestro_repository_root: repositoryRoot } : {}),
|
|
356
|
+
...(repository ? { maestro_repository: repository } : {}),
|
|
357
|
+
...(gitBranch ? { maestro_git_branch: gitBranch } : {}),
|
|
358
|
+
...(gitCommit ? { maestro_git_commit: gitCommit } : {}),
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
function buildMetadata(input, classification, linkage) {
|
|
362
|
+
const originalArgs = input.toolCall.arguments;
|
|
363
|
+
const redactedArguments = stableStringify(originalArgs) !== stableStringify(input.sanitizedArgs);
|
|
364
|
+
const sessionId = trimString(input.cfg.session?.id) ?? getEnvValue(["MAESTRO_SESSION_ID"]);
|
|
365
|
+
const remoteRunnerSessionId = getEnvValue([
|
|
366
|
+
"MAESTRO_REMOTE_RUNNER_SESSION_ID",
|
|
367
|
+
"MAESTRO_RUNNER_SESSION_ID",
|
|
368
|
+
]);
|
|
369
|
+
return {
|
|
370
|
+
maestro_bridge_mode: classification.mode,
|
|
371
|
+
maestro_tool_call_id: input.toolCall.id,
|
|
372
|
+
...buildRuntimeContextMetadata(linkage),
|
|
373
|
+
...(sessionId ? { maestro_session_id: sessionId } : {}),
|
|
374
|
+
...(remoteRunnerSessionId
|
|
375
|
+
? { maestro_remote_runner_session_id: remoteRunnerSessionId }
|
|
376
|
+
: {}),
|
|
377
|
+
...(input.displayName ? { maestro_display_name: input.displayName } : {}),
|
|
378
|
+
...(input.summaryLabel
|
|
379
|
+
? { maestro_summary_label: input.summaryLabel }
|
|
380
|
+
: {}),
|
|
381
|
+
...(input.actionDescription
|
|
382
|
+
? { maestro_action_description: input.actionDescription }
|
|
383
|
+
: {}),
|
|
384
|
+
maestro_redacted_arguments: String(redactedArguments),
|
|
385
|
+
maestro_tool_family: classification.family,
|
|
386
|
+
maestro_local_execution_authoritative: String(classification.mode === "governed"),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
function buildExecuteRequest(input, config, classification) {
|
|
390
|
+
const linkage = buildLinkage(input.cfg, input.toolCall, config.organizationId, config.workspaceId ?? process.cwd());
|
|
391
|
+
return {
|
|
392
|
+
linkage,
|
|
393
|
+
tool: classification.tool,
|
|
394
|
+
...(classification.connector
|
|
395
|
+
? { connector: classification.connector }
|
|
396
|
+
: {}),
|
|
397
|
+
arguments: cloneRecord(input.sanitizedArgs),
|
|
398
|
+
riskLevel: classification.riskLevel,
|
|
399
|
+
retryPolicy: {
|
|
400
|
+
maxAttempts: 1,
|
|
401
|
+
initialDelayMs: 0,
|
|
402
|
+
maxDelayMs: 0,
|
|
403
|
+
allowNonIdempotentRetry: false,
|
|
404
|
+
},
|
|
405
|
+
idempotencyKey: `maestro:${input.toolCall.id}`,
|
|
406
|
+
metadata: buildMetadata(input, classification, linkage),
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function planFromResponse(classification, config, request, response) {
|
|
410
|
+
return {
|
|
411
|
+
kind: "governed",
|
|
412
|
+
mode: "governed",
|
|
413
|
+
classification,
|
|
414
|
+
config,
|
|
415
|
+
request,
|
|
416
|
+
metadata: {
|
|
417
|
+
toolExecutionId: response.execution.id,
|
|
418
|
+
approvalRequestId: response.execution.approvalWait?.approvalRequestId,
|
|
419
|
+
},
|
|
420
|
+
resumeToken: response.execution.approvalWait?.resumeToken,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function waitApprovalRequest(input, plan, execution) {
|
|
424
|
+
return {
|
|
425
|
+
id: execution.approvalWait?.approvalRequestId ??
|
|
426
|
+
plan.metadata.approvalRequestId ??
|
|
427
|
+
input.toolCall.id,
|
|
428
|
+
toolName: input.toolCall.name,
|
|
429
|
+
displayName: input.displayName,
|
|
430
|
+
summaryLabel: input.summaryLabel,
|
|
431
|
+
actionDescription: input.actionDescription,
|
|
432
|
+
args: input.sanitizedArgs,
|
|
433
|
+
reason: execution.approvalWait?.reason ??
|
|
434
|
+
execution.errorMessage ??
|
|
435
|
+
"Approval required by Platform ToolExecution",
|
|
436
|
+
platform: {
|
|
437
|
+
source: "tool_execution",
|
|
438
|
+
toolExecutionId: execution.id ?? plan.metadata.toolExecutionId,
|
|
439
|
+
approvalRequestId: execution.approvalWait?.approvalRequestId ??
|
|
440
|
+
plan.metadata.approvalRequestId,
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
function isBridgeGloballyDisabled() {
|
|
445
|
+
return isFeatureFlagEnabled(MAESTRO_PLATFORM_RUNTIME_BRIDGE_KILL_SWITCH);
|
|
446
|
+
}
|
|
447
|
+
export class DefaultPlatformToolExecutionBridge {
|
|
448
|
+
async prepare(input, signal) {
|
|
449
|
+
if (isBridgeGloballyDisabled()) {
|
|
450
|
+
return { status: "skip" };
|
|
451
|
+
}
|
|
452
|
+
const rollout = {
|
|
453
|
+
observeEnabled: isPlatformRuntimeObserveEnabled() ||
|
|
454
|
+
isPlatformToolExecutionBridgeEnabled(),
|
|
455
|
+
governedEnabled: isPlatformToolExecutionBridgeEnabled(),
|
|
456
|
+
};
|
|
457
|
+
const classification = classifyToolExecution(input.toolCall, input.toolDef, rollout);
|
|
458
|
+
if (!classification) {
|
|
459
|
+
return { status: "skip" };
|
|
460
|
+
}
|
|
461
|
+
const config = await resolveToolExecutionServiceConfig();
|
|
462
|
+
if (!config) {
|
|
463
|
+
return { status: "skip" };
|
|
464
|
+
}
|
|
465
|
+
const request = buildExecuteRequest(input, config, classification);
|
|
466
|
+
if (classification.mode === "observe") {
|
|
467
|
+
return {
|
|
468
|
+
status: "observe",
|
|
469
|
+
plan: {
|
|
470
|
+
kind: "observe",
|
|
471
|
+
mode: "observe",
|
|
472
|
+
classification,
|
|
473
|
+
config,
|
|
474
|
+
request,
|
|
475
|
+
metadata: {},
|
|
476
|
+
},
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
try {
|
|
480
|
+
const response = await executeToolWithPlatform(config, request, signal);
|
|
481
|
+
const plan = planFromResponse(classification, config, request, response);
|
|
482
|
+
switch (response.execution.state) {
|
|
483
|
+
case "TOOL_EXECUTION_STATE_DENIED":
|
|
484
|
+
return {
|
|
485
|
+
status: "deny",
|
|
486
|
+
plan,
|
|
487
|
+
reason: response.execution.errorMessage ??
|
|
488
|
+
"Action denied by Platform ToolExecution",
|
|
489
|
+
};
|
|
490
|
+
case "TOOL_EXECUTION_STATE_WAITING_APPROVAL":
|
|
491
|
+
return {
|
|
492
|
+
status: "wait_approval",
|
|
493
|
+
plan,
|
|
494
|
+
request: waitApprovalRequest(input, plan, response.execution),
|
|
495
|
+
};
|
|
496
|
+
default:
|
|
497
|
+
return { status: "allow", plan };
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
catch (error) {
|
|
501
|
+
if (isAbortError(error)) {
|
|
502
|
+
throw error;
|
|
503
|
+
}
|
|
504
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
505
|
+
return {
|
|
506
|
+
status: "deny",
|
|
507
|
+
reason: `Platform ToolExecution unavailable: ${message}`,
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
async resolveApproval(input, plan, decision, signal) {
|
|
512
|
+
if (!plan.resumeToken || !plan.metadata.approvalRequestId) {
|
|
513
|
+
return decision.approved
|
|
514
|
+
? { status: "allow", plan }
|
|
515
|
+
: {
|
|
516
|
+
status: "deny",
|
|
517
|
+
plan,
|
|
518
|
+
reason: decision.reason ?? "Approval denied",
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
const request = {
|
|
522
|
+
executionId: plan.metadata.toolExecutionId ?? "",
|
|
523
|
+
approvalRequestId: plan.metadata.approvalRequestId,
|
|
524
|
+
resumeToken: plan.resumeToken,
|
|
525
|
+
approved: decision.approved,
|
|
526
|
+
decidedBy: decision.resolvedBy === "user"
|
|
527
|
+
? (trimString(input.cfg.user?.id) ?? "user")
|
|
528
|
+
: "policy",
|
|
529
|
+
reason: decision.reason,
|
|
530
|
+
};
|
|
531
|
+
try {
|
|
532
|
+
const response = await resumeToolExecutionWithPlatform(plan.config, request, signal);
|
|
533
|
+
const nextPlan = {
|
|
534
|
+
...plan,
|
|
535
|
+
metadata: {
|
|
536
|
+
toolExecutionId: response.execution.id ?? plan.metadata.toolExecutionId,
|
|
537
|
+
approvalRequestId: response.execution.approvalWait?.approvalRequestId ??
|
|
538
|
+
plan.metadata.approvalRequestId,
|
|
539
|
+
},
|
|
540
|
+
};
|
|
541
|
+
switch (response.execution.state) {
|
|
542
|
+
case "TOOL_EXECUTION_STATE_DENIED":
|
|
543
|
+
case "TOOL_EXECUTION_STATE_FAILED":
|
|
544
|
+
case "TOOL_EXECUTION_STATE_CANCELLED":
|
|
545
|
+
return {
|
|
546
|
+
status: "deny",
|
|
547
|
+
plan: nextPlan,
|
|
548
|
+
reason: response.execution.errorMessage ??
|
|
549
|
+
decision.reason ??
|
|
550
|
+
"Platform ToolExecution denied the action",
|
|
551
|
+
};
|
|
552
|
+
default:
|
|
553
|
+
return { status: "allow", plan: nextPlan };
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
catch (error) {
|
|
557
|
+
if (isAbortError(error)) {
|
|
558
|
+
throw error;
|
|
559
|
+
}
|
|
560
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
561
|
+
return decision.approved
|
|
562
|
+
? {
|
|
563
|
+
status: "deny",
|
|
564
|
+
plan,
|
|
565
|
+
reason: `Platform ToolExecution decision sync failed: ${message}`,
|
|
566
|
+
}
|
|
567
|
+
: {
|
|
568
|
+
status: "deny",
|
|
569
|
+
plan,
|
|
570
|
+
reason: decision.reason ?? `Approval denied (${message})`,
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
async recordObservation(plan, result, signal) {
|
|
575
|
+
const summary = summarizeToolResult(result);
|
|
576
|
+
const request = {
|
|
577
|
+
...plan.request,
|
|
578
|
+
metadata: {
|
|
579
|
+
...plan.request.metadata,
|
|
580
|
+
maestro_bridge_mode: "observe",
|
|
581
|
+
maestro_local_outcome: result.isError ? "failed" : "succeeded",
|
|
582
|
+
maestro_local_output_summary: summary.summary,
|
|
583
|
+
maestro_local_output_redactions: summary.redactions.length > 0 ? summary.redactions.join(",") : "none",
|
|
584
|
+
},
|
|
585
|
+
};
|
|
586
|
+
try {
|
|
587
|
+
const response = await executeToolWithPlatform(plan.config, request, signal);
|
|
588
|
+
return {
|
|
589
|
+
metadata: {
|
|
590
|
+
toolExecutionId: response.execution.id,
|
|
591
|
+
approvalRequestId: response.execution.approvalWait?.approvalRequestId,
|
|
592
|
+
},
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
catch (error) {
|
|
596
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
597
|
+
logger.warn("Failed to record observe-only tool execution", {
|
|
598
|
+
error: message,
|
|
599
|
+
toolName: plan.request.tool.name,
|
|
600
|
+
toolCallId: plan.request.metadata?.maestro_tool_call_id,
|
|
601
|
+
});
|
|
602
|
+
return { metadata: plan.metadata };
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
async recordGovernedOutput(plan, result, durationMs, signal) {
|
|
606
|
+
const executionId = plan.metadata.toolExecutionId;
|
|
607
|
+
if (!executionId) {
|
|
608
|
+
return { metadata: plan.metadata };
|
|
609
|
+
}
|
|
610
|
+
const request = {
|
|
611
|
+
executionId,
|
|
612
|
+
output: buildOutputPayload(result, durationMs),
|
|
613
|
+
metadata: {
|
|
614
|
+
...plan.request.metadata,
|
|
615
|
+
maestro_bridge_mode: "governed",
|
|
616
|
+
maestro_local_outcome: result.isError ? "failed" : "succeeded",
|
|
617
|
+
maestro_tool_call_id: result.toolCallId,
|
|
618
|
+
},
|
|
619
|
+
};
|
|
620
|
+
try {
|
|
621
|
+
const response = await recordToolExecutionOutputWithPlatform(plan.config, request, signal);
|
|
622
|
+
return {
|
|
623
|
+
metadata: {
|
|
624
|
+
toolExecutionId: response.execution.id ?? executionId,
|
|
625
|
+
approvalRequestId: response.execution.approvalWait?.approvalRequestId ??
|
|
626
|
+
plan.metadata.approvalRequestId,
|
|
627
|
+
},
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
catch (error) {
|
|
631
|
+
if (isAbortError(error)) {
|
|
632
|
+
throw error;
|
|
633
|
+
}
|
|
634
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
635
|
+
logger.warn("Failed to record governed tool execution output", {
|
|
636
|
+
error: message,
|
|
637
|
+
toolName: plan.request.tool.name,
|
|
638
|
+
toolCallId: result.toolCallId,
|
|
639
|
+
toolExecutionId: executionId,
|
|
640
|
+
});
|
|
641
|
+
return { metadata: plan.metadata };
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
let defaultBridge = null;
|
|
646
|
+
export function getDefaultPlatformToolExecutionBridge() {
|
|
647
|
+
if (!defaultBridge) {
|
|
648
|
+
defaultBridge = new DefaultPlatformToolExecutionBridge();
|
|
649
|
+
}
|
|
650
|
+
return defaultBridge;
|
|
651
|
+
}
|
|
652
|
+
export function buildObservedResultMetadata(plan, observation) {
|
|
653
|
+
if (!plan) {
|
|
654
|
+
return observation?.metadata ?? {};
|
|
655
|
+
}
|
|
656
|
+
return {
|
|
657
|
+
toolExecutionId: observation?.metadata.toolExecutionId ?? plan.metadata.toolExecutionId,
|
|
658
|
+
approvalRequestId: observation?.metadata.approvalRequestId ??
|
|
659
|
+
plan.metadata.approvalRequestId,
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
function isAbortError(error) {
|
|
663
|
+
return error instanceof Error && error.name === "AbortError";
|
|
664
|
+
}
|
|
665
|
+
//# sourceMappingURL=tool-execution-bridge.js.map
|