@resolveio/server-lib 22.3.100 → 22.3.102
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/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/public_api.js +1 -0
- package/public_api.js.map +1 -1
- package/util/ai-runner-qa-tools.js +60 -2
- package/util/ai-runner-qa-tools.js.map +1 -1
- package/util/aicoder-runner-v6.d.ts +168 -0
- package/util/aicoder-runner-v6.js +347 -0
- package/util/aicoder-runner-v6.js.map +1 -0
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export * from './util/ai-qa-policy';
|
|
|
94
94
|
export * from './util/ai-runner-artifacts';
|
|
95
95
|
export * from './util/ai-runner-qa-auth';
|
|
96
96
|
export * from './util/ai-runner-qa-tools';
|
|
97
|
+
export * from './util/aicoder-runner-v6';
|
|
97
98
|
export * from './util/runner-process-janitor';
|
|
98
99
|
export * from './util/support-runner-v5';
|
|
99
100
|
export * from './util/tokenizer';
|
package/public_api.js
CHANGED
|
@@ -110,6 +110,7 @@ __exportStar(require("./util/ai-qa-policy"), exports);
|
|
|
110
110
|
__exportStar(require("./util/ai-runner-artifacts"), exports);
|
|
111
111
|
__exportStar(require("./util/ai-runner-qa-auth"), exports);
|
|
112
112
|
__exportStar(require("./util/ai-runner-qa-tools"), exports);
|
|
113
|
+
__exportStar(require("./util/aicoder-runner-v6"), exports);
|
|
113
114
|
__exportStar(require("./util/runner-process-janitor"), exports);
|
|
114
115
|
__exportStar(require("./util/support-runner-v5"), exports);
|
|
115
116
|
__exportStar(require("./util/tokenizer"), exports);
|
package/public_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,uEAAqD;AACrD,uEAAqD;AACrD,8EAA4D;AAC5D,qFAAmE;AACnE,oFAAkE;AAClE,oFAAkE;AAClE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wC;AACxC,gDAA8B;AAC9B,kEAAgD;AAChD,sDAAoC;AACpC,6DAA2C;AAC3C,2DAAyC;AACzC,4DAA0C;AAC1C,gEAA8C;AAC9C,2DAAyC;AACzC,mDAAiC","file":"public_api.js","sourcesContent":["export * from './collections/app-status.collection';\nexport * from './collections/app-setting.collection';\nexport * from './ai/resolveio-platform-intelligence';\nexport * from './ai/resolveio-platform-intelligence-memory';\nexport * from './ai/resolveio-platform-intelligence-memory-corpus';\nexport * from './collections/ai-terminal-issue-report.collection';\nexport * from './collections/ai-terminal-conversation.collection';\nexport * from './collections/ai-terminal-message.collection';\nexport * from './collections/counter.collection';\nexport * from './collections/customer-portal-password.collection';\nexport * from './collections/customer-notification.collection';\nexport * from './collections/communication-metric.collection';\nexport * from './collections/cron-job-history.collection';\nexport * from './collections/cron-job.collection';\nexport * from './collections/email-history.collection';\nexport * from './collections/email-verified.collection';\nexport * from './collections/file.collection';\nexport * from './collections/flag-update.collection';\nexport * from './collections/flag.collection';\nexport * from './collections/log-method-latency.collection';\nexport * from './collections/log-subscription.collection';\nexport * from './collections/log.collection';\nexport * from './collections/logged-in-users.collection';\nexport * from './collections/monitor-cpu.collection';\nexport * from './collections/monitor-function.collection';\nexport * from './collections/monitor-memory.collection';\nexport * from './collections/monitor-mongo.collection';\nexport * from './collections/notification.collection';\nexport * from './collections/openai-usage-ledger.collection';\nexport * from './collections/report-builder-library.collection';\nexport * from './collections/report-builder-report.collection';\nexport * from './collections/user-group.collection';\nexport * from './collections/user-guide.collection';\nexport * from './collections/user.collection';\nexport * from './managers/mongo.manager';\nexport * from './managers/error-auto-fix.manager';\nexport * from './managers/ai-assistant-codex-manager.manager';\nexport * from './managers/slow-query-verifier.manager';\nexport * from './managers/slow-query.manager';\nexport * from './managers/customer-notification-content.manager';\nexport * from './managers/diagnostic-manager-bootstrap';\nexport * from './models/app-status.model';\nexport * from './models/app-setting.model';\nexport * from './models/ai-terminal-issue-report.model';\nexport * from './models/ai-terminal-conversation.model';\nexport * from './models/ai-terminal-message.model';\nexport * from './models/billing-logged-in-users.model';\nexport * from './models/collection-document.model';\nexport * from './models/communication-metric.model';\nexport * from './models/counter.model';\nexport * from './models/customer-portal-password.model';\nexport * from './models/customer-notification.model';\nexport * from './models/cron-job-history.model';\nexport * from './models/cron-job.model';\nexport * from './models/dialog.model';\nexport * from './models/email-history.model';\nexport * from './models/email-verified.model';\nexport * from './models/file.model';\nexport * from './models/flag-update.model';\nexport * from './models/flag.model';\nexport * from './models/log-method-latency.model';\nexport * from './models/log-subscription.model';\nexport * from './models/log.model';\nexport * from './models/logged-in-users.model';\nexport * from './models/method-response.model';\nexport * from './models/method.model';\nexport * from './models/monitor-cpu.model';\nexport * from './models/monitor-memory.model';\nexport * from './models/monitor-mongo.model';\nexport * from './models/notification.model';\nexport * from './models/openai-usage-ledger.model';\nexport * from './models/pagination.model';\nexport * from './models/permission.model';\nexport * from './models/report-builder-library.model';\nexport * from './models/report-builder-report.model';\nexport * from './models/report-builder.model';\nexport * from './models/select-data-label.model';\nexport * from './models/server-message.model';\nexport * from './models/subscription.model';\nexport * from './models/support-ticket.model';\nexport * from './models/user-group.model';\nexport * from './models/user-guide.model';\nexport * from './models/user.model';\nexport * from './types/error-report';\nexport * from './types/slow-query-report';\nexport * from './managers/openai-usage-ledger.manager';\nexport * from './managers/communication-metric.manager';\nexport * from './resolveio-server-app';\nexport * from './services/openai-client';\nexport * from './services/codex-client';\nexport * from './util/common';\nexport * from './util/customer-portal-password';\nexport * from './util/ai-qa-policy';\nexport * from './util/ai-runner-artifacts';\nexport * from './util/ai-runner-qa-auth';\nexport * from './util/ai-runner-qa-tools';\nexport * from './util/runner-process-janitor';\nexport * from './util/support-runner-v5';\nexport * from './util/tokenizer';\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/public_api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sEAAoD;AACpD,uEAAqD;AACrD,uEAAqD;AACrD,8EAA4D;AAC5D,qFAAmE;AACnE,oF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AACvC,2DAAyC;AACzC,0DAAwC;AACxC,gDAA8B;AAC9B,kEAAgD;AAChD,sDAAoC;AACpC,6DAA2C;AAC3C,2DAAyC;AACzC,4DAA0C;AAC1C,2DAAyC;AACzC,gEAA8C;AAC9C,2DAAyC;AACzC,mDAAiC","file":"public_api.js","sourcesContent":["export * from './collections/app-status.collection';\nexport * from './collections/app-setting.collection';\nexport * from './ai/resolveio-platform-intelligence';\nexport * from './ai/resolveio-platform-intelligence-memory';\nexport * from './ai/resolveio-platform-intelligence-memory-corpus';\nexport * from './collections/ai-terminal-issue-report.collection';\nexport * from './collections/ai-terminal-conversation.collection';\nexport * from './collections/ai-terminal-message.collection';\nexport * from './collections/counter.collection';\nexport * from './collections/customer-portal-password.collection';\nexport * from './collections/customer-notification.collection';\nexport * from './collections/communication-metric.collection';\nexport * from './collections/cron-job-history.collection';\nexport * from './collections/cron-job.collection';\nexport * from './collections/email-history.collection';\nexport * from './collections/email-verified.collection';\nexport * from './collections/file.collection';\nexport * from './collections/flag-update.collection';\nexport * from './collections/flag.collection';\nexport * from './collections/log-method-latency.collection';\nexport * from './collections/log-subscription.collection';\nexport * from './collections/log.collection';\nexport * from './collections/logged-in-users.collection';\nexport * from './collections/monitor-cpu.collection';\nexport * from './collections/monitor-function.collection';\nexport * from './collections/monitor-memory.collection';\nexport * from './collections/monitor-mongo.collection';\nexport * from './collections/notification.collection';\nexport * from './collections/openai-usage-ledger.collection';\nexport * from './collections/report-builder-library.collection';\nexport * from './collections/report-builder-report.collection';\nexport * from './collections/user-group.collection';\nexport * from './collections/user-guide.collection';\nexport * from './collections/user.collection';\nexport * from './managers/mongo.manager';\nexport * from './managers/error-auto-fix.manager';\nexport * from './managers/ai-assistant-codex-manager.manager';\nexport * from './managers/slow-query-verifier.manager';\nexport * from './managers/slow-query.manager';\nexport * from './managers/customer-notification-content.manager';\nexport * from './managers/diagnostic-manager-bootstrap';\nexport * from './models/app-status.model';\nexport * from './models/app-setting.model';\nexport * from './models/ai-terminal-issue-report.model';\nexport * from './models/ai-terminal-conversation.model';\nexport * from './models/ai-terminal-message.model';\nexport * from './models/billing-logged-in-users.model';\nexport * from './models/collection-document.model';\nexport * from './models/communication-metric.model';\nexport * from './models/counter.model';\nexport * from './models/customer-portal-password.model';\nexport * from './models/customer-notification.model';\nexport * from './models/cron-job-history.model';\nexport * from './models/cron-job.model';\nexport * from './models/dialog.model';\nexport * from './models/email-history.model';\nexport * from './models/email-verified.model';\nexport * from './models/file.model';\nexport * from './models/flag-update.model';\nexport * from './models/flag.model';\nexport * from './models/log-method-latency.model';\nexport * from './models/log-subscription.model';\nexport * from './models/log.model';\nexport * from './models/logged-in-users.model';\nexport * from './models/method-response.model';\nexport * from './models/method.model';\nexport * from './models/monitor-cpu.model';\nexport * from './models/monitor-memory.model';\nexport * from './models/monitor-mongo.model';\nexport * from './models/notification.model';\nexport * from './models/openai-usage-ledger.model';\nexport * from './models/pagination.model';\nexport * from './models/permission.model';\nexport * from './models/report-builder-library.model';\nexport * from './models/report-builder-report.model';\nexport * from './models/report-builder.model';\nexport * from './models/select-data-label.model';\nexport * from './models/server-message.model';\nexport * from './models/subscription.model';\nexport * from './models/support-ticket.model';\nexport * from './models/user-group.model';\nexport * from './models/user-guide.model';\nexport * from './models/user.model';\nexport * from './types/error-report';\nexport * from './types/slow-query-report';\nexport * from './managers/openai-usage-ledger.manager';\nexport * from './managers/communication-metric.manager';\nexport * from './resolveio-server-app';\nexport * from './services/openai-client';\nexport * from './services/codex-client';\nexport * from './util/common';\nexport * from './util/customer-portal-password';\nexport * from './util/ai-qa-policy';\nexport * from './util/ai-runner-artifacts';\nexport * from './util/ai-runner-qa-auth';\nexport * from './util/ai-runner-qa-tools';\nexport * from './util/aicoder-runner-v6';\nexport * from './util/runner-process-janitor';\nexport * from './util/support-runner-v5';\nexport * from './util/tokenizer';\n"]}
|
|
@@ -1107,6 +1107,9 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1107
1107
|
' if (existing && shouldAutoDiscoverAssetContext() && !(existing.selected && existing.selected.qa_asset_context)) {',
|
|
1108
1108
|
' return;',
|
|
1109
1109
|
' }',
|
|
1110
|
+
' if (existing && shouldAutoDiscoverProductionInterchangeablesContext() && !(existing.selected && existing.selected.qa_production_interchangeables_context)) {',
|
|
1111
|
+
' return;',
|
|
1112
|
+
' }',
|
|
1110
1113
|
' if (["pass", "needs-data"].includes(status)) {',
|
|
1111
1114
|
' normalizeCoverageMatrixFromLiveSeed(existing);',
|
|
1112
1115
|
' const preserved = { ...existing, reused_existing: true, reuse_reason: reason, checked_at: new Date().toISOString() };',
|
|
@@ -1258,6 +1261,11 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1258
1261
|
' return /\\b(asset|assets|unit|units|equipment|current\\s+location|location\\s+name|location\\s+names|default\\s+yard|yard)\\b/i.test(text);',
|
|
1259
1262
|
'}',
|
|
1260
1263
|
'',
|
|
1264
|
+
'function shouldAutoDiscoverProductionInterchangeablesContext() {',
|
|
1265
|
+
' const text = readSeedHintText();',
|
|
1266
|
+
' return /\\b(interchangeable|interchangeables|mass\\s+update|update\\s+interchangeables|from\\s+chemical|to\\s+chemical|treatment\\s+plan|treatment\\s+plans|production\\s+location)\\b/i.test(text);',
|
|
1267
|
+
'}',
|
|
1268
|
+
'',
|
|
1261
1269
|
'function extractAssetIdentifiers() {',
|
|
1262
1270
|
' const text = readSeedHintText();',
|
|
1263
1271
|
' const identifiers = new Set();',
|
|
@@ -1513,6 +1521,55 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1513
1521
|
' return [...bols, ...productionRoutes, ...productionDeliveries, ...truckTreatingDeliveries, ...copiedTreatmentPlans];',
|
|
1514
1522
|
'}',
|
|
1515
1523
|
'',
|
|
1524
|
+
'async function copyProductionInterchangeablesContext(sourceDb, targetDb, summary) {',
|
|
1525
|
+
' if (!shouldAutoDiscoverProductionInterchangeablesContext()) return [];',
|
|
1526
|
+
' const interchangeables = await copyQuery(sourceDb, targetDb, "chemical-interchangeables", { "id_chemicals.1": { $exists: true } }, summary, 12, { updatedAt: -1 });',
|
|
1527
|
+
' if (!interchangeables.length) {',
|
|
1528
|
+
' summary.notes.push("No live chemical-interchangeables records with multiple chemicals were available for Update Interchangeables QA.");',
|
|
1529
|
+
' return [];',
|
|
1530
|
+
' }',
|
|
1531
|
+
' const chemicalIds = unique(idValues(interchangeables, ["id_chemicals"]));',
|
|
1532
|
+
' const chemicals = await copyQuery(sourceDb, targetDb, "chemicals", { _id: { $in: chemicalIds }, types: "Finished Good" }, summary, 80, { name: 1 });',
|
|
1533
|
+
' const usableChemicalIds = unique(chemicals.map((doc) => doc._id));',
|
|
1534
|
+
' const items = await copyQuery(sourceDb, targetDb, "items", { $or: [{ id_chemical: { $in: usableChemicalIds } }, { _id: { $in: usableChemicalIds } }] }, summary, 120, { name: 1 });',
|
|
1535
|
+
' const itemIds = unique(items.map((doc) => doc._id));',
|
|
1536
|
+
' let treatmentPlans = await copyQuery(sourceDb, targetDb, "treatment-plans", { date_end: null, $or: [{ id_chemical: { $in: usableChemicalIds } }, { id_item: { $in: itemIds } }] }, summary, 120, { updatedAt: -1 });',
|
|
1537
|
+
' if (!treatmentPlans.length && usableChemicalIds.length) {',
|
|
1538
|
+
' treatmentPlans = await copyQuery(sourceDb, targetDb, "treatment-plans", { date_end: null, id_chemical: usableChemicalIds[0] }, summary, 40, { updatedAt: -1 });',
|
|
1539
|
+
' }',
|
|
1540
|
+
' const customerIds = unique(idValues(treatmentPlans, ["id_customer"]));',
|
|
1541
|
+
' const yardIds = unique(idValues(treatmentPlans, ["id_yard"]));',
|
|
1542
|
+
' const locationIds = unique(idValues(treatmentPlans, ["id_location"]));',
|
|
1543
|
+
' const wellGroupIds = unique(idValues(treatmentPlans, ["id_well_group"]));',
|
|
1544
|
+
' const tankIds = unique(collectNestedStringValues(treatmentPlans, ["id_tank"]));',
|
|
1545
|
+
' await copyByIds(sourceDb, targetDb, "customers", customerIds, summary, 80);',
|
|
1546
|
+
' await copyByIds(sourceDb, targetDb, "yards", yardIds, summary, 80);',
|
|
1547
|
+
' await copyByIds(sourceDb, targetDb, "production-locations", locationIds, summary, 120);',
|
|
1548
|
+
' await copyByIds(sourceDb, targetDb, "well-groups", wellGroupIds, summary, 120);',
|
|
1549
|
+
' await copyByIds(sourceDb, targetDb, "production-location-tanks", tankIds, summary, 120);',
|
|
1550
|
+
' if (yardIds.length) {',
|
|
1551
|
+
' const users = await targetDb.collection("users").find({}).project({ _id: 1, other: 1 }).limit(50).toArray().catch(() => []);',
|
|
1552
|
+
' for (const user of users) {',
|
|
1553
|
+
' const other = user && typeof user.other === "object" && user.other ? user.other : {};',
|
|
1554
|
+
' const nextYards = unique([...(Array.isArray(other.yards) ? other.yards : []), ...yardIds]);',
|
|
1555
|
+
' await targetDb.collection("users").updateOne({ _id: user._id }, { $set: { "other.yards": nextYards } });',
|
|
1556
|
+
' }',
|
|
1557
|
+
' if (users.length) summary.notes.push(`Added seeded Update Interchangeables yard ids to ${users.length} local QA user(s) so treatment-plan filters can return data.`);',
|
|
1558
|
+
' }',
|
|
1559
|
+
' summary.selected.qa_production_interchangeables_context = {',
|
|
1560
|
+
' interchangeable_ids: interchangeables.map((doc) => doc._id).filter(Boolean),',
|
|
1561
|
+
' chemical_ids: usableChemicalIds,',
|
|
1562
|
+
' item_ids: itemIds,',
|
|
1563
|
+
' treatment_plan_ids: treatmentPlans.map((doc) => doc._id).filter(Boolean),',
|
|
1564
|
+
' customer_ids: customerIds,',
|
|
1565
|
+
' yard_ids: yardIds,',
|
|
1566
|
+
' tank_ids: tankIds,',
|
|
1567
|
+
' browser_routes: { update_interchangeables: "/production-location/update-interchangeables" }',
|
|
1568
|
+
' };',
|
|
1569
|
+
' summary.notes.push(`Seeded Update Interchangeables context: ${interchangeables.length} interchangeable group(s), ${chemicals.length} chemical(s), ${items.length} active item(s), ${treatmentPlans.length} treatment plan(s).`);',
|
|
1570
|
+
' return [...interchangeables, ...chemicals, ...items, ...treatmentPlans];',
|
|
1571
|
+
'}',
|
|
1572
|
+
'',
|
|
1516
1573
|
'async function copyTicketAssetContext(sourceDb, targetDb, summary) {',
|
|
1517
1574
|
' if (!shouldAutoDiscoverAssetContext()) return [];',
|
|
1518
1575
|
' const assetIdentifiers = extractAssetIdentifiers();',
|
|
@@ -1717,6 +1774,7 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1717
1774
|
' summary.selected.seed_identifiers = identifiers;',
|
|
1718
1775
|
' const truckTreatingBolContextDocs = await copyTruckTreatingBolContext(sourceDb, targetDb, summary);',
|
|
1719
1776
|
' const ticketAssetContextDocs = await copyTicketAssetContext(sourceDb, targetDb, summary);',
|
|
1777
|
+
' const productionInterchangeablesContextDocs = await copyProductionInterchangeablesContext(sourceDb, targetDb, summary);',
|
|
1720
1778
|
' if (!includeBillingFixtures) {',
|
|
1721
1779
|
' summary.notes.push("Using live-context seed profile: billing dashboard fixtures are disabled because ticket context does not mention billing, invoices, taxes, inventory, pricing, surcharges, checkout, or pick tickets.");',
|
|
1722
1780
|
' await cleanupSyntheticBillingDashboardQaFixtures(targetDb, summary);',
|
|
@@ -1755,7 +1813,7 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1755
1813
|
' summary.notes.push("No live billable delivery or truck-treatment records matched the Billing Dashboard awaiting-invoice filters.");',
|
|
1756
1814
|
' }',
|
|
1757
1815
|
'',
|
|
1758
|
-
' const sourceDocs = [...truckTreatingBolContextDocs, ...ticketAssetContextDocs, ...productionDeliveries, ...truckTreatingDeliveries];',
|
|
1816
|
+
' const sourceDocs = [...truckTreatingBolContextDocs, ...ticketAssetContextDocs, ...productionInterchangeablesContextDocs, ...productionDeliveries, ...truckTreatingDeliveries];',
|
|
1759
1817
|
' const customerIds = idValues(sourceDocs, ["id_customer"]);',
|
|
1760
1818
|
' const locationIds = idValues(sourceDocs, ["id_location"]);',
|
|
1761
1819
|
' const wellGroupIds = idValues(sourceDocs, ["id_well_group"]);',
|
|
@@ -1811,7 +1869,7 @@ function buildResolveIORunnerQaLiveDataSeederScript() {
|
|
|
1811
1869
|
' ] }, summary, 120, { date: -1, updatedAt: -1 });',
|
|
1812
1870
|
' }',
|
|
1813
1871
|
'',
|
|
1814
|
-
' summary.ready = truckTreatingBolContextDocs.length > 0 || ticketAssetContextDocs.length > 0 || productionDeliveries.length > 0 || truckTreatingDeliveries.length > 0;',
|
|
1872
|
+
' summary.ready = truckTreatingBolContextDocs.length > 0 || ticketAssetContextDocs.length > 0 || productionInterchangeablesContextDocs.length > 0 || productionDeliveries.length > 0 || truckTreatingDeliveries.length > 0;',
|
|
1815
1873
|
' return summary;',
|
|
1816
1874
|
'}',
|
|
1817
1875
|
'',
|