@evalops/maestro 0.10.8 → 0.10.11
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 +29 -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 +74 -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/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +140 -0
- package/dist/cli/commands/init.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 +44 -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 +42555 -23133
- 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/evalops/agent-bootstrap.d.ts +73 -0
- package/dist/evalops/agent-bootstrap.d.ts.map +1 -0
- package/dist/evalops/agent-bootstrap.js +380 -0
- package/dist/evalops/agent-bootstrap.js.map +1 -0
- 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 +127 -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 +117 -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 +74 -15
- 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,185 @@
|
|
|
1
|
+
export declare const COMPLIANCE_FRAMEWORKS: readonly ["soc2", "iso27001"];
|
|
2
|
+
export type ComplianceFramework = (typeof COMPLIANCE_FRAMEWORKS)[number];
|
|
3
|
+
export type ComplianceJsonValue = string | number | boolean | null | ComplianceJsonValue[] | {
|
|
4
|
+
[key: string]: ComplianceJsonValue;
|
|
5
|
+
};
|
|
6
|
+
export interface ComplianceControl {
|
|
7
|
+
id: string;
|
|
8
|
+
framework: ComplianceFramework;
|
|
9
|
+
title: string;
|
|
10
|
+
description: string;
|
|
11
|
+
evidenceTypes: string[];
|
|
12
|
+
mappedActionTypes: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface AgentActionInput {
|
|
15
|
+
actionId?: string;
|
|
16
|
+
workspaceId?: string;
|
|
17
|
+
agentId?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
timestamp?: Date | string;
|
|
21
|
+
resource?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface AgentActionRecord {
|
|
26
|
+
actionId: string;
|
|
27
|
+
workspaceId?: string;
|
|
28
|
+
agentId?: string;
|
|
29
|
+
type: string;
|
|
30
|
+
status: string;
|
|
31
|
+
timestamp: string;
|
|
32
|
+
resource?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
metadata: Record<string, ComplianceJsonValue>;
|
|
35
|
+
}
|
|
36
|
+
export interface GovernanceEvaluationInput {
|
|
37
|
+
evaluationId?: string;
|
|
38
|
+
workspaceId?: string;
|
|
39
|
+
agentId?: string;
|
|
40
|
+
policyId?: string;
|
|
41
|
+
actionType: string;
|
|
42
|
+
decision: string;
|
|
43
|
+
riskLevel?: string;
|
|
44
|
+
reason?: string;
|
|
45
|
+
timestamp?: Date | string;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export interface GovernanceEvaluationRecord {
|
|
49
|
+
evaluationId: string;
|
|
50
|
+
workspaceId?: string;
|
|
51
|
+
agentId?: string;
|
|
52
|
+
policyId?: string;
|
|
53
|
+
actionType: string;
|
|
54
|
+
decision: string;
|
|
55
|
+
riskLevel?: string;
|
|
56
|
+
reason?: string;
|
|
57
|
+
timestamp: string;
|
|
58
|
+
metadata: Record<string, ComplianceJsonValue>;
|
|
59
|
+
}
|
|
60
|
+
export interface ComplianceEvidence {
|
|
61
|
+
evidenceId: string;
|
|
62
|
+
controlId: string;
|
|
63
|
+
framework: ComplianceFramework;
|
|
64
|
+
sourceType: string;
|
|
65
|
+
timestamp: string;
|
|
66
|
+
summary: string;
|
|
67
|
+
workspaceId?: string;
|
|
68
|
+
agentId?: string;
|
|
69
|
+
actionId?: string;
|
|
70
|
+
traceId?: string;
|
|
71
|
+
resource?: string;
|
|
72
|
+
status?: string;
|
|
73
|
+
metadata: Record<string, ComplianceJsonValue>;
|
|
74
|
+
}
|
|
75
|
+
export interface ComplianceReportRequest {
|
|
76
|
+
workspaceId?: string;
|
|
77
|
+
frameworks?: ComplianceFramework[];
|
|
78
|
+
from?: Date | string;
|
|
79
|
+
to?: Date | string;
|
|
80
|
+
actions?: AgentActionInput[];
|
|
81
|
+
governanceEvents?: GovernanceEvaluationInput[];
|
|
82
|
+
includeEvidence?: boolean;
|
|
83
|
+
includeArtifact?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface NormalizedComplianceReportRequest {
|
|
86
|
+
workspaceId?: string;
|
|
87
|
+
frameworks: ComplianceFramework[];
|
|
88
|
+
from?: Date;
|
|
89
|
+
to?: Date;
|
|
90
|
+
actions: AgentActionRecord[];
|
|
91
|
+
governanceEvents: GovernanceEvaluationRecord[];
|
|
92
|
+
includeEvidence: boolean;
|
|
93
|
+
includeArtifact: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface ComplianceControlReport {
|
|
96
|
+
control: ComplianceControl;
|
|
97
|
+
status: "satisfied" | "missing";
|
|
98
|
+
evidenceCount: number;
|
|
99
|
+
evidence?: ComplianceEvidence[];
|
|
100
|
+
}
|
|
101
|
+
export interface ComplianceArtifactControlMatrixRow {
|
|
102
|
+
controlId: string;
|
|
103
|
+
framework: ComplianceFramework;
|
|
104
|
+
title: string;
|
|
105
|
+
status: "satisfied" | "missing";
|
|
106
|
+
evidenceCount: number;
|
|
107
|
+
evidenceIds: string[];
|
|
108
|
+
evidenceSources: string[];
|
|
109
|
+
lastEvidenceAt?: string;
|
|
110
|
+
}
|
|
111
|
+
export interface ComplianceArtifactGap {
|
|
112
|
+
controlId: string;
|
|
113
|
+
framework: ComplianceFramework;
|
|
114
|
+
title: string;
|
|
115
|
+
severity: "high" | "medium";
|
|
116
|
+
reason: string;
|
|
117
|
+
remediation: string;
|
|
118
|
+
}
|
|
119
|
+
export interface ComplianceArtifactSourceManifestEntry {
|
|
120
|
+
sourceType: string;
|
|
121
|
+
evidenceCount: number;
|
|
122
|
+
firstSeenAt?: string;
|
|
123
|
+
lastSeenAt?: string;
|
|
124
|
+
}
|
|
125
|
+
export interface ComplianceArtifact {
|
|
126
|
+
artifactId: string;
|
|
127
|
+
format: "auditor_json";
|
|
128
|
+
reportId: string;
|
|
129
|
+
generatedAt: string;
|
|
130
|
+
workspaceId?: string;
|
|
131
|
+
period: {
|
|
132
|
+
from?: string;
|
|
133
|
+
to?: string;
|
|
134
|
+
};
|
|
135
|
+
frameworks: ComplianceFramework[];
|
|
136
|
+
executiveSummary: string;
|
|
137
|
+
controlMatrix: ComplianceArtifactControlMatrixRow[];
|
|
138
|
+
evidenceIndex: ComplianceEvidence[];
|
|
139
|
+
gaps: ComplianceArtifactGap[];
|
|
140
|
+
sourceManifest: ComplianceArtifactSourceManifestEntry[];
|
|
141
|
+
exports: {
|
|
142
|
+
drata: {
|
|
143
|
+
controlEvidence: Array<{
|
|
144
|
+
controlExternalId: string;
|
|
145
|
+
evidenceIds: string[];
|
|
146
|
+
status: "ready" | "gap";
|
|
147
|
+
}>;
|
|
148
|
+
};
|
|
149
|
+
vanta: {
|
|
150
|
+
customEvidence: Array<{
|
|
151
|
+
controlId: string;
|
|
152
|
+
title: string;
|
|
153
|
+
evidenceCount: number;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
export interface ComplianceReport {
|
|
159
|
+
reportId: string;
|
|
160
|
+
generatedAt: string;
|
|
161
|
+
workspaceId?: string;
|
|
162
|
+
period: {
|
|
163
|
+
from?: string;
|
|
164
|
+
to?: string;
|
|
165
|
+
};
|
|
166
|
+
frameworks: ComplianceFramework[];
|
|
167
|
+
summary: {
|
|
168
|
+
controls: number;
|
|
169
|
+
satisfied: number;
|
|
170
|
+
missing: number;
|
|
171
|
+
evidenceItems: number;
|
|
172
|
+
};
|
|
173
|
+
controls: ComplianceControlReport[];
|
|
174
|
+
artifact?: ComplianceArtifact;
|
|
175
|
+
}
|
|
176
|
+
export interface ComplianceEvidenceQuery {
|
|
177
|
+
workspaceId?: string;
|
|
178
|
+
from?: Date;
|
|
179
|
+
to?: Date;
|
|
180
|
+
}
|
|
181
|
+
export interface ComplianceControlEvidence {
|
|
182
|
+
control: ComplianceControl;
|
|
183
|
+
evidence: ComplianceEvidence[];
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/compliance/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,+BAAgC,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAC5B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,mBAAmB,EAAE,GACrB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;CAAE,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,mBAAmB,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,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ED,MAAM,WAAW,uBAAuB;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,CAAC,EAAE,IAAI,CAAC;CACV;AAED,MAAM,WAAW,yBAAyB;IACzC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/compliance/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,UAAU,CAAU,CAAC","sourcesContent":["export const COMPLIANCE_FRAMEWORKS = [\"soc2\", \"iso27001\"] as const;\n\nexport type ComplianceFramework = (typeof COMPLIANCE_FRAMEWORKS)[number];\n\nexport type ComplianceJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| ComplianceJsonValue[]\n\t| { [key: string]: ComplianceJsonValue };\n\nexport interface ComplianceControl {\n\tid: string;\n\tframework: ComplianceFramework;\n\ttitle: string;\n\tdescription: string;\n\tevidenceTypes: string[];\n\tmappedActionTypes: string[];\n}\n\nexport interface AgentActionInput {\n\tactionId?: string;\n\tworkspaceId?: string;\n\tagentId?: string;\n\ttype: string;\n\tstatus?: string;\n\ttimestamp?: Date | string;\n\tresource?: string;\n\tdescription?: string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface AgentActionRecord {\n\tactionId: string;\n\tworkspaceId?: string;\n\tagentId?: string;\n\ttype: string;\n\tstatus: string;\n\ttimestamp: string;\n\tresource?: string;\n\tdescription?: string;\n\tmetadata: Record<string, ComplianceJsonValue>;\n}\n\nexport interface GovernanceEvaluationInput {\n\tevaluationId?: string;\n\tworkspaceId?: string;\n\tagentId?: string;\n\tpolicyId?: string;\n\tactionType: string;\n\tdecision: string;\n\triskLevel?: string;\n\treason?: string;\n\ttimestamp?: Date | string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface GovernanceEvaluationRecord {\n\tevaluationId: string;\n\tworkspaceId?: string;\n\tagentId?: string;\n\tpolicyId?: string;\n\tactionType: string;\n\tdecision: string;\n\triskLevel?: string;\n\treason?: string;\n\ttimestamp: string;\n\tmetadata: Record<string, ComplianceJsonValue>;\n}\n\nexport interface ComplianceEvidence {\n\tevidenceId: string;\n\tcontrolId: string;\n\tframework: ComplianceFramework;\n\tsourceType: string;\n\ttimestamp: string;\n\tsummary: string;\n\tworkspaceId?: string;\n\tagentId?: string;\n\tactionId?: string;\n\ttraceId?: string;\n\tresource?: string;\n\tstatus?: string;\n\tmetadata: Record<string, ComplianceJsonValue>;\n}\n\nexport interface ComplianceReportRequest {\n\tworkspaceId?: string;\n\tframeworks?: ComplianceFramework[];\n\tfrom?: Date | string;\n\tto?: Date | string;\n\tactions?: AgentActionInput[];\n\tgovernanceEvents?: GovernanceEvaluationInput[];\n\tincludeEvidence?: boolean;\n\tincludeArtifact?: boolean;\n}\n\nexport interface NormalizedComplianceReportRequest {\n\tworkspaceId?: string;\n\tframeworks: ComplianceFramework[];\n\tfrom?: Date;\n\tto?: Date;\n\tactions: AgentActionRecord[];\n\tgovernanceEvents: GovernanceEvaluationRecord[];\n\tincludeEvidence: boolean;\n\tincludeArtifact: boolean;\n}\n\nexport interface ComplianceControlReport {\n\tcontrol: ComplianceControl;\n\tstatus: \"satisfied\" | \"missing\";\n\tevidenceCount: number;\n\tevidence?: ComplianceEvidence[];\n}\n\nexport interface ComplianceArtifactControlMatrixRow {\n\tcontrolId: string;\n\tframework: ComplianceFramework;\n\ttitle: string;\n\tstatus: \"satisfied\" | \"missing\";\n\tevidenceCount: number;\n\tevidenceIds: string[];\n\tevidenceSources: string[];\n\tlastEvidenceAt?: string;\n}\n\nexport interface ComplianceArtifactGap {\n\tcontrolId: string;\n\tframework: ComplianceFramework;\n\ttitle: string;\n\tseverity: \"high\" | \"medium\";\n\treason: string;\n\tremediation: string;\n}\n\nexport interface ComplianceArtifactSourceManifestEntry {\n\tsourceType: string;\n\tevidenceCount: number;\n\tfirstSeenAt?: string;\n\tlastSeenAt?: string;\n}\n\nexport interface ComplianceArtifact {\n\tartifactId: string;\n\tformat: \"auditor_json\";\n\treportId: string;\n\tgeneratedAt: string;\n\tworkspaceId?: string;\n\tperiod: {\n\t\tfrom?: string;\n\t\tto?: string;\n\t};\n\tframeworks: ComplianceFramework[];\n\texecutiveSummary: string;\n\tcontrolMatrix: ComplianceArtifactControlMatrixRow[];\n\tevidenceIndex: ComplianceEvidence[];\n\tgaps: ComplianceArtifactGap[];\n\tsourceManifest: ComplianceArtifactSourceManifestEntry[];\n\texports: {\n\t\tdrata: {\n\t\t\tcontrolEvidence: Array<{\n\t\t\t\tcontrolExternalId: string;\n\t\t\t\tevidenceIds: string[];\n\t\t\t\tstatus: \"ready\" | \"gap\";\n\t\t\t}>;\n\t\t};\n\t\tvanta: {\n\t\t\tcustomEvidence: Array<{\n\t\t\t\tcontrolId: string;\n\t\t\t\ttitle: string;\n\t\t\t\tevidenceCount: number;\n\t\t\t}>;\n\t\t};\n\t};\n}\n\nexport interface ComplianceReport {\n\treportId: string;\n\tgeneratedAt: string;\n\tworkspaceId?: string;\n\tperiod: {\n\t\tfrom?: string;\n\t\tto?: string;\n\t};\n\tframeworks: ComplianceFramework[];\n\tsummary: {\n\t\tcontrols: number;\n\t\tsatisfied: number;\n\t\tmissing: number;\n\t\tevidenceItems: number;\n\t};\n\tcontrols: ComplianceControlReport[];\n\tartifact?: ComplianceArtifact;\n}\n\nexport interface ComplianceEvidenceQuery {\n\tworkspaceId?: string;\n\tfrom?: Date;\n\tto?: Date;\n}\n\nexport interface ComplianceControlEvidence {\n\tcontrol: ComplianceControl;\n\tevidence: ComplianceEvidence[];\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { IntelligentRouterValidationError, normalizePerformanceMetricInput, normalizeRoutingOverrideInput, normalizeRoutingRequest, parseRoutingStrategy, } from "./normalize.js";
|
|
2
|
+
export { recordIntelligentRouterChatMetric, registeredRoutingModels, resolveIntelligentRouterStrategy, resolveIntelligentRouterTaskType, selectIntelligentRouterModel, } from "./recorder.js";
|
|
3
|
+
export { IntelligentRouterService, getIntelligentRouterService, setIntelligentRouterServiceForTest, } from "./service.js";
|
|
4
|
+
export { ROUTING_STRATEGIES, type ModelPerformanceAggregate, type ModelPerformanceMetricInput, type RoutedModel, type RoutingDecision, type RoutingModelCandidate, type RoutingModelCost, type RoutingOverride, type RoutingOverrideInput, type RoutingRequest, type RoutingRequestInput, type RoutingScore, type RoutingStrategy, } from "./types.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/intelligent-router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gCAAgC,EAChC,+BAA+B,EAC/B,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,iCAAiC,EACjC,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,GAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,wBAAwB,EACxB,2BAA2B,EAC3B,kCAAkC,GAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,eAAe,GACpB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { IntelligentRouterValidationError, normalizePerformanceMetricInput, normalizeRoutingOverrideInput, normalizeRoutingRequest, parseRoutingStrategy, } from "./normalize.js";
|
|
2
|
+
export { recordIntelligentRouterChatMetric, registeredRoutingModels, resolveIntelligentRouterStrategy, resolveIntelligentRouterTaskType, selectIntelligentRouterModel, } from "./recorder.js";
|
|
3
|
+
export { IntelligentRouterService, getIntelligentRouterService, setIntelligentRouterServiceForTest, } from "./service.js";
|
|
4
|
+
export { ROUTING_STRATEGIES, } from "./types.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/intelligent-router/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gCAAgC,EAChC,+BAA+B,EAC/B,6BAA6B,EAC7B,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,iCAAiC,EACjC,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,EAChC,4BAA4B,GAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,wBAAwB,EACxB,2BAA2B,EAC3B,kCAAkC,GAClC,MAAM,cAAc,CAAC;AACtB,OAAO,EACN,kBAAkB,GAalB,MAAM,YAAY,CAAC","sourcesContent":["export {\n\tIntelligentRouterValidationError,\n\tnormalizePerformanceMetricInput,\n\tnormalizeRoutingOverrideInput,\n\tnormalizeRoutingRequest,\n\tparseRoutingStrategy,\n} from \"./normalize.js\";\nexport {\n\trecordIntelligentRouterChatMetric,\n\tregisteredRoutingModels,\n\tresolveIntelligentRouterStrategy,\n\tresolveIntelligentRouterTaskType,\n\tselectIntelligentRouterModel,\n} from \"./recorder.js\";\nexport {\n\tIntelligentRouterService,\n\tgetIntelligentRouterService,\n\tsetIntelligentRouterServiceForTest,\n} from \"./service.js\";\nexport {\n\tROUTING_STRATEGIES,\n\ttype ModelPerformanceAggregate,\n\ttype ModelPerformanceMetricInput,\n\ttype RoutedModel,\n\ttype RoutingDecision,\n\ttype RoutingModelCandidate,\n\ttype RoutingModelCost,\n\ttype RoutingOverride,\n\ttype RoutingOverrideInput,\n\ttype RoutingRequest,\n\ttype RoutingRequestInput,\n\ttype RoutingScore,\n\ttype RoutingStrategy,\n} from \"./types.js\";\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ModelPerformanceMetricInput, type RoutingModelCandidate, type RoutingOverrideInput, type RoutingRequest, type RoutingRequestInput, type RoutingStrategy } from "./types.js";
|
|
2
|
+
export declare class IntelligentRouterValidationError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function parseRoutingStrategy(value: unknown): RoutingStrategy;
|
|
6
|
+
export declare function normalizeRoutingRequest(input: RoutingRequestInput, defaultAvailableModels: RoutingModelCandidate[]): RoutingRequest;
|
|
7
|
+
export declare function normalizePerformanceMetricInput(input: ModelPerformanceMetricInput): Required<ModelPerformanceMetricInput>;
|
|
8
|
+
export declare function normalizeRoutingOverrideInput(input: RoutingOverrideInput): RoutingOverrideInput;
|
|
9
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/services/intelligent-router/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,2BAA2B,EAEhC,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,MAAM,YAAY,CAAC;AAEpB,qBAAa,gCAAiC,SAAQ,KAAK;gBAC9C,OAAO,EAAE,MAAM;CAI3B;AAmDD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAQpE;AA4DD,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,mBAAmB,EAC1B,sBAAsB,EAAE,qBAAqB,EAAE,GAC7C,cAAc,CAyBhB;AAED,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,2BAA2B,GAChC,QAAQ,CAAC,2BAA2B,CAAC,CA0BvC;AAED,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,oBAAoB,GACzB,oBAAoB,CActB"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { ROUTING_STRATEGIES, } from "./types.js";
|
|
2
|
+
export class IntelligentRouterValidationError extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "IntelligentRouterValidationError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function isRecord(value) {
|
|
9
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
|
+
}
|
|
11
|
+
function cleanOptionalString(value) {
|
|
12
|
+
if (typeof value !== "string")
|
|
13
|
+
return undefined;
|
|
14
|
+
const trimmed = value.trim();
|
|
15
|
+
return trimmed ? trimmed : undefined;
|
|
16
|
+
}
|
|
17
|
+
function cleanRequiredString(value, label) {
|
|
18
|
+
const trimmed = cleanOptionalString(value);
|
|
19
|
+
if (!trimmed) {
|
|
20
|
+
throw new IntelligentRouterValidationError(`${label} is required.`);
|
|
21
|
+
}
|
|
22
|
+
return trimmed;
|
|
23
|
+
}
|
|
24
|
+
function parseFiniteNumber(value, label) {
|
|
25
|
+
if (value === undefined || value === null || value === "")
|
|
26
|
+
return undefined;
|
|
27
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
28
|
+
if (!Number.isFinite(parsed)) {
|
|
29
|
+
throw new IntelligentRouterValidationError(`${label} must be a number.`);
|
|
30
|
+
}
|
|
31
|
+
return parsed;
|
|
32
|
+
}
|
|
33
|
+
function parseOptionalBoolean(value) {
|
|
34
|
+
if (value === undefined || value === null || value === "")
|
|
35
|
+
return undefined;
|
|
36
|
+
if (typeof value === "boolean")
|
|
37
|
+
return value;
|
|
38
|
+
if (typeof value === "string") {
|
|
39
|
+
const normalized = value.trim().toLowerCase();
|
|
40
|
+
if (normalized === "true")
|
|
41
|
+
return true;
|
|
42
|
+
if (normalized === "false")
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
throw new IntelligentRouterValidationError("success must be a boolean.");
|
|
46
|
+
}
|
|
47
|
+
function parseOptionalDate(value, label) {
|
|
48
|
+
if (value === undefined || value === null || value === "")
|
|
49
|
+
return undefined;
|
|
50
|
+
const parsed = value instanceof Date ? value : new Date(String(value));
|
|
51
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
52
|
+
throw new IntelligentRouterValidationError(`${label} must be a valid date.`);
|
|
53
|
+
}
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
export function parseRoutingStrategy(value) {
|
|
57
|
+
const normalized = cleanOptionalString(value)?.toLowerCase() ?? "balanced";
|
|
58
|
+
if (ROUTING_STRATEGIES.includes(normalized)) {
|
|
59
|
+
return normalized;
|
|
60
|
+
}
|
|
61
|
+
throw new IntelligentRouterValidationError("Invalid routing strategy. Use balanced, quality, cost, or latency.");
|
|
62
|
+
}
|
|
63
|
+
function normalizeUnavailableModels(value) {
|
|
64
|
+
if (value === undefined || value === null)
|
|
65
|
+
return [];
|
|
66
|
+
if (typeof value === "string") {
|
|
67
|
+
return value
|
|
68
|
+
.split(",")
|
|
69
|
+
.map((entry) => entry.trim())
|
|
70
|
+
.filter(Boolean);
|
|
71
|
+
}
|
|
72
|
+
if (!Array.isArray(value)) {
|
|
73
|
+
throw new IntelligentRouterValidationError("unavailableModels must be an array or comma-separated string.");
|
|
74
|
+
}
|
|
75
|
+
return value.map((entry) => String(entry).trim()).filter(Boolean);
|
|
76
|
+
}
|
|
77
|
+
function normalizeAvailableModels(value) {
|
|
78
|
+
if (value === undefined || value === null)
|
|
79
|
+
return [];
|
|
80
|
+
if (!Array.isArray(value)) {
|
|
81
|
+
throw new IntelligentRouterValidationError("availableModels must be an array.");
|
|
82
|
+
}
|
|
83
|
+
return value.filter(isRecord).map((entry) => {
|
|
84
|
+
const provider = cleanRequiredString(entry.provider, "provider");
|
|
85
|
+
const model = cleanRequiredString(entry.model, "model");
|
|
86
|
+
const name = cleanOptionalString(entry.name);
|
|
87
|
+
const available = typeof entry.available === "boolean" ? entry.available : undefined;
|
|
88
|
+
const cost = (() => {
|
|
89
|
+
if (!isRecord(entry.cost))
|
|
90
|
+
return undefined;
|
|
91
|
+
const input = parseFiniteNumber(entry.cost.input, "cost.input");
|
|
92
|
+
const output = parseFiniteNumber(entry.cost.output, "cost.output");
|
|
93
|
+
const cacheRead = parseFiniteNumber(entry.cost.cacheRead, "cost.cacheRead");
|
|
94
|
+
const cacheWrite = parseFiniteNumber(entry.cost.cacheWrite, "cost.cacheWrite");
|
|
95
|
+
return {
|
|
96
|
+
...(input !== undefined ? { input } : {}),
|
|
97
|
+
...(output !== undefined ? { output } : {}),
|
|
98
|
+
...(cacheRead !== undefined ? { cacheRead } : {}),
|
|
99
|
+
...(cacheWrite !== undefined ? { cacheWrite } : {}),
|
|
100
|
+
};
|
|
101
|
+
})();
|
|
102
|
+
return {
|
|
103
|
+
provider,
|
|
104
|
+
model,
|
|
105
|
+
...(name ? { name } : {}),
|
|
106
|
+
...(cost && Object.keys(cost).length > 0 ? { cost } : {}),
|
|
107
|
+
...(available !== undefined ? { available } : {}),
|
|
108
|
+
};
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
export function normalizeRoutingRequest(input, defaultAvailableModels) {
|
|
112
|
+
if (!isRecord(input)) {
|
|
113
|
+
throw new IntelligentRouterValidationError("Routing request must be an object.");
|
|
114
|
+
}
|
|
115
|
+
const requestInput = input;
|
|
116
|
+
const taskType = cleanOptionalString(requestInput.taskType) ?? "chat";
|
|
117
|
+
const modelHint = cleanOptionalString(requestInput.modelHint) ??
|
|
118
|
+
cleanOptionalString(requestInput.model_hint);
|
|
119
|
+
const unavailableModels = normalizeUnavailableModels(requestInput.unavailableModels ?? requestInput.unavailable_models);
|
|
120
|
+
const availableModels = normalizeAvailableModels(requestInput.availableModels);
|
|
121
|
+
return {
|
|
122
|
+
taskType,
|
|
123
|
+
strategy: parseRoutingStrategy(requestInput.strategy),
|
|
124
|
+
unavailableModels,
|
|
125
|
+
availableModels: availableModels.length > 0 ? availableModels : defaultAvailableModels,
|
|
126
|
+
...(modelHint ? { modelHint } : {}),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export function normalizePerformanceMetricInput(input) {
|
|
130
|
+
if (!isRecord(input)) {
|
|
131
|
+
throw new IntelligentRouterValidationError("Metric must be an object.");
|
|
132
|
+
}
|
|
133
|
+
const metricInput = input;
|
|
134
|
+
const latencyMs = parseFiniteNumber(metricInput.latencyMs, "latencyMs") ?? 0;
|
|
135
|
+
const costUsd = parseFiniteNumber(metricInput.costUsd, "costUsd") ?? 0;
|
|
136
|
+
const qualityScore = parseFiniteNumber(metricInput.qualityScore, "qualityScore") ?? 0.5;
|
|
137
|
+
if (latencyMs < 0) {
|
|
138
|
+
throw new IntelligentRouterValidationError("latencyMs cannot be negative.");
|
|
139
|
+
}
|
|
140
|
+
if (costUsd < 0) {
|
|
141
|
+
throw new IntelligentRouterValidationError("costUsd cannot be negative.");
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
taskType: cleanRequiredString(metricInput.taskType, "taskType"),
|
|
145
|
+
provider: cleanRequiredString(metricInput.provider, "provider"),
|
|
146
|
+
model: cleanRequiredString(metricInput.model, "model"),
|
|
147
|
+
latencyMs,
|
|
148
|
+
success: parseOptionalBoolean(metricInput.success) ?? true,
|
|
149
|
+
costUsd,
|
|
150
|
+
qualityScore: Math.max(0, Math.min(1, qualityScore)),
|
|
151
|
+
occurredAt: parseOptionalDate(metricInput.occurredAt, "occurredAt") ?? new Date(),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export function normalizeRoutingOverrideInput(input) {
|
|
155
|
+
if (!isRecord(input)) {
|
|
156
|
+
throw new IntelligentRouterValidationError("Override must be an object.");
|
|
157
|
+
}
|
|
158
|
+
const overrideInput = input;
|
|
159
|
+
const reason = cleanOptionalString(overrideInput.reason);
|
|
160
|
+
const expiresAt = parseOptionalDate(overrideInput.expiresAt, "expiresAt");
|
|
161
|
+
return {
|
|
162
|
+
taskType: cleanRequiredString(overrideInput.taskType, "taskType"),
|
|
163
|
+
provider: cleanRequiredString(overrideInput.provider, "provider"),
|
|
164
|
+
model: cleanRequiredString(overrideInput.model, "model"),
|
|
165
|
+
...(reason ? { reason } : {}),
|
|
166
|
+
...(expiresAt ? { expiresAt } : {}),
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/services/intelligent-router/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,kBAAkB,GAMlB,MAAM,YAAY,CAAC;AAEpB,MAAM,OAAO,gCAAiC,SAAQ,KAAK;IAC1D,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;IAChD,CAAC;CACD;AAED,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACtC,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,KAAa;IACzD,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,gCAAgC,CAAC,GAAG,KAAK,eAAe,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,OAAO,C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ttype RoutingModelCandidate,\n\ttype RoutingOverrideInput,\n\ttype RoutingRequest,\n\ttype RoutingRequestInput,\n\ttype RoutingStrategy,\n} from \"./types.js\";\n\nexport class IntelligentRouterValidationError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"IntelligentRouterValidationError\";\n\t}\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction cleanOptionalString(value: unknown): string | undefined {\n\tif (typeof value !== \"string\") return undefined;\n\tconst trimmed = value.trim();\n\treturn trimmed ? trimmed : undefined;\n}\n\nfunction cleanRequiredString(value: unknown, label: string): string {\n\tconst trimmed = cleanOptionalString(value);\n\tif (!trimmed) {\n\t\tthrow new IntelligentRouterValidationError(`${label} is required.`);\n\t}\n\treturn trimmed;\n}\n\nfunction parseFiniteNumber(value: unknown, label: string): number | undefined {\n\tif (value === undefined || value === null || value === \"\") return undefined;\n\tconst parsed = typeof value === \"number\" ? value : Number(value);\n\tif (!Number.isFinite(parsed)) {\n\t\tthrow new IntelligentRouterValidationError(`${label} must be a number.`);\n\t}\n\treturn parsed;\n}\n\nfunction parseOptionalBoolean(value: unknown): boolean | undefined {\n\tif (value === undefined || value === null || value === \"\") return undefined;\n\tif (typeof value === \"boolean\") return value;\n\tif (typeof value === \"string\") {\n\t\tconst normalized = value.trim().toLowerCase();\n\t\tif (normalized === \"true\") return true;\n\t\tif (normalized === \"false\") return false;\n\t}\n\tthrow new IntelligentRouterValidationError(\"success must be a boolean.\");\n}\n\nfunction parseOptionalDate(value: unknown, label: string): Date | undefined {\n\tif (value === undefined || value === null || value === \"\") return undefined;\n\tconst parsed = value instanceof Date ? value : new Date(String(value));\n\tif (Number.isNaN(parsed.getTime())) {\n\t\tthrow new IntelligentRouterValidationError(\n\t\t\t`${label} must be a valid date.`,\n\t\t);\n\t}\n\treturn parsed;\n}\n\nexport function parseRoutingStrategy(value: unknown): RoutingStrategy {\n\tconst normalized = cleanOptionalString(value)?.toLowerCase() ?? \"balanced\";\n\tif (ROUTING_STRATEGIES.includes(normalized as RoutingStrategy)) {\n\t\treturn normalized as RoutingStrategy;\n\t}\n\tthrow new IntelligentRouterValidationError(\n\t\t\"Invalid routing strategy. Use balanced, quality, cost, or latency.\",\n\t);\n}\n\nfunction normalizeUnavailableModels(value: unknown): string[] {\n\tif (value === undefined || value === null) return [];\n\tif (typeof value === \"string\") {\n\t\treturn value\n\t\t\t.split(\",\")\n\t\t\t.map((entry) => entry.trim())\n\t\t\t.filter(Boolean);\n\t}\n\tif (!Array.isArray(value)) {\n\t\tthrow new IntelligentRouterValidationError(\n\t\t\t\"unavailableModels must be an array or comma-separated string.\",\n\t\t);\n\t}\n\treturn value.map((entry) => String(entry).trim()).filter(Boolean);\n}\n\nfunction normalizeAvailableModels(value: unknown): RoutingModelCandidate[] {\n\tif (value === undefined || value === null) return [];\n\tif (!Array.isArray(value)) {\n\t\tthrow new IntelligentRouterValidationError(\n\t\t\t\"availableModels must be an array.\",\n\t\t);\n\t}\n\treturn value.filter(isRecord).map((entry) => {\n\t\tconst provider = cleanRequiredString(entry.provider, \"provider\");\n\t\tconst model = cleanRequiredString(entry.model, \"model\");\n\t\tconst name = cleanOptionalString(entry.name);\n\t\tconst available =\n\t\t\ttypeof entry.available === \"boolean\" ? entry.available : undefined;\n\t\tconst cost = (() => {\n\t\t\tif (!isRecord(entry.cost)) return undefined;\n\t\t\tconst input = parseFiniteNumber(entry.cost.input, \"cost.input\");\n\t\t\tconst output = parseFiniteNumber(entry.cost.output, \"cost.output\");\n\t\t\tconst cacheRead = parseFiniteNumber(\n\t\t\t\tentry.cost.cacheRead,\n\t\t\t\t\"cost.cacheRead\",\n\t\t\t);\n\t\t\tconst cacheWrite = parseFiniteNumber(\n\t\t\t\tentry.cost.cacheWrite,\n\t\t\t\t\"cost.cacheWrite\",\n\t\t\t);\n\t\t\treturn {\n\t\t\t\t...(input !== undefined ? { input } : {}),\n\t\t\t\t...(output !== undefined ? { output } : {}),\n\t\t\t\t...(cacheRead !== undefined ? { cacheRead } : {}),\n\t\t\t\t...(cacheWrite !== undefined ? { cacheWrite } : {}),\n\t\t\t};\n\t\t})();\n\t\treturn {\n\t\t\tprovider,\n\t\t\tmodel,\n\t\t\t...(name ? { name } : {}),\n\t\t\t...(cost && Object.keys(cost).length > 0 ? { cost } : {}),\n\t\t\t...(available !== undefined ? { available } : {}),\n\t\t};\n\t});\n}\n\nexport function normalizeRoutingRequest(\n\tinput: RoutingRequestInput,\n\tdefaultAvailableModels: RoutingModelCandidate[],\n): RoutingRequest {\n\tif (!isRecord(input)) {\n\t\tthrow new IntelligentRouterValidationError(\n\t\t\t\"Routing request must be an object.\",\n\t\t);\n\t}\n\tconst requestInput = input as RoutingRequestInput;\n\tconst taskType = cleanOptionalString(requestInput.taskType) ?? \"chat\";\n\tconst modelHint =\n\t\tcleanOptionalString(requestInput.modelHint) ??\n\t\tcleanOptionalString(requestInput.model_hint);\n\tconst unavailableModels = normalizeUnavailableModels(\n\t\trequestInput.unavailableModels ?? requestInput.unavailable_models,\n\t);\n\tconst availableModels = normalizeAvailableModels(\n\t\trequestInput.availableModels,\n\t);\n\treturn {\n\t\ttaskType,\n\t\tstrategy: parseRoutingStrategy(requestInput.strategy),\n\t\tunavailableModels,\n\t\tavailableModels:\n\t\t\tavailableModels.length > 0 ? availableModels : defaultAvailableModels,\n\t\t...(modelHint ? { modelHint } : {}),\n\t};\n}\n\nexport function normalizePerformanceMetricInput(\n\tinput: ModelPerformanceMetricInput,\n): Required<ModelPerformanceMetricInput> {\n\tif (!isRecord(input)) {\n\t\tthrow new IntelligentRouterValidationError(\"Metric must be an object.\");\n\t}\n\tconst metricInput = input as ModelPerformanceMetricInput;\n\tconst latencyMs = parseFiniteNumber(metricInput.latencyMs, \"latencyMs\") ?? 0;\n\tconst costUsd = parseFiniteNumber(metricInput.costUsd, \"costUsd\") ?? 0;\n\tconst qualityScore =\n\t\tparseFiniteNumber(metricInput.qualityScore, \"qualityScore\") ?? 0.5;\n\tif (latencyMs < 0) {\n\t\tthrow new IntelligentRouterValidationError(\"latencyMs cannot be negative.\");\n\t}\n\tif (costUsd < 0) {\n\t\tthrow new IntelligentRouterValidationError(\"costUsd cannot be negative.\");\n\t}\n\treturn {\n\t\ttaskType: cleanRequiredString(metricInput.taskType, \"taskType\"),\n\t\tprovider: cleanRequiredString(metricInput.provider, \"provider\"),\n\t\tmodel: cleanRequiredString(metricInput.model, \"model\"),\n\t\tlatencyMs,\n\t\tsuccess: parseOptionalBoolean(metricInput.success) ?? true,\n\t\tcostUsd,\n\t\tqualityScore: Math.max(0, Math.min(1, qualityScore)),\n\t\toccurredAt:\n\t\t\tparseOptionalDate(metricInput.occurredAt, \"occurredAt\") ?? new Date(),\n\t};\n}\n\nexport function normalizeRoutingOverrideInput(\n\tinput: RoutingOverrideInput,\n): RoutingOverrideInput {\n\tif (!isRecord(input)) {\n\t\tthrow new IntelligentRouterValidationError(\"Override must be an object.\");\n\t}\n\tconst overrideInput = input as RoutingOverrideInput;\n\tconst reason = cleanOptionalString(overrideInput.reason);\n\tconst expiresAt = parseOptionalDate(overrideInput.expiresAt, \"expiresAt\");\n\treturn {\n\t\ttaskType: cleanRequiredString(overrideInput.taskType, \"taskType\"),\n\t\tprovider: cleanRequiredString(overrideInput.provider, \"provider\"),\n\t\tmodel: cleanRequiredString(overrideInput.model, \"model\"),\n\t\t...(reason ? { reason } : {}),\n\t\t...(expiresAt ? { expiresAt } : {}),\n\t};\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IncomingMessage } from "node:http";
|
|
2
|
+
import type { AssistantMessage } from "../../agent/types.js";
|
|
3
|
+
import type { RoutingDecision, RoutingModelCandidate, RoutingStrategy } from "./types.js";
|
|
4
|
+
export interface RoutedModelSelection {
|
|
5
|
+
taskType: string;
|
|
6
|
+
decision: RoutingDecision;
|
|
7
|
+
modelInputs: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function registeredRoutingModels(): RoutingModelCandidate[];
|
|
10
|
+
export declare function resolveIntelligentRouterTaskType(req: IncomingMessage, body?: unknown): string;
|
|
11
|
+
export declare function resolveIntelligentRouterStrategy(req: IncomingMessage): RoutingStrategy | undefined;
|
|
12
|
+
export declare function selectIntelligentRouterModel(params: {
|
|
13
|
+
req: IncomingMessage;
|
|
14
|
+
requestedModel?: string | null;
|
|
15
|
+
body?: unknown;
|
|
16
|
+
}): RoutedModelSelection;
|
|
17
|
+
export declare function recordIntelligentRouterChatMetric(params: {
|
|
18
|
+
taskType: string;
|
|
19
|
+
provider: string;
|
|
20
|
+
model: string;
|
|
21
|
+
startedAt: number;
|
|
22
|
+
message: AssistantMessage;
|
|
23
|
+
}): void;
|
|
24
|
+
//# sourceMappingURL=recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["../../../src/services/intelligent-router/recorder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAK7D,OAAO,KAAK,EAEX,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;CACtB;AAmBD,wBAAgB,uBAAuB,IAAI,qBAAqB,EAAE,CAQjE;AAED,wBAAgB,gCAAgC,CAC/C,GAAG,EAAE,eAAe,EACpB,IAAI,CAAC,EAAE,OAAO,GACZ,MAAM,CAaR;AAED,wBAAgB,gCAAgC,CAC/C,GAAG,EAAE,eAAe,GAClB,eAAe,GAAG,SAAS,CAU7B;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACpD,GAAG,EAAE,eAAe,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,GAAG,oBAAoB,CAkBvB;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,gBAAgB,CAAC;CAC1B,GAAG,IAAI,CAuBP"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { getRegisteredModels } from "../../models/registry.js";
|
|
2
|
+
import { createLogger } from "../../utils/logger.js";
|
|
3
|
+
import { getIntelligentRouterService } from "./service.js";
|
|
4
|
+
import { ROUTING_STRATEGIES } from "./types.js";
|
|
5
|
+
const logger = createLogger("intelligent-router:recorder");
|
|
6
|
+
function modelInput(model) {
|
|
7
|
+
return `${model.provider}/${model.model}`;
|
|
8
|
+
}
|
|
9
|
+
function firstHeader(req, names) {
|
|
10
|
+
for (const name of names) {
|
|
11
|
+
const raw = req.headers[name.toLowerCase()];
|
|
12
|
+
const value = Array.isArray(raw) ? raw[0] : raw;
|
|
13
|
+
const trimmed = value?.trim();
|
|
14
|
+
if (trimmed)
|
|
15
|
+
return trimmed;
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
export function registeredRoutingModels() {
|
|
20
|
+
return getRegisteredModels().map((model) => ({
|
|
21
|
+
provider: model.provider,
|
|
22
|
+
model: model.id,
|
|
23
|
+
name: model.name || model.id,
|
|
24
|
+
cost: model.cost,
|
|
25
|
+
available: true,
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
export function resolveIntelligentRouterTaskType(req, body) {
|
|
29
|
+
const header = firstHeader(req, [
|
|
30
|
+
"x-maestro-task-type",
|
|
31
|
+
"x-composer-task-type",
|
|
32
|
+
]);
|
|
33
|
+
if (header?.trim())
|
|
34
|
+
return header.trim();
|
|
35
|
+
if (body && typeof body === "object" && "taskType" in body) {
|
|
36
|
+
const taskType = body.taskType;
|
|
37
|
+
if (typeof taskType === "string" && taskType.trim()) {
|
|
38
|
+
return taskType.trim();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return "chat";
|
|
42
|
+
}
|
|
43
|
+
export function resolveIntelligentRouterStrategy(req) {
|
|
44
|
+
const header = firstHeader(req, [
|
|
45
|
+
"x-maestro-routing-strategy",
|
|
46
|
+
"x-composer-routing-strategy",
|
|
47
|
+
]);
|
|
48
|
+
if (!header?.trim())
|
|
49
|
+
return undefined;
|
|
50
|
+
const strategy = header.trim().toLowerCase();
|
|
51
|
+
return ROUTING_STRATEGIES.includes(strategy)
|
|
52
|
+
? strategy
|
|
53
|
+
: undefined;
|
|
54
|
+
}
|
|
55
|
+
export function selectIntelligentRouterModel(params) {
|
|
56
|
+
const taskType = resolveIntelligentRouterTaskType(params.req, params.body);
|
|
57
|
+
const modelHint = params.requestedModel ?? undefined;
|
|
58
|
+
const strategy = resolveIntelligentRouterStrategy(params.req);
|
|
59
|
+
const decision = getIntelligentRouterService().routeRequest({
|
|
60
|
+
taskType,
|
|
61
|
+
availableModels: registeredRoutingModels(),
|
|
62
|
+
...(modelHint ? { modelHint } : {}),
|
|
63
|
+
...(strategy ? { strategy } : {}),
|
|
64
|
+
});
|
|
65
|
+
return {
|
|
66
|
+
taskType,
|
|
67
|
+
decision,
|
|
68
|
+
modelInputs: [
|
|
69
|
+
modelInput(decision.selectedModel),
|
|
70
|
+
...decision.fallbackChain.map(modelInput),
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function recordIntelligentRouterChatMetric(params) {
|
|
75
|
+
const usage = params.message.usage;
|
|
76
|
+
void Promise.resolve()
|
|
77
|
+
.then(() => {
|
|
78
|
+
const costUsd = usage.cost?.total;
|
|
79
|
+
getIntelligentRouterService().recordPerformanceMetric({
|
|
80
|
+
taskType: params.taskType,
|
|
81
|
+
provider: params.provider,
|
|
82
|
+
model: params.model,
|
|
83
|
+
latencyMs: Date.now() - params.startedAt,
|
|
84
|
+
success: params.message.stopReason !== "error",
|
|
85
|
+
occurredAt: new Date(params.message.timestamp),
|
|
86
|
+
...(typeof costUsd === "number" ? { costUsd } : {}),
|
|
87
|
+
});
|
|
88
|
+
})
|
|
89
|
+
.catch((error) => {
|
|
90
|
+
logger.warn("Intelligent router metric recording failed", {
|
|
91
|
+
error: error instanceof Error ? error.message : String(error),
|
|
92
|
+
taskType: params.taskType,
|
|
93
|
+
provider: params.provider,
|
|
94
|
+
model: params.model,
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recorder.js","sourceRoot":"","sources":["../../../src/services/intelligent-router/recorder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQhD,MAAM,MAAM,GAAG,YAAY,CAAC,6BAA6B,CAAC,CAAC;AAQ3D,SAAS,UAAU,CAAC,KAAkB;IACrC,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CACnB,GAAoB,EACpB,KAAe;IAEf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAA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AAE,CAAC,uBAAuB,CAAC;YACrD,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,SAAS;YACxC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK,OAAO;YAC9C,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;YAC9C,GAAG,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnD,CAAC,CAAC;IACJ,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAChB,MAAM,CAAC,IAAI,CAAC,4CAA4C,EAAE;YACzD,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC7D,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;SACnB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { IncomingMessage } from \"node:http\";\nimport type { AssistantMessage } from \"../../agent/types.js\";\nimport { getRegisteredModels } from \"../../models/registry.js\";\nimport { createLogger } from \"../../utils/logger.js\";\nimport { getIntelligentRouterService } from \"./service.js\";\nimport { ROUTING_STRATEGIES } from \"./types.js\";\nimport type {\n\tRoutedModel,\n\tRoutingDecision,\n\tRoutingModelCandidate,\n\tRoutingStrategy,\n} from \"./types.js\";\n\nconst logger = createLogger(\"intelligent-router:recorder\");\n\nexport interface RoutedModelSelection {\n\ttaskType: string;\n\tdecision: RoutingDecision;\n\tmodelInputs: string[];\n}\n\nfunction modelInput(model: RoutedModel): string {\n\treturn `${model.provider}/${model.model}`;\n}\n\nfunction firstHeader(\n\treq: IncomingMessage,\n\tnames: string[],\n): string | undefined {\n\tfor (const name of names) {\n\t\tconst raw = req.headers[name.toLowerCase()];\n\t\tconst value = Array.isArray(raw) ? raw[0] : raw;\n\t\tconst trimmed = value?.trim();\n\t\tif (trimmed) return trimmed;\n\t}\n\treturn undefined;\n}\n\nexport function registeredRoutingModels(): RoutingModelCandidate[] {\n\treturn getRegisteredModels().map((model) => ({\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\tname: model.name || model.id,\n\t\tcost: model.cost,\n\t\tavailable: true,\n\t}));\n}\n\nexport function resolveIntelligentRouterTaskType(\n\treq: IncomingMessage,\n\tbody?: unknown,\n): string {\n\tconst header = firstHeader(req, [\n\t\t\"x-maestro-task-type\",\n\t\t\"x-composer-task-type\",\n\t]);\n\tif (header?.trim()) return header.trim();\n\tif (body && typeof body === \"object\" && \"taskType\" in body) {\n\t\tconst taskType = (body as { taskType?: unknown }).taskType;\n\t\tif (typeof taskType === \"string\" && taskType.trim()) {\n\t\t\treturn taskType.trim();\n\t\t}\n\t}\n\treturn \"chat\";\n}\n\nexport function resolveIntelligentRouterStrategy(\n\treq: IncomingMessage,\n): RoutingStrategy | undefined {\n\tconst header = firstHeader(req, [\n\t\t\"x-maestro-routing-strategy\",\n\t\t\"x-composer-routing-strategy\",\n\t]);\n\tif (!header?.trim()) return undefined;\n\tconst strategy = header.trim().toLowerCase();\n\treturn ROUTING_STRATEGIES.includes(strategy as RoutingStrategy)\n\t\t? (strategy as RoutingStrategy)\n\t\t: undefined;\n}\n\nexport function selectIntelligentRouterModel(params: {\n\treq: IncomingMessage;\n\trequestedModel?: string | null;\n\tbody?: unknown;\n}): RoutedModelSelection {\n\tconst taskType = resolveIntelligentRouterTaskType(params.req, params.body);\n\tconst modelHint = params.requestedModel ?? undefined;\n\tconst strategy = resolveIntelligentRouterStrategy(params.req);\n\tconst decision = getIntelligentRouterService().routeRequest({\n\t\ttaskType,\n\t\tavailableModels: registeredRoutingModels(),\n\t\t...(modelHint ? { modelHint } : {}),\n\t\t...(strategy ? { strategy } : {}),\n\t});\n\treturn {\n\t\ttaskType,\n\t\tdecision,\n\t\tmodelInputs: [\n\t\t\tmodelInput(decision.selectedModel),\n\t\t\t...decision.fallbackChain.map(modelInput),\n\t\t],\n\t};\n}\n\nexport function recordIntelligentRouterChatMetric(params: {\n\ttaskType: string;\n\tprovider: string;\n\tmodel: string;\n\tstartedAt: number;\n\tmessage: AssistantMessage;\n}): void {\n\tconst usage = params.message.usage;\n\tvoid Promise.resolve()\n\t\t.then(() => {\n\t\t\tconst costUsd = usage.cost?.total;\n\t\t\tgetIntelligentRouterService().recordPerformanceMetric({\n\t\t\t\ttaskType: params.taskType,\n\t\t\t\tprovider: params.provider,\n\t\t\t\tmodel: params.model,\n\t\t\t\tlatencyMs: Date.now() - params.startedAt,\n\t\t\t\tsuccess: params.message.stopReason !== \"error\",\n\t\t\t\toccurredAt: new Date(params.message.timestamp),\n\t\t\t\t...(typeof costUsd === \"number\" ? { costUsd } : {}),\n\t\t\t});\n\t\t})\n\t\t.catch((error) => {\n\t\t\tlogger.warn(\"Intelligent router metric recording failed\", {\n\t\t\t\terror: error instanceof Error ? error.message : String(error),\n\t\t\t\ttaskType: params.taskType,\n\t\t\t\tprovider: params.provider,\n\t\t\t\tmodel: params.model,\n\t\t\t});\n\t\t});\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ModelPerformanceAggregate, ModelPerformanceMetricInput, RoutingDecision, RoutingModelCandidate, RoutingOverride, RoutingOverrideInput, RoutingRequestInput } from "./types.js";
|
|
2
|
+
export declare class IntelligentRouterService {
|
|
3
|
+
private readonly defaultModels;
|
|
4
|
+
private readonly now;
|
|
5
|
+
private readonly metrics;
|
|
6
|
+
private readonly overrides;
|
|
7
|
+
private readonly decisions;
|
|
8
|
+
constructor(defaultModels?: () => RoutingModelCandidate[], now?: () => Date);
|
|
9
|
+
recordPerformanceMetric(input: ModelPerformanceMetricInput): ModelPerformanceAggregate;
|
|
10
|
+
routeRequest(input: RoutingRequestInput): RoutingDecision;
|
|
11
|
+
setOverride(input: RoutingOverrideInput): RoutingOverride;
|
|
12
|
+
deleteOverride(taskType: string): boolean;
|
|
13
|
+
listOverrides(): RoutingOverride[];
|
|
14
|
+
listMetrics(taskType?: string): ModelPerformanceAggregate[];
|
|
15
|
+
listDecisions(limit?: number): RoutingDecision[];
|
|
16
|
+
clearForTest(): void;
|
|
17
|
+
private getAggregate;
|
|
18
|
+
private pruneExpiredOverrides;
|
|
19
|
+
}
|
|
20
|
+
export declare function getIntelligentRouterService(): IntelligentRouterService;
|
|
21
|
+
export declare function setIntelligentRouterServiceForTest(service: IntelligentRouterService | null): void;
|
|
22
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/services/intelligent-router/service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,yBAAyB,EACzB,2BAA2B,EAE3B,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,mBAAmB,EAGnB,MAAM,YAAY,CAAC;AA6MpB,qBAAa,wBAAwB;IAMnC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG;IANrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;gBAGjC,aAAa,GAAE,MAAM,qBAAqB,EAAa,EACvD,GAAG,GAAE,MAAM,IAAuB;IAGpD,uBAAuB,CACtB,KAAK,EAAE,2BAA2B,GAChC,yBAAyB;IAoC5B,YAAY,CAAC,KAAK,EAAE,mBAAmB,GAAG,eAAe;IA2GzD,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IAkBzD,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIzC,aAAa,IAAI,eAAe,EAAE;IAOlC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,yBAAyB,EAAE;IAe3D,aAAa,CAAC,KAAK,SAAK,GAAG,eAAe,EAAE;IAK5C,YAAY,IAAI,IAAI;IAMpB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,qBAAqB;CAQ7B;AAID,wBAAgB,2BAA2B,IAAI,wBAAwB,CAGtE;AAED,wBAAgB,kCAAkC,CACjD,OAAO,EAAE,wBAAwB,GAAG,IAAI,GACtC,IAAI,CAEN"}
|