@scout9/app 1.0.0-alpha.0.1.84 → 1.0.0-alpha.0.1.86

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.
@@ -41174,7 +41174,7 @@ class Body {
41174
41174
  }
41175
41175
  const {
41176
41176
  toFormData
41177
- } = await Promise.resolve().then(function () { return require("./multipart-parser-141ee5a8.cjs"); });
41177
+ } = await Promise.resolve().then(function () { return require("./multipart-parser-caa634a9.cjs"); });
41178
41178
  return toFormData(this.body, ct);
41179
41179
  }
41180
41180
 
@@ -81230,7 +81230,7 @@ function _loadUserPackageJson$1() {
81230
81230
  targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
81231
81231
  _context2.t0 = JSON;
81232
81232
  _context2.next = 10;
81233
- 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('exports-5ad64876.js', document.baseURI).href))), 'utf-8');
81233
+ 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('exports-291eb22e.js', document.baseURI).href))), 'utf-8');
81234
81234
  case 10:
81235
81235
  _context2.t1 = _context2.sent;
81236
81236
  pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
@@ -82075,7 +82075,7 @@ function _loadUserPackageJson() {
82075
82075
  targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
82076
82076
  _context.t0 = JSON;
82077
82077
  _context.next = 10;
82078
- 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('exports-5ad64876.js', document.baseURI).href))), 'utf-8');
82078
+ 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('exports-291eb22e.js', document.baseURI).href))), 'utf-8');
82079
82079
  case 10:
82080
82080
  _context.t1 = _context.sent;
82081
82081
  pkg = _context.t0.parse.call(_context.t0, _context.t1);
@@ -86634,9 +86634,8 @@ var momentExports = moment$1.exports;
86634
86634
  var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports);
86635
86635
 
86636
86636
  /**
86637
- *
86638
86637
  * @param {string} name
86639
- * @returns {ZodString}
86638
+ * @returns {import('zod').ZodString}
86640
86639
  */
86641
86640
  function zId(name) {
86642
86641
  return z.string().regex(/^[A-Za-z0-9\-_\[\]]+$/, {
@@ -86981,7 +86980,7 @@ var entityConfigurationSchema = _entityConfigurationSchema.refine(function (data
86981
86980
  // Custom error message
86982
86981
  message: "If 'definitions' is provided, then 'training' must also be provided"
86983
86982
  });
86984
- z.array(entityConfigurationSchema);
86983
+ var entitiesRootConfigurationSchema = z.array(entityConfigurationSchema);
86985
86984
  var entityExtendedProjectConfigurationSchema = z.object({
86986
86985
  entities: z.array(zId('Entity Folder', z.string()), {
86987
86986
  description: 'Entity id association, used to handle route params'
@@ -87067,17 +87066,51 @@ var InstructionSchema = z.object({
87067
87066
  id: zId('Instruction ID').describe('Unique ID for the instruction, this is used to remove the instruction later'),
87068
87067
  content: z.string()
87069
87068
  });
87069
+
87070
+ /**
87071
+ * If its a string, it will be sent as a static string.
87072
+ * If it's a object or WorkflowResponseMessageAPI - it will use
87073
+ */
87074
+ var WorkflowResponseMessage = z.union(z.string(),
87075
+ /**
87076
+ * An api call that should be called later, must return a string or {message: string}
87077
+ */
87078
+ WorkflowResponseMessageApiRequest);
87079
+ var WorkflowResponseMessageApiRequest = z.object({
87080
+ uri: z.string(),
87081
+ data: z.any().optional(),
87082
+ headers: z.object(spirits._defineProperty({}, z.string(), z.string())).optional(),
87083
+ method: z["enum"](["GET", "POST", "PUT"]).optional()
87084
+ });
87085
+
87086
+ /**
87087
+ * The intended response provided by the WorkflowResponseMessageApiRequest
87088
+ */
87089
+ var WorkflowResponseMessageApiResponse = z.union([z.string(), z.object({
87090
+ message: z.string()
87091
+ }), z.object({
87092
+ text: z.string()
87093
+ }), z.object({
87094
+ data: z.object({
87095
+ message: z.string()
87096
+ })
87097
+ }), z.object({
87098
+ data: z.object({
87099
+ text: z.string()
87100
+ })
87101
+ })]);
87070
87102
  var WorkflowResponseSlotSchema = z.object({
87071
87103
  forward: ForwardSchema.optional(),
87072
87104
  instructions: z.union([z.string(), InstructionSchema, z.array(z.string()), z.array(InstructionSchema)]).optional(),
87073
87105
  removeInstructions: z.array(z.string()).optional(),
87074
87106
  message: z.string().optional(),
87107
+ // message: WorkflowResponseMessage.optional(),
87075
87108
  secondsDelay: z.number().optional(),
87076
87109
  scheduled: z.number().optional(),
87077
87110
  contextUpsert: ConversationContext.optional(),
87078
87111
  resetIntent: z["boolean"]().optional()
87079
87112
  });
87080
- z.union([WorkflowResponseSlotSchema, z.array(WorkflowResponseSlotSchema)]);
87113
+ var WorkflowResponseSchema = z.union([WorkflowResponseSlotSchema, z.array(WorkflowResponseSlotSchema)]);
87081
87114
 
87082
87115
  var llmModelOptions = z.union([z.literal('gpt-4-1106-preview'), z.literal('gpt-4-vision-preview'), z.literal('gpt-4'), z.literal('gpt-4-0314'), z.literal('gpt-4-0613'), z.literal('gpt-4-32k'), z.literal('gpt-4-32k-0314'), z.literal('gpt-4-32k-0613'), z.literal('gpt-3.5-turbo'), z.literal('gpt-3.5-turbo-16k'), z.literal('gpt-3.5-turbo-0301'), z.literal('gpt-3.5-turbo-0613'), z.literal('gpt-3.5-turbo-16k-0613'), z.string() // for the (string & {}) part
87083
87116
  ]);
@@ -88316,7 +88349,7 @@ function report(config, logger) {
88316
88349
  logger.primary("Run ".concat(cyan('scout9 dev'), " to test your project locally"));
88317
88350
  }
88318
88351
 
88319
- var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('exports-5ad64876.js', document.baseURI).href)));
88352
+ var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('exports-291eb22e.js', document.baseURI).href)));
88320
88353
  var __dirname$1 = path__default["default"].dirname(__filename$1);
88321
88354
 
88322
88355
  /**
@@ -88559,7 +88592,7 @@ function _buildApp() {
88559
88592
  case 11:
88560
88593
  _context4.t0 = JSON;
88561
88594
  _context4.next = 14;
88562
- 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('exports-5ad64876.js', document.baseURI).href))), 'utf-8');
88595
+ 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('exports-291eb22e.js', document.baseURI).href))), 'utf-8');
88563
88596
  case 14:
88564
88597
  _context4.t1 = _context4.sent;
88565
88598
  packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
@@ -91631,15 +91664,42 @@ function json(data, init) {
91631
91664
  }
91632
91665
  var encoder = new TextEncoder();
91633
91666
 
91667
+ exports.ConversationContext = ConversationContext;
91668
+ exports.ConversationSchema = ConversationSchema;
91634
91669
  exports.EventResponse = EventResponse;
91635
91670
  exports.File = File;
91636
91671
  exports.FormData = FormData$2;
91672
+ exports.ForwardSchema = ForwardSchema;
91673
+ exports.InstructionSchema = InstructionSchema;
91674
+ exports.IntentWorkflowEventSchema = IntentWorkflowEventSchema;
91675
+ exports.MessageSchema = MessageSchema;
91676
+ exports.Scout9ProjectBuildConfigSchema = Scout9ProjectBuildConfigSchema;
91637
91677
  exports.Scout9Test = Scout9Test;
91678
+ exports.WorkflowConfigurationSchema = WorkflowConfigurationSchema;
91679
+ exports.WorkflowEventSchema = WorkflowEventSchema;
91680
+ exports.WorkflowResponseMessage = WorkflowResponseMessage;
91681
+ exports.WorkflowResponseMessageApiRequest = WorkflowResponseMessageApiRequest;
91682
+ exports.WorkflowResponseMessageApiResponse = WorkflowResponseMessageApiResponse;
91683
+ exports.WorkflowResponseSchema = WorkflowResponseSchema;
91684
+ exports.WorkflowResponseSlotSchema = WorkflowResponseSlotSchema;
91685
+ exports.WorkflowsConfigurationSchema = WorkflowsConfigurationSchema;
91686
+ exports._entityApiConfigurationSchema = _entityApiConfigurationSchema;
91687
+ exports.agentBaseConfigurationSchema = agentBaseConfigurationSchema;
91688
+ exports.agentConfigurationSchema = agentConfigurationSchema;
91689
+ exports.agentsBaseConfigurationSchema = agentsBaseConfigurationSchema;
91690
+ exports.agentsConfigurationSchema = agentsConfigurationSchema;
91638
91691
  exports.createMockAgent = createMockAgent;
91639
91692
  exports.createMockConversation = createMockConversation;
91640
91693
  exports.createMockCustomer = createMockCustomer;
91641
91694
  exports.createMockMessage = createMockMessage;
91642
91695
  exports.createMockWorkflowEvent = createMockWorkflowEvent;
91696
+ exports.customerSchema = customerSchema;
91697
+ exports.customerValueSchema = customerValueSchema;
91698
+ exports.entitiesRootConfigurationSchema = entitiesRootConfigurationSchema;
91699
+ exports.entitiesRootProjectConfigurationSchema = entitiesRootProjectConfigurationSchema;
91700
+ exports.entityApiConfigurationSchema = entityApiConfigurationSchema;
91701
+ exports.entityConfigurationSchema = entityConfigurationSchema;
91702
+ exports.entityRootProjectConfigurationSchema = entityRootProjectConfigurationSchema;
91643
91703
  exports.json = json;
91644
91704
  exports.run = run;
91645
91705
  exports.sendEvent = sendEvent;
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-5ad64876.cjs");
5
+ var exports$1 = require("./exports-291eb22e.cjs");
6
6
  var spirits = require("./spirits-643c422a.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
@@ -39,13 +39,40 @@ require('node:vm');
39
39
 
40
40
 
41
41
 
42
+ exports.ConversationContext = exports$1.ConversationContext;
43
+ exports.ConversationSchema = exports$1.ConversationSchema;
42
44
  exports.EventResponse = exports$1.EventResponse;
45
+ exports.ForwardSchema = exports$1.ForwardSchema;
46
+ exports.InstructionSchema = exports$1.InstructionSchema;
47
+ exports.IntentWorkflowEventSchema = exports$1.IntentWorkflowEventSchema;
48
+ exports.MessageSchema = exports$1.MessageSchema;
49
+ exports.Scout9ProjectBuildConfigSchema = exports$1.Scout9ProjectBuildConfigSchema;
43
50
  exports.Scout9Test = exports$1.Scout9Test;
51
+ exports.WorkflowConfigurationSchema = exports$1.WorkflowConfigurationSchema;
52
+ exports.WorkflowEventSchema = exports$1.WorkflowEventSchema;
53
+ exports.WorkflowResponseMessage = exports$1.WorkflowResponseMessage;
54
+ exports.WorkflowResponseMessageApiRequest = exports$1.WorkflowResponseMessageApiRequest;
55
+ exports.WorkflowResponseMessageApiResponse = exports$1.WorkflowResponseMessageApiResponse;
56
+ exports.WorkflowResponseSchema = exports$1.WorkflowResponseSchema;
57
+ exports.WorkflowResponseSlotSchema = exports$1.WorkflowResponseSlotSchema;
58
+ exports.WorkflowsConfigurationSchema = exports$1.WorkflowsConfigurationSchema;
59
+ exports._entityApiConfigurationSchema = exports$1._entityApiConfigurationSchema;
60
+ exports.agentBaseConfigurationSchema = exports$1.agentBaseConfigurationSchema;
61
+ exports.agentConfigurationSchema = exports$1.agentConfigurationSchema;
62
+ exports.agentsBaseConfigurationSchema = exports$1.agentsBaseConfigurationSchema;
63
+ exports.agentsConfigurationSchema = exports$1.agentsConfigurationSchema;
44
64
  exports.createMockAgent = exports$1.createMockAgent;
45
65
  exports.createMockConversation = exports$1.createMockConversation;
46
66
  exports.createMockCustomer = exports$1.createMockCustomer;
47
67
  exports.createMockMessage = exports$1.createMockMessage;
48
68
  exports.createMockWorkflowEvent = exports$1.createMockWorkflowEvent;
69
+ exports.customerSchema = exports$1.customerSchema;
70
+ exports.customerValueSchema = exports$1.customerValueSchema;
71
+ exports.entitiesRootConfigurationSchema = exports$1.entitiesRootConfigurationSchema;
72
+ exports.entitiesRootProjectConfigurationSchema = exports$1.entitiesRootProjectConfigurationSchema;
73
+ exports.entityApiConfigurationSchema = exports$1.entityApiConfigurationSchema;
74
+ exports.entityConfigurationSchema = exports$1.entityConfigurationSchema;
75
+ exports.entityRootProjectConfigurationSchema = exports$1.entityRootProjectConfigurationSchema;
49
76
  exports.json = exports$1.json;
50
77
  exports.run = exports$1.run;
51
78
  exports.sendEvent = exports$1.sendEvent;
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('node:fs');
4
4
  require('node:path');
5
- var exports$1 = require("./exports-5ad64876.cjs");
5
+ var exports$1 = require("./exports-291eb22e.cjs");
6
6
  require("./spirits-643c422a.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-5ad64876.cjs");
5
+ var exports$1 = require("./exports-291eb22e.cjs");
6
6
  var spirits = require("./spirits-643c422a.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scout9/app",
3
- "version": "1.0.0-alpha.0.1.84",
3
+ "version": "1.0.0-alpha.0.1.86",
4
4
  "description": "Build and deploy your Scout9 app for SMS auto replies",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/exports.js CHANGED
@@ -4,6 +4,7 @@ import { EventResponse } from './runtime/index.js';
4
4
  export { EventResponse } from './runtime/index.js';
5
5
  // export * from './types';
6
6
  export * from './testing-tools/index.js';
7
+ export * from './runtime/client/index.js';
7
8
 
8
9
  /**
9
10
  * @param {WorkflowEvent} event - every workflow receives an event object
@@ -1,9 +1,8 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  /**
4
- *
5
4
  * @param {string} name
6
- * @returns {ZodString}
5
+ * @returns {import('zod').ZodString}
7
6
  */
8
7
  export function zId(name) {
9
8
  return z.string().regex(/^[A-Za-z0-9\-_\[\]]+$/, {
@@ -70,18 +70,64 @@ export const InstructionSchema = z.object({
70
70
  id: zId('Instruction ID').describe('Unique ID for the instruction, this is used to remove the instruction later'),
71
71
  content: z.string(),
72
72
  });
73
+
74
+ /**
75
+ * If its a string, it will be sent as a static string.
76
+ * If it's a object or WorkflowResponseMessageAPI - it will use
77
+ */
78
+ export const WorkflowResponseMessage = z.union(
79
+ z.string(),
80
+
81
+ /**
82
+ * An api call that should be called later, must return a string or {message: string}
83
+ */
84
+ WorkflowResponseMessageApiRequest
85
+ );
86
+
87
+ export const WorkflowResponseMessageApiRequest = z.object({
88
+ uri: z.string(),
89
+ data: z.any().optional(),
90
+ headers: z.object({
91
+ [z.string()]: z.string(),
92
+ }).optional(),
93
+ method: z.enum(["GET", "POST", "PUT"]).optional()
94
+ });
95
+
96
+ /**
97
+ * The intended response provided by the WorkflowResponseMessageApiRequest
98
+ */
99
+ export const WorkflowResponseMessageApiResponse = z.union([
100
+ z.string(),
101
+ z.object({
102
+ message: z.string()
103
+ }),
104
+ z.object({
105
+ text: z.string()
106
+ }),
107
+ z.object({
108
+ data: z.object({
109
+ message: z.string()
110
+ })
111
+ }),
112
+ z.object({
113
+ data: z.object({
114
+ text: z.string()
115
+ })
116
+ })
117
+ ]);
118
+
73
119
  export const WorkflowResponseSlotSchema = z.object({
74
120
  forward: ForwardSchema.optional(),
75
121
  instructions: z.union([z.string(), InstructionSchema, z.array(z.string()), z.array(InstructionSchema)]).optional(),
76
122
  removeInstructions: z.array(z.string()).optional(),
77
123
  message: z.string().optional(),
124
+ // message: WorkflowResponseMessage.optional(),
78
125
  secondsDelay: z.number().optional(),
79
126
  scheduled: z.number().optional(),
80
127
  contextUpsert: ConversationContext.optional(),
81
128
  resetIntent: z.boolean().optional(),
82
129
  });
83
130
 
84
-
85
131
  export const WorkflowResponseSchema = z.union([
86
132
  WorkflowResponseSlotSchema,
87
133
  z.array(WorkflowResponseSlotSchema)