@xapp/stentor-service-generative-ai 1.89.0 → 1.89.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.
Files changed (88) hide show
  1. package/lib/AWSBedrockService.d.ts +67 -0
  2. package/lib/AWSBedrockService.js +133 -0
  3. package/lib/AWSBedrockService.js.map +1 -0
  4. package/lib/ClaudeService.d.ts +77 -0
  5. package/lib/ClaudeService.js +142 -0
  6. package/lib/ClaudeService.js.map +1 -0
  7. package/lib/FallbackLLMService.d.ts +46 -0
  8. package/lib/FallbackLLMService.js +83 -0
  9. package/lib/FallbackLLMService.js.map +1 -0
  10. package/lib/GenerativeAIService.d.ts +49 -0
  11. package/lib/GenerativeAIService.js +130 -0
  12. package/lib/GenerativeAIService.js.map +1 -0
  13. package/lib/OpenAIService.d.ts +33 -0
  14. package/lib/OpenAIService.js +76 -0
  15. package/lib/OpenAIService.js.map +1 -0
  16. package/lib/http/HTTPService.d.ts +18 -0
  17. package/lib/http/HTTPService.js +4 -0
  18. package/lib/http/HTTPService.js.map +1 -0
  19. package/lib/http/NodeHTTPService.d.ts +8 -0
  20. package/lib/http/NodeHTTPService.js +70 -0
  21. package/lib/http/NodeHTTPService.js.map +1 -0
  22. package/lib/http/index.d.ts +3 -0
  23. package/lib/http/index.js +20 -0
  24. package/lib/http/index.js.map +1 -0
  25. package/lib/index.d.ts +10 -0
  26. package/lib/index.js +27 -0
  27. package/lib/index.js.map +1 -0
  28. package/lib/models/ChatSummary.d.ts +10 -0
  29. package/lib/models/ChatSummary.js +4 -0
  30. package/lib/models/ChatSummary.js.map +1 -0
  31. package/lib/models/EmailAnalysis.d.ts +73 -0
  32. package/lib/models/EmailAnalysis.js +4 -0
  33. package/lib/models/EmailAnalysis.js.map +1 -0
  34. package/lib/models/EngagementAnalysis.d.ts +93 -0
  35. package/lib/models/EngagementAnalysis.js +4 -0
  36. package/lib/models/EngagementAnalysis.js.map +1 -0
  37. package/lib/models/GenerativeAIService.d.ts +65 -0
  38. package/lib/models/GenerativeAIService.js +3 -0
  39. package/lib/models/GenerativeAIService.js.map +1 -0
  40. package/lib/models/LLMService.d.ts +24 -0
  41. package/lib/models/LLMService.js +4 -0
  42. package/lib/models/LLMService.js.map +1 -0
  43. package/lib/models/LeadAnalysis.d.ts +105 -0
  44. package/lib/models/LeadAnalysis.js +4 -0
  45. package/lib/models/LeadAnalysis.js.map +1 -0
  46. package/lib/models/Prompt.d.ts +37 -0
  47. package/lib/models/Prompt.js +8 -0
  48. package/lib/models/Prompt.js.map +1 -0
  49. package/lib/models/PromptGenerator.d.ts +6 -0
  50. package/lib/models/PromptGenerator.js +4 -0
  51. package/lib/models/PromptGenerator.js.map +1 -0
  52. package/lib/models/ResponseParser.d.ts +5 -0
  53. package/lib/models/ResponseParser.js +4 -0
  54. package/lib/models/ResponseParser.js.map +1 -0
  55. package/lib/models/WebsiteAnalysis.d.ts +48 -0
  56. package/lib/models/WebsiteAnalysis.js +4 -0
  57. package/lib/models/WebsiteAnalysis.js.map +1 -0
  58. package/lib/models/errors.d.ts +7 -0
  59. package/lib/models/errors.js +15 -0
  60. package/lib/models/errors.js.map +1 -0
  61. package/lib/models/index.d.ts +10 -0
  62. package/lib/models/index.js +27 -0
  63. package/lib/models/index.js.map +1 -0
  64. package/lib/prompts/AnalyzeEmail.d.ts +36 -0
  65. package/lib/prompts/AnalyzeEmail.js +385 -0
  66. package/lib/prompts/AnalyzeEmail.js.map +1 -0
  67. package/lib/prompts/AnalyzeLead.d.ts +59 -0
  68. package/lib/prompts/AnalyzeLead.js +396 -0
  69. package/lib/prompts/AnalyzeLead.js.map +1 -0
  70. package/lib/prompts/AnalyzeTranscript.d.ts +24 -0
  71. package/lib/prompts/AnalyzeTranscript.js +202 -0
  72. package/lib/prompts/AnalyzeTranscript.js.map +1 -0
  73. package/lib/prompts/AnalyzeWebsite.d.ts +10 -0
  74. package/lib/prompts/AnalyzeWebsite.js +176 -0
  75. package/lib/prompts/AnalyzeWebsite.js.map +1 -0
  76. package/lib/prompts/ChatSummary.d.ts +62 -0
  77. package/lib/prompts/ChatSummary.js +67 -0
  78. package/lib/prompts/ChatSummary.js.map +1 -0
  79. package/lib/prompts/index.d.ts +5 -0
  80. package/lib/prompts/index.js +22 -0
  81. package/lib/prompts/index.js.map +1 -0
  82. package/lib/utils/extractJSON.d.ts +10 -0
  83. package/lib/utils/extractJSON.js +17 -0
  84. package/lib/utils/extractJSON.js.map +1 -0
  85. package/lib/utils/standardizeTerms.d.ts +15 -0
  86. package/lib/utils/standardizeTerms.js +53 -0
  87. package/lib/utils/standardizeTerms.js.map +1 -0
  88. package/package.json +3 -2
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.GenerativeAIService = void 0;
13
+ const AnalyzeEmail_1 = require("./prompts/AnalyzeEmail");
14
+ const AnalyzeLead_1 = require("./prompts/AnalyzeLead");
15
+ const AnalyzeTranscript_1 = require("./prompts/AnalyzeTranscript");
16
+ const prompts_1 = require("./prompts");
17
+ const AnalyzeWebsite_1 = require("./prompts/AnalyzeWebsite");
18
+ class GenerativeAIService {
19
+ constructor(llmService) {
20
+ this.llmService = llmService;
21
+ }
22
+ /**
23
+ * Executes a custom prompt that the user is responsible for creating and parsing.
24
+ *
25
+ * @param prompt
26
+ */
27
+ customPrompt(prompt) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ return this.llmService.generate(prompt);
30
+ });
31
+ }
32
+ /**
33
+ * Can take in an external lead and help summarize and classify.
34
+ *
35
+ * @param lead
36
+ */
37
+ analyzeLead(lead, options) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const prompt = (0, AnalyzeLead_1.generateAnalyzeLead)({
40
+ channel: lead.source,
41
+ businessDescription: (options === null || options === void 0 ? void 0 : options.businessDescription) || "",
42
+ highValueLeadDescription: (options === null || options === void 0 ? void 0 : options.highValueLeadDescription) || "",
43
+ fields: lead.fields,
44
+ transcript: lead.transcript
45
+ });
46
+ const llmResponse = yield this.llmService.generate(prompt, {
47
+ timeout: options === null || options === void 0 ? void 0 : options.timeout
48
+ });
49
+ const analysis = (0, AnalyzeLead_1.analyzeLeadResponseParse)(llmResponse.text);
50
+ // remove highValueLead if a description is not provided
51
+ if (!(options === null || options === void 0 ? void 0 : options.highValueLeadDescription)) {
52
+ delete analysis.highValueLead;
53
+ }
54
+ analysis.analysisVersion = "1.2.0"; // Update this version when the analysis process changes
55
+ return analysis;
56
+ });
57
+ }
58
+ /**
59
+ * Analyze an inbound email (or email thread) to classify and extract lead information.
60
+ *
61
+ * Combines lead classification (contactType, serviceType, jobType, urgency) with
62
+ * structured contact extraction in a single LLM call. Handles direct customer emails,
63
+ * FSM/CRM lead notification emails, and multi-email threads.
64
+ *
65
+ * @param email - The email content and optional thread history to analyze.
66
+ * @param options - Optional business context and LLM call options.
67
+ */
68
+ analyzeEmail(email, options) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const prompt = (0, AnalyzeEmail_1.generateAnalyzeEmail)({
71
+ businessDescription: (options === null || options === void 0 ? void 0 : options.businessDescription) || "",
72
+ highValueLeadDescription: (options === null || options === void 0 ? void 0 : options.highValueLeadDescription) || "",
73
+ email
74
+ });
75
+ const llmResponse = yield this.llmService.generate(prompt, {
76
+ timeout: options === null || options === void 0 ? void 0 : options.timeout
77
+ });
78
+ const analysis = (0, AnalyzeEmail_1.analyzeEmailResponseParse)(llmResponse.text);
79
+ // remove highValueLead if a description is not provided
80
+ if (!(options === null || options === void 0 ? void 0 : options.highValueLeadDescription)) {
81
+ delete analysis.highValueLead;
82
+ }
83
+ analysis.analysisVersion = AnalyzeEmail_1.ANALYZE_EMAIL_VERSION;
84
+ return analysis;
85
+ });
86
+ }
87
+ /**
88
+ * Analyze a completed conversation transcript to derive engagement metadata: sentiment,
89
+ * topics, whether the AI agent contained/resolved the conversation without human handoff,
90
+ * escalation, and business-defined categories.
91
+ *
92
+ * @param transcript - The chat transcript to analyze.
93
+ * @param config - Optional categories and business context to customize the analysis.
94
+ */
95
+ analyzeTranscript(transcript, config) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ const prompt = (0, AnalyzeTranscript_1.generateAnalyzeTranscript)({
98
+ transcript,
99
+ businessContext: config === null || config === void 0 ? void 0 : config.businessContext,
100
+ categories: config === null || config === void 0 ? void 0 : config.categories
101
+ });
102
+ const llmResponse = yield this.llmService.generate(prompt);
103
+ const analysis = (0, AnalyzeTranscript_1.analyzeTranscriptResponseParse)(llmResponse.text);
104
+ analysis.analysisVersion = AnalyzeTranscript_1.ANALYZE_TRANSCRIPT_VERSION;
105
+ return analysis;
106
+ });
107
+ }
108
+ /**
109
+ * Summarize a chat transcript
110
+ * @param transcript
111
+ * @returns Returns the summarized chat of a lead transcript
112
+ */
113
+ summarizeChatFromTranscript(transcript) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const prompt = (0, prompts_1.generateChatSummaryPromptFromLeadTranscript)({ transcript });
116
+ const llmResponse = yield this.llmService.generate(prompt);
117
+ return (0, prompts_1.chatSummaryResponseParse)(llmResponse.text);
118
+ });
119
+ }
120
+ analyzeWebsite(markdown, data) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const { url } = data;
123
+ const prompt = (0, AnalyzeWebsite_1.generateAnalyzeWebsite)({ markdown, url });
124
+ const llmResponse = yield this.llmService.generate(prompt);
125
+ return (0, AnalyzeWebsite_1.parseAnalyzeWebsiteResponse)(llmResponse.text);
126
+ });
127
+ }
128
+ }
129
+ exports.GenerativeAIService = GenerativeAIService;
130
+ //# sourceMappingURL=GenerativeAIService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenerativeAIService.js","sourceRoot":"","sources":["../src/GenerativeAIService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,yDAAgH;AAChH,uDAAsF;AACtF,mEAAoI;AACpI,uCAAkG;AAGlG,6DAA+F;AAE/F,MAAa,mBAAmB;IAG5B,YAAY,UAAsB;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACG,YAAY,CAAC,MAAc;;YAC7B,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5C,CAAC;KAAA;IAED;;;;OAIG;IACG,WAAW,CAAC,IAAkB,EAAE,OAA4B;;YAC9D,MAAM,MAAM,GAAG,IAAA,iCAAmB,EAAC;gBAC/B,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,mBAAmB,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,KAAI,EAAE;gBACvD,wBAAwB,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,wBAAwB,KAAI,EAAE;gBACjE,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;aAC9B,CAAC,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE;gBACvD,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;aAC5B,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,IAAA,sCAAwB,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAE5D,wDAAwD;YACxD,IAAI,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,wBAAwB,C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,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAE3D,MAAM,QAAQ,GAAG,IAAA,kDAA8B,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAElE,QAAQ,CAAC,eAAe,GAAG,8CAA0B,CAAC;YAEtD,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;IAED;;;;OAIG;IACG,2BAA2B,CAAC,UAAsC;;YACpE,MAAM,MAAM,GAAG,IAAA,qDAA2C,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC;YAC3E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3D,OAAO,IAAA,kCAAwB,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACtD,CAAC;KAAA;IAEK,cAAc,CAAC,QAAgB,EAAE,IAAwB;;YAC3D,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;YAErB,MAAM,MAAM,GAAG,IAAA,uCAAsB,EAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC;YACzD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3D,OAAO,IAAA,4CAA2B,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzD,CAAC;KAAA;CACJ;AAtHD,kDAsHC"}
@@ -0,0 +1,33 @@
1
+ /*! Copyright (c) 2024, XAPP AI */
2
+ import type { APIKeyGetter, LLMService, LLMServiceResponse, Prompt } from "./models";
3
+ import type { HTTPService } from "./http/HTTPService";
4
+ export declare const DEFAULT_OPEN_AI_URL = "https://api.openai.com";
5
+ export interface OpenAIServiceProps {
6
+ /**
7
+ * Returns the API key to use for the OpenAI service authorization
8
+ */
9
+ keyGetter: APIKeyGetter;
10
+ /**
11
+ * The HTTP service to use for making requests
12
+ *
13
+ * Defaults to a Node.js HTTP service if not provided.
14
+ */
15
+ httpService?: Pick<HTTPService, "post">;
16
+ /**
17
+ * The base URL for the OpenAI service
18
+ */
19
+ openAIUrl?: string;
20
+ }
21
+ export declare class OpenAIService implements LLMService {
22
+ private readonly keyGetter;
23
+ private readonly openAIUrl;
24
+ private readonly httpService;
25
+ constructor(props: OpenAIServiceProps);
26
+ generate(prompt: Prompt, options?: {
27
+ timeout?: number;
28
+ }): Promise<LLMServiceResponse>;
29
+ completions(prompt: Prompt, options?: {
30
+ timeout?: number;
31
+ }): Promise<LLMServiceResponse>;
32
+ private post;
33
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2024, XAPP AI */
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.OpenAIService = exports.DEFAULT_OPEN_AI_URL = void 0;
25
+ const models_1 = require("./models");
26
+ const http_1 = require("./http");
27
+ exports.DEFAULT_OPEN_AI_URL = "https://api.openai.com";
28
+ class OpenAIService {
29
+ constructor(props) {
30
+ this.keyGetter = props.keyGetter;
31
+ this.openAIUrl = props.openAIUrl || exports.DEFAULT_OPEN_AI_URL;
32
+ this.httpService = props.httpService || new http_1.NodeHttpService();
33
+ }
34
+ generate(prompt, options) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ const { type } = prompt;
37
+ if (type === "completions") {
38
+ return this.completions(prompt, options);
39
+ }
40
+ throw new models_1.InvalidPromptTypeError(type);
41
+ });
42
+ }
43
+ completions(prompt, options) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const { type } = prompt, remainingPrompt = __rest(prompt, ["type"]);
46
+ const response = yield this.post({
47
+ path: "v1/chat/completions",
48
+ body: Object.assign({}, remainingPrompt)
49
+ }, options);
50
+ let content;
51
+ try {
52
+ content = JSON.parse(response.body).choices[0].message.content;
53
+ }
54
+ catch (e) {
55
+ content = response.body;
56
+ }
57
+ return { text: content };
58
+ });
59
+ }
60
+ post(props, options) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const apiKey = yield this.keyGetter();
63
+ const response = yield this.httpService.post({
64
+ url: `${this.openAIUrl}/${props.path}`,
65
+ body: props.body,
66
+ headers: {
67
+ Authorization: `Bearer ${apiKey}`
68
+ },
69
+ timeout: options === null || options === void 0 ? void 0 : options.timeout
70
+ });
71
+ return response;
72
+ });
73
+ }
74
+ }
75
+ exports.OpenAIService = OpenAIService;
76
+ //# sourceMappingURL=OpenAIService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAIService.js","sourceRoot":"","sources":["../src/OpenAIService.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;AAGlC,qCAAkD;AAElD,iCAAyC;AAE5B,QAAA,mBAAmB,GAAG,wBAAwB,CAAC;AAmB5D,MAAa,aAAa;IAKtB,YAAY,KAAyB;QACjC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;QACjC,IAAI,CAAC,SAAS,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AAI,KAAK,CAAC,IAAI,EAAE;gBACtC,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE;oBACL,aAAa,EAAE,UAAU,MAAM,EAAE;iBACpC;gBACD,OAAO,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO;aAC5B,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CACJ;AAtDD,sCAsDC"}
@@ -0,0 +1,18 @@
1
+ /*! Copyright (c) 2024, XAPP AI */
2
+ export type Headers = Record<string, string | number>;
3
+ export interface PostProps {
4
+ url: string | URL;
5
+ body: string | object;
6
+ headers?: Headers;
7
+ /**
8
+ * Optional timeout in milliseconds for the request.
9
+ */
10
+ timeout?: number;
11
+ }
12
+ export interface Response {
13
+ status: number;
14
+ body: string;
15
+ }
16
+ export interface HTTPService {
17
+ post(props: PostProps): Promise<Response>;
18
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2024, XAPP AI */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=HTTPService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTTPService.js","sourceRoot":"","sources":["../../src/http/HTTPService.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
@@ -0,0 +1,8 @@
1
+ import { HTTPService, PostProps, Response } from "./HTTPService";
2
+ export declare class NodeHttpService implements HTTPService {
3
+ post(props: PostProps): Promise<Response>;
4
+ }
5
+ export declare class InvalidHTTPUrlError extends Error {
6
+ name: string;
7
+ constructor(url: string);
8
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.InvalidHTTPUrlError = exports.NodeHttpService = void 0;
7
+ /*! Copyright (c) 2024, XAPP AI */
8
+ const http_1 = __importDefault(require("http"));
9
+ const https_1 = __importDefault(require("https"));
10
+ class NodeHttpService {
11
+ post(props) {
12
+ var _a;
13
+ const url = new URL(props.url);
14
+ const http = retrieveHttp(url);
15
+ const bodyIsObject = typeof props.body !== "string";
16
+ const postData = typeof props.body === "string" ? props.body : JSON.stringify(props.body);
17
+ const baseHeaders = {
18
+ "Content-Length": Buffer.byteLength(postData)
19
+ };
20
+ if (bodyIsObject) {
21
+ baseHeaders["Content-Type"] = "application/json";
22
+ }
23
+ const timeoutMs = (_a = props.timeout) !== null && _a !== void 0 ? _a : 30000; // Optional timeout from props or default
24
+ return new Promise((resolve, reject) => {
25
+ const request = http.request({
26
+ host: url.hostname, // use hostname, not host
27
+ port: url.port || (url.protocol === "https:" ? 443 : 80),
28
+ path: url.pathname + url.search, // include query params
29
+ method: "POST",
30
+ headers: Object.assign(Object.assign({}, props.headers), baseHeaders)
31
+ }, (response) => {
32
+ let body = "";
33
+ response.setEncoding("utf-8");
34
+ response.on("data", (chunk) => (body += chunk));
35
+ response.on("end", () => resolve({ body, status: response.statusCode }));
36
+ response.on("error", (err) => reject(err));
37
+ });
38
+ request.setTimeout(timeoutMs, () => {
39
+ request.destroy(new Error(`Request timed out after ${timeoutMs}ms`));
40
+ });
41
+ request.on("error", (err) => reject(err));
42
+ request.write(postData);
43
+ request.end();
44
+ });
45
+ }
46
+ }
47
+ exports.NodeHttpService = NodeHttpService;
48
+ class InvalidHTTPUrlError extends Error {
49
+ constructor(url) {
50
+ super(`Unable to decipher URL: ${url}`);
51
+ this.name = InvalidHTTPUrlError.name;
52
+ }
53
+ }
54
+ exports.InvalidHTTPUrlError = InvalidHTTPUrlError;
55
+ /**
56
+ * Retrieves the proper HTTP node module based on the url.
57
+ *
58
+ * @param url
59
+ * @returns
60
+ */
61
+ function retrieveHttp(url) {
62
+ if (url.toString().startsWith("https")) {
63
+ return https_1.default;
64
+ }
65
+ else if (url.toString().startsWith("http")) {
66
+ return http_1.default;
67
+ }
68
+ throw new InvalidHTTPUrlError(url.toString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AKG;AACH,SAAS,YAAY,CAAC,GAAiB;IACnC,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACrC,OAAO,eAAK,CAAC;IACjB,CAAC;SAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,OAAO,cAAI,CAAC;IAChB,CAAC;IACD,MAAM,IAAI,mBAAmB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,3 @@
1
+ /*! Copyright (c) 2024, XAPP AI */
2
+ export * from "./HTTPService";
3
+ export * from "./NodeHTTPService";
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2024, XAPP AI */
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./HTTPService"), exports);
19
+ __exportStar(require("./NodeHTTPService"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";AAAA,kCAAkC;;;;;;;;;;;;;;;;AAElC,gDAA8B;AAC9B,oDAAkC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ /*! Copyright (c) 2024, XAPP AI */
2
+ export * from "./AWSBedrockService";
3
+ export * from "./ClaudeService";
4
+ export * from "./FallbackLLMService";
5
+ export * from "./GenerativeAIService";
6
+ export * from "./OpenAIService";
7
+ export * from "./http";
8
+ export * from "./models";
9
+ export * from "./prompts";
10
+ export * from "./utils/standardizeTerms";
package/lib/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /*! Copyright (c) 2024, XAPP AI */
18
+ __exportStar(require("./AWSBedrockService"), exports);
19
+ __exportStar(require("./ClaudeService"), exports);
20
+ __exportStar(require("./FallbackLLMService"), exports);
21
+ __exportStar(require("./GenerativeAIService"), exports);
22
+ __exportStar(require("./OpenAIService"), exports);
23
+ __exportStar(require("./http"), exports);
24
+ __exportStar(require("./models"), exports);
25
+ __exportStar(require("./prompts"), exports);
26
+ __exportStar(require("./utils/standardizeTerms"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,kCAAkC;AAClC,sDAAoC;AACpC,kDAAgC;AAChC,uDAAqC;AACrC,wDAAsC;AACtC,kDAAgC;AAChC,yCAAuB;AACvB,2CAAyB;AACzB,4CAA0B;AAC1B,2DAAyC"}
@@ -0,0 +1,10 @@
1
+ /*! Copyright (c) 2024, XAPP AI */
2
+ /**
3
+ * A quick summary returned by the LLM which summerizes the a chat widget transcript.
4
+ */
5
+ export interface ChatSummary {
6
+ /**
7
+ * The summary that is returned by the LLM or undefined if the LLM failed.
8
+ */
9
+ summary: string | undefined;
10
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2024, XAPP AI */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=ChatSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatSummary.js","sourceRoot":"","sources":["../../src/models/ChatSummary.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
@@ -0,0 +1,73 @@
1
+ /*! Copyright (c) 2026, XAPP AI */
2
+ import type { LeadAnalysis } from "./LeadAnalysis";
3
+ export interface EmailThreadMessage {
4
+ role: "customer" | "agent" | "fsm_crm";
5
+ content: string;
6
+ timestamp?: string;
7
+ }
8
+ export interface EmailSender {
9
+ name?: string;
10
+ email: string;
11
+ }
12
+ /**
13
+ * Represents an inbound email (or email thread) to be analyzed.
14
+ */
15
+ export interface EmailAnalysisInput {
16
+ /**
17
+ * The email subject line.
18
+ */
19
+ subject: string;
20
+ /**
21
+ * The email body text. May include an email signature or quoted reply chains — the
22
+ * LLM is instructed to ignore those sections.
23
+ */
24
+ body: string;
25
+ /**
26
+ * The sender of the current (most recent) email.
27
+ */
28
+ from?: EmailSender;
29
+ /**
30
+ * Prior messages in the email thread, oldest first. Used to provide conversation
31
+ * context when the current email is a reply in an ongoing thread.
32
+ */
33
+ threadHistory?: EmailThreadMessage[];
34
+ /**
35
+ * Raw email headers (e.g., Reply-To, X-Mailer). Provides additional context
36
+ * for the LLM to disambiguate the actual contact from template senders
37
+ * (e.g., Jobber, ServiceTitan). Values must be strings; if a header has
38
+ * multiple values, join them before passing.
39
+ */
40
+ headers?: Record<string, string>;
41
+ }
42
+ /**
43
+ * Structured contact information extracted from an email body, particularly useful
44
+ * for FSM/CRM system notification emails (Jobber, ServiceTitan, Housecall Pro, etc.)
45
+ * that embed lead data in a structured text format.
46
+ */
47
+ export interface ExtractedContactInfo {
48
+ fullName?: string;
49
+ phone?: string;
50
+ email?: string;
51
+ address?: string;
52
+ city?: string;
53
+ state?: string;
54
+ zip?: string;
55
+ propertyType?: "residential" | "commercial";
56
+ preferredContactTime?: string;
57
+ /**
58
+ * Confidence score from 0.0 (low) to 1.0 (high) indicating how confident the LLM
59
+ * is in the extracted contact information.
60
+ */
61
+ confidence: number;
62
+ }
63
+ /**
64
+ * Extends the standard LeadAnalysis with email-specific contact extraction fields.
65
+ * Returned by `GenerativeAIService.analyzeEmail()`.
66
+ */
67
+ export interface EmailLeadAnalysis extends LeadAnalysis {
68
+ /**
69
+ * Contact information extracted from the email body. Only populated when the LLM
70
+ * can identify structured contact data (e.g., in FSM/CRM notification emails).
71
+ */
72
+ extractedContact?: ExtractedContactInfo;
73
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2026, XAPP AI */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=EmailAnalysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmailAnalysis.js","sourceRoot":"","sources":["../../src/models/EmailAnalysis.ts"],"names":[],"mappings":";AAAA,kCAAkC"}
@@ -0,0 +1,93 @@
1
+ /*! Copyright (c) 2026, XAPP AI */
2
+ /**
3
+ * Overall sentiment expressed by the customer over the course of the conversation.
4
+ */
5
+ export type EngagementSentiment = "POSITIVE" | "NEUTRAL" | "NEGATIVE";
6
+ /**
7
+ * A single category that a business wants engagement transcripts classified against.
8
+ */
9
+ export interface EngagementAnalysisCategory {
10
+ /**
11
+ * A unique key for the category, e.g. "BILLING_QUESTION". Returned back in the analysis
12
+ * `categories` array and used as the enum value in the structured-output json_schema.
13
+ */
14
+ key: string;
15
+ /**
16
+ * A description of when this category applies, injected into the system prompt so the
17
+ * LLM can decide whether the transcript matches it.
18
+ */
19
+ description: string;
20
+ }
21
+ /**
22
+ * Configuration for `GenerativeAIService.analyzeTranscript()`. Lets a business customize the
23
+ * categories a transcript is classified against and provide additional business context.
24
+ */
25
+ export interface EngagementAnalysisConfig {
26
+ /**
27
+ * The categories to classify the transcript against. Injected into the system prompt and
28
+ * the structured-output json_schema enum. Defaults to `DEFAULT_ENGAGEMENT_CATEGORIES` when
29
+ * omitted.
30
+ */
31
+ categories?: EngagementAnalysisCategory[];
32
+ /**
33
+ * Additional context about the business to help the LLM understand the transcript.
34
+ */
35
+ businessContext?: string;
36
+ }
37
+ /**
38
+ * A category that was determined to apply to the transcript, from the set provided in
39
+ * `EngagementAnalysisConfig.categories` (or the default categories when none was provided).
40
+ */
41
+ export interface EngagementAnalysisCategoryResult {
42
+ key: string;
43
+ }
44
+ /**
45
+ * The result of analyzing an engagement (chat transcript) between a customer and an AI agent.
46
+ * Returned by `GenerativeAIService.analyzeTranscript()`.
47
+ */
48
+ export interface EngagementAnalysis {
49
+ /**
50
+ * The version of the analysis that was performed. This changes when major changes are made
51
+ * to the analysis process. It can be used to determine if the analysis is up to date and
52
+ * needs to be re-run.
53
+ */
54
+ analysisVersion?: string;
55
+ /**
56
+ * The overall sentiment expressed by the customer.
57
+ */
58
+ sentiment?: EngagementSentiment;
59
+ /**
60
+ * The main topics discussed in the conversation.
61
+ */
62
+ topics?: string[];
63
+ /**
64
+ * Whether the AI agent was able to resolve the customer's need without any human handoff.
65
+ */
66
+ containment?: boolean;
67
+ /**
68
+ * Whether the customer's issue or question was resolved by the end of the conversation,
69
+ * regardless of who resolved it (AI or human).
70
+ */
71
+ resolved?: boolean;
72
+ /**
73
+ * Whether the conversation was or needs to be escalated to a human agent.
74
+ */
75
+ escalation?: boolean;
76
+ /**
77
+ * A summary of the conversation.
78
+ */
79
+ summary?: string;
80
+ /**
81
+ * A 2-3 word concise summary of the conversation, main use for this is in a word cloud and
82
+ * on a dashboard list item.
83
+ */
84
+ conciseSummary?: string;
85
+ /**
86
+ * The categories (from `EngagementAnalysisConfig.categories`) that apply to this conversation.
87
+ */
88
+ categories?: EngagementAnalysisCategoryResult[];
89
+ /**
90
+ * An analysis of how the LLM came to its conclusions.
91
+ */
92
+ analysis?: string;
93
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /*! Copyright (c) 2026, XAPP AI */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=EngagementAnalysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EngagementAnalysis.js","sourceRoot":"","sources":["../../src/models/EngagementAnalysis.ts"],"names":[],"mappings":";AAAA,kCAAkC"}