@resolveio/server-lib 22.3.48 → 22.3.50
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/.nodemon.json +5 -0
- package/.vscode/settings.json +21 -0
- package/AGENTS.md +189 -0
- package/README.md +22 -0
- package/build_package.sh +5 -0
- package/compileDTS.pl +64 -0
- package/docs/ai-assistant-nightly-eval.md +65 -0
- package/docs/ai-assistant-preflight-checklist.md +23 -0
- package/docs/ai-assistant-report-builder-bridge-playbook.md +115 -0
- package/eslint-plugin-custom/index.js +7 -0
- package/eslint-plugin-custom/rules/no-filter-zero-index.js +44 -0
- package/eslint.config.js +103 -0
- package/gulpfile.js +216 -0
- package/methodAndPublicationListGenerator.py +375 -0
- package/mongodbensurers.js +2 -0
- package/mongostop.js +3 -0
- package/package.json +1 -1
- package/scripts/cleanup-bypassed-callmethod-logs.js +616 -0
- package/settings.development.json +25 -0
- package/settings.development.redacted.json +25 -0
- package/src/.env +12 -0
- package/src/ai/assistant-core-heuristics.ts +379 -0
- package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +185 -0
- package/src/ai/resolveio-platform-intelligence-memory.ts +325 -0
- package/{ai/resolveio-platform-intelligence-types.d.ts → src/ai/resolveio-platform-intelligence-types.ts} +20 -15
- package/src/ai/resolveio-platform-intelligence.ts +462 -0
- package/src/client-server-app.ts +12 -0
- package/src/collections/ai-terminal-conversation.collection.ts +91 -0
- package/src/collections/ai-terminal-issue-report.collection.ts +99 -0
- package/src/collections/ai-terminal-message.collection.ts +77 -0
- package/src/collections/app-setting.collection.ts +104 -0
- package/src/collections/app-status.collection.ts +58 -0
- package/src/collections/communication-metric.collection.ts +84 -0
- package/src/collections/counter.collection.ts +56 -0
- package/src/collections/cron-job-history.collection.ts +94 -0
- package/src/collections/cron-job.collection.ts +92 -0
- package/src/collections/customer-notification.collection.ts +131 -0
- package/src/collections/customer-portal-password.collection.ts +76 -0
- package/src/collections/email-history.collection.ts +127 -0
- package/src/collections/email-verified.collection.ts +62 -0
- package/src/collections/file.collection.ts +74 -0
- package/src/collections/flag-update.collection.ts +57 -0
- package/src/collections/flag.collection.ts +57 -0
- package/src/collections/log-method-latency.collection.ts +77 -0
- package/src/collections/log-subscription.collection.ts +80 -0
- package/src/collections/log.collection.ts +93 -0
- package/src/collections/logged-in-users.collection.ts +67 -0
- package/src/collections/monitor-cpu.collection.ts +65 -0
- package/src/collections/monitor-function.collection.ts +74 -0
- package/src/collections/monitor-memory.collection.ts +77 -0
- package/src/collections/monitor-mongo.collection.ts +71 -0
- package/src/collections/notification.collection.ts +57 -0
- package/src/collections/openai-usage-ledger.collection.ts +77 -0
- package/src/collections/report-builder-dashboard-builder.collection.ts +109 -0
- package/src/collections/report-builder-library.collection.ts +89 -0
- package/src/collections/report-builder-report.collection.ts +184 -0
- package/src/collections/user-group.collection.ts +89 -0
- package/src/collections/user-guide.collection.ts +57 -0
- package/src/collections/user.collection.ts +181 -0
- package/src/cron/cron.ts +117 -0
- package/src/fixtures/cron-jobs.ts +95 -0
- package/src/fixtures/init.ts +35 -0
- package/src/http/auth.ts +764 -0
- package/src/http/health.ts +7 -0
- package/src/http/home.ts +90 -0
- package/src/http/slow-query-publication.ts +49 -0
- package/src/index.ts +1 -0
- package/src/managers/ai-assistant-codex-manager.manager.ts +1131 -0
- package/src/managers/communication-metric.manager.ts +82 -0
- package/src/managers/cron.manager.ts +333 -0
- package/src/managers/customer-notification-content.manager.ts +236 -0
- package/src/managers/diagnostic-manager-bootstrap.ts +165 -0
- package/src/managers/error-auto-fix.manager.ts +2767 -0
- package/src/managers/local-log.manager.ts +113 -0
- package/src/managers/method.manager.ts +1827 -0
- package/src/managers/mongo.manager.ts +4575 -0
- package/src/managers/monitor.manager.ts +507 -0
- package/src/managers/openai-usage-ledger.manager.ts +116 -0
- package/src/managers/slow-query-verifier.manager.ts +3590 -0
- package/src/managers/slow-query.manager.ts +519 -0
- package/src/managers/subscription.manager.ts +3128 -0
- package/src/managers/websocket.manager.ts +746 -0
- package/src/managers/worker-dispatcher.manager.ts +1360 -0
- package/src/managers/worker-server.manager.ts +536 -0
- package/src/methods/accounts.ts +532 -0
- package/src/methods/ai-terminal.ts +23043 -0
- package/src/methods/app-settings.ts +114 -0
- package/src/methods/aws.ts +649 -0
- package/src/methods/collections.ts +641 -0
- package/src/methods/counters.ts +69 -0
- package/src/methods/cron-jobs.ts +2614 -0
- package/src/methods/customer-notifications.ts +458 -0
- package/src/methods/diagnostics.ts +616 -0
- package/src/methods/flag-updates.ts +7 -0
- package/src/methods/flags.ts +7 -0
- package/src/methods/logs.ts +657 -0
- package/src/methods/mongo-explorer.ts +1880 -0
- package/src/methods/monitor.ts +540 -0
- package/src/methods/pdf.ts +1236 -0
- package/src/methods/publications.ts +129 -0
- package/src/methods/report-builder.ts +3300 -0
- package/src/methods/support.ts +335 -0
- package/src/models/ai-terminal-conversation.model.ts +19 -0
- package/src/models/ai-terminal-issue-report.model.ts +21 -0
- package/src/models/ai-terminal-message.model.ts +24 -0
- package/src/models/app-setting.model.ts +17 -0
- package/{models/app-status.model.d.ts → src/models/app-status.model.ts} +3 -2
- package/{models/billing-logged-in-users.model.d.ts → src/models/billing-logged-in-users.model.ts} +5 -4
- package/src/models/collection-document.model.ts +24 -0
- package/src/models/communication-metric.model.ts +23 -0
- package/{models/counter.model.d.ts → src/models/counter.model.ts} +4 -3
- package/src/models/cron-job-history.model.ts +16 -0
- package/src/models/cron-job.model.ts +15 -0
- package/src/models/customer-notification.model.ts +28 -0
- package/src/models/customer-portal-password.model.ts +12 -0
- package/src/models/dialog.model.ts +25 -0
- package/{models/email-history.model.js → src/models/email-history.model.ts} +35 -4
- package/{models/email-verified.model.d.ts → src/models/email-verified.model.ts} +6 -5
- package/{models/file.model.d.ts → src/models/file.model.ts} +8 -7
- package/{models/flag-update.model.d.ts → src/models/flag-update.model.ts} +4 -3
- package/{models/flag.model.d.ts → src/models/flag.model.ts} +4 -3
- package/src/models/log-method-latency.model.ts +11 -0
- package/{models/log-subscription.model.d.ts → src/models/log-subscription.model.ts} +11 -9
- package/src/models/log.model.ts +19 -0
- package/{models/logged-in-users.model.d.ts → src/models/logged-in-users.model.ts} +6 -5
- package/{models/method-response.model.d.ts → src/models/method-response.model.ts} +7 -6
- package/src/models/method.model.ts +25 -0
- package/{models/monitor-cpu.model.d.ts → src/models/monitor-cpu.model.ts} +9 -7
- package/src/models/monitor-function.model.ts +16 -0
- package/src/models/monitor-memory.model.ts +17 -0
- package/src/models/monitor-mongo.model.ts +15 -0
- package/{models/notification.model.d.ts → src/models/notification.model.ts} +6 -4
- package/src/models/openai-usage-ledger.model.ts +16 -0
- package/src/models/pagination.model.ts +35 -0
- package/src/models/permission.model.ts +14 -0
- package/src/models/report-builder-dashboard-builder.model.ts +29 -0
- package/src/models/report-builder-library.model.ts +20 -0
- package/src/models/report-builder-report.model.ts +136 -0
- package/src/models/report-builder.model.ts +68 -0
- package/src/models/select-data-label.model.ts +9 -0
- package/src/models/server-message.model.ts +31 -0
- package/src/models/slow-query-report.model.ts +23 -0
- package/src/models/subscription.model.ts +73 -0
- package/src/models/support-ticket.model.ts +104 -0
- package/src/models/user-group.model.ts +24 -0
- package/{models/user-guide.model.d.ts → src/models/user-guide.model.ts} +5 -4
- package/src/models/user.model.ts +96 -0
- package/src/private/images/ResolveIO.png +0 -0
- package/src/publications/ai-terminal.ts +73 -0
- package/src/publications/app-settings.ts +25 -0
- package/src/publications/app-status.ts +13 -0
- package/src/publications/cron-jobs.ts +40 -0
- package/src/publications/customer-notifications.ts +101 -0
- package/src/publications/files.ts +33 -0
- package/src/publications/flags-update.ts +19 -0
- package/src/publications/flags.ts +19 -0
- package/src/publications/logs.ts +163 -0
- package/src/publications/notifications.ts +13 -0
- package/src/publications/report-builder-dashboard-builders.ts +39 -0
- package/src/publications/report-builder-libraries.ts +41 -0
- package/src/publications/report-builder-reports.ts +47 -0
- package/src/publications/super-admin.ts +13 -0
- package/src/publications/user-groups.ts +12 -0
- package/src/publications/user-guides.ts +12 -0
- package/src/resolveio-server-app.ts +617 -0
- package/src/server-app.ts +3354 -0
- package/src/services/codex-client.ts +1223 -0
- package/src/services/openai-client.ts +265 -0
- package/src/types/error-report.ts +26 -0
- package/src/types/js-tiktoken.d.ts +11 -0
- package/src/types/slow-query-report.ts +28 -0
- package/src/util/ai-qa-policy.ts +879 -0
- package/src/util/ai-runner-artifacts.ts +430 -0
- package/src/util/ai-runner-qa-auth.ts +356 -0
- package/src/util/ai-runner-qa-tools.ts +650 -0
- package/src/util/common.ts +649 -0
- package/src/util/customer-portal-password.ts +183 -0
- package/src/util/error-reporter.ts +332 -0
- package/src/util/error-tracking.ts +79 -0
- package/src/util/report-builder-unwinds.ts +180 -0
- package/src/util/schema-report-builder.ts +448 -0
- package/src/util/slow-query-reporter.ts +216 -0
- package/src/util/subscription-dependency-context.ts +1096 -0
- package/src/util/tokenizer.ts +38 -0
- package/src/workers/codex-runner.worker.ts +142 -0
- package/start_server.sh +5 -0
- package/tests/ai-assistant-corpus-build.ts +484 -0
- package/tests/ai-assistant-corpus-replay-e2e.ts +774 -0
- package/tests/ai-assistant-data-parity-e2e.ts +1989 -0
- package/tests/ai-assistant-eval-triage.ts +831 -0
- package/tests/ai-assistant-openai-e2e.ts +1061 -0
- package/tests/ai-assistant-openai-git-e2e.ts +155 -0
- package/tests/ai-assistant-preflight-matrix.ts +215 -0
- package/tests/ai-assistant-routing-eval.test.ts +560 -0
- package/tests/ai-assistant-snf-live-eval.ts +975 -0
- package/tests/ai-assistant-utils.test.ts +2860 -0
- package/tests/ai-runner-contract.test.ts +263 -0
- package/tests/error-reporter.test.ts +145 -0
- package/tests/method-publication-generator.test.ts +46 -0
- package/tests/report-builder-linking.test.ts +79 -0
- package/tests/resolveio-platform-intelligence.test.ts +352 -0
- package/tests/server-app-cron-owner.test.ts +127 -0
- package/tests/subscription-connect-race.test.ts +158 -0
- package/tests/subscription-dependency-context.test.ts +324 -0
- package/tests/subscription-manager-collection-tracking.test.ts +86 -0
- package/tests/subscription-manager-invalidation.test.ts +86 -0
- package/tsconfig.json +34 -0
- package/ai/assistant-core-heuristics.d.ts +0 -11
- package/ai/assistant-core-heuristics.js +0 -356
- package/ai/assistant-core-heuristics.js.map +0 -1
- package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +0 -3
- package/ai/resolveio-platform-intelligence-memory-corpus.js +0 -214
- package/ai/resolveio-platform-intelligence-memory-corpus.js.map +0 -1
- package/ai/resolveio-platform-intelligence-memory.d.ts +0 -20
- package/ai/resolveio-platform-intelligence-memory.js +0 -341
- package/ai/resolveio-platform-intelligence-memory.js.map +0 -1
- package/ai/resolveio-platform-intelligence-types.js +0 -4
- package/ai/resolveio-platform-intelligence-types.js.map +0 -1
- package/ai/resolveio-platform-intelligence.d.ts +0 -6
- package/ai/resolveio-platform-intelligence.js +0 -463
- package/ai/resolveio-platform-intelligence.js.map +0 -1
- package/client-server-app.d.ts +0 -1
- package/client-server-app.js +0 -68
- package/client-server-app.js.map +0 -1
- package/collections/ai-terminal-conversation.collection.d.ts +0 -2
- package/collections/ai-terminal-conversation.collection.js +0 -140
- package/collections/ai-terminal-conversation.collection.js.map +0 -1
- package/collections/ai-terminal-issue-report.collection.d.ts +0 -2
- package/collections/ai-terminal-issue-report.collection.js +0 -148
- package/collections/ai-terminal-issue-report.collection.js.map +0 -1
- package/collections/ai-terminal-message.collection.d.ts +0 -2
- package/collections/ai-terminal-message.collection.js +0 -121
- package/collections/ai-terminal-message.collection.js.map +0 -1
- package/collections/app-setting.collection.d.ts +0 -3
- package/collections/app-setting.collection.js +0 -103
- package/collections/app-setting.collection.js.map +0 -1
- package/collections/app-status.collection.d.ts +0 -3
- package/collections/app-status.collection.js +0 -57
- package/collections/app-status.collection.js.map +0 -1
- package/collections/communication-metric.collection.d.ts +0 -2
- package/collections/communication-metric.collection.js +0 -133
- package/collections/communication-metric.collection.js.map +0 -1
- package/collections/counter.collection.d.ts +0 -3
- package/collections/counter.collection.js +0 -56
- package/collections/counter.collection.js.map +0 -1
- package/collections/cron-job-history.collection.d.ts +0 -3
- package/collections/cron-job-history.collection.js +0 -137
- package/collections/cron-job-history.collection.js.map +0 -1
- package/collections/cron-job.collection.d.ts +0 -3
- package/collections/cron-job.collection.js +0 -92
- package/collections/cron-job.collection.js.map +0 -1
- package/collections/customer-notification.collection.d.ts +0 -3
- package/collections/customer-notification.collection.js +0 -130
- package/collections/customer-notification.collection.js.map +0 -1
- package/collections/customer-portal-password.collection.d.ts +0 -3
- package/collections/customer-portal-password.collection.js +0 -75
- package/collections/customer-portal-password.collection.js.map +0 -1
- package/collections/email-history.collection.d.ts +0 -3
- package/collections/email-history.collection.js +0 -127
- package/collections/email-history.collection.js.map +0 -1
- package/collections/email-verified.collection.d.ts +0 -3
- package/collections/email-verified.collection.js +0 -62
- package/collections/email-verified.collection.js.map +0 -1
- package/collections/file.collection.d.ts +0 -3
- package/collections/file.collection.js +0 -74
- package/collections/file.collection.js.map +0 -1
- package/collections/flag-update.collection.d.ts +0 -3
- package/collections/flag-update.collection.js +0 -57
- package/collections/flag-update.collection.js.map +0 -1
- package/collections/flag.collection.d.ts +0 -3
- package/collections/flag.collection.js +0 -57
- package/collections/flag.collection.js.map +0 -1
- package/collections/log-method-latency.collection.d.ts +0 -3
- package/collections/log-method-latency.collection.js +0 -77
- package/collections/log-method-latency.collection.js.map +0 -1
- package/collections/log-subscription.collection.d.ts +0 -3
- package/collections/log-subscription.collection.js +0 -80
- package/collections/log-subscription.collection.js.map +0 -1
- package/collections/log.collection.d.ts +0 -3
- package/collections/log.collection.js +0 -93
- package/collections/log.collection.js.map +0 -1
- package/collections/logged-in-users.collection.d.ts +0 -3
- package/collections/logged-in-users.collection.js +0 -67
- package/collections/logged-in-users.collection.js.map +0 -1
- package/collections/monitor-cpu.collection.d.ts +0 -3
- package/collections/monitor-cpu.collection.js +0 -65
- package/collections/monitor-cpu.collection.js.map +0 -1
- package/collections/monitor-function.collection.d.ts +0 -3
- package/collections/monitor-function.collection.js +0 -74
- package/collections/monitor-function.collection.js.map +0 -1
- package/collections/monitor-memory.collection.d.ts +0 -3
- package/collections/monitor-memory.collection.js +0 -77
- package/collections/monitor-memory.collection.js.map +0 -1
- package/collections/monitor-mongo.collection.d.ts +0 -3
- package/collections/monitor-mongo.collection.js +0 -71
- package/collections/monitor-mongo.collection.js.map +0 -1
- package/collections/notification.collection.d.ts +0 -3
- package/collections/notification.collection.js +0 -57
- package/collections/notification.collection.js.map +0 -1
- package/collections/openai-usage-ledger.collection.d.ts +0 -2
- package/collections/openai-usage-ledger.collection.js +0 -124
- package/collections/openai-usage-ledger.collection.js.map +0 -1
- package/collections/report-builder-dashboard-builder.collection.d.ts +0 -3
- package/collections/report-builder-dashboard-builder.collection.js +0 -109
- package/collections/report-builder-dashboard-builder.collection.js.map +0 -1
- package/collections/report-builder-library.collection.d.ts +0 -3
- package/collections/report-builder-library.collection.js +0 -87
- package/collections/report-builder-library.collection.js.map +0 -1
- package/collections/report-builder-report.collection.d.ts +0 -4
- package/collections/report-builder-report.collection.js +0 -184
- package/collections/report-builder-report.collection.js.map +0 -1
- package/collections/user-group.collection.d.ts +0 -4
- package/collections/user-group.collection.js +0 -89
- package/collections/user-group.collection.js.map +0 -1
- package/collections/user-guide.collection.d.ts +0 -3
- package/collections/user-guide.collection.js +0 -57
- package/collections/user-guide.collection.js.map +0 -1
- package/collections/user.collection.d.ts +0 -4
- package/collections/user.collection.js +0 -180
- package/collections/user.collection.js.map +0 -1
- package/cron/cron.d.ts +0 -14
- package/cron/cron.js +0 -216
- package/cron/cron.js.map +0 -1
- package/fixtures/cron-jobs.d.ts +0 -1
- package/fixtures/cron-jobs.js +0 -150
- package/fixtures/cron-jobs.js.map +0 -1
- package/fixtures/init.d.ts +0 -1
- package/fixtures/init.js +0 -91
- package/fixtures/init.js.map +0 -1
- package/http/auth.d.ts +0 -2
- package/http/auth.js +0 -906
- package/http/auth.js.map +0 -1
- package/http/health.d.ts +0 -1
- package/http/health.js +0 -11
- package/http/health.js.map +0 -1
- package/http/home.d.ts +0 -1
- package/http/home.js +0 -134
- package/http/home.js.map +0 -1
- package/http/slow-query-publication.d.ts +0 -2
- package/http/slow-query-publication.js +0 -99
- package/http/slow-query-publication.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -19
- package/index.js.map +0 -1
- package/managers/ai-assistant-codex-manager.manager.d.ts +0 -67
- package/managers/ai-assistant-codex-manager.manager.js +0 -1113
- package/managers/ai-assistant-codex-manager.manager.js.map +0 -1
- package/managers/communication-metric.manager.d.ts +0 -16
- package/managers/communication-metric.manager.js +0 -134
- package/managers/communication-metric.manager.js.map +0 -1
- package/managers/cron.manager.d.ts +0 -20
- package/managers/cron.manager.js +0 -534
- package/managers/cron.manager.js.map +0 -1
- package/managers/customer-notification-content.manager.d.ts +0 -55
- package/managers/customer-notification-content.manager.js +0 -158
- package/managers/customer-notification-content.manager.js.map +0 -1
- package/managers/diagnostic-manager-bootstrap.d.ts +0 -9
- package/managers/diagnostic-manager-bootstrap.js +0 -260
- package/managers/diagnostic-manager-bootstrap.js.map +0 -1
- package/managers/error-auto-fix.manager.d.ts +0 -149
- package/managers/error-auto-fix.manager.js +0 -3064
- package/managers/error-auto-fix.manager.js.map +0 -1
- package/managers/local-log.manager.d.ts +0 -18
- package/managers/local-log.manager.js +0 -88
- package/managers/local-log.manager.js.map +0 -1
- package/managers/method.manager.d.ts +0 -83
- package/managers/method.manager.js +0 -1941
- package/managers/method.manager.js.map +0 -1
- package/managers/mongo.manager.d.ts +0 -224
- package/managers/mongo.manager.js +0 -5000
- package/managers/mongo.manager.js.map +0 -1
- package/managers/monitor.manager.d.ts +0 -70
- package/managers/monitor.manager.js +0 -550
- package/managers/monitor.manager.js.map +0 -1
- package/managers/openai-usage-ledger.manager.d.ts +0 -15
- package/managers/openai-usage-ledger.manager.js +0 -144
- package/managers/openai-usage-ledger.manager.js.map +0 -1
- package/managers/slow-query-verifier.manager.d.ts +0 -144
- package/managers/slow-query-verifier.manager.js +0 -3857
- package/managers/slow-query-verifier.manager.js.map +0 -1
- package/managers/slow-query.manager.d.ts +0 -28
- package/managers/slow-query.manager.js +0 -468
- package/managers/slow-query.manager.js.map +0 -1
- package/managers/subscription.manager.d.ts +0 -169
- package/managers/subscription.manager.js +0 -3434
- package/managers/subscription.manager.js.map +0 -1
- package/managers/websocket.manager.d.ts +0 -73
- package/managers/websocket.manager.js +0 -673
- package/managers/websocket.manager.js.map +0 -1
- package/managers/worker-dispatcher.manager.d.ts +0 -120
- package/managers/worker-dispatcher.manager.js +0 -1266
- package/managers/worker-dispatcher.manager.js.map +0 -1
- package/managers/worker-server.manager.d.ts +0 -35
- package/managers/worker-server.manager.js +0 -582
- package/managers/worker-server.manager.js.map +0 -1
- package/methods/accounts.d.ts +0 -2
- package/methods/accounts.js +0 -624
- package/methods/accounts.js.map +0 -1
- package/methods/ai-terminal.d.ts +0 -336
- package/methods/ai-terminal.js +0 -22782
- package/methods/ai-terminal.js.map +0 -1
- package/methods/app-settings.d.ts +0 -2
- package/methods/app-settings.js +0 -169
- package/methods/app-settings.js.map +0 -1
- package/methods/aws.d.ts +0 -2
- package/methods/aws.js +0 -877
- package/methods/aws.js.map +0 -1
- package/methods/collections.d.ts +0 -2
- package/methods/collections.js +0 -719
- package/methods/collections.js.map +0 -1
- package/methods/counters.d.ts +0 -2
- package/methods/counters.js +0 -113
- package/methods/counters.js.map +0 -1
- package/methods/cron-jobs.d.ts +0 -2
- package/methods/cron-jobs.js +0 -2475
- package/methods/cron-jobs.js.map +0 -1
- package/methods/customer-notifications.d.ts +0 -2
- package/methods/customer-notifications.js +0 -528
- package/methods/customer-notifications.js.map +0 -1
- package/methods/diagnostics.d.ts +0 -2
- package/methods/diagnostics.js +0 -703
- package/methods/diagnostics.js.map +0 -1
- package/methods/flag-updates.d.ts +0 -2
- package/methods/flag-updates.js +0 -8
- package/methods/flag-updates.js.map +0 -1
- package/methods/flags.d.ts +0 -2
- package/methods/flags.js +0 -8
- package/methods/flags.js.map +0 -1
- package/methods/logs.d.ts +0 -2
- package/methods/logs.js +0 -751
- package/methods/logs.js.map +0 -1
- package/methods/mongo-explorer.d.ts +0 -2
- package/methods/mongo-explorer.js +0 -1808
- package/methods/mongo-explorer.js.map +0 -1
- package/methods/monitor.d.ts +0 -2
- package/methods/monitor.js +0 -543
- package/methods/monitor.js.map +0 -1
- package/methods/pdf.d.ts +0 -2
- package/methods/pdf.js +0 -1216
- package/methods/pdf.js.map +0 -1
- package/methods/publications.d.ts +0 -1
- package/methods/publications.js +0 -183
- package/methods/publications.js.map +0 -1
- package/methods/report-builder.d.ts +0 -2
- package/methods/report-builder.js +0 -3094
- package/methods/report-builder.js.map +0 -1
- package/methods/support.d.ts +0 -2
- package/methods/support.js +0 -430
- package/methods/support.js.map +0 -1
- package/models/ai-terminal-conversation.model.d.ts +0 -17
- package/models/ai-terminal-conversation.model.js +0 -4
- package/models/ai-terminal-conversation.model.js.map +0 -1
- package/models/ai-terminal-issue-report.model.d.ts +0 -19
- package/models/ai-terminal-issue-report.model.js +0 -4
- package/models/ai-terminal-issue-report.model.js.map +0 -1
- package/models/ai-terminal-message.model.d.ts +0 -22
- package/models/ai-terminal-message.model.js +0 -4
- package/models/ai-terminal-message.model.js.map +0 -1
- package/models/app-setting.model.d.ts +0 -16
- package/models/app-setting.model.js +0 -4
- package/models/app-setting.model.js.map +0 -1
- package/models/app-status.model.js +0 -4
- package/models/app-status.model.js.map +0 -1
- package/models/billing-logged-in-users.model.js +0 -4
- package/models/billing-logged-in-users.model.js.map +0 -1
- package/models/collection-document.model.d.ts +0 -21
- package/models/collection-document.model.js +0 -4
- package/models/collection-document.model.js.map +0 -1
- package/models/communication-metric.model.d.ts +0 -20
- package/models/communication-metric.model.js +0 -4
- package/models/communication-metric.model.js.map +0 -1
- package/models/counter.model.js +0 -4
- package/models/counter.model.js.map +0 -1
- package/models/cron-job-history.model.d.ts +0 -15
- package/models/cron-job-history.model.js +0 -4
- package/models/cron-job-history.model.js.map +0 -1
- package/models/cron-job.model.d.ts +0 -14
- package/models/cron-job.model.js +0 -4
- package/models/cron-job.model.js.map +0 -1
- package/models/customer-notification.model.d.ts +0 -26
- package/models/customer-notification.model.js +0 -4
- package/models/customer-notification.model.js.map +0 -1
- package/models/customer-portal-password.model.d.ts +0 -11
- package/models/customer-portal-password.model.js +0 -4
- package/models/customer-portal-password.model.js.map +0 -1
- package/models/dialog.model.d.ts +0 -23
- package/models/dialog.model.js +0 -4
- package/models/dialog.model.js.map +0 -1
- package/models/email-history.model.d.ts +0 -31
- package/models/email-history.model.js.map +0 -1
- package/models/email-verified.model.js +0 -4
- package/models/email-verified.model.js.map +0 -1
- package/models/file.model.js +0 -4
- package/models/file.model.js.map +0 -1
- package/models/flag-update.model.js +0 -4
- package/models/flag-update.model.js.map +0 -1
- package/models/flag.model.js +0 -4
- package/models/flag.model.js.map +0 -1
- package/models/log-method-latency.model.d.ts +0 -10
- package/models/log-method-latency.model.js +0 -4
- package/models/log-method-latency.model.js.map +0 -1
- package/models/log-subscription.model.js +0 -4
- package/models/log-subscription.model.js.map +0 -1
- package/models/log.model.d.ts +0 -17
- package/models/log.model.js +0 -4
- package/models/log.model.js.map +0 -1
- package/models/logged-in-users.model.js +0 -4
- package/models/logged-in-users.model.js.map +0 -1
- package/models/method-response.model.js +0 -4
- package/models/method-response.model.js.map +0 -1
- package/models/method.model.d.ts +0 -26
- package/models/method.model.js +0 -4
- package/models/method.model.js.map +0 -1
- package/models/monitor-cpu.model.js +0 -4
- package/models/monitor-cpu.model.js.map +0 -1
- package/models/monitor-function.model.d.ts +0 -14
- package/models/monitor-function.model.js +0 -4
- package/models/monitor-function.model.js.map +0 -1
- package/models/monitor-memory.model.d.ts +0 -15
- package/models/monitor-memory.model.js +0 -4
- package/models/monitor-memory.model.js.map +0 -1
- package/models/monitor-mongo.model.d.ts +0 -13
- package/models/monitor-mongo.model.js +0 -4
- package/models/monitor-mongo.model.js.map +0 -1
- package/models/notification.model.js +0 -4
- package/models/notification.model.js.map +0 -1
- package/models/openai-usage-ledger.model.d.ts +0 -15
- package/models/openai-usage-ledger.model.js +0 -4
- package/models/openai-usage-ledger.model.js.map +0 -1
- package/models/pagination.model.d.ts +0 -11
- package/models/pagination.model.js +0 -28
- package/models/pagination.model.js.map +0 -1
- package/models/permission.model.d.ts +0 -12
- package/models/permission.model.js +0 -4
- package/models/permission.model.js.map +0 -1
- package/models/report-builder-dashboard-builder.model.d.ts +0 -25
- package/models/report-builder-dashboard-builder.model.js +0 -4
- package/models/report-builder-dashboard-builder.model.js.map +0 -1
- package/models/report-builder-library.model.d.ts +0 -17
- package/models/report-builder-library.model.js +0 -4
- package/models/report-builder-library.model.js.map +0 -1
- package/models/report-builder-report.model.d.ts +0 -121
- package/models/report-builder-report.model.js +0 -4
- package/models/report-builder-report.model.js.map +0 -1
- package/models/report-builder.model.d.ts +0 -61
- package/models/report-builder.model.js +0 -4
- package/models/report-builder.model.js.map +0 -1
- package/models/select-data-label.model.d.ts +0 -9
- package/models/select-data-label.model.js +0 -4
- package/models/select-data-label.model.js.map +0 -1
- package/models/server-message.model.d.ts +0 -32
- package/models/server-message.model.js +0 -4
- package/models/server-message.model.js.map +0 -1
- package/models/slow-query-report.model.d.ts +0 -23
- package/models/slow-query-report.model.js +0 -4
- package/models/slow-query-report.model.js.map +0 -1
- package/models/subscription.model.d.ts +0 -31
- package/models/subscription.model.js +0 -4
- package/models/subscription.model.js.map +0 -1
- package/models/support-ticket.model.d.ts +0 -87
- package/models/support-ticket.model.js +0 -4
- package/models/support-ticket.model.js.map +0 -1
- package/models/user-group.model.d.ts +0 -20
- package/models/user-group.model.js +0 -4
- package/models/user-group.model.js.map +0 -1
- package/models/user-guide.model.js +0 -4
- package/models/user-guide.model.js.map +0 -1
- package/models/user.model.d.ts +0 -84
- package/models/user.model.js +0 -4
- package/models/user.model.js.map +0 -1
- package/private/images/ResolveIO.png +0 -0
- package/public_api.js +0 -115
- package/public_api.js.map +0 -1
- package/publications/ai-terminal.d.ts +0 -1
- package/publications/ai-terminal.js +0 -122
- package/publications/ai-terminal.js.map +0 -1
- package/publications/app-settings.d.ts +0 -2
- package/publications/app-settings.js +0 -28
- package/publications/app-settings.js.map +0 -1
- package/publications/app-status.d.ts +0 -2
- package/publications/app-status.js +0 -16
- package/publications/app-status.js.map +0 -1
- package/publications/cron-jobs.d.ts +0 -2
- package/publications/cron-jobs.js +0 -88
- package/publications/cron-jobs.js.map +0 -1
- package/publications/customer-notifications.d.ts +0 -2
- package/publications/customer-notifications.js +0 -161
- package/publications/customer-notifications.js.map +0 -1
- package/publications/files.d.ts +0 -2
- package/publications/files.js +0 -36
- package/publications/files.js.map +0 -1
- package/publications/flags-update.d.ts +0 -2
- package/publications/flags-update.js +0 -22
- package/publications/flags-update.js.map +0 -1
- package/publications/flags.d.ts +0 -2
- package/publications/flags.js +0 -22
- package/publications/flags.js.map +0 -1
- package/publications/logs.d.ts +0 -2
- package/publications/logs.js +0 -164
- package/publications/logs.js.map +0 -1
- package/publications/notifications.d.ts +0 -2
- package/publications/notifications.js +0 -16
- package/publications/notifications.js.map +0 -1
- package/publications/report-builder-dashboard-builders.d.ts +0 -2
- package/publications/report-builder-dashboard-builders.js +0 -42
- package/publications/report-builder-dashboard-builders.js.map +0 -1
- package/publications/report-builder-libraries.d.ts +0 -2
- package/publications/report-builder-libraries.js +0 -90
- package/publications/report-builder-libraries.js.map +0 -1
- package/publications/report-builder-reports.d.ts +0 -2
- package/publications/report-builder-reports.js +0 -50
- package/publications/report-builder-reports.js.map +0 -1
- package/publications/super-admin.d.ts +0 -2
- package/publications/super-admin.js +0 -16
- package/publications/super-admin.js.map +0 -1
- package/publications/user-groups.d.ts +0 -1
- package/publications/user-groups.js +0 -16
- package/publications/user-groups.js.map +0 -1
- package/publications/user-guides.d.ts +0 -1
- package/publications/user-guides.js +0 -16
- package/publications/user-guides.js.map +0 -1
- package/resolveio-server-app.d.ts +0 -70
- package/resolveio-server-app.js +0 -801
- package/resolveio-server-app.js.map +0 -1
- package/server-app.d.ts +0 -228
- package/server-app.js +0 -3566
- package/server-app.js.map +0 -1
- package/services/codex-client.d.ts +0 -126
- package/services/codex-client.js +0 -1622
- package/services/codex-client.js.map +0 -1
- package/services/openai-client.d.ts +0 -46
- package/services/openai-client.js +0 -318
- package/services/openai-client.js.map +0 -1
- package/types/error-report.d.ts +0 -25
- package/types/error-report.js +0 -4
- package/types/error-report.js.map +0 -1
- package/types/slow-query-report.d.ts +0 -27
- package/types/slow-query-report.js +0 -6
- package/types/slow-query-report.js.map +0 -1
- package/util/ai-qa-policy.d.ts +0 -119
- package/util/ai-qa-policy.js +0 -650
- package/util/ai-qa-policy.js.map +0 -1
- package/util/ai-runner-artifacts.d.ts +0 -74
- package/util/ai-runner-artifacts.js +0 -531
- package/util/ai-runner-artifacts.js.map +0 -1
- package/util/ai-runner-qa-auth.d.ts +0 -5
- package/util/ai-runner-qa-auth.js +0 -357
- package/util/ai-runner-qa-auth.js.map +0 -1
- package/util/ai-runner-qa-tools.d.ts +0 -16
- package/util/ai-runner-qa-tools.js +0 -635
- package/util/ai-runner-qa-tools.js.map +0 -1
- package/util/common.d.ts +0 -31
- package/util/common.js +0 -683
- package/util/common.js.map +0 -1
- package/util/customer-portal-password.d.ts +0 -13
- package/util/customer-portal-password.js +0 -209
- package/util/customer-portal-password.js.map +0 -1
- package/util/error-reporter.d.ts +0 -52
- package/util/error-reporter.js +0 -326
- package/util/error-reporter.js.map +0 -1
- package/util/error-tracking.d.ts +0 -13
- package/util/error-tracking.js +0 -120
- package/util/error-tracking.js.map +0 -1
- package/util/report-builder-unwinds.d.ts +0 -15
- package/util/report-builder-unwinds.js +0 -156
- package/util/report-builder-unwinds.js.map +0 -1
- package/util/schema-report-builder.d.ts +0 -6
- package/util/schema-report-builder.js +0 -481
- package/util/schema-report-builder.js.map +0 -1
- package/util/slow-query-reporter.d.ts +0 -28
- package/util/slow-query-reporter.js +0 -226
- package/util/slow-query-reporter.js.map +0 -1
- package/util/subscription-dependency-context.d.ts +0 -34
- package/util/subscription-dependency-context.js +0 -1283
- package/util/subscription-dependency-context.js.map +0 -1
- package/util/tokenizer.d.ts +0 -5
- package/util/tokenizer.js +0 -41
- package/util/tokenizer.js.map +0 -1
- package/workers/codex-runner.worker.d.ts +0 -1
- package/workers/codex-runner.worker.js +0 -192
- package/workers/codex-runner.worker.js.map +0 -1
- /package/{private → src/private}/email-templates/enrollment.html +0 -0
- /package/{private → src/private}/email-templates/forgot-password.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-deleted.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket-modified.html +0 -0
- /package/{private → src/private}/email-templates/support-ticket.html +0 -0
- /package/{public_api.d.ts → src/public_api.ts} +0 -0
|
@@ -1,531 +0,0 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __values = (this && this.__values) || function(o) {
|
|
50
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
51
|
-
if (m) return m.call(o);
|
|
52
|
-
if (o && typeof o.length === "number") return {
|
|
53
|
-
next: function () {
|
|
54
|
-
if (o && i >= o.length) o = void 0;
|
|
55
|
-
return { value: o && o[i++], done: !o };
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
59
|
-
};
|
|
60
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
61
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
62
|
-
if (!m) return o;
|
|
63
|
-
var i = m.call(o), r, ar = [], e;
|
|
64
|
-
try {
|
|
65
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
66
|
-
}
|
|
67
|
-
catch (error) { e = { error: error }; }
|
|
68
|
-
finally {
|
|
69
|
-
try {
|
|
70
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
71
|
-
}
|
|
72
|
-
finally { if (e) throw e.error; }
|
|
73
|
-
}
|
|
74
|
-
return ar;
|
|
75
|
-
};
|
|
76
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
77
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
78
|
-
if (ar || !(i in from)) {
|
|
79
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
80
|
-
ar[i] = from[i];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
84
|
-
};
|
|
85
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
-
exports.inferResolveIORunnerEvidenceContentType = inferResolveIORunnerEvidenceContentType;
|
|
87
|
-
exports.buildResolveIORunnerEvidenceCid = buildResolveIORunnerEvidenceCid;
|
|
88
|
-
exports.inferResolveIORunnerEvidenceCaption = inferResolveIORunnerEvidenceCaption;
|
|
89
|
-
exports.normalizeResolveIORunnerPersistedEvidenceFiles = normalizeResolveIORunnerPersistedEvidenceFiles;
|
|
90
|
-
exports.mergeResolveIORunnerEvidenceFileIds = mergeResolveIORunnerEvidenceFileIds;
|
|
91
|
-
exports.collectResolveIORunnerEvidenceArtifactPaths = collectResolveIORunnerEvidenceArtifactPaths;
|
|
92
|
-
exports.toResolveIORunnerEvidenceAttachments = toResolveIORunnerEvidenceAttachments;
|
|
93
|
-
exports.persistResolveIORunnerEvidenceArtifacts = persistResolveIORunnerEvidenceArtifacts;
|
|
94
|
-
var node_crypto_1 = require("node:crypto");
|
|
95
|
-
var fs = require("fs");
|
|
96
|
-
var path = require("path");
|
|
97
|
-
function inferResolveIORunnerEvidenceContentType(fileName) {
|
|
98
|
-
var normalized = String(fileName || '').trim().toLowerCase();
|
|
99
|
-
if (normalized.endsWith('.png')) {
|
|
100
|
-
return 'image/png';
|
|
101
|
-
}
|
|
102
|
-
if (normalized.endsWith('.jpg') || normalized.endsWith('.jpeg')) {
|
|
103
|
-
return 'image/jpeg';
|
|
104
|
-
}
|
|
105
|
-
if (normalized.endsWith('.webp')) {
|
|
106
|
-
return 'image/webp';
|
|
107
|
-
}
|
|
108
|
-
if (normalized.endsWith('.zip')) {
|
|
109
|
-
return 'application/zip';
|
|
110
|
-
}
|
|
111
|
-
if (normalized.endsWith('.json')) {
|
|
112
|
-
return 'application/json';
|
|
113
|
-
}
|
|
114
|
-
if (normalized.endsWith('.txt') || normalized.endsWith('.log')) {
|
|
115
|
-
return 'text/plain; charset=utf-8';
|
|
116
|
-
}
|
|
117
|
-
return 'application/octet-stream';
|
|
118
|
-
}
|
|
119
|
-
function buildResolveIORunnerEvidenceCid(filePath) {
|
|
120
|
-
var baseName = path.basename(String(filePath || '').trim()) || 'runner-artifact';
|
|
121
|
-
var normalized = baseName
|
|
122
|
-
.toLowerCase()
|
|
123
|
-
.replace(/[^a-z0-9._-]+/g, '-')
|
|
124
|
-
.replace(/^-+|-+$/g, '')
|
|
125
|
-
.slice(0, 80) || 'runner-artifact';
|
|
126
|
-
var digest = (0, node_crypto_1.createHash)('sha1').update(String(filePath || '')).digest('hex').slice(0, 12);
|
|
127
|
-
return "".concat(normalized, "-").concat(digest, "@resolveio-runner");
|
|
128
|
-
}
|
|
129
|
-
function inferResolveIORunnerEvidenceCaption(fileNameOrPath) {
|
|
130
|
-
var baseName = path.basename(String(fileNameOrPath || '').trim()).replace(/\.[a-z0-9]+$/i, '');
|
|
131
|
-
var normalized = baseName
|
|
132
|
-
.toLowerCase()
|
|
133
|
-
.replace(/[_-]+/g, ' ')
|
|
134
|
-
.replace(/\b\d{4,}\b/g, '')
|
|
135
|
-
.replace(/\s+/g, ' ')
|
|
136
|
-
.trim();
|
|
137
|
-
if (!normalized) {
|
|
138
|
-
return 'QA screenshot captured during validation.';
|
|
139
|
-
}
|
|
140
|
-
if (/\bbefore\b/.test(normalized)) {
|
|
141
|
-
return 'Before: the tested page is loaded at the start of the workflow.';
|
|
142
|
-
}
|
|
143
|
-
if (/\bready\b/.test(normalized) && /\bimport\b/.test(normalized)) {
|
|
144
|
-
return 'Ready to import: the uploaded data was accepted and is displayed for review before submission.';
|
|
145
|
-
}
|
|
146
|
-
if (/\bsubmitted\b|\bresult\b|\bafter\b|\bcomplete\b|\bsuccess\b|\bverified\b/.test(normalized)) {
|
|
147
|
-
return 'After submission: the workflow completed and the result confirms the change worked.';
|
|
148
|
-
}
|
|
149
|
-
if (/\bdialog\b|\bmodal\b|\bpopup\b/.test(normalized)) {
|
|
150
|
-
return 'Dialog: the tested prompt or modal is shown in the expected state.';
|
|
151
|
-
}
|
|
152
|
-
if (/\bmobile\b/.test(normalized)) {
|
|
153
|
-
return 'Mobile view: the tested workflow is shown at the mobile viewport.';
|
|
154
|
-
}
|
|
155
|
-
if (/\bdesktop\b|\bwide\b/.test(normalized)) {
|
|
156
|
-
return 'Desktop view: the tested workflow is shown at a full-width desktop viewport.';
|
|
157
|
-
}
|
|
158
|
-
return baseName
|
|
159
|
-
.replace(/[_-]+/g, ' ')
|
|
160
|
-
.replace(/\b\w/g, function (letter) { return letter.toUpperCase(); })
|
|
161
|
-
.slice(0, 180);
|
|
162
|
-
}
|
|
163
|
-
function normalizeResolveIORunnerPersistedEvidenceFiles(value) {
|
|
164
|
-
if (!Array.isArray(value)) {
|
|
165
|
-
return [];
|
|
166
|
-
}
|
|
167
|
-
return value
|
|
168
|
-
.map(function (item) {
|
|
169
|
-
var fileId = String((item === null || item === void 0 ? void 0 : item.file_id) || (item === null || item === void 0 ? void 0 : item.id_file) || (item === null || item === void 0 ? void 0 : item._id) || '').trim();
|
|
170
|
-
if (!fileId) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
file_id: fileId,
|
|
175
|
-
filename: String((item === null || item === void 0 ? void 0 : item.filename) || (item === null || item === void 0 ? void 0 : item.name) || '').trim(),
|
|
176
|
-
key: String((item === null || item === void 0 ? void 0 : item.key) || '').trim() || undefined,
|
|
177
|
-
contentType: String((item === null || item === void 0 ? void 0 : item.contentType) || (item === null || item === void 0 ? void 0 : item.content_type) || '').trim() || undefined,
|
|
178
|
-
caption: String((item === null || item === void 0 ? void 0 : item.caption) || '').trim() || undefined,
|
|
179
|
-
content_hash: String((item === null || item === void 0 ? void 0 : item.content_hash) || (item === null || item === void 0 ? void 0 : item.hash) || '').trim() || undefined,
|
|
180
|
-
ticket_url: String((item === null || item === void 0 ? void 0 : item.ticket_url) || '').trim() || undefined
|
|
181
|
-
};
|
|
182
|
-
})
|
|
183
|
-
.filter(function (item) { return !!item; });
|
|
184
|
-
}
|
|
185
|
-
function mergeResolveIORunnerEvidenceFileIds() {
|
|
186
|
-
var values = [];
|
|
187
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
188
|
-
values[_i] = arguments[_i];
|
|
189
|
-
}
|
|
190
|
-
var ids = [];
|
|
191
|
-
var seen = new Set();
|
|
192
|
-
var push = function (value) {
|
|
193
|
-
if (Array.isArray(value)) {
|
|
194
|
-
value.forEach(push);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
var id = String((value === null || value === void 0 ? void 0 : value.file_id) || (value === null || value === void 0 ? void 0 : value.id_file) || (value === null || value === void 0 ? void 0 : value._id) || value || '').trim();
|
|
198
|
-
if (!id || seen.has(id)) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
seen.add(id);
|
|
202
|
-
ids.push(id);
|
|
203
|
-
};
|
|
204
|
-
values.forEach(push);
|
|
205
|
-
return ids;
|
|
206
|
-
}
|
|
207
|
-
function collectResolveIORunnerEvidenceText(value, output) {
|
|
208
|
-
if (value === null || value === undefined) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
if (typeof value === 'string') {
|
|
212
|
-
output.push(value);
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
if (Array.isArray(value)) {
|
|
216
|
-
value.forEach(function (entry) { return collectResolveIORunnerEvidenceText(entry, output); });
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
if (typeof value === 'object') {
|
|
220
|
-
Object.values(value).forEach(function (entry) { return collectResolveIORunnerEvidenceText(entry, output); });
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
function normalizeArtifactCandidatePath(value) {
|
|
224
|
-
return String(value || '')
|
|
225
|
-
.trim()
|
|
226
|
-
.replace(/[),.;:'"]+$/g, '')
|
|
227
|
-
.replace(/\\/g, '/');
|
|
228
|
-
}
|
|
229
|
-
function pathExists(filePath) {
|
|
230
|
-
try {
|
|
231
|
-
return !!filePath && fs.existsSync(filePath) && fs.statSync(filePath).isFile();
|
|
232
|
-
}
|
|
233
|
-
catch (_a) {
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
function resolveArtifactCandidate(candidate, roots) {
|
|
238
|
-
var e_1, _a;
|
|
239
|
-
var normalized = normalizeArtifactCandidatePath(candidate);
|
|
240
|
-
if (!normalized) {
|
|
241
|
-
return '';
|
|
242
|
-
}
|
|
243
|
-
if (path.isAbsolute(normalized)) {
|
|
244
|
-
return pathExists(normalized) ? normalized : '';
|
|
245
|
-
}
|
|
246
|
-
try {
|
|
247
|
-
for (var roots_1 = __values(roots), roots_1_1 = roots_1.next(); !roots_1_1.done; roots_1_1 = roots_1.next()) {
|
|
248
|
-
var root = roots_1_1.value;
|
|
249
|
-
var normalizedRoot = String(root || '').trim();
|
|
250
|
-
if (!normalizedRoot) {
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
var resolved = path.resolve(normalizedRoot, normalized);
|
|
254
|
-
if (pathExists(resolved)) {
|
|
255
|
-
return resolved;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
260
|
-
finally {
|
|
261
|
-
try {
|
|
262
|
-
if (roots_1_1 && !roots_1_1.done && (_a = roots_1.return)) _a.call(roots_1);
|
|
263
|
-
}
|
|
264
|
-
finally { if (e_1) throw e_1.error; }
|
|
265
|
-
}
|
|
266
|
-
return '';
|
|
267
|
-
}
|
|
268
|
-
function collectResolveIORunnerEvidenceArtifactPaths(input) {
|
|
269
|
-
var e_2, _a, e_3, _b, e_4, _c, e_5, _d, e_6, _e;
|
|
270
|
-
var _f, _g, _h, _j;
|
|
271
|
-
if (input === void 0) { input = {}; }
|
|
272
|
-
var values = [];
|
|
273
|
-
collectResolveIORunnerEvidenceText(input.evidence, values);
|
|
274
|
-
var job = input.job || {};
|
|
275
|
-
collectResolveIORunnerEvidenceText(job.responseSummary, values);
|
|
276
|
-
collectResolveIORunnerEvidenceText(job.lastVerificationSummary, values);
|
|
277
|
-
collectResolveIORunnerEvidenceText(job.lastRerunReason, values);
|
|
278
|
-
collectResolveIORunnerEvidenceText((_f = job.artifacts) === null || _f === void 0 ? void 0 : _f.agentNotes, values);
|
|
279
|
-
collectResolveIORunnerEvidenceText((_g = job.artifacts) === null || _g === void 0 ? void 0 : _g.supportArtifacts, values);
|
|
280
|
-
collectResolveIORunnerEvidenceText((_h = job.artifacts) === null || _h === void 0 ? void 0 : _h.qaArtifacts, values);
|
|
281
|
-
collectResolveIORunnerEvidenceText((_j = job.artifacts) === null || _j === void 0 ? void 0 : _j.qa_artifacts, values);
|
|
282
|
-
collectResolveIORunnerEvidenceText(job.qa_artifacts, values);
|
|
283
|
-
collectResolveIORunnerEvidenceText(job.supportQaArtifacts, values);
|
|
284
|
-
collectResolveIORunnerEvidenceText(job.runnerEvidenceArtifacts, values);
|
|
285
|
-
if (Array.isArray(job.tasks)) {
|
|
286
|
-
try {
|
|
287
|
-
for (var _k = __values(job.tasks), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
288
|
-
var task = _l.value;
|
|
289
|
-
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.title, values);
|
|
290
|
-
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.notes, values);
|
|
291
|
-
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.artifacts, values);
|
|
292
|
-
collectResolveIORunnerEvidenceText(task === null || task === void 0 ? void 0 : task.evidence, values);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
296
|
-
finally {
|
|
297
|
-
try {
|
|
298
|
-
if (_l && !_l.done && (_a = _k.return)) _a.call(_k);
|
|
299
|
-
}
|
|
300
|
-
finally { if (e_2) throw e_2.error; }
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
if (Array.isArray(job.log)) {
|
|
304
|
-
collectResolveIORunnerEvidenceText(job.log.slice(-160), values);
|
|
305
|
-
}
|
|
306
|
-
var roots = Array.from(new Set(__spreadArray(__spreadArray([], __read((input.roots || [])), false), [
|
|
307
|
-
job.workspacePath,
|
|
308
|
-
job.projectRoot && job.workspacePath ? path.join(job.workspacePath, job.projectRoot) : '',
|
|
309
|
-
job.projectDisplayPath && job.workspacePath ? path.join(job.workspacePath, job.projectDisplayPath) : '',
|
|
310
|
-
job.localPath
|
|
311
|
-
], false).map(function (entry) { return String(entry || '').trim(); }).filter(Boolean)));
|
|
312
|
-
var candidates = [];
|
|
313
|
-
try {
|
|
314
|
-
for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
|
|
315
|
-
var value = values_1_1.value;
|
|
316
|
-
var text = String(value || '');
|
|
317
|
-
try {
|
|
318
|
-
for (var _m = (e_4 = void 0, __values(text.matchAll(/((?:\/tmp\/|\/var\/|\/Users\/)[^\s)'"]+?\.(?:png|jpe?g|webp|zip|json|txt|log))/gi))), _o = _m.next(); !_o.done; _o = _m.next()) {
|
|
319
|
-
var match = _o.value;
|
|
320
|
-
candidates.push(match[1]);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
324
|
-
finally {
|
|
325
|
-
try {
|
|
326
|
-
if (_o && !_o.done && (_c = _m.return)) _c.call(_m);
|
|
327
|
-
}
|
|
328
|
-
finally { if (e_4) throw e_4.error; }
|
|
329
|
-
}
|
|
330
|
-
try {
|
|
331
|
-
for (var _p = (e_5 = void 0, __values(text.matchAll(/(?:^|[\s("'`])((?:(?:[\w.-]+\/)*qa-artifacts|qa-artifacts|test-results|playwright-report|\.build-output)\/[^\s)'"]+?\.(?:png|jpe?g|webp|zip|json|txt|log))/gim))), _q = _p.next(); !_q.done; _q = _p.next()) {
|
|
332
|
-
var match = _q.value;
|
|
333
|
-
candidates.push(match[1]);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
337
|
-
finally {
|
|
338
|
-
try {
|
|
339
|
-
if (_q && !_q.done && (_d = _p.return)) _d.call(_p);
|
|
340
|
-
}
|
|
341
|
-
finally { if (e_5) throw e_5.error; }
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
346
|
-
finally {
|
|
347
|
-
try {
|
|
348
|
-
if (values_1_1 && !values_1_1.done && (_b = values_1.return)) _b.call(values_1);
|
|
349
|
-
}
|
|
350
|
-
finally { if (e_3) throw e_3.error; }
|
|
351
|
-
}
|
|
352
|
-
var resolved = [];
|
|
353
|
-
var seen = new Set();
|
|
354
|
-
try {
|
|
355
|
-
for (var candidates_1 = __values(candidates), candidates_1_1 = candidates_1.next(); !candidates_1_1.done; candidates_1_1 = candidates_1.next()) {
|
|
356
|
-
var candidate = candidates_1_1.value;
|
|
357
|
-
var filePath = resolveArtifactCandidate(candidate, roots);
|
|
358
|
-
if (!filePath || seen.has(filePath)) {
|
|
359
|
-
continue;
|
|
360
|
-
}
|
|
361
|
-
seen.add(filePath);
|
|
362
|
-
resolved.push(filePath);
|
|
363
|
-
if (resolved.length >= (input.maxFiles || 8)) {
|
|
364
|
-
break;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
369
|
-
finally {
|
|
370
|
-
try {
|
|
371
|
-
if (candidates_1_1 && !candidates_1_1.done && (_e = candidates_1.return)) _e.call(candidates_1);
|
|
372
|
-
}
|
|
373
|
-
finally { if (e_6) throw e_6.error; }
|
|
374
|
-
}
|
|
375
|
-
return resolved;
|
|
376
|
-
}
|
|
377
|
-
function toResolveIORunnerEvidenceAttachments(input) {
|
|
378
|
-
if (input === void 0) { input = {}; }
|
|
379
|
-
return collectResolveIORunnerEvidenceArtifactPaths(input).map(function (filePath) {
|
|
380
|
-
var filename = path.basename(filePath);
|
|
381
|
-
return {
|
|
382
|
-
filename: filename,
|
|
383
|
-
path: filePath,
|
|
384
|
-
contentType: inferResolveIORunnerEvidenceContentType(filename),
|
|
385
|
-
cid: buildResolveIORunnerEvidenceCid(filePath),
|
|
386
|
-
caption: inferResolveIORunnerEvidenceCaption(filename)
|
|
387
|
-
};
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
function persistResolveIORunnerEvidenceArtifacts(options) {
|
|
391
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
392
|
-
var maxFiles, previousFiles, existingByHash, previousFiles_1, previousFiles_1_1, file, attachments, persistedFiles, fileIds, errors, nextAttachments, seenPaths, attachments_1, attachments_1_1, attachment, filePath, filename, contentType, error, stat, error, contentBuffer, contentHash, existing, uploaded, fileId, persisted, error_1, message, e_7_1;
|
|
393
|
-
var e_8, _a, e_7, _b;
|
|
394
|
-
return __generator(this, function (_c) {
|
|
395
|
-
switch (_c.label) {
|
|
396
|
-
case 0:
|
|
397
|
-
maxFiles = Math.max(1, options.maxFiles || 8);
|
|
398
|
-
previousFiles = normalizeResolveIORunnerPersistedEvidenceFiles(options.previousFiles);
|
|
399
|
-
existingByHash = new Map();
|
|
400
|
-
try {
|
|
401
|
-
for (previousFiles_1 = __values(previousFiles), previousFiles_1_1 = previousFiles_1.next(); !previousFiles_1_1.done; previousFiles_1_1 = previousFiles_1.next()) {
|
|
402
|
-
file = previousFiles_1_1.value;
|
|
403
|
-
if (file.content_hash) {
|
|
404
|
-
existingByHash.set(file.content_hash, file);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
409
|
-
finally {
|
|
410
|
-
try {
|
|
411
|
-
if (previousFiles_1_1 && !previousFiles_1_1.done && (_a = previousFiles_1.return)) _a.call(previousFiles_1);
|
|
412
|
-
}
|
|
413
|
-
finally { if (e_8) throw e_8.error; }
|
|
414
|
-
}
|
|
415
|
-
attachments = __spreadArray(__spreadArray([], __read((options.attachments || [])), false), __read(toResolveIORunnerEvidenceAttachments({
|
|
416
|
-
evidence: options.evidence,
|
|
417
|
-
job: options.job,
|
|
418
|
-
roots: options.roots,
|
|
419
|
-
maxFiles: maxFiles
|
|
420
|
-
})), false);
|
|
421
|
-
persistedFiles = __spreadArray([], __read(previousFiles), false);
|
|
422
|
-
fileIds = mergeResolveIORunnerEvidenceFileIds(options.existingFileIds, previousFiles.map(function (file) { return file.file_id; }));
|
|
423
|
-
errors = [];
|
|
424
|
-
nextAttachments = [];
|
|
425
|
-
seenPaths = new Set();
|
|
426
|
-
_c.label = 1;
|
|
427
|
-
case 1:
|
|
428
|
-
_c.trys.push([1, 10, 11, 12]);
|
|
429
|
-
attachments_1 = __values(attachments), attachments_1_1 = attachments_1.next();
|
|
430
|
-
_c.label = 2;
|
|
431
|
-
case 2:
|
|
432
|
-
if (!!attachments_1_1.done) return [3 /*break*/, 9];
|
|
433
|
-
attachment = attachments_1_1.value;
|
|
434
|
-
if (nextAttachments.length >= maxFiles) {
|
|
435
|
-
return [3 /*break*/, 9];
|
|
436
|
-
}
|
|
437
|
-
filePath = String((attachment === null || attachment === void 0 ? void 0 : attachment.path) || '').trim();
|
|
438
|
-
if (!filePath || seenPaths.has(filePath)) {
|
|
439
|
-
return [3 /*break*/, 8];
|
|
440
|
-
}
|
|
441
|
-
seenPaths.add(filePath);
|
|
442
|
-
filename = String((attachment === null || attachment === void 0 ? void 0 : attachment.filename) || path.basename(filePath) || 'runner-qa-artifact.png').trim();
|
|
443
|
-
contentType = String((attachment === null || attachment === void 0 ? void 0 : attachment.contentType) || inferResolveIORunnerEvidenceContentType(filename)).trim();
|
|
444
|
-
if (!pathExists(filePath)) {
|
|
445
|
-
error = "".concat(filename, ": evidence file was not found before S3 upload.");
|
|
446
|
-
errors.push(error);
|
|
447
|
-
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, upload_error: error }));
|
|
448
|
-
return [3 /*break*/, 8];
|
|
449
|
-
}
|
|
450
|
-
return [4 /*yield*/, fs.promises.stat(filePath)];
|
|
451
|
-
case 3:
|
|
452
|
-
stat = _c.sent();
|
|
453
|
-
if (!stat.isFile() || stat.size <= 0) {
|
|
454
|
-
error = "".concat(filename, ": evidence file was empty before S3 upload.");
|
|
455
|
-
errors.push(error);
|
|
456
|
-
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, upload_error: error }));
|
|
457
|
-
return [3 /*break*/, 8];
|
|
458
|
-
}
|
|
459
|
-
return [4 /*yield*/, fs.promises.readFile(filePath)];
|
|
460
|
-
case 4:
|
|
461
|
-
contentBuffer = _c.sent();
|
|
462
|
-
contentHash = (0, node_crypto_1.createHash)('sha1').update(new Uint8Array(contentBuffer)).digest('hex');
|
|
463
|
-
existing = existingByHash.get(contentHash);
|
|
464
|
-
if (existing) {
|
|
465
|
-
fileIds.push(existing.file_id);
|
|
466
|
-
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, file_id: existing.file_id, key: existing.key, caption: attachment.caption || existing.caption || inferResolveIORunnerEvidenceCaption(filename), content_hash: contentHash, ticket_url: options.ticketUrl || existing.ticket_url, uploaded_to_support_ticket: true }));
|
|
467
|
-
return [3 /*break*/, 8];
|
|
468
|
-
}
|
|
469
|
-
_c.label = 5;
|
|
470
|
-
case 5:
|
|
471
|
-
_c.trys.push([5, 7, , 8]);
|
|
472
|
-
return [4 /*yield*/, options.uploadFile({
|
|
473
|
-
filename: filename,
|
|
474
|
-
filePath: filePath,
|
|
475
|
-
contentType: contentType,
|
|
476
|
-
size: stat.size,
|
|
477
|
-
contentBuffer: contentBuffer,
|
|
478
|
-
contentHash: contentHash
|
|
479
|
-
})];
|
|
480
|
-
case 6:
|
|
481
|
-
uploaded = _c.sent();
|
|
482
|
-
fileId = String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.file_id) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded.id_file) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded._id) || '').trim();
|
|
483
|
-
if (!fileId) {
|
|
484
|
-
throw new Error('artifact upload returned no file id');
|
|
485
|
-
}
|
|
486
|
-
persisted = {
|
|
487
|
-
file_id: fileId,
|
|
488
|
-
filename: String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.filename) || (uploaded === null || uploaded === void 0 ? void 0 : uploaded.name) || filename).trim() || filename,
|
|
489
|
-
key: String((uploaded === null || uploaded === void 0 ? void 0 : uploaded.key) || '').trim() || undefined,
|
|
490
|
-
contentType: contentType,
|
|
491
|
-
caption: String((attachment === null || attachment === void 0 ? void 0 : attachment.caption) || '').trim() || inferResolveIORunnerEvidenceCaption(filename),
|
|
492
|
-
content_hash: contentHash,
|
|
493
|
-
ticket_url: String(options.ticketUrl || '').trim() || undefined
|
|
494
|
-
};
|
|
495
|
-
persistedFiles.push(persisted);
|
|
496
|
-
existingByHash.set(contentHash, persisted);
|
|
497
|
-
fileIds.push(fileId);
|
|
498
|
-
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, file_id: fileId, key: persisted.key, caption: persisted.caption, content_hash: contentHash, ticket_url: persisted.ticket_url, uploaded_to_support_ticket: true }));
|
|
499
|
-
return [3 /*break*/, 8];
|
|
500
|
-
case 7:
|
|
501
|
-
error_1 = _c.sent();
|
|
502
|
-
message = "".concat(filename, ": ").concat((error_1 === null || error_1 === void 0 ? void 0 : error_1.message) || error_1);
|
|
503
|
-
errors.push(message);
|
|
504
|
-
nextAttachments.push(__assign(__assign({}, attachment), { filename: filename, content_hash: contentHash, upload_error: message }));
|
|
505
|
-
return [3 /*break*/, 8];
|
|
506
|
-
case 8:
|
|
507
|
-
attachments_1_1 = attachments_1.next();
|
|
508
|
-
return [3 /*break*/, 2];
|
|
509
|
-
case 9: return [3 /*break*/, 12];
|
|
510
|
-
case 10:
|
|
511
|
-
e_7_1 = _c.sent();
|
|
512
|
-
e_7 = { error: e_7_1 };
|
|
513
|
-
return [3 /*break*/, 12];
|
|
514
|
-
case 11:
|
|
515
|
-
try {
|
|
516
|
-
if (attachments_1_1 && !attachments_1_1.done && (_b = attachments_1.return)) _b.call(attachments_1);
|
|
517
|
-
}
|
|
518
|
-
finally { if (e_7) throw e_7.error; }
|
|
519
|
-
return [7 /*endfinally*/];
|
|
520
|
-
case 12: return [2 /*return*/, {
|
|
521
|
-
attachments: nextAttachments,
|
|
522
|
-
fileIds: mergeResolveIORunnerEvidenceFileIds(fileIds),
|
|
523
|
-
files: persistedFiles,
|
|
524
|
-
errors: errors
|
|
525
|
-
}];
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
//# sourceMappingURL=ai-runner-artifacts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/ai-runner-artifacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkEA,0FAqBC;AAED,0EASC;AAED,kFAiCC;AAED,wGAqBC;AAED,kFAiBC;AAwDD,kGA8DC;AAED,oFAgBC;AAED,0FAoHC;AA7aD,2CAAyC;AACzC,uBAAyB;AACzB,2BAA6B;AAgE7B,SAAgB,uCAAuC,CAAC,QAAgB;IACvE,IAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/D,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,WAAW,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACjE,OAAO,YAAY,CAAC;IACrB,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACrB,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,OAAO,iBAAiB,CAAC;IAC1B,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,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["import { createHash } from 'node:crypto';\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nexport interface ResolveIORunnerEvidenceAttachment {\n\tfilename: string;\n\tpath: string;\n\tcontentType?: string;\n\tcid?: string;\n\tcaption?: string;\n\tfile_id?: string;\n\tkey?: string;\n\tcontent_hash?: string;\n\tticket_url?: string;\n\tuploaded_to_support_ticket?: boolean;\n\tupload_error?: string;\n}\n\nexport interface ResolveIORunnerPersistedEvidenceFile {\n\tfile_id: string;\n\tfilename: string;\n\tkey?: string;\n\tcontentType?: string;\n\tcaption?: string;\n\tcontent_hash?: string;\n\tticket_url?: string;\n}\n\nexport interface ResolveIORunnerEvidenceUploadInput {\n\tfilename: string;\n\tfilePath: string;\n\tcontentType: string;\n\tsize: number;\n\tcontentBuffer: Buffer;\n\tcontentHash: string;\n}\n\nexport interface ResolveIORunnerEvidenceUploadResult {\n\tfile_id?: string;\n\tid_file?: string;\n\t_id?: string;\n\tkey?: string;\n\tname?: string;\n\tfilename?: string;\n}\n\nexport interface ResolveIORunnerPersistEvidenceOptions {\n\tattachments?: ResolveIORunnerEvidenceAttachment[];\n\tevidence?: any;\n\tjob?: any;\n\tticket?: any;\n\tticketUrl?: string;\n\troots?: string[];\n\tpreviousFiles?: any[];\n\texistingFileIds?: any[];\n\tmaxFiles?: number;\n\tuploadFile: any;\n}\n\nexport interface ResolveIORunnerPersistEvidenceResult {\n\tattachments: ResolveIORunnerEvidenceAttachment[];\n\tfileIds: string[];\n\tfiles: ResolveIORunnerPersistedEvidenceFile[];\n\terrors: string[];\n}\n\nexport function inferResolveIORunnerEvidenceContentType(fileName: string): string {\n\tconst normalized = String(fileName || '').trim().toLowerCase();\n\tif (normalized.endsWith('.png')) {\n\t\treturn 'image/png';\n\t}\n\tif (normalized.endsWith('.jpg') || normalized.endsWith('.jpeg')) {\n\t\treturn 'image/jpeg';\n\t}\n\tif (normalized.endsWith('.webp')) {\n\t\treturn 'image/webp';\n\t}\n\tif (normalized.endsWith('.zip')) {\n\t\treturn 'application/zip';\n\t}\n\tif (normalized.endsWith('.json')) {\n\t\treturn 'application/json';\n\t}\n\tif (normalized.endsWith('.txt') || normalized.endsWith('.log')) {\n\t\treturn 'text/plain; charset=utf-8';\n\t}\n\treturn 'application/octet-stream';\n}\n\nexport function buildResolveIORunnerEvidenceCid(filePath: string): string {\n\tconst baseName = path.basename(String(filePath || '').trim()) || 'runner-artifact';\n\tconst normalized = baseName\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z0-9._-]+/g, '-')\n\t\t.replace(/^-+|-+$/g, '')\n\t\t.slice(0, 80) || 'runner-artifact';\n\tconst digest = createHash('sha1').update(String(filePath || '')).digest('hex').slice(0, 12);\n\treturn `${normalized}-${digest}@resolveio-runner`;\n}\n\nexport function inferResolveIORunnerEvidenceCaption(fileNameOrPath: string): string {\n\tconst baseName = path.basename(String(fileNameOrPath || '').trim()).replace(/\\.[a-z0-9]+$/i, '');\n\tconst normalized = baseName\n\t\t.toLowerCase()\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/\\b\\d{4,}\\b/g, '')\n\t\t.replace(/\\s+/g, ' ')\n\t\t.trim();\n\tif (!normalized) {\n\t\treturn 'QA screenshot captured during validation.';\n\t}\n\tif (/\\bbefore\\b/.test(normalized)) {\n\t\treturn 'Before: the tested page is loaded at the start of the workflow.';\n\t}\n\tif (/\\bready\\b/.test(normalized) && /\\bimport\\b/.test(normalized)) {\n\t\treturn 'Ready to import: the uploaded data was accepted and is displayed for review before submission.';\n\t}\n\tif (/\\bsubmitted\\b|\\bresult\\b|\\bafter\\b|\\bcomplete\\b|\\bsuccess\\b|\\bverified\\b/.test(normalized)) {\n\t\treturn 'After submission: the workflow completed and the result confirms the change worked.';\n\t}\n\tif (/\\bdialog\\b|\\bmodal\\b|\\bpopup\\b/.test(normalized)) {\n\t\treturn 'Dialog: the tested prompt or modal is shown in the expected state.';\n\t}\n\tif (/\\bmobile\\b/.test(normalized)) {\n\t\treturn 'Mobile view: the tested workflow is shown at the mobile viewport.';\n\t}\n\tif (/\\bdesktop\\b|\\bwide\\b/.test(normalized)) {\n\t\treturn 'Desktop view: the tested workflow is shown at a full-width desktop viewport.';\n\t}\n\treturn baseName\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/\\b\\w/g, (letter) => letter.toUpperCase())\n\t\t.slice(0, 180);\n}\n\nexport function normalizeResolveIORunnerPersistedEvidenceFiles(value: any): ResolveIORunnerPersistedEvidenceFile[] {\n\tif (!Array.isArray(value)) {\n\t\treturn [];\n\t}\n\treturn value\n\t\t.map((item): ResolveIORunnerPersistedEvidenceFile | null => {\n\t\t\tconst fileId = String(item?.file_id || item?.id_file || item?._id || '').trim();\n\t\t\tif (!fileId) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tfile_id: fileId,\n\t\t\t\tfilename: String(item?.filename || item?.name || '').trim(),\n\t\t\t\tkey: String(item?.key || '').trim() || undefined,\n\t\t\t\tcontentType: String(item?.contentType || item?.content_type || '').trim() || undefined,\n\t\t\t\tcaption: String(item?.caption || '').trim() || undefined,\n\t\t\t\tcontent_hash: String(item?.content_hash || item?.hash || '').trim() || undefined,\n\t\t\t\tticket_url: String(item?.ticket_url || '').trim() || undefined\n\t\t\t};\n\t\t})\n\t\t.filter((item): item is ResolveIORunnerPersistedEvidenceFile => !!item);\n}\n\nexport function mergeResolveIORunnerEvidenceFileIds(...values: any[]): string[] {\n\tconst ids: string[] = [];\n\tconst seen = new Set<string>();\n\tconst push = (value: any) => {\n\t\tif (Array.isArray(value)) {\n\t\t\tvalue.forEach(push);\n\t\t\treturn;\n\t\t}\n\t\tconst id = String(value?.file_id || value?.id_file || value?._id || value || '').trim();\n\t\tif (!id || seen.has(id)) {\n\t\t\treturn;\n\t\t}\n\t\tseen.add(id);\n\t\tids.push(id);\n\t};\n\tvalues.forEach(push);\n\treturn ids;\n}\n\nfunction collectResolveIORunnerEvidenceText(value: any, output: string[]): void {\n\tif (value === null || value === undefined) {\n\t\treturn;\n\t}\n\tif (typeof value === 'string') {\n\t\toutput.push(value);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tvalue.forEach((entry) => collectResolveIORunnerEvidenceText(entry, output));\n\t\treturn;\n\t}\n\tif (typeof value === 'object') {\n\t\tObject.values(value).forEach((entry) => collectResolveIORunnerEvidenceText(entry, output));\n\t}\n}\n\nfunction normalizeArtifactCandidatePath(value: string): string {\n\treturn String(value || '')\n\t\t.trim()\n\t\t.replace(/[),.;:'\"]+$/g, '')\n\t\t.replace(/\\\\/g, '/');\n}\n\nfunction pathExists(filePath: string): boolean {\n\ttry {\n\t\treturn !!filePath && fs.existsSync(filePath) && fs.statSync(filePath).isFile();\n\t}\n\tcatch {\n\t\treturn false;\n\t}\n}\n\nfunction resolveArtifactCandidate(candidate: string, roots: string[]): string {\n\tconst normalized = normalizeArtifactCandidatePath(candidate);\n\tif (!normalized) {\n\t\treturn '';\n\t}\n\tif (path.isAbsolute(normalized)) {\n\t\treturn pathExists(normalized) ? normalized : '';\n\t}\n\tfor (const root of roots) {\n\t\tconst normalizedRoot = String(root || '').trim();\n\t\tif (!normalizedRoot) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst resolved = path.resolve(normalizedRoot, normalized);\n\t\tif (pathExists(resolved)) {\n\t\t\treturn resolved;\n\t\t}\n\t}\n\treturn '';\n}\n\nexport function collectResolveIORunnerEvidenceArtifactPaths(input: {\n\tevidence?: any;\n\tjob?: any;\n\troots?: string[];\n\tmaxFiles?: number;\n} = {}): string[] {\n\tconst values: string[] = [];\n\tcollectResolveIORunnerEvidenceText(input.evidence, values);\n\tconst job = input.job || {};\n\tcollectResolveIORunnerEvidenceText(job.responseSummary, values);\n\tcollectResolveIORunnerEvidenceText(job.lastVerificationSummary, values);\n\tcollectResolveIORunnerEvidenceText(job.lastRerunReason, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.agentNotes, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.supportArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.qaArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.artifacts?.qa_artifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.qa_artifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.supportQaArtifacts, values);\n\tcollectResolveIORunnerEvidenceText(job.runnerEvidenceArtifacts, values);\n\tif (Array.isArray(job.tasks)) {\n\t\tfor (const task of job.tasks) {\n\t\t\tcollectResolveIORunnerEvidenceText(task?.title, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.notes, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.artifacts, values);\n\t\t\tcollectResolveIORunnerEvidenceText(task?.evidence, values);\n\t\t}\n\t}\n\tif (Array.isArray(job.log)) {\n\t\tcollectResolveIORunnerEvidenceText(job.log.slice(-160), values);\n\t}\n\n\tconst roots = Array.from(new Set([\n\t\t...(input.roots || []),\n\t\tjob.workspacePath,\n\t\tjob.projectRoot && job.workspacePath ? path.join(job.workspacePath, job.projectRoot) : '',\n\t\tjob.projectDisplayPath && job.workspacePath ? path.join(job.workspacePath, job.projectDisplayPath) : '',\n\t\tjob.localPath\n\t].map((entry) => String(entry || '').trim()).filter(Boolean)));\n\tconst candidates: string[] = [];\n\tfor (const value of values) {\n\t\tconst text = String(value || '');\n\t\tfor (const match of text.matchAll(/((?:\\/tmp\\/|\\/var\\/|\\/Users\\/)[^\\s)'\"]+?\\.(?:png|jpe?g|webp|zip|json|txt|log))/gi)) {\n\t\t\tcandidates.push(match[1]);\n\t\t}\n\t\tfor (const match of text.matchAll(/(?:^|[\\s(\"'`])((?:(?:[\\w.-]+\\/)*qa-artifacts|qa-artifacts|test-results|playwright-report|\\.build-output)\\/[^\\s)'\"]+?\\.(?:png|jpe?g|webp|zip|json|txt|log))/gim)) {\n\t\t\tcandidates.push(match[1]);\n\t\t}\n\t}\n\tconst resolved: string[] = [];\n\tconst seen = new Set<string>();\n\tfor (const candidate of candidates) {\n\t\tconst filePath = resolveArtifactCandidate(candidate, roots);\n\t\tif (!filePath || seen.has(filePath)) {\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(filePath);\n\t\tresolved.push(filePath);\n\t\tif (resolved.length >= (input.maxFiles || 8)) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn resolved;\n}\n\nexport function toResolveIORunnerEvidenceAttachments(input: {\n\tevidence?: any;\n\tjob?: any;\n\troots?: string[];\n\tmaxFiles?: number;\n} = {}): ResolveIORunnerEvidenceAttachment[] {\n\treturn collectResolveIORunnerEvidenceArtifactPaths(input).map((filePath) => {\n\t\tconst filename = path.basename(filePath);\n\t\treturn {\n\t\t\tfilename,\n\t\t\tpath: filePath,\n\t\t\tcontentType: inferResolveIORunnerEvidenceContentType(filename),\n\t\t\tcid: buildResolveIORunnerEvidenceCid(filePath),\n\t\t\tcaption: inferResolveIORunnerEvidenceCaption(filename)\n\t\t};\n\t});\n}\n\nexport async function persistResolveIORunnerEvidenceArtifacts(\n\toptions: ResolveIORunnerPersistEvidenceOptions\n): Promise<ResolveIORunnerPersistEvidenceResult> {\n\tconst maxFiles = Math.max(1, options.maxFiles || 8);\n\tconst previousFiles = normalizeResolveIORunnerPersistedEvidenceFiles(options.previousFiles);\n\tconst existingByHash = new Map<string, ResolveIORunnerPersistedEvidenceFile>();\n\tfor (const file of previousFiles) {\n\t\tif (file.content_hash) {\n\t\t\texistingByHash.set(file.content_hash, file);\n\t\t}\n\t}\n\tconst attachments = [\n\t\t...(options.attachments || []),\n\t\t...toResolveIORunnerEvidenceAttachments({\n\t\t\tevidence: options.evidence,\n\t\t\tjob: options.job,\n\t\t\troots: options.roots,\n\t\t\tmaxFiles\n\t\t})\n\t];\n\tconst persistedFiles = [...previousFiles];\n\tconst fileIds = mergeResolveIORunnerEvidenceFileIds(options.existingFileIds, previousFiles.map((file) => file.file_id));\n\tconst errors: string[] = [];\n\tconst nextAttachments: ResolveIORunnerEvidenceAttachment[] = [];\n\tconst seenPaths = new Set<string>();\n\n\tfor (const attachment of attachments) {\n\t\tif (nextAttachments.length >= maxFiles) {\n\t\t\tbreak;\n\t\t}\n\t\tconst filePath = String(attachment?.path || '').trim();\n\t\tif (!filePath || seenPaths.has(filePath)) {\n\t\t\tcontinue;\n\t\t}\n\t\tseenPaths.add(filePath);\n\t\tconst filename = String(attachment?.filename || path.basename(filePath) || 'runner-qa-artifact.png').trim();\n\t\tconst contentType = String(attachment?.contentType || inferResolveIORunnerEvidenceContentType(filename)).trim();\n\t\tif (!pathExists(filePath)) {\n\t\t\tconst error = `${filename}: evidence file was not found before S3 upload.`;\n\t\t\terrors.push(error);\n\t\t\tnextAttachments.push({ ...attachment, filename, upload_error: error });\n\t\t\tcontinue;\n\t\t}\n\t\tconst stat = await fs.promises.stat(filePath);\n\t\tif (!stat.isFile() || stat.size <= 0) {\n\t\t\tconst error = `${filename}: evidence file was empty before S3 upload.`;\n\t\t\terrors.push(error);\n\t\t\tnextAttachments.push({ ...attachment, filename, upload_error: error });\n\t\t\tcontinue;\n\t\t}\n\t\tconst contentBuffer = await fs.promises.readFile(filePath);\n\t\tconst contentHash = createHash('sha1').update(new Uint8Array(contentBuffer)).digest('hex');\n\t\tconst existing = existingByHash.get(contentHash);\n\t\tif (existing) {\n\t\t\tfileIds.push(existing.file_id);\n\t\t\tnextAttachments.push({\n\t\t\t\t...attachment,\n\t\t\t\tfilename,\n\t\t\t\tfile_id: existing.file_id,\n\t\t\t\tkey: existing.key,\n\t\t\t\tcaption: attachment.caption || existing.caption || inferResolveIORunnerEvidenceCaption(filename),\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: options.ticketUrl || existing.ticket_url,\n\t\t\t\tuploaded_to_support_ticket: true\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst uploaded = await options.uploadFile({\n\t\t\t\tfilename,\n\t\t\t\tfilePath,\n\t\t\t\tcontentType,\n\t\t\t\tsize: stat.size,\n\t\t\t\tcontentBuffer,\n\t\t\t\tcontentHash\n\t\t\t});\n\t\t\tconst fileId = String(uploaded?.file_id || uploaded?.id_file || uploaded?._id || '').trim();\n\t\t\tif (!fileId) {\n\t\t\t\tthrow new Error('artifact upload returned no file id');\n\t\t\t}\n\t\t\tconst persisted: ResolveIORunnerPersistedEvidenceFile = {\n\t\t\t\tfile_id: fileId,\n\t\t\t\tfilename: String(uploaded?.filename || uploaded?.name || filename).trim() || filename,\n\t\t\t\tkey: String(uploaded?.key || '').trim() || undefined,\n\t\t\t\tcontentType,\n\t\t\t\tcaption: String(attachment?.caption || '').trim() || inferResolveIORunnerEvidenceCaption(filename),\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: String(options.ticketUrl || '').trim() || undefined\n\t\t\t};\n\t\t\tpersistedFiles.push(persisted);\n\t\t\texistingByHash.set(contentHash, persisted);\n\t\t\tfileIds.push(fileId);\n\t\t\tnextAttachments.push({\n\t\t\t\t...attachment,\n\t\t\t\tfilename,\n\t\t\t\tfile_id: fileId,\n\t\t\t\tkey: persisted.key,\n\t\t\t\tcaption: persisted.caption,\n\t\t\t\tcontent_hash: contentHash,\n\t\t\t\tticket_url: persisted.ticket_url,\n\t\t\t\tuploaded_to_support_ticket: true\n\t\t\t});\n\t\t}\n\t\tcatch (error) {\n\t\t\tconst message = `${filename}: ${(error as Error)?.message || error}`;\n\t\t\terrors.push(message);\n\t\t\tnextAttachments.push({ ...attachment, filename, content_hash: contentHash, upload_error: message });\n\t\t}\n\t}\n\n\treturn {\n\t\tattachments: nextAttachments,\n\t\tfileIds: mergeResolveIORunnerEvidenceFileIds(fileIds),\n\t\tfiles: persistedFiles,\n\t\terrors\n\t};\n}\n"]}
|