@xapp/stentor-templates 1.86.4 → 1.87.1
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/smbs/SMBTemplate.d.ts +6 -0
- package/lib/smbs/SMBTemplateFactory.d.ts +7 -0
- package/lib/smbs/SMBTemplateFactory.js +69 -50
- package/lib/smbs/SMBTemplateFactory.js.map +1 -1
- package/lib/smbs/constants.d.ts +16 -0
- package/lib/smbs/constants.js +31 -2
- package/lib/smbs/constants.js.map +1 -1
- package/package.json +13 -13
|
@@ -19,6 +19,12 @@ export interface SMBTemplate extends Template {
|
|
|
19
19
|
template?: ExportApp;
|
|
20
20
|
/**
|
|
21
21
|
* No capture response, used when lead capture is not supported.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated The factory no longer generates one, and no longer refuses to
|
|
24
|
+
* build an app without one. It was assembled from crawled contact details,
|
|
25
|
+
* which are not the details the customer gave us, and its absence blocked
|
|
26
|
+
* onboarding for any business with a thin website. A template that wants a
|
|
27
|
+
* specific line should carry it in its own content.
|
|
22
28
|
*/
|
|
23
29
|
noCaptureResponse?: string;
|
|
24
30
|
}
|
|
@@ -22,6 +22,13 @@ export declare class SMBTemplateFactory extends TemplateFactory<SMBTemplate> {
|
|
|
22
22
|
generateApp(template: SMBTemplate, app?: OVAIApp): OVAIApp;
|
|
23
23
|
protected removeTemplateProperties?(template: SMBTemplate): Partial<OVAIApp>;
|
|
24
24
|
generateIntentsAndHandlers(template: SMBTemplate, handlers?: (Handler<Content, Data, Forward, Redirect> | Intent)[]): (Handler<Content, Data, Forward, Redirect> | Intent)[];
|
|
25
|
+
/**
|
|
26
|
+
* None. Entities existed to resolve slots for the NLU; both are gone.
|
|
27
|
+
*
|
|
28
|
+
* Templates may still carry an `entities` array from when they were
|
|
29
|
+
* exported — it is ignored rather than removed at the source, so an older
|
|
30
|
+
* template does not have to be republished to behave correctly.
|
|
31
|
+
*/
|
|
25
32
|
generateEntities(template?: SMBTemplate): Entity[];
|
|
26
33
|
generateUtterancesTests(template?: SMBTemplate): UtteranceTest[];
|
|
27
34
|
generateTemplate?(app: OVAIApp, handlers: (Handler<Content, Data, Forward, Redirect> | Intent)[]): SMBTemplate | undefined;
|
|
@@ -81,15 +81,17 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
81
81
|
const defaultDescription = "High-value projects requiring premium materials, extensive work scope, commercial applications, or projects with budgets significantly above average market rates.";
|
|
82
82
|
// Handle single job type as string
|
|
83
83
|
if (typeof jobTypes === "string") {
|
|
84
|
-
|
|
85
|
-
return descriptions[normalizedJobType] || defaultDescription;
|
|
84
|
+
return descriptions[normalizeJobType(jobTypes)] || defaultDescription;
|
|
86
85
|
}
|
|
87
86
|
// Handle multiple job types as array
|
|
88
87
|
if (Array.isArray(jobTypes) && jobTypes.length > 0) {
|
|
89
88
|
const validDescriptions = jobTypes
|
|
90
|
-
.map(
|
|
89
|
+
.map(normalizeJobType)
|
|
91
90
|
.map((normalizedJobType) => descriptions[normalizedJobType])
|
|
92
|
-
.filter((description) => description !== undefined)
|
|
91
|
+
.filter((description) => description !== undefined)
|
|
92
|
+
// A business listing "pest control" and "termite control"
|
|
93
|
+
// should not be described twice over.
|
|
94
|
+
.filter((description, index, all) => all.indexOf(description) === index);
|
|
93
95
|
if (validDescriptions.length === 0) {
|
|
94
96
|
return defaultDescription;
|
|
95
97
|
}
|
|
@@ -129,7 +131,7 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
133
|
generateApp(template, app) {
|
|
132
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
134
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
133
135
|
const name = (_b = (_a = template.webdata) === null || _a === void 0 ? void 0 : _a.business) === null || _b === void 0 ? void 0 : _b.name;
|
|
134
136
|
const primaryColor = (_d = (_c = template.webdata) === null || _c === void 0 ? void 0 : _c.site) === null || _d === void 0 ? void 0 : _d.primaryColor;
|
|
135
137
|
const secondaryColor = (_f = (_e = template.webdata) === null || _e === void 0 ? void 0 : _e.site) === null || _f === void 0 ? void 0 : _f.secondaryColor;
|
|
@@ -163,6 +165,14 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
163
165
|
generatedApp.leadsContact = firstEmail;
|
|
164
166
|
}
|
|
165
167
|
}
|
|
168
|
+
// What counts as a lead worth chasing, from the trades the crawl found.
|
|
169
|
+
// The helper has existed for a while and nothing that generated an app
|
|
170
|
+
// called it, so every generated app started with this empty while the
|
|
171
|
+
// lead analyzer downstream expected it.
|
|
172
|
+
if ((0, stentor_utils_1.existsAndNotEmpty)((_t = (_s = template.webdata) === null || _s === void 0 ? void 0 : _s.business) === null || _t === void 0 ? void 0 : _t.services)) {
|
|
173
|
+
generatedApp.businessHighValueLeadDescription =
|
|
174
|
+
SMBTemplateFactory.generateHighValueLeadDescription(template.webdata.business.services);
|
|
175
|
+
}
|
|
166
176
|
if (app) {
|
|
167
177
|
generatedApp = Object.assign(Object.assign({}, app), generatedApp);
|
|
168
178
|
}
|
|
@@ -174,13 +184,24 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
174
184
|
return template;
|
|
175
185
|
}
|
|
176
186
|
generateIntentsAndHandlers(template, handlers) {
|
|
177
|
-
var _a, _b
|
|
187
|
+
var _a, _b;
|
|
178
188
|
if (handlers) {
|
|
179
189
|
throw new Error("Augmenting Handlers are not supported for this template.");
|
|
180
190
|
}
|
|
181
191
|
// no intents, just empty handlers
|
|
192
|
+
// Utterances and slots are NLU-era artifacts. Chat is driven by an LLM
|
|
193
|
+
// now, so nothing trains on utterance patterns and nothing resolves a
|
|
194
|
+
// slot against an entity — `generateEntities` returns none, so the
|
|
195
|
+
// entities those slots referenced are not created either.
|
|
196
|
+
//
|
|
197
|
+
// Dropping them is not just tidiness: they are carried through export,
|
|
198
|
+
// stored on every generated app, and shown to whoever edits it, which
|
|
199
|
+
// invites people to maintain vocabulary that has no effect.
|
|
200
|
+
//
|
|
201
|
+
// A handler is still a superset of an intent. What matters now is its
|
|
202
|
+
// `content` and `data` — the instructions the model is driven by — and
|
|
203
|
+
// those are left exactly as the template set them.
|
|
182
204
|
const cleanHandler = (handler) => {
|
|
183
|
-
// delete slots
|
|
184
205
|
const cleaned = Object.assign({}, handler);
|
|
185
206
|
cleaned.slots = [];
|
|
186
207
|
cleaned.utterancePatterns = [];
|
|
@@ -193,51 +214,38 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
193
214
|
if (!contactCaptureHandler) {
|
|
194
215
|
throw new Error(`No LeadGeneration handler found in template. ${template.template}`);
|
|
195
216
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
else if (phone || email) {
|
|
220
|
-
noCaptureResponse = `Sure, you can reach us at ${phone || email}.`;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
if (!noCaptureResponse) {
|
|
224
|
-
throw new Error("No noCaptureResponse found in template and unable to generate");
|
|
225
|
-
}
|
|
226
|
-
const response = {
|
|
227
|
-
outputSpeech: {
|
|
228
|
-
ssml: `<speak>${noCaptureResponse}</speak>`,
|
|
229
|
-
displayText: `${noCaptureResponse}`,
|
|
230
|
-
suggestions: []
|
|
231
|
-
},
|
|
232
|
-
name: "No Capture Start",
|
|
233
|
-
tag: "ContactCaptureNoCaptureStart"
|
|
234
|
-
};
|
|
235
|
-
if ((_g = (_f = (_e = template.webdata) === null || _e === void 0 ? void 0 : _e.site) === null || _f === void 0 ? void 0 : _f.pages) === null || _g === void 0 ? void 0 : _g.contactUs) {
|
|
236
|
-
response.outputSpeech.suggestions.push({ title: "Contact Us", url: template.webdata.site.pages.contactUs });
|
|
237
|
-
}
|
|
238
|
-
contactCaptureResponses.push(response);
|
|
217
|
+
// The data every LeadGeneration handler should start with. Merged
|
|
218
|
+
// under whatever the template set, so a template that deliberately
|
|
219
|
+
// turns one of these off keeps its choice.
|
|
220
|
+
//
|
|
221
|
+
// `chat` is merged a level deeper rather than spread flat. It is the
|
|
222
|
+
// only nested default, and `suggestionChips` is the one chat field
|
|
223
|
+
// stentor-models actually models — so a template setting it is the
|
|
224
|
+
// realistic case, and a flat spread would replace the whole `chat`
|
|
225
|
+
// object and drop `followUp` with it, quietly turning follow-up
|
|
226
|
+
// suppression off for that template alone.
|
|
227
|
+
const templateData = ((_a = contactCaptureHandler.data) !== null && _a !== void 0 ? _a : {});
|
|
228
|
+
const defaultChat = constants_1.LEAD_GENERATION_DEFAULT_DATA.chat;
|
|
229
|
+
contactCaptureHandler.data = Object.assign(Object.assign(Object.assign({}, constants_1.LEAD_GENERATION_DEFAULT_DATA), templateData), { chat: Object.assign(Object.assign({}, defaultChat), ((_b = templateData.chat) !== null && _b !== void 0 ? _b : {})) });
|
|
230
|
+
// The no-capture response used to be built here from the crawled phone
|
|
231
|
+
// number and email — "Sure, you can reach us at …" — and the factory
|
|
232
|
+
// refused to generate anything at all when the crawl had found neither.
|
|
233
|
+
// A business with a thin website could not be onboarded because of a
|
|
234
|
+
// fallback sentence.
|
|
235
|
+
//
|
|
236
|
+
// It was never ours to invent from a crawl either: by the time an app is
|
|
237
|
+
// generated the contact details the customer actually gave us are known,
|
|
238
|
+
// and those are the ones that should be answered with. Templates that
|
|
239
|
+
// want a specific line still carry their own.
|
|
239
240
|
return newHandlers;
|
|
240
241
|
}
|
|
242
|
+
/**
|
|
243
|
+
* None. Entities existed to resolve slots for the NLU; both are gone.
|
|
244
|
+
*
|
|
245
|
+
* Templates may still carry an `entities` array from when they were
|
|
246
|
+
* exported — it is ignored rather than removed at the source, so an older
|
|
247
|
+
* template does not have to be republished to behave correctly.
|
|
248
|
+
*/
|
|
241
249
|
generateEntities(template) {
|
|
242
250
|
return [];
|
|
243
251
|
}
|
|
@@ -253,4 +261,15 @@ class SMBTemplateFactory extends TemplateFactory_1.TemplateFactory {
|
|
|
253
261
|
}
|
|
254
262
|
}
|
|
255
263
|
exports.SMBTemplateFactory = SMBTemplateFactory;
|
|
264
|
+
/**
|
|
265
|
+
* Job types as the crawler writes them, matched against the keys the
|
|
266
|
+
* descriptions are held under.
|
|
267
|
+
*
|
|
268
|
+
* Arachne reports `business.services` in prose — "pest control", "bed bug
|
|
269
|
+
* treatment" — while the map is keyed `pest_control`. Every multi-word trade
|
|
270
|
+
* therefore missed and fell through to the generic description, silently.
|
|
271
|
+
*/
|
|
272
|
+
function normalizeJobType(jobType) {
|
|
273
|
+
return jobType.toLowerCase().trim().replace(/[\s-]+/g, "_");
|
|
274
|
+
}
|
|
256
275
|
//# sourceMappingURL=SMBTemplateFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SMBTemplateFactory.js","sourceRoot":"","sources":["../../src/smbs/SMBTemplateFactory.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SMBTemplateFactory.js","sourceRoot":"","sources":["../../src/smbs/SMBTemplateFactory.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;AAclC,iDAAkD;AAElD,2CAA0E;AAE1E,wDAAqD;AAMrD,MAAa,kBAAmB,SAAQ,iCAA4B;IAGhE,YAAY,KAA+B;QACvC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,iBAAiB,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,iBAAiB,CAAC;IACtD,CAAC;IAED;;;;;;OAMG;IACH,MAAM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,EACZ,QAAgE;QAEhE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC/C,CAAC;IAED,gBAAgB,CACZ,QAAqB,EACrB,QAAiE;QAEjE,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC3E,CAAC;CACJ;AA/UD,gDA+UC;AAED;;;;;;;GAOG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACrC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAChE,CAAC"}
|
package/lib/smbs/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/*! Copyright (c) 2024, XAPP AI */
|
|
2
|
+
import { Data } from "stentor-models";
|
|
2
3
|
export interface SMBTemplateItem {
|
|
3
4
|
/**
|
|
4
5
|
* Name of the template
|
|
@@ -21,3 +22,18 @@ export interface SMBTemplateItem {
|
|
|
21
22
|
* Our small business templates
|
|
22
23
|
*/
|
|
23
24
|
export declare const SMB_TEMPLATES: SMBTemplateItem[];
|
|
25
|
+
/**
|
|
26
|
+
* What the LeadGeneration handler starts with on a generated app.
|
|
27
|
+
*
|
|
28
|
+
* These were being set by hand after the fact, so an app was only as good as
|
|
29
|
+
* whoever remembered. `chat.followUp` is a single space on purpose: it
|
|
30
|
+
* suppresses the follow-up line without the handler treating it as unset.
|
|
31
|
+
*
|
|
32
|
+
* Cast because `Data["chat"]` in stentor-models only models `suggestionChips`,
|
|
33
|
+
* so `followUp` does not typecheck even though it is used in production
|
|
34
|
+
* content and in contact-capture-handler's own fixtures — which cast for the
|
|
35
|
+
* same reason. The honest fix is to add it to the model in stentor-models;
|
|
36
|
+
* until then this repeats the existing workaround rather than inventing a
|
|
37
|
+
* second one.
|
|
38
|
+
*/
|
|
39
|
+
export declare const LEAD_GENERATION_DEFAULT_DATA: Data;
|
package/lib/smbs/constants.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/*! Copyright (c) 2024, XAPP AI */
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.SMB_TEMPLATES = void 0;
|
|
3
|
+
exports.LEAD_GENERATION_DEFAULT_DATA = exports.SMB_TEMPLATES = void 0;
|
|
5
4
|
/**
|
|
6
5
|
* Our small business templates
|
|
7
6
|
*/
|
|
@@ -80,6 +79,12 @@ exports.SMB_TEMPLATES = [
|
|
|
80
79
|
description: "Travel agents, brokers",
|
|
81
80
|
url: "https://templates.xapp.ai/travel.json"
|
|
82
81
|
}, */
|
|
82
|
+
{
|
|
83
|
+
name: "Pest Control",
|
|
84
|
+
id: "pest-control",
|
|
85
|
+
description: "Pest, termite, rodent and wildlife control.",
|
|
86
|
+
url: "https://templates.xapp.ai/pest-control.json"
|
|
87
|
+
},
|
|
83
88
|
{
|
|
84
89
|
name: "Everything Else",
|
|
85
90
|
id: "contact-capture",
|
|
@@ -87,4 +92,28 @@ exports.SMB_TEMPLATES = [
|
|
|
87
92
|
url: "https://templates.xapp.ai/contact-capture.json"
|
|
88
93
|
}
|
|
89
94
|
];
|
|
95
|
+
/**
|
|
96
|
+
* What the LeadGeneration handler starts with on a generated app.
|
|
97
|
+
*
|
|
98
|
+
* These were being set by hand after the fact, so an app was only as good as
|
|
99
|
+
* whoever remembered. `chat.followUp` is a single space on purpose: it
|
|
100
|
+
* suppresses the follow-up line without the handler treating it as unset.
|
|
101
|
+
*
|
|
102
|
+
* Cast because `Data["chat"]` in stentor-models only models `suggestionChips`,
|
|
103
|
+
* so `followUp` does not typecheck even though it is used in production
|
|
104
|
+
* content and in contact-capture-handler's own fixtures — which cast for the
|
|
105
|
+
* same reason. The honest fix is to add it to the model in stentor-models;
|
|
106
|
+
* until then this repeats the existing workaround rather than inventing a
|
|
107
|
+
* second one.
|
|
108
|
+
*/
|
|
109
|
+
exports.LEAD_GENERATION_DEFAULT_DATA = {
|
|
110
|
+
inputUnknownStrategy: "REPROMPT",
|
|
111
|
+
REMOVE_TRAILING_LINES_WITHOUT_HIGHLIGHTS: true,
|
|
112
|
+
QNA_BOT_LONGEST_HIGHLIGHT: false,
|
|
113
|
+
REMOVE_LEADING_LINES_WITHOUT_HIGHLIGHTS: true,
|
|
114
|
+
FUZZY_MATCH_FAQS: true,
|
|
115
|
+
chat: {
|
|
116
|
+
followUp: " "
|
|
117
|
+
}
|
|
118
|
+
};
|
|
90
119
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/smbs/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/smbs/constants.ts"],"names":[],"mappings":";;;AAyBA;;GAEG;AACU,QAAA,aAAa,GAAsB;IAC5C;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,6CAA6C;QAC1D,GAAG,EAAE,kDAAkD;KAC1D;IACD;QACI,IAAI,EAAE,qBAAqB;QAC3B,EAAE,EAAE,YAAY;QAChB,WAAW,EAAE,qBAAqB;QAClC,GAAG,EAAE,2CAA2C;KACnD;IACD;;;;;;SAMK;IACL;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EAAE,8DAA8D;QAC3E,GAAG,EAAE,uDAAuD;KAC/D;IACD;QACI,IAAI,EAAE,wDAAwD;QAC9D,EAAE,EAAE,2BAA2B;QAC/B,WAAW,EAAE,0DAA0D;QACvE,GAAG,EAAE,0DAA0D;KAClE;IACD;QACI,IAAI,EAAE,gCAAgC;QACtC,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EAAE,iFAAiF;QAC9F,GAAG,EAAE,sDAAsD;KAC9D;IACD;QACI,IAAI,EAAE,WAAW;QACjB,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,2BAA2B;QACxC,GAAG,EAAE,0CAA0C;KAClD;IACD;QACI,IAAI,EAAE,gBAAgB;QACtB,EAAE,EAAE,gBAAgB;QACpB,WAAW,EAAE,SAAS;QACtB,GAAG,EAAE,+CAA+C;KACvD;IACD;;;;;;;;;;;;;;;;;;;;;;;;SAwBK;IACL;QACI,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,cAAc;QAClB,WAAW,EAAE,6CAA6C;QAC1D,GAAG,EAAE,6CAA6C;KACrD;IACD;QACI,IAAI,EAAE,iBAAiB;QACvB,EAAE,EAAE,iBAAiB;QACrB,WAAW,EAAE,sEAAsE;QACnF,GAAG,EAAE,gDAAgD;KACxD;CACJ,CAAC;AACF;;;;;;;;;;;;;GAaG;AACU,QAAA,4BAA4B,GAAG;IACxC,oBAAoB,EAAE,UAAU;IAChC,wCAAwC,EAAE,IAAI;IAC9C,yBAAyB,EAAE,KAAK;IAChC,uCAAuC,EAAE,IAAI;IAC7C,gBAAgB,EAAE,IAAI;IACtB,IAAI,EAAE;QACF,QAAQ,EAAE,GAAG;KAChB;CACe,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.87.1",
|
|
8
8
|
"description": "Custom App templates for OVAI stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
"chai": "4.5.0",
|
|
23
23
|
"chai-as-promised": "7.1.2",
|
|
24
24
|
"mocha": "11.8.0",
|
|
25
|
-
"puppeteer-core": "25.
|
|
26
|
-
"stentor-constants": "1.74.
|
|
27
|
-
"stentor-guards": "1.74.
|
|
28
|
-
"stentor-interaction-model": "1.74.
|
|
29
|
-
"stentor-models": "1.
|
|
30
|
-
"stentor-request": "1.74.
|
|
25
|
+
"puppeteer-core": "25.8.0",
|
|
26
|
+
"stentor-constants": "1.74.5",
|
|
27
|
+
"stentor-guards": "1.74.5",
|
|
28
|
+
"stentor-interaction-model": "1.74.8",
|
|
29
|
+
"stentor-models": "1.79.0",
|
|
30
|
+
"stentor-request": "1.74.8",
|
|
31
31
|
"ts-node": "10.9.2",
|
|
32
32
|
"typescript": "5.9.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@xapp/oc-studio-starter-template": "1.3.0",
|
|
36
|
-
"@xapp/ovai-lib": "1.86.
|
|
37
|
-
"@xapp/stentor-alexa-lib": "1.86.
|
|
38
|
-
"@xapp/stentor-app": "1.86.
|
|
39
|
-
"@xapp/stentor-handler-media": "1.86.
|
|
40
|
-
"@xapp/stentor-interaction-model-profiler": "1.86.
|
|
41
|
-
"stentor-interaction-model": "1.74.
|
|
36
|
+
"@xapp/ovai-lib": "1.86.6",
|
|
37
|
+
"@xapp/stentor-alexa-lib": "1.86.5",
|
|
38
|
+
"@xapp/stentor-app": "1.86.5",
|
|
39
|
+
"@xapp/stentor-handler-media": "1.86.6",
|
|
40
|
+
"@xapp/stentor-interaction-model-profiler": "1.86.5",
|
|
41
|
+
"stentor-interaction-model": "1.74.8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@xapp/arachne-web-service": "1.x",
|