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

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-caa634a9.cjs"); });
41177
+ } = await Promise.resolve().then(function () { return require("./multipart-parser-1f8d78d0.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-291eb22e.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-85e8c05c.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-291eb22e.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-85e8c05c.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);
@@ -86635,22 +86635,51 @@ var moment = /*@__PURE__*/getDefaultExportFromCjs(momentExports);
86635
86635
 
86636
86636
  /**
86637
86637
  * @param {string} name
86638
+ * @param {Object} [props]
86638
86639
  * @returns {import('zod').ZodString}
86639
86640
  */
86640
86641
  function zId(name) {
86641
- return z.string().regex(/^[A-Za-z0-9\-_\[\]]+$/, {
86642
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
86643
+ return z.string(props).regex(/^[A-Za-z0-9\-_\[\]]+$/, {
86642
86644
  message: "Invalid ".concat(name, " ID: ID must not contain spaces and should only contain alphanumeric characters, dashes, or underscores.")
86643
86645
  });
86644
86646
  }
86645
86647
 
86648
+ /**
86649
+ * @typedef {import('zod').infer<typeof MessageSchema>} IMessage
86650
+ */
86646
86651
  var MessageSchema = z.object({
86647
- content: z.string(),
86652
+ id: zId('Message ID', {
86653
+ description: 'Unique ID for the message'
86654
+ }),
86648
86655
  role: z["enum"](['agent', 'customer', 'system']),
86649
- time: z.string(),
86650
- name: z.string().optional()
86656
+ content: z.string(),
86657
+ time: z.string({
86658
+ description: 'Datetime ISO 8601 timestamp'
86659
+ }),
86660
+ name: z.string().optional(),
86661
+ scheduled: z.string({
86662
+ description: 'Datetime ISO 8601 timestamp'
86663
+ }).optional(),
86664
+ context: z.any({
86665
+ description: 'The context generated from the message'
86666
+ }).optional(),
86667
+ intent: z.string({
86668
+ description: 'Detected intent'
86669
+ }).optional().nullable(),
86670
+ intentScore: z.number({
86671
+ description: 'Confidence score of the assigned intent'
86672
+ }).nullable().optional()
86651
86673
  });
86652
86674
 
86675
+ /**
86676
+ * @typedef {import('zod').infer<typeof customerValueSchema>} ICustomerValue
86677
+ */
86653
86678
  var customerValueSchema = z.union([z["boolean"](), z.number(), z.string()]);
86679
+
86680
+ /**
86681
+ * @typedef {import('zod').infer<typeof customerSchema>} ICustomer
86682
+ */
86654
86683
  var customerSchema = z.object({
86655
86684
  firstName: z.string().optional(),
86656
86685
  lastName: z.string().optional(),
@@ -86670,6 +86699,10 @@ var customerSchema = z.object({
86670
86699
  stripe: z.string().nullable().optional(),
86671
86700
  stripeDev: z.string().nullable().optional()
86672
86701
  }).catchall(customerValueSchema);
86702
+
86703
+ /**
86704
+ * @typedef {import('zod').infer<typeof agentBaseConfigurationSchema>} IAgentBase
86705
+ */
86673
86706
  var agentBaseConfigurationSchema = z.object({
86674
86707
  deployed: z.object({
86675
86708
  web: z.string({
@@ -86682,6 +86715,7 @@ var agentBaseConfigurationSchema = z.object({
86682
86715
  description: 'Email address for agent'
86683
86716
  }).optional()
86684
86717
  }).optional(),
86718
+ img: z.string().nullable().optional(),
86685
86719
  firstName: z.string({
86686
86720
  description: 'Agent first name'
86687
86721
  }).optional(),
@@ -86722,190 +86756,70 @@ var agentBaseConfigurationSchema = z.object({
86722
86756
  transcripts: z.array(z.array(MessageSchema)).optional(),
86723
86757
  audios: z.array(z.any()).optional()
86724
86758
  });
86759
+
86760
+ /**
86761
+ * @typedef {import('zod').infer<typeof agentBaseConfigurationSchema>} IAgent
86762
+ * @typedef {import('zod').infer<typeof agentBaseConfigurationSchema>} IPersona
86763
+ */
86725
86764
  var agentConfigurationSchema = agentBaseConfigurationSchema.extend({
86726
- id: zId('Agent ID', z.string({
86765
+ id: zId('Agent ID', {
86727
86766
  description: 'Unique ID for agent'
86728
- }))
86767
+ })
86729
86768
  });
86769
+
86770
+ /**
86771
+ * @typedef {import('zod').infer<typeof agentsConfigurationSchema>} IAgentsConfiguration
86772
+ */
86730
86773
  var agentsConfigurationSchema = z.array(agentConfigurationSchema);
86731
- var agentsBaseConfigurationSchema = z.array(agentBaseConfigurationSchema);
86732
86774
 
86733
- // export type Scout9Response =
86734
- // export type RequestHandler<
86735
- // RequestBody = unknown,
86736
- // ResponseBody = Record<string | number, any> | Record<string | number, any>[],
86737
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86738
- // RouteId extends string | null = string | null,
86739
- // SearchParams extends Partial<Record<string, string | string[]>> = Partial<Record<string, string>>
86740
- // > = (event: EventRequest<RequestBody, Params, RouteId, SearchParams>) => MaybePromise<EventResponse<ResponseBody>>;
86741
- //
86742
- // /**
86743
- // * For QUERY entity api calls, this is used for getting multiple entities
86744
- // */
86745
- // export type QueryRequestHandler<
86746
- // ResponseBody = Record<string | number, any>,
86747
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86748
- // RouteId extends string | null = string | null,
86749
- // > = RequestHandler<unknown, ResponseBody[], Params, RouteId, {q?: string, page?: string, limit?: string, orderBy?: string, endAt?: string, startAt?: string}>;
86750
- //
86751
- // /**
86752
- // * For GET entity api calls, this is used for getting one entity
86753
- // */
86754
- // export type GetRequestHandler<
86755
- // ResponseBody = Record<string | number, any>,
86756
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86757
- // RouteId extends string | null = string | null,
86758
- // > = RequestHandler<unknown, ResponseBody, Params, RouteId>;
86759
- //
86760
- // /**
86761
- // * For POST entity api calls, this is used for creating an entity
86762
- // */
86763
- // export type PostRequestHandler<
86764
- // RequestBody = Record<string | number, any>,
86765
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86766
- // RouteId extends string | null = string | null
86767
- // > = RequestHandler<RequestBody, {success: boolean, id: string, error?: string | object, [key: string]: any}, Params, RouteId>;
86768
- //
86769
- // export type CreatedRequestHandler<
86770
- // RequestBody = Record<string | number, any>,
86771
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86772
- // RouteId extends string | null = string | null
86773
- // > = PostRequestHandler<RequestBody, Params, RouteId>;
86774
- //
86775
- //
86776
- // /**
86777
- // * For PUT entity api calls, this is used for creating an entity
86778
- // */
86779
- // export type PutRequestHandler<
86780
- // RequestBody = Record<string | number, any>,
86781
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86782
- // RouteId extends string | null = string | null
86783
- // > = RequestHandler<Partial<RequestBody>, {success: boolean, error?: string | object, [key: string]: any}, Params, RouteId>;
86784
- //
86785
- //
86786
- // /**
86787
- // * For PUT entity api calls, this is used for creating an entity
86788
- // */
86789
- // export type PatchRequestHandler<
86790
- // RequestBody = Record<string | number, any>,
86791
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86792
- // RouteId extends string | null = string | null
86793
- // > = PutRequestHandler<RequestBody, Params, RouteId>;
86794
- //
86795
- // /**
86796
- // * For PUT entity api calls, this is used for creating an entity
86797
- // */
86798
- // export type UpdateRequestHandler<
86799
- // RequestBody = Record<string | number, any>,
86800
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86801
- // RouteId extends string | null = string | null
86802
- // > = PutRequestHandler<RequestBody, Params, RouteId>;
86803
- //
86804
- // /**
86805
- // * For PUT entity api calls, this is used for creating an entity
86806
- // */
86807
- // export type DeleteRequestHandler<
86808
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86809
- // RouteId extends string | null = string | null
86810
- // > = RequestHandler<unknown, {success: boolean, error?: string | object, [key: string]: any}, Params, RouteId>;
86811
- //
86812
- //
86813
- // export interface EventRequest<
86814
- // Body = unknown,
86815
- // Params extends Partial<Record<string, string>> = Partial<Record<string, string>>,
86816
- // RouteId extends string | null = string | null,
86817
- // SearchParams extends Partial<Record<string, string | string[]>> = Partial<Record<string, string>>,
86818
- // > {
86819
- //
86820
- // /**
86821
- // * `fetch` is equivalent to the [native `fetch` web API](https://developer.mozilla.org/en-US/docs/Web/API/fetch), with a few additional features:
86822
- // *
86823
- // * - It can be used to make credentialed requests on the server, as it inherits the `cookie` and `authorization` headers for the page request.
86824
- // * - It can make relative requests on the server (ordinarily, `fetch` requires a URL with an origin when used in a server context).
86825
- // * - Internal requests (e.g. for `+server.js` routes) go directly to the handler function when running on the server, without the overhead of an HTTP call.
86826
- // * - During server-side rendering, the response will be captured and inlined into the rendered HTML by hooking into the `text` and `json` methods of the `Response` object. Note that headers will _not_ be serialized, unless explicitly included
86827
- // * - During hydration, the response will be read from the HTML, guaranteeing consistency and preventing an additional network request.
86828
- // *
86829
- // */
86830
- // fetch: typeof fetch;
86831
- //
86832
- // /**
86833
- // * The parameters of the current route - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object
86834
- // */
86835
- // params: Params;
86836
- //
86837
- // /**
86838
- // * The requested URL.
86839
- // */
86840
- // url: URL;
86841
- //
86842
- // /**
86843
- // * The anticipated searchParams inside `const { searchParams } = new URL(req.url)`
86844
- // */
86845
- // searchParams: SearchParams;
86846
- //
86847
- // /**
86848
- // * The anticipated parsed body inside `request.body`
86849
- // */
86850
- // body: Body;
86851
- //
86852
- // /**
86853
- // * The original request object
86854
- // */
86855
- // request: Request;
86856
- //
86857
- // /**
86858
- // * If you need to set headers for the response, you can do so using the this method. This is useful if you want the page to be cached, for example:
86859
- // *
86860
- // * ```js
86861
- // * /// file: src/routes/blog/+page.js
86862
- // * export async function load({ fetch, setHeaders }) {
86863
- // * const url = `https://cms.example.com/articles.json`;
86864
- // * const response = await fetch(url);
86865
- // *
86866
- // * setHeaders({
86867
- // * age: response.headers.get('age'),
86868
- // * 'cache-control': response.headers.get('cache-control')
86869
- // * });
86870
- // *
86871
- // * return response.json();
86872
- // * }
86873
- // * ```
86874
- // *
86875
- // * Setting the same header multiple times (even in separate `load` functions) is an error — you can only set a given header once.
86876
- // *
86877
- // * You cannot add a `set-cookie` header with `setHeaders` API instead.
86878
- // */
86879
- // setHeaders(headers: Record<string, string>): void;
86880
- //
86881
- // /**
86882
- // * Info about the current route
86883
- // */
86884
- // route: {
86885
- // /**
86886
- // * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`
86887
- // */
86888
- // id: RouteId;
86889
- // };
86890
- // }
86775
+ /**
86776
+ * @typedef {import('zod').infer<typeof agentsBaseConfigurationSchema>} IAgentsBaseConfiguration
86777
+ */
86778
+ var agentsBaseConfigurationSchema = z.array(agentBaseConfigurationSchema);
86891
86779
 
86892
86780
  /**
86893
86781
  * Utility runtime class used to guide event output
86782
+ * @template T
86894
86783
  */
86895
86784
  var EventResponse = /*#__PURE__*/function () {
86785
+ /**
86786
+ * Create an EventResponse.
86787
+ * @param {T} body - The body of the response.
86788
+ * @param {ResponseInit} [init] - Additional options for the response.
86789
+ * @throws {Error} If the body is not a valid object.
86790
+ */
86896
86791
  function EventResponse(body, init) {
86897
86792
  spirits._classCallCheck(this, EventResponse);
86793
+ /**
86794
+ * @type {T}
86795
+ * @private
86796
+ */
86898
86797
  this.body = body;
86798
+
86799
+ /**
86800
+ * @type {ResponseInit}
86801
+ * @private
86802
+ */
86899
86803
  this.init = init;
86900
86804
  if (spirits._typeof(this.body) !== 'object') {
86901
86805
  throw new Error("EventResponse body in not a valid object:\n\"".concat(JSON.stringify(body, null, 2), "\""));
86902
86806
  }
86903
86807
  }
86808
+
86809
+ /**
86810
+ * Get the response object.
86811
+ * @returns {Response} The response object.
86812
+ */
86904
86813
  spirits._createClass(EventResponse, [{
86905
86814
  key: "response",
86906
86815
  get: function get() {
86907
86816
  return Response.json(this.body, this.init);
86908
86817
  }
86818
+
86819
+ /**
86820
+ * Get the data of the response.
86821
+ * @returns {T} The body of the response.
86822
+ */
86909
86823
  }, {
86910
86824
  key: "data",
86911
86825
  get: function get() {
@@ -86913,14 +86827,44 @@ var EventResponse = /*#__PURE__*/function () {
86913
86827
  }
86914
86828
  }], [{
86915
86829
  key: "json",
86916
- value: function json(body, options) {
86830
+ value:
86831
+ /**
86832
+ * Create a new EventResponse instance with a JSON body.
86833
+ * @template T
86834
+ * @param {T} body - The body of the response.
86835
+ * @param {ResponseInit} [options] - Additional options for the response.
86836
+ * @returns {EventResponse<T>} A new EventResponse instance.
86837
+ */
86838
+ function json(body, options) {
86917
86839
  return new EventResponse(body, options);
86918
86840
  }
86919
86841
  }]);
86920
86842
  return EventResponse;
86921
86843
  }();
86844
+ var responseInitSchema = z.object({
86845
+ status: z.number().optional(),
86846
+ statusText: z.string().optional(),
86847
+ headers: z.any().optional() // Headers can be complex; adjust as needed
86848
+ });
86849
+
86850
+ /**
86851
+ * @template T
86852
+ * @typedef {object} IEventResponse
86853
+ * @property {T} body - The body of the response.
86854
+ * @property {ResponseInit} [init] - Additional options for the response.
86855
+ * @property {Response} response - The response object.
86856
+ * @property {T} data - The body of the response.
86857
+ */
86858
+ var eventResponseSchema = z.object({
86859
+ body: z.any(),
86860
+ // Adjust as per your actual body structure
86861
+ init: responseInitSchema.optional()
86862
+ });
86922
86863
 
86923
- var _entityApiConfigurationSchema = z.object({
86864
+ /**
86865
+ * @typedef {import('zod').infer<typeof entityApiConfigurationSchema>} IEntityApiConfiguration
86866
+ */
86867
+ var entityApiConfigurationSchema = z.object({
86924
86868
  // path: z.string(),
86925
86869
  GET: z["boolean"]().optional(),
86926
86870
  UPDATE: z["boolean"]().optional(),
@@ -86928,8 +86872,7 @@ var _entityApiConfigurationSchema = z.object({
86928
86872
  PUT: z["boolean"]().optional(),
86929
86873
  PATCH: z["boolean"]().optional(),
86930
86874
  DELETE: z["boolean"]().optional()
86931
- });
86932
- var entityApiConfigurationSchema = _entityApiConfigurationSchema.nullable();
86875
+ }).nullable();
86933
86876
  var entityConfigurationDefinitionSchema = z.object({
86934
86877
  utterance: zId('Utterance', z.string({
86935
86878
  description: 'What entity utterance this represents, if not provided, it will default to the entity id'
@@ -86969,6 +86912,10 @@ var _entityConfigurationSchema = z.object({
86969
86912
  training: z.array(entityConfigurationTrainingSchema).optional(),
86970
86913
  tests: z.array(entityConfigurationTestSchema).optional()
86971
86914
  }).strict();
86915
+
86916
+ /**
86917
+ * @typedef {import('zod').infer<typeof entityConfigurationSchema>} IEntityConfiguration
86918
+ */
86972
86919
  var entityConfigurationSchema = _entityConfigurationSchema.refine(function (data) {
86973
86920
  // If 'definitions' is provided, then 'training' must also be provided
86974
86921
  if (data.definitions !== undefined) {
@@ -86980,6 +86927,10 @@ var entityConfigurationSchema = _entityConfigurationSchema.refine(function (data
86980
86927
  // Custom error message
86981
86928
  message: "If 'definitions' is provided, then 'training' must also be provided"
86982
86929
  });
86930
+
86931
+ /**
86932
+ * @typedef {import('zod').infer<typeof entitiesRootConfigurationSchema>} IEntitiesRootConfiguration
86933
+ */
86983
86934
  var entitiesRootConfigurationSchema = z.array(entityConfigurationSchema);
86984
86935
  var entityExtendedProjectConfigurationSchema = z.object({
86985
86936
  entities: z.array(zId('Entity Folder', z.string()), {
@@ -86991,7 +86942,10 @@ var entityExtendedProjectConfigurationSchema = z.object({
86991
86942
  var _entityRootProjectConfigurationSchema = _entityConfigurationSchema.extend(entityExtendedProjectConfigurationSchema.shape);
86992
86943
  z.array(_entityRootProjectConfigurationSchema);
86993
86944
 
86994
- // @TODO why type extend not valid?
86945
+ /**
86946
+ * @TODO why type extend not valid?
86947
+ * @typedef {import('zod').infer<typeof entityRootProjectConfigurationSchema>} IEntityRootProjectConfiguration
86948
+ */
86995
86949
  var entityRootProjectConfigurationSchema = _entityConfigurationSchema.extend(entityExtendedProjectConfigurationSchema.shape).refine(function (data) {
86996
86950
  // If 'definitions' is provided, then 'training' must also be provided
86997
86951
  if (data.definitions !== undefined) {
@@ -87003,15 +86957,30 @@ var entityRootProjectConfigurationSchema = _entityConfigurationSchema.extend(ent
87003
86957
  // Custom error message
87004
86958
  message: "If 'definitions' is provided, then 'training' must also be provided"
87005
86959
  });
86960
+
86961
+ /**
86962
+ * @typedef {import('zod').infer<typeof entitiesRootProjectConfigurationSchema>} IEntitiesRootProjectConfiguration
86963
+ */
87006
86964
  var entitiesRootProjectConfigurationSchema = z.array(entityRootProjectConfigurationSchema);
87007
86965
 
86966
+ /**
86967
+ * @typedef {import('zod').infer<typeof WorkflowConfigurationSchema>} IWorkflowConfiguration
86968
+ */
87008
86969
  var WorkflowConfigurationSchema = z.object({
87009
86970
  entities: z.array(zId('Workflow Folder', z.string()), {
87010
86971
  description: 'Workflow id association, used to handle route params'
87011
86972
  }).min(1, 'Must have at least 1 entity').max(15, 'Cannot have more than 15 entity paths'),
87012
86973
  entity: zId('Workflow Folder', z.string())
87013
86974
  });
86975
+
86976
+ /**
86977
+ * @typedef {import('zod').infer<typeof WorkflowsConfigurationSchema>} IWorkflowsConfiguration
86978
+ */
87014
86979
  var WorkflowsConfigurationSchema = z.array(WorkflowConfigurationSchema);
86980
+
86981
+ /**
86982
+ * @typedef {import('zod').infer<typeof ConversationSchema>} IConversation
86983
+ */
87015
86984
  var ConversationSchema = z.object({
87016
86985
  $agent: zId('Conversation Agent ID', z.string({
87017
86986
  description: 'Default agent assigned to the conversation(s)'
@@ -87030,19 +86999,56 @@ var ConversationSchema = z.object({
87030
86999
  platformEmailThreadId: z.string({
87031
87000
  description: 'Used to sync email messages with the conversation'
87032
87001
  }).optional()
87033
- }).optional()
87002
+ }).optional(),
87003
+ locked: z["boolean"]({
87004
+ description: 'Whether the conversation is locked or not'
87005
+ }).optional().nullable(),
87006
+ lockedReason: z.string({
87007
+ description: 'Why this conversation was locked'
87008
+ }).optional().nullable(),
87009
+ lockAttempts: z.number({
87010
+ description: 'Number attempts made until conversation is locked'
87011
+ }).optional().nullable(),
87012
+ forwardedTo: z.string({
87013
+ description: 'What personaId/phone/email was forwarded'
87014
+ }).optional().nullable(),
87015
+ forwarded: z.string({
87016
+ description: 'Datetime ISO 8601 timestamp when persona was forwarded'
87017
+ }).optional().nullable(),
87018
+ forwardNote: z.string().optional().nullable(),
87019
+ intent: z.string({
87020
+ description: 'Detected intent of conversation'
87021
+ }).optional().nullable(),
87022
+ intentScore: z.number({
87023
+ description: 'Confidence score of the assigned intent'
87024
+ }).optional().nullable()
87034
87025
  });
87026
+
87027
+ /**
87028
+ * @typedef {import('zod').infer<typeof IntentWorkflowEventSchema>} IIntentWorkflowEvent
87029
+ */
87035
87030
  var IntentWorkflowEventSchema = z.object({
87036
87031
  current: z.string().nullable(),
87037
87032
  flow: z.array(z.string()),
87038
87033
  initial: z.string().nullable()
87039
87034
  });
87035
+
87036
+ /**
87037
+ * @typedef {import('zod').infer<typeof WorkflowEventSchema>} IWorkflowEvent
87038
+ */
87040
87039
  var WorkflowEventSchema = z.object({
87041
87040
  messages: z.array(MessageSchema),
87042
87041
  conversation: ConversationSchema,
87043
87042
  context: z.any(),
87044
87043
  message: MessageSchema,
87045
- agent: agentConfigurationSchema,
87044
+ agent: agentConfigurationSchema.omit({
87045
+ transcripts: true,
87046
+ audios: true,
87047
+ includedLocations: true,
87048
+ excludedLocations: true,
87049
+ model: true,
87050
+ context: true
87051
+ }),
87046
87052
  customer: customerSchema,
87047
87053
  intent: IntentWorkflowEventSchema,
87048
87054
  stagnationCount: z.number(),
@@ -87053,15 +87059,33 @@ var WorkflowEventSchema = z.object({
87053
87059
  var Primitive = z.union([z.string(), z.number(), z["boolean"]()]);
87054
87060
  // Assuming ConversationContext is already defined as a Zod schema
87055
87061
 
87056
- // Lazy is used to handle recursive types.
87062
+ /**
87063
+ * Lazy is used to handle recursive types.
87064
+ * @typedef {import('zod').infer<typeof ConversationContext>} IConversation
87065
+ */
87057
87066
  var ConversationContext = z.lazy(function () {
87058
87067
  return z.record(Primitive.or(ConversationContext));
87059
87068
  });
87060
87069
  z.record(Primitive.or(ConversationContext));
87070
+
87071
+ /**
87072
+ * Forward input information of a conversation
87073
+ * @typedef {import('zod').infer<typeof ForwardSchema>} IForward
87074
+ */
87061
87075
  var ForwardSchema = z.union([z["boolean"](), z.string(), z.object({
87062
87076
  to: z.string().optional(),
87063
- mode: z["enum"](['after-reply', 'immediately']).optional()
87064
- })]);
87077
+ mode: z["enum"](['after-reply', 'immediately']).optional(),
87078
+ note: z.string({
87079
+ description: 'Note to provide to the agent'
87080
+ }).optional()
87081
+ })], {
87082
+ description: 'Forward input information of a conversation'
87083
+ });
87084
+
87085
+ /**
87086
+ * Instruction object schema used to send context to guide conversations
87087
+ * @typedef {import('zod').infer<typeof InstructionSchema>} IInstruction
87088
+ */
87065
87089
  var InstructionSchema = z.object({
87066
87090
  id: zId('Instruction ID').describe('Unique ID for the instruction, this is used to remove the instruction later'),
87067
87091
  content: z.string()
@@ -87070,12 +87094,17 @@ var InstructionSchema = z.object({
87070
87094
  /**
87071
87095
  * If its a string, it will be sent as a static string.
87072
87096
  * If it's a object or WorkflowResponseMessageAPI - it will use
87097
+ * @typedef {import('zod').infer<typeof WorkflowResponseMessage>} IWorkflowResponseMessage
87073
87098
  */
87074
87099
  var WorkflowResponseMessage = z.union(z.string(),
87075
87100
  /**
87076
87101
  * An api call that should be called later, must return a string or {message: string}
87077
87102
  */
87078
87103
  WorkflowResponseMessageApiRequest);
87104
+
87105
+ /**
87106
+ * @typedef {import('zod').infer<typeof WorkflowResponseMessageApiRequest>} IWorkflowResponseMessageApiRequest
87107
+ */
87079
87108
  var WorkflowResponseMessageApiRequest = z.object({
87080
87109
  uri: z.string(),
87081
87110
  data: z.any().optional(),
@@ -87085,6 +87114,7 @@ var WorkflowResponseMessageApiRequest = z.object({
87085
87114
 
87086
87115
  /**
87087
87116
  * The intended response provided by the WorkflowResponseMessageApiRequest
87117
+ * @typedef {import('zod').infer<typeof WorkflowResponseMessageApiResponse>} IWorkflowResponseMessageApiResponse
87088
87118
  */
87089
87119
  var WorkflowResponseMessageApiResponse = z.union([z.string(), z.object({
87090
87120
  message: z.string()
@@ -87099,8 +87129,16 @@ var WorkflowResponseMessageApiResponse = z.union([z.string(), z.object({
87099
87129
  text: z.string()
87100
87130
  })
87101
87131
  })]);
87132
+
87133
+ /**
87134
+ * The workflow response object slot
87135
+ * @typedef {import('zod').infer<typeof WorkflowResponseSlotSchema>} IWorkflowResponseSlot
87136
+ */
87102
87137
  var WorkflowResponseSlotSchema = z.object({
87103
87138
  forward: ForwardSchema.optional(),
87139
+ forwardNote: z.string({
87140
+ description: 'Note to provide to the agent, recommend using forward object api instead'
87141
+ }).optional(),
87104
87142
  instructions: z.union([z.string(), InstructionSchema, z.array(z.string()), z.array(InstructionSchema)]).optional(),
87105
87143
  removeInstructions: z.array(z.string()).optional(),
87106
87144
  message: z.string().optional(),
@@ -87110,8 +87148,18 @@ var WorkflowResponseSlotSchema = z.object({
87110
87148
  contextUpsert: ConversationContext.optional(),
87111
87149
  resetIntent: z["boolean"]().optional()
87112
87150
  });
87151
+
87152
+ /**
87153
+ * The workflow response to send in any given workflow
87154
+ * @typedef {import('zod').infer<typeof WorkflowResponseSchema>} IWorkflowResponse
87155
+ */
87113
87156
  var WorkflowResponseSchema = z.union([WorkflowResponseSlotSchema, z.array(WorkflowResponseSlotSchema)]);
87114
87157
 
87158
+ /**
87159
+ * @typedef {import('zod').infer<typeof WorkflowFunctionSchema>} IWorkflowFunction
87160
+ */
87161
+ var WorkflowFunctionSchema = z["function"]().args(WorkflowEventSchema).returns(z.union([z.promise(WorkflowResponseSchema), WorkflowResponseSchema]));
87162
+
87115
87163
  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
87116
87164
  ]);
87117
87165
  z.union([z.literal('orin-1.0'), z.literal('orin-2.0-preview')]);
@@ -87127,21 +87175,45 @@ var bardSchema = z.object({
87127
87175
  engine: z.literal('bard'),
87128
87176
  model: z.string()
87129
87177
  });
87178
+
87179
+ /**
87180
+ * Configure personal model transformer (PMT) settings to align auto replies the agent's tone
87181
+ */
87130
87182
  var pmtSchema = z.object({
87131
87183
  engine: z.literal('scout9'),
87132
87184
  // model: pmtModelOptions
87133
87185
  model: z.string()
87186
+ }, {
87187
+ description: 'Configure personal model transformer (PMT) settings to align auto replies the agent\'s tone'
87134
87188
  });
87135
- var Scout9ProjectBuildConfigSchema = z.object({
87189
+
87190
+ /**
87191
+ * Represents the configuration provided in src/index.{js | ts} in a project
87192
+ * @typedef {import('zod').infer<typeof Scout9ProjectConfigSchema>} IScout9ProjectConfig
87193
+ */
87194
+ var Scout9ProjectConfigSchema = z.object({
87195
+ /**
87196
+ * Tag to reference this application
87197
+ * @defaut your local package.json name + version, or scout9-app-v1.0.0
87198
+ */
87136
87199
  tag: z.string().optional(),
87137
87200
  // Defaults to scout9-app-v1.0.0
87138
- agents: agentsBaseConfigurationSchema,
87139
- entities: entitiesRootProjectConfigurationSchema,
87140
- workflows: WorkflowsConfigurationSchema,
87141
87201
  llm: z.union([llmSchema, llamaSchema, bardSchema]),
87202
+ /**
87203
+ * Configure personal model transformer (PMT) settings to align auto replies the agent's tone
87204
+ */
87142
87205
  pmt: pmtSchema,
87143
- initialContext: z.array(z.string()),
87144
- maxLockAttempts: z.number().min(0).max(20).optional(),
87206
+ /**
87207
+ * Determines the max auto replies without further conversation progression (defined by new context data gathered)
87208
+ * before the conversation is locked and requires manual intervention
87209
+ * @default 3
87210
+ */
87211
+ maxLockAttempts: z.number({
87212
+ description: 'Determines the max auto replies without further conversation progression (defined by new context data gathered), before the conversation is locked and requires manual intervention'
87213
+ }).min(0).max(20)["default"](3).optional(),
87214
+ initialContext: z.array(z.string(), {
87215
+ description: 'Configure the initial contexts for every conversation'
87216
+ }),
87145
87217
  organization: z.object({
87146
87218
  name: z.string(),
87147
87219
  description: z.string(),
@@ -87155,6 +87227,96 @@ var Scout9ProjectBuildConfigSchema = z.object({
87155
87227
  }).optional()
87156
87228
  });
87157
87229
 
87230
+ /**
87231
+ * @typedef {import('zod').infer<typeof Scout9ProjectBuildConfigSchema>} IScout9ProjectBuildConfig
87232
+ */
87233
+ var Scout9ProjectBuildConfigSchema = Scout9ProjectConfigSchema.extend({
87234
+ agents: agentsBaseConfigurationSchema,
87235
+ entities: entitiesRootProjectConfigurationSchema,
87236
+ workflows: WorkflowsConfigurationSchema
87237
+ });
87238
+
87239
+ /**
87240
+ * @typedef {object} IApiFunctionParams
87241
+ * @property {Object.<string, string|string[]>} searchParams
87242
+ * @property {Record<string, string>} params
87243
+ */
87244
+ var apiFunctionParamsSchema = z.object({
87245
+ searchParams: z.record(z.union([z.string(), z.array(z.string())])),
87246
+ params: z.record(z.string())
87247
+ });
87248
+
87249
+ /**
87250
+ * @typedef {IApiFunctionParams & { id: string }} IApiEntityFunctionParams
87251
+ */
87252
+ apiFunctionParamsSchema.extend({
87253
+ id: z.string()
87254
+ });
87255
+
87256
+ /**
87257
+ * @template Params
87258
+ * @template Response
87259
+ * @typedef {function(IApiFunctionParams): Promise<EventResponse>} IApiFunction
87260
+ */
87261
+ var apiFunctionSchema = z["function"]().args(apiFunctionParamsSchema).returns(z.promise(eventResponseSchema));
87262
+
87263
+ /**
87264
+ * @template Params
87265
+ * @template Response
87266
+ * @typedef {IApiFunction<Params, Response>} IQueryApiFunction
87267
+ */
87268
+ var queryApiFunctionSchema = apiFunctionSchema;
87269
+
87270
+ /**
87271
+ * @template Params
87272
+ * @template Response
87273
+ * @typedef {IApiFunction<Params, Response>} GetApiFunction
87274
+ */
87275
+ var getApiFunctionSchema = apiFunctionSchema;
87276
+
87277
+ /**
87278
+ * @template Params
87279
+ * @template RequestBody
87280
+ * @template Response
87281
+ * @typedef {function(IApiFunctionParams & {body: Partial<RequestBody>}): Promise<EventResponse<Response>>} IPostApiFunction
87282
+ */
87283
+ var postApiFunctionSchema = function postApiFunctionSchema(requestBodySchema) {
87284
+ return z["function"]().args(apiFunctionParamsSchema.extend({
87285
+ body: requestBodySchema.partial()
87286
+ })).returns(z.promise(eventResponseSchema));
87287
+ };
87288
+
87289
+ /**
87290
+ * @template Params
87291
+ * @template RequestBody
87292
+ * @template Response
87293
+ * @typedef {function(IApiFunctionParams & {body: Partial<RequestBody>}): Promise<EventResponse<Response>>} IPutApiFunction
87294
+ */
87295
+ var putApiFunctionSchema = function putApiFunctionSchema(requestBodySchema) {
87296
+ return z["function"]().args(apiFunctionParamsSchema.extend({
87297
+ body: requestBodySchema.partial()
87298
+ })).returns(z.promise(eventResponseSchema));
87299
+ };
87300
+
87301
+ /**
87302
+ * @template Params
87303
+ * @template RequestBody
87304
+ * @template Response
87305
+ * @typedef {function(IApiFunctionParams & {body: Partial<RequestBody>}): Promise<EventResponse<Response>>} IPatchApiFunction
87306
+ */
87307
+ var patchApiFunctionSchema = function patchApiFunctionSchema(requestBodySchema) {
87308
+ return z["function"]().args(apiFunctionParamsSchema.extend({
87309
+ body: requestBodySchema.partial()
87310
+ })).returns(z.promise(eventResponseSchema));
87311
+ };
87312
+
87313
+ /**
87314
+ * @template Params
87315
+ * @template Response
87316
+ * @typedef {IApiFunction<Params, Response>} IDeleteApiFunction
87317
+ */
87318
+ var deleteApiFunctionSchema = apiFunctionSchema;
87319
+
87158
87320
  function loadEntityApiConfig$1(_x, _x2) {
87159
87321
  return _loadEntityApiConfig$1.apply(this, arguments);
87160
87322
  }
@@ -88349,36 +88511,8 @@ function report(config, logger) {
88349
88511
  logger.primary("Run ".concat(cyan('scout9 dev'), " to test your project locally"));
88350
88512
  }
88351
88513
 
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)));
88514
+ 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-85e8c05c.js', document.baseURI).href)));
88353
88515
  var __dirname$1 = path__default["default"].dirname(__filename$1);
88354
-
88355
- /**
88356
- * @returns {Promise<string>} - the output directory
88357
- */
88358
- // async function runNpmRunBuild({cwd = process.cwd(), src = 'src'} = {}) {
88359
- // const pkg = JSON.parse(fss.readFileSync(new URL(`${cwd}/package.json`, import.meta.url), 'utf-8'));
88360
- // // Package.json must have a "build" script
88361
- // const buildScript = pkg.scripts?.build;
88362
- // if (!buildScript) {
88363
- // // If no build script then just return src
88364
- // return path.resolve(cwd, src);
88365
- // }
88366
- // // "build" script cannot contain "scout9 build" (otherwise we'll get stuck in a loop)
88367
- // if (buildScript.includes('scout9 build')) {
88368
- // throw new Error(`"build" script in ${cwd}/package.json cannot contain "scout9 build"`);
88369
- // }
88370
- //
88371
- // return new Promise((resolve, reject) => {
88372
- // exec('npm run build', {cwd}, (error, stdout, stderr) => {
88373
- // if (error) {
88374
- // return reject(error);
88375
- // }
88376
- // // @TODO don't assume build script created a "build" directory (use a config)
88377
- // return resolve(path.resolve(cwd, 'build'));
88378
- // });
88379
- // });
88380
- // }
88381
-
88382
88516
  function zipDirectory(source, out) {
88383
88517
  var archive = archiver$1('tar', {
88384
88518
  gzip: true,
@@ -88592,7 +88726,7 @@ function _buildApp() {
88592
88726
  case 11:
88593
88727
  _context4.t0 = JSON;
88594
88728
  _context4.next = 14;
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');
88729
+ 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-85e8c05c.js', document.baseURI).href))), 'utf-8');
88596
88730
  case 14:
88597
88731
  _context4.t1 = _context4.sent;
88598
88732
  packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
@@ -88674,6 +88808,13 @@ function _buildApp() {
88674
88808
  function downloadDevApp(_x8, _x9) {
88675
88809
  return _downloadDevApp.apply(this, arguments);
88676
88810
  }
88811
+ /**
88812
+ * @param {Object} [options]
88813
+ * @param {string} [options.cwd]
88814
+ * @param {string} [options.src]
88815
+ * @param {boolean} [options.ignoreAppRequire]
88816
+ * @returns {Promise<{app: *, fileName: string, exe: string, filePath: string}>}
88817
+ */
88677
88818
  function _downloadDevApp() {
88678
88819
  _downloadDevApp = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee5(destination, version) {
88679
88820
  var url, downloadLocalResponse, arrayBuffer;
@@ -88804,10 +88945,10 @@ function getAgentContacts() {
88804
88945
  * Runs a given project container from scout9 to given environment
88805
88946
  * Runs the project in a container
88806
88947
  *
88807
- * @param {WorkflowEvent} event - every workflow receives an event object
88948
+ * @param {import('../runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
88808
88949
  * @param {Object} options
88809
88950
  * @param {string} options.eventSource - the source path of the event
88810
- * @returns {Promise<WorkflowResponse<any>>}
88951
+ * @returns {Promise<import('../runtime/client/workflow.js').IWorkflowResponse>}
88811
88952
  */
88812
88953
  function _getAgentContacts() {
88813
88954
  _getAgentContacts = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee7() {
@@ -88907,7 +89048,7 @@ function runConfig() {
88907
89048
  /**
88908
89049
  * Builds a local project
88909
89050
  * @param {{cwd: string; src: string; dest: string; logger: ProgressLogger; mode: string;}} - build options
88910
- * @param {Scout9ProjectBuildConfig} config
89051
+ * @param {import('../runtime/client/').IScout9ProjectBuildConfig} config
88911
89052
  * @returns {messages: string[]}
88912
89053
  */
88913
89054
  function _runConfig() {
@@ -88950,6 +89091,7 @@ function build() {
88950
89091
  * Deploys a local project to scout9
88951
89092
  * @param {{cwd: string; src: string, dest: string}} - build options
88952
89093
  * @param {Scout9ProjectBuildConfig} config
89094
+ * @return {Promise<{deploy: Object, contacts: any}>}
88953
89095
  */
88954
89096
  function _build() {
88955
89097
  _build = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee10() {
@@ -89041,7 +89183,7 @@ function deploy(_x11, _x12) {
89041
89183
  /**
89042
89184
  * Tests a local project to scout9 by running a dummy parse command with the project's local entities
89043
89185
  * @param {{cwd: string; src: string, dest: string}} - build options
89044
- * @param {Scout9ProjectBuildConfig} config
89186
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
89045
89187
  */
89046
89188
  function _deploy() {
89047
89189
  _deploy = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee11(_ref4, config) {
@@ -89117,8 +89259,8 @@ function test(_x13, _x14) {
89117
89259
  /**
89118
89260
  *
89119
89261
  * @param {{cwd: string; src: string; projectFiles: ProjectFiles; logger: ProgressLogger}} options
89120
- * @param {Scout9ProjectBuildConfig} config
89121
- * @returns {Promise<{success: boolean; config: Scout9ProjectBuildConfig}>}
89262
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
89263
+ * @returns {Promise<{success: boolean; config: import('../runtime/client/config.js').IScout9ProjectBuildConfig}>}
89122
89264
  */
89123
89265
  function _test() {
89124
89266
  _test = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee12(_ref5, config) {
@@ -90488,7 +90630,7 @@ var Scout9Platform = {
90488
90630
  * @param {string} [params.cwd=process.cwd()] - the working directory
90489
90631
  * @param {string} [params.src='src'] - the source directory
90490
90632
  * @param {string} [params.mode='production'] - the build mode
90491
- * @returns {Promise<Scout9ProjectBuildConfig>}
90633
+ * @returns {Promise<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
90492
90634
  */
90493
90635
  sync: function () {
90494
90636
  var _sync2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee() {
@@ -90563,7 +90705,7 @@ var Scout9Platform = {
90563
90705
  * @param {string} [params.dest='/tmp/project'] - the destination directory
90564
90706
  * @param {'development' | 'production'} [params.mode='production'] - the build mode
90565
90707
  * @param {boolean} [params.sync=true] - whether to sync the project after deploying
90566
- * @returns {Promise<Scout9ProjectBuildConfig>}
90708
+ * @returns {Promise<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
90567
90709
  */
90568
90710
  deploy: function () {
90569
90711
  var _deploy2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee2() {
@@ -90685,7 +90827,7 @@ var Scout9Platform = {
90685
90827
  * @param {string} [params.src='./src'] - the source directory
90686
90828
  * @param {string} [params.dest='/tmp/project'] - the destination directory
90687
90829
  * @param {'development' | 'production'} [params.mode='production'] - the build mode
90688
- * @returns {Promise<Scout9ProjectBuildConfig>}
90830
+ * @returns {Promise<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
90689
90831
  */
90690
90832
  test: function () {
90691
90833
  var _test2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee3() {
@@ -90759,7 +90901,7 @@ var Scout9Platform = {
90759
90901
  * @param {string} [params.src='./src'] - the source directory
90760
90902
  * @param {string} [params.dest='/tmp/project'] - the destination directory
90761
90903
  * @param {'development' | 'production'} [params.mode='production'] - the build mode
90762
- * @returns {Promise<Scout9ProjectBuildConfig>}
90904
+ * @returns {Promise<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
90763
90905
  */
90764
90906
  build: function () {
90765
90907
  var _build2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee4() {
@@ -90836,7 +90978,7 @@ var Scout9Platform = {
90836
90978
  * @param {string} [params.cwd=process.cwd()] - the working directory
90837
90979
  * @param {boolean} [params.local=false] - whether to only load the local config (ignores what's saved on server)
90838
90980
  * @param {string} [params.src='./src'] - the source directory
90839
- * @returns {Promise<Scout9ProjectBuildConfig>}
90981
+ * @returns {Promise<import('./runtime/client/config.js').IScout9ProjectBuildConfig>}
90840
90982
  */
90841
90983
  config: function () {
90842
90984
  var _config = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee5() {
@@ -90890,13 +91032,13 @@ var Scout9Platform = {
90890
91032
  }(),
90891
91033
  /**
90892
91034
  * Runs the project in a container
90893
- * @param {WorkflowEvent} event - every workflow receives an event object
91035
+ * @param {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
90894
91036
  * @param {Object} options
90895
91037
  * @param {string} [options.cwd=process.cwd()] - the working directory
90896
91038
  * @param {string} [options.mode='production'] - the build mode
90897
91039
  * @param {string} [options.src='./src'] - the source directory
90898
91040
  * @param {string} options.eventSource - the source of the workflow event
90899
- * @returns {Promise<WorkflowResponse<any>>}
91041
+ * @returns {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
90900
91042
  */
90901
91043
  run: function () {
90902
91044
  var _run2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee6(event, _ref6) {
@@ -91606,18 +91748,22 @@ var Scout9Test = /*#__PURE__*/function () {
91606
91748
  }();
91607
91749
 
91608
91750
  /**
91609
- * @param {WorkflowEvent} event - every workflow receives an event object
91610
- * @param {{cwd: string; mode: 'development' | 'production'; src: string}} options - build options
91611
- * @returns {Promise<WorkflowResponse<any>>}
91751
+ * @param {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
91752
+ * @param {Object} options
91753
+ * @param {string} [options.cwd=process.cwd()] - the working directory
91754
+ * @param {string} [options.mode='production'] - the build mode
91755
+ * @param {string} [options.src='./src'] - the source directory
91756
+ * @param {string} options.eventSource - the source of the workflow event
91757
+ * @returns {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
91612
91758
  */
91613
91759
  function run(_x, _x2) {
91614
91760
  return _run.apply(this, arguments);
91615
91761
  }
91616
91762
 
91617
91763
  /**
91618
- * @param {WorkflowEvent} event - every workflow receives an event object
91764
+ * @param {import('./runtime/client/workflow.js').IWorkflowEvent} event - every workflow receives an event object
91619
91765
  * @param {{cwd: string; mode: 'development' | 'production'; src: string}} options - build options
91620
- * @returns {Promise<WorkflowResponse<any>>}
91766
+ * @returns {Promise<import('./runtime/client/workflow.js').IWorkflowResponse>}
91621
91767
  */
91622
91768
  function _run() {
91623
91769
  _run = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee(event, options) {
@@ -91638,7 +91784,7 @@ var sendEvent = run;
91638
91784
  /**
91639
91785
  * @param data {T}
91640
91786
  * @param init {ResponseInit | undefined}
91641
- * @returns {EventResponse<T>}
91787
+ * @returns {import('./runtime/client/api.js').EventResponse<T>}
91642
91788
  */
91643
91789
  function json(data, init) {
91644
91790
  if (data instanceof Promise) {
@@ -91674,20 +91820,22 @@ exports.InstructionSchema = InstructionSchema;
91674
91820
  exports.IntentWorkflowEventSchema = IntentWorkflowEventSchema;
91675
91821
  exports.MessageSchema = MessageSchema;
91676
91822
  exports.Scout9ProjectBuildConfigSchema = Scout9ProjectBuildConfigSchema;
91823
+ exports.Scout9ProjectConfigSchema = Scout9ProjectConfigSchema;
91677
91824
  exports.Scout9Test = Scout9Test;
91678
91825
  exports.WorkflowConfigurationSchema = WorkflowConfigurationSchema;
91679
91826
  exports.WorkflowEventSchema = WorkflowEventSchema;
91827
+ exports.WorkflowFunctionSchema = WorkflowFunctionSchema;
91680
91828
  exports.WorkflowResponseMessage = WorkflowResponseMessage;
91681
91829
  exports.WorkflowResponseMessageApiRequest = WorkflowResponseMessageApiRequest;
91682
91830
  exports.WorkflowResponseMessageApiResponse = WorkflowResponseMessageApiResponse;
91683
91831
  exports.WorkflowResponseSchema = WorkflowResponseSchema;
91684
91832
  exports.WorkflowResponseSlotSchema = WorkflowResponseSlotSchema;
91685
91833
  exports.WorkflowsConfigurationSchema = WorkflowsConfigurationSchema;
91686
- exports._entityApiConfigurationSchema = _entityApiConfigurationSchema;
91687
91834
  exports.agentBaseConfigurationSchema = agentBaseConfigurationSchema;
91688
91835
  exports.agentConfigurationSchema = agentConfigurationSchema;
91689
91836
  exports.agentsBaseConfigurationSchema = agentsBaseConfigurationSchema;
91690
91837
  exports.agentsConfigurationSchema = agentsConfigurationSchema;
91838
+ exports.apiFunctionSchema = apiFunctionSchema;
91691
91839
  exports.createMockAgent = createMockAgent;
91692
91840
  exports.createMockConversation = createMockConversation;
91693
91841
  exports.createMockCustomer = createMockCustomer;
@@ -91695,11 +91843,18 @@ exports.createMockMessage = createMockMessage;
91695
91843
  exports.createMockWorkflowEvent = createMockWorkflowEvent;
91696
91844
  exports.customerSchema = customerSchema;
91697
91845
  exports.customerValueSchema = customerValueSchema;
91846
+ exports.deleteApiFunctionSchema = deleteApiFunctionSchema;
91698
91847
  exports.entitiesRootConfigurationSchema = entitiesRootConfigurationSchema;
91699
91848
  exports.entitiesRootProjectConfigurationSchema = entitiesRootProjectConfigurationSchema;
91700
91849
  exports.entityApiConfigurationSchema = entityApiConfigurationSchema;
91701
91850
  exports.entityConfigurationSchema = entityConfigurationSchema;
91702
91851
  exports.entityRootProjectConfigurationSchema = entityRootProjectConfigurationSchema;
91852
+ exports.eventResponseSchema = eventResponseSchema;
91853
+ exports.getApiFunctionSchema = getApiFunctionSchema;
91703
91854
  exports.json = json;
91855
+ exports.patchApiFunctionSchema = patchApiFunctionSchema;
91856
+ exports.postApiFunctionSchema = postApiFunctionSchema;
91857
+ exports.putApiFunctionSchema = putApiFunctionSchema;
91858
+ exports.queryApiFunctionSchema = queryApiFunctionSchema;
91704
91859
  exports.run = run;
91705
91860
  exports.sendEvent = sendEvent;