@scout9/app 1.0.0-alpha.0.1.88 → 1.0.0-alpha.0.1.89
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/{exports-b2e88386.cjs → exports-e7d51b70.cjs} +37 -37
- package/dist/index.cjs +2 -2
- package/dist/{multipart-parser-78fb466c.cjs → multipart-parser-e09a67c9.cjs} +2 -2
- package/dist/{spirits-1dc18cf4.cjs → spirits-3b603262.cjs} +19 -19
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +2 -2
- package/package.json +2 -2
- package/src/core/config/entities.js +2 -2
- package/src/core/config/index.js +2 -2
- package/src/core/config/project.js +1 -1
- package/src/core/config/workflow.js +2 -2
- package/src/core/index.js +4 -4
- package/src/core/sync.js +2 -2
- package/src/core/templates/project-files.js +1 -1
- package/src/public.d.ts +1 -0
- package/src/runtime/client/config.js +1 -1
- package/src/testing-tools/dev.js +13 -13
- package/src/testing-tools/mocks.js +6 -6
- package/src/testing-tools/spirits.js +19 -19
- package/types/index.d.ts +6080 -2952
- package/types/index.d.ts.map +20 -20
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @returns {import('
|
|
4
|
+
* @returns {import('../runtime/client/users.js').IAgent}
|
|
5
5
|
*/
|
|
6
6
|
export const createMockAgent = (firstName = 'Carmela', lastName = 'Soprano') => {
|
|
7
7
|
return {
|
|
@@ -12,7 +12,7 @@ export const createMockAgent = (firstName = 'Carmela', lastName = 'Soprano') =>
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @returns {import('
|
|
15
|
+
* @returns {import('../runtime/client/users.js').ICustomer}
|
|
16
16
|
*/
|
|
17
17
|
export const createMockCustomer = (firstName = 'Tony', lastName = 'Soprano') => {
|
|
18
18
|
return {
|
|
@@ -28,7 +28,7 @@ export const createMockCustomer = (firstName = 'Tony', lastName = 'Soprano') =>
|
|
|
28
28
|
* @param content
|
|
29
29
|
* @param role
|
|
30
30
|
* @param time
|
|
31
|
-
* @returns {import('
|
|
31
|
+
* @returns {import('../runtime/client/message.js').IMessage}
|
|
32
32
|
*/
|
|
33
33
|
export const createMockMessage = (content, role = 'customer', time = moment().toISOString()) => {
|
|
34
34
|
return {
|
|
@@ -42,7 +42,7 @@ export const createMockMessage = (content, role = 'customer', time = moment().t
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* @returns {import('
|
|
45
|
+
* @returns {import('../runtime/client/workflow.js').IConversation}
|
|
46
46
|
*/
|
|
47
47
|
export const createMockConversation = (environment = 'phone', $agent = 'default', $customer = 'default') => {
|
|
48
48
|
return {
|
|
@@ -54,8 +54,8 @@ export const createMockConversation = (environment = 'phone', $agent = 'default'
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* @param {string} message
|
|
57
|
-
* @param {string | import('
|
|
58
|
-
* @returns {import('
|
|
57
|
+
* @param {string | import('../runtime/client/workflow.js').IWorkflowEvent['intent'] | null} intent
|
|
58
|
+
* @returns {import('../runtime/client/workflow.js').IWorkflowEvent}
|
|
59
59
|
*/
|
|
60
60
|
export const createMockWorkflowEvent = (
|
|
61
61
|
message,
|
|
@@ -14,35 +14,35 @@
|
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @typedef {Object} ConversationData
|
|
17
|
-
* @property {import('
|
|
18
|
-
* @property {import('
|
|
19
|
-
* @property {Array<import('
|
|
20
|
-
* @property {import('
|
|
21
|
-
* @property {import('
|
|
17
|
+
* @property {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config - used to define generation and extract persona metadata
|
|
18
|
+
* @property {import('../runtime/client/workflow.js').IConversation} conversation
|
|
19
|
+
* @property {Array<import('../runtime/client/message.js').IMessage>} messages
|
|
20
|
+
* @property {import('../runtime/client/message.js').IMessage} message - the message sent by the customer (should exist in messages)
|
|
21
|
+
* @property {import('../runtime/client/users.js').ICustomer} customer
|
|
22
22
|
* @property {any} context
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* @typedef {Object} ParseOutput
|
|
27
|
-
* @property {Array<import('
|
|
28
|
-
* @property {import('
|
|
29
|
-
* @property {import('
|
|
27
|
+
* @property {Array<import('../runtime/client/message.js').IMessage>} messages
|
|
28
|
+
* @property {import('../runtime/client/workflow.js').IConversation} conversation
|
|
29
|
+
* @property {import('../runtime/client/message.js').IMessage} message
|
|
30
30
|
* @property {any} context
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {Object} WorkflowOutput
|
|
35
|
-
* @property {Array<import('
|
|
36
|
-
* @property {Array<import('
|
|
37
|
-
* @property {import('
|
|
35
|
+
* @property {Array<import('../runtime/client/workflow.js').IWorkflowResponseSlot>} slots
|
|
36
|
+
* @property {Array<import('../runtime/client/message.js').IMessage>} messages
|
|
37
|
+
* @property {import('../runtime/client/workflow.js').IConversation} conversation
|
|
38
38
|
* @property {any} context
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @typedef {Object} GenerateOutput
|
|
43
43
|
* @property {import('@scout9/admin').GenerateResponse | undefined} generate
|
|
44
|
-
* @property {Array<import('
|
|
45
|
-
* @property {import('
|
|
44
|
+
* @property {Array<import('../runtime/client/message.js').IMessage>} messages
|
|
45
|
+
* @property {import('../runtime/client/workflow.js').IConversation} conversation
|
|
46
46
|
* @property {any} context
|
|
47
47
|
*/
|
|
48
48
|
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* @callback WorkflowFun
|
|
58
|
-
* @param {import('
|
|
59
|
-
* @returns {Promise<import('
|
|
58
|
+
* @param {import('../runtime/client/workflow.js').IWorkflowEvent} event - conversation data
|
|
59
|
+
* @returns {Promise<import('../runtime/client/workflow.js').IWorkflowResponse>}
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* @callback IdGeneratorFun
|
|
70
|
-
* @param {import('
|
|
70
|
+
* @param {import('../runtime/client/message.js').IMessage.role} prefix
|
|
71
71
|
* @returns {string}
|
|
72
72
|
*/
|
|
73
73
|
/**
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* @typedef {Object} ConversationEvent
|
|
93
|
-
* @property {Change<import('
|
|
94
|
-
* @property {Change<Array<import('
|
|
93
|
+
* @property {Change<import('../runtime/client/workflow.js').IConversation> & {forwardNote?: string; forward?: import('../runtime/client/message.js').IWorkflowResponseSlot['forward']}} conversation
|
|
94
|
+
* @property {Change<Array<import('../runtime/client/message.js').IMessage>>} messages
|
|
95
95
|
* @property {Change<Object>} context
|
|
96
|
-
* @property {Change<import('
|
|
96
|
+
* @property {Change<import('../runtime/client/message.js').IMessage>} message
|
|
97
97
|
*/
|
|
98
98
|
export const Spirits = {
|
|
99
99
|
|