@xapp/stentor-service-generative-ai 1.92.0 → 1.93.0
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/lib/models/LeadAnalysis.d.ts +12 -29
- package/lib/models/LeadAnalysis.js +21 -13
- package/lib/models/LeadAnalysis.js.map +1 -1
- package/lib/prompts/AnalyzeEmail.d.ts +1 -1
- package/lib/prompts/AnalyzeEmail.js +4 -1
- package/lib/prompts/AnalyzeEmail.js.map +1 -1
- package/lib/prompts/AnalyzeLead.d.ts +8 -1
- package/lib/prompts/AnalyzeLead.js +11 -1
- package/lib/prompts/AnalyzeLead.js.map +1 -1
- package/lib/prompts/leadTaxonomyPrompt.d.ts +10 -0
- package/lib/prompts/leadTaxonomyPrompt.js +16 -3
- package/lib/prompts/leadTaxonomyPrompt.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,9 +53,13 @@ export type ServiceType = (typeof SERVICE_TYPES)[number];
|
|
|
53
53
|
* See LEAD_ANALYSIS_GUIDE.md for detailed definitions and examples.
|
|
54
54
|
*
|
|
55
55
|
* @remarks
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
56
|
+
* One name per trade. Eight alias pairs (electrical/electrician, gutters/gutter, …) were retired in
|
|
57
|
+
* analysis 1.4.0 and live on only in JOB_TYPE_VARIANTS, which maps each retired name to the trade
|
|
58
|
+
* that kept it. They are not categories here any more, and nothing should classify into them.
|
|
59
|
+
*
|
|
60
|
+
* Retiring one is still a coordinated change: these values are read by dashboards, GraphQL filters
|
|
61
|
+
* and customer webhooks. stentor-api #6086 had to teach lead email routes to match across both
|
|
62
|
+
* names of a pair before 1.4.0 could stop writing the losing side.
|
|
59
63
|
*
|
|
60
64
|
* Added in analysis 1.3.0, from production leads the classifier had no value for (2026-09-14):
|
|
61
65
|
* fireplace_chimney, drainage_waterproofing, water_treatment, pool_spa, closets_organization,
|
|
@@ -83,9 +87,6 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
83
87
|
}, {
|
|
84
88
|
readonly value: "construction";
|
|
85
89
|
readonly definition: "General construction services.";
|
|
86
|
-
}, {
|
|
87
|
-
readonly value: "contractor";
|
|
88
|
-
readonly definition: "General contracting services (same as construction).";
|
|
89
90
|
}, {
|
|
90
91
|
readonly value: "dental";
|
|
91
92
|
readonly definition: "Dental care: cleanings, exams, fillings, crowns, extractions, dentures.";
|
|
@@ -98,9 +99,6 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
98
99
|
}, {
|
|
99
100
|
readonly value: "electrical";
|
|
100
101
|
readonly definition: "Electrical work or services, including EV charger installation.";
|
|
101
|
-
}, {
|
|
102
|
-
readonly value: "electrician";
|
|
103
|
-
readonly definition: "Electrical work or services (same as electrical).";
|
|
104
102
|
}, {
|
|
105
103
|
readonly value: "event_rental";
|
|
106
104
|
readonly definition: "Party and event rentals: tents, tables, chairs, linens, equipment.";
|
|
@@ -116,18 +114,12 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
116
114
|
}, {
|
|
117
115
|
readonly value: "flooring";
|
|
118
116
|
readonly definition: "Flooring installation, refinishing, or repair (hardwood, tile, garage floor coatings, etc.).";
|
|
119
|
-
}, {
|
|
120
|
-
readonly value: "gutter";
|
|
121
|
-
readonly definition: "Gutter installation, rerouting, or cleaning.";
|
|
122
117
|
}, {
|
|
123
118
|
readonly value: "gutters";
|
|
124
|
-
readonly definition: "Gutter
|
|
119
|
+
readonly definition: "Gutter installation, rerouting, or cleaning.";
|
|
125
120
|
}, {
|
|
126
121
|
readonly value: "handyman";
|
|
127
122
|
readonly definition: "General home repair and maintenance services.";
|
|
128
|
-
}, {
|
|
129
|
-
readonly value: "house_cleaning";
|
|
130
|
-
readonly definition: "House cleaning services (same as cleaning).";
|
|
131
123
|
}, {
|
|
132
124
|
readonly value: "hvac";
|
|
133
125
|
readonly definition: "Heating, ventilation, or air conditioning services, including dryer vent cleaning.";
|
|
@@ -137,9 +129,6 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
137
129
|
}, {
|
|
138
130
|
readonly value: "landscaping";
|
|
139
131
|
readonly definition: "Landscaping or yard services.";
|
|
140
|
-
}, {
|
|
141
|
-
readonly value: "landscaper";
|
|
142
|
-
readonly definition: "Landscaping services (same as landscaping).";
|
|
143
132
|
}, {
|
|
144
133
|
readonly value: "legal_services";
|
|
145
134
|
readonly definition: "Legal services.";
|
|
@@ -155,9 +144,6 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
155
144
|
}, {
|
|
156
145
|
readonly value: "painting";
|
|
157
146
|
readonly definition: "Painting services.";
|
|
158
|
-
}, {
|
|
159
|
-
readonly value: "painter";
|
|
160
|
-
readonly definition: "Painting services (same as painting).";
|
|
161
147
|
}, {
|
|
162
148
|
readonly value: "pest_control";
|
|
163
149
|
readonly definition: "Pest control services (insects, termites, rodents).";
|
|
@@ -182,9 +168,6 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
182
168
|
}, {
|
|
183
169
|
readonly value: "roofing";
|
|
184
170
|
readonly definition: "Roofing services.";
|
|
185
|
-
}, {
|
|
186
|
-
readonly value: "roofer";
|
|
187
|
-
readonly definition: "Roofing services (same as roofing).";
|
|
188
171
|
}, {
|
|
189
172
|
readonly value: "salon";
|
|
190
173
|
readonly definition: "Hair, nail, and beauty salon services.";
|
|
@@ -203,15 +186,15 @@ export declare const JOB_TYPE_DEFINITIONS: readonly [{
|
|
|
203
186
|
}, {
|
|
204
187
|
readonly value: "window_cleaning";
|
|
205
188
|
readonly definition: "Window cleaning services.";
|
|
206
|
-
}, {
|
|
207
|
-
readonly value: "window_installation";
|
|
208
|
-
readonly definition: "Window installation or replacement services.";
|
|
209
189
|
}, {
|
|
210
190
|
readonly value: "windows_doors";
|
|
211
191
|
readonly definition: "Window or door installation or replacement.";
|
|
192
|
+
}, {
|
|
193
|
+
readonly value: "not_stated";
|
|
194
|
+
readonly definition: "The request does not say what work is wanted and no one trade can be assumed.";
|
|
212
195
|
}, {
|
|
213
196
|
readonly value: "other";
|
|
214
|
-
readonly definition: "Work that belongs to none of the trades above
|
|
197
|
+
readonly definition: "Work that belongs to none of the trades above.";
|
|
215
198
|
}];
|
|
216
199
|
export type JobType = (typeof JOB_TYPE_DEFINITIONS)[number]["value"];
|
|
217
200
|
export declare const JOB_TYPES: JobType[];
|
|
@@ -83,9 +83,13 @@ exports.SERVICE_TYPES = [
|
|
|
83
83
|
* See LEAD_ANALYSIS_GUIDE.md for detailed definitions and examples.
|
|
84
84
|
*
|
|
85
85
|
* @remarks
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
86
|
+
* One name per trade. Eight alias pairs (electrical/electrician, gutters/gutter, …) were retired in
|
|
87
|
+
* analysis 1.4.0 and live on only in JOB_TYPE_VARIANTS, which maps each retired name to the trade
|
|
88
|
+
* that kept it. They are not categories here any more, and nothing should classify into them.
|
|
89
|
+
*
|
|
90
|
+
* Retiring one is still a coordinated change: these values are read by dashboards, GraphQL filters
|
|
91
|
+
* and customer webhooks. stentor-api #6086 had to teach lead email routes to match across both
|
|
92
|
+
* names of a pair before 1.4.0 could stop writing the losing side.
|
|
89
93
|
*
|
|
90
94
|
* Added in analysis 1.3.0, from production leads the classifier had no value for (2026-09-14):
|
|
91
95
|
* fireplace_chimney, drainage_waterproofing, water_treatment, pool_spa, closets_organization,
|
|
@@ -100,31 +104,25 @@ exports.JOB_TYPE_DEFINITIONS = [
|
|
|
100
104
|
{ value: "cleaning", definition: "General cleaning services (house, carpet, duct, etc.)." },
|
|
101
105
|
{ value: "closets_organization", definition: "Closet systems and home or garage organization." },
|
|
102
106
|
{ value: "construction", definition: "General construction services." },
|
|
103
|
-
{ value: "contractor", definition: "General contracting services (same as construction)." },
|
|
104
107
|
{ value: "dental", definition: "Dental care: cleanings, exams, fillings, crowns, extractions, dentures." },
|
|
105
108
|
{ value: "drainage_waterproofing", definition: "Drainage, French drains, sump pumps, and basement or foundation waterproofing." },
|
|
106
109
|
{ value: "drywall", definition: "Drywall installation or repair." },
|
|
107
110
|
{ value: "electrical", definition: "Electrical work or services, including EV charger installation." },
|
|
108
|
-
{ value: "electrician", definition: "Electrical work or services (same as electrical)." },
|
|
109
111
|
{ value: "event_rental", definition: "Party and event rentals: tents, tables, chairs, linens, equipment." },
|
|
110
112
|
{ value: "eye_care", definition: "Eye exams, optometry, contact lenses, and eyewear." },
|
|
111
113
|
{ value: "fencing", definition: "Fence installation or repair." },
|
|
112
114
|
{ value: "fireplace_chimney", definition: "Fireplaces, gas logs and inserts, chimneys, and wood or pellet stoves." },
|
|
113
115
|
{ value: "flooring", definition: "Flooring installation, refinishing, or repair (hardwood, tile, garage floor coatings, etc.)." },
|
|
114
|
-
{ value: "
|
|
115
|
-
{ value: "gutters", definition: "Gutter services (same as gutter)." },
|
|
116
|
+
{ value: "gutters", definition: "Gutter installation, rerouting, or cleaning." },
|
|
116
117
|
{ value: "handyman", definition: "General home repair and maintenance services." },
|
|
117
|
-
{ value: "house_cleaning", definition: "House cleaning services (same as cleaning)." },
|
|
118
118
|
{ value: "hvac", definition: "Heating, ventilation, or air conditioning services, including dryer vent cleaning." },
|
|
119
119
|
{ value: "junk_removal", definition: "Junk and debris removal services." },
|
|
120
120
|
{ value: "landscaping", definition: "Landscaping or yard services." },
|
|
121
|
-
{ value: "landscaper", definition: "Landscaping services (same as landscaping)." },
|
|
122
121
|
{ value: "legal_services", definition: "Legal services." },
|
|
123
122
|
{ value: "masonry", definition: "Masonry, brick, stone, or tuckpointing work." },
|
|
124
123
|
{ value: "mold_remediation", definition: "Mold inspection, removal, or remediation services." },
|
|
125
124
|
{ value: "moving", definition: "Moving or relocation services." },
|
|
126
125
|
{ value: "painting", definition: "Painting services." },
|
|
127
|
-
{ value: "painter", definition: "Painting services (same as painting)." },
|
|
128
126
|
{ value: "pest_control", definition: "Pest control services (insects, termites, rodents)." },
|
|
129
127
|
{ value: "plumbing", definition: "Plumbing services, including water heaters, fixtures, backflow testing, and septic." },
|
|
130
128
|
{ value: "pool_spa", definition: "Pool and spa installation, repair, cleaning, and maintenance." },
|
|
@@ -133,16 +131,15 @@ exports.JOB_TYPE_DEFINITIONS = [
|
|
|
133
131
|
{ value: "remodeling", definition: "Remodeling or renovation (kitchen, bathroom, home)." },
|
|
134
132
|
{ value: "restoration", definition: "Water, fire, or damage restoration services." },
|
|
135
133
|
{ value: "roofing", definition: "Roofing services." },
|
|
136
|
-
{ value: "roofer", definition: "Roofing services (same as roofing)." },
|
|
137
134
|
{ value: "salon", definition: "Hair, nail, and beauty salon services." },
|
|
138
135
|
{ value: "siding", definition: "Siding installation or repair services." },
|
|
139
136
|
{ value: "tree_services", definition: "Tree removal, trimming, and care services." },
|
|
140
137
|
{ value: "water_treatment", definition: "Water softeners, filtration, reverse osmosis, and well water treatment." },
|
|
141
138
|
{ value: "wildlife_control", definition: "Wildlife removal or exclusion services (e.g., raccoons, squirrels, bats)." },
|
|
142
139
|
{ value: "window_cleaning", definition: "Window cleaning services." },
|
|
143
|
-
{ value: "window_installation", definition: "Window installation or replacement services." },
|
|
144
140
|
{ value: "windows_doors", definition: "Window or door installation or replacement." },
|
|
145
|
-
{ value: "
|
|
141
|
+
{ value: "not_stated", definition: "The request does not say what work is wanted and no one trade can be assumed." },
|
|
142
|
+
{ value: "other", definition: "Work that belongs to none of the trades above." }
|
|
146
143
|
];
|
|
147
144
|
exports.JOB_TYPES = exports.JOB_TYPE_DEFINITIONS.map((d) => d.value);
|
|
148
145
|
/**
|
|
@@ -194,6 +191,17 @@ const JOB_TYPE_VARIANTS = {
|
|
|
194
191
|
water_heater: "plumbing",
|
|
195
192
|
water_softener: "water_treatment",
|
|
196
193
|
water_filtration: "water_treatment",
|
|
194
|
+
// The eight alias pairs the taxonomy used to declare, retired 1.4.0. Anything that already
|
|
195
|
+
// wrote one of these - a stored route, an older analysis, a model still echoing the old list -
|
|
196
|
+
// still lands on the trade that kept the name.
|
|
197
|
+
contractor: "construction",
|
|
198
|
+
electrician: "electrical",
|
|
199
|
+
gutter: "gutters",
|
|
200
|
+
house_cleaning: "cleaning",
|
|
201
|
+
landscaper: "landscaping",
|
|
202
|
+
painter: "painting",
|
|
203
|
+
roofer: "roofing",
|
|
204
|
+
window_installation: "windows_doors",
|
|
197
205
|
garage_floor: "flooring",
|
|
198
206
|
garage_floor_coating: "flooring",
|
|
199
207
|
dryer_vent: "hvac"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeadAnalysis.js","sourceRoot":"","sources":["../../src/models/LeadAnalysis.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"LeadAnalysis.js","sourceRoot":"","sources":["../../src/models/LeadAnalysis.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;AAmSlC,kDA0BC;AA3TD;;;;;;;;;;;;;;;;;;;;GAoBG;AACU,QAAA,aAAa,GAAG;IACzB,eAAe;IACf,cAAc;IACd,WAAW;IACX,YAAY;IACZ,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,UAAU;IACV,eAAe;IACf,oBAAoB;IACpB,iBAAiB;IACjB,MAAM;IACN,MAAM;IACN,OAAO;CACD,CAAC;AAIX;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,aAAa,GAAG;IACzB,UAAU;IACV,cAAc;IACd,YAAY;IACZ,cAAc;IACd,aAAa;IACb,UAAU;IACV,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,WAAW;IACX,OAAO;CACD,CAAC;AAIX;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACU,QAAA,oBAAoB,GAAG;IAChC,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,4BAA4B,EAAE;IACvE,EAAE,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,gEAAgE,EAAE;IACxG,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,iDAAiD,EAAE;IAClF,EAAE,KAAK,EAAE,WA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AI,CAAC,GAAG,CAAC,OAAO,CAAC,0CAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACzE,IAAI,OAAO,EAAE,CAAC;QACV,kFAAkF;QAClF,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC1H,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAmB,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC;IACxF,CAAC;IAED,MAAM,OAAO,GAAG,MAAA,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,0CAAE,WAAW,EAAE,CAAC;IACjD,IAAI,OAAO,EAAE,CAAC;QACV,GAAG,CAAC,OAAO,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAgB,CAAC;IAC7F,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! Copyright (c) 2026, XAPP AI */
|
|
2
2
|
import type { CompletionPrompt, PromptGenerator, ResponseParser } from "../models";
|
|
3
3
|
import type { EmailAnalysisInput, EmailLeadAnalysis } from "../models/EmailAnalysis";
|
|
4
|
-
export declare const ANALYZE_EMAIL_VERSION = "1.
|
|
4
|
+
export declare const ANALYZE_EMAIL_VERSION = "1.3.0";
|
|
5
5
|
export interface AnalyzeEmailProps {
|
|
6
6
|
businessDescription?: string;
|
|
7
7
|
highValueLeadDescription?: string;
|
|
@@ -8,7 +8,7 @@ const errors_1 = require("../models/errors");
|
|
|
8
8
|
const extractJSON_1 = require("../utils/extractJSON");
|
|
9
9
|
const LeadAnalysis_1 = require("../models/LeadAnalysis");
|
|
10
10
|
const leadTaxonomyPrompt_1 = require("./leadTaxonomyPrompt");
|
|
11
|
-
exports.ANALYZE_EMAIL_VERSION = "1.
|
|
11
|
+
exports.ANALYZE_EMAIL_VERSION = "1.3.0"; // 1.2.0: the AnalyzeLead 1.3.0 taxonomy and validation, shared. 1.2.1: its reworded jobType rules. 1.2.2: its 1.3.2 contactType scoping. 1.3.0: its 1.4.0 taxonomy — one name per trade, not_stated, quote urgency
|
|
12
12
|
/** Headers forwarded to the LLM to help disambiguate the actual contact from template senders. */
|
|
13
13
|
const RELEVANT_HEADERS = ["reply-to", "x-mailer", "x-original-sender", "x-source"];
|
|
14
14
|
/**
|
|
@@ -130,6 +130,7 @@ TEST: A test message, placeholder text, or internal system check (e.g., "test",
|
|
|
130
130
|
OTHER: Content cannot be reasonably determined from the email.
|
|
131
131
|
|
|
132
132
|
When multiple could apply, prefer BILLING_ISSUE, RESCHEDULE_REQUEST, CANCELLATION, or MISSED_APPOINTMENT over COMPLAINT or CONTACT_REQUEST.
|
|
133
|
+
${leadTaxonomyPrompt_1.DETAIL_FREE_CONTACT_RULE}
|
|
133
134
|
${leadTaxonomyPrompt_1.ESTIMATING_VENDOR_SPAM_EXAMPLES}
|
|
134
135
|
|
|
135
136
|
|
|
@@ -158,6 +159,8 @@ NOT_SPECIFIED: The urgency of the lead could not be determined by the content of
|
|
|
158
159
|
|
|
159
160
|
Note about "urgency": This isn't necessarily the customer stating that the issue is urgent, but rather the nature of the issue itself.
|
|
160
161
|
|
|
162
|
+
A request for a price or an estimate on planned work, with no problem described, is LOW - nothing is broken and nothing is getting worse. Use NOT_SPECIFIED only when you cannot tell.
|
|
163
|
+
|
|
161
164
|
${highValueLeadInstruction}
|
|
162
165
|
|
|
163
166
|
Provide a summary of the email which will be placed in the value "summary". The summary should not exceed 250 characters.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyzeEmail.js","sourceRoot":"","sources":["../../src/prompts/Analyze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AAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,aAAa,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3C,CAAC;QAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,aAAa,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QACnD,CAAC;QAED,IAAI,gBAAgB,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,gBAAwC,CAAC;YACzD,mEAAmE;YACnE,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;gBACrD,oEAAoE;gBACpE,OAAO,CAAC,UAAU,GAAG,OAAO,OAAO,CAAC,UAAU,KAAK,QAAQ;oBACvD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;oBAC9C,CAAC,CAAC,CAAC,CAAC;gBACR,aAAa,CAAC,gBAAgB,GAAG,OAAO,CAAC;YAC7C,CAAC;QACL,CAAC;QAED,OAAO,aAAa,CAAC;IACzB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,uFAAuF;QACvF,yFAAyF;QACzF,0FAA0F;QAC1F,MAAM,IAAI,8BAAqB,CAAC,cAAc,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC;AACL,CAAC,CAAC;AAhDW,QAAA,yBAAyB,6BAgDpC"}
|
|
@@ -9,8 +9,15 @@ import type { CompletionPrompt, LeadAnalysis, PromptGenerator, ResponseParser }
|
|
|
9
9
|
* business's trade used when a request names none, eleven new job types, and worked examples.
|
|
10
10
|
* 1.3.1 (2026-09-14): the jobType rules moved before the definitions and reworded, after an A/B on
|
|
11
11
|
* 300 production leads showed 1.3.0's model never applying the business-trade rule.
|
|
12
|
+
* 1.3.2 (2026-09-23): the trade fallback scoped to jobType. It had been moving contactType with it -
|
|
13
|
+
* of the leads arriving with no message at all, CONTACT_REQUEST fell from 42% on 1.2.0 to 3% on
|
|
14
|
+
* 1.3.1 while SERVICE_REQUEST rose to 77%, against an unchanged CONTACT_REQUEST definition.
|
|
15
|
+
* 1.4.0 (2026-09-25): one name per trade — the eight alias pairs retired, the old names kept in
|
|
16
|
+
* JOB_TYPE_VARIANTS so anything that already wrote them still resolves. "other" split: not_stated
|
|
17
|
+
* for a request that names no work, other for work in no listed trade. A price request on planned
|
|
18
|
+
* work is LOW rather than NOT_SPECIFIED.
|
|
12
19
|
*/
|
|
13
|
-
export declare const ANALYZE_LEAD_VERSION = "1.
|
|
20
|
+
export declare const ANALYZE_LEAD_VERSION = "1.4.0";
|
|
14
21
|
export interface TranscriptMessage {
|
|
15
22
|
text: string;
|
|
16
23
|
speaker: string;
|
|
@@ -19,8 +19,15 @@ const leadTaxonomyPrompt_1 = require("./leadTaxonomyPrompt");
|
|
|
19
19
|
* business's trade used when a request names none, eleven new job types, and worked examples.
|
|
20
20
|
* 1.3.1 (2026-09-14): the jobType rules moved before the definitions and reworded, after an A/B on
|
|
21
21
|
* 300 production leads showed 1.3.0's model never applying the business-trade rule.
|
|
22
|
+
* 1.3.2 (2026-09-23): the trade fallback scoped to jobType. It had been moving contactType with it -
|
|
23
|
+
* of the leads arriving with no message at all, CONTACT_REQUEST fell from 42% on 1.2.0 to 3% on
|
|
24
|
+
* 1.3.1 while SERVICE_REQUEST rose to 77%, against an unchanged CONTACT_REQUEST definition.
|
|
25
|
+
* 1.4.0 (2026-09-25): one name per trade — the eight alias pairs retired, the old names kept in
|
|
26
|
+
* JOB_TYPE_VARIANTS so anything that already wrote them still resolves. "other" split: not_stated
|
|
27
|
+
* for a request that names no work, other for work in no listed trade. A price request on planned
|
|
28
|
+
* work is LOW rather than NOT_SPECIFIED.
|
|
22
29
|
*/
|
|
23
|
-
exports.ANALYZE_LEAD_VERSION = "1.
|
|
30
|
+
exports.ANALYZE_LEAD_VERSION = "1.4.0";
|
|
24
31
|
function getName(profile) {
|
|
25
32
|
// Sorting these based on priority.
|
|
26
33
|
return (profile === null || profile === void 0 ? void 0 : profile.name) || (profile === null || profile === void 0 ? void 0 : profile.email) || (profile === null || profile === void 0 ? void 0 : profile.phone) || "Unknown";
|
|
@@ -184,6 +191,7 @@ TEST: A test message, placeholder text, or internal system check (e.g., “test
|
|
|
184
191
|
OTHER: Content cannot be reasonably determined from the transcript.
|
|
185
192
|
|
|
186
193
|
When multiple could apply, prefer BILLING_ISSUE, RESCHEDULE_REQUEST, CANCELLATION, or MISSED_APPOINTMENT over COMPLAINT or CONTACT_REQUEST.
|
|
194
|
+
${leadTaxonomyPrompt_1.DETAIL_FREE_CONTACT_RULE}
|
|
187
195
|
${leadTaxonomyPrompt_1.ESTIMATING_VENDOR_SPAM_EXAMPLES}
|
|
188
196
|
|
|
189
197
|
|
|
@@ -212,6 +220,8 @@ NOT_SPECIFIED: The urgency of the lead could not be determined by the content of
|
|
|
212
220
|
|
|
213
221
|
Note about "urgency": This isn't necessarily the customer stating that the issue is urgent, but rather the nature of the issue itself.
|
|
214
222
|
|
|
223
|
+
A request for a price or an estimate on planned work, with no problem described, is LOW - nothing is broken and nothing is getting worse. Use NOT_SPECIFIED only when you cannot tell.
|
|
224
|
+
|
|
215
225
|
${highValueLeadInstruction}
|
|
216
226
|
|
|
217
227
|
Provide a summary of the conversation which will be placed in the value "summary". The summary should not exceed 250 characters.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnalyzeLead.js","sourceRoot":"","sources":["../../src/prompts/AnalyzeLead.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AnalyzeLead.js","sourceRoot":"","sources":["../../src/prompts/AnalyzeLead.ts"],"names":[],"mappings":";;;AAsDA,kDAMC;AAyBD,oDAiCC;AAOD,kCAaC;AAQD,kEAEC;AAlJD,iDAAkD;AAGlD,6CAAyD;AACzD,sDAAmD;AACnD,yDAAqH;AACrH,6DAAiH;AAEjH,kDAAkD;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AM,IAAI,8BAAqB,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;AACL,CAAC,CAAC;AAnCW,QAAA,wBAAwB,4BAmCnC"}
|
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
* fall back on when a request names no trade.
|
|
7
7
|
*/
|
|
8
8
|
export declare function jobTypeSection(hasBusinessDescription: boolean): string;
|
|
9
|
+
/**
|
|
10
|
+
* The contactType half of the business-trade fallback.
|
|
11
|
+
*
|
|
12
|
+
* 1.3.0 taught the model to give a detail-free request the business's trade, and contactType moved
|
|
13
|
+
* with it: of the leads that arrive with no message at all, CONTACT_REQUEST was 42% on v1.2.0 and 3%
|
|
14
|
+
* on v1.3.1, while SERVICE_REQUEST went 31% -> 77% (studioProd, 2026-09-23). The CONTACT_REQUEST
|
|
15
|
+
* definition never changed, so the only new signal was a worked example reading
|
|
16
|
+
* "please call me" -> pest_control, and the model carried the inferred trade over into intent.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DETAIL_FREE_CONTACT_RULE = "\nGiving a request the business's trade does not change contactType. A message with no actionable detail about the work - \"please call me\", a callback request, or a booking request carrying only a date and time - is a CONTACT_REQUEST even after you have given it that business's trade. Only use SERVICE_REQUEST or QUOTE_REQUEST when the customer describes work, asks to schedule, or asks for a price.";
|
|
9
19
|
/**
|
|
10
20
|
* Worked examples for the estimating-vendor rule. The SPAM definition names "people offering cost
|
|
11
21
|
* estimation or takeoff services", and on analysis 1.2.0 it held for 75 of the 222 leads the model
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ESTIMATING_VENDOR_SPAM_EXAMPLES = void 0;
|
|
3
|
+
exports.ESTIMATING_VENDOR_SPAM_EXAMPLES = exports.DETAIL_FREE_CONTACT_RULE = void 0;
|
|
4
4
|
exports.jobTypeSection = jobTypeSection;
|
|
5
5
|
/*! Copyright (c) 2026, XAPP AI */
|
|
6
6
|
const LeadAnalysis_1 = require("../models/LeadAnalysis");
|
|
@@ -21,8 +21,10 @@ function jobTypeSection(hasBusinessDescription) {
|
|
|
21
21
|
? `2. If the request gives no detail about the work (for example "please call me", a booking request with only a date and time, or a quote request with no description), use the business's trade: when the business description describes a single trade, use that trade's jobType.
|
|
22
22
|
- A pest control company receives "please call me" → pest_control
|
|
23
23
|
- An HVAC company receives a booking request with only a preferred time → hvac
|
|
24
|
-
3. Use "
|
|
25
|
-
|
|
24
|
+
3. Use "not_stated" when the request gives no detail about the work AND the business offers several different trades, so there is no single trade to borrow.
|
|
25
|
+
4. Use "other" only when the work belongs to none of the trades listed below.
|
|
26
|
+
5. Borrowing the business's trade in rule 2 sets jobType only. It does not change contactType: a request with no detail is still a CONTACT_REQUEST, never a SERVICE_REQUEST.`
|
|
27
|
+
: `2. If the request gives no detail about the work, use "not_stated".
|
|
26
28
|
3. Otherwise use "other" only when the work belongs to none of the trades listed below.`;
|
|
27
29
|
return `jobType is the trade of the work the customer wants — not how much detail they gave, and not whether this business offers it.
|
|
28
30
|
|
|
@@ -42,6 +44,17 @@ Examples of requests that fit an existing jobType:
|
|
|
42
44
|
- "gas fireplace won't light" or "chimney sweep" → fireplace_chimney
|
|
43
45
|
- "French drain" or "wet basement" → drainage_waterproofing`;
|
|
44
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The contactType half of the business-trade fallback.
|
|
49
|
+
*
|
|
50
|
+
* 1.3.0 taught the model to give a detail-free request the business's trade, and contactType moved
|
|
51
|
+
* with it: of the leads that arrive with no message at all, CONTACT_REQUEST was 42% on v1.2.0 and 3%
|
|
52
|
+
* on v1.3.1, while SERVICE_REQUEST went 31% -> 77% (studioProd, 2026-09-23). The CONTACT_REQUEST
|
|
53
|
+
* definition never changed, so the only new signal was a worked example reading
|
|
54
|
+
* "please call me" -> pest_control, and the model carried the inferred trade over into intent.
|
|
55
|
+
*/
|
|
56
|
+
exports.DETAIL_FREE_CONTACT_RULE = `
|
|
57
|
+
Giving a request the business's trade does not change contactType. A message with no actionable detail about the work - "please call me", a callback request, or a booking request carrying only a date and time - is a CONTACT_REQUEST even after you have given it that business's trade. Only use SERVICE_REQUEST or QUOTE_REQUEST when the customer describes work, asks to schedule, or asks for a price.`;
|
|
45
58
|
/**
|
|
46
59
|
* Worked examples for the estimating-vendor rule. The SPAM definition names "people offering cost
|
|
47
60
|
* estimation or takeoff services", and on analysis 1.2.0 it held for 75 of the 222 leads the model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leadTaxonomyPrompt.js","sourceRoot":"","sources":["../../src/prompts/leadTaxonomyPrompt.ts"],"names":[],"mappings":";;;AAUA,
|
|
1
|
+
{"version":3,"file":"leadTaxonomyPrompt.js","sourceRoot":"","sources":["../../src/prompts/leadTaxonomyPrompt.ts"],"names":[],"mappings":";;;AAUA,wCAkCC;AA5CD,kCAAkC;AAClC,yDAA8D;AAE9D;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,sBAA+B;IAC1D,MAAM,WAAW,GAAG,mCAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE9G,wFAAwF;IACxF,0FAA0F;IAC1F,+FAA+F;IAC/F,kFAAkF;IAClF,MAAM,QAAQ,GAAG,sBAAsB;QACnC,CAAC,CAAC;;;;;6KAKmK;QACrK,CAAC,CAAC;wFAC8E,CAAC;IAErF,OAAO;;;;;EAKT,QAAQ;;;EAGR,WAAW;;;;;;;;4DAQ+C,CAAC;AAC7D,CAAC;AAED;;;;;;;;GAQG;AACU,QAAA,wBAAwB,GAAG;+YACuW,CAAA;AAE/Y;;;;GAIG;AACU,QAAA,+BAA+B,GAAG;;;;+FAIgD,CAAC"}
|