@resolveio/server-lib 22.3.221 → 22.3.222
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/ai/assistant-core-heuristics.d.ts +11 -0
- package/ai/assistant-core-heuristics.js +356 -0
- package/ai/assistant-core-heuristics.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +3 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js +214 -0
- package/ai/resolveio-platform-intelligence-memory-corpus.js.map +1 -0
- package/ai/resolveio-platform-intelligence-memory.d.ts +20 -0
- package/ai/resolveio-platform-intelligence-memory.js +341 -0
- package/ai/resolveio-platform-intelligence-memory.js.map +1 -0
- package/{src/ai/resolveio-platform-intelligence-types.ts → ai/resolveio-platform-intelligence-types.d.ts} +15 -20
- package/ai/resolveio-platform-intelligence-types.js +4 -0
- package/ai/resolveio-platform-intelligence-types.js.map +1 -0
- package/ai/resolveio-platform-intelligence.d.ts +6 -0
- package/ai/resolveio-platform-intelligence.js +463 -0
- package/ai/resolveio-platform-intelligence.js.map +1 -0
- package/client-server-app.d.ts +1 -0
- package/client-server-app.js +68 -0
- package/client-server-app.js.map +1 -0
- package/collections/ai-run.collection.d.ts +3 -0
- package/collections/ai-run.collection.js +170 -0
- package/collections/ai-run.collection.js.map +1 -0
- package/collections/ai-terminal-conversation.collection.d.ts +2 -0
- package/collections/ai-terminal-conversation.collection.js +140 -0
- package/collections/ai-terminal-conversation.collection.js.map +1 -0
- package/collections/ai-terminal-issue-report.collection.d.ts +2 -0
- package/collections/ai-terminal-issue-report.collection.js +148 -0
- package/collections/ai-terminal-issue-report.collection.js.map +1 -0
- package/collections/ai-terminal-message.collection.d.ts +2 -0
- package/collections/ai-terminal-message.collection.js +121 -0
- package/collections/ai-terminal-message.collection.js.map +1 -0
- package/collections/app-setting.collection.d.ts +3 -0
- package/collections/app-setting.collection.js +103 -0
- package/collections/app-setting.collection.js.map +1 -0
- package/collections/app-status.collection.d.ts +3 -0
- package/collections/app-status.collection.js +57 -0
- package/collections/app-status.collection.js.map +1 -0
- package/collections/communication-metric.collection.d.ts +2 -0
- package/collections/communication-metric.collection.js +133 -0
- package/collections/communication-metric.collection.js.map +1 -0
- package/collections/counter.collection.d.ts +3 -0
- package/collections/counter.collection.js +56 -0
- package/collections/counter.collection.js.map +1 -0
- package/collections/cron-job-history.collection.d.ts +3 -0
- package/collections/cron-job-history.collection.js +137 -0
- package/collections/cron-job-history.collection.js.map +1 -0
- package/collections/cron-job.collection.d.ts +3 -0
- package/collections/cron-job.collection.js +92 -0
- package/collections/cron-job.collection.js.map +1 -0
- package/collections/customer-notification.collection.d.ts +3 -0
- package/collections/customer-notification.collection.js +130 -0
- package/collections/customer-notification.collection.js.map +1 -0
- package/collections/customer-portal-password.collection.d.ts +3 -0
- package/collections/customer-portal-password.collection.js +75 -0
- package/collections/customer-portal-password.collection.js.map +1 -0
- package/collections/email-history.collection.d.ts +3 -0
- package/collections/email-history.collection.js +134 -0
- package/collections/email-history.collection.js.map +1 -0
- package/collections/email-verified.collection.d.ts +3 -0
- package/collections/email-verified.collection.js +62 -0
- package/collections/email-verified.collection.js.map +1 -0
- package/collections/file.collection.d.ts +3 -0
- package/collections/file.collection.js +74 -0
- package/collections/file.collection.js.map +1 -0
- package/collections/flag-update.collection.d.ts +3 -0
- package/collections/flag-update.collection.js +57 -0
- package/collections/flag-update.collection.js.map +1 -0
- package/collections/flag.collection.d.ts +3 -0
- package/collections/flag.collection.js +57 -0
- package/collections/flag.collection.js.map +1 -0
- package/collections/log-method-latency.collection.d.ts +3 -0
- package/collections/log-method-latency.collection.js +77 -0
- package/collections/log-method-latency.collection.js.map +1 -0
- package/collections/log-subscription.collection.d.ts +3 -0
- package/collections/log-subscription.collection.js +80 -0
- package/collections/log-subscription.collection.js.map +1 -0
- package/collections/log.collection.d.ts +3 -0
- package/collections/log.collection.js +93 -0
- package/collections/log.collection.js.map +1 -0
- package/collections/logged-in-users.collection.d.ts +3 -0
- package/collections/logged-in-users.collection.js +67 -0
- package/collections/logged-in-users.collection.js.map +1 -0
- package/collections/monitor-cpu.collection.d.ts +3 -0
- package/collections/monitor-cpu.collection.js +65 -0
- package/collections/monitor-cpu.collection.js.map +1 -0
- package/collections/monitor-function.collection.d.ts +3 -0
- package/collections/monitor-function.collection.js +74 -0
- package/collections/monitor-function.collection.js.map +1 -0
- package/collections/monitor-memory.collection.d.ts +3 -0
- package/collections/monitor-memory.collection.js +77 -0
- package/collections/monitor-memory.collection.js.map +1 -0
- package/collections/monitor-mongo.collection.d.ts +3 -0
- package/collections/monitor-mongo.collection.js +71 -0
- package/collections/monitor-mongo.collection.js.map +1 -0
- package/collections/notification.collection.d.ts +3 -0
- package/collections/notification.collection.js +57 -0
- package/collections/notification.collection.js.map +1 -0
- package/collections/openai-usage-ledger.collection.d.ts +2 -0
- package/collections/openai-usage-ledger.collection.js +188 -0
- package/collections/openai-usage-ledger.collection.js.map +1 -0
- package/collections/report-builder-dashboard-builder.collection.d.ts +3 -0
- package/collections/report-builder-dashboard-builder.collection.js +109 -0
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
- package/collections/report-builder-library.collection.d.ts +3 -0
- package/collections/report-builder-library.collection.js +87 -0
- package/collections/report-builder-library.collection.js.map +1 -0
- package/collections/report-builder-report.collection.d.ts +4 -0
- package/collections/report-builder-report.collection.js +184 -0
- package/collections/report-builder-report.collection.js.map +1 -0
- package/collections/user-group.collection.d.ts +4 -0
- package/collections/user-group.collection.js +89 -0
- package/collections/user-group.collection.js.map +1 -0
- package/collections/user-guide.collection.d.ts +3 -0
- package/collections/user-guide.collection.js +57 -0
- package/collections/user-guide.collection.js.map +1 -0
- package/collections/user.collection.d.ts +4 -0
- package/collections/user.collection.js +180 -0
- package/collections/user.collection.js.map +1 -0
- package/cron/cron.d.ts +14 -0
- package/cron/cron.js +216 -0
- package/cron/cron.js.map +1 -0
- package/fixtures/cron-jobs.d.ts +1 -0
- package/fixtures/cron-jobs.js +150 -0
- package/fixtures/cron-jobs.js.map +1 -0
- package/fixtures/init.d.ts +1 -0
- package/fixtures/init.js +91 -0
- package/fixtures/init.js.map +1 -0
- package/http/auth.d.ts +2 -0
- package/http/auth.js +951 -0
- package/http/auth.js.map +1 -0
- package/http/health.d.ts +1 -0
- package/http/health.js +11 -0
- package/http/health.js.map +1 -0
- package/http/home.d.ts +1 -0
- package/http/home.js +134 -0
- package/http/home.js.map +1 -0
- package/http/slow-query-publication.d.ts +2 -0
- package/http/slow-query-publication.js +99 -0
- package/http/slow-query-publication.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/managers/ai-assistant-codex-manager.manager.d.ts +67 -0
- package/managers/ai-assistant-codex-manager.manager.js +1113 -0
- package/managers/ai-assistant-codex-manager.manager.js.map +1 -0
- package/managers/ai-run-evidence.manager.d.ts +36 -0
- package/managers/ai-run-evidence.manager.js +377 -0
- package/managers/ai-run-evidence.manager.js.map +1 -0
- package/managers/communication-metric.manager.d.ts +16 -0
- package/managers/communication-metric.manager.js +134 -0
- package/managers/communication-metric.manager.js.map +1 -0
- package/managers/cron.manager.d.ts +20 -0
- package/managers/cron.manager.js +534 -0
- package/managers/cron.manager.js.map +1 -0
- package/managers/customer-notification-content.manager.d.ts +55 -0
- package/managers/customer-notification-content.manager.js +158 -0
- package/managers/customer-notification-content.manager.js.map +1 -0
- package/managers/diagnostic-manager-bootstrap.d.ts +9 -0
- package/managers/diagnostic-manager-bootstrap.js +260 -0
- package/managers/diagnostic-manager-bootstrap.js.map +1 -0
- package/managers/error-auto-fix.manager.d.ts +149 -0
- package/managers/error-auto-fix.manager.js +3064 -0
- package/managers/error-auto-fix.manager.js.map +1 -0
- package/managers/local-log.manager.d.ts +18 -0
- package/managers/local-log.manager.js +88 -0
- package/managers/local-log.manager.js.map +1 -0
- package/managers/method.manager.d.ts +84 -0
- package/managers/method.manager.js +1964 -0
- package/managers/method.manager.js.map +1 -0
- package/managers/mongo.manager.d.ts +224 -0
- package/managers/mongo.manager.js +5000 -0
- package/managers/mongo.manager.js.map +1 -0
- package/managers/monitor.manager.d.ts +70 -0
- package/managers/monitor.manager.js +550 -0
- package/managers/monitor.manager.js.map +1 -0
- package/managers/openai-usage-ledger.manager.d.ts +30 -0
- package/managers/openai-usage-ledger.manager.js +142 -0
- package/managers/openai-usage-ledger.manager.js.map +1 -0
- package/managers/slow-query-verifier.manager.d.ts +144 -0
- package/managers/slow-query-verifier.manager.js +3857 -0
- package/managers/slow-query-verifier.manager.js.map +1 -0
- package/managers/slow-query.manager.d.ts +28 -0
- package/managers/slow-query.manager.js +468 -0
- package/managers/slow-query.manager.js.map +1 -0
- package/managers/subscription.manager.d.ts +169 -0
- package/managers/subscription.manager.js +3434 -0
- package/managers/subscription.manager.js.map +1 -0
- package/managers/websocket.manager.d.ts +73 -0
- package/managers/websocket.manager.js +673 -0
- package/managers/websocket.manager.js.map +1 -0
- package/managers/worker-dispatcher.manager.d.ts +120 -0
- package/managers/worker-dispatcher.manager.js +1266 -0
- package/managers/worker-dispatcher.manager.js.map +1 -0
- package/managers/worker-server.manager.d.ts +35 -0
- package/managers/worker-server.manager.js +582 -0
- package/managers/worker-server.manager.js.map +1 -0
- package/methods/accounts.d.ts +2 -0
- package/methods/accounts.js +624 -0
- package/methods/accounts.js.map +1 -0
- package/methods/ai-terminal.d.ts +458 -0
- package/methods/ai-terminal.js +27991 -0
- package/methods/ai-terminal.js.map +1 -0
- package/methods/app-settings.d.ts +2 -0
- package/methods/app-settings.js +169 -0
- package/methods/app-settings.js.map +1 -0
- package/methods/aws.d.ts +2 -0
- package/methods/aws.js +877 -0
- package/methods/aws.js.map +1 -0
- package/methods/collections.d.ts +2 -0
- package/methods/collections.js +719 -0
- package/methods/collections.js.map +1 -0
- package/methods/counters.d.ts +2 -0
- package/methods/counters.js +113 -0
- package/methods/counters.js.map +1 -0
- package/methods/cron-jobs.d.ts +2 -0
- package/methods/cron-jobs.js +2475 -0
- package/methods/cron-jobs.js.map +1 -0
- package/methods/customer-notifications.d.ts +2 -0
- package/methods/customer-notifications.js +528 -0
- package/methods/customer-notifications.js.map +1 -0
- package/methods/diagnostics.d.ts +2 -0
- package/methods/diagnostics.js +703 -0
- package/methods/diagnostics.js.map +1 -0
- package/methods/flag-updates.d.ts +2 -0
- package/methods/flag-updates.js +8 -0
- package/methods/flag-updates.js.map +1 -0
- package/methods/flags.d.ts +2 -0
- package/methods/flags.js +8 -0
- package/methods/flags.js.map +1 -0
- package/methods/logs.d.ts +2 -0
- package/methods/logs.js +751 -0
- package/methods/logs.js.map +1 -0
- package/methods/mongo-explorer.d.ts +2 -0
- package/methods/mongo-explorer.js +1808 -0
- package/methods/mongo-explorer.js.map +1 -0
- package/methods/monitor.d.ts +2 -0
- package/methods/monitor.js +543 -0
- package/methods/monitor.js.map +1 -0
- package/methods/pdf.d.ts +2 -0
- package/methods/pdf.js +1216 -0
- package/methods/pdf.js.map +1 -0
- package/methods/publications.d.ts +1 -0
- package/methods/publications.js +183 -0
- package/methods/publications.js.map +1 -0
- package/methods/report-builder.d.ts +2 -0
- package/methods/report-builder.js +3094 -0
- package/methods/report-builder.js.map +1 -0
- package/methods/support.d.ts +2 -0
- package/methods/support.js +430 -0
- package/methods/support.js.map +1 -0
- package/models/ai-run.model.d.ts +19 -0
- package/models/ai-run.model.js +4 -0
- package/models/ai-run.model.js.map +1 -0
- package/models/ai-terminal-conversation.model.d.ts +17 -0
- package/models/ai-terminal-conversation.model.js +4 -0
- package/models/ai-terminal-conversation.model.js.map +1 -0
- package/models/ai-terminal-issue-report.model.d.ts +19 -0
- package/models/ai-terminal-issue-report.model.js +4 -0
- package/models/ai-terminal-issue-report.model.js.map +1 -0
- package/models/ai-terminal-message.model.d.ts +22 -0
- package/models/ai-terminal-message.model.js +4 -0
- package/models/ai-terminal-message.model.js.map +1 -0
- package/models/app-setting.model.d.ts +16 -0
- package/models/app-setting.model.js +4 -0
- package/models/app-setting.model.js.map +1 -0
- package/{src/models/app-status.model.ts → models/app-status.model.d.ts} +2 -3
- package/models/app-status.model.js +4 -0
- package/models/app-status.model.js.map +1 -0
- package/{src/models/billing-logged-in-users.model.ts → models/billing-logged-in-users.model.d.ts} +4 -5
- package/models/billing-logged-in-users.model.js +4 -0
- package/models/billing-logged-in-users.model.js.map +1 -0
- package/models/collection-document.model.d.ts +21 -0
- package/models/collection-document.model.js +4 -0
- package/models/collection-document.model.js.map +1 -0
- package/models/communication-metric.model.d.ts +20 -0
- package/models/communication-metric.model.js +4 -0
- package/models/communication-metric.model.js.map +1 -0
- package/{src/models/counter.model.ts → models/counter.model.d.ts} +3 -4
- package/models/counter.model.js +4 -0
- package/models/counter.model.js.map +1 -0
- package/models/cron-job-history.model.d.ts +15 -0
- package/models/cron-job-history.model.js +4 -0
- package/models/cron-job-history.model.js.map +1 -0
- package/models/cron-job.model.d.ts +14 -0
- package/models/cron-job.model.js +4 -0
- package/models/cron-job.model.js.map +1 -0
- package/models/customer-notification.model.d.ts +26 -0
- package/models/customer-notification.model.js +4 -0
- package/models/customer-notification.model.js.map +1 -0
- package/models/customer-portal-password.model.d.ts +11 -0
- package/models/customer-portal-password.model.js +4 -0
- package/models/customer-portal-password.model.js.map +1 -0
- package/models/dialog.model.d.ts +23 -0
- package/models/dialog.model.js +4 -0
- package/models/dialog.model.js.map +1 -0
- package/models/email-history.model.d.ts +32 -0
- package/{src/models/email-history.model.ts → models/email-history.model.js} +4 -36
- package/models/email-history.model.js.map +1 -0
- package/{src/models/email-verified.model.ts → models/email-verified.model.d.ts} +5 -6
- package/models/email-verified.model.js +4 -0
- package/models/email-verified.model.js.map +1 -0
- package/{src/models/file.model.ts → models/file.model.d.ts} +7 -8
- package/models/file.model.js +4 -0
- package/models/file.model.js.map +1 -0
- package/{src/models/flag-update.model.ts → models/flag-update.model.d.ts} +3 -4
- package/models/flag-update.model.js +4 -0
- package/models/flag-update.model.js.map +1 -0
- package/{src/models/flag.model.ts → models/flag.model.d.ts} +3 -4
- package/models/flag.model.js +4 -0
- package/models/flag.model.js.map +1 -0
- package/models/log-method-latency.model.d.ts +10 -0
- package/models/log-method-latency.model.js +4 -0
- package/models/log-method-latency.model.js.map +1 -0
- package/{src/models/log-subscription.model.ts → models/log-subscription.model.d.ts} +9 -11
- package/models/log-subscription.model.js +4 -0
- package/models/log-subscription.model.js.map +1 -0
- package/models/log.model.d.ts +17 -0
- package/models/log.model.js +4 -0
- package/models/log.model.js.map +1 -0
- package/{src/models/logged-in-users.model.ts → models/logged-in-users.model.d.ts} +5 -6
- package/models/logged-in-users.model.js +4 -0
- package/models/logged-in-users.model.js.map +1 -0
- package/{src/models/method-response.model.ts → models/method-response.model.d.ts} +6 -7
- package/models/method-response.model.js +4 -0
- package/models/method-response.model.js.map +1 -0
- package/models/method.model.d.ts +26 -0
- package/models/method.model.js +4 -0
- package/models/method.model.js.map +1 -0
- package/{src/models/monitor-cpu.model.ts → models/monitor-cpu.model.d.ts} +7 -9
- package/models/monitor-cpu.model.js +4 -0
- package/models/monitor-cpu.model.js.map +1 -0
- package/models/monitor-function.model.d.ts +14 -0
- package/models/monitor-function.model.js +4 -0
- package/models/monitor-function.model.js.map +1 -0
- package/models/monitor-memory.model.d.ts +15 -0
- package/models/monitor-memory.model.js +4 -0
- package/models/monitor-memory.model.js.map +1 -0
- package/models/monitor-mongo.model.d.ts +13 -0
- package/models/monitor-mongo.model.js +4 -0
- package/models/monitor-mongo.model.js.map +1 -0
- package/{src/models/notification.model.ts → models/notification.model.d.ts} +4 -6
- package/models/notification.model.js +4 -0
- package/models/notification.model.js.map +1 -0
- package/models/openai-usage-ledger.model.d.ts +30 -0
- package/models/openai-usage-ledger.model.js +4 -0
- package/models/openai-usage-ledger.model.js.map +1 -0
- package/models/pagination.model.d.ts +11 -0
- package/models/pagination.model.js +28 -0
- package/models/pagination.model.js.map +1 -0
- package/models/permission.model.d.ts +12 -0
- package/models/permission.model.js +4 -0
- package/models/permission.model.js.map +1 -0
- package/models/report-builder-dashboard-builder.model.d.ts +25 -0
- package/models/report-builder-dashboard-builder.model.js +4 -0
- package/models/report-builder-dashboard-builder.model.js.map +1 -0
- package/models/report-builder-library.model.d.ts +17 -0
- package/models/report-builder-library.model.js +4 -0
- package/models/report-builder-library.model.js.map +1 -0
- package/models/report-builder-report.model.d.ts +121 -0
- package/models/report-builder-report.model.js +4 -0
- package/models/report-builder-report.model.js.map +1 -0
- package/models/report-builder.model.d.ts +61 -0
- package/models/report-builder.model.js +4 -0
- package/models/report-builder.model.js.map +1 -0
- package/models/select-data-label.model.d.ts +9 -0
- package/models/select-data-label.model.js +4 -0
- package/models/select-data-label.model.js.map +1 -0
- package/models/server-message.model.d.ts +32 -0
- package/models/server-message.model.js +4 -0
- package/models/server-message.model.js.map +1 -0
- package/models/slow-query-report.model.d.ts +23 -0
- package/models/slow-query-report.model.js +4 -0
- package/models/slow-query-report.model.js.map +1 -0
- package/models/subscription.model.d.ts +31 -0
- package/models/subscription.model.js +4 -0
- package/models/subscription.model.js.map +1 -0
- package/models/support-ticket.model.d.ts +87 -0
- package/models/support-ticket.model.js +4 -0
- package/models/support-ticket.model.js.map +1 -0
- package/models/user-group.model.d.ts +20 -0
- package/models/user-group.model.js +4 -0
- package/models/user-group.model.js.map +1 -0
- package/{src/models/user-guide.model.ts → models/user-guide.model.d.ts} +4 -5
- package/models/user-guide.model.js +4 -0
- package/models/user-guide.model.js.map +1 -0
- package/models/user.model.d.ts +84 -0
- package/models/user.model.js +4 -0
- package/models/user.model.js.map +1 -0
- package/package.json +1 -1
- package/private/images/ResolveIO.png +0 -0
- package/public_api.js +127 -0
- package/public_api.js.map +1 -0
- package/publications/ai-terminal.d.ts +1 -0
- package/publications/ai-terminal.js +122 -0
- package/publications/ai-terminal.js.map +1 -0
- package/publications/app-settings.d.ts +2 -0
- package/publications/app-settings.js +28 -0
- package/publications/app-settings.js.map +1 -0
- package/publications/app-status.d.ts +2 -0
- package/publications/app-status.js +16 -0
- package/publications/app-status.js.map +1 -0
- package/publications/cron-jobs.d.ts +2 -0
- package/publications/cron-jobs.js +88 -0
- package/publications/cron-jobs.js.map +1 -0
- package/publications/customer-notifications.d.ts +2 -0
- package/publications/customer-notifications.js +161 -0
- package/publications/customer-notifications.js.map +1 -0
- package/publications/files.d.ts +2 -0
- package/publications/files.js +36 -0
- package/publications/files.js.map +1 -0
- package/publications/flags-update.d.ts +2 -0
- package/publications/flags-update.js +22 -0
- package/publications/flags-update.js.map +1 -0
- package/publications/flags.d.ts +2 -0
- package/publications/flags.js +22 -0
- package/publications/flags.js.map +1 -0
- package/publications/logs.d.ts +2 -0
- package/publications/logs.js +164 -0
- package/publications/logs.js.map +1 -0
- package/publications/notifications.d.ts +2 -0
- package/publications/notifications.js +16 -0
- package/publications/notifications.js.map +1 -0
- package/publications/report-builder-dashboard-builders.d.ts +2 -0
- package/publications/report-builder-dashboard-builders.js +42 -0
- package/publications/report-builder-dashboard-builders.js.map +1 -0
- package/publications/report-builder-libraries.d.ts +2 -0
- package/publications/report-builder-libraries.js +90 -0
- package/publications/report-builder-libraries.js.map +1 -0
- package/publications/report-builder-reports.d.ts +2 -0
- package/publications/report-builder-reports.js +50 -0
- package/publications/report-builder-reports.js.map +1 -0
- package/publications/super-admin.d.ts +2 -0
- package/publications/super-admin.js +16 -0
- package/publications/super-admin.js.map +1 -0
- package/publications/user-groups.d.ts +1 -0
- package/publications/user-groups.js +16 -0
- package/publications/user-groups.js.map +1 -0
- package/publications/user-guides.d.ts +1 -0
- package/publications/user-guides.js +16 -0
- package/publications/user-guides.js.map +1 -0
- package/resolveio-server-app.d.ts +70 -0
- package/resolveio-server-app.js +801 -0
- package/resolveio-server-app.js.map +1 -0
- package/server-app.d.ts +228 -0
- package/server-app.js +3566 -0
- package/server-app.js.map +1 -0
- package/services/codex-client.d.ts +128 -0
- package/services/codex-client.js +1629 -0
- package/services/codex-client.js.map +1 -0
- package/services/openai-client.d.ts +46 -0
- package/services/openai-client.js +318 -0
- package/services/openai-client.js.map +1 -0
- package/types/error-report.d.ts +25 -0
- package/types/error-report.js +4 -0
- package/types/error-report.js.map +1 -0
- package/types/slow-query-report.d.ts +27 -0
- package/types/slow-query-report.js +6 -0
- package/types/slow-query-report.js.map +1 -0
- package/util/ai-qa-policy.d.ts +124 -0
- package/util/ai-qa-policy.js +736 -0
- package/util/ai-qa-policy.js.map +1 -0
- package/util/ai-run-evidence-adapters.d.ts +109 -0
- package/util/ai-run-evidence-adapters.js +7234 -0
- package/util/ai-run-evidence-adapters.js.map +1 -0
- package/util/ai-run-evidence-dashboard.d.ts +88 -0
- package/util/ai-run-evidence-dashboard.js +343 -0
- package/util/ai-run-evidence-dashboard.js.map +1 -0
- package/util/ai-run-evidence-eval.d.ts +86 -0
- package/util/ai-run-evidence-eval.js +1018 -0
- package/util/ai-run-evidence-eval.js.map +1 -0
- package/util/ai-run-evidence.d.ts +244 -0
- package/util/ai-run-evidence.js +1096 -0
- package/util/ai-run-evidence.js.map +1 -0
- package/util/ai-runner-artifacts.d.ts +82 -0
- package/util/ai-runner-artifacts.js +713 -0
- package/util/ai-runner-artifacts.js.map +1 -0
- package/util/ai-runner-manager-autopilot.d.ts +210 -0
- package/util/ai-runner-manager-autopilot.js +642 -0
- package/util/ai-runner-manager-autopilot.js.map +1 -0
- package/util/ai-runner-manager-policy.d.ts +807 -0
- package/util/ai-runner-manager-policy.js +3501 -0
- package/util/ai-runner-manager-policy.js.map +1 -0
- package/util/ai-runner-qa-auth.d.ts +5 -0
- package/util/ai-runner-qa-auth.js +839 -0
- package/util/ai-runner-qa-auth.js.map +1 -0
- package/util/ai-runner-qa-tools.d.ts +26 -0
- package/util/ai-runner-qa-tools.js +3520 -0
- package/util/ai-runner-qa-tools.js.map +1 -0
- package/util/aicoder-runner-v6.d.ts +426 -0
- package/util/aicoder-runner-v6.js +2464 -0
- package/util/aicoder-runner-v6.js.map +1 -0
- package/util/common.d.ts +31 -0
- package/util/common.js +683 -0
- package/util/common.js.map +1 -0
- package/util/customer-portal-password.d.ts +13 -0
- package/util/customer-portal-password.js +209 -0
- package/util/customer-portal-password.js.map +1 -0
- package/util/error-reporter.d.ts +52 -0
- package/util/error-reporter.js +326 -0
- package/util/error-reporter.js.map +1 -0
- package/util/error-tracking.d.ts +13 -0
- package/util/error-tracking.js +120 -0
- package/util/error-tracking.js.map +1 -0
- package/util/openai-usage-cost.d.ts +6 -0
- package/util/openai-usage-cost.js +103 -0
- package/util/openai-usage-cost.js.map +1 -0
- package/util/report-builder-unwinds.d.ts +15 -0
- package/util/report-builder-unwinds.js +156 -0
- package/util/report-builder-unwinds.js.map +1 -0
- package/util/runner-process-janitor.d.ts +27 -0
- package/util/runner-process-janitor.js +208 -0
- package/util/runner-process-janitor.js.map +1 -0
- package/util/schema-report-builder.d.ts +6 -0
- package/util/schema-report-builder.js +481 -0
- package/util/schema-report-builder.js.map +1 -0
- package/util/slow-query-reporter.d.ts +28 -0
- package/util/slow-query-reporter.js +226 -0
- package/util/slow-query-reporter.js.map +1 -0
- package/util/subscription-dependency-context.d.ts +34 -0
- package/util/subscription-dependency-context.js +1283 -0
- package/util/subscription-dependency-context.js.map +1 -0
- package/util/support-runner-v5.d.ts +1426 -0
- package/util/support-runner-v5.js +7643 -0
- package/util/support-runner-v5.js.map +1 -0
- package/util/tokenizer.d.ts +5 -0
- package/util/tokenizer.js +41 -0
- package/util/tokenizer.js.map +1 -0
- package/workers/codex-runner.worker.d.ts +1 -0
- package/workers/codex-runner.worker.js +192 -0
- package/workers/codex-runner.worker.js.map +1 -0
- package/.nodemon.json +0 -5
- package/.vscode/settings.json +0 -21
- package/AGENTS.md +0 -195
- package/README.md +0 -22
- package/build_package.sh +0 -5
- package/compileDTS.pl +0 -64
- package/docs/ai-assistant-nightly-eval.md +0 -65
- package/docs/ai-assistant-preflight-checklist.md +0 -23
- package/docs/ai-assistant-report-builder-bridge-playbook.md +0 -115
- package/eslint-plugin-custom/index.js +0 -7
- package/eslint-plugin-custom/rules/no-filter-zero-index.js +0 -44
- package/eslint.config.js +0 -103
- package/gulpfile.js +0 -216
- package/methodAndPublicationListGenerator.py +0 -375
- package/mongodbensurers.js +0 -2
- package/mongostop.js +0 -3
- package/scripts/cleanup-bypassed-callmethod-logs.js +0 -616
- package/settings.development.json +0 -25
- package/settings.development.redacted.json +0 -25
- package/src/.env +0 -12
- package/src/ai/assistant-core-heuristics.ts +0 -379
- package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +0 -185
- package/src/ai/resolveio-platform-intelligence-memory.ts +0 -325
- package/src/ai/resolveio-platform-intelligence.ts +0 -462
- package/src/client-server-app.ts +0 -12
- package/src/collections/ai-run.collection.ts +0 -117
- package/src/collections/ai-terminal-conversation.collection.ts +0 -91
- package/src/collections/ai-terminal-issue-report.collection.ts +0 -99
- package/src/collections/ai-terminal-message.collection.ts +0 -77
- package/src/collections/app-setting.collection.ts +0 -104
- package/src/collections/app-status.collection.ts +0 -58
- package/src/collections/communication-metric.collection.ts +0 -84
- package/src/collections/counter.collection.ts +0 -56
- package/src/collections/cron-job-history.collection.ts +0 -94
- package/src/collections/cron-job.collection.ts +0 -92
- package/src/collections/customer-notification.collection.ts +0 -131
- package/src/collections/customer-portal-password.collection.ts +0 -76
- package/src/collections/email-history.collection.ts +0 -134
- package/src/collections/email-verified.collection.ts +0 -62
- package/src/collections/file.collection.ts +0 -74
- package/src/collections/flag-update.collection.ts +0 -57
- package/src/collections/flag.collection.ts +0 -57
- package/src/collections/log-method-latency.collection.ts +0 -77
- package/src/collections/log-subscription.collection.ts +0 -80
- package/src/collections/log.collection.ts +0 -93
- package/src/collections/logged-in-users.collection.ts +0 -67
- package/src/collections/monitor-cpu.collection.ts +0 -65
- package/src/collections/monitor-function.collection.ts +0 -74
- package/src/collections/monitor-memory.collection.ts +0 -77
- package/src/collections/monitor-mongo.collection.ts +0 -71
- package/src/collections/notification.collection.ts +0 -57
- package/src/collections/openai-usage-ledger.collection.ts +0 -131
- package/src/collections/report-builder-dashboard-builder.collection.ts +0 -109
- package/src/collections/report-builder-library.collection.ts +0 -89
- package/src/collections/report-builder-report.collection.ts +0 -184
- package/src/collections/user-group.collection.ts +0 -89
- package/src/collections/user-guide.collection.ts +0 -57
- package/src/collections/user.collection.ts +0 -181
- package/src/cron/cron.ts +0 -117
- package/src/fixtures/cron-jobs.ts +0 -95
- package/src/fixtures/init.ts +0 -35
- package/src/http/auth.ts +0 -818
- package/src/http/health.ts +0 -7
- package/src/http/home.ts +0 -90
- package/src/http/slow-query-publication.ts +0 -49
- package/src/index.ts +0 -1
- package/src/managers/ai-assistant-codex-manager.manager.ts +0 -1131
- package/src/managers/ai-run-evidence.manager.ts +0 -264
- package/src/managers/communication-metric.manager.ts +0 -82
- package/src/managers/cron.manager.ts +0 -333
- package/src/managers/customer-notification-content.manager.ts +0 -236
- package/src/managers/diagnostic-manager-bootstrap.ts +0 -165
- package/src/managers/error-auto-fix.manager.ts +0 -2767
- package/src/managers/local-log.manager.ts +0 -113
- package/src/managers/method.manager.ts +0 -1857
- package/src/managers/mongo.manager.ts +0 -4575
- package/src/managers/monitor.manager.ts +0 -507
- package/src/managers/openai-usage-ledger.manager.ts +0 -112
- package/src/managers/slow-query-verifier.manager.ts +0 -3590
- package/src/managers/slow-query.manager.ts +0 -519
- package/src/managers/subscription.manager.ts +0 -3128
- package/src/managers/websocket.manager.ts +0 -746
- package/src/managers/worker-dispatcher.manager.ts +0 -1360
- package/src/managers/worker-server.manager.ts +0 -536
- package/src/methods/accounts.ts +0 -532
- package/src/methods/ai-terminal.ts +0 -29070
- package/src/methods/app-settings.ts +0 -114
- package/src/methods/aws.ts +0 -649
- package/src/methods/collections.ts +0 -641
- package/src/methods/counters.ts +0 -69
- package/src/methods/cron-jobs.ts +0 -2614
- package/src/methods/customer-notifications.ts +0 -458
- package/src/methods/diagnostics.ts +0 -616
- package/src/methods/flag-updates.ts +0 -7
- package/src/methods/flags.ts +0 -7
- package/src/methods/logs.ts +0 -657
- package/src/methods/mongo-explorer.ts +0 -1880
- package/src/methods/monitor.ts +0 -540
- package/src/methods/pdf.ts +0 -1236
- package/src/methods/publications.ts +0 -129
- package/src/methods/report-builder.ts +0 -3300
- package/src/methods/support.ts +0 -335
- package/src/models/ai-run.model.ts +0 -27
- package/src/models/ai-terminal-conversation.model.ts +0 -19
- package/src/models/ai-terminal-issue-report.model.ts +0 -21
- package/src/models/ai-terminal-message.model.ts +0 -24
- package/src/models/app-setting.model.ts +0 -17
- package/src/models/collection-document.model.ts +0 -24
- package/src/models/communication-metric.model.ts +0 -23
- package/src/models/cron-job-history.model.ts +0 -16
- package/src/models/cron-job.model.ts +0 -15
- package/src/models/customer-notification.model.ts +0 -28
- package/src/models/customer-portal-password.model.ts +0 -12
- package/src/models/dialog.model.ts +0 -25
- package/src/models/log-method-latency.model.ts +0 -11
- package/src/models/log.model.ts +0 -19
- package/src/models/method.model.ts +0 -25
- package/src/models/monitor-function.model.ts +0 -16
- package/src/models/monitor-memory.model.ts +0 -17
- package/src/models/monitor-mongo.model.ts +0 -15
- package/src/models/openai-usage-ledger.model.ts +0 -56
- package/src/models/pagination.model.ts +0 -35
- package/src/models/permission.model.ts +0 -14
- package/src/models/report-builder-dashboard-builder.model.ts +0 -29
- package/src/models/report-builder-library.model.ts +0 -20
- package/src/models/report-builder-report.model.ts +0 -136
- package/src/models/report-builder.model.ts +0 -68
- package/src/models/select-data-label.model.ts +0 -9
- package/src/models/server-message.model.ts +0 -31
- package/src/models/slow-query-report.model.ts +0 -23
- package/src/models/subscription.model.ts +0 -73
- package/src/models/support-ticket.model.ts +0 -104
- package/src/models/user-group.model.ts +0 -24
- package/src/models/user.model.ts +0 -96
- package/src/private/images/ResolveIO.png +0 -0
- package/src/publications/ai-terminal.ts +0 -73
- package/src/publications/app-settings.ts +0 -25
- package/src/publications/app-status.ts +0 -13
- package/src/publications/cron-jobs.ts +0 -40
- package/src/publications/customer-notifications.ts +0 -101
- package/src/publications/files.ts +0 -33
- package/src/publications/flags-update.ts +0 -19
- package/src/publications/flags.ts +0 -19
- package/src/publications/logs.ts +0 -163
- package/src/publications/notifications.ts +0 -13
- package/src/publications/report-builder-dashboard-builders.ts +0 -39
- package/src/publications/report-builder-libraries.ts +0 -41
- package/src/publications/report-builder-reports.ts +0 -47
- package/src/publications/super-admin.ts +0 -13
- package/src/publications/user-groups.ts +0 -12
- package/src/publications/user-guides.ts +0 -12
- package/src/resolveio-server-app.ts +0 -617
- package/src/server-app.ts +0 -3354
- package/src/services/codex-client.ts +0 -1231
- package/src/services/openai-client.ts +0 -265
- package/src/types/error-report.ts +0 -26
- package/src/types/js-tiktoken.d.ts +0 -11
- package/src/types/slow-query-report.ts +0 -28
- package/src/util/ai-qa-policy.ts +0 -925
- package/src/util/ai-run-evidence-adapters.ts +0 -8347
- package/src/util/ai-run-evidence-dashboard.ts +0 -323
- package/src/util/ai-run-evidence-eval.ts +0 -1057
- package/src/util/ai-run-evidence.ts +0 -1430
- package/src/util/ai-runner-artifacts.ts +0 -586
- package/src/util/ai-runner-manager-autopilot.ts +0 -961
- package/src/util/ai-runner-manager-policy.ts +0 -5011
- package/src/util/ai-runner-qa-auth.ts +0 -838
- package/src/util/ai-runner-qa-tools.ts +0 -3536
- package/src/util/aicoder-runner-v6.ts +0 -3121
- package/src/util/common.ts +0 -649
- package/src/util/customer-portal-password.ts +0 -183
- package/src/util/error-reporter.ts +0 -332
- package/src/util/error-tracking.ts +0 -79
- package/src/util/openai-usage-cost.ts +0 -114
- package/src/util/report-builder-unwinds.ts +0 -180
- package/src/util/runner-process-janitor.ts +0 -219
- package/src/util/schema-report-builder.ts +0 -448
- package/src/util/slow-query-reporter.ts +0 -216
- package/src/util/subscription-dependency-context.ts +0 -1096
- package/src/util/support-runner-v5.ts +0 -10040
- package/src/util/tokenizer.ts +0 -38
- package/src/workers/codex-runner.worker.ts +0 -142
- package/start_server.sh +0 -5
- package/tests/ai-assistant-corpus-build.ts +0 -484
- package/tests/ai-assistant-corpus-replay-e2e.ts +0 -774
- package/tests/ai-assistant-data-parity-e2e.ts +0 -1989
- package/tests/ai-assistant-eval-triage.ts +0 -831
- package/tests/ai-assistant-openai-e2e.ts +0 -1061
- package/tests/ai-assistant-openai-git-e2e.ts +0 -155
- package/tests/ai-assistant-preflight-matrix.ts +0 -215
- package/tests/ai-assistant-routing-eval.test.ts +0 -585
- package/tests/ai-assistant-snf-live-eval.ts +0 -975
- package/tests/ai-assistant-utils.test.ts +0 -4834
- package/tests/ai-manager-autopilot-snapshot.test.ts +0 -193
- package/tests/ai-manager-recovery-checkpoint.test.ts +0 -1383
- package/tests/ai-run-eval.test.ts +0 -132
- package/tests/ai-run-evidence.test.ts +0 -3773
- package/tests/ai-runner-contract.test.ts +0 -515
- package/tests/aicoder-runner-v6.test.ts +0 -822
- package/tests/error-reporter.test.ts +0 -145
- package/tests/method-publication-generator.test.ts +0 -46
- package/tests/report-builder-linking.test.ts +0 -79
- package/tests/resolveio-platform-intelligence.test.ts +0 -352
- package/tests/server-app-cron-owner.test.ts +0 -127
- package/tests/subscription-connect-race.test.ts +0 -158
- package/tests/subscription-dependency-context.test.ts +0 -324
- package/tests/subscription-manager-collection-tracking.test.ts +0 -86
- package/tests/subscription-manager-invalidation.test.ts +0 -86
- package/tests/support-runner-v5.test.ts +0 -3201
- package/tsconfig.json +0 -34
- /package/{src/private → private}/email-templates/enrollment.html +0 -0
- /package/{src/private → private}/email-templates/forgot-password.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket-modified.html +0 -0
- /package/{src/private → private}/email-templates/support-ticket.html +0 -0
- /package/{src/public_api.ts → public_api.d.ts} +0 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __values = (this && this.__values) || function(o) {
|
|
14
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
15
|
+
if (m) return m.call(o);
|
|
16
|
+
if (o && typeof o.length === "number") return {
|
|
17
|
+
next: function () {
|
|
18
|
+
if (o && i >= o.length) o = void 0;
|
|
19
|
+
return { value: o && o[i++], done: !o };
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
23
|
+
};
|
|
24
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
25
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
26
|
+
if (!m) return o;
|
|
27
|
+
var i = m.call(o), r, ar = [], e;
|
|
28
|
+
try {
|
|
29
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
30
|
+
}
|
|
31
|
+
catch (error) { e = { error: error }; }
|
|
32
|
+
finally {
|
|
33
|
+
try {
|
|
34
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
35
|
+
}
|
|
36
|
+
finally { if (e) throw e.error; }
|
|
37
|
+
}
|
|
38
|
+
return ar;
|
|
39
|
+
};
|
|
40
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
41
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
42
|
+
if (ar || !(i in from)) {
|
|
43
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
44
|
+
ar[i] = from[i];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.isCumulativeCodexUsageEntry = isCumulativeCodexUsageEntry;
|
|
51
|
+
exports.resolveOpenAIUsageThreadKey = resolveOpenAIUsageThreadKey;
|
|
52
|
+
exports.normalizeOpenAIUsageRowsForCosting = normalizeOpenAIUsageRowsForCosting;
|
|
53
|
+
exports.buildAIQaRun = buildAIQaRun;
|
|
54
|
+
exports.classifyAIRunOutcome = classifyAIRunOutcome;
|
|
55
|
+
exports.buildAIRun = buildAIRun;
|
|
56
|
+
exports.buildAIRunCost = buildAIRunCost;
|
|
57
|
+
exports.redactAIRunTrainingExample = redactAIRunTrainingExample;
|
|
58
|
+
function isoNow(value) {
|
|
59
|
+
if (value instanceof Date) {
|
|
60
|
+
return value.toISOString();
|
|
61
|
+
}
|
|
62
|
+
var parsed = value ? new Date(value) : new Date();
|
|
63
|
+
if (Number.isFinite(parsed.getTime())) {
|
|
64
|
+
return parsed.toISOString();
|
|
65
|
+
}
|
|
66
|
+
return new Date().toISOString();
|
|
67
|
+
}
|
|
68
|
+
function cleanText(value, max) {
|
|
69
|
+
if (max === void 0) { max = 1000; }
|
|
70
|
+
return String(value || '').replace(/\s+/g, ' ').trim().slice(0, max);
|
|
71
|
+
}
|
|
72
|
+
function cleanUsageNumber(value) {
|
|
73
|
+
var parsed = Number(value);
|
|
74
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
75
|
+
}
|
|
76
|
+
function cleanUsageDate(value) {
|
|
77
|
+
if (!value) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
var date = value instanceof Date ? value : new Date(value);
|
|
81
|
+
return Number.isFinite(date.getTime()) ? date : undefined;
|
|
82
|
+
}
|
|
83
|
+
function isCumulativeCodexUsageEntry(entry) {
|
|
84
|
+
return cleanText(entry === null || entry === void 0 ? void 0 : entry.category, 180).toLowerCase().startsWith('ai-dashboard-codex:');
|
|
85
|
+
}
|
|
86
|
+
function resolveOpenAIUsageThreadKey(entry) {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
var conversationId = cleanText((_a = entry === null || entry === void 0 ? void 0 : entry.id_conversation) !== null && _a !== void 0 ? _a : entry === null || entry === void 0 ? void 0 : entry.idConversation, 240);
|
|
89
|
+
if (conversationId) {
|
|
90
|
+
return conversationId;
|
|
91
|
+
}
|
|
92
|
+
return cleanText((_b = entry === null || entry === void 0 ? void 0 : entry.id_request) !== null && _b !== void 0 ? _b : entry === null || entry === void 0 ? void 0 : entry.idRequest, 240);
|
|
93
|
+
}
|
|
94
|
+
function normalizeOpenAIUsageRowsForCosting(rows) {
|
|
95
|
+
if (rows === void 0) { rows = []; }
|
|
96
|
+
if (!Array.isArray(rows) || !rows.length) {
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
var sortedRows = rows
|
|
100
|
+
.map(function (row, index) { return (__assign(__assign({}, row), { _sortIndex: index })); })
|
|
101
|
+
.sort(function (a, b) {
|
|
102
|
+
var _a, _b, _c, _d, _e, _f;
|
|
103
|
+
var timeA = ((_a = cleanUsageDate(a.timestamp)) === null || _a === void 0 ? void 0 : _a.getTime()) || 0;
|
|
104
|
+
var timeB = ((_b = cleanUsageDate(b.timestamp)) === null || _b === void 0 ? void 0 : _b.getTime()) || 0;
|
|
105
|
+
if (timeA !== timeB) {
|
|
106
|
+
return timeA - timeB;
|
|
107
|
+
}
|
|
108
|
+
var requestCompare = cleanText((_c = a.id_request) !== null && _c !== void 0 ? _c : a.idRequest, 240)
|
|
109
|
+
.localeCompare(cleanText((_d = b.id_request) !== null && _d !== void 0 ? _d : b.idRequest, 240));
|
|
110
|
+
if (requestCompare) {
|
|
111
|
+
return requestCompare;
|
|
112
|
+
}
|
|
113
|
+
var conversationCompare = cleanText((_e = a.id_conversation) !== null && _e !== void 0 ? _e : a.idConversation, 240)
|
|
114
|
+
.localeCompare(cleanText((_f = b.id_conversation) !== null && _f !== void 0 ? _f : b.idConversation, 240));
|
|
115
|
+
if (conversationCompare) {
|
|
116
|
+
return conversationCompare;
|
|
117
|
+
}
|
|
118
|
+
return cleanUsageNumber(a._sortIndex) - cleanUsageNumber(b._sortIndex);
|
|
119
|
+
});
|
|
120
|
+
var previousByThread = new Map();
|
|
121
|
+
return sortedRows.map(function (row) {
|
|
122
|
+
var _a, _b, _c, _d, _e, _f;
|
|
123
|
+
var inputTokens = cleanUsageNumber((_a = row.input_tokens) !== null && _a !== void 0 ? _a : row.inputTokens);
|
|
124
|
+
var cachedInputTokens = cleanUsageNumber((_b = row.cached_input_tokens) !== null && _b !== void 0 ? _b : row.cachedInputTokens);
|
|
125
|
+
var outputTokens = cleanUsageNumber((_c = row.output_tokens) !== null && _c !== void 0 ? _c : row.outputTokens);
|
|
126
|
+
var totalTokens = cleanUsageNumber((_e = (_d = row.total_tokens) !== null && _d !== void 0 ? _d : row.totalTokens) !== null && _e !== void 0 ? _e : (inputTokens + outputTokens));
|
|
127
|
+
var estimatedUsd = cleanUsageNumber((_f = row.cost_estimate) !== null && _f !== void 0 ? _f : row.estimatedUsd);
|
|
128
|
+
var threadKey = isCumulativeCodexUsageEntry(row) ? resolveOpenAIUsageThreadKey(row) : '';
|
|
129
|
+
var normalizedInputTokens = inputTokens;
|
|
130
|
+
var normalizedCachedInputTokens = cachedInputTokens;
|
|
131
|
+
var normalizedOutputTokens = outputTokens;
|
|
132
|
+
var normalizedTotalTokens = totalTokens;
|
|
133
|
+
var normalizedEstimatedUsd = estimatedUsd;
|
|
134
|
+
if (threadKey) {
|
|
135
|
+
var previous = previousByThread.get(threadKey);
|
|
136
|
+
if (previous
|
|
137
|
+
&& inputTokens >= previous.inputTokens
|
|
138
|
+
&& cachedInputTokens >= previous.cachedInputTokens
|
|
139
|
+
&& outputTokens >= previous.outputTokens
|
|
140
|
+
&& totalTokens >= previous.totalTokens
|
|
141
|
+
&& estimatedUsd >= previous.estimatedUsd) {
|
|
142
|
+
normalizedInputTokens = Math.max(0, inputTokens - previous.inputTokens);
|
|
143
|
+
normalizedCachedInputTokens = Math.max(0, cachedInputTokens - previous.cachedInputTokens);
|
|
144
|
+
normalizedOutputTokens = Math.max(0, outputTokens - previous.outputTokens);
|
|
145
|
+
normalizedTotalTokens = Math.max(0, totalTokens - previous.totalTokens);
|
|
146
|
+
normalizedEstimatedUsd = Math.max(0, estimatedUsd - previous.estimatedUsd);
|
|
147
|
+
}
|
|
148
|
+
previousByThread.set(threadKey, {
|
|
149
|
+
inputTokens: inputTokens,
|
|
150
|
+
cachedInputTokens: cachedInputTokens,
|
|
151
|
+
outputTokens: outputTokens,
|
|
152
|
+
totalTokens: totalTokens,
|
|
153
|
+
estimatedUsd: estimatedUsd
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
var resolvedTotalTokens = normalizedTotalTokens || (normalizedInputTokens + normalizedOutputTokens);
|
|
157
|
+
var resolvedEstimatedUsd = Number(normalizedEstimatedUsd.toFixed(6));
|
|
158
|
+
return __assign(__assign({}, row), { input_tokens: normalizedInputTokens, inputTokens: normalizedInputTokens, cached_input_tokens: normalizedCachedInputTokens, cachedInputTokens: normalizedCachedInputTokens, output_tokens: normalizedOutputTokens, outputTokens: normalizedOutputTokens, total_tokens: resolvedTotalTokens, totalTokens: resolvedTotalTokens, cost_estimate: resolvedEstimatedUsd, estimatedUsd: resolvedEstimatedUsd });
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function cleanList(values, limit, max) {
|
|
162
|
+
var e_1, _a;
|
|
163
|
+
if (limit === void 0) { limit = 20; }
|
|
164
|
+
if (max === void 0) { max = 500; }
|
|
165
|
+
if (!Array.isArray(values)) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
var result = [];
|
|
169
|
+
try {
|
|
170
|
+
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
|
171
|
+
var value = values_1_1.value;
|
|
172
|
+
var normalized = cleanText(value, max);
|
|
173
|
+
if (normalized && !result.includes(normalized)) {
|
|
174
|
+
result.push(normalized);
|
|
175
|
+
}
|
|
176
|
+
if (result.length >= limit) {
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
182
|
+
finally {
|
|
183
|
+
try {
|
|
184
|
+
if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
|
|
185
|
+
}
|
|
186
|
+
finally { if (e_1) throw e_1.error; }
|
|
187
|
+
}
|
|
188
|
+
return result;
|
|
189
|
+
}
|
|
190
|
+
function normalizeCheckStatus(value) {
|
|
191
|
+
var normalized = cleanText(value, 40).toLowerCase().replace(/[_\s-]+/g, '_');
|
|
192
|
+
if (normalized === 'passed' || normalized === 'ok' || normalized === 'ready') {
|
|
193
|
+
return 'pass';
|
|
194
|
+
}
|
|
195
|
+
if (normalized === 'failed' || normalized === 'error' || normalized === 'fail') {
|
|
196
|
+
return 'fail';
|
|
197
|
+
}
|
|
198
|
+
if (normalized === 'blocked' || normalized === 'dependency_blocked') {
|
|
199
|
+
return 'blocked';
|
|
200
|
+
}
|
|
201
|
+
if (normalized === 'warning') {
|
|
202
|
+
return 'warn';
|
|
203
|
+
}
|
|
204
|
+
if (normalized === 'skipped' || normalized === 'not_applicable') {
|
|
205
|
+
return 'skipped';
|
|
206
|
+
}
|
|
207
|
+
return normalized === 'pass' || normalized === 'warn' ? normalized : 'unknown';
|
|
208
|
+
}
|
|
209
|
+
function normalizeCompileStatus(value) {
|
|
210
|
+
var normalized = cleanText(value, 40).toLowerCase().replace(/[_\s-]+/g, '_');
|
|
211
|
+
if (normalized === 'passed' || normalized === 'ok') {
|
|
212
|
+
return 'pass';
|
|
213
|
+
}
|
|
214
|
+
if (normalized === 'failed' || normalized === 'error') {
|
|
215
|
+
return 'fail';
|
|
216
|
+
}
|
|
217
|
+
if (normalized === 'blocked') {
|
|
218
|
+
return 'blocked';
|
|
219
|
+
}
|
|
220
|
+
if (normalized === 'stale' || normalized === 'stale_evidence') {
|
|
221
|
+
return 'stale';
|
|
222
|
+
}
|
|
223
|
+
if (normalized === 'skipped' || normalized === 'not_applicable') {
|
|
224
|
+
return 'skipped';
|
|
225
|
+
}
|
|
226
|
+
return normalized === 'pass' || normalized === 'fail' ? normalized : 'unknown';
|
|
227
|
+
}
|
|
228
|
+
function makeGate(key, label, status, reason, evidenceRefs, now, metadata) {
|
|
229
|
+
if (evidenceRefs === void 0) { evidenceRefs = []; }
|
|
230
|
+
return __assign({ key: key, label: label, status: status, reason: cleanText(reason, 1400), evidenceRefs: cleanList(evidenceRefs, 20, 500), recordedAt: isoNow(now) }, (metadata ? { metadata: metadata } : {}));
|
|
231
|
+
}
|
|
232
|
+
function failedOrBlocked(status) {
|
|
233
|
+
return status === 'fail' || status === 'blocked';
|
|
234
|
+
}
|
|
235
|
+
function passed(status) {
|
|
236
|
+
return status === 'pass';
|
|
237
|
+
}
|
|
238
|
+
function normalizeInfraChecks(values) {
|
|
239
|
+
return (Array.isArray(values) ? values : []).map(function (entry) { return (__assign(__assign({}, entry), { name: cleanText(entry === null || entry === void 0 ? void 0 : entry.name, 120) || 'infra_check', status: normalizeCheckStatus(entry === null || entry === void 0 ? void 0 : entry.status), message: cleanText(entry === null || entry === void 0 ? void 0 : entry.message, 1000), path: cleanText(entry === null || entry === void 0 ? void 0 : entry.path, 500) })); });
|
|
240
|
+
}
|
|
241
|
+
function normalizeRouteProbes(values) {
|
|
242
|
+
return (Array.isArray(values) ? values : []).map(function (entry) { return (__assign(__assign({}, entry), { route: cleanText(entry === null || entry === void 0 ? void 0 : entry.route, 500) || '/', status: normalizeCheckStatus(entry === null || entry === void 0 ? void 0 : entry.status), screenshot: cleanText(entry === null || entry === void 0 ? void 0 : entry.screenshot, 500), caption: cleanText(entry === null || entry === void 0 ? void 0 : entry.caption, 1000), message: cleanText(entry === null || entry === void 0 ? void 0 : entry.message, 1000), consoleErrors: cleanList(entry === null || entry === void 0 ? void 0 : entry.consoleErrors, 30, 500), networkErrors: cleanList(entry === null || entry === void 0 ? void 0 : entry.networkErrors, 30, 500) })); });
|
|
243
|
+
}
|
|
244
|
+
function normalizeBusinessAssertions(values) {
|
|
245
|
+
return (Array.isArray(values) ? values : []).map(function (entry) { return (__assign(__assign({}, entry), { assertion: cleanText(entry === null || entry === void 0 ? void 0 : entry.assertion, 1000) || 'business assertion', status: normalizeCheckStatus(entry === null || entry === void 0 ? void 0 : entry.status), workflow: cleanText(entry === null || entry === void 0 ? void 0 : entry.workflow, 400), route: cleanText(entry === null || entry === void 0 ? void 0 : entry.route, 500), action: cleanText(entry === null || entry === void 0 ? void 0 : entry.action, 500), expected: cleanText(entry === null || entry === void 0 ? void 0 : entry.expected, 1000), observed: cleanText(entry === null || entry === void 0 ? void 0 : entry.observed, 1000), dataProof: cleanText(entry === null || entry === void 0 ? void 0 : entry.dataProof, 1400), artifactPaths: cleanList(entry === null || entry === void 0 ? void 0 : entry.artifactPaths, 30, 500), message: cleanText(entry === null || entry === void 0 ? void 0 : entry.message, 1000) })); });
|
|
246
|
+
}
|
|
247
|
+
function collectBusinessAssertionArtifactPaths(assertions) {
|
|
248
|
+
var e_2, _a, e_3, _b;
|
|
249
|
+
var paths = [];
|
|
250
|
+
try {
|
|
251
|
+
for (var assertions_1 = __values(assertions), assertions_1_1 = assertions_1.next(); !assertions_1_1.done; assertions_1_1 = assertions_1.next()) {
|
|
252
|
+
var assertion = assertions_1_1.value;
|
|
253
|
+
try {
|
|
254
|
+
for (var _c = (e_3 = void 0, __values(assertion.artifactPaths || [])), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
255
|
+
var artifactPath = _d.value;
|
|
256
|
+
if (artifactPath && !paths.includes(artifactPath)) {
|
|
257
|
+
paths.push(artifactPath);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
262
|
+
finally {
|
|
263
|
+
try {
|
|
264
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
265
|
+
}
|
|
266
|
+
finally { if (e_3) throw e_3.error; }
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
271
|
+
finally {
|
|
272
|
+
try {
|
|
273
|
+
if (assertions_1_1 && !assertions_1_1.done && (_a = assertions_1.return)) _a.call(assertions_1);
|
|
274
|
+
}
|
|
275
|
+
finally { if (e_2) throw e_2.error; }
|
|
276
|
+
}
|
|
277
|
+
return paths;
|
|
278
|
+
}
|
|
279
|
+
function buildAIQaRun(input) {
|
|
280
|
+
if (input === void 0) { input = {}; }
|
|
281
|
+
var now = isoNow(input.now);
|
|
282
|
+
var infraChecks = normalizeInfraChecks(input.infraChecks);
|
|
283
|
+
var compile = input.compile
|
|
284
|
+
? __assign(__assign({}, input.compile), { status: normalizeCompileStatus(input.compile.status), command: cleanText(input.compile.command, 500), artifactPath: cleanText(input.compile.artifactPath, 500), message: cleanText(input.compile.message, 1000) }) : undefined;
|
|
285
|
+
var routeProbes = normalizeRouteProbes(input.routeProbes);
|
|
286
|
+
var businessAssertions = normalizeBusinessAssertions(input.businessAssertions);
|
|
287
|
+
var artifacts = Array.isArray(input.artifacts) ? input.artifacts : [];
|
|
288
|
+
var gateResults = [];
|
|
289
|
+
var failedInfra = infraChecks.filter(function (check) { return failedOrBlocked(check.status); });
|
|
290
|
+
if (failedInfra.length) {
|
|
291
|
+
gateResults.push(makeGate('qa_infra', 'QA infrastructure', 'blocked', "QA infrastructure failed before model/business validation: ".concat(failedInfra.map(function (check) { return "".concat(check.name, ": ").concat(check.message || check.status); }).join('; ')), failedInfra.map(function (check) { return check.path || ''; }).filter(Boolean), now, { failed_checks: failedInfra.map(function (check) { return check.name; }) }));
|
|
292
|
+
return { outcome: 'infra_failed', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
293
|
+
}
|
|
294
|
+
if (infraChecks.length) {
|
|
295
|
+
gateResults.push(makeGate('qa_infra', 'QA infrastructure', 'pass', 'QA infrastructure preflight checks passed.', [], now));
|
|
296
|
+
}
|
|
297
|
+
if (compile && (failedOrBlocked(compile.status) || compile.status === 'stale' || compile.staleEvidence === true)) {
|
|
298
|
+
gateResults.push(makeGate('qa_compile', 'Compile/build', 'fail', compile.status === 'stale' || compile.staleEvidence === true
|
|
299
|
+
? 'Compile/build evidence is stale and cannot be used for acceptance.'
|
|
300
|
+
: (compile.message || 'Compile/build failed before browser QA.'), compile.artifactPath ? [compile.artifactPath] : [], now, { command: compile.command || '' }));
|
|
301
|
+
return { outcome: 'compile_failed', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
302
|
+
}
|
|
303
|
+
if (compile && passed(compile.status)) {
|
|
304
|
+
gateResults.push(makeGate('qa_compile', 'Compile/build', 'pass', 'Compile/build evidence passed.', compile.artifactPath ? [compile.artifactPath] : [], now));
|
|
305
|
+
}
|
|
306
|
+
var failedRouteProbes = routeProbes.filter(function (probe) { return failedOrBlocked(probe.status) || probe.shellOnly === true; });
|
|
307
|
+
if (failedRouteProbes.length) {
|
|
308
|
+
gateResults.push(makeGate('qa_route_probe', 'Browser route probe', 'fail', "Browser route probe failed or showed shell-only UI: ".concat(failedRouteProbes.map(function (probe) { return "".concat(probe.route, ": ").concat(probe.message || probe.caption || probe.status); }).join('; ')), failedRouteProbes.map(function (probe) { return probe.screenshot || ''; }).filter(Boolean), now));
|
|
309
|
+
return { outcome: 'route_failed', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
310
|
+
}
|
|
311
|
+
if (routeProbes.some(function (probe) { return passed(probe.status); })) {
|
|
312
|
+
gateResults.push(makeGate('qa_route_probe', 'Browser route probe', 'pass', 'Browser route reached authenticated application content. This is not business acceptance by itself.', routeProbes.map(function (probe) { return probe.screenshot || ''; }).filter(Boolean), now));
|
|
313
|
+
}
|
|
314
|
+
var failedBusinessAssertions = businessAssertions.filter(function (assertion) { return failedOrBlocked(assertion.status); });
|
|
315
|
+
if (failedBusinessAssertions.length) {
|
|
316
|
+
gateResults.push(makeGate('qa_business_assertion', 'Business assertion', 'fail', "Issue-specific workflow assertion failed: ".concat(failedBusinessAssertions.map(function (assertion) { return assertion.message || assertion.observed || assertion.assertion; }).join('; ')), collectBusinessAssertionArtifactPaths(failedBusinessAssertions), now));
|
|
317
|
+
return { outcome: 'business_assertion_failed', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
318
|
+
}
|
|
319
|
+
var passedBusinessAssertions = businessAssertions.filter(function (assertion) { return passed(assertion.status); });
|
|
320
|
+
if (passedBusinessAssertions.length) {
|
|
321
|
+
gateResults.push(makeGate('qa_business_assertion', 'Business assertion', 'pass', 'At least one issue-specific workflow/data assertion passed.', collectBusinessAssertionArtifactPaths(passedBusinessAssertions), now, { passed_assertions: passedBusinessAssertions.map(function (assertion) { return assertion.assertion; }) }));
|
|
322
|
+
return { outcome: 'business_assertion_passed', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
323
|
+
}
|
|
324
|
+
if (routeProbes.some(function (probe) { return passed(probe.status); })) {
|
|
325
|
+
gateResults.push(makeGate('qa_business_assertion', 'Business assertion', 'blocked', 'Browser route loaded, but no issue-specific business assertion passed. Route-only proof cannot accept the run.', [], now));
|
|
326
|
+
return { outcome: 'route_only_pass', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
327
|
+
}
|
|
328
|
+
gateResults.push(makeGate('qa_business_assertion', 'Business assertion', 'blocked', 'No issue-specific QA assertion was recorded.', [], now));
|
|
329
|
+
return { outcome: 'incomplete', infraChecks: infraChecks, compile: compile, routeProbes: routeProbes, businessAssertions: businessAssertions, artifacts: artifacts, gateResults: gateResults, updatedAt: now };
|
|
330
|
+
}
|
|
331
|
+
function normalizeQaRun(input) {
|
|
332
|
+
if (!input) {
|
|
333
|
+
return undefined;
|
|
334
|
+
}
|
|
335
|
+
if (input.outcome && Array.isArray(input.gateResults)) {
|
|
336
|
+
return input;
|
|
337
|
+
}
|
|
338
|
+
return buildAIQaRun(input);
|
|
339
|
+
}
|
|
340
|
+
function statusLooksFailed(value) {
|
|
341
|
+
var normalized = cleanText(value, 120).toLowerCase();
|
|
342
|
+
return !!normalized && /(fail|failed|error|blocked|missing|empty|stale|skipped|not ready|not_ready|could not|cannot)/i.test(normalized);
|
|
343
|
+
}
|
|
344
|
+
function statusLooksPassed(value) {
|
|
345
|
+
var normalized = cleanText(value, 120).toLowerCase();
|
|
346
|
+
return !!normalized && /(pass|passed|success|complete|completed|ready|published|deployed|live|merged)/i.test(normalized);
|
|
347
|
+
}
|
|
348
|
+
function addGateOnce(gates, gate) {
|
|
349
|
+
if (gates.some(function (entry) { return entry.key === gate.key && entry.status === gate.status && entry.reason === gate.reason; })) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
gates.push(gate);
|
|
353
|
+
}
|
|
354
|
+
function classifyAIRunOutcome(input) {
|
|
355
|
+
var e_4, _a;
|
|
356
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
357
|
+
if (input === void 0) { input = {}; }
|
|
358
|
+
var now = isoNow(input.now);
|
|
359
|
+
var gates = Array.isArray(input.gates) ? __spreadArray([], __read(input.gates), false) : [];
|
|
360
|
+
var warnings = [];
|
|
361
|
+
var qa = normalizeQaRun(input.qa);
|
|
362
|
+
if (qa) {
|
|
363
|
+
try {
|
|
364
|
+
for (var _z = __values(qa.gateResults), _0 = _z.next(); !_0.done; _0 = _z.next()) {
|
|
365
|
+
var gate = _0.value;
|
|
366
|
+
addGateOnce(gates, gate);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
370
|
+
finally {
|
|
371
|
+
try {
|
|
372
|
+
if (_0 && !_0.done && (_a = _z.return)) _a.call(_z);
|
|
373
|
+
}
|
|
374
|
+
finally { if (e_4) throw e_4.error; }
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
var supportParkedByStatus = input.source === 'support_ticket'
|
|
378
|
+
&& (input.manualHandoff === true || input.stopped === true || /stop|stopped|cancel|cancelled|paused|handoff/i.test("".concat(input.status || '', " ").concat(input.phase || '')));
|
|
379
|
+
if (supportParkedByStatus) {
|
|
380
|
+
var blockedSupportAutoloopNoProgressGate_1 = gates.find(function (gate) { return gate.key === 'support_autoloop_no_progress' && gate.status === 'blocked'; });
|
|
381
|
+
if (blockedSupportAutoloopNoProgressGate_1) {
|
|
382
|
+
return {
|
|
383
|
+
outcome: 'manual_handoff',
|
|
384
|
+
reason: "Support autoloop parked before another repair loop because no new evidence was recorded: ".concat(blockedSupportAutoloopNoProgressGate_1.reason),
|
|
385
|
+
nextAction: 'Collect new material evidence, rerun read-only diagnosis or issue-class proof, then resume only if the blocker fingerprint changes.',
|
|
386
|
+
gates: gates,
|
|
387
|
+
warnings: warnings,
|
|
388
|
+
recordedAt: now
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
var blockedSupportAutoloopApprovalGate_1 = gates.find(function (gate) { return gate.key === 'support_autoloop_approval_block' && gate.status === 'blocked'; });
|
|
392
|
+
if (blockedSupportAutoloopApprovalGate_1) {
|
|
393
|
+
var nextAction = cleanText((_b = blockedSupportAutoloopApprovalGate_1.metadata) === null || _b === void 0 ? void 0 : _b.nextAction, 160)
|
|
394
|
+
|| cleanText((_c = blockedSupportAutoloopApprovalGate_1.metadata) === null || _c === void 0 ? void 0 : _c.action, 160);
|
|
395
|
+
var elapsedReapproval = ((_d = blockedSupportAutoloopApprovalGate_1.metadata) === null || _d === void 0 ? void 0 : _d.requiresElapsedReapproval) === true;
|
|
396
|
+
return {
|
|
397
|
+
outcome: 'manual_handoff',
|
|
398
|
+
reason: "Support autoloop parked before another repair loop because approval/scope is blocked: ".concat(blockedSupportAutoloopApprovalGate_1.reason),
|
|
399
|
+
nextAction: elapsedReapproval
|
|
400
|
+
? 'Approve continued runtime beyond the current wall-clock boundary or park the ticket for manual review; do not run another model/code/QA continuation until that decision is recorded.'
|
|
401
|
+
: nextAction
|
|
402
|
+
? "Run ".concat(nextAction, " or revise the blocked scope, then resume the approved autoloop toward A-grade QA/business proof.")
|
|
403
|
+
: 'Approve the blocked support autonomy scope or revise the diagnosis, owner files, planned change, estimate, or classification before the autoloop continues.',
|
|
404
|
+
gates: gates,
|
|
405
|
+
warnings: warnings,
|
|
406
|
+
recordedAt: now
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
var blockedSupportAutonomyApprovalGate_1 = gates.find(function (gate) { return gate.key === 'support_autonomy_approval' && gate.status === 'blocked'; });
|
|
410
|
+
if (blockedSupportAutonomyApprovalGate_1) {
|
|
411
|
+
return {
|
|
412
|
+
outcome: 'manual_handoff',
|
|
413
|
+
reason: "Support autonomy is waiting on operator approval or revised intake/diagnosis scope: ".concat(blockedSupportAutonomyApprovalGate_1.reason),
|
|
414
|
+
nextAction: ((_e = blockedSupportAutonomyApprovalGate_1.metadata) === null || _e === void 0 ? void 0 : _e.approvalAction)
|
|
415
|
+
? "Use ".concat(blockedSupportAutonomyApprovalGate_1.metadata.approvalAction, " or revise the blocked scope, then allow the runner to continue until A-grade QA/business proof.")
|
|
416
|
+
: 'Approve the bounded support autonomy request or revise classification, estimate, owner files, or diagnosis scope before product-code repair.',
|
|
417
|
+
gates: gates,
|
|
418
|
+
warnings: warnings,
|
|
419
|
+
recordedAt: now
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
var blockedSupportProductRepairDispatchGate_1 = gates.find(function (gate) { return gate.key === 'support_product_repair_dispatch_guard' && gate.status === 'blocked'; });
|
|
423
|
+
if (blockedSupportProductRepairDispatchGate_1) {
|
|
424
|
+
return {
|
|
425
|
+
outcome: 'manual_handoff',
|
|
426
|
+
reason: "Support product-code repair dispatch is blocked by the approval/scope guard: ".concat(blockedSupportProductRepairDispatchGate_1.reason),
|
|
427
|
+
nextAction: ((_f = blockedSupportProductRepairDispatchGate_1.metadata) === null || _f === void 0 ? void 0 : _f.nextAction)
|
|
428
|
+
? "Run ".concat(blockedSupportProductRepairDispatchGate_1.metadata.nextAction, " before product-code repair continues.")
|
|
429
|
+
: 'Approve the current support autonomy scope or revise the diagnosis/owner-file set before product-code repair continues.',
|
|
430
|
+
gates: gates,
|
|
431
|
+
warnings: warnings,
|
|
432
|
+
recordedAt: now
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
var blockedSupportHumanDecisionGate_1 = gates.find(function (gate) { return gate.key === 'support_human_decision_request' && gate.status === 'blocked'; });
|
|
436
|
+
if (blockedSupportHumanDecisionGate_1) {
|
|
437
|
+
return {
|
|
438
|
+
outcome: 'manual_handoff',
|
|
439
|
+
reason: "Support run is waiting on a specific operator decision: ".concat(blockedSupportHumanDecisionGate_1.reason),
|
|
440
|
+
nextAction: ((_g = blockedSupportHumanDecisionGate_1.metadata) === null || _g === void 0 ? void 0 : _g.preferredChoiceId)
|
|
441
|
+
? "Choose ".concat(blockedSupportHumanDecisionGate_1.metadata.preferredChoiceId, " or an equivalent safe console action, then resume the runner.")
|
|
442
|
+
: 'Answer the requested support runner decision, then resume the runner.',
|
|
443
|
+
gates: gates,
|
|
444
|
+
warnings: warnings,
|
|
445
|
+
recordedAt: now
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (input.manualHandoff === true) {
|
|
450
|
+
return {
|
|
451
|
+
outcome: 'manual_handoff',
|
|
452
|
+
reason: 'Run requires manual handoff.',
|
|
453
|
+
nextAction: 'Ask a human operator to resolve the blocked run.',
|
|
454
|
+
gates: gates,
|
|
455
|
+
warnings: warnings,
|
|
456
|
+
recordedAt: now
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
if (input.stopped === true || /stop|stopped|cancel|cancelled|paused/i.test("".concat(input.status || '', " ").concat(input.phase || ''))) {
|
|
460
|
+
return {
|
|
461
|
+
outcome: 'stopped',
|
|
462
|
+
reason: 'Run was stopped before accepted evidence was recorded.',
|
|
463
|
+
nextAction: 'Resume or restart only if the request is still active.',
|
|
464
|
+
gates: gates,
|
|
465
|
+
warnings: warnings,
|
|
466
|
+
recordedAt: now
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (input.rejected === true) {
|
|
470
|
+
return {
|
|
471
|
+
outcome: 'rejected',
|
|
472
|
+
reason: 'Run was explicitly rejected.',
|
|
473
|
+
nextAction: 'Start a repair run from the failing evidence.',
|
|
474
|
+
gates: gates,
|
|
475
|
+
warnings: warnings,
|
|
476
|
+
recordedAt: now
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
var blockedHotfixCommitGate = gates.find(function (gate) { return gate.key === 'hotfix_commit_proof' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
480
|
+
if (blockedHotfixCommitGate) {
|
|
481
|
+
return {
|
|
482
|
+
outcome: 'release_blocked',
|
|
483
|
+
reason: "Hotfix cannot be treated as durable until GitHub commit proof passes: ".concat(blockedHotfixCommitGate.reason),
|
|
484
|
+
nextAction: 'Commit and push the hotfix to GitHub, record sourceCommitSha/githubCommitUrl/gitCommitStatus/gitPushStatus, then rerun the smallest release gate.',
|
|
485
|
+
gates: gates,
|
|
486
|
+
warnings: warnings,
|
|
487
|
+
recordedAt: now
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
var blockedNoBlindLoopGate = gates.find(function (gate) { return gate.key === 'manager_no_blind_loop_policy' && gate.status === 'blocked'; });
|
|
491
|
+
if (blockedNoBlindLoopGate) {
|
|
492
|
+
return {
|
|
493
|
+
outcome: 'manual_handoff',
|
|
494
|
+
reason: "Manager parked the run to avoid a blind loop: ".concat(blockedNoBlindLoopGate.reason),
|
|
495
|
+
nextAction: 'Collect new material evidence or approve the specific recovery decision before any more model/code repair.',
|
|
496
|
+
gates: gates,
|
|
497
|
+
warnings: warnings,
|
|
498
|
+
recordedAt: now
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
var blockedSupportAutoloopNoProgressGate = gates.find(function (gate) { return gate.key === 'support_autoloop_no_progress' && gate.status === 'blocked'; });
|
|
502
|
+
if (input.source === 'support_ticket' && blockedSupportAutoloopNoProgressGate) {
|
|
503
|
+
return {
|
|
504
|
+
outcome: 'manual_handoff',
|
|
505
|
+
reason: "Support autoloop parked before another repair loop because no new evidence was recorded: ".concat(blockedSupportAutoloopNoProgressGate.reason),
|
|
506
|
+
nextAction: 'Collect new material evidence, rerun read-only diagnosis or issue-class proof, then resume only if the blocker fingerprint changes.',
|
|
507
|
+
gates: gates,
|
|
508
|
+
warnings: warnings,
|
|
509
|
+
recordedAt: now
|
|
510
|
+
};
|
|
511
|
+
}
|
|
512
|
+
var blockedSupportDiagnosisBeforeRepairGate = gates.find(function (gate) { return gate.key === 'support_diagnosis_before_repair' && gate.status === 'blocked'; });
|
|
513
|
+
if (blockedSupportDiagnosisBeforeRepairGate) {
|
|
514
|
+
return {
|
|
515
|
+
outcome: 'manual_handoff',
|
|
516
|
+
reason: "Support repair is parked until root-cause diagnosis validates: ".concat(blockedSupportDiagnosisBeforeRepairGate.reason),
|
|
517
|
+
nextAction: 'Run read-only support diagnosis, record support_diagnosis_gate with owner_files and before/action/after proof, then retry only the owner-scoped repair.',
|
|
518
|
+
gates: gates,
|
|
519
|
+
warnings: warnings,
|
|
520
|
+
recordedAt: now
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
var blockedSupportOwnerFileScopeGate = gates.find(function (gate) { return gate.key === 'support_owner_file_scope' && gate.status === 'blocked'; });
|
|
524
|
+
if (blockedSupportOwnerFileScopeGate) {
|
|
525
|
+
return {
|
|
526
|
+
outcome: 'manual_handoff',
|
|
527
|
+
reason: "Support repair exceeded the diagnosed owner-file scope: ".concat(blockedSupportOwnerFileScopeGate.reason),
|
|
528
|
+
nextAction: 'Revise the SupportDiagnosisGate with evidence for each new owner file, update failing_path/proof_plan, then run only the bounded owner-scoped repair.',
|
|
529
|
+
gates: gates,
|
|
530
|
+
warnings: warnings,
|
|
531
|
+
recordedAt: now
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
var blockedSupportIntakeRevisionGate = gates.find(function (gate) { return gate.key === 'support_intake_revision_contract' && gate.status === 'blocked'; });
|
|
535
|
+
if (input.source === 'support_ticket' && blockedSupportIntakeRevisionGate) {
|
|
536
|
+
var requiredOperatorAction = cleanText((_h = blockedSupportIntakeRevisionGate.metadata) === null || _h === void 0 ? void 0 : _h.requiredOperatorAction, 160);
|
|
537
|
+
return {
|
|
538
|
+
outcome: 'manual_handoff',
|
|
539
|
+
reason: "Support intake/classification changed after approval: ".concat(blockedSupportIntakeRevisionGate.reason),
|
|
540
|
+
nextAction: requiredOperatorAction
|
|
541
|
+
? "Run ".concat(requiredOperatorAction, " to approve the revised intake/scope before product-code repair continues.")
|
|
542
|
+
: 'Approve the revised support intake/scope before product-code repair continues.',
|
|
543
|
+
gates: gates,
|
|
544
|
+
warnings: warnings,
|
|
545
|
+
recordedAt: now
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
var blockedSupportAutoloopApprovalGate = gates.find(function (gate) { return gate.key === 'support_autoloop_approval_block' && gate.status === 'blocked'; });
|
|
549
|
+
if (input.source === 'support_ticket' && blockedSupportAutoloopApprovalGate) {
|
|
550
|
+
var nextAction = cleanText((_j = blockedSupportAutoloopApprovalGate.metadata) === null || _j === void 0 ? void 0 : _j.nextAction, 160)
|
|
551
|
+
|| cleanText((_k = blockedSupportAutoloopApprovalGate.metadata) === null || _k === void 0 ? void 0 : _k.action, 160);
|
|
552
|
+
var elapsedReapproval = ((_l = blockedSupportAutoloopApprovalGate.metadata) === null || _l === void 0 ? void 0 : _l.requiresElapsedReapproval) === true;
|
|
553
|
+
return {
|
|
554
|
+
outcome: 'manual_handoff',
|
|
555
|
+
reason: "Support autoloop parked before another repair loop because approval/scope is blocked: ".concat(blockedSupportAutoloopApprovalGate.reason),
|
|
556
|
+
nextAction: elapsedReapproval
|
|
557
|
+
? 'Approve continued runtime beyond the current wall-clock boundary or park the ticket for manual review; do not run another model/code/QA continuation until that decision is recorded.'
|
|
558
|
+
: nextAction
|
|
559
|
+
? "Run ".concat(nextAction, " or revise the blocked scope, then resume the approved autoloop toward A-grade QA/business proof.")
|
|
560
|
+
: 'Approve the blocked support autonomy scope or revise the diagnosis, owner files, planned change, estimate, or classification before the autoloop continues.',
|
|
561
|
+
gates: gates,
|
|
562
|
+
warnings: warnings,
|
|
563
|
+
recordedAt: now
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
var blockedSupportAutonomyApprovalGate = gates.find(function (gate) { return gate.key === 'support_autonomy_approval' && gate.status === 'blocked'; });
|
|
567
|
+
if (input.source === 'support_ticket' && blockedSupportAutonomyApprovalGate) {
|
|
568
|
+
return {
|
|
569
|
+
outcome: 'manual_handoff',
|
|
570
|
+
reason: "Support autonomy is waiting on operator approval or revised intake/diagnosis scope: ".concat(blockedSupportAutonomyApprovalGate.reason),
|
|
571
|
+
nextAction: ((_m = blockedSupportAutonomyApprovalGate.metadata) === null || _m === void 0 ? void 0 : _m.approvalAction)
|
|
572
|
+
? "Use ".concat(blockedSupportAutonomyApprovalGate.metadata.approvalAction, " or revise the blocked scope, then allow the runner to continue until A-grade QA/business proof.")
|
|
573
|
+
: 'Approve the bounded support autonomy request or revise classification, estimate, owner files, or diagnosis scope before product-code repair.',
|
|
574
|
+
gates: gates,
|
|
575
|
+
warnings: warnings,
|
|
576
|
+
recordedAt: now
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
var blockedSupportProductRepairDispatchGate = gates.find(function (gate) { return gate.key === 'support_product_repair_dispatch_guard' && gate.status === 'blocked'; });
|
|
580
|
+
if (input.source === 'support_ticket' && blockedSupportProductRepairDispatchGate) {
|
|
581
|
+
return {
|
|
582
|
+
outcome: 'manual_handoff',
|
|
583
|
+
reason: "Support product-code repair dispatch is blocked by the approval/scope guard: ".concat(blockedSupportProductRepairDispatchGate.reason),
|
|
584
|
+
nextAction: ((_o = blockedSupportProductRepairDispatchGate.metadata) === null || _o === void 0 ? void 0 : _o.nextAction)
|
|
585
|
+
? "Run ".concat(blockedSupportProductRepairDispatchGate.metadata.nextAction, " before product-code repair continues.")
|
|
586
|
+
: 'Approve the current support autonomy scope or revise the diagnosis/owner-file set before product-code repair continues.',
|
|
587
|
+
gates: gates,
|
|
588
|
+
warnings: warnings,
|
|
589
|
+
recordedAt: now
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
var blockedSupportHumanDecisionGate = gates.find(function (gate) { return gate.key === 'support_human_decision_request' && gate.status === 'blocked'; });
|
|
593
|
+
if (input.source === 'support_ticket' && blockedSupportHumanDecisionGate) {
|
|
594
|
+
return {
|
|
595
|
+
outcome: 'manual_handoff',
|
|
596
|
+
reason: "Support run is waiting on a specific operator decision: ".concat(blockedSupportHumanDecisionGate.reason),
|
|
597
|
+
nextAction: ((_p = blockedSupportHumanDecisionGate.metadata) === null || _p === void 0 ? void 0 : _p.preferredChoiceId)
|
|
598
|
+
? "Choose ".concat(blockedSupportHumanDecisionGate.metadata.preferredChoiceId, " or an equivalent safe console action, then resume the runner.")
|
|
599
|
+
: 'Answer the requested support runner decision, then resume the runner.',
|
|
600
|
+
gates: gates,
|
|
601
|
+
warnings: warnings,
|
|
602
|
+
recordedAt: now
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
var blockedSupportPostApprovalResumeAttemptGate = gates.find(function (gate) { return gate.key === 'support_post_approval_resume_attempt' && gate.status === 'blocked'; });
|
|
606
|
+
if (input.source === 'support_ticket' && blockedSupportPostApprovalResumeAttemptGate) {
|
|
607
|
+
var nextAction = cleanText((_q = blockedSupportPostApprovalResumeAttemptGate.metadata) === null || _q === void 0 ? void 0 : _q.nextAction, 160);
|
|
608
|
+
var failureClass = cleanText((_r = blockedSupportPostApprovalResumeAttemptGate.metadata) === null || _r === void 0 ? void 0 : _r.failureClass, 160);
|
|
609
|
+
return {
|
|
610
|
+
outcome: 'manual_handoff',
|
|
611
|
+
reason: "Approved support autoloop resume did not start: ".concat(blockedSupportPostApprovalResumeAttemptGate.reason),
|
|
612
|
+
nextAction: nextAction
|
|
613
|
+
? "Review ".concat(failureClass || 'resume blocker', " and run ").concat(nextAction, " only after the blocker fingerprint changes; product repair and customer reply remain blocked.")
|
|
614
|
+
: 'Review the approved autoloop resume blocker and require a changed blocker fingerprint before another retry.',
|
|
615
|
+
gates: gates,
|
|
616
|
+
warnings: warnings,
|
|
617
|
+
recordedAt: now
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
var blockedSupportPostApprovalAutostartGate = gates.find(function (gate) { return gate.key === 'support_post_approval_autostart' && gate.status === 'blocked'; });
|
|
621
|
+
if (input.source === 'support_ticket' && blockedSupportPostApprovalAutostartGate) {
|
|
622
|
+
var nextAction = cleanText((_s = blockedSupportPostApprovalAutostartGate.metadata) === null || _s === void 0 ? void 0 : _s.nextAction, 160);
|
|
623
|
+
var canRetryWithoutReapproval = ((_t = blockedSupportPostApprovalAutostartGate.metadata) === null || _t === void 0 ? void 0 : _t.canRetryWithoutReapproval) === true;
|
|
624
|
+
var safeRetryAction = cleanText((_u = blockedSupportPostApprovalAutostartGate.metadata) === null || _u === void 0 ? void 0 : _u.safeRetryAction, 160);
|
|
625
|
+
return {
|
|
626
|
+
outcome: 'manual_handoff',
|
|
627
|
+
reason: "Support autonomy was approved, but the post-approval autostart did not begin: ".concat(blockedSupportPostApprovalAutostartGate.reason),
|
|
628
|
+
nextAction: canRetryWithoutReapproval && safeRetryAction === 'run_autoloop'
|
|
629
|
+
? 'Retry the approved auto-improve loop under the same approval/scope fingerprint; no product repair or customer reply is allowed until the loop starts and records proof.'
|
|
630
|
+
: nextAction === 'resolve_autostart_blocker'
|
|
631
|
+
? 'Resolve the autostart blocker or clear the active run, then rerun runSupportTicketAutoImproveLoopManual under the approved scope until A-grade PR proof.'
|
|
632
|
+
: 'Review the post-approval autostart result, then resume the approved auto-improve loop without changing scope.',
|
|
633
|
+
gates: gates,
|
|
634
|
+
warnings: warnings,
|
|
635
|
+
recordedAt: now
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
if ((qa === null || qa === void 0 ? void 0 : qa.outcome) === 'infra_failed') {
|
|
639
|
+
return {
|
|
640
|
+
outcome: 'qa_infra_failed',
|
|
641
|
+
reason: 'QA infrastructure failed before product validation.',
|
|
642
|
+
nextAction: 'Repair QA harness dependencies, ports, browser, Mongo, or startup before another model repair loop.',
|
|
643
|
+
gates: gates,
|
|
644
|
+
warnings: warnings,
|
|
645
|
+
recordedAt: now
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
if ((qa === null || qa === void 0 ? void 0 : qa.outcome) === 'compile_failed') {
|
|
649
|
+
return {
|
|
650
|
+
outcome: 'build_failed',
|
|
651
|
+
reason: 'Compile/build evidence failed or was stale.',
|
|
652
|
+
nextAction: 'Repair compile/build first, then rerun QA from the same failed step.',
|
|
653
|
+
gates: gates,
|
|
654
|
+
warnings: warnings,
|
|
655
|
+
recordedAt: now
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
if ((qa === null || qa === void 0 ? void 0 : qa.outcome) === 'route_failed') {
|
|
659
|
+
return {
|
|
660
|
+
outcome: 'qa_incomplete',
|
|
661
|
+
reason: 'Browser route probe failed before business proof.',
|
|
662
|
+
nextAction: 'Repair route/auth/startup issue and rerun the same browser route probe.',
|
|
663
|
+
gates: gates,
|
|
664
|
+
warnings: warnings,
|
|
665
|
+
recordedAt: now
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
var blockedAICoderJourneyContractGate = gates.find(function (gate) { return gate.key === 'aicoder_journey_contract' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
669
|
+
if (blockedAICoderJourneyContractGate) {
|
|
670
|
+
var claimedSuccess = input.explicitAccepted === true || input.scorecardPassed === true || statusLooksPassed(input.scorecardStatus) || statusLooksPassed("".concat(input.status || '', " ").concat(input.phase || ''));
|
|
671
|
+
return {
|
|
672
|
+
outcome: claimedSuccess ? 'false_pass' : 'qa_incomplete',
|
|
673
|
+
reason: claimedSuccess
|
|
674
|
+
? "AICoder run claimed success without a valid Journey Contract: ".concat(blockedAICoderJourneyContractGate.reason)
|
|
675
|
+
: "AICoder workflow is blocked until the Journey Contract validates: ".concat(blockedAICoderJourneyContractGate.reason),
|
|
676
|
+
nextAction: 'Generate or repair docs/APP_JOURNEY_CONTRACT.md, validate first/next/last workflow/data story/QA assertions, then rerun workflow build and workflow QA.',
|
|
677
|
+
gates: gates,
|
|
678
|
+
warnings: warnings,
|
|
679
|
+
recordedAt: now
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
var blockedSupportNextActionContractGate = gates.find(function (gate) { return gate.key === 'support_next_action_contract' && gate.status === 'blocked'; });
|
|
683
|
+
if (blockedSupportNextActionContractGate
|
|
684
|
+
&& (qa === null || qa === void 0 ? void 0 : qa.outcome) !== 'business_assertion_passed'
|
|
685
|
+
&& input.scorecardPassed !== true
|
|
686
|
+
&& !statusLooksPassed(input.scorecardStatus)) {
|
|
687
|
+
return {
|
|
688
|
+
outcome: 'manual_handoff',
|
|
689
|
+
reason: "Support manager cannot safely continue without a valid next-action contract: ".concat(blockedSupportNextActionContractGate.reason),
|
|
690
|
+
nextAction: 'Record one validated next-action contract with safeToAutoRun, canRunWithoutCodexMonitor, codexFallbackRequired, preconditions, stop conditions, and success evidence before another autonomous recovery.',
|
|
691
|
+
gates: gates,
|
|
692
|
+
warnings: warnings,
|
|
693
|
+
recordedAt: now
|
|
694
|
+
};
|
|
695
|
+
}
|
|
696
|
+
var blockedSupportIssueClassProbePlanGate = gates.find(function (gate) { return gate.key === 'support_issue_class_probe_plan' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
697
|
+
if (input.source === 'support_ticket' && blockedSupportIssueClassProbePlanGate) {
|
|
698
|
+
var claimedSuccess = input.explicitAccepted === true
|
|
699
|
+
|| input.scorecardPassed === true
|
|
700
|
+
|| statusLooksPassed(input.scorecardStatus)
|
|
701
|
+
|| statusLooksPassed("".concat(input.status || '', " ").concat(input.phase || ''));
|
|
702
|
+
return {
|
|
703
|
+
outcome: claimedSuccess ? 'false_pass' : 'qa_incomplete',
|
|
704
|
+
reason: claimedSuccess
|
|
705
|
+
? "Support run claimed success without a valid issue-class probe plan: ".concat(blockedSupportIssueClassProbePlanGate.reason)
|
|
706
|
+
: "Support business proof is blocked until the issue-class probe plan validates: ".concat(blockedSupportIssueClassProbePlanGate.reason),
|
|
707
|
+
nextAction: 'Generate or repair the Support IssueClassProbePlan from the diagnosis proof_plan, then rerun issue-specific business proof QA.',
|
|
708
|
+
gates: gates,
|
|
709
|
+
warnings: warnings,
|
|
710
|
+
recordedAt: now
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
var blockedAssistantAnswerActionabilityGate = gates.find(function (gate) { return gate.key === 'assistant_answer_actionability' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
714
|
+
if (input.source === 'ai_assistant' && blockedAssistantAnswerActionabilityGate) {
|
|
715
|
+
var claimedSuccess = input.explicitAccepted === true
|
|
716
|
+
|| statusLooksPassed("".concat(input.status || '', " ").concat(input.phase || ''));
|
|
717
|
+
return {
|
|
718
|
+
outcome: claimedSuccess ? 'false_pass' : 'qa_incomplete',
|
|
719
|
+
reason: claimedSuccess
|
|
720
|
+
? "Assistant answer was marked accepted without a valid actionability contract: ".concat(blockedAssistantAnswerActionabilityGate.reason)
|
|
721
|
+
: "Assistant answer is blocked until actionability evidence validates: ".concat(blockedAssistantAnswerActionabilityGate.reason),
|
|
722
|
+
nextAction: 'Record verified query/date/permission/citation/confidence evidence and one assistant actionability contract before answering or drafting customer-facing text.',
|
|
723
|
+
gates: gates,
|
|
724
|
+
warnings: warnings,
|
|
725
|
+
recordedAt: now
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
if ((qa === null || qa === void 0 ? void 0 : qa.outcome) === 'route_only_pass' || (qa === null || qa === void 0 ? void 0 : qa.outcome) === 'incomplete') {
|
|
729
|
+
return {
|
|
730
|
+
outcome: input.scorecardPassed === true ? 'false_pass' : 'qa_incomplete',
|
|
731
|
+
reason: input.scorecardPassed === true
|
|
732
|
+
? 'Scorecard or workflow status passed without issue-specific business assertion proof.'
|
|
733
|
+
: 'QA has not recorded issue-specific business assertion proof.',
|
|
734
|
+
nextAction: 'Add before/action/after workflow proof with screenshot/data assertions before acceptance.',
|
|
735
|
+
gates: gates,
|
|
736
|
+
warnings: warnings,
|
|
737
|
+
recordedAt: now
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
if ((qa === null || qa === void 0 ? void 0 : qa.outcome) === 'business_assertion_failed') {
|
|
741
|
+
return {
|
|
742
|
+
outcome: input.terminal === true ? 'rejected' : 'qa_incomplete',
|
|
743
|
+
reason: 'Issue-specific business assertion failed.',
|
|
744
|
+
nextAction: 'Repair the product/data defect and rerun the failing assertion.',
|
|
745
|
+
gates: gates,
|
|
746
|
+
warnings: warnings,
|
|
747
|
+
recordedAt: now
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
var hasBusinessPass = (qa === null || qa === void 0 ? void 0 : qa.outcome) === 'business_assertion_passed';
|
|
751
|
+
var scorecardPassed = input.scorecardPassed === true || statusLooksPassed(input.scorecardStatus);
|
|
752
|
+
var releaseBlockers = [];
|
|
753
|
+
if (statusLooksFailed(input.deployStatus)) {
|
|
754
|
+
releaseBlockers.push("deploy=".concat(cleanText(input.deployStatus, 120)));
|
|
755
|
+
}
|
|
756
|
+
if (statusLooksFailed(input.publishStatus)) {
|
|
757
|
+
releaseBlockers.push("publish=".concat(cleanText(input.publishStatus, 120)));
|
|
758
|
+
}
|
|
759
|
+
if (statusLooksFailed(input.sampleDataStatus)) {
|
|
760
|
+
releaseBlockers.push("sample_data=".concat(cleanText(input.sampleDataStatus, 120)));
|
|
761
|
+
}
|
|
762
|
+
if (releaseBlockers.length && (scorecardPassed || hasBusinessPass)) {
|
|
763
|
+
addGateOnce(gates, makeGate('release', 'Release/deploy', 'fail', "Final acceptance is blocked after QA/scorecard because release gates failed: ".concat(releaseBlockers.join(', '), "."), [], now));
|
|
764
|
+
return {
|
|
765
|
+
outcome: 'release_blocked',
|
|
766
|
+
reason: "Release gates failed after QA/scorecard: ".concat(releaseBlockers.join(', '), "."),
|
|
767
|
+
nextAction: 'Repair deploy/publish/sample-data coverage before marking the run accepted.',
|
|
768
|
+
gates: gates,
|
|
769
|
+
warnings: warnings,
|
|
770
|
+
recordedAt: now
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
var failedSupportPrCreationGate = gates.find(function (gate) { return gate.key === 'support_pr_creation_result' && (gate.status === 'fail' || gate.status === 'blocked'); });
|
|
774
|
+
if (input.source === 'support_ticket' && failedSupportPrCreationGate) {
|
|
775
|
+
return {
|
|
776
|
+
outcome: 'release_blocked',
|
|
777
|
+
reason: "Support PR creation is blocked after proof-ready work: ".concat(failedSupportPrCreationGate.reason),
|
|
778
|
+
nextAction: ((_v = failedSupportPrCreationGate.metadata) === null || _v === void 0 ? void 0 : _v.nextAction) === 'repair_pr_creation_blocker'
|
|
779
|
+
? 'Repair the PR creation/release-safety blocker or route to platform repair; do not rerun product-code repair unless new issue evidence changes.'
|
|
780
|
+
: 'Check PR creation status before another repair loop.',
|
|
781
|
+
gates: gates,
|
|
782
|
+
warnings: warnings,
|
|
783
|
+
recordedAt: now
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
var blockedSupportAutopilotCompletionGate = gates.find(function (gate) { return gate.key === 'support_autopilot_completion_contract' && gate.status === 'blocked'; });
|
|
787
|
+
if (input.source === 'support_ticket' && blockedSupportAutopilotCompletionGate) {
|
|
788
|
+
var nextAction = cleanText((_w = blockedSupportAutopilotCompletionGate.metadata) === null || _w === void 0 ? void 0 : _w.nextAction, 160);
|
|
789
|
+
var missingEvidence = Array.isArray((_x = blockedSupportAutopilotCompletionGate.metadata) === null || _x === void 0 ? void 0 : _x.missingCompletionEvidence)
|
|
790
|
+
? blockedSupportAutopilotCompletionGate.metadata.missingCompletionEvidence
|
|
791
|
+
.map(function (entry) { return cleanText(entry, 240); })
|
|
792
|
+
.filter(Boolean)
|
|
793
|
+
: [];
|
|
794
|
+
var outcome = nextAction === 'create_pr'
|
|
795
|
+
? 'release_blocked'
|
|
796
|
+
: (input.explicitAccepted === true || scorecardPassed || statusLooksPassed("".concat(input.status || '', " ").concat(input.phase || '')) || hasBusinessPass)
|
|
797
|
+
? 'false_pass'
|
|
798
|
+
: 'qa_incomplete';
|
|
799
|
+
return {
|
|
800
|
+
outcome: outcome,
|
|
801
|
+
reason: "Approved support autopilot has not reached A-grade PR proof: ".concat(blockedSupportAutopilotCompletionGate.reason),
|
|
802
|
+
nextAction: nextAction === 'create_pr'
|
|
803
|
+
? 'Create the proof-backed support PR; merge, release, deploy, and customer reply remain separately gated.'
|
|
804
|
+
: nextAction === 'run_business_proof_qa'
|
|
805
|
+
? 'Run issue-specific business proof QA until AIQaBusinessAssertion, before/action/after proof, and screenshot/trace evidence pass.'
|
|
806
|
+
: nextAction === 'run_a_grade_pr_review'
|
|
807
|
+
? 'Run strict A-grade PR review; do not merge, release, deploy, or send the customer reply until execution, artifact, pull_request, business-proof, and screenshot/trace evidence pass.'
|
|
808
|
+
: 'Continue only the bounded owner-scoped support workflow until PR readiness or a new blocker/scope change.',
|
|
809
|
+
gates: gates,
|
|
810
|
+
warnings: missingEvidence.length
|
|
811
|
+
? __spreadArray(__spreadArray([], __read(warnings), false), __read(missingEvidence.map(function (entry) { return "missing_completion_evidence:".concat(entry); })), false) : warnings,
|
|
812
|
+
recordedAt: now
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
var blockedSupportReleaseCustomerGate = gates.find(function (gate) { return gate.key === 'support_release_customer_acceptance' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
816
|
+
if (input.source === 'support_ticket' && blockedSupportReleaseCustomerGate) {
|
|
817
|
+
var nextAction = cleanText((_y = blockedSupportReleaseCustomerGate.metadata) === null || _y === void 0 ? void 0 : _y.nextAction, 160);
|
|
818
|
+
return {
|
|
819
|
+
outcome: 'release_blocked',
|
|
820
|
+
reason: "Support PR proof is ready, but release/customer acceptance is incomplete: ".concat(blockedSupportReleaseCustomerGate.reason),
|
|
821
|
+
nextAction: nextAction === 'draft_or_review_proof_backed_customer_reply'
|
|
822
|
+
? 'Draft or review the proof-backed customer reply from the accepted QA/release evidence; do not rerun product-code repair unless new issue evidence appears.'
|
|
823
|
+
: 'Complete the release/hotfix gate for the A-grade PR, then generate or review the proof-backed customer reply.',
|
|
824
|
+
gates: gates,
|
|
825
|
+
warnings: warnings,
|
|
826
|
+
recordedAt: now
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
var blockedAICoderNextActionContractGate = gates.find(function (gate) { return gate.key === 'aicoder_next_action_contract' && (gate.status === 'blocked' || gate.status === 'fail'); });
|
|
830
|
+
if (input.source === 'aicoder_app' && blockedAICoderNextActionContractGate) {
|
|
831
|
+
var claimedSuccess = input.explicitAccepted === true
|
|
832
|
+
|| input.scorecardPassed === true
|
|
833
|
+
|| statusLooksPassed(input.scorecardStatus)
|
|
834
|
+
|| statusLooksPassed("".concat(input.status || '', " ").concat(input.phase || ''));
|
|
835
|
+
return {
|
|
836
|
+
outcome: claimedSuccess ? 'false_pass' : 'manual_handoff',
|
|
837
|
+
reason: claimedSuccess
|
|
838
|
+
? "AICoder run claimed success without a manager-safe next-action contract: ".concat(blockedAICoderNextActionContractGate.reason)
|
|
839
|
+
: "AICoder manager cannot safely continue without a manager-safe next-action contract: ".concat(blockedAICoderNextActionContractGate.reason),
|
|
840
|
+
nextAction: 'Record one validated AICoder next-action contract with safeToAutoRun, canRunWithoutCodexMonitor, codexFallbackRequired, stop conditions, and success evidence before another autonomous loop.',
|
|
841
|
+
gates: gates,
|
|
842
|
+
warnings: warnings,
|
|
843
|
+
recordedAt: now
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
if (scorecardPassed && !hasBusinessPass) {
|
|
847
|
+
warnings.push('scorecard_pass_without_business_assertion');
|
|
848
|
+
addGateOnce(gates, makeGate('business_assertion_required', 'Business assertion', 'blocked', 'Scorecard passed, but no issue-specific business assertion proof was recorded.', [], now));
|
|
849
|
+
return {
|
|
850
|
+
outcome: 'false_pass',
|
|
851
|
+
reason: 'Scorecard-only proof is not acceptance.',
|
|
852
|
+
nextAction: 'Record issue-specific workflow/data proof, then reclassify the run.',
|
|
853
|
+
gates: gates,
|
|
854
|
+
warnings: warnings,
|
|
855
|
+
recordedAt: now
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
var statusPhase = "".concat(input.status || '', " ").concat(input.phase || '');
|
|
859
|
+
if ((input.explicitAccepted === true || statusLooksPassed(statusPhase) || scorecardPassed) && hasBusinessPass) {
|
|
860
|
+
return {
|
|
861
|
+
outcome: 'accepted',
|
|
862
|
+
reason: 'Run has terminal success signal and issue-specific business assertion proof.',
|
|
863
|
+
nextAction: 'No repair action required.',
|
|
864
|
+
gates: gates,
|
|
865
|
+
warnings: warnings,
|
|
866
|
+
recordedAt: now
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
if (statusLooksFailed(statusPhase)) {
|
|
870
|
+
return {
|
|
871
|
+
outcome: 'rejected',
|
|
872
|
+
reason: 'Run ended with a failure status and no accepted proof.',
|
|
873
|
+
nextAction: 'Classify the failing gate and rerun the smallest repair step.',
|
|
874
|
+
gates: gates,
|
|
875
|
+
warnings: warnings,
|
|
876
|
+
recordedAt: now
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
return {
|
|
880
|
+
outcome: 'unknown',
|
|
881
|
+
reason: 'Run does not have enough normalized evidence for a terminal label.',
|
|
882
|
+
nextAction: 'Ingest QA, deploy, assistant, usage, and commit evidence before using this run for training.',
|
|
883
|
+
gates: gates,
|
|
884
|
+
warnings: warnings,
|
|
885
|
+
recordedAt: now
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
function buildAIRun(input) {
|
|
889
|
+
var decision = input.outcome
|
|
890
|
+
? {
|
|
891
|
+
outcome: input.outcome,
|
|
892
|
+
gates: input.gates || [],
|
|
893
|
+
warnings: input.warnings || [],
|
|
894
|
+
nextAction: input.nextAction || '',
|
|
895
|
+
reason: '',
|
|
896
|
+
recordedAt: isoNow(input.now)
|
|
897
|
+
}
|
|
898
|
+
: classifyAIRunOutcome({
|
|
899
|
+
source: input.source,
|
|
900
|
+
status: input.status,
|
|
901
|
+
phase: input.phase,
|
|
902
|
+
qa: input.qa,
|
|
903
|
+
gates: input.gates,
|
|
904
|
+
scorecardPassed: input.scorecardPassed,
|
|
905
|
+
deployStatus: input.deployStatus,
|
|
906
|
+
publishStatus: input.publishStatus,
|
|
907
|
+
sampleDataStatus: input.sampleDataStatus,
|
|
908
|
+
manualHandoff: input.manualHandoff,
|
|
909
|
+
stopped: input.stopped,
|
|
910
|
+
rejected: input.rejected,
|
|
911
|
+
explicitAccepted: input.explicitAccepted,
|
|
912
|
+
terminal: input.terminal,
|
|
913
|
+
now: input.now
|
|
914
|
+
});
|
|
915
|
+
return {
|
|
916
|
+
id: input.id,
|
|
917
|
+
source: input.source || 'unknown',
|
|
918
|
+
sourceIds: input.sourceIds || {},
|
|
919
|
+
title: input.title,
|
|
920
|
+
status: input.status,
|
|
921
|
+
phase: input.phase,
|
|
922
|
+
startedAt: input.startedAt,
|
|
923
|
+
completedAt: input.completedAt,
|
|
924
|
+
outcome: decision.outcome,
|
|
925
|
+
events: Array.isArray(input.events) ? input.events : [],
|
|
926
|
+
gates: decision.gates,
|
|
927
|
+
qa: normalizeQaRun(input.qa),
|
|
928
|
+
cost: input.cost,
|
|
929
|
+
nextAction: decision.nextAction,
|
|
930
|
+
warnings: decision.warnings,
|
|
931
|
+
metadata: input.metadata
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
function buildAIRunCost(entries) {
|
|
935
|
+
var e_5, _a, e_6, _b, e_7, _c, e_8, _d;
|
|
936
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
937
|
+
if (entries === void 0) { entries = []; }
|
|
938
|
+
var cost = {
|
|
939
|
+
inputTokens: 0,
|
|
940
|
+
cachedInputTokens: 0,
|
|
941
|
+
outputTokens: 0,
|
|
942
|
+
totalTokens: 0,
|
|
943
|
+
estimatedUsd: 0,
|
|
944
|
+
models: [],
|
|
945
|
+
categories: {},
|
|
946
|
+
sources: {},
|
|
947
|
+
surfaces: {},
|
|
948
|
+
manualEstimatedUsd: 0,
|
|
949
|
+
untrackedEstimatedUsd: 0,
|
|
950
|
+
untrackedWarnings: []
|
|
951
|
+
};
|
|
952
|
+
try {
|
|
953
|
+
for (var _x = __values(normalizeOpenAIUsageRowsForCosting(entries)), _y = _x.next(); !_y.done; _y = _x.next()) {
|
|
954
|
+
var entry = _y.value;
|
|
955
|
+
var category = cleanText(entry.category, 120) || 'unknown';
|
|
956
|
+
var source = cleanText((_e = entry.usage_source) !== null && _e !== void 0 ? _e : entry.usageSource, 80) || 'unknown';
|
|
957
|
+
var surface = cleanText((_f = entry.usage_surface) !== null && _f !== void 0 ? _f : entry.usageSurface, 80) || 'unknown';
|
|
958
|
+
var isManual = entry.is_manual === true || entry.isManual === true || source === 'manual_codex';
|
|
959
|
+
var isUntracked = entry.is_untracked === true || entry.isUntracked === true;
|
|
960
|
+
var untrackedReason = cleanText((_g = entry.untracked_reason) !== null && _g !== void 0 ? _g : entry.untrackedReason, 500);
|
|
961
|
+
var model = cleanText(entry.model, 120);
|
|
962
|
+
var inputTokens = Number((_j = (_h = entry.input_tokens) !== null && _h !== void 0 ? _h : entry.inputTokens) !== null && _j !== void 0 ? _j : 0) || 0;
|
|
963
|
+
var cachedInputTokens = Number((_l = (_k = entry.cached_input_tokens) !== null && _k !== void 0 ? _k : entry.cachedInputTokens) !== null && _l !== void 0 ? _l : 0) || 0;
|
|
964
|
+
var outputTokens = Number((_o = (_m = entry.output_tokens) !== null && _m !== void 0 ? _m : entry.outputTokens) !== null && _o !== void 0 ? _o : 0) || 0;
|
|
965
|
+
var totalTokens = Number((_q = (_p = entry.total_tokens) !== null && _p !== void 0 ? _p : entry.totalTokens) !== null && _q !== void 0 ? _q : (inputTokens + outputTokens)) || 0;
|
|
966
|
+
var estimatedUsd = Number((_s = (_r = entry.cost_estimate) !== null && _r !== void 0 ? _r : entry.estimatedUsd) !== null && _s !== void 0 ? _s : 0) || 0;
|
|
967
|
+
cost.inputTokens += inputTokens;
|
|
968
|
+
cost.cachedInputTokens += cachedInputTokens;
|
|
969
|
+
cost.outputTokens += outputTokens;
|
|
970
|
+
cost.totalTokens += totalTokens;
|
|
971
|
+
cost.estimatedUsd += estimatedUsd;
|
|
972
|
+
if (isManual) {
|
|
973
|
+
cost.manualEstimatedUsd = Number(cost.manualEstimatedUsd || 0) + estimatedUsd;
|
|
974
|
+
}
|
|
975
|
+
if (isUntracked) {
|
|
976
|
+
cost.untrackedEstimatedUsd = Number(cost.untrackedEstimatedUsd || 0) + estimatedUsd;
|
|
977
|
+
var warning = untrackedReason || "".concat(source, " usage is an estimate outside managed runner telemetry.");
|
|
978
|
+
if (warning && !((_t = cost.untrackedWarnings) === null || _t === void 0 ? void 0 : _t.includes(warning))) {
|
|
979
|
+
(_u = cost.untrackedWarnings) === null || _u === void 0 ? void 0 : _u.push(warning);
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
if (model && !cost.models.includes(model)) {
|
|
983
|
+
cost.models.push(model);
|
|
984
|
+
}
|
|
985
|
+
if (!cost.categories[category]) {
|
|
986
|
+
cost.categories[category] = {
|
|
987
|
+
inputTokens: 0,
|
|
988
|
+
cachedInputTokens: 0,
|
|
989
|
+
outputTokens: 0,
|
|
990
|
+
totalTokens: 0,
|
|
991
|
+
estimatedUsd: 0,
|
|
992
|
+
count: 0
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
cost.categories[category].inputTokens += inputTokens;
|
|
996
|
+
cost.categories[category].cachedInputTokens += cachedInputTokens;
|
|
997
|
+
cost.categories[category].outputTokens += outputTokens;
|
|
998
|
+
cost.categories[category].totalTokens += totalTokens;
|
|
999
|
+
cost.categories[category].estimatedUsd += estimatedUsd;
|
|
1000
|
+
cost.categories[category].count += 1;
|
|
1001
|
+
if (!((_v = cost.sources) === null || _v === void 0 ? void 0 : _v[source])) {
|
|
1002
|
+
cost.sources[source] = {
|
|
1003
|
+
inputTokens: 0,
|
|
1004
|
+
cachedInputTokens: 0,
|
|
1005
|
+
outputTokens: 0,
|
|
1006
|
+
totalTokens: 0,
|
|
1007
|
+
estimatedUsd: 0,
|
|
1008
|
+
count: 0,
|
|
1009
|
+
manualCount: 0,
|
|
1010
|
+
untrackedCount: 0
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
cost.sources[source].inputTokens += inputTokens;
|
|
1014
|
+
cost.sources[source].cachedInputTokens += cachedInputTokens;
|
|
1015
|
+
cost.sources[source].outputTokens += outputTokens;
|
|
1016
|
+
cost.sources[source].totalTokens += totalTokens;
|
|
1017
|
+
cost.sources[source].estimatedUsd += estimatedUsd;
|
|
1018
|
+
cost.sources[source].count += 1;
|
|
1019
|
+
if (isManual) {
|
|
1020
|
+
cost.sources[source].manualCount += 1;
|
|
1021
|
+
}
|
|
1022
|
+
if (isUntracked) {
|
|
1023
|
+
cost.sources[source].untrackedCount += 1;
|
|
1024
|
+
}
|
|
1025
|
+
if (!((_w = cost.surfaces) === null || _w === void 0 ? void 0 : _w[surface])) {
|
|
1026
|
+
cost.surfaces[surface] = {
|
|
1027
|
+
totalTokens: 0,
|
|
1028
|
+
estimatedUsd: 0,
|
|
1029
|
+
count: 0
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
cost.surfaces[surface].totalTokens += totalTokens;
|
|
1033
|
+
cost.surfaces[surface].estimatedUsd += estimatedUsd;
|
|
1034
|
+
cost.surfaces[surface].count += 1;
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1038
|
+
finally {
|
|
1039
|
+
try {
|
|
1040
|
+
if (_y && !_y.done && (_a = _x.return)) _a.call(_x);
|
|
1041
|
+
}
|
|
1042
|
+
finally { if (e_5) throw e_5.error; }
|
|
1043
|
+
}
|
|
1044
|
+
cost.estimatedUsd = Number(cost.estimatedUsd.toFixed(6));
|
|
1045
|
+
cost.manualEstimatedUsd = Number(Number(cost.manualEstimatedUsd || 0).toFixed(6));
|
|
1046
|
+
cost.untrackedEstimatedUsd = Number(Number(cost.untrackedEstimatedUsd || 0).toFixed(6));
|
|
1047
|
+
try {
|
|
1048
|
+
for (var _z = __values(Object.keys(cost.categories)), _0 = _z.next(); !_0.done; _0 = _z.next()) {
|
|
1049
|
+
var category = _0.value;
|
|
1050
|
+
cost.categories[category].estimatedUsd = Number(cost.categories[category].estimatedUsd.toFixed(6));
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1054
|
+
finally {
|
|
1055
|
+
try {
|
|
1056
|
+
if (_0 && !_0.done && (_b = _z.return)) _b.call(_z);
|
|
1057
|
+
}
|
|
1058
|
+
finally { if (e_6) throw e_6.error; }
|
|
1059
|
+
}
|
|
1060
|
+
try {
|
|
1061
|
+
for (var _1 = __values(Object.keys(cost.sources || {})), _2 = _1.next(); !_2.done; _2 = _1.next()) {
|
|
1062
|
+
var source = _2.value;
|
|
1063
|
+
cost.sources[source].estimatedUsd = Number(cost.sources[source].estimatedUsd.toFixed(6));
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1067
|
+
finally {
|
|
1068
|
+
try {
|
|
1069
|
+
if (_2 && !_2.done && (_c = _1.return)) _c.call(_1);
|
|
1070
|
+
}
|
|
1071
|
+
finally { if (e_7) throw e_7.error; }
|
|
1072
|
+
}
|
|
1073
|
+
try {
|
|
1074
|
+
for (var _3 = __values(Object.keys(cost.surfaces || {})), _4 = _3.next(); !_4.done; _4 = _3.next()) {
|
|
1075
|
+
var surface = _4.value;
|
|
1076
|
+
cost.surfaces[surface].estimatedUsd = Number(cost.surfaces[surface].estimatedUsd.toFixed(6));
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1080
|
+
finally {
|
|
1081
|
+
try {
|
|
1082
|
+
if (_4 && !_4.done && (_d = _3.return)) _d.call(_3);
|
|
1083
|
+
}
|
|
1084
|
+
finally { if (e_8) throw e_8.error; }
|
|
1085
|
+
}
|
|
1086
|
+
return cost;
|
|
1087
|
+
}
|
|
1088
|
+
function redactAIRunTrainingExample(example) {
|
|
1089
|
+
var redact = function (value) { return cleanText(value, 5000)
|
|
1090
|
+
.replace(/mongodb(?:\+srv)?:\/\/[^\s"'<>]+/ig, '[redacted-mongo-url]')
|
|
1091
|
+
.replace(/\b(?:sk|ghp|xoxb|AKIA)[A-Za-z0-9_\-]{12,}\b/g, '[redacted-secret]')
|
|
1092
|
+
.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z]{2,}\b/ig, '[redacted-email]'); };
|
|
1093
|
+
return __assign(__assign({}, example), { inputSummary: redact(example.inputSummary), actionSummary: redact(example.actionSummary), evidence: cleanList(example.evidence, 80, 5000).map(redact) });
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
//# sourceMappingURL=ai-run-evidence.js.map
|