@scout9/app 1.0.0-alpha.0.1.87 → 1.0.0-alpha.0.1.88

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.
@@ -15,22 +15,22 @@ import { Spirits } from './spirits.js';
15
15
  export class Scout9Test {
16
16
 
17
17
  /**
18
- * @type {import('@scout9/app').Customer}
18
+ * @type {import('@scout9/app').ICustomer}
19
19
  */
20
20
  customer;
21
21
 
22
22
  /**
23
- * @type {import('@scout9/app').Persona}
23
+ * @type {import('@scout9/app').IPersona}
24
24
  */
25
25
  persona;
26
26
 
27
27
  /**
28
- * @type {import('@scout9/app').Conversation}
28
+ * @type {import('@scout9/app').IConversation}
29
29
  */
30
30
  conversation;
31
31
 
32
32
  /**
33
- * @type {import('@scout9/app').Message[]}
33
+ * @type {import('@scout9/app').IMessage[]}
34
34
  */
35
35
  messages;
36
36
 
@@ -41,13 +41,13 @@ export class Scout9Test {
41
41
 
42
42
  /**
43
43
  * @private
44
- * @type {import('scout9/app').Scout9ProjectBuildConfig | null}
44
+ * @type {import('scout9/app').IScout9ProjectBuildConfig | null}
45
45
  */
46
46
  _project = null;
47
47
 
48
48
  /**
49
49
  * @private
50
- * @type {import('@scout9/app').WorkflowFunction | null}
50
+ * @type {import('@scout9/app').IWorkflowFunction | null}
51
51
  */
52
52
  _app = null;
53
53
 
@@ -86,16 +86,16 @@ export class Scout9Test {
86
86
  /**
87
87
  * Mimics a customer message to your app (useful for testing)
88
88
  * @param props - the Scout9Test properties
89
- * @param {import('@scout9/app').Customer | undefined} [props.customer] - customer to use
89
+ * @param {import('@scout9/app').ICustomer | undefined} [props.customer] - customer to use
90
90
  * @param {any | undefined} [props.context] - prior conversation context
91
91
  * @param {string | undefined} [props.persona] id to use
92
- * @param {import('@scout9/app').Conversation | undefined} [props.conversation] - existing conversation
92
+ * @param {import('@scout9/app').IConversation | undefined} [props.conversation] - existing conversation
93
93
  * @param {string | undefined} [props.cwd]
94
94
  * @param {string | undefined} [props.src]
95
95
  * @param {string | undefined} [props.mode]
96
96
  * @param {import('@scout9/admin').Scout9Api} [props.api]
97
- * @param {import('@scout9/app').WorkflowFunction} [props.app]
98
- * @param {import('scout9/app').Scout9ProjectBuildConfig} [props.project]
97
+ * @param {import('@scout9/app').IWorkflowFunction} [props.app]
98
+ * @param {import('scout9/app').IScout9ProjectBuildConfig} [props.project]
99
99
  */
100
100
  constructor(
101
101
  {
@@ -303,8 +303,8 @@ export class Scout9Test {
303
303
  /**
304
304
  * Runs your local app workflow
305
305
  * @param {string} message - the message to run through the workflow
306
- * @param {Omit<Partial<import('@scout9/app').WorkflowEvent>, 'message'> | undefined} [event] - additional event data
307
- * @returns {Promise<import('@scout9/app').WorkflowResponse>}
306
+ * @param {Omit<Partial<import('@scout9/app').IWorkflowEvent>, 'message'> | undefined} [event] - additional event data
307
+ * @returns {Promise<import('@scout9/app').IWorkflowResponse>}
308
308
  */
309
309
  async workflow(message, event = {}) {
310
310
  if (!this._app) {
@@ -324,7 +324,7 @@ export class Scout9Test {
324
324
  * @param {Object} [input] - Generation input, defaults to test registered data such as existing messages, context, and persona information.
325
325
  * @param {string} [input.personaId] - Persona ID to use, defaults to test registered persona id.
326
326
  * @param {Partial<import('@scout9/admin').ConversationCreateRequest>} [input.conversation] - Conversation overrides, defaults to test registered conversation data.
327
- * @param {import('@scout9/app').Message[]} [input.messages] - Message overrides, defaults to test registered message data.
327
+ * @param {import('@scout9/app').IMessage[]} [input.messages] - Message overrides, defaults to test registered message data.
328
328
  * @param {any} [input.context] - Context overrides, defaults to test registered context data.
329
329
  * @returns {Promise<import('@scout9/admin').GenerateResponse>}
330
330
  */
@@ -1,7 +1,7 @@
1
1
  import moment from 'moment';
2
2
 
3
3
  /**
4
- * @returns {import('@scout9/app').Agent}
4
+ * @returns {import('@scout9/app').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('@scout9/app').Customer}
15
+ * @returns {import('@scout9/app').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('@scout9/app').Message}
31
+ * @returns {import('@scout9/app').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('@scout9/app').Conversation}
45
+ * @returns {import('@scout9/app').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('@scout9/app').WorkflowEvent['intent'] | null} intent
58
- * @returns {import('@scout9/app').WorkflowEvent}
57
+ * @param {string | import('@scout9/app').IWorkflowEvent['intent'] | null} intent
58
+ * @returns {import('@scout9/app').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('@scout9/app').Scout9ProjectBuildConfig} config - used to define generation and extract persona metadata
18
- * @property {import('@scout9/app').Conversation} conversation
19
- * @property {Array<import('@scout9/app').Message>} messages
20
- * @property {import('@scout9/app').Message} message - the message sent by the customer (should exist in messages)
21
- * @property {import('@scout9/app').Customer} customer
17
+ * @property {import('@scout9/app').IScout9ProjectBuildConfig} config - used to define generation and extract persona metadata
18
+ * @property {import('@scout9/app').IConversation} conversation
19
+ * @property {Array<import('@scout9/app').IMessage>} messages
20
+ * @property {import('@scout9/app').IMessage} message - the message sent by the customer (should exist in messages)
21
+ * @property {import('@scout9/app').ICustomer} customer
22
22
  * @property {any} context
23
23
  */
24
24
 
25
25
  /**
26
26
  * @typedef {Object} ParseOutput
27
- * @property {Array<import('@scout9/app').Message>} messages
28
- * @property {import('@scout9/app').Conversation} conversation
29
- * @property {import('@scout9/app').Message} message
27
+ * @property {Array<import('@scout9/app').IMessage>} messages
28
+ * @property {import('@scout9/app').IConversation} conversation
29
+ * @property {import('@scout9/app').IMessage} message
30
30
  * @property {any} context
31
31
  */
32
32
 
33
33
  /**
34
34
  * @typedef {Object} WorkflowOutput
35
- * @property {Array<import('@scout9/app').WorkflowResponseSlot>} slots
36
- * @property {Array<import('@scout9/app').Message>} messages
37
- * @property {import('@scout9/app').Conversation} conversation
35
+ * @property {Array<import('@scout9/app').IWorkflowResponseSlot>} slots
36
+ * @property {Array<import('@scout9/app').IMessage>} messages
37
+ * @property {import('@scout9/app').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('@scout9/app').Message>} messages
45
- * @property {import('@scout9/app').Conversation} conversation
44
+ * @property {Array<import('@scout9/app').IMessage>} messages
45
+ * @property {import('@scout9/app').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('@scout9/app').WorkflowEvent} event - conversation data
59
- * @returns {Promise<import('@scout9/app').WorkflowResponse>}
58
+ * @param {import('@scout9/app').IWorkflowEvent} event - conversation data
59
+ * @returns {Promise<import('@scout9/app').IWorkflowResponse>}
60
60
  */
61
61
 
62
62
  /**
@@ -67,7 +67,7 @@
67
67
 
68
68
  /**
69
69
  * @callback IdGeneratorFun
70
- * @param {import('@scout9/app').Message.role} prefix
70
+ * @param {import('@scout9/app').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('@scout9/app').Conversation> & {forwardNote?: string; forward?: import('@scout9/app').WorkflowResponseSlot['forward']}} conversation
94
- * @property {Change<Array<import('@scout9/app').Message>>} messages
93
+ * @property {Change<import('@scout9/app').IConversation> & {forwardNote?: string; forward?: import('@scout9/app').WorkflowResponseSlot['forward']}} conversation
94
+ * @property {Change<Array<import('@scout9/app').IMessage>>} messages
95
95
  * @property {Change<Object>} context
96
- * @property {Change<import('@scout9/app').Message>} message
96
+ * @property {Change<import('@scout9/app').IMessage>} message
97
97
  */
98
98
  export const Spirits = {
99
99
 
@@ -7,7 +7,7 @@ function agentsTemplate(agents, exe = 'js') {
7
7
  return `
8
8
  /**
9
9
  * Required core entity type: Agents represents you and your team
10
- * @returns {Array<import('@scout9/app').Agent>}
10
+ * @returns {Array<import('@scout9/app').IAgent>}
11
11
  */
12
12
  export default function Agents() {
13
13
  return ${JSON.stringify(agents, null, 2)};
@@ -19,12 +19,13 @@ export default function Agents() {
19
19
  * @param {Scout9ProjectBuildConfig} config
20
20
  * @param {string} exe - file extension
21
21
  * @returns {string}
22
+ *
22
23
  */
23
24
  function rootTemplate(config, exe = 'js') {
24
25
  return `
25
26
  /**
26
27
  * Configuration for the Scout9 project.
27
- * @type {import('@scout9/app').Scout9ProjectConfig}
28
+ * @type {import('@scout9/app').IScout9ProjectConfig}
28
29
  */
29
30
  export default {
30
31
 
@@ -51,8 +52,8 @@ export default {
51
52
  function appTemplate() {
52
53
  return `
53
54
  /**
54
- * @param {import('@scout9/app').WorkflowEvent} event - every workflow receives an event object
55
- * @returns {Promise<import('@scout9/app').WorkflowResponse>} - every workflow must return a WorkflowResponse
55
+ * @param {import('@scout9/app').IWorkflowEvent} event - every workflow receives an event object
56
+ * @returns {Promise<import('@scout9/app').IWorkflowResponse>} - every workflow must return a WorkflowResponse
56
57
  */
57
58
  export default async function Scout9App(event) {
58
59
  return {