@resolveio/server-lib 22.3.77 → 22.3.79
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/methods/ai-terminal.d.ts +0 -1
- package/methods/ai-terminal.js +12 -396
- package/methods/ai-terminal.js.map +1 -1
- package/package.json +1 -1
- package/util/ai-qa-policy.js +1 -1
- package/util/ai-qa-policy.js.map +1 -1
- package/util/ai-runner-qa-auth.js +17 -0
- package/util/ai-runner-qa-auth.js.map +1 -1
- package/util/ai-runner-qa-tools.js +24 -0
- package/util/ai-runner-qa-tools.js.map +1 -1
package/methods/ai-terminal.d.ts
CHANGED
|
@@ -149,7 +149,6 @@ type AssistantMongoDirective = {
|
|
|
149
149
|
payload: Record<string, any> | null;
|
|
150
150
|
cleaned: string;
|
|
151
151
|
rawLine: string;
|
|
152
|
-
metadata?: Record<string, any>;
|
|
153
152
|
};
|
|
154
153
|
type AssistantRequestType = 'data' | 'navigation' | 'feature_info' | 'bug_issue' | 'mixed' | 'unknown';
|
|
155
154
|
type AssistantRequestTypeSource = 'heuristic' | 'planner' | 'merged';
|
package/methods/ai-terminal.js
CHANGED
|
@@ -1901,7 +1901,7 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
1901
1901
|
insertResult = _d.sent();
|
|
1902
1902
|
assistantMessageId = (insertResult === null || insertResult === void 0 ? void 0 : insertResult._id) || (insertResult === null || insertResult === void 0 ? void 0 : insertResult.insertedId);
|
|
1903
1903
|
enqueueAssistantCodexRun(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1904
|
-
var runStart, fastModeEnabled, alwaysAllowProbeEnabled, plannerEnabled, runBudgetMs, assistantMongoMaxTimeMs, assistantSystemPrompt, runDeadlineMs, steps, recordStep,
|
|
1904
|
+
var runStart, fastModeEnabled, alwaysAllowProbeEnabled, plannerEnabled, runBudgetMs, assistantMongoMaxTimeMs, assistantSystemPrompt, runDeadlineMs, steps, recordStep, progressTracker, streamProgress, remainingRunBudgetMs, hasRunBudget, applyCodexStageBudget, assistantContent, toolResult, assistantDebug, directiveSource, requestClassification, dataQuestion, lastDirective, heuristicDirectivePrecomputed, usedDeterministicHeuristicFastPath, requestedTimeGrain, requestedBreakdownDimensions, enforceDatedDirective, enforceGroupedDirective, datedDirectiveRetryUsed, datedDirectiveResolved, toolResponseDebug, toolError, toolTelemetry, termHints, collectionHints, fieldHints, schemaHints, methodHints, publicationHints, collectionTokenization, collectionRanking, collectionSelection, collectionOverride, collectionNames, plannerUsed, plannerSkipReason, plannerOutput, plannerRaw, timingBreakdown, codexUsage, accumulateCodexUsage, contextRoute, contextMode, hintSeed, termExpansion, hintText, baseTokens, expandedTokens, baseWeights, expandedWeights, dbName, db, surfaceHints, _a, allowedRoutes, rankedAllowedRoutes, routeHints, appCollectionHints, rankedCollectionHints, rankedCollections, hintCollections, schemaHintCollections, assistantContext, hasDeterministicHeuristicFastPath, prompt_1, workspaceRoot, codexConfig, runOptions, plannerRunOptions, shouldRunPlanner, plannerBudgetAvailable, plannerPrompt, plannerStart, _b, preferListDirective, directiveStyleHint, directivePromptMode, responseText, directiveText, directive, heuristicDirectiveFastPath, directivePrompt, directiveStart, forcedDirective, _c, initialStart, extractedDirective, error_2, directivePrompt, forcedStart, forcedDirective, _d, strictDirectivePrompt, strictStart, strictDirectiveText, strictDirective, strictDirectiveIsDated, shouldUseStrictDirective, _e, guardDirectivePrompt, guardStart, guardDirectiveText, guardDirective, _f, groupedDirectivePrompt, groupedStart, groupedDirectiveText, groupedDirective, _g, heuristicDirective, requestedCollection, allowCollectionOverride, cleanedResponseText, deniedModuleByIntent, permissionLabel, effectiveDirective, rankedCollections_1, directiveHintsBase_1, buildToolRequestForDirective, executionDirective, probeFieldHints, aggregateProbeDisabled, probeEnabled, probeBudgetAllowed, probeDirective, probeRequest, probeStart, probeResponse, _h, probeDurationMs, probeRowCount, probeRewrite, probeError_1, probeDurationMs, probeErrorMessage, toolRequest, requestedToolCollection, toolStart, toolResponse, _j, toolDurationMs, toolPayload, resolvedToolCollection, zeroRowResult, followupCodexEnabled, skipFollowupCodex, followupPrompt, followupStart, followupText, _k, error_3, errorMessage, existingFinal, error_4, runBudgetExceeded, includeToolExecutionTelemetry, toolExecutionTelemetry, finishedAt, finalNow, finishedAt, codexMs, draftingMs, finalMetadata, finalUsage, usageClientId, usageError_1, finalAssistantDoc, setPayload, finalizeError_1, failedAt, fallbackContent, failureMetadata, persistError_1, _l;
|
|
1905
1905
|
var _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21;
|
|
1906
1906
|
return __generator(this, function (_22) {
|
|
1907
1907
|
switch (_22.label) {
|
|
@@ -1941,10 +1941,8 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
1941
1941
|
details: details
|
|
1942
1942
|
});
|
|
1943
1943
|
};
|
|
1944
|
-
requestClassification = classifyAssistantRequestType(message);
|
|
1945
|
-
dataQuestion = requestClassification.dataQuestion;
|
|
1946
1944
|
progressTracker = createAssistantProgressTracker(assistantMessageId, initialProgress);
|
|
1947
|
-
streamProgress = createAssistantStreamProgressHandler(progressTracker
|
|
1945
|
+
streamProgress = createAssistantStreamProgressHandler(progressTracker);
|
|
1948
1946
|
remainingRunBudgetMs = function () {
|
|
1949
1947
|
if (!runDeadlineMs) {
|
|
1950
1948
|
return null;
|
|
@@ -1979,6 +1977,8 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
1979
1977
|
toolResult = null;
|
|
1980
1978
|
assistantDebug = null;
|
|
1981
1979
|
directiveSource = 'none';
|
|
1980
|
+
requestClassification = classifyAssistantRequestType(message);
|
|
1981
|
+
dataQuestion = requestClassification.dataQuestion;
|
|
1982
1982
|
lastDirective = null;
|
|
1983
1983
|
heuristicDirectivePrecomputed = null;
|
|
1984
1984
|
usedDeterministicHeuristicFastPath = false;
|
|
@@ -2609,22 +2609,6 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
2609
2609
|
if (!((directive === null || directive === void 0 ? void 0 : directive.payload) && AI_ASSISTANT_TOOL_MAX_STEPS > 0)) return [3 /*break*/, 66];
|
|
2610
2610
|
effectiveDirective = collectionOverride
|
|
2611
2611
|
? __assign(__assign({}, directive), { payload: __assign(__assign({}, (directive.payload || {})), { collection: collectionOverride.to }) }) : directive;
|
|
2612
|
-
effectiveDirectiveMetadata = effectiveDirective.metadata && typeof effectiveDirective.metadata === 'object'
|
|
2613
|
-
? effectiveDirective.metadata
|
|
2614
|
-
: {};
|
|
2615
|
-
directiveAcknowledgementText = normalizeOptionalString(effectiveDirectiveMetadata.acknowledgementText);
|
|
2616
|
-
directiveProgressMessages = Array.isArray(effectiveDirectiveMetadata.progress)
|
|
2617
|
-
? effectiveDirectiveMetadata.progress.map(function (entry) { return normalizeOptionalString(entry); }).filter(Boolean)
|
|
2618
|
-
: [];
|
|
2619
|
-
deterministicDataIntentDirective = isAssistantAppDataIntentHeuristicDirective(effectiveDirective);
|
|
2620
|
-
if (deterministicDataIntentDirective) {
|
|
2621
|
-
toolTelemetry.intentId = normalizeOptionalString(effectiveDirectiveMetadata.intentId) || undefined;
|
|
2622
|
-
toolTelemetry.recipeUsed = normalizeOptionalString(effectiveDirectiveMetadata.recipeUsed) || undefined;
|
|
2623
|
-
toolTelemetry.acknowledgementText = directiveAcknowledgementText || undefined;
|
|
2624
|
-
if (!collectionOverride) {
|
|
2625
|
-
toolTelemetry.overrideBlockedReason = 'deterministic_data_intent_preserved_collection';
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2628
2612
|
rankedCollections_1 = Array.isArray(collectionRanking === null || collectionRanking === void 0 ? void 0 : collectionRanking.ranked)
|
|
2629
2613
|
? collectionRanking.ranked
|
|
2630
2614
|
.map(function (entry) { return normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.name); })
|
|
@@ -2644,18 +2628,9 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
2644
2628
|
deadlineMs: runDeadlineMs || undefined,
|
|
2645
2629
|
maxTimeMS: assistantMongoMaxTimeMs
|
|
2646
2630
|
};
|
|
2647
|
-
if (isAssistantAppDataIntentHeuristicDirective(value)) {
|
|
2648
|
-
request.__assistantRetryState = __assign(__assign({}, (request.__assistantRetryState || {})), { disableCrossCollectionRetry: true, rootCollection: normalizeOptionalString(request.collection) || undefined });
|
|
2649
|
-
}
|
|
2650
2631
|
return request;
|
|
2651
2632
|
};
|
|
2652
|
-
|
|
2653
|
-
progressTracker.push(directiveAcknowledgementText);
|
|
2654
|
-
}
|
|
2655
|
-
else {
|
|
2656
|
-
progressTracker.push(deterministicDataIntentDirective ? 'Pulling the requested data' : 'Grabbing Data');
|
|
2657
|
-
}
|
|
2658
|
-
directiveProgressMessages.slice(0, 2).forEach(function (messageText) { return progressTracker.push(messageText); });
|
|
2633
|
+
progressTracker.push('Grabbing Data');
|
|
2659
2634
|
executionDirective = effectiveDirective;
|
|
2660
2635
|
probeFieldHints = [];
|
|
2661
2636
|
_22.label = 39;
|
|
@@ -2673,9 +2648,7 @@ function executeAiAssistantCodexRun(payload, context) {
|
|
|
2673
2648
|
};
|
|
2674
2649
|
return [3 /*break*/, 63];
|
|
2675
2650
|
case 40:
|
|
2676
|
-
aggregateProbeDisabled = executionDirective.type === 'aggregate'
|
|
2677
|
-
&& !alwaysAllowProbeEnabled
|
|
2678
|
-
&& !isAssistantAppDataIntentHeuristicDirective(executionDirective);
|
|
2651
|
+
aggregateProbeDisabled = executionDirective.type === 'aggregate' && !alwaysAllowProbeEnabled;
|
|
2679
2652
|
probeEnabled = AI_ASSISTANT_TOOL_MAX_STEPS > 1 && !aggregateProbeDisabled;
|
|
2680
2653
|
probeBudgetAllowed = alwaysAllowProbeEnabled
|
|
2681
2654
|
|| hasRunBudget('Grabbing Data: probe', AI_ASSISTANT_MONGO_MIN_STAGE_BUDGET_MS);
|
|
@@ -6037,10 +6010,6 @@ function buildAssistantToolExecutionTelemetrySnapshot(telemetry) {
|
|
|
6037
6010
|
mode: (telemetry === null || telemetry === void 0 ? void 0 : telemetry.mode) || 'single_step',
|
|
6038
6011
|
always_allow_probe: (telemetry === null || telemetry === void 0 ? void 0 : telemetry.alwaysAllowProbe) === true,
|
|
6039
6012
|
permission_denied: (telemetry === null || telemetry === void 0 ? void 0 : telemetry.permissionDenied) === true ? true : undefined,
|
|
6040
|
-
intentId: normalizeOptionalString(telemetry === null || telemetry === void 0 ? void 0 : telemetry.intentId) || undefined,
|
|
6041
|
-
acknowledgementText: normalizeOptionalString(telemetry === null || telemetry === void 0 ? void 0 : telemetry.acknowledgementText) || undefined,
|
|
6042
|
-
recipeUsed: normalizeOptionalString(telemetry === null || telemetry === void 0 ? void 0 : telemetry.recipeUsed) || undefined,
|
|
6043
|
-
overrideBlockedReason: normalizeOptionalString(telemetry === null || telemetry === void 0 ? void 0 : telemetry.overrideBlockedReason) || undefined,
|
|
6044
6013
|
probe: probe ? {
|
|
6045
6014
|
attempted: probe.attempted === true,
|
|
6046
6015
|
succeeded: probe.succeeded === true ? true : undefined,
|
|
@@ -6681,253 +6650,15 @@ function isAssistantSchemaHoursHeuristicDirective(directive) {
|
|
|
6681
6650
|
var rawLine = normalizeOptionalString(directive === null || directive === void 0 ? void 0 : directive.rawLine).toLowerCase();
|
|
6682
6651
|
return rawLine.includes('heuristic_agg(schema-hours-user-time)');
|
|
6683
6652
|
}
|
|
6684
|
-
function isAssistantAppDataIntentHeuristicDirective(directive) {
|
|
6685
|
-
var rawLine = normalizeOptionalString(directive === null || directive === void 0 ? void 0 : directive.rawLine).toLowerCase();
|
|
6686
|
-
return rawLine.includes('heuristic_agg(app-data-intent:') || rawLine.includes('heuristic_read(app-data-intent:');
|
|
6687
|
-
}
|
|
6688
|
-
function scoreAssistantAppDataIntent(messageText, intent) {
|
|
6689
|
-
if ((intent.excludeTerms || []).some(function (term) { return containsAssistantHeuristicTerm(messageText, term); })) {
|
|
6690
|
-
return 0;
|
|
6691
|
-
}
|
|
6692
|
-
return (intent.terms || []).reduce(function (score, term) {
|
|
6693
|
-
if (!containsAssistantHeuristicTerm(messageText, term)) {
|
|
6694
|
-
return score;
|
|
6695
|
-
}
|
|
6696
|
-
return score + (term.includes(' ') ? 4 : 1);
|
|
6697
|
-
}, 0);
|
|
6698
|
-
}
|
|
6699
|
-
function selectAssistantAppDataIntent(message, collectionNames, appId) {
|
|
6700
|
-
var text = normalizeOptionalString(message).toLowerCase();
|
|
6701
|
-
if (!text) {
|
|
6702
|
-
return null;
|
|
6703
|
-
}
|
|
6704
|
-
var availableNames = new Set((Array.isArray(collectionNames) ? collectionNames : []).map(function (value) { return normalizeOptionalString(value); }).filter(Boolean));
|
|
6705
|
-
var profile = resolveAssistantAppHeuristicProfile(appId);
|
|
6706
|
-
var selected = null;
|
|
6707
|
-
profile.dataIntents.forEach(function (intent) {
|
|
6708
|
-
if (!(intent === null || intent === void 0 ? void 0 : intent.id) || !intent.collection) {
|
|
6709
|
-
return;
|
|
6710
|
-
}
|
|
6711
|
-
if (availableNames.size && !availableNames.has(intent.collection)) {
|
|
6712
|
-
return;
|
|
6713
|
-
}
|
|
6714
|
-
var score = scoreAssistantAppDataIntent(text, intent);
|
|
6715
|
-
if (score <= 0) {
|
|
6716
|
-
return;
|
|
6717
|
-
}
|
|
6718
|
-
if (!selected || score > selected.score) {
|
|
6719
|
-
selected = { intent: intent, score: score };
|
|
6720
|
-
}
|
|
6721
|
-
});
|
|
6722
|
-
return selected ? selected.intent : null;
|
|
6723
|
-
}
|
|
6724
|
-
function extractAssistantDataIntentCustomerText(message) {
|
|
6725
|
-
var value = normalizeOptionalString(message);
|
|
6726
|
-
if (!value) {
|
|
6727
|
-
return '';
|
|
6728
|
-
}
|
|
6729
|
-
value = value.replace(/\b(summarize|summary|show|list|give|pull|find|tell|me|about|of|the|a|an|and|amount|quantity|qty|total|totals|for|to|them|their|by)\b/gi, ' ');
|
|
6730
|
-
value = value.replace(/\b(work\s*orders?|wos?|jobs?|invoices?|invoice|billed|billing|revenue|charged|chemicals?|chemical|sent|shipped|shipment|shipments|delivered|planned|inventory|on\s+hand|stock|this\s+year|ytd|year\s+to\s+date|current\s+year)\b/gi, ' ');
|
|
6731
|
-
value = value.replace(/\b(last|past|current|completed|reviewed|closed)\b/gi, ' ');
|
|
6732
|
-
value = value.replace(/[^a-z0-9&.' -]+/gi, ' ');
|
|
6733
|
-
return normalizeOptionalString(value.replace(/\s+/g, ' '));
|
|
6734
|
-
}
|
|
6735
|
-
function resolveAssistantDataIntentDateWindow(message) {
|
|
6736
|
-
var text = normalizeOptionalString(message).toLowerCase();
|
|
6737
|
-
if (!/\b(this\s+year|ytd|year\s+to\s+date|current\s+year)\b/.test(text)) {
|
|
6738
|
-
return {};
|
|
6739
|
-
}
|
|
6740
|
-
var now = new Date();
|
|
6741
|
-
var year = now.getUTCFullYear();
|
|
6742
|
-
return {
|
|
6743
|
-
start: new Date(Date.UTC(year, 0, 1, 0, 0, 0, 0)).toISOString(),
|
|
6744
|
-
end: new Date(Date.UTC(year, now.getUTCMonth(), now.getUTCDate(), 23, 59, 59, 999)).toISOString(),
|
|
6745
|
-
year: year
|
|
6746
|
-
};
|
|
6747
|
-
}
|
|
6748
|
-
function buildAssistantDataIntentAcknowledgement(intent, customerText, dateWindow) {
|
|
6749
|
-
var customer = customerText || 'the requested customer';
|
|
6750
|
-
var yearText = dateWindow.year ? " for ".concat(dateWindow.year) : '';
|
|
6751
|
-
if (intent.id === 'snf_job_chemical_shipments') {
|
|
6752
|
-
return "I understand you want a summary of chemicals sent to ".concat(customer, " jobs").concat(yearText, ". Let me pull the work-order shipment data for you.");
|
|
6753
|
-
}
|
|
6754
|
-
if (intent.id === 'snf_invoice_chemical_quantities') {
|
|
6755
|
-
return "I understand you want invoice and billed chemical details for ".concat(customer).concat(yearText, ". Let me pull the invoice data for you.");
|
|
6756
|
-
}
|
|
6757
|
-
if (intent.id === 'snf_planned_job_chemicals') {
|
|
6758
|
-
return "I understand you want planned chemicals for ".concat(customer, " jobs").concat(yearText, ". Let me pull the job setup data for you.");
|
|
6759
|
-
}
|
|
6760
|
-
return 'I understand the data you want. Let me pull the matching records for you.';
|
|
6761
|
-
}
|
|
6762
|
-
function buildAssistantDataIntentMatchStage(customerText, dateField, dateWindow, customerPaths) {
|
|
6763
|
-
var _a;
|
|
6764
|
-
var and = [];
|
|
6765
|
-
if (customerText) {
|
|
6766
|
-
and.push({
|
|
6767
|
-
$or: customerPaths.map(function (path) {
|
|
6768
|
-
var _a;
|
|
6769
|
-
return (_a = {},
|
|
6770
|
-
_a[path] = {
|
|
6771
|
-
$regex: customerText,
|
|
6772
|
-
$options: 'i'
|
|
6773
|
-
},
|
|
6774
|
-
_a);
|
|
6775
|
-
})
|
|
6776
|
-
});
|
|
6777
|
-
}
|
|
6778
|
-
if (dateField && dateWindow.start && dateWindow.end) {
|
|
6779
|
-
and.push((_a = {},
|
|
6780
|
-
_a[dateField] = {
|
|
6781
|
-
$gte: dateWindow.start,
|
|
6782
|
-
$lte: dateWindow.end
|
|
6783
|
-
},
|
|
6784
|
-
_a));
|
|
6785
|
-
}
|
|
6786
|
-
return and.length ? { $match: { $and: and } } : { $match: {} };
|
|
6787
|
-
}
|
|
6788
|
-
function buildAssistantAppDataIntentDirective(message, collectionNames, appId) {
|
|
6789
|
-
if (collectionNames === void 0) { collectionNames = []; }
|
|
6790
|
-
var intent = selectAssistantAppDataIntent(message, collectionNames, appId);
|
|
6791
|
-
if (!intent) {
|
|
6792
|
-
return null;
|
|
6793
|
-
}
|
|
6794
|
-
var customerText = extractAssistantDataIntentCustomerText(message);
|
|
6795
|
-
var dateWindow = resolveAssistantDataIntentDateWindow(message);
|
|
6796
|
-
var acknowledgementText = buildAssistantDataIntentAcknowledgement(intent, customerText, dateWindow);
|
|
6797
|
-
var progress = intent.progress.map(function (entry) {
|
|
6798
|
-
return entry
|
|
6799
|
-
.replace(/\{\{customer\}\}/g, customerText || 'the requested customer')
|
|
6800
|
-
.replace(/\{\{year\}\}/g, dateWindow.year ? String(dateWindow.year) : 'the requested date range');
|
|
6801
|
-
});
|
|
6802
|
-
var metadata = {
|
|
6803
|
-
intentId: intent.id,
|
|
6804
|
-
recipeUsed: intent.id,
|
|
6805
|
-
acknowledgementText: acknowledgementText,
|
|
6806
|
-
progress: progress,
|
|
6807
|
-
assumptions: intent.assumptions,
|
|
6808
|
-
fallbackCollections: intent.fallbackCollections
|
|
6809
|
-
};
|
|
6810
|
-
var basePayload = function (pipeline) { return ({
|
|
6811
|
-
collection: intent.collection,
|
|
6812
|
-
permissionView: intent.permissionView || resolveDefaultAssistantPermissionView(intent.collection),
|
|
6813
|
-
pipeline: pipeline,
|
|
6814
|
-
options: {
|
|
6815
|
-
allowDiskUse: true,
|
|
6816
|
-
limit: 20
|
|
6817
|
-
}
|
|
6818
|
-
}); };
|
|
6819
|
-
if (intent.id === 'snf_job_chemical_shipments') {
|
|
6820
|
-
var pipeline = [
|
|
6821
|
-
buildAssistantDataIntentMatchStage(customerText, intent.dateField || 'date_completed', dateWindow, ['customer', 'job.customer']),
|
|
6822
|
-
{ $match: { status: { $in: ['Completed', 'Reviewed', 'Closed'] } } },
|
|
6823
|
-
{ $unwind: '$chemicals' },
|
|
6824
|
-
{ $match: { 'chemicals.shipped.quantity': { $gt: 0 } } },
|
|
6825
|
-
{
|
|
6826
|
-
$group: {
|
|
6827
|
-
_id: {
|
|
6828
|
-
id_job: '$job.id_job',
|
|
6829
|
-
job: '$job.job',
|
|
6830
|
-
chemical: '$chemicals.chemical',
|
|
6831
|
-
unit: '$chemicals.unit'
|
|
6832
|
-
},
|
|
6833
|
-
qty_sent: { $sum: '$chemicals.shipped.quantity' },
|
|
6834
|
-
work_order_ids: { $addToSet: '$_id' }
|
|
6835
|
-
}
|
|
6836
|
-
},
|
|
6837
|
-
{
|
|
6838
|
-
$project: {
|
|
6839
|
-
_id: 0,
|
|
6840
|
-
id_job: '$_id.id_job',
|
|
6841
|
-
job: '$_id.job',
|
|
6842
|
-
chemical: '$_id.chemical',
|
|
6843
|
-
unit: '$_id.unit',
|
|
6844
|
-
qty_sent: 1,
|
|
6845
|
-
work_order_count: { $size: '$work_order_ids' }
|
|
6846
|
-
}
|
|
6847
|
-
},
|
|
6848
|
-
{ $sort: { qty_sent: -1, job: 1, chemical: 1 } }
|
|
6849
|
-
];
|
|
6850
|
-
return { type: 'aggregate', payload: basePayload(pipeline), cleaned: '', rawLine: "HEURISTIC_AGG(app-data-intent:".concat(intent.id, ")"), metadata: metadata };
|
|
6851
|
-
}
|
|
6852
|
-
if (intent.id === 'snf_invoice_chemical_quantities') {
|
|
6853
|
-
var pipeline = [
|
|
6854
|
-
buildAssistantDataIntentMatchStage(customerText, intent.dateField || 'date_created', dateWindow, ['customer', 'job.customer']),
|
|
6855
|
-
{ $unwind: '$items_chemicals' },
|
|
6856
|
-
{
|
|
6857
|
-
$group: {
|
|
6858
|
-
_id: {
|
|
6859
|
-
id_job: '$id_job',
|
|
6860
|
-
job: '$job',
|
|
6861
|
-
chemical: '$items_chemicals.chemical',
|
|
6862
|
-
unit: '$items_chemicals.unit'
|
|
6863
|
-
},
|
|
6864
|
-
quantity: { $sum: '$items_chemicals.quantity' },
|
|
6865
|
-
price_total: { $sum: '$items_chemicals.price_total' },
|
|
6866
|
-
invoice_ids: { $addToSet: '$_id' }
|
|
6867
|
-
}
|
|
6868
|
-
},
|
|
6869
|
-
{
|
|
6870
|
-
$project: {
|
|
6871
|
-
_id: 0,
|
|
6872
|
-
id_job: '$_id.id_job',
|
|
6873
|
-
job: '$_id.job',
|
|
6874
|
-
chemical: '$_id.chemical',
|
|
6875
|
-
unit: '$_id.unit',
|
|
6876
|
-
quantity: 1,
|
|
6877
|
-
price_total: 1,
|
|
6878
|
-
invoice_count: { $size: '$invoice_ids' }
|
|
6879
|
-
}
|
|
6880
|
-
},
|
|
6881
|
-
{ $sort: { price_total: -1, quantity: -1, job: 1 } }
|
|
6882
|
-
];
|
|
6883
|
-
return { type: 'aggregate', payload: basePayload(pipeline), cleaned: '', rawLine: "HEURISTIC_AGG(app-data-intent:".concat(intent.id, ")"), metadata: metadata };
|
|
6884
|
-
}
|
|
6885
|
-
if (intent.id === 'snf_planned_job_chemicals') {
|
|
6886
|
-
var pipeline = [
|
|
6887
|
-
buildAssistantDataIntentMatchStage(customerText, intent.dateField || 'date_job_created', dateWindow, ['customer', 'jca.customer']),
|
|
6888
|
-
{ $unwind: '$planned_chemicals' },
|
|
6889
|
-
{
|
|
6890
|
-
$group: {
|
|
6891
|
-
_id: {
|
|
6892
|
-
id_job: '$_id',
|
|
6893
|
-
job: '$job',
|
|
6894
|
-
chemical: '$planned_chemicals.chemical',
|
|
6895
|
-
unit: '$planned_chemicals.unit'
|
|
6896
|
-
},
|
|
6897
|
-
planned_quantity: { $sum: '$planned_chemicals.quantity' }
|
|
6898
|
-
}
|
|
6899
|
-
},
|
|
6900
|
-
{
|
|
6901
|
-
$project: {
|
|
6902
|
-
_id: 0,
|
|
6903
|
-
id_job: '$_id.id_job',
|
|
6904
|
-
job: '$_id.job',
|
|
6905
|
-
chemical: '$_id.chemical',
|
|
6906
|
-
unit: '$_id.unit',
|
|
6907
|
-
planned_quantity: 1
|
|
6908
|
-
}
|
|
6909
|
-
},
|
|
6910
|
-
{ $sort: { planned_quantity: -1, job: 1 } }
|
|
6911
|
-
];
|
|
6912
|
-
return { type: 'aggregate', payload: basePayload(pipeline), cleaned: '', rawLine: "HEURISTIC_AGG(app-data-intent:".concat(intent.id, ")"), metadata: metadata };
|
|
6913
|
-
}
|
|
6914
|
-
return null;
|
|
6915
|
-
}
|
|
6916
6653
|
function isAssistantDeterministicHeuristicDirective(directive) {
|
|
6917
|
-
return isAssistantSchemaHoursHeuristicDirective(directive)
|
|
6918
|
-
|| isAssistantAppDataIntentHeuristicDirective(directive);
|
|
6654
|
+
return isAssistantSchemaHoursHeuristicDirective(directive);
|
|
6919
6655
|
}
|
|
6920
6656
|
function buildAssistantHeuristicDirective(message, collectionHints, collectionNames, appId) {
|
|
6921
6657
|
if (collectionNames === void 0) { collectionNames = []; }
|
|
6922
6658
|
if (!normalizeOptionalString(message)) {
|
|
6923
6659
|
return null;
|
|
6924
6660
|
}
|
|
6925
|
-
|
|
6926
|
-
? buildAssistantAppDataIntentDirective(message, collectionNames, appId)
|
|
6927
|
-
: null;
|
|
6928
|
-
if (appDataIntentDirective) {
|
|
6929
|
-
return appDataIntentDirective;
|
|
6930
|
-
}
|
|
6661
|
+
void collectionNames;
|
|
6931
6662
|
var schemaHoursDirective = resolveAssistantDeterministicHeuristicEnabled(AI_ASSISTANT_HEURISTIC_ID_SCHEMA_HOURS_USER_TIME, appId)
|
|
6932
6663
|
? buildAssistantGenericHoursDirective(message, collectionHints, appId)
|
|
6933
6664
|
: null;
|
|
@@ -7615,8 +7346,6 @@ function buildAssistantToolResultPayload(directive, toolResponse, requestMessage
|
|
|
7615
7346
|
var verification = (toolResponse === null || toolResponse === void 0 ? void 0 : toolResponse.verification) && typeof toolResponse.verification === 'object'
|
|
7616
7347
|
? toolResponse.verification
|
|
7617
7348
|
: undefined;
|
|
7618
|
-
var directiveMetadata = directive.metadata && typeof directive.metadata === 'object' ? directive.metadata : {};
|
|
7619
|
-
var mergedDebug = __assign(__assign(__assign(__assign(__assign({}, ((toolResponse === null || toolResponse === void 0 ? void 0 : toolResponse.debug) && typeof toolResponse.debug === 'object' ? toolResponse.debug : {})), (normalizeOptionalString(directiveMetadata.intentId) ? { intentId: normalizeOptionalString(directiveMetadata.intentId) } : {})), (normalizeOptionalString(directiveMetadata.acknowledgementText) ? { acknowledgementText: normalizeOptionalString(directiveMetadata.acknowledgementText) } : {})), (normalizeOptionalString(directiveMetadata.recipeUsed) ? { recipeUsed: normalizeOptionalString(directiveMetadata.recipeUsed) } : {})), (Array.isArray(directiveMetadata.assumptions) && directiveMetadata.assumptions.length ? { assumptions: directiveMetadata.assumptions } : {}));
|
|
7620
7349
|
var result = {
|
|
7621
7350
|
type: directive.type === 'aggregate' ? 'mongo_agg' : 'mongo_read',
|
|
7622
7351
|
input: directivePayload,
|
|
@@ -7628,7 +7357,7 @@ function buildAssistantToolResultPayload(directive, toolResponse, requestMessage
|
|
|
7628
7357
|
columns: responseDisplay.columns,
|
|
7629
7358
|
truncated: responseDisplay.truncated,
|
|
7630
7359
|
verification: verification,
|
|
7631
|
-
debug:
|
|
7360
|
+
debug: (toolResponse === null || toolResponse === void 0 ? void 0 : toolResponse.debug) && typeof toolResponse.debug === 'object' ? toolResponse.debug : undefined
|
|
7632
7361
|
}
|
|
7633
7362
|
};
|
|
7634
7363
|
return {
|
|
@@ -7812,13 +7541,9 @@ function buildAssistantToolFallbackResponse(result) {
|
|
|
7812
7541
|
var _a, _b;
|
|
7813
7542
|
var rowCount = Math.max(0, Number(result.output.rowCount || 0));
|
|
7814
7543
|
var source = normalizeOptionalString(result.output.collection);
|
|
7815
|
-
var debug = result.output.debug && typeof result.output.debug === 'object' ? result.output.debug : {};
|
|
7816
|
-
var intentId = normalizeOptionalString(debug.intentId);
|
|
7817
7544
|
var lines = rowCount > 0
|
|
7818
7545
|
? ["I found ".concat(rowCount === 1 ? '1 matching row' : "".concat(rowCount, " matching rows")).concat(source ? " from ".concat(source) : '', ".")]
|
|
7819
|
-
: [
|
|
7820
|
-
? "I checked the ".concat(source || 'selected', " data for that request, but I did not find matching rows for the filters I used.")
|
|
7821
|
-
: "I checked the data".concat(source ? " in ".concat(source) : '', ", but no matching rows were returned.")];
|
|
7546
|
+
: ["The query ran successfully".concat(source ? " against ".concat(source) : '', ", but no matching rows were returned.")];
|
|
7822
7547
|
if (source) {
|
|
7823
7548
|
lines.push("- Source: ".concat(source));
|
|
7824
7549
|
}
|
|
@@ -7826,22 +7551,6 @@ function buildAssistantToolFallbackResponse(result) {
|
|
|
7826
7551
|
if (typeof result.output.total === 'number') {
|
|
7827
7552
|
lines.push("- Total: ".concat(result.output.total));
|
|
7828
7553
|
}
|
|
7829
|
-
if (rowCount <= 0) {
|
|
7830
|
-
var assumptions = Array.isArray(debug.assumptions)
|
|
7831
|
-
? debug.assumptions.map(function (entry) { return normalizeOptionalString(entry); }).filter(Boolean)
|
|
7832
|
-
: [];
|
|
7833
|
-
if (assumptions.length) {
|
|
7834
|
-
lines.push("- Assumptions: ".concat(assumptions.slice(0, 3).join('; ')));
|
|
7835
|
-
}
|
|
7836
|
-
if (intentId === 'snf_job_chemical_shipments') {
|
|
7837
|
-
lines.push('- I treated "sent" as shipped chemical quantity from completed/reviewed/closed work orders.');
|
|
7838
|
-
lines.push('- If you meant billed quantities or dollars, ask for invoiced/billed chemicals instead.');
|
|
7839
|
-
}
|
|
7840
|
-
else if (intentId === 'snf_invoice_chemical_quantities') {
|
|
7841
|
-
lines.push('- I treated the request as billed invoice chemical quantities and invoice totals.');
|
|
7842
|
-
lines.push('- If you meant field shipments, ask for chemicals shipped/sent on work orders.');
|
|
7843
|
-
}
|
|
7844
|
-
}
|
|
7845
7554
|
var leadSummary = buildAssistantDisplayLeadSummary(result.output.display);
|
|
7846
7555
|
if (leadSummary) {
|
|
7847
7556
|
lines.push('');
|
|
@@ -8387,29 +8096,11 @@ function deriveAssistantStreamStatus(event) {
|
|
|
8387
8096
|
}
|
|
8388
8097
|
return null;
|
|
8389
8098
|
}
|
|
8390
|
-
function
|
|
8391
|
-
if (dataMode === void 0) { dataMode = false; }
|
|
8392
|
-
var trimmed = normalizeOptionalString(status);
|
|
8393
|
-
if (!trimmed || !dataMode) {
|
|
8394
|
-
return trimmed;
|
|
8395
|
-
}
|
|
8396
|
-
var normalized = trimmed.toLowerCase();
|
|
8397
|
-
if (normalized === 'planning') {
|
|
8398
|
-
return 'Understanding your request';
|
|
8399
|
-
}
|
|
8400
|
-
if (normalized === 'drafting response') {
|
|
8401
|
-
return 'Preparing the summary';
|
|
8402
|
-
}
|
|
8403
|
-
if (normalized === 'searching files' || normalized === 'finding files' || normalized === 'opening files' || normalized === 'scanning files') {
|
|
8404
|
-
return 'Checking available data';
|
|
8405
|
-
}
|
|
8406
|
-
return trimmed;
|
|
8407
|
-
}
|
|
8408
|
-
function createAssistantStreamProgressHandler(progressTracker, isDataMode) {
|
|
8099
|
+
function createAssistantStreamProgressHandler(progressTracker) {
|
|
8409
8100
|
var lastStatus = '';
|
|
8410
8101
|
var lastSentAt = 0;
|
|
8411
8102
|
return function (status) {
|
|
8412
|
-
var trimmed =
|
|
8103
|
+
var trimmed = normalizeOptionalString(status);
|
|
8413
8104
|
if (!trimmed) {
|
|
8414
8105
|
return;
|
|
8415
8106
|
}
|
|
@@ -15564,7 +15255,6 @@ function mergeAssistantHintValues() {
|
|
|
15564
15255
|
return result;
|
|
15565
15256
|
}
|
|
15566
15257
|
var AI_ASSISTANT_HEURISTIC_ID_SCHEMA_HOURS_USER_TIME = 'schema_hours_user_time';
|
|
15567
|
-
var AI_ASSISTANT_HEURISTIC_ID_APP_DATA_INTENT = 'app_data_intent';
|
|
15568
15258
|
var AI_ASSISTANT_DEFAULT_ENABLED_DETERMINISTIC_HEURISTICS = new Set();
|
|
15569
15259
|
var aiAssistantAppHeuristicRegistryCache = null;
|
|
15570
15260
|
var aiAssistantAppHeuristicRegistryWarningKey = '';
|
|
@@ -15573,7 +15263,6 @@ function createAssistantEmptyHeuristicProfile() {
|
|
|
15573
15263
|
aliases: {},
|
|
15574
15264
|
aliasOptions: {},
|
|
15575
15265
|
collectionTermHints: [],
|
|
15576
|
-
dataIntents: [],
|
|
15577
15266
|
enabledDeterministicHeuristics: new Set(),
|
|
15578
15267
|
disabledDeterministicHeuristics: new Set()
|
|
15579
15268
|
};
|
|
@@ -15592,21 +15281,6 @@ function cloneAssistantHeuristicProfile(profile) {
|
|
|
15592
15281
|
collections: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.collections) || [])
|
|
15593
15282
|
}); })
|
|
15594
15283
|
: [],
|
|
15595
|
-
dataIntents: Array.isArray(profile === null || profile === void 0 ? void 0 : profile.dataIntents)
|
|
15596
|
-
? profile.dataIntents.map(function (entry) { return ({
|
|
15597
|
-
id: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.id),
|
|
15598
|
-
terms: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.terms) || []).map(function (term) { return term.toLowerCase(); }),
|
|
15599
|
-
excludeTerms: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.excludeTerms) || []).map(function (term) { return term.toLowerCase(); }),
|
|
15600
|
-
collection: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.collection),
|
|
15601
|
-
permissionView: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.permissionView) || undefined,
|
|
15602
|
-
dateField: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.dateField) || undefined,
|
|
15603
|
-
quantityField: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.quantityField) || undefined,
|
|
15604
|
-
metricField: normalizeOptionalString(entry === null || entry === void 0 ? void 0 : entry.metricField) || undefined,
|
|
15605
|
-
fallbackCollections: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.fallbackCollections) || []),
|
|
15606
|
-
progress: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.progress) || []),
|
|
15607
|
-
assumptions: mergeAssistantHintValues((entry === null || entry === void 0 ? void 0 : entry.assumptions) || [])
|
|
15608
|
-
}); }).filter(function (entry) { return !!entry.id && !!entry.collection; })
|
|
15609
|
-
: [],
|
|
15610
15284
|
enabledDeterministicHeuristics: new Set(Array.from((profile === null || profile === void 0 ? void 0 : profile.enabledDeterministicHeuristics) || [])),
|
|
15611
15285
|
disabledDeterministicHeuristics: new Set(Array.from((profile === null || profile === void 0 ? void 0 : profile.disabledDeterministicHeuristics) || [])),
|
|
15612
15286
|
displayDateFormat: profile === null || profile === void 0 ? void 0 : profile.displayDateFormat
|
|
@@ -15634,7 +15308,6 @@ function mergeAssistantHeuristicProfiles(base, override) {
|
|
|
15634
15308
|
merged.aliasOptions[normalizedKey] = values;
|
|
15635
15309
|
});
|
|
15636
15310
|
merged.collectionTermHints = __spreadArray(__spreadArray([], __read(merged.collectionTermHints), false), __read((Array.isArray(override.collectionTermHints) ? override.collectionTermHints : [])), false);
|
|
15637
|
-
merged.dataIntents = __spreadArray(__spreadArray([], __read(merged.dataIntents), false), __read((Array.isArray(override.dataIntents) ? override.dataIntents : [])), false);
|
|
15638
15311
|
Array.from(override.enabledDeterministicHeuristics || []).forEach(function (value) { return merged.enabledDeterministicHeuristics.add(value); });
|
|
15639
15312
|
Array.from(override.disabledDeterministicHeuristics || []).forEach(function (value) { return merged.disabledDeterministicHeuristics.add(value); });
|
|
15640
15313
|
if (override.displayDateFormat) {
|
|
@@ -15717,35 +15390,6 @@ function normalizeAssistantCollectionTermHints(value) {
|
|
|
15717
15390
|
});
|
|
15718
15391
|
return hints;
|
|
15719
15392
|
}
|
|
15720
|
-
function normalizeAssistantAppDataIntents(value) {
|
|
15721
|
-
var entries = Array.isArray(value) ? value : [];
|
|
15722
|
-
var intents = [];
|
|
15723
|
-
entries.forEach(function (entry) {
|
|
15724
|
-
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
15725
|
-
return;
|
|
15726
|
-
}
|
|
15727
|
-
var id = normalizeOptionalString(entry.id || entry.intent_id || entry.intentId);
|
|
15728
|
-
var collection = normalizeOptionalString(entry.collection || entry.primary_collection || entry.primaryCollection);
|
|
15729
|
-
var terms = normalizeAssistantHeuristicStringList(entry.terms || entry.trigger_terms || entry.triggerTerms || entry.phrases || []).map(function (term) { return term.toLowerCase(); });
|
|
15730
|
-
if (!id || !collection || !terms.length) {
|
|
15731
|
-
return;
|
|
15732
|
-
}
|
|
15733
|
-
intents.push({
|
|
15734
|
-
id: id,
|
|
15735
|
-
terms: terms,
|
|
15736
|
-
excludeTerms: normalizeAssistantHeuristicStringList(entry.exclude_terms || entry.excludeTerms || []).map(function (term) { return term.toLowerCase(); }),
|
|
15737
|
-
collection: collection,
|
|
15738
|
-
permissionView: normalizeOptionalString(entry.permission_view || entry.permissionView) || undefined,
|
|
15739
|
-
dateField: normalizeOptionalString(entry.date_field || entry.dateField) || undefined,
|
|
15740
|
-
quantityField: normalizeOptionalString(entry.quantity_field || entry.quantityField || entry.metric_field || entry.metricField) || undefined,
|
|
15741
|
-
metricField: normalizeOptionalString(entry.metric_field || entry.metricField) || undefined,
|
|
15742
|
-
fallbackCollections: normalizeAssistantHeuristicStringList(entry.fallback_collections || entry.fallbackCollections || []),
|
|
15743
|
-
progress: mergeAssistantHintValues(Array.isArray(entry.progress) ? entry.progress : []),
|
|
15744
|
-
assumptions: mergeAssistantHintValues(Array.isArray(entry.assumptions) ? entry.assumptions : [])
|
|
15745
|
-
});
|
|
15746
|
-
});
|
|
15747
|
-
return intents;
|
|
15748
|
-
}
|
|
15749
15393
|
function normalizeAssistantAppHeuristicProfile(value) {
|
|
15750
15394
|
var profile = createAssistantEmptyHeuristicProfile();
|
|
15751
15395
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
@@ -15768,9 +15412,6 @@ function normalizeAssistantAppHeuristicProfile(value) {
|
|
|
15768
15412
|
|| value.collectionTermHints
|
|
15769
15413
|
|| value.term_hints
|
|
15770
15414
|
|| value.termHints);
|
|
15771
|
-
profile.dataIntents = normalizeAssistantAppDataIntents(value.data_intents
|
|
15772
|
-
|| value.dataIntents
|
|
15773
|
-
|| value.intents);
|
|
15774
15415
|
profile.displayDateFormat = normalizeAssistantDisplayDateFormat(value.display_date_format
|
|
15775
15416
|
|| value.displayDateFormat
|
|
15776
15417
|
|| value.date_display_format
|
|
@@ -15817,7 +15458,6 @@ function normalizeAssistantAppHeuristicRegistry(value) {
|
|
|
15817
15458
|
if (Object.keys(standaloneProfile.aliases).length
|
|
15818
15459
|
|| Object.keys(standaloneProfile.aliasOptions).length
|
|
15819
15460
|
|| standaloneProfile.collectionTermHints.length
|
|
15820
|
-
|| standaloneProfile.dataIntents.length
|
|
15821
15461
|
|| standaloneProfile.enabledDeterministicHeuristics.size
|
|
15822
15462
|
|| standaloneProfile.disabledDeterministicHeuristics.size
|
|
15823
15463
|
|| normalizeOptionalString(standaloneProfile.appId)) {
|
|
@@ -16253,9 +15893,6 @@ function resolveCollectionOverrideWithContext(params) {
|
|
|
16253
15893
|
&& !isAssistantCollectionInHintFamilies(requested, [routePreferred])) {
|
|
16254
15894
|
var routePreferredName = normalizeAssistantCollectionOverrideName(routePreferred);
|
|
16255
15895
|
var requestedIsWorkOrder = isAssistantWorkOrderCollectionOverrideCandidate(requested);
|
|
16256
|
-
if (shouldPreserveAssistantJobDomainCollectionForRoute(params.message, permissionView, routePreferredName, requested)) {
|
|
16257
|
-
return null;
|
|
16258
|
-
}
|
|
16259
15896
|
if (!(routePreferredName === 'orders' && requestedIsWorkOrder && hasAssistantWorkOrderAliasTerms(params.message))) {
|
|
16260
15897
|
return {
|
|
16261
15898
|
from: requested,
|
|
@@ -16355,27 +15992,6 @@ function resolveCollectionOverrideWithContext(params) {
|
|
|
16355
15992
|
function resolveCollectionOverrideWithContextForTesting(params) {
|
|
16356
15993
|
return resolveCollectionOverrideWithContext(params);
|
|
16357
15994
|
}
|
|
16358
|
-
function shouldPreserveAssistantJobDomainCollectionForRoute(message, permissionView, routePreferredName, requestedCollection) {
|
|
16359
|
-
var route = normalizeOptionalString(permissionView).toLowerCase();
|
|
16360
|
-
var requested = normalizeAssistantCollectionOverrideName(requestedCollection);
|
|
16361
|
-
if (!route || routePreferredName !== 'jobs') {
|
|
16362
|
-
return false;
|
|
16363
|
-
}
|
|
16364
|
-
if (!/\/(?:customer-info\/jobs|job\/list|jobs?)(?:\/|$)/.test(route)) {
|
|
16365
|
-
return false;
|
|
16366
|
-
}
|
|
16367
|
-
var text = normalizeOptionalString(message).toLowerCase();
|
|
16368
|
-
if (!text || !/\b(job|jobs|work\s*orders?|wos?)\b/.test(text)) {
|
|
16369
|
-
return false;
|
|
16370
|
-
}
|
|
16371
|
-
if (requested === 'work-order-dynamics') {
|
|
16372
|
-
return /\b(chemical|chemicals|sent|shipped|shipment|delivered|work\s*orders?|wos?)\b/.test(text);
|
|
16373
|
-
}
|
|
16374
|
-
if (requested === 'invoices') {
|
|
16375
|
-
return /\b(invoice|invoices|billed|billing|revenue|charged|dollars?)\b/.test(text);
|
|
16376
|
-
}
|
|
16377
|
-
return requested === 'jobs';
|
|
16378
|
-
}
|
|
16379
15995
|
function isAssistantWorkOrderCollectionOverrideCandidate(value) {
|
|
16380
15996
|
var normalized = normalizeAssistantCollectionOverrideName(value);
|
|
16381
15997
|
return normalized === 'work-order-dynamics'
|