@scout9/app 1.0.0-alpha.0.1.88 → 1.0.0-alpha.0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{exports-b2e88386.cjs → exports-e7d51b70.cjs} +37 -37
- package/dist/index.cjs +2 -2
- package/dist/{multipart-parser-78fb466c.cjs → multipart-parser-e09a67c9.cjs} +2 -2
- package/dist/{spirits-1dc18cf4.cjs → spirits-3b603262.cjs} +19 -19
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +2 -2
- package/package.json +2 -2
- package/src/core/config/entities.js +2 -2
- package/src/core/config/index.js +2 -2
- package/src/core/config/project.js +1 -1
- package/src/core/config/workflow.js +2 -2
- package/src/core/index.js +4 -4
- package/src/core/sync.js +2 -2
- package/src/core/templates/project-files.js +1 -1
- package/src/public.d.ts +1 -0
- package/src/runtime/client/config.js +1 -1
- package/src/testing-tools/dev.js +13 -13
- package/src/testing-tools/mocks.js +6 -6
- package/src/testing-tools/spirits.js +19 -19
- package/types/index.d.ts +6080 -2952
- package/types/index.d.ts.map +20 -20
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var spirits = require("./spirits-
|
|
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-
|
|
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('
|
|
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-
|
|
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('
|
|
81568
|
-
* @returns {Promise<import('
|
|
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-
|
|
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-
|
|
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-
|
|
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('
|
|
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('
|
|
89268
|
-
* @returns {Promise<{success: boolean; config: import('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
91171
|
-
* @returns {import('
|
|
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('
|
|
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('
|
|
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('
|
|
91207
|
-
* @param {import('
|
|
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('
|
|
91231
|
+
* @type {import('../runtime/client/users.js').ICustomer}
|
|
91232
91232
|
*/
|
|
91233
91233
|
spirits._defineProperty(this, "customer", void 0);
|
|
91234
91234
|
/**
|
|
91235
|
-
* @type {import('
|
|
91235
|
+
* @type {import('../runtime/client/users.js').IPersona}
|
|
91236
91236
|
*/
|
|
91237
91237
|
spirits._defineProperty(this, "persona", void 0);
|
|
91238
91238
|
/**
|
|
91239
|
-
* @type {import('
|
|
91239
|
+
* @type {import('../runtime/client/workflow.js').IConversation}
|
|
91240
91240
|
*/
|
|
91241
91241
|
spirits._defineProperty(this, "conversation", void 0);
|
|
91242
91242
|
/**
|
|
91243
|
-
* @type {import('
|
|
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('
|
|
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('
|
|
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('
|
|
91607
|
-
* @returns {Promise<import('
|
|
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('
|
|
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-
|
|
6
|
-
var spirits = require("./spirits-
|
|
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-
|
|
6
|
-
require("./spirits-
|
|
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('
|
|
570
|
-
* @property {import('
|
|
571
|
-
* @property {Array<import('
|
|
572
|
-
* @property {import('
|
|
573
|
-
* @property {import('
|
|
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('
|
|
580
|
-
* @property {import('
|
|
581
|
-
* @property {import('
|
|
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('
|
|
588
|
-
* @property {Array<import('
|
|
589
|
-
* @property {import('
|
|
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('
|
|
597
|
-
* @property {import('
|
|
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('
|
|
611
|
-
* @returns {Promise<import('
|
|
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('
|
|
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('
|
|
646
|
-
* @property {Change<Array<import('
|
|
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('
|
|
648
|
+
* @property {Change<import('../runtime/client/message.js').IMessage>} message
|
|
649
649
|
*/
|
|
650
650
|
var Spirits = {
|
|
651
651
|
/**
|
package/dist/spirits.cjs
CHANGED
package/dist/testing-tools.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var exports$1 = require("./exports-
|
|
6
|
-
var spirits = require("./spirits-
|
|
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.
|
|
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('
|
|
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('
|
|
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});
|
package/src/core/config/index.js
CHANGED
|
@@ -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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
471
|
-
* @returns {Promise<{success: boolean; config: import('
|
|
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('
|
|
5
|
-
* @returns {Promise<import('
|
|
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('
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { agentsBaseConfigurationSchema } from './users.js';
|
|
3
3
|
import { entitiesRootProjectConfigurationSchema } from './entity.js';
|
|
4
4
|
import { WorkflowsConfigurationSchema } from './workflow.js';
|
|
5
5
|
|
package/src/testing-tools/dev.js
CHANGED
|
@@ -15,22 +15,22 @@ import { Spirits } from './spirits.js';
|
|
|
15
15
|
export class Scout9Test {
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @type {import('
|
|
18
|
+
* @type {import('../runtime/client/users.js').ICustomer}
|
|
19
19
|
*/
|
|
20
20
|
customer;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* @type {import('
|
|
23
|
+
* @type {import('../runtime/client/users.js').IPersona}
|
|
24
24
|
*/
|
|
25
25
|
persona;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* @type {import('
|
|
28
|
+
* @type {import('../runtime/client/workflow.js').IConversation}
|
|
29
29
|
*/
|
|
30
30
|
conversation;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* @type {import('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
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('
|
|
98
|
-
* @param {import('
|
|
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('
|
|
307
|
-
* @returns {Promise<import('
|
|
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('
|
|
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
|
*/
|