@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,119 @@
|
|
|
1
|
+
const SUMMARY_LIMIT = 180;
|
|
2
|
+
const SECRET_PATTERNS = [
|
|
3
|
+
[/\b(Bearer\s+)[A-Za-z0-9._~+/=-]{16,}/gi, "$1[redacted]"],
|
|
4
|
+
[/\b(sk-[A-Za-z0-9_-]{16,})\b/g, "[redacted-secret]"],
|
|
5
|
+
[/\b(gh[pousr]_[A-Za-z0-9_]{16,})\b/g, "[redacted-token]"],
|
|
6
|
+
[/\b(xox[a-zA-Z]?-[A-Za-z0-9-]{16,})\b/g, "[redacted-token]"],
|
|
7
|
+
[/\b(AKIA[0-9A-Z]{16})\b/g, "[redacted-access-key]"],
|
|
8
|
+
];
|
|
9
|
+
const ALWAYS_SENSITIVE_KEY_TOKENS = new Set([
|
|
10
|
+
"arg",
|
|
11
|
+
"args",
|
|
12
|
+
"argument",
|
|
13
|
+
"arguments",
|
|
14
|
+
"body",
|
|
15
|
+
"command",
|
|
16
|
+
"commands",
|
|
17
|
+
"content",
|
|
18
|
+
"credential",
|
|
19
|
+
"credentials",
|
|
20
|
+
"env",
|
|
21
|
+
"header",
|
|
22
|
+
"headers",
|
|
23
|
+
"input",
|
|
24
|
+
"inputs",
|
|
25
|
+
"output",
|
|
26
|
+
"outputs",
|
|
27
|
+
"password",
|
|
28
|
+
"passwords",
|
|
29
|
+
"prompt",
|
|
30
|
+
"prompts",
|
|
31
|
+
"secret",
|
|
32
|
+
"secrets",
|
|
33
|
+
"stderr",
|
|
34
|
+
"stdout",
|
|
35
|
+
"token",
|
|
36
|
+
"tokens",
|
|
37
|
+
"transcript",
|
|
38
|
+
"transcripts",
|
|
39
|
+
]);
|
|
40
|
+
const SENSITIVE_EXACT_KEYS = new Set(["request", "response"]);
|
|
41
|
+
const REQUEST_RESPONSE_BODY_TOKENS = new Set([
|
|
42
|
+
"body",
|
|
43
|
+
"content",
|
|
44
|
+
"data",
|
|
45
|
+
"payload",
|
|
46
|
+
"raw",
|
|
47
|
+
"text",
|
|
48
|
+
]);
|
|
49
|
+
function stringValue(value) {
|
|
50
|
+
return typeof value === "string" && value.trim().length > 0
|
|
51
|
+
? value.trim()
|
|
52
|
+
: undefined;
|
|
53
|
+
}
|
|
54
|
+
export function redactTimelineSecrets(value) {
|
|
55
|
+
let redacted = value;
|
|
56
|
+
for (const [pattern, replacement] of SECRET_PATTERNS) {
|
|
57
|
+
redacted = redacted.replace(pattern, replacement);
|
|
58
|
+
}
|
|
59
|
+
return redacted;
|
|
60
|
+
}
|
|
61
|
+
export function compactTimelineSummary(value) {
|
|
62
|
+
const text = stringValue(value);
|
|
63
|
+
if (!text)
|
|
64
|
+
return undefined;
|
|
65
|
+
const singleLine = redactTimelineSecrets(text.replace(/\s+/g, " ").trim());
|
|
66
|
+
if (!singleLine)
|
|
67
|
+
return undefined;
|
|
68
|
+
if (singleLine.length <= SUMMARY_LIMIT)
|
|
69
|
+
return singleLine;
|
|
70
|
+
return `${singleLine.slice(0, SUMMARY_LIMIT - 3)}...`;
|
|
71
|
+
}
|
|
72
|
+
export function compactTimelineMetadata(values) {
|
|
73
|
+
const metadata = Object.fromEntries(Object.entries(values).filter(([, value]) => value !== undefined));
|
|
74
|
+
return Object.keys(metadata).length > 0 ? metadata : undefined;
|
|
75
|
+
}
|
|
76
|
+
function keyTokens(key) {
|
|
77
|
+
return key
|
|
78
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
79
|
+
.toLowerCase()
|
|
80
|
+
.split(/[^a-z0-9]+/u)
|
|
81
|
+
.filter(Boolean);
|
|
82
|
+
}
|
|
83
|
+
function isSensitiveMetadataKey(key) {
|
|
84
|
+
const tokens = keyTokens(key);
|
|
85
|
+
if (!tokens.length) {
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
if (SENSITIVE_EXACT_KEYS.has(tokens.join("_"))) {
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
if (tokens.some((token) => ALWAYS_SENSITIVE_KEY_TOKENS.has(token))) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
const hasRequestOrResponse = tokens.includes("request") || tokens.includes("response");
|
|
95
|
+
return (hasRequestOrResponse &&
|
|
96
|
+
tokens.some((token) => REQUEST_RESPONSE_BODY_TOKENS.has(token)));
|
|
97
|
+
}
|
|
98
|
+
function redactMetadataValue(value) {
|
|
99
|
+
if (typeof value === "string") {
|
|
100
|
+
return compactTimelineSummary(value);
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(value)) {
|
|
103
|
+
return value.map(redactMetadataValue).filter((item) => item !== undefined);
|
|
104
|
+
}
|
|
105
|
+
if (value && typeof value === "object") {
|
|
106
|
+
return redactTimelineMetadata(value);
|
|
107
|
+
}
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
export function redactTimelineMetadata(metadata) {
|
|
111
|
+
if (!metadata) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
const redacted = Object.fromEntries(Object.entries(metadata)
|
|
115
|
+
.filter(([key, value]) => value !== undefined && !isSensitiveMetadataKey(key))
|
|
116
|
+
.map(([key, value]) => [key, redactMetadataValue(value)]));
|
|
117
|
+
return Object.keys(redacted).length > 0 ? redacted : undefined;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=redaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redaction.js","sourceRoot":"","sources":["../../src/timeline/redaction.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,eAAe,GAA4B;IAChD,CAAC,wCAAwC,EAAE,cAAc,CAAC;IAC1D,CAAC,8BAA8B,EAAE,mBAAmB,CAAC;IACrD,CAAC,oCAAoC,EAAE,kBAAkB,CAAC;IAC1D,CAAC,uCAAuC,EAAE,kBAAkB,CAAC;IAC7D,CAAC,yBAAyB,EAAE,uBAAuB,CAAC;CACpD,CAAC;AAEF,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC;IAC3C,KAAK;IACL,MAAM;IACN,UAAU;IACV,WAAW;IACX,MAAM;IACN,SAAS;IACT,UAAU;IACV,SAAS;IACT,YAAY;IACZ,aAAa;IACb,KAAK;IACL,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,UAAU;IACV,WAAW;IACX,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,aAAa;CACb,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAE9D,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC;IAC5C,MAAM;IACN,SAAS;IACT,MAAM;IACN,SAAS;IACT,KAAK;IACL,MAAM;CACN,CAAC,CAAC;AAEH,SAAS,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AAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,sBAAsB,CAAC,KAAgC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB,CACrC,QAA6C;IAE7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;SACtB,MAAM,CACN,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,CACrE;SACA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,CAC1D,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AAChE,CAAC","sourcesContent":["const SUMMARY_LIMIT = 180;\n\nconst SECRET_PATTERNS: Array<[RegExp, string]> = [\n\t[/\\b(Bearer\\s+)[A-Za-z0-9._~+/=-]{16,}/gi, \"$1[redacted]\"],\n\t[/\\b(sk-[A-Za-z0-9_-]{16,})\\b/g, \"[redacted-secret]\"],\n\t[/\\b(gh[pousr]_[A-Za-z0-9_]{16,})\\b/g, \"[redacted-token]\"],\n\t[/\\b(xox[a-zA-Z]?-[A-Za-z0-9-]{16,})\\b/g, \"[redacted-token]\"],\n\t[/\\b(AKIA[0-9A-Z]{16})\\b/g, \"[redacted-access-key]\"],\n];\n\nconst ALWAYS_SENSITIVE_KEY_TOKENS = new Set([\n\t\"arg\",\n\t\"args\",\n\t\"argument\",\n\t\"arguments\",\n\t\"body\",\n\t\"command\",\n\t\"commands\",\n\t\"content\",\n\t\"credential\",\n\t\"credentials\",\n\t\"env\",\n\t\"header\",\n\t\"headers\",\n\t\"input\",\n\t\"inputs\",\n\t\"output\",\n\t\"outputs\",\n\t\"password\",\n\t\"passwords\",\n\t\"prompt\",\n\t\"prompts\",\n\t\"secret\",\n\t\"secrets\",\n\t\"stderr\",\n\t\"stdout\",\n\t\"token\",\n\t\"tokens\",\n\t\"transcript\",\n\t\"transcripts\",\n]);\n\nconst SENSITIVE_EXACT_KEYS = new Set([\"request\", \"response\"]);\n\nconst REQUEST_RESPONSE_BODY_TOKENS = new Set([\n\t\"body\",\n\t\"content\",\n\t\"data\",\n\t\"payload\",\n\t\"raw\",\n\t\"text\",\n]);\n\nfunction stringValue(value: unknown): string | undefined {\n\treturn typeof value === \"string\" && value.trim().length > 0\n\t\t? value.trim()\n\t\t: undefined;\n}\n\nexport function redactTimelineSecrets(value: string): string {\n\tlet redacted = value;\n\tfor (const [pattern, replacement] of SECRET_PATTERNS) {\n\t\tredacted = redacted.replace(pattern, replacement);\n\t}\n\treturn redacted;\n}\n\nexport function compactTimelineSummary(value: unknown): string | undefined {\n\tconst text = stringValue(value);\n\tif (!text) return undefined;\n\tconst singleLine = redactTimelineSecrets(text.replace(/\\s+/g, \" \").trim());\n\tif (!singleLine) return undefined;\n\tif (singleLine.length <= SUMMARY_LIMIT) return singleLine;\n\treturn `${singleLine.slice(0, SUMMARY_LIMIT - 3)}...`;\n}\n\nexport function compactTimelineMetadata(\n\tvalues: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n\tconst metadata = Object.fromEntries(\n\t\tObject.entries(values).filter(([, value]) => value !== undefined),\n\t);\n\treturn Object.keys(metadata).length > 0 ? metadata : undefined;\n}\n\nfunction keyTokens(key: string): string[] {\n\treturn key\n\t\t.replace(/([a-z0-9])([A-Z])/g, \"$1_$2\")\n\t\t.toLowerCase()\n\t\t.split(/[^a-z0-9]+/u)\n\t\t.filter(Boolean);\n}\n\nfunction isSensitiveMetadataKey(key: string): boolean {\n\tconst tokens = keyTokens(key);\n\tif (!tokens.length) {\n\t\treturn false;\n\t}\n\tif (SENSITIVE_EXACT_KEYS.has(tokens.join(\"_\"))) {\n\t\treturn true;\n\t}\n\tif (tokens.some((token) => ALWAYS_SENSITIVE_KEY_TOKENS.has(token))) {\n\t\treturn true;\n\t}\n\tconst hasRequestOrResponse =\n\t\ttokens.includes(\"request\") || tokens.includes(\"response\");\n\treturn (\n\t\thasRequestOrResponse &&\n\t\ttokens.some((token) => REQUEST_RESPONSE_BODY_TOKENS.has(token))\n\t);\n}\n\nfunction redactMetadataValue(value: unknown): unknown {\n\tif (typeof value === \"string\") {\n\t\treturn compactTimelineSummary(value);\n\t}\n\tif (Array.isArray(value)) {\n\t\treturn value.map(redactMetadataValue).filter((item) => item !== undefined);\n\t}\n\tif (value && typeof value === \"object\") {\n\t\treturn redactTimelineMetadata(value as Record<string, unknown>);\n\t}\n\treturn value;\n}\n\nexport function redactTimelineMetadata(\n\tmetadata: Record<string, unknown> | undefined,\n): Record<string, unknown> | undefined {\n\tif (!metadata) {\n\t\treturn undefined;\n\t}\n\tconst redacted = Object.fromEntries(\n\t\tObject.entries(metadata)\n\t\t\t.filter(\n\t\t\t\t([key, value]) => value !== undefined && !isSensitiveMetadataKey(key),\n\t\t\t)\n\t\t\t.map(([key, value]) => [key, redactMetadataValue(value)]),\n\t);\n\treturn Object.keys(redacted).length > 0 ? redacted : undefined;\n}\n"]}
|
package/dist/tools/ask-user.d.ts
CHANGED
|
@@ -5,9 +5,19 @@
|
|
|
5
5
|
* improving UX over free-form text input.
|
|
6
6
|
*/
|
|
7
7
|
import { type Static } from "@sinclair/typebox";
|
|
8
|
+
export declare const askUserOptionPreviewSchema: import("@sinclair/typebox").TObject<{
|
|
9
|
+
kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"diff">]>;
|
|
10
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
body: import("@sinclair/typebox").TString;
|
|
12
|
+
}>;
|
|
8
13
|
export declare const questionOptionSchema: import("@sinclair/typebox").TObject<{
|
|
9
14
|
label: import("@sinclair/typebox").TString;
|
|
10
15
|
description: import("@sinclair/typebox").TString;
|
|
16
|
+
preview: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
17
|
+
kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"diff">]>;
|
|
18
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
19
|
+
body: import("@sinclair/typebox").TString;
|
|
20
|
+
}>>;
|
|
11
21
|
}>;
|
|
12
22
|
export declare const questionSchema: import("@sinclair/typebox").TObject<{
|
|
13
23
|
question: import("@sinclair/typebox").TString;
|
|
@@ -15,6 +25,11 @@ export declare const questionSchema: import("@sinclair/typebox").TObject<{
|
|
|
15
25
|
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
16
26
|
label: import("@sinclair/typebox").TString;
|
|
17
27
|
description: import("@sinclair/typebox").TString;
|
|
28
|
+
preview: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
29
|
+
kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"diff">]>;
|
|
30
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
31
|
+
body: import("@sinclair/typebox").TString;
|
|
32
|
+
}>>;
|
|
18
33
|
}>>;
|
|
19
34
|
multiSelect: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
20
35
|
}>;
|
|
@@ -25,11 +40,17 @@ export declare const askUserSchema: import("@sinclair/typebox").TObject<{
|
|
|
25
40
|
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
26
41
|
label: import("@sinclair/typebox").TString;
|
|
27
42
|
description: import("@sinclair/typebox").TString;
|
|
43
|
+
preview: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
44
|
+
kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"diff">]>;
|
|
45
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
46
|
+
body: import("@sinclair/typebox").TString;
|
|
47
|
+
}>>;
|
|
28
48
|
}>>;
|
|
29
49
|
multiSelect: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
30
50
|
}>>;
|
|
31
51
|
}>;
|
|
32
52
|
export type QuestionOption = Static<typeof questionOptionSchema>;
|
|
53
|
+
export type AskUserOptionPreview = Static<typeof askUserOptionPreviewSchema>;
|
|
33
54
|
export type Question = Static<typeof questionSchema>;
|
|
34
55
|
export type AskUserInput = Static<typeof askUserSchema>;
|
|
35
56
|
export interface AskUserResult {
|
|
@@ -68,6 +89,11 @@ export declare const askUserTool: Readonly<{
|
|
|
68
89
|
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
|
69
90
|
label: import("@sinclair/typebox").TString;
|
|
70
91
|
description: import("@sinclair/typebox").TString;
|
|
92
|
+
preview: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
93
|
+
kind: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"diff">]>;
|
|
94
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
95
|
+
body: import("@sinclair/typebox").TString;
|
|
96
|
+
}>>;
|
|
71
97
|
}>>;
|
|
72
98
|
multiSelect: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
73
99
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.d.ts","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,oBAAoB
|
|
1
|
+
{"version":3,"file":"ask-user.d.ts","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,eAAO,MAAM,0BAA0B;;;;EAqBrC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;EAc/B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;EA0BzB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;EAMxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC7E,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAExD,MAAM,WAAW,aAAa;IAC7B,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IACxC,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,KAAK,cAAc,GAAG;IACrB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,MAAM,CAyBvE;AAYD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GAChB,MAAM,GAAG,MAAM,EAAE,CAgCnB;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CtB,CAAC;AAEH;;GAEG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAE,CAG1E"}
|
package/dist/tools/ask-user.js
CHANGED
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
8
8
|
import { createTool } from "./tool-dsl.js";
|
|
9
|
+
export const askUserOptionPreviewSchema = Type.Object({
|
|
10
|
+
kind: Type.Union([Type.Literal("markdown"), Type.Literal("text"), Type.Literal("diff")], {
|
|
11
|
+
description: "Preview format. Raw HTML is intentionally unsupported; use markdown, text, or diff.",
|
|
12
|
+
}),
|
|
13
|
+
title: Type.Optional(Type.String({
|
|
14
|
+
description: "Optional short preview title.",
|
|
15
|
+
minLength: 1,
|
|
16
|
+
maxLength: 80,
|
|
17
|
+
})),
|
|
18
|
+
body: Type.String({
|
|
19
|
+
description: "Preview content shown with the option. Keep it focused; large artifacts should be summarized.",
|
|
20
|
+
minLength: 1,
|
|
21
|
+
maxLength: 12_000,
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
9
24
|
export const questionOptionSchema = Type.Object({
|
|
10
25
|
label: Type.String({
|
|
11
26
|
description: "The display text for this option (1-5 words). Should clearly describe the choice.",
|
|
@@ -17,6 +32,7 @@ export const questionOptionSchema = Type.Object({
|
|
|
17
32
|
minLength: 1,
|
|
18
33
|
maxLength: 200,
|
|
19
34
|
}),
|
|
35
|
+
preview: Type.Optional(askUserOptionPreviewSchema),
|
|
20
36
|
});
|
|
21
37
|
export const questionSchema = Type.Object({
|
|
22
38
|
question: Type.String({
|
|
@@ -56,6 +72,11 @@ export function formatQuestionsForDisplay(questions) {
|
|
|
56
72
|
for (const [optIndex, opt] of q.options.entries()) {
|
|
57
73
|
const marker = q.multiSelect ? "☐" : "○";
|
|
58
74
|
lines.push(` ${marker} ${optIndex + 1}. **${opt.label}**: ${opt.description}`);
|
|
75
|
+
if (opt.preview) {
|
|
76
|
+
const title = opt.preview.title ? `: ${opt.preview.title}` : "";
|
|
77
|
+
lines.push(` Preview (${opt.preview.kind}${title})`);
|
|
78
|
+
lines.push(...formatPreviewBodyForDisplay(opt.preview.body));
|
|
79
|
+
}
|
|
59
80
|
}
|
|
60
81
|
lines.push(` ${q.multiSelect ? "☐" : "○"} ${q.options.length + 1}. **Other**: Provide custom answer`);
|
|
61
82
|
if (index < questions.length - 1) {
|
|
@@ -64,6 +85,15 @@ export function formatQuestionsForDisplay(questions) {
|
|
|
64
85
|
}
|
|
65
86
|
return lines.join("\n");
|
|
66
87
|
}
|
|
88
|
+
function formatPreviewBodyForDisplay(body) {
|
|
89
|
+
const lines = body.split(/\r?\n/);
|
|
90
|
+
const visibleLines = lines.slice(0, 12);
|
|
91
|
+
const formatted = visibleLines.map((line) => ` ${line}`);
|
|
92
|
+
if (lines.length > visibleLines.length) {
|
|
93
|
+
formatted.push(" ...");
|
|
94
|
+
}
|
|
95
|
+
return formatted;
|
|
96
|
+
}
|
|
67
97
|
/**
|
|
68
98
|
* Parse user response to questions.
|
|
69
99
|
* Supports formats like:
|
|
@@ -114,10 +144,12 @@ Parameters:
|
|
|
114
144
|
- question: The full question text
|
|
115
145
|
- header: Short label (max 12 chars) like "Library", "Approach"
|
|
116
146
|
- options: 2-4 choices with label and description
|
|
147
|
+
- options[].preview: Optional markdown/text/diff preview for concrete artifacts
|
|
117
148
|
- multiSelect: Allow multiple selections (default: false)
|
|
118
149
|
|
|
119
150
|
An "Other" option is automatically added to allow custom input.
|
|
120
|
-
Users can respond with option numbers, labels, or free text
|
|
151
|
+
Users can respond with option numbers, labels, or free text.
|
|
152
|
+
Preview HTML is not supported; use markdown, text, or diff so clients can render previews safely.`,
|
|
121
153
|
schema: askUserSchema,
|
|
122
154
|
// This tool requires special handling - the TUI will intercept it
|
|
123
155
|
// and display a proper selection UI rather than executing directly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QAClB,WAAW,EACV,mFAAmF;QACpF,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;KACb,CAAC;IACF,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;QACxB,WAAW,EACV,sEAAsE;QACvE,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,GAAG;KACd,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;QACrB,WAAW,EACV,iJAAiJ;QAClJ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,GAA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,OAAO,QAAQ,KAAK,UAAU,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA6B;IAC7D,MAAM,KAAK,GAAG,IAAoB,CAAC;IACnC,OAAO,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Structured question tool for gathering user input.\n *\n * Provides a structured way to ask users questions with predefined options,\n * improving UX over free-form text input.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { createTool } from \"./tool-dsl.js\";\n\nexport const questionOptionSchema = Type.Object({\n\tlabel: Type.String({\n\t\tdescription:\n\t\t\t\"The display text for this option (1-5 words). Should clearly describe the choice.\",\n\t\tminLength: 1,\n\t\tmaxLength: 50,\n\t}),\n\tdescription: Type.String({\n\t\tdescription:\n\t\t\t\"Explanation of what this option means or what will happen if chosen.\",\n\t\tminLength: 1,\n\t\tmaxLength: 200,\n\t}),\n});\n\nexport const questionSchema = Type.Object({\n\tquestion: Type.String({\n\t\tdescription:\n\t\t\t'The complete question to ask. Should be clear, specific, and end with a question mark. E.g., \"Which library should we use for date formatting?\"',\n\t\tminLength: 5,\n\t\tmaxLength: 500,\n\t}),\n\theader: Type.String({\n\t\tdescription:\n\t\t\t'Short label displayed as a chip/tag (max 12 chars). E.g., \"Auth method\", \"Library\", \"Approach\".',\n\t\tminLength: 1,\n\t\tmaxLength: 12,\n\t}),\n\toptions: Type.Array(questionOptionSchema, {\n\t\tdescription:\n\t\t\t\"Available choices (2-4 options). Each should be distinct. An 'Other' option is automatically added.\",\n\t\tminItems: 2,\n\t\tmaxItems: 4,\n\t}),\n\tmultiSelect: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"Allow selecting multiple options. Use when choices are not mutually exclusive.\",\n\t\t\tdefault: false,\n\t\t}),\n\t),\n});\n\nexport const askUserSchema = Type.Object({\n\tquestions: Type.Array(questionSchema, {\n\t\tdescription: \"Questions to ask the user (1-4 questions)\",\n\t\tminItems: 1,\n\t\tmaxItems: 4,\n\t}),\n});\n\nexport type QuestionOption = Static<typeof questionOptionSchema>;\nexport type Question = Static<typeof questionSchema>;\nexport type AskUserInput = Static<typeof askUserSchema>;\n\nexport interface AskUserResult {\n\t/** Whether the user provided answers */\n\tanswered: boolean;\n\t/** Map of question index to selected option(s) */\n\tanswers: Map<number, string | string[]>;\n\t/** Raw answer data */\n\trawAnswers: Record<string, string>;\n}\n\ntype AskUserDetails = {\n\tquestions: Question[];\n\tstatus: \"pending\" | \"answered\" | \"cancelled\";\n};\n\n/**\n * Format questions for display when the tool is invoked.\n */\nexport function formatQuestionsForDisplay(questions: Question[]): string {\n\tconst lines: string[] = [];\n\n\tfor (const [index, q] of questions.entries()) {\n\t\tlines.push(`**[${q.header}]** ${q.question}`);\n\t\tfor (const [optIndex, opt] of q.options.entries()) {\n\t\t\tconst marker = q.multiSelect ? \"☐\" : \"○\";\n\t\t\tlines.push(\n\t\t\t\t` ${marker} ${optIndex + 1}. **${opt.label}**: ${opt.description}`,\n\t\t\t);\n\t\t}\n\t\tlines.push(\n\t\t\t` ${q.multiSelect ? \"☐\" : \"○\"} ${q.options.length + 1}. **Other**: Provide custom answer`,\n\t\t);\n\t\tif (index < questions.length - 1) {\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\n/**\n * Parse user response to questions.\n * Supports formats like:\n * - \"1\" (single selection)\n * - \"1, 3\" (multi-select)\n * - \"Option A\" (label match)\n * - Free text (for \"Other\")\n */\nexport function parseUserResponse(\n\tresponse: string,\n\tquestion: Question,\n): string | string[] {\n\tconst trimmed = response.trim();\n\n\t// Check if it's a number or comma-separated numbers\n\tconst numbers = trimmed\n\t\t.split(/[,\\s]+/)\n\t\t.map((s) => Number.parseInt(s.trim(), 10));\n\tconst allValidNumbers = numbers.every((n) => !Number.isNaN(n));\n\n\tif (allValidNumbers && numbers.length > 0) {\n\t\tconst selected = numbers\n\t\t\t.filter((n) => n >= 1 && n <= question.options.length + 1)\n\t\t\t.map((n) => {\n\t\t\t\tif (n === question.options.length + 1) {\n\t\t\t\t\treturn \"Other\";\n\t\t\t\t}\n\t\t\t\treturn question.options[n - 1]?.label || `Option ${n}`;\n\t\t\t});\n\n\t\treturn question.multiSelect ? selected : selected[0] || trimmed;\n\t}\n\n\t// Check if it matches an option label\n\tconst matchedOption = question.options.find(\n\t\t(opt) => opt.label.toLowerCase() === trimmed.toLowerCase(),\n\t);\n\tif (matchedOption) {\n\t\treturn matchedOption.label;\n\t}\n\n\t// Return as free-form answer\n\treturn trimmed;\n}\n\nexport const askUserTool = createTool<typeof askUserSchema, AskUserDetails>({\n\tname: \"ask_user\",\n\tlabel: \"ask\",\n\tdescription: `Ask the user structured questions with predefined options.\n\nUse this tool when you need to:\n- Gather user preferences or requirements\n- Clarify ambiguous instructions\n- Get decisions on implementation choices\n- Offer choices about direction to take\n\nParameters:\n- questions: Array of 1-4 questions, each with:\n - question: The full question text\n - header: Short label (max 12 chars) like \"Library\", \"Approach\"\n - options: 2-4 choices with label and description\n - multiSelect: Allow multiple selections (default: false)\n\nAn \"Other\" option is automatically added to allow custom input.\nUsers can respond with option numbers, labels, or free text.`,\n\tschema: askUserSchema,\n\n\t// This tool requires special handling - the TUI will intercept it\n\t// and display a proper selection UI rather than executing directly\n\tdeferApiDefinition: true,\n\n\tasync run({ questions }, { respond }) {\n\t\t// Format the questions for display\n\t\t// In practice, this tool should be intercepted by the UI layer\n\t\t// before reaching here, but we provide a fallback text format\n\n\t\tconst formatted = formatQuestionsForDisplay(questions);\n\n\t\treturn respond\n\t\t\t.text(\n\t\t\t\t`Please answer the following question(s):\\n\\n${formatted}\\n\\nReply with option numbers (e.g., '1' or '1, 3' for multi-select), option labels, or your own answer for 'Other'.`,\n\t\t\t)\n\t\t\t.detail({\n\t\t\t\tquestions,\n\t\t\t\tstatus: \"pending\",\n\t\t\t});\n\t},\n});\n\n/**\n * Check if a tool call is an ask_user call.\n */\nexport function isAskUserCall(\n\ttoolName: string,\n\t_args: Record<string, unknown>,\n): boolean {\n\treturn toolName === \"ask_user\";\n}\n\n/**\n * Extract questions from an ask_user tool call.\n */\nexport function extractQuestions(args: Record<string, unknown>): Question[] {\n\tconst input = args as AskUserInput;\n\treturn input.questions || [];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ask-user.js","sourceRoot":"","sources":["../../src/tools/ask-user.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC,KAAK,CACf,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EACtE;QACC,WAAW,EACV,qFAAqF;KACtF,CACD;IACD,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,MAAM,CAAC;QACX,WAAW,EAAE,+BAA+B;QAC5C,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;KACb,CAAC,CACF;IACD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QACjB,WAAW,EACV,+FAA+F;QAChG,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,MAAM;KACjB,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;QAClB,WAAW,EACV,mFAAmF;QACpF,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;KACb,CAAC;IACF,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;QACxB,WAAW,EACV,sEAAsE;QACvE,SAAS,EA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IAA6B;IAC7D,MAAM,KAAK,GAAG,IAAoB,CAAC;IACnC,OAAO,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Structured question tool for gathering user input.\n *\n * Provides a structured way to ask users questions with predefined options,\n * improving UX over free-form text input.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\nimport { createTool } from \"./tool-dsl.js\";\n\nexport const askUserOptionPreviewSchema = Type.Object({\n\tkind: Type.Union(\n\t\t[Type.Literal(\"markdown\"), Type.Literal(\"text\"), Type.Literal(\"diff\")],\n\t\t{\n\t\t\tdescription:\n\t\t\t\t\"Preview format. Raw HTML is intentionally unsupported; use markdown, text, or diff.\",\n\t\t},\n\t),\n\ttitle: Type.Optional(\n\t\tType.String({\n\t\t\tdescription: \"Optional short preview title.\",\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 80,\n\t\t}),\n\t),\n\tbody: Type.String({\n\t\tdescription:\n\t\t\t\"Preview content shown with the option. Keep it focused; large artifacts should be summarized.\",\n\t\tminLength: 1,\n\t\tmaxLength: 12_000,\n\t}),\n});\n\nexport const questionOptionSchema = Type.Object({\n\tlabel: Type.String({\n\t\tdescription:\n\t\t\t\"The display text for this option (1-5 words). Should clearly describe the choice.\",\n\t\tminLength: 1,\n\t\tmaxLength: 50,\n\t}),\n\tdescription: Type.String({\n\t\tdescription:\n\t\t\t\"Explanation of what this option means or what will happen if chosen.\",\n\t\tminLength: 1,\n\t\tmaxLength: 200,\n\t}),\n\tpreview: Type.Optional(askUserOptionPreviewSchema),\n});\n\nexport const questionSchema = Type.Object({\n\tquestion: Type.String({\n\t\tdescription:\n\t\t\t'The complete question to ask. Should be clear, specific, and end with a question mark. E.g., \"Which library should we use for date formatting?\"',\n\t\tminLength: 5,\n\t\tmaxLength: 500,\n\t}),\n\theader: Type.String({\n\t\tdescription:\n\t\t\t'Short label displayed as a chip/tag (max 12 chars). E.g., \"Auth method\", \"Library\", \"Approach\".',\n\t\tminLength: 1,\n\t\tmaxLength: 12,\n\t}),\n\toptions: Type.Array(questionOptionSchema, {\n\t\tdescription:\n\t\t\t\"Available choices (2-4 options). Each should be distinct. An 'Other' option is automatically added.\",\n\t\tminItems: 2,\n\t\tmaxItems: 4,\n\t}),\n\tmultiSelect: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"Allow selecting multiple options. Use when choices are not mutually exclusive.\",\n\t\t\tdefault: false,\n\t\t}),\n\t),\n});\n\nexport const askUserSchema = Type.Object({\n\tquestions: Type.Array(questionSchema, {\n\t\tdescription: \"Questions to ask the user (1-4 questions)\",\n\t\tminItems: 1,\n\t\tmaxItems: 4,\n\t}),\n});\n\nexport type QuestionOption = Static<typeof questionOptionSchema>;\nexport type AskUserOptionPreview = Static<typeof askUserOptionPreviewSchema>;\nexport type Question = Static<typeof questionSchema>;\nexport type AskUserInput = Static<typeof askUserSchema>;\n\nexport interface AskUserResult {\n\t/** Whether the user provided answers */\n\tanswered: boolean;\n\t/** Map of question index to selected option(s) */\n\tanswers: Map<number, string | string[]>;\n\t/** Raw answer data */\n\trawAnswers: Record<string, string>;\n}\n\ntype AskUserDetails = {\n\tquestions: Question[];\n\tstatus: \"pending\" | \"answered\" | \"cancelled\";\n};\n\n/**\n * Format questions for display when the tool is invoked.\n */\nexport function formatQuestionsForDisplay(questions: Question[]): string {\n\tconst lines: string[] = [];\n\n\tfor (const [index, q] of questions.entries()) {\n\t\tlines.push(`**[${q.header}]** ${q.question}`);\n\t\tfor (const [optIndex, opt] of q.options.entries()) {\n\t\t\tconst marker = q.multiSelect ? \"☐\" : \"○\";\n\t\t\tlines.push(\n\t\t\t\t` ${marker} ${optIndex + 1}. **${opt.label}**: ${opt.description}`,\n\t\t\t);\n\t\t\tif (opt.preview) {\n\t\t\t\tconst title = opt.preview.title ? `: ${opt.preview.title}` : \"\";\n\t\t\t\tlines.push(` Preview (${opt.preview.kind}${title})`);\n\t\t\t\tlines.push(...formatPreviewBodyForDisplay(opt.preview.body));\n\t\t\t}\n\t\t}\n\t\tlines.push(\n\t\t\t` ${q.multiSelect ? \"☐\" : \"○\"} ${q.options.length + 1}. **Other**: Provide custom answer`,\n\t\t);\n\t\tif (index < questions.length - 1) {\n\t\t\tlines.push(\"\");\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n\nfunction formatPreviewBodyForDisplay(body: string): string[] {\n\tconst lines = body.split(/\\r?\\n/);\n\tconst visibleLines = lines.slice(0, 12);\n\tconst formatted = visibleLines.map((line) => ` ${line}`);\n\tif (lines.length > visibleLines.length) {\n\t\tformatted.push(\" ...\");\n\t}\n\treturn formatted;\n}\n\n/**\n * Parse user response to questions.\n * Supports formats like:\n * - \"1\" (single selection)\n * - \"1, 3\" (multi-select)\n * - \"Option A\" (label match)\n * - Free text (for \"Other\")\n */\nexport function parseUserResponse(\n\tresponse: string,\n\tquestion: Question,\n): string | string[] {\n\tconst trimmed = response.trim();\n\n\t// Check if it's a number or comma-separated numbers\n\tconst numbers = trimmed\n\t\t.split(/[,\\s]+/)\n\t\t.map((s) => Number.parseInt(s.trim(), 10));\n\tconst allValidNumbers = numbers.every((n) => !Number.isNaN(n));\n\n\tif (allValidNumbers && numbers.length > 0) {\n\t\tconst selected = numbers\n\t\t\t.filter((n) => n >= 1 && n <= question.options.length + 1)\n\t\t\t.map((n) => {\n\t\t\t\tif (n === question.options.length + 1) {\n\t\t\t\t\treturn \"Other\";\n\t\t\t\t}\n\t\t\t\treturn question.options[n - 1]?.label || `Option ${n}`;\n\t\t\t});\n\n\t\treturn question.multiSelect ? selected : selected[0] || trimmed;\n\t}\n\n\t// Check if it matches an option label\n\tconst matchedOption = question.options.find(\n\t\t(opt) => opt.label.toLowerCase() === trimmed.toLowerCase(),\n\t);\n\tif (matchedOption) {\n\t\treturn matchedOption.label;\n\t}\n\n\t// Return as free-form answer\n\treturn trimmed;\n}\n\nexport const askUserTool = createTool<typeof askUserSchema, AskUserDetails>({\n\tname: \"ask_user\",\n\tlabel: \"ask\",\n\tdescription: `Ask the user structured questions with predefined options.\n\nUse this tool when you need to:\n- Gather user preferences or requirements\n- Clarify ambiguous instructions\n- Get decisions on implementation choices\n- Offer choices about direction to take\n\nParameters:\n- questions: Array of 1-4 questions, each with:\n - question: The full question text\n - header: Short label (max 12 chars) like \"Library\", \"Approach\"\n - options: 2-4 choices with label and description\n - options[].preview: Optional markdown/text/diff preview for concrete artifacts\n - multiSelect: Allow multiple selections (default: false)\n\nAn \"Other\" option is automatically added to allow custom input.\nUsers can respond with option numbers, labels, or free text.\nPreview HTML is not supported; use markdown, text, or diff so clients can render previews safely.`,\n\tschema: askUserSchema,\n\n\t// This tool requires special handling - the TUI will intercept it\n\t// and display a proper selection UI rather than executing directly\n\tdeferApiDefinition: true,\n\n\tasync run({ questions }, { respond }) {\n\t\t// Format the questions for display\n\t\t// In practice, this tool should be intercepted by the UI layer\n\t\t// before reaching here, but we provide a fallback text format\n\n\t\tconst formatted = formatQuestionsForDisplay(questions);\n\n\t\treturn respond\n\t\t\t.text(\n\t\t\t\t`Please answer the following question(s):\\n\\n${formatted}\\n\\nReply with option numbers (e.g., '1' or '1, 3' for multi-select), option labels, or your own answer for 'Other'.`,\n\t\t\t)\n\t\t\t.detail({\n\t\t\t\tquestions,\n\t\t\t\tstatus: \"pending\",\n\t\t\t});\n\t},\n});\n\n/**\n * Check if a tool call is an ask_user call.\n */\nexport function isAskUserCall(\n\ttoolName: string,\n\t_args: Record<string, unknown>,\n): boolean {\n\treturn toolName === \"ask_user\";\n}\n\n/**\n * Extract questions from an ask_user tool call.\n */\nexport function extractQuestions(args: Record<string, unknown>): Question[] {\n\tconst input = args as AskUserInput;\n\treturn input.questions || [];\n}\n"]}
|
|
@@ -129,6 +129,6 @@ export declare function buildTaskDetail(task: BackgroundTask): {
|
|
|
129
129
|
limits: TaskRuntimeLimits;
|
|
130
130
|
resourceUsage: TaskResourceUsage | null;
|
|
131
131
|
failureReason: string | null;
|
|
132
|
-
monitoringMode: "
|
|
132
|
+
monitoringMode: "disabled" | "proc" | "ps";
|
|
133
133
|
};
|
|
134
134
|
//# sourceMappingURL=task-types.d.ts.map
|
package/dist/tools/edit.d.ts
CHANGED
|
@@ -35,11 +35,13 @@
|
|
|
35
35
|
*
|
|
36
36
|
* @module tools/edit
|
|
37
37
|
*/
|
|
38
|
+
import { type DiagnosticDeltaToolSummary } from "../lsp/diagnostic-repair.js";
|
|
38
39
|
import type { ValidatorRunResult } from "../safety/safe-mode.js";
|
|
39
40
|
type EditToolDetails = {
|
|
40
41
|
diff: string;
|
|
41
42
|
editsApplied?: number;
|
|
42
43
|
validators?: ValidatorRunResult[];
|
|
44
|
+
diagnosticDelta?: DiagnosticDeltaToolSummary;
|
|
43
45
|
mode?: "sandbox";
|
|
44
46
|
};
|
|
45
47
|
export declare const editTool: Readonly<{
|
package/dist/tools/edit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/tools/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../src/tools/edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAWH,OAAO,EACN,KAAK,0BAA0B,EAG/B,MAAM,6BAA6B,CAAC;AAMrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAwHjE,KAAK,eAAe,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClC,eAAe,CAAC,EAAE,0BAA0B,CAAC;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgSnB,CAAC"}
|
package/dist/tools/edit.js
CHANGED
|
@@ -40,7 +40,8 @@ import { constants } from "node:fs";
|
|
|
40
40
|
import { access, readFile, rename, unlink, writeFile } from "node:fs/promises";
|
|
41
41
|
import { resolve as resolvePath } from "node:path";
|
|
42
42
|
import { Type } from "@sinclair/typebox";
|
|
43
|
-
import {
|
|
43
|
+
import { captureDiagnosticBaseline, collectDiagnosticDelta, } from "../lsp/diagnostic-deltas.js";
|
|
44
|
+
import { buildDiagnosticDeltaToolSummary, formatDiagnosticDeltaForToolOutput, } from "../lsp/diagnostic-repair.js";
|
|
44
45
|
import { assertTeamMemoryContentSafe } from "../memory/team-memory.js";
|
|
45
46
|
import { requirePlanCheck, runValidatorsOnSuccess, } from "../safety/safe-mode.js";
|
|
46
47
|
import { formatLspDiagnostics, generateDiffString } from "./diff-utils.js";
|
|
@@ -299,16 +300,26 @@ If "not found", read file to check actual content.`,
|
|
|
299
300
|
editsApplied: hasMultiEdit ? replacementCount : undefined,
|
|
300
301
|
});
|
|
301
302
|
}
|
|
303
|
+
const diagnosticBaseline = await captureDiagnosticBaseline(absolutePath);
|
|
304
|
+
throwIfAborted();
|
|
302
305
|
await writeFileAtomically(absolutePath, newContent);
|
|
303
306
|
let validatorSummaries;
|
|
304
307
|
let linterOutput = "";
|
|
308
|
+
let diagnosticDeltaSummary;
|
|
305
309
|
try {
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
const diagnosticDelta = await collectDiagnosticDelta(diagnosticBaseline);
|
|
311
|
+
diagnosticDeltaSummary = buildDiagnosticDeltaToolSummary({
|
|
312
|
+
file: absolutePath,
|
|
313
|
+
displayPath: path,
|
|
314
|
+
result: diagnosticDelta,
|
|
315
|
+
});
|
|
316
|
+
const visibleDiagnostics = diagnosticDelta.usedDelta
|
|
317
|
+
? diagnosticDelta.newDiagnostics
|
|
318
|
+
: diagnosticDelta.fileDiagnostics;
|
|
319
|
+
if (visibleDiagnostics.length > 0) {
|
|
320
|
+
linterOutput = formatLspDiagnostics(path, visibleDiagnostics);
|
|
310
321
|
}
|
|
311
|
-
validatorSummaries = await runValidatorsOnSuccess([absolutePath],
|
|
322
|
+
validatorSummaries = await runValidatorsOnSuccess([absolutePath], diagnosticDelta.validatorDiagnostics);
|
|
312
323
|
}
|
|
313
324
|
catch (validatorError) {
|
|
314
325
|
await writeFileAtomically(absolutePath, originalContent);
|
|
@@ -321,11 +332,20 @@ If "not found", read file to check actual content.`,
|
|
|
321
332
|
? `Successfully replaced all ${replacementCount} occurrence(s) in ${path}.`
|
|
322
333
|
: `Successfully edited ${path}.`;
|
|
323
334
|
return respond
|
|
324
|
-
.text(
|
|
335
|
+
.text([
|
|
336
|
+
resultMessage,
|
|
337
|
+
linterOutput,
|
|
338
|
+
diagnosticDeltaSummary
|
|
339
|
+
? formatDiagnosticDeltaForToolOutput(diagnosticDeltaSummary)
|
|
340
|
+
: "",
|
|
341
|
+
]
|
|
342
|
+
.filter(Boolean)
|
|
343
|
+
.join("\n"))
|
|
325
344
|
.detail({
|
|
326
345
|
diff,
|
|
327
346
|
editsApplied: hasMultiEdit ? replacementCount : undefined,
|
|
328
347
|
validators: validatorSummaries,
|
|
348
|
+
diagnosticDelta: diagnosticDeltaSummary,
|
|
329
349
|
});
|
|
330
350
|
},
|
|
331
351
|
});
|