@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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var spirits = require("./spirits-1dc18cf4.cjs");
3
+ var spirits = require("./spirits-3b603262.cjs");
4
4
  var readline = require('node:readline');
5
5
  var require$$0$2 = require('fs');
6
6
  var require$$2$1 = require('events');
@@ -41174,7 +41174,7 @@ class Body {
41174
41174
  }
41175
41175
  const {
41176
41176
  toFormData
41177
- } = await Promise.resolve().then(function () { return require("./multipart-parser-78fb466c.cjs"); });
41177
+ } = await Promise.resolve().then(function () { return require("./multipart-parser-e09a67c9.cjs"); });
41178
41178
  return toFormData(this.body, ct);
41179
41179
  }
41180
41180
 
@@ -81215,7 +81215,7 @@ function loadUserPackageJson$1(_x2) {
81215
81215
  }
81216
81216
 
81217
81217
  /**
81218
- * @returns {Promise<import('@scout9/app').IScout9ProjectConfig>}
81218
+ * @returns {Promise<import('../../runtime/client/config.js').IScout9ProjectConfig>}
81219
81219
  */
81220
81220
  function _loadUserPackageJson$1() {
81221
81221
  _loadUserPackageJson$1 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee2(_ref2) {
@@ -81232,7 +81232,7 @@ function _loadUserPackageJson$1() {
81232
81232
  targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
81233
81233
  _context2.t0 = JSON;
81234
81234
  _context2.next = 10;
81235
- 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-b2e88386.js', document.baseURI).href))), 'utf-8');
81235
+ 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-e7d51b70.js', document.baseURI).href))), 'utf-8');
81236
81236
  case 10:
81237
81237
  _context2.t1 = _context2.sent;
81238
81238
  pkg = _context2.t0.parse.call(_context2.t0, _context2.t1);
@@ -81564,8 +81564,8 @@ function _platformApi() {
81564
81564
  }
81565
81565
 
81566
81566
  /**
81567
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
81568
- * @returns {Promise<import('@scout9/app').IScout9ProjectBuildConfig>}
81567
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
81568
+ * @returns {Promise<import('../runtime/client/config.js').IScout9ProjectBuildConfig>}
81569
81569
  */
81570
81570
  function syncData(_x) {
81571
81571
  return _syncData.apply(this, arguments);
@@ -82077,7 +82077,7 @@ function _loadUserPackageJson() {
82077
82077
  targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
82078
82078
  _context.t0 = JSON;
82079
82079
  _context.next = 10;
82080
- 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-b2e88386.js', document.baseURI).href))), 'utf-8');
82080
+ 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-e7d51b70.js', document.baseURI).href))), 'utf-8');
82081
82081
  case 10:
82082
82082
  _context.t1 = _context.sent;
82083
82083
  pkg = _context.t0.parse.call(_context.t0, _context.t1);
@@ -88516,7 +88516,7 @@ function report(config, logger) {
88516
88516
  logger.primary("Run ".concat(cyan('scout9 dev'), " to test your project locally"));
88517
88517
  }
88518
88518
 
88519
- 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-b2e88386.js', document.baseURI).href)));
88519
+ 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-e7d51b70.js', document.baseURI).href)));
88520
88520
  var __dirname$1 = path__default["default"].dirname(__filename$1);
88521
88521
  function zipDirectory(source, out) {
88522
88522
  var archive = archiver$1('tar', {
@@ -88731,7 +88731,7 @@ function _buildApp() {
88731
88731
  case 11:
88732
88732
  _context4.t0 = JSON;
88733
88733
  _context4.next = 14;
88734
- 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-b2e88386.js', document.baseURI).href))), 'utf-8');
88734
+ 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-e7d51b70.js', document.baseURI).href))), 'utf-8');
88735
88735
  case 14:
88736
88736
  _context4.t1 = _context4.sent;
88737
88737
  packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
@@ -89188,7 +89188,7 @@ function deploy(_x11, _x12) {
89188
89188
  /**
89189
89189
  * Tests a local project to scout9 by running a dummy parse command with the project's local entities
89190
89190
  * @param {{cwd: string; src: string, dest: string}} - build options
89191
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
89191
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
89192
89192
  */
89193
89193
  function _deploy() {
89194
89194
  _deploy = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee11(_ref4, config) {
@@ -89264,8 +89264,8 @@ function test(_x13, _x14) {
89264
89264
  /**
89265
89265
  *
89266
89266
  * @param {{cwd: string; src: string; projectFiles: ProjectFiles; logger: ProgressLogger}} options
89267
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
89268
- * @returns {Promise<{success: boolean; config: import('@scout9/app').IScout9ProjectBuildConfig}>}
89267
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
89268
+ * @returns {Promise<{success: boolean; config: import('../runtime/client/config.js').IScout9ProjectBuildConfig}>}
89269
89269
  */
89270
89270
  function _test() {
89271
89271
  _test = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee12(_ref5, config) {
@@ -90154,7 +90154,7 @@ function loadEntityApiConfig(_x, _x2) {
90154
90154
  return _loadEntityApiConfig.apply(this, arguments);
90155
90155
  }
90156
90156
  /**
90157
- * @returns {Promise<import('@scout9/app').IEntitiesRootProjectConfiguration>}
90157
+ * @returns {Promise<import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration>}
90158
90158
  */
90159
90159
  function _loadEntityApiConfig() {
90160
90160
  _loadEntityApiConfig = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee(cwd, filePath) {
@@ -90217,7 +90217,7 @@ function _loadEntitiesConfig() {
90217
90217
  while (1) switch (_context4.prev = _context4.next) {
90218
90218
  case 0:
90219
90219
  _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref$cwd = _ref.cwd, cwd = _ref$cwd === void 0 ? process.cwd() : _ref$cwd, _ref$src = _ref.src, src = _ref$src === void 0 ? 'src' : _ref$src, _ref.logger, _ref.cb;
90220
- /** @type import('@scout9/app').IEntitiesRootProjectConfiguration */
90220
+ /** @type import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration */
90221
90221
  config = []; // const paths = globSync(path.resolve(cwd, `${src}/entities/**/{index,config,api}.{ts,js}`), {cwd, absolute: true});
90222
90222
  filePaths = globSync("".concat(src, "/entities/**/{index,config,api}.{ts,js}"), {
90223
90223
  cwd: cwd,
@@ -90431,7 +90431,7 @@ function _loadEntitiesConfig() {
90431
90431
  }
90432
90432
 
90433
90433
  /**
90434
- * @returns {Promise<import('@scout9/app').IWorkflowsConfiguration>}
90434
+ * @returns {Promise<import('../../runtime/client/workflow.js').IWorkflowsConfiguration>}
90435
90435
  */
90436
90436
  function loadWorkflowsConfig() {
90437
90437
  return _loadWorkflowsConfig.apply(this, arguments);
@@ -90473,7 +90473,7 @@ function _loadWorkflowsConfig() {
90473
90473
  _ref2.path;
90474
90474
  var parents = _ref2.parents;
90475
90475
  // Validate project configuration
90476
- /** @type {import('@scout9/app').IWorkflowConfiguration} */
90476
+ /** @type {import('../../runtime/client/workflow.js').IWorkflowConfiguration} */
90477
90477
  var workflowConfig = {
90478
90478
  entity: parents[0],
90479
90479
  entities: parents.reverse()
@@ -90520,7 +90520,7 @@ function loadEnvConfig() {
90520
90520
  /**
90521
90521
  * @deprecated use "new ProjectFiles(...).load()" instead
90522
90522
  * @param {{cwd: string; src: string; logger?: ProgressLogger; deploying?: boolean; cb?: (message: string) => void}} - build options
90523
- * @returns {Promise<import('@scout9/app').IScout9ProjectBuildConfig>}
90523
+ * @returns {Promise<import('../../runtime/client/config.js').IScout9ProjectBuildConfig>}
90524
90524
  */
90525
90525
  function loadConfig() {
90526
90526
  return _loadConfig.apply(this, arguments);
@@ -90600,7 +90600,7 @@ function _loadConfig() {
90600
90600
  case 13:
90601
90601
  workflowsConfig = _context.sent;
90602
90602
  /**
90603
- * @type {import('@scout9/app').IScout9ProjectBuildConfig}
90603
+ * @type {import('../../runtime/client/config.js').IScout9ProjectBuildConfig}
90604
90604
  */
90605
90605
  projectConfig = spirits._objectSpread2(spirits._objectSpread2({}, baseProjectConfig), {}, {
90606
90606
  entities: entitiesConfig,
@@ -91105,7 +91105,7 @@ var Scout9Platform = {
91105
91105
  };
91106
91106
 
91107
91107
  /**
91108
- * @returns {import('@scout9/app').IAgent}
91108
+ * @returns {import('../runtime/client/users.js').IAgent}
91109
91109
  */
91110
91110
  var createMockAgent = function createMockAgent() {
91111
91111
  var firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Carmela';
@@ -91118,7 +91118,7 @@ var createMockAgent = function createMockAgent() {
91118
91118
  };
91119
91119
 
91120
91120
  /**
91121
- * @returns {import('@scout9/app').ICustomer}
91121
+ * @returns {import('../runtime/client/users.js').ICustomer}
91122
91122
  */
91123
91123
  var createMockCustomer = function createMockCustomer() {
91124
91124
  var firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Tony';
@@ -91136,7 +91136,7 @@ var createMockCustomer = function createMockCustomer() {
91136
91136
  * @param content
91137
91137
  * @param role
91138
91138
  * @param time
91139
- * @returns {import('@scout9/app').IMessage}
91139
+ * @returns {import('../runtime/client/message.js').IMessage}
91140
91140
  */
91141
91141
  var createMockMessage = function createMockMessage(content) {
91142
91142
  var role = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'customer';
@@ -91152,7 +91152,7 @@ var createMockMessage = function createMockMessage(content) {
91152
91152
  };
91153
91153
 
91154
91154
  /**
91155
- * @returns {import('@scout9/app').IConversation}
91155
+ * @returns {import('../runtime/client/workflow.js').IConversation}
91156
91156
  */
91157
91157
  var createMockConversation = function createMockConversation() {
91158
91158
  var environment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'phone';
@@ -91167,8 +91167,8 @@ var createMockConversation = function createMockConversation() {
91167
91167
 
91168
91168
  /**
91169
91169
  * @param {string} message
91170
- * @param {string | import('@scout9/app').IWorkflowEvent['intent'] | null} intent
91171
- * @returns {import('@scout9/app').IWorkflowEvent}
91170
+ * @param {string | import('../runtime/client/workflow.js').IWorkflowEvent['intent'] | null} intent
91171
+ * @returns {import('../runtime/client/workflow.js').IWorkflowEvent}
91172
91172
  */
91173
91173
  var createMockWorkflowEvent = function createMockWorkflowEvent(message) {
91174
91174
  var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
@@ -91195,16 +91195,16 @@ var Scout9Test = /*#__PURE__*/function () {
91195
91195
  /**
91196
91196
  * Mimics a customer message to your app (useful for testing)
91197
91197
  * @param props - the Scout9Test properties
91198
- * @param {import('@scout9/app').ICustomer | undefined} [props.customer] - customer to use
91198
+ * @param {import('../runtime/client/users.js').ICustomer | undefined} [props.customer] - customer to use
91199
91199
  * @param {any | undefined} [props.context] - prior conversation context
91200
91200
  * @param {string | undefined} [props.persona] id to use
91201
- * @param {import('@scout9/app').IConversation | undefined} [props.conversation] - existing conversation
91201
+ * @param {import('../runtime/client/workflow.js').IConversation | undefined} [props.conversation] - existing conversation
91202
91202
  * @param {string | undefined} [props.cwd]
91203
91203
  * @param {string | undefined} [props.src]
91204
91204
  * @param {string | undefined} [props.mode]
91205
91205
  * @param {import('@scout9/admin').Scout9Api} [props.api]
91206
- * @param {import('@scout9/app').IWorkflowFunction} [props.app]
91207
- * @param {import('scout9/app').IScout9ProjectBuildConfig} [props.project]
91206
+ * @param {import('../runtime/client/workflow.js').IWorkflowFunction} [props.app]
91207
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} [props.project]
91208
91208
  */
91209
91209
  function Scout9Test() {
91210
91210
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
@@ -91228,19 +91228,19 @@ var Scout9Test = /*#__PURE__*/function () {
91228
91228
  project = _ref.project;
91229
91229
  spirits._classCallCheck(this, Scout9Test);
91230
91230
  /**
91231
- * @type {import('@scout9/app').ICustomer}
91231
+ * @type {import('../runtime/client/users.js').ICustomer}
91232
91232
  */
91233
91233
  spirits._defineProperty(this, "customer", void 0);
91234
91234
  /**
91235
- * @type {import('@scout9/app').IPersona}
91235
+ * @type {import('../runtime/client/users.js').IPersona}
91236
91236
  */
91237
91237
  spirits._defineProperty(this, "persona", void 0);
91238
91238
  /**
91239
- * @type {import('@scout9/app').IConversation}
91239
+ * @type {import('../runtime/client/workflow.js').IConversation}
91240
91240
  */
91241
91241
  spirits._defineProperty(this, "conversation", void 0);
91242
91242
  /**
91243
- * @type {import('@scout9/app').IMessage[]}
91243
+ * @type {import('../runtime/client/message.js').IMessage[]}
91244
91244
  */
91245
91245
  spirits._defineProperty(this, "messages", void 0);
91246
91246
  /**
@@ -91249,12 +91249,12 @@ var Scout9Test = /*#__PURE__*/function () {
91249
91249
  spirits._defineProperty(this, "context", void 0);
91250
91250
  /**
91251
91251
  * @private
91252
- * @type {import('scout9/app').IScout9ProjectBuildConfig | null}
91252
+ * @type {import('../runtime/client/config.js').IScout9ProjectBuildConfig | null}
91253
91253
  */
91254
91254
  spirits._defineProperty(this, "_project", null);
91255
91255
  /**
91256
91256
  * @private
91257
- * @type {import('@scout9/app').IWorkflowFunction | null}
91257
+ * @type {import('../runtime/client/workflow.js').IWorkflowFunction | null}
91258
91258
  */
91259
91259
  spirits._defineProperty(this, "_app", null);
91260
91260
  /**
@@ -91603,8 +91603,8 @@ var Scout9Test = /*#__PURE__*/function () {
91603
91603
  /**
91604
91604
  * Runs your local app workflow
91605
91605
  * @param {string} message - the message to run through the workflow
91606
- * @param {Omit<Partial<import('@scout9/app').IWorkflowEvent>, 'message'> | undefined} [event] - additional event data
91607
- * @returns {Promise<import('@scout9/app').IWorkflowResponse>}
91606
+ * @param {Omit<Partial<import('../runtime/client/workflow.js').IWorkflowEvent>, 'message'> | undefined} [event] - additional event data
91607
+ * @returns {Promise<import('../runtime/client/workflow.js').IWorkflowResponse>}
91608
91608
  */
91609
91609
  )
91610
91610
  }, {
@@ -91643,7 +91643,7 @@ var Scout9Test = /*#__PURE__*/function () {
91643
91643
  * @param {Object} [input] - Generation input, defaults to test registered data such as existing messages, context, and persona information.
91644
91644
  * @param {string} [input.personaId] - Persona ID to use, defaults to test registered persona id.
91645
91645
  * @param {Partial<import('@scout9/admin').ConversationCreateRequest>} [input.conversation] - Conversation overrides, defaults to test registered conversation data.
91646
- * @param {import('@scout9/app').IMessage[]} [input.messages] - Message overrides, defaults to test registered message data.
91646
+ * @param {import('../runtime/client/message.js').IMessage[]} [input.messages] - Message overrides, defaults to test registered message data.
91647
91647
  * @param {any} [input.context] - Context overrides, defaults to test registered context data.
91648
91648
  * @returns {Promise<import('@scout9/admin').GenerateResponse>}
91649
91649
  */
package/dist/index.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-b2e88386.cjs");
6
- var spirits = require("./spirits-1dc18cf4.cjs");
5
+ var exports$1 = require("./exports-e7d51b70.cjs");
6
+ var spirits = require("./spirits-3b603262.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
9
9
  require('events');
@@ -2,8 +2,8 @@
2
2
 
3
3
  require('node:fs');
4
4
  require('node:path');
5
- var exports$1 = require("./exports-b2e88386.cjs");
6
- require("./spirits-1dc18cf4.cjs");
5
+ var exports$1 = require("./exports-e7d51b70.cjs");
6
+ require("./spirits-3b603262.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
9
9
  require('events');
@@ -566,35 +566,35 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
566
566
 
567
567
  /**
568
568
  * @typedef {Object} ConversationData
569
- * @property {import('@scout9/app').IScout9ProjectBuildConfig} config - used to define generation and extract persona metadata
570
- * @property {import('@scout9/app').IConversation} conversation
571
- * @property {Array<import('@scout9/app').IMessage>} messages
572
- * @property {import('@scout9/app').IMessage} message - the message sent by the customer (should exist in messages)
573
- * @property {import('@scout9/app').ICustomer} customer
569
+ * @property {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config - used to define generation and extract persona metadata
570
+ * @property {import('../runtime/client/workflow.js').IConversation} conversation
571
+ * @property {Array<import('../runtime/client/message.js').IMessage>} messages
572
+ * @property {import('../runtime/client/message.js').IMessage} message - the message sent by the customer (should exist in messages)
573
+ * @property {import('../runtime/client/users.js').ICustomer} customer
574
574
  * @property {any} context
575
575
  */
576
576
 
577
577
  /**
578
578
  * @typedef {Object} ParseOutput
579
- * @property {Array<import('@scout9/app').IMessage>} messages
580
- * @property {import('@scout9/app').IConversation} conversation
581
- * @property {import('@scout9/app').IMessage} message
579
+ * @property {Array<import('../runtime/client/message.js').IMessage>} messages
580
+ * @property {import('../runtime/client/workflow.js').IConversation} conversation
581
+ * @property {import('../runtime/client/message.js').IMessage} message
582
582
  * @property {any} context
583
583
  */
584
584
 
585
585
  /**
586
586
  * @typedef {Object} WorkflowOutput
587
- * @property {Array<import('@scout9/app').IWorkflowResponseSlot>} slots
588
- * @property {Array<import('@scout9/app').IMessage>} messages
589
- * @property {import('@scout9/app').IConversation} conversation
587
+ * @property {Array<import('../runtime/client/workflow.js').IWorkflowResponseSlot>} slots
588
+ * @property {Array<import('../runtime/client/message.js').IMessage>} messages
589
+ * @property {import('../runtime/client/workflow.js').IConversation} conversation
590
590
  * @property {any} context
591
591
  */
592
592
 
593
593
  /**
594
594
  * @typedef {Object} GenerateOutput
595
595
  * @property {import('@scout9/admin').GenerateResponse | undefined} generate
596
- * @property {Array<import('@scout9/app').IMessage>} messages
597
- * @property {import('@scout9/app').IConversation} conversation
596
+ * @property {Array<import('../runtime/client/message.js').IMessage>} messages
597
+ * @property {import('../runtime/client/workflow.js').IConversation} conversation
598
598
  * @property {any} context
599
599
  */
600
600
 
@@ -607,8 +607,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
607
607
 
608
608
  /**
609
609
  * @callback WorkflowFun
610
- * @param {import('@scout9/app').IWorkflowEvent} event - conversation data
611
- * @returns {Promise<import('@scout9/app').IWorkflowResponse>}
610
+ * @param {import('../runtime/client/workflow.js').IWorkflowEvent} event - conversation data
611
+ * @returns {Promise<import('../runtime/client/workflow.js').IWorkflowResponse>}
612
612
  */
613
613
 
614
614
  /**
@@ -619,7 +619,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
619
619
 
620
620
  /**
621
621
  * @callback IdGeneratorFun
622
- * @param {import('@scout9/app').IMessage.role} prefix
622
+ * @param {import('../runtime/client/message.js').IMessage.role} prefix
623
623
  * @returns {string}
624
624
  */
625
625
  /**
@@ -642,10 +642,10 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
642
642
 
643
643
  /**
644
644
  * @typedef {Object} ConversationEvent
645
- * @property {Change<import('@scout9/app').IConversation> & {forwardNote?: string; forward?: import('@scout9/app').WorkflowResponseSlot['forward']}} conversation
646
- * @property {Change<Array<import('@scout9/app').IMessage>>} messages
645
+ * @property {Change<import('../runtime/client/workflow.js').IConversation> & {forwardNote?: string; forward?: import('../runtime/client/message.js').IWorkflowResponseSlot['forward']}} conversation
646
+ * @property {Change<Array<import('../runtime/client/message.js').IMessage>>} messages
647
647
  * @property {Change<Object>} context
648
- * @property {Change<import('@scout9/app').IMessage>} message
648
+ * @property {Change<import('../runtime/client/message.js').IMessage>} message
649
649
  */
650
650
  var Spirits = {
651
651
  /**
package/dist/spirits.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var spirits = require("./spirits-1dc18cf4.cjs");
5
+ var spirits = require("./spirits-3b603262.cjs");
6
6
 
7
7
 
8
8
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var exports$1 = require("./exports-b2e88386.cjs");
6
- var spirits = require("./spirits-1dc18cf4.cjs");
5
+ var exports$1 = require("./exports-e7d51b70.cjs");
6
+ var spirits = require("./spirits-3b603262.cjs");
7
7
  require('node:readline');
8
8
  require('fs');
9
9
  require('events');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scout9/app",
3
- "version": "1.0.0-alpha.0.1.88",
3
+ "version": "1.0.0-alpha.0.1.89",
4
4
  "description": "Build and deploy your Scout9 app for SMS auto replies",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -16,7 +16,7 @@
16
16
  "generate:types": "node scripts/generate-dts.js",
17
17
  "prebuild": "rimraf dist/",
18
18
  "build": "rollup -c",
19
- "postbuild": "npm run generate:types && node scripts/post-build.js"
19
+ "postbuild": "npm run generate:types && node scripts/post-build.js && npx tsc --noEmit"
20
20
  },
21
21
  "type": "module",
22
22
  "bin": {
@@ -31,12 +31,12 @@ async function loadEntityApiConfig(cwd, filePath) {
31
31
  }
32
32
 
33
33
  /**
34
- * @returns {Promise<import('@scout9/app').IEntitiesRootProjectConfiguration>}
34
+ * @returns {Promise<import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration>}
35
35
  */
36
36
  export default async function loadEntitiesConfig(
37
37
  {cwd = process.cwd(), src = 'src', logger, cb = (message) => {}} = {}
38
38
  ) {
39
- /** @type import('@scout9/app').IEntitiesRootProjectConfiguration */
39
+ /** @type import('../../runtime/client/config.js').IEntitiesRootProjectConfiguration */
40
40
  const config = [];
41
41
  // const paths = globSync(path.resolve(cwd, `${src}/entities/**/{index,config,api}.{ts,js}`), {cwd, absolute: true});
42
42
  const filePaths = globSync(`${src}/entities/**/{index,config,api}.{ts,js}`, {cwd, absolute: true});
@@ -34,7 +34,7 @@ export function loadEnvConfig({
34
34
  /**
35
35
  * @deprecated use "new ProjectFiles(...).load()" instead
36
36
  * @param {{cwd: string; src: string; logger?: ProgressLogger; deploying?: boolean; cb?: (message: string) => void}} - build options
37
- * @returns {Promise<import('@scout9/app').IScout9ProjectBuildConfig>}
37
+ * @returns {Promise<import('../../runtime/client/config.js').IScout9ProjectBuildConfig>}
38
38
  */
39
39
  export async function loadConfig({
40
40
  cwd = process.cwd(), src = 'src', dest = '/tmp/project', deploying = false, logger = new ProgressLogger(), cb = (msg) => {
@@ -49,7 +49,7 @@ export async function loadConfig({
49
49
  const workflowsConfig = await loadWorkflowsConfig({cwd, src, logger, deploying, cb});
50
50
 
51
51
  /**
52
- * @type {import('@scout9/app').IScout9ProjectBuildConfig}
52
+ * @type {import('../../runtime/client/config.js').IScout9ProjectBuildConfig}
53
53
  */
54
54
  const projectConfig = {
55
55
  ...baseProjectConfig,
@@ -55,7 +55,7 @@ export async function loadUserPackageJson({cwd = process.cwd()}) {
55
55
  }
56
56
 
57
57
  /**
58
- * @returns {Promise<import('@scout9/app').IScout9ProjectConfig>}
58
+ * @returns {Promise<import('../../runtime/client/config.js').IScout9ProjectConfig>}
59
59
  */
60
60
  export default async function loadProjectConfig({cwd = process.cwd(), deploying = false, src = 'src', cb = (message) => {}} = {}) {
61
61
  // Grab the project tag name (from their package.json)
@@ -3,7 +3,7 @@ import { WorkflowConfigurationSchema, WorkflowsConfigurationSchema } from '../..
3
3
 
4
4
 
5
5
  /**
6
- * @returns {Promise<import('@scout9/app').IWorkflowsConfiguration>}
6
+ * @returns {Promise<import('../../runtime/client/workflow.js').IWorkflowsConfiguration>}
7
7
  */
8
8
  export default async function loadWorkflowsConfig(
9
9
  {
@@ -30,7 +30,7 @@ export default async function loadWorkflowsConfig(
30
30
  .map(({path, parents}) => {
31
31
 
32
32
  // Validate project configuration
33
- /** @type {import('@scout9/app').IWorkflowConfiguration} */
33
+ /** @type {import('../../runtime/client/workflow.js').IWorkflowConfiguration} */
34
34
  const workflowConfig = {
35
35
  entity: parents[0],
36
36
  entities: parents.reverse(),
package/src/core/index.js CHANGED
@@ -98,7 +98,7 @@ async function downloadAndUnpackZip(outputDir) {
98
98
  * @param {string} cwd
99
99
  * @param {string} src
100
100
  * @param {string} dest
101
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
101
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
102
102
  * @returns {Promise<void>}
103
103
  */
104
104
  async function buildApp(cwd, src, dest, config) {
@@ -435,7 +435,7 @@ export async function deploy(
435
435
  /**
436
436
  * Tests a local project to scout9 by running a dummy parse command with the project's local entities
437
437
  * @param {{cwd: string; src: string, dest: string}} - build options
438
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
438
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
439
439
  */
440
440
  export async function test(
441
441
  {cwd = process.cwd(), src = './src', dest = '/tmp/project', logger = new ProgressLogger()},
@@ -467,8 +467,8 @@ export async function test(
467
467
  /**
468
468
  *
469
469
  * @param {{cwd: string; src: string; projectFiles: ProjectFiles; logger: ProgressLogger}} options
470
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
471
- * @returns {Promise<{success: boolean; config: import('@scout9/app').IScout9ProjectBuildConfig}>}
470
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
471
+ * @returns {Promise<{success: boolean; config: import('../runtime/client/config.js').IScout9ProjectBuildConfig}>}
472
472
  */
473
473
  export async function sync({
474
474
  cwd = process.cwd(), src = 'src',
package/src/core/sync.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { platformApi } from './data.js';
2
2
 
3
3
  /**
4
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
5
- * @returns {Promise<import('@scout9/app').IScout9ProjectBuildConfig>}
4
+ * @param {import('../runtime/client/config.js').IScout9ProjectBuildConfig} config
5
+ * @returns {Promise<import('../runtime/client/config.js').IScout9ProjectBuildConfig>}
6
6
  */
7
7
  export async function syncData(config) {
8
8
  if (!process.env.SCOUT9_API_KEY) {
@@ -15,7 +15,7 @@ const resolveFilePath = () => {
15
15
  export const entities = {
16
16
  /**
17
17
  * Generates ./src/entities/
18
- * @param {import('@scout9/app').IScout9ProjectBuildConfig} config
18
+ * @param {import('../../runtime/client/config.js').IScout9ProjectBuildConfig} config
19
19
  * @param {string} cwd
20
20
  * @param {string} src
21
21
  * @returns {Promise<void>}
package/src/public.d.ts CHANGED
@@ -177,6 +177,7 @@ export interface Conversation {
177
177
  }
178
178
 
179
179
  /**
180
+ * @typedef {import('./runtime/client/message.js').IMessage} IMessage
180
181
  * @deprecated use IMessage
181
182
  */
182
183
  export interface Message {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { agentsConfigurationSchema, agentsBaseConfigurationSchema } from './users.js';
2
+ import { agentsBaseConfigurationSchema } from './users.js';
3
3
  import { entitiesRootProjectConfigurationSchema } from './entity.js';
4
4
  import { WorkflowsConfigurationSchema } from './workflow.js';
5
5
 
@@ -15,22 +15,22 @@ import { Spirits } from './spirits.js';
15
15
  export class Scout9Test {
16
16
 
17
17
  /**
18
- * @type {import('@scout9/app').ICustomer}
18
+ * @type {import('../runtime/client/users.js').ICustomer}
19
19
  */
20
20
  customer;
21
21
 
22
22
  /**
23
- * @type {import('@scout9/app').IPersona}
23
+ * @type {import('../runtime/client/users.js').IPersona}
24
24
  */
25
25
  persona;
26
26
 
27
27
  /**
28
- * @type {import('@scout9/app').IConversation}
28
+ * @type {import('../runtime/client/workflow.js').IConversation}
29
29
  */
30
30
  conversation;
31
31
 
32
32
  /**
33
- * @type {import('@scout9/app').IMessage[]}
33
+ * @type {import('../runtime/client/message.js').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').IScout9ProjectBuildConfig | null}
44
+ * @type {import('../runtime/client/config.js').IScout9ProjectBuildConfig | null}
45
45
  */
46
46
  _project = null;
47
47
 
48
48
  /**
49
49
  * @private
50
- * @type {import('@scout9/app').IWorkflowFunction | null}
50
+ * @type {import('../runtime/client/workflow.js').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').ICustomer | undefined} [props.customer] - customer to use
89
+ * @param {import('../runtime/client/users.js').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').IConversation | undefined} [props.conversation] - existing conversation
92
+ * @param {import('../runtime/client/workflow.js').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').IWorkflowFunction} [props.app]
98
- * @param {import('scout9/app').IScout9ProjectBuildConfig} [props.project]
97
+ * @param {import('../runtime/client/workflow.js').IWorkflowFunction} [props.app]
98
+ * @param {import('../runtime/client/config.js').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').IWorkflowEvent>, 'message'> | undefined} [event] - additional event data
307
- * @returns {Promise<import('@scout9/app').IWorkflowResponse>}
306
+ * @param {Omit<Partial<import('../runtime/client/workflow.js').IWorkflowEvent>, 'message'> | undefined} [event] - additional event data
307
+ * @returns {Promise<import('../runtime/client/workflow.js').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').IMessage[]} [input.messages] - Message overrides, defaults to test registered message data.
327
+ * @param {import('../runtime/client/message.js').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
  */