@scout9/app 1.0.0-alpha.0.7.8 → 1.0.0-alpha.0.7.9
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/dist/{dev-5179cacf.cjs → dev-4051ca91.cjs} +11 -7
- package/dist/{index-83cb2dbc.cjs → index-be7da4e6.cjs} +6 -6
- package/dist/index.cjs +3 -3
- package/dist/{macros-44de7397.cjs → macros-f62cceac.cjs} +16 -3
- package/dist/{multipart-parser-440f5bd6.cjs → multipart-parser-c7246b66.cjs} +3 -3
- package/dist/schemas.cjs +1 -1
- package/dist/testing-tools.cjs +2 -2
- package/package.json +1 -1
- package/src/public.d.ts +7 -35
- package/src/runtime/schemas/message.js +15 -3
- package/types/index.d.ts +3887 -346
- package/types/index.d.ts.map +1 -1
|
@@ -21,7 +21,7 @@ var node_url = require('node:url');
|
|
|
21
21
|
var node_events = require('node:events');
|
|
22
22
|
var Stream = require('node:stream');
|
|
23
23
|
var node_string_decoder = require('node:string_decoder');
|
|
24
|
-
var macros = require("./macros-
|
|
24
|
+
var macros = require("./macros-f62cceac.cjs");
|
|
25
25
|
var readline = require('node:readline');
|
|
26
26
|
var process$2 = require('node:process');
|
|
27
27
|
var node_os = require('node:os');
|
|
@@ -25544,7 +25544,8 @@ common.createRequestFunction = createRequestFunction;
|
|
|
25544
25544
|
exports.ForwardRequestLatestMessageRoleEnum = {
|
|
25545
25545
|
Customer: 'customer',
|
|
25546
25546
|
Agent: 'agent',
|
|
25547
|
-
|
|
25547
|
+
System: 'system',
|
|
25548
|
+
Tool: 'tool'
|
|
25548
25549
|
};
|
|
25549
25550
|
exports.GetApiOperationResponseMethodEnum = {
|
|
25550
25551
|
Get: 'get',
|
|
@@ -25692,12 +25693,14 @@ common.createRequestFunction = createRequestFunction;
|
|
|
25692
25693
|
exports.MessageRoleEnum = {
|
|
25693
25694
|
Customer: 'customer',
|
|
25694
25695
|
Agent: 'agent',
|
|
25695
|
-
|
|
25696
|
+
System: 'system',
|
|
25697
|
+
Tool: 'tool'
|
|
25696
25698
|
};
|
|
25697
25699
|
exports.MessageBaseRoleEnum = {
|
|
25698
25700
|
Customer: 'customer',
|
|
25699
25701
|
Agent: 'agent',
|
|
25700
|
-
|
|
25702
|
+
System: 'system',
|
|
25703
|
+
Tool: 'tool'
|
|
25701
25704
|
};
|
|
25702
25705
|
exports.MessageCreateRequestRoleEnum = {
|
|
25703
25706
|
Agent: 'agent',
|
|
@@ -25707,7 +25710,8 @@ common.createRequestFunction = createRequestFunction;
|
|
|
25707
25710
|
exports.MessageGetResponseInnerRoleEnum = {
|
|
25708
25711
|
Customer: 'customer',
|
|
25709
25712
|
Agent: 'agent',
|
|
25710
|
-
|
|
25713
|
+
System: 'system',
|
|
25714
|
+
Tool: 'tool'
|
|
25711
25715
|
};
|
|
25712
25716
|
exports.PmtConfigEngineEnum = {
|
|
25713
25717
|
Scout9: 'scout9',
|
|
@@ -30268,7 +30272,7 @@ common.createRequestFunction = createRequestFunction;
|
|
|
30268
30272
|
var configuration = {};
|
|
30269
30273
|
|
|
30270
30274
|
var name$1 = "@scout9/admin";
|
|
30271
|
-
var version$2 = "1.0.0-alpha.0.0.
|
|
30275
|
+
var version$2 = "1.0.0-alpha.0.0.62";
|
|
30272
30276
|
var description$1 = "";
|
|
30273
30277
|
var main$2 = "./build/index.js";
|
|
30274
30278
|
var types$1 = "./build/index.d.ts";
|
|
@@ -35333,7 +35337,7 @@ function _loadUserPackageJson() {
|
|
|
35333
35337
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
35334
35338
|
_context2.t0 = JSON;
|
|
35335
35339
|
_context2.next = 10;
|
|
35336
|
-
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-
|
|
35340
|
+
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('dev-4051ca91.js', document.baseURI).href))), 'utf-8');
|
|
35337
35341
|
case 10:
|
|
35338
35342
|
_context2.t1 = _context2.sent;
|
|
35339
35343
|
pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var spirits = require("./spirits-02db68e3.cjs");
|
|
4
|
-
var dev = require("./dev-
|
|
5
|
-
var macros = require("./macros-
|
|
4
|
+
var dev = require("./dev-4051ca91.cjs");
|
|
5
|
+
var macros = require("./macros-f62cceac.cjs");
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$2$1 = require('events');
|
|
8
8
|
var require$$1 = require('path');
|
|
@@ -29483,7 +29483,7 @@ class Body {
|
|
|
29483
29483
|
}
|
|
29484
29484
|
const {
|
|
29485
29485
|
toFormData
|
|
29486
|
-
} = await Promise.resolve().then(function () { return require("./multipart-parser-
|
|
29486
|
+
} = await Promise.resolve().then(function () { return require("./multipart-parser-c7246b66.cjs"); });
|
|
29487
29487
|
return toFormData(this.body, ct);
|
|
29488
29488
|
}
|
|
29489
29489
|
|
|
@@ -41884,7 +41884,7 @@ function _loadUserPackageJson() {
|
|
|
41884
41884
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
41885
41885
|
_context.t0 = JSON;
|
|
41886
41886
|
_context.next = 10;
|
|
41887
|
-
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
41887
|
+
return fs__default["default"].readFile(new URL(targetPkgUrl, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-be7da4e6.js', document.baseURI).href))), 'utf-8');
|
|
41888
41888
|
case 10:
|
|
41889
41889
|
_context.t1 = _context.sent;
|
|
41890
41890
|
pkg = _context.t0.parse.call(_context.t0, _context.t1);
|
|
@@ -43176,7 +43176,7 @@ var ProjectFiles = /*#__PURE__*/function () {
|
|
|
43176
43176
|
return ProjectFiles;
|
|
43177
43177
|
}();
|
|
43178
43178
|
|
|
43179
|
-
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43179
|
+
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-be7da4e6.js', document.baseURI).href)));
|
|
43180
43180
|
var __dirname$1 = path__default["default"].dirname(__filename$1);
|
|
43181
43181
|
function zipDirectory(source, out) {
|
|
43182
43182
|
var archive = archiver$1('tar', {
|
|
@@ -43391,7 +43391,7 @@ function _buildApp() {
|
|
|
43391
43391
|
case 11:
|
|
43392
43392
|
_context4.t0 = JSON;
|
|
43393
43393
|
_context4.next = 14;
|
|
43394
|
-
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43394
|
+
return fs__default["default"].readFile(new URL(templatePackagePath, (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-be7da4e6.js', document.baseURI).href))), 'utf-8');
|
|
43395
43395
|
case 14:
|
|
43396
43396
|
_context4.t1 = _context4.sent;
|
|
43397
43397
|
packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
|
package/dist/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require("./index-
|
|
6
|
-
var dev = require("./dev-
|
|
5
|
+
var index = require("./index-be7da4e6.cjs");
|
|
6
|
+
var dev = require("./dev-4051ca91.cjs");
|
|
7
7
|
require("./spirits-02db68e3.cjs");
|
|
8
|
-
require("./macros-
|
|
8
|
+
require("./macros-f62cceac.cjs");
|
|
9
9
|
require('fs');
|
|
10
10
|
require('events');
|
|
11
11
|
require('path');
|
|
@@ -4018,15 +4018,19 @@ function zId(name) {
|
|
|
4018
4018
|
var MessageEntitySchema = z.object({
|
|
4019
4019
|
start: z.number(),
|
|
4020
4020
|
end: z.number(),
|
|
4021
|
-
type: z.string(),
|
|
4021
|
+
type: z.string().optional().nullable(),
|
|
4022
4022
|
option: z.string().optional().nullable(),
|
|
4023
4023
|
text: z.string().optional().nullable()
|
|
4024
4024
|
});
|
|
4025
|
+
|
|
4026
|
+
/**
|
|
4027
|
+
* Follows @scout9/admin Message
|
|
4028
|
+
*/
|
|
4025
4029
|
var MessageSchema = z.object({
|
|
4026
4030
|
id: zId('Message ID', {
|
|
4027
4031
|
description: 'Unique ID for the message'
|
|
4028
4032
|
}),
|
|
4029
|
-
role: z["enum"](['agent', 'customer', 'system']),
|
|
4033
|
+
role: z["enum"](['agent', 'customer', 'system', 'tool']),
|
|
4030
4034
|
content: z.string(),
|
|
4031
4035
|
time: z.string({
|
|
4032
4036
|
description: 'Datetime ISO 8601 timestamp'
|
|
@@ -4053,7 +4057,16 @@ var MessageSchema = z.object({
|
|
|
4053
4057
|
}).optional(),
|
|
4054
4058
|
mediaUrls: z.array(z.string(), {
|
|
4055
4059
|
description: 'Media urls to attach to the transported message'
|
|
4056
|
-
}).optional().nullable()
|
|
4060
|
+
}).optional().nullable(),
|
|
4061
|
+
tool_calls: z.array(z.object({
|
|
4062
|
+
id: z.string(),
|
|
4063
|
+
type: z.string(),
|
|
4064
|
+
"function": z.object({
|
|
4065
|
+
arguments: z.string(),
|
|
4066
|
+
name: z.string()
|
|
4067
|
+
})
|
|
4068
|
+
})).optional().nullable(),
|
|
4069
|
+
tool_call_id: z.string().optional().nullable()
|
|
4057
4070
|
});
|
|
4058
4071
|
|
|
4059
4072
|
var CustomerValueSchema = z.union([z["boolean"](), z.number(), z.string()]);
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require('node:fs');
|
|
4
4
|
require('node:path');
|
|
5
|
-
var index = require("./index-
|
|
5
|
+
var index = require("./index-be7da4e6.cjs");
|
|
6
6
|
require("./spirits-02db68e3.cjs");
|
|
7
|
-
require("./dev-
|
|
7
|
+
require("./dev-4051ca91.cjs");
|
|
8
8
|
require('util');
|
|
9
9
|
require('stream');
|
|
10
10
|
require('path');
|
|
@@ -23,7 +23,7 @@ require('node:url');
|
|
|
23
23
|
require('node:events');
|
|
24
24
|
require('node:stream');
|
|
25
25
|
require('node:string_decoder');
|
|
26
|
-
require("./macros-
|
|
26
|
+
require("./macros-f62cceac.cjs");
|
|
27
27
|
require('node:readline');
|
|
28
28
|
require('node:process');
|
|
29
29
|
require('node:os');
|
package/dist/schemas.cjs
CHANGED
package/dist/testing-tools.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dev = require("./dev-
|
|
5
|
+
var dev = require("./dev-4051ca91.cjs");
|
|
6
6
|
require("./spirits-02db68e3.cjs");
|
|
7
7
|
require('util');
|
|
8
8
|
require('stream');
|
|
@@ -24,7 +24,7 @@ require('node:url');
|
|
|
24
24
|
require('node:events');
|
|
25
25
|
require('node:stream');
|
|
26
26
|
require('node:string_decoder');
|
|
27
|
-
require("./macros-
|
|
27
|
+
require("./macros-f62cceac.cjs");
|
|
28
28
|
require('node:readline');
|
|
29
29
|
require('node:process');
|
|
30
30
|
require('node:os');
|
package/package.json
CHANGED
package/src/public.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
+
import { Message as MessageAdmin, EntityToken as EntityTokenAdmin } from '@scout9/admin'
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
@@ -614,14 +615,9 @@ export type IntentWorkflowEvent = {
|
|
|
614
615
|
/**
|
|
615
616
|
* metadata relationship for the <entity-context>/<entity> element in transcripts and instructions
|
|
616
617
|
* @ingress auto/manual
|
|
618
|
+
* @deprecated use @scout9/admin EntityTokenAdmin
|
|
617
619
|
*/
|
|
618
|
-
export type EntityToken =
|
|
619
|
-
start: number;
|
|
620
|
-
end: number;
|
|
621
|
-
type: string;
|
|
622
|
-
option?: string | null;
|
|
623
|
-
text?: string | null;
|
|
624
|
-
}
|
|
620
|
+
export type EntityToken = EntityTokenAdmin;
|
|
625
621
|
|
|
626
622
|
/**
|
|
627
623
|
* metadata relationship for the <entity-api> element in transcripts and instructions
|
|
@@ -655,34 +651,10 @@ export type EntityApi = {
|
|
|
655
651
|
auth?: Omit<EntityApi, 'auth'>;
|
|
656
652
|
}
|
|
657
653
|
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
* @TODO role:agent is inaccurate it should be "persona"
|
|
663
|
-
*/
|
|
664
|
-
role: "agent" | "customer" | "system";
|
|
665
|
-
content: string;
|
|
666
|
-
/** Datetime ISO 8601 timestamp */
|
|
667
|
-
time: string;
|
|
668
|
-
name?: string | undefined;
|
|
669
|
-
/** Datetime ISO 8601 timestamp */
|
|
670
|
-
scheduled?: string | undefined;
|
|
671
|
-
/** The context generated from the message */
|
|
672
|
-
context?: any | undefined;
|
|
673
|
-
/** Detected intent */
|
|
674
|
-
intent?: (string | undefined) | null;
|
|
675
|
-
/** Confidence score of the assigned intent */
|
|
676
|
-
intentScore?: (number | null) | undefined;
|
|
677
|
-
/** How long to delay the message manually in seconds */
|
|
678
|
-
delayInSeconds?: (number | null) | undefined;
|
|
679
|
-
/** Entities related to the message (gets set after the PMT transform) */
|
|
680
|
-
entities?: EntityToken[] | null;
|
|
681
|
-
/** If set to true, the PMT will not transform, message will be sent as is */
|
|
682
|
-
ignoreTransform?: boolean;
|
|
683
|
-
/** Media urls to attach to the transported message */
|
|
684
|
-
mediaUrls?: string[];
|
|
685
|
-
};
|
|
654
|
+
/**
|
|
655
|
+
* @deprecated use @scout/admin Message
|
|
656
|
+
*/
|
|
657
|
+
export type Message = MessageAdmin;
|
|
686
658
|
|
|
687
659
|
export type PersonaConfiguration = AgentConfiguration;
|
|
688
660
|
|
|
@@ -4,14 +4,17 @@ import { zId } from './utils.js';
|
|
|
4
4
|
export const MessageEntitySchema = z.object({
|
|
5
5
|
start: z.number(),
|
|
6
6
|
end: z.number(),
|
|
7
|
-
type: z.string(),
|
|
7
|
+
type: z.string().optional().nullable(),
|
|
8
8
|
option: z.string().optional().nullable(),
|
|
9
9
|
text: z.string().optional().nullable()
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Follows @scout9/admin Message
|
|
14
|
+
*/
|
|
12
15
|
export const MessageSchema = z.object({
|
|
13
16
|
id: zId('Message ID', {description: 'Unique ID for the message'}),
|
|
14
|
-
role: z.enum(['agent', 'customer', 'system']),
|
|
17
|
+
role: z.enum(['agent', 'customer', 'system', 'tool']),
|
|
15
18
|
content: z.string(),
|
|
16
19
|
time: z.string({description: 'Datetime ISO 8601 timestamp'}),
|
|
17
20
|
name: z.string().optional(),
|
|
@@ -22,5 +25,14 @@ export const MessageSchema = z.object({
|
|
|
22
25
|
delayInSeconds: z.number({description: 'How long to delay the message manually in seconds'}).nullable().optional(),
|
|
23
26
|
entities: z.array(MessageEntitySchema).optional().nullable(),
|
|
24
27
|
ignoreTransform: z.boolean({description: 'If set to true, the PMT will not transform, message will be sent as is'}).optional(),
|
|
25
|
-
mediaUrls: z.array(z.string(), {description: 'Media urls to attach to the transported message'}).optional().nullable()
|
|
28
|
+
mediaUrls: z.array(z.string(), {description: 'Media urls to attach to the transported message'}).optional().nullable(),
|
|
29
|
+
tool_calls: z.array(z.object({
|
|
30
|
+
id: z.string(),
|
|
31
|
+
type: z.string(),
|
|
32
|
+
function: z.object({
|
|
33
|
+
arguments: z.string(),
|
|
34
|
+
name: z.string()
|
|
35
|
+
})
|
|
36
|
+
})).optional().nullable(),
|
|
37
|
+
tool_call_id: z.string().optional().nullable()
|
|
26
38
|
});
|