@scout9/app 1.0.0-alpha.0.1.96 → 1.0.0-alpha.0.1.98
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/{dev-ecdbe765.cjs → dev-1afc1e7b.cjs} +3788 -3684
- package/dist/{index-ea1273a0.cjs → index-2aedbf12.cjs} +150 -55
- package/dist/index.cjs +6 -47
- package/dist/{multipart-parser-26f98006.cjs → multipart-parser-51d88fc4.cjs} +9 -7
- package/dist/{spirits-32395ac4.cjs → spirits-43ce19cf.cjs} +19 -19
- package/dist/spirits.cjs +1 -1
- package/dist/testing-tools.cjs +7 -6
- package/package.json +4 -3
- package/src/core/config/agents.js +2 -2
- package/src/core/config/entities.js +10 -10
- 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 +7 -7
- package/src/core/sync.js +2 -2
- package/src/core/templates/project-files.js +1 -1
- package/src/exports.js +8 -7
- package/src/platform.js +7 -7
- package/src/public.d.ts +3383 -0
- package/src/runtime/client/api.js +0 -22
- package/src/runtime/client/index.js +0 -6
- package/src/runtime/index.js +1 -0
- package/src/runtime/macros/builder.js +25 -4
- package/src/runtime/macros/event.js +139 -35
- package/src/runtime/macros/index.js +0 -1
- package/src/runtime/schemas/api.js +21 -0
- package/src/runtime/{client → schemas}/config.js +13 -17
- package/src/runtime/{client → schemas}/entity.js +16 -29
- package/src/runtime/schemas/index.js +9 -0
- package/src/runtime/{client → schemas}/message.js +0 -3
- package/src/runtime/{client → schemas}/platform.js +1 -1
- package/src/runtime/{client → schemas}/users.js +32 -26
- package/src/runtime/{client → schemas}/workflow.js +7 -59
- package/src/testing-tools/dev.js +15 -17
- package/src/testing-tools/mocks.js +6 -6
- package/src/testing-tools/spirits.js +19 -19
- package/src/utils/configs/agents.js +2 -2
- package/src/utils/configs/entities.js +8 -8
- package/src/utils/project-templates.js +3 -3
- package/types/index.d.ts +2899 -25181
- package/types/index.d.ts.map +67 -108
- package/src/public.d.ts.text +0 -330
- /package/src/runtime/{macros/schemas.js → schemas/macros.js} +0 -0
- /package/src/runtime/{client → schemas}/utils.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var spirits = require("./spirits-
|
|
4
|
-
var dev = require("./dev-
|
|
3
|
+
var spirits = require("./spirits-43ce19cf.cjs");
|
|
4
|
+
var dev = require("./dev-1afc1e7b.cjs");
|
|
5
5
|
var require$$0 = require('fs');
|
|
6
6
|
var require$$2$1 = require('events');
|
|
7
7
|
var require$$1 = require('path');
|
|
@@ -29482,7 +29482,7 @@ class Body {
|
|
|
29482
29482
|
}
|
|
29483
29483
|
const {
|
|
29484
29484
|
toFormData
|
|
29485
|
-
} = await Promise.resolve().then(function () { return require("./multipart-parser-
|
|
29485
|
+
} = await Promise.resolve().then(function () { return require("./multipart-parser-51d88fc4.cjs"); });
|
|
29486
29486
|
return toFormData(this.body, ct);
|
|
29487
29487
|
}
|
|
29488
29488
|
|
|
@@ -30022,7 +30022,7 @@ const INTERNALS$1 = Symbol('Response internals');
|
|
|
30022
30022
|
* @param Object opts Response options
|
|
30023
30023
|
* @return Void
|
|
30024
30024
|
*/
|
|
30025
|
-
class Response extends Body {
|
|
30025
|
+
class Response$1 extends Body {
|
|
30026
30026
|
constructor(body = null, options = {}) {
|
|
30027
30027
|
super(body, options);
|
|
30028
30028
|
|
|
@@ -30080,7 +30080,7 @@ class Response extends Body {
|
|
|
30080
30080
|
* @return Response
|
|
30081
30081
|
*/
|
|
30082
30082
|
clone() {
|
|
30083
|
-
return new Response(clone(this, this.highWaterMark), {
|
|
30083
|
+
return new Response$1(clone(this, this.highWaterMark), {
|
|
30084
30084
|
type: this.type,
|
|
30085
30085
|
url: this.url,
|
|
30086
30086
|
status: this.status,
|
|
@@ -30102,7 +30102,7 @@ class Response extends Body {
|
|
|
30102
30102
|
if (!isRedirect(status)) {
|
|
30103
30103
|
throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
|
|
30104
30104
|
}
|
|
30105
|
-
return new Response(null, {
|
|
30105
|
+
return new Response$1(null, {
|
|
30106
30106
|
headers: {
|
|
30107
30107
|
location: new URL(url).toString()
|
|
30108
30108
|
},
|
|
@@ -30110,7 +30110,7 @@ class Response extends Body {
|
|
|
30110
30110
|
});
|
|
30111
30111
|
}
|
|
30112
30112
|
static error() {
|
|
30113
|
-
const response = new Response(null, {
|
|
30113
|
+
const response = new Response$1(null, {
|
|
30114
30114
|
status: 0,
|
|
30115
30115
|
statusText: ''
|
|
30116
30116
|
});
|
|
@@ -30126,7 +30126,7 @@ class Response extends Body {
|
|
|
30126
30126
|
if (!headers.has('content-type')) {
|
|
30127
30127
|
headers.set('content-type', 'application/json');
|
|
30128
30128
|
}
|
|
30129
|
-
return new Response(body, {
|
|
30129
|
+
return new Response$1(body, {
|
|
30130
30130
|
...init,
|
|
30131
30131
|
headers
|
|
30132
30132
|
});
|
|
@@ -30135,7 +30135,7 @@ class Response extends Body {
|
|
|
30135
30135
|
return 'Response';
|
|
30136
30136
|
}
|
|
30137
30137
|
}
|
|
30138
|
-
Object.defineProperties(Response.prototype, {
|
|
30138
|
+
Object.defineProperties(Response$1.prototype, {
|
|
30139
30139
|
type: {
|
|
30140
30140
|
enumerable: true
|
|
30141
30141
|
},
|
|
@@ -30831,7 +30831,7 @@ async function fetch(url, options_) {
|
|
|
30831
30831
|
}
|
|
30832
30832
|
if (parsedURL.protocol === 'data:') {
|
|
30833
30833
|
const data = dataUriToBuffer(request.url);
|
|
30834
|
-
const response = new Response(data, {
|
|
30834
|
+
const response = new Response$1(data, {
|
|
30835
30835
|
headers: {
|
|
30836
30836
|
'Content-Type': data.typeFull
|
|
30837
30837
|
}
|
|
@@ -31052,7 +31052,7 @@ async function fetch(url, options_) {
|
|
|
31052
31052
|
// 4. no content response (204)
|
|
31053
31053
|
// 5. content not modified response (304)
|
|
31054
31054
|
if (!request.compress || request.method === 'HEAD' || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
|
|
31055
|
-
response = new Response(body, responseOptions);
|
|
31055
|
+
response = new Response$1(body, responseOptions);
|
|
31056
31056
|
resolve(response);
|
|
31057
31057
|
return;
|
|
31058
31058
|
}
|
|
@@ -31074,7 +31074,7 @@ async function fetch(url, options_) {
|
|
|
31074
31074
|
reject(error);
|
|
31075
31075
|
}
|
|
31076
31076
|
});
|
|
31077
|
-
response = new Response(body, responseOptions);
|
|
31077
|
+
response = new Response$1(body, responseOptions);
|
|
31078
31078
|
resolve(response);
|
|
31079
31079
|
return;
|
|
31080
31080
|
}
|
|
@@ -31103,14 +31103,14 @@ async function fetch(url, options_) {
|
|
|
31103
31103
|
}
|
|
31104
31104
|
});
|
|
31105
31105
|
}
|
|
31106
|
-
response = new Response(body, responseOptions);
|
|
31106
|
+
response = new Response$1(body, responseOptions);
|
|
31107
31107
|
resolve(response);
|
|
31108
31108
|
});
|
|
31109
31109
|
raw.once('end', () => {
|
|
31110
31110
|
// Some old IIS servers return zero-length OK deflate responses, so
|
|
31111
31111
|
// 'data' is never emitted. See https://github.com/node-fetch/node-fetch/pull/903
|
|
31112
31112
|
if (!response) {
|
|
31113
|
-
response = new Response(body, responseOptions);
|
|
31113
|
+
response = new Response$1(body, responseOptions);
|
|
31114
31114
|
resolve(response);
|
|
31115
31115
|
}
|
|
31116
31116
|
});
|
|
@@ -31124,13 +31124,13 @@ async function fetch(url, options_) {
|
|
|
31124
31124
|
reject(error);
|
|
31125
31125
|
}
|
|
31126
31126
|
});
|
|
31127
|
-
response = new Response(body, responseOptions);
|
|
31127
|
+
response = new Response$1(body, responseOptions);
|
|
31128
31128
|
resolve(response);
|
|
31129
31129
|
return;
|
|
31130
31130
|
}
|
|
31131
31131
|
|
|
31132
31132
|
// Otherwise, use response as-is
|
|
31133
|
-
response = new Response(body, responseOptions);
|
|
31133
|
+
response = new Response$1(body, responseOptions);
|
|
31134
31134
|
resolve(response);
|
|
31135
31135
|
});
|
|
31136
31136
|
|
|
@@ -41783,8 +41783,8 @@ function _platformApi() {
|
|
|
41783
41783
|
}
|
|
41784
41784
|
|
|
41785
41785
|
/**
|
|
41786
|
-
* @param {
|
|
41787
|
-
* @returns {Promise<
|
|
41786
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
41787
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
41788
41788
|
*/
|
|
41789
41789
|
function syncData(_x) {
|
|
41790
41790
|
return _syncData.apply(this, arguments);
|
|
@@ -41891,7 +41891,7 @@ function _loadUserPackageJson() {
|
|
|
41891
41891
|
targetPkgUrl = isTest ? packageTestJsonUrl : packageJsonUrl;
|
|
41892
41892
|
_context.t0 = JSON;
|
|
41893
41893
|
_context.next = 10;
|
|
41894
|
-
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('index-
|
|
41894
|
+
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('index-2aedbf12.js', document.baseURI).href))), 'utf-8');
|
|
41895
41895
|
case 10:
|
|
41896
41896
|
_context.t1 = _context.sent;
|
|
41897
41897
|
pkg = _context.t0.parse.call(_context.t0, _context.t1);
|
|
@@ -41908,6 +41908,71 @@ function _loadUserPackageJson() {
|
|
|
41908
41908
|
return _loadUserPackageJson.apply(this, arguments);
|
|
41909
41909
|
}
|
|
41910
41910
|
|
|
41911
|
+
/**
|
|
41912
|
+
* Utility runtime class used to guide event output
|
|
41913
|
+
* @template T
|
|
41914
|
+
*/
|
|
41915
|
+
var EventResponse = /*#__PURE__*/function () {
|
|
41916
|
+
/**
|
|
41917
|
+
* Create an EventResponse.
|
|
41918
|
+
* @param {T} body - The body of the response.
|
|
41919
|
+
* @param {ResponseInit} [init] - Additional options for the response.
|
|
41920
|
+
* @throws {Error} If the body is not a valid object.
|
|
41921
|
+
*/
|
|
41922
|
+
function EventResponse(body, init) {
|
|
41923
|
+
spirits._classCallCheck(this, EventResponse);
|
|
41924
|
+
/**
|
|
41925
|
+
* @type {T}
|
|
41926
|
+
* @private
|
|
41927
|
+
*/
|
|
41928
|
+
this.body = body;
|
|
41929
|
+
|
|
41930
|
+
/**
|
|
41931
|
+
* @type {ResponseInit}
|
|
41932
|
+
* @private
|
|
41933
|
+
*/
|
|
41934
|
+
this.init = init;
|
|
41935
|
+
if (spirits._typeof(this.body) !== 'object') {
|
|
41936
|
+
throw new Error("EventResponse body in not a valid object:\n\"".concat(JSON.stringify(body, null, 2), "\""));
|
|
41937
|
+
}
|
|
41938
|
+
}
|
|
41939
|
+
|
|
41940
|
+
/**
|
|
41941
|
+
* Get the response object.
|
|
41942
|
+
* @returns {Response} The response object.
|
|
41943
|
+
*/
|
|
41944
|
+
spirits._createClass(EventResponse, [{
|
|
41945
|
+
key: "response",
|
|
41946
|
+
get: function get() {
|
|
41947
|
+
return Response.json(this.body, this.init);
|
|
41948
|
+
}
|
|
41949
|
+
|
|
41950
|
+
/**
|
|
41951
|
+
* Get the data of the response.
|
|
41952
|
+
* @returns {T} The body of the response.
|
|
41953
|
+
*/
|
|
41954
|
+
}, {
|
|
41955
|
+
key: "data",
|
|
41956
|
+
get: function get() {
|
|
41957
|
+
return this.body;
|
|
41958
|
+
}
|
|
41959
|
+
}], [{
|
|
41960
|
+
key: "json",
|
|
41961
|
+
value:
|
|
41962
|
+
/**
|
|
41963
|
+
* Create a new EventResponse instance with a JSON body.
|
|
41964
|
+
* @template T
|
|
41965
|
+
* @param {T} body - The body of the response.
|
|
41966
|
+
* @param {ResponseInit} [options] - Additional options for the response.
|
|
41967
|
+
* @returns {EventResponse<T>} A new EventResponse instance.
|
|
41968
|
+
*/
|
|
41969
|
+
function json(body, options) {
|
|
41970
|
+
return new EventResponse(body, options);
|
|
41971
|
+
}
|
|
41972
|
+
}]);
|
|
41973
|
+
return EventResponse;
|
|
41974
|
+
}();
|
|
41975
|
+
|
|
41911
41976
|
var MacroGlobals = /*#__PURE__*/function () {
|
|
41912
41977
|
function MacroGlobals() {
|
|
41913
41978
|
spirits._classCallCheck(this, MacroGlobals);
|
|
@@ -41947,11 +42012,27 @@ function did(_x) {
|
|
|
41947
42012
|
return _did.apply(this, arguments);
|
|
41948
42013
|
}
|
|
41949
42014
|
|
|
42015
|
+
/**
|
|
42016
|
+
* @typedef {import('@scout9/admin').MacroContextInputExamples} ContextExamples
|
|
42017
|
+
* @typedef {import('@scout9/admin').MacroContextValue} ContextOutput
|
|
42018
|
+
*/
|
|
42019
|
+
|
|
41950
42020
|
/**
|
|
41951
42021
|
* The `context` macro, similar to the `did` macro, takes a natural statement and checks the entire conversation state and extracts or infers a metadata composition result.
|
|
41952
|
-
*
|
|
41953
|
-
* @
|
|
41954
|
-
*
|
|
42022
|
+
*
|
|
42023
|
+
* @example - inferring what a user requested
|
|
42024
|
+
* const response = await context(`What pizzas did the user want to order?`);
|
|
42025
|
+
* {
|
|
42026
|
+
* "order": {
|
|
42027
|
+
* "pizzas": [
|
|
42028
|
+
* {"size": "small", "toppings": ["cheese"], quantity: 1}
|
|
42029
|
+
* ]
|
|
42030
|
+
* }
|
|
42031
|
+
* }
|
|
42032
|
+
*
|
|
42033
|
+
* @param {string} prompt - Prompt to infer a context data set to use in your workflow code.
|
|
42034
|
+
* @param {ContextExamples} [examples] - Examples to the macro to ensure a consistent data structure.
|
|
42035
|
+
* @return {Promise<ContextOutput>}
|
|
41955
42036
|
*/
|
|
41956
42037
|
function _did() {
|
|
41957
42038
|
_did = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee(prompt) {
|
|
@@ -41960,18 +42041,24 @@ function _did() {
|
|
|
41960
42041
|
while (1) switch (_context2.prev = _context2.next) {
|
|
41961
42042
|
case 0:
|
|
41962
42043
|
convoId = MacroGlobals.$convo();
|
|
41963
|
-
|
|
42044
|
+
if (convoId) {
|
|
42045
|
+
_context2.next = 3;
|
|
42046
|
+
break;
|
|
42047
|
+
}
|
|
42048
|
+
throw new Error("Internal: Unable to contextualize did response for \"".concat(prompt, "\""));
|
|
42049
|
+
case 3:
|
|
42050
|
+
_context2.next = 5;
|
|
41964
42051
|
return new dev.build.Scout9Api(new dev.build.Configuration({
|
|
41965
42052
|
apiKey: process.env.SCOUT9_API_KEY
|
|
41966
42053
|
})).did({
|
|
41967
42054
|
prompt: prompt,
|
|
41968
42055
|
convoId: convoId
|
|
41969
42056
|
}).then(handleAxiosResponse);
|
|
41970
|
-
case
|
|
42057
|
+
case 5:
|
|
41971
42058
|
_yield$Scout9Api$did$ = _context2.sent;
|
|
41972
42059
|
value = _yield$Scout9Api$did$.value;
|
|
41973
42060
|
return _context2.abrupt("return", value);
|
|
41974
|
-
case
|
|
42061
|
+
case 8:
|
|
41975
42062
|
case "end":
|
|
41976
42063
|
return _context2.stop();
|
|
41977
42064
|
}
|
|
@@ -41989,7 +42076,13 @@ function _context() {
|
|
|
41989
42076
|
while (1) switch (_context3.prev = _context3.next) {
|
|
41990
42077
|
case 0:
|
|
41991
42078
|
convoId = MacroGlobals.$convo();
|
|
41992
|
-
|
|
42079
|
+
if (convoId) {
|
|
42080
|
+
_context3.next = 3;
|
|
42081
|
+
break;
|
|
42082
|
+
}
|
|
42083
|
+
throw new Error("Internal: Unable to contextualize did response for \"".concat(prompt, "\""));
|
|
42084
|
+
case 3:
|
|
42085
|
+
_context3.next = 5;
|
|
41993
42086
|
return new dev.build.Scout9Api(new dev.build.Configuration({
|
|
41994
42087
|
apiKey: process.env.SCOUT9_API_KEY
|
|
41995
42088
|
})).captureContext({
|
|
@@ -41997,11 +42090,11 @@ function _context() {
|
|
|
41997
42090
|
examples: examples,
|
|
41998
42091
|
convoId: convoId
|
|
41999
42092
|
}).then(handleAxiosResponse);
|
|
42000
|
-
case
|
|
42093
|
+
case 5:
|
|
42001
42094
|
_yield$Scout9Api$capt = _context3.sent;
|
|
42002
42095
|
value = _yield$Scout9Api$capt.value;
|
|
42003
42096
|
return _context3.abrupt("return", value);
|
|
42004
|
-
case
|
|
42097
|
+
case 8:
|
|
42005
42098
|
case "end":
|
|
42006
42099
|
return _context3.stop();
|
|
42007
42100
|
}
|
|
@@ -42040,7 +42133,7 @@ function _loadEntityApiConfig() {
|
|
|
42040
42133
|
config[key] = true;
|
|
42041
42134
|
}
|
|
42042
42135
|
}
|
|
42043
|
-
dev.
|
|
42136
|
+
dev.EntityApiConfigurationSchema.parse(config);
|
|
42044
42137
|
return _context.abrupt("return", config);
|
|
42045
42138
|
case 14:
|
|
42046
42139
|
return _context.abrupt("return", null);
|
|
@@ -42189,7 +42282,7 @@ function _loadEntitiesConfig() {
|
|
|
42189
42282
|
throw new Error("Invalid entity type (".concat(entityType, ") returned at \"").concat(filePath, "\""));
|
|
42190
42283
|
case 21:
|
|
42191
42284
|
// Validate entity configuration
|
|
42192
|
-
result = dev.
|
|
42285
|
+
result = dev.EntityConfigurationSchema.safeParse(entityConfig, {
|
|
42193
42286
|
path: ['entities', config.length]
|
|
42194
42287
|
});
|
|
42195
42288
|
if (result.success) {
|
|
@@ -42214,7 +42307,7 @@ function _loadEntitiesConfig() {
|
|
|
42214
42307
|
entities: parents.reverse(),
|
|
42215
42308
|
api: api
|
|
42216
42309
|
});
|
|
42217
|
-
dev.
|
|
42310
|
+
dev.EntityRootProjectConfigurationSchema.parse(entityProjectConfig);
|
|
42218
42311
|
existingIndex = config.findIndex(function (c) {
|
|
42219
42312
|
return c.entity === entityProjectConfig.entity;
|
|
42220
42313
|
});
|
|
@@ -42270,7 +42363,7 @@ function _loadEntitiesConfig() {
|
|
|
42270
42363
|
// }
|
|
42271
42364
|
|
|
42272
42365
|
// Validate the config
|
|
42273
|
-
dev.
|
|
42366
|
+
dev.EntitiesRootProjectConfigurationSchema.parse(config);
|
|
42274
42367
|
return _context4.abrupt("return", config);
|
|
42275
42368
|
case 32:
|
|
42276
42369
|
case "end":
|
|
@@ -43004,7 +43097,7 @@ var ProjectFiles = /*#__PURE__*/function () {
|
|
|
43004
43097
|
return ProjectFiles;
|
|
43005
43098
|
}();
|
|
43006
43099
|
|
|
43007
|
-
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-
|
|
43100
|
+
var __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index-2aedbf12.js', document.baseURI).href)));
|
|
43008
43101
|
var __dirname$1 = path__default["default"].dirname(__filename$1);
|
|
43009
43102
|
function zipDirectory(source, out) {
|
|
43010
43103
|
var archive = archiver$1('tar', {
|
|
@@ -43219,7 +43312,7 @@ function _buildApp() {
|
|
|
43219
43312
|
case 11:
|
|
43220
43313
|
_context4.t0 = JSON;
|
|
43221
43314
|
_context4.next = 14;
|
|
43222
|
-
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('index-
|
|
43315
|
+
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('index-2aedbf12.js', document.baseURI).href))), 'utf-8');
|
|
43223
43316
|
case 14:
|
|
43224
43317
|
_context4.t1 = _context4.sent;
|
|
43225
43318
|
packageTemplate = _context4.t0.parse.call(_context4.t0, _context4.t1);
|
|
@@ -43438,10 +43531,10 @@ function getAgentContacts() {
|
|
|
43438
43531
|
* Runs a given project container from scout9 to given environment
|
|
43439
43532
|
* Runs the project in a container
|
|
43440
43533
|
*
|
|
43441
|
-
* @param {
|
|
43534
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
43442
43535
|
* @param {Object} options
|
|
43443
43536
|
* @param {string} options.eventSource - the source path of the event
|
|
43444
|
-
* @returns {Promise<
|
|
43537
|
+
* @returns {Promise<WorkflowResponse>}
|
|
43445
43538
|
*/
|
|
43446
43539
|
function _getAgentContacts() {
|
|
43447
43540
|
_getAgentContacts = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee7() {
|
|
@@ -43541,7 +43634,7 @@ function runConfig() {
|
|
|
43541
43634
|
/**
|
|
43542
43635
|
* Builds a local project
|
|
43543
43636
|
* @param {{cwd: string; src: string; dest: string; logger: ProgressLogger; mode: string;}} - build options
|
|
43544
|
-
* @param {
|
|
43637
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
43545
43638
|
* @returns {messages: string[]}
|
|
43546
43639
|
*/
|
|
43547
43640
|
function _runConfig() {
|
|
@@ -43676,7 +43769,7 @@ function deploy(_x11, _x12) {
|
|
|
43676
43769
|
/**
|
|
43677
43770
|
* Tests a local project to scout9 by running a dummy parse command with the project's local entities
|
|
43678
43771
|
* @param {{cwd: string; src: string, dest: string}} - build options
|
|
43679
|
-
* @param {
|
|
43772
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
43680
43773
|
*/
|
|
43681
43774
|
function _deploy() {
|
|
43682
43775
|
_deploy = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee11(_ref4, config) {
|
|
@@ -43752,8 +43845,8 @@ function test(_x13, _x14) {
|
|
|
43752
43845
|
/**
|
|
43753
43846
|
*
|
|
43754
43847
|
* @param {{cwd: string; src: string; projectFiles: ProjectFiles; logger: ProgressLogger}} options
|
|
43755
|
-
* @param {
|
|
43756
|
-
* @returns {Promise<{success: boolean; config:
|
|
43848
|
+
* @param {Scout9ProjectBuildConfig} config
|
|
43849
|
+
* @returns {Promise<{success: boolean; config: Scout9ProjectBuildConfig}>}
|
|
43757
43850
|
*/
|
|
43758
43851
|
function _test() {
|
|
43759
43852
|
_test = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee12(_ref5, config) {
|
|
@@ -43880,7 +43973,7 @@ var Scout9Platform = {
|
|
|
43880
43973
|
* @param {string} [params.cwd=process.cwd()] - the working directory
|
|
43881
43974
|
* @param {string} [params.src='src'] - the source directory
|
|
43882
43975
|
* @param {string} [params.mode='production'] - the build mode
|
|
43883
|
-
* @returns {Promise<
|
|
43976
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
43884
43977
|
*/
|
|
43885
43978
|
sync: function () {
|
|
43886
43979
|
var _sync2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee() {
|
|
@@ -43955,7 +44048,7 @@ var Scout9Platform = {
|
|
|
43955
44048
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
43956
44049
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
43957
44050
|
* @param {boolean} [params.sync=true] - whether to sync the project after deploying
|
|
43958
|
-
* @returns {Promise<
|
|
44051
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
43959
44052
|
*/
|
|
43960
44053
|
deploy: function () {
|
|
43961
44054
|
var _deploy2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee2() {
|
|
@@ -44077,7 +44170,7 @@ var Scout9Platform = {
|
|
|
44077
44170
|
* @param {string} [params.src='./src'] - the source directory
|
|
44078
44171
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
44079
44172
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
44080
|
-
* @returns {Promise<
|
|
44173
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
44081
44174
|
*/
|
|
44082
44175
|
test: function () {
|
|
44083
44176
|
var _test2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee3() {
|
|
@@ -44151,7 +44244,7 @@ var Scout9Platform = {
|
|
|
44151
44244
|
* @param {string} [params.src='./src'] - the source directory
|
|
44152
44245
|
* @param {string} [params.dest='/tmp/project'] - the destination directory
|
|
44153
44246
|
* @param {'development' | 'production'} [params.mode='production'] - the build mode
|
|
44154
|
-
* @returns {Promise<
|
|
44247
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
44155
44248
|
*/
|
|
44156
44249
|
build: function () {
|
|
44157
44250
|
var _build2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee4() {
|
|
@@ -44228,7 +44321,7 @@ var Scout9Platform = {
|
|
|
44228
44321
|
* @param {string} [params.cwd=process.cwd()] - the working directory
|
|
44229
44322
|
* @param {boolean} [params.local=false] - whether to only load the local config (ignores what's saved on server)
|
|
44230
44323
|
* @param {string} [params.src='./src'] - the source directory
|
|
44231
|
-
* @returns {Promise<
|
|
44324
|
+
* @returns {Promise<Scout9ProjectBuildConfig>}
|
|
44232
44325
|
*/
|
|
44233
44326
|
config: function () {
|
|
44234
44327
|
var _config = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee5() {
|
|
@@ -44282,13 +44375,13 @@ var Scout9Platform = {
|
|
|
44282
44375
|
}(),
|
|
44283
44376
|
/**
|
|
44284
44377
|
* Runs the project in a container
|
|
44285
|
-
* @param {
|
|
44378
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
44286
44379
|
* @param {Object} options
|
|
44287
44380
|
* @param {string} [options.cwd=process.cwd()] - the working directory
|
|
44288
44381
|
* @param {string} [options.mode='production'] - the build mode
|
|
44289
44382
|
* @param {string} [options.src='./src'] - the source directory
|
|
44290
44383
|
* @param {string} options.eventSource - the source of the workflow event
|
|
44291
|
-
* @returns {
|
|
44384
|
+
* @returns {WorkflowResponse}
|
|
44292
44385
|
*/
|
|
44293
44386
|
run: function () {
|
|
44294
44387
|
var _run2 = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee6(event, _ref6) {
|
|
@@ -44350,22 +44443,22 @@ var Scout9Platform = {
|
|
|
44350
44443
|
};
|
|
44351
44444
|
|
|
44352
44445
|
/**
|
|
44353
|
-
* @param {
|
|
44446
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
44354
44447
|
* @param {Object} options
|
|
44355
44448
|
* @param {string} [options.cwd=process.cwd()] - the working directory
|
|
44356
44449
|
* @param {string} [options.mode='production'] - the build mode
|
|
44357
44450
|
* @param {string} [options.src='./src'] - the source directory
|
|
44358
44451
|
* @param {string} options.eventSource - the source of the workflow event
|
|
44359
|
-
* @returns {
|
|
44452
|
+
* @returns {WorkflowResponse}
|
|
44360
44453
|
*/
|
|
44361
44454
|
function run(_x, _x2) {
|
|
44362
44455
|
return _run.apply(this, arguments);
|
|
44363
44456
|
}
|
|
44364
44457
|
|
|
44365
44458
|
/**
|
|
44366
|
-
* @param {
|
|
44459
|
+
* @param {WorkflowEvent} event - every workflow receives an event object
|
|
44367
44460
|
* @param {{cwd: string; mode: 'development' | 'production'; src: string}} options - build options
|
|
44368
|
-
* @returns {
|
|
44461
|
+
* @returns {WorkflowResponse}
|
|
44369
44462
|
*/
|
|
44370
44463
|
function _run() {
|
|
44371
44464
|
_run = spirits._asyncToGenerator( /*#__PURE__*/spirits._regeneratorRuntime().mark(function _callee(event, options) {
|
|
@@ -44384,9 +44477,10 @@ function _run() {
|
|
|
44384
44477
|
var sendEvent = run;
|
|
44385
44478
|
|
|
44386
44479
|
/**
|
|
44387
|
-
* @
|
|
44388
|
-
* @param
|
|
44389
|
-
* @
|
|
44480
|
+
* @template T
|
|
44481
|
+
* @param {T} data
|
|
44482
|
+
* @param {ResponseInit | undefined} [init]
|
|
44483
|
+
* @returns {EventResponse<T>}
|
|
44390
44484
|
*/
|
|
44391
44485
|
function json(data, init) {
|
|
44392
44486
|
if (data instanceof Promise) {
|
|
@@ -44406,12 +44500,13 @@ function json(data, init) {
|
|
|
44406
44500
|
if (!headers.has('content-type')) {
|
|
44407
44501
|
headers.set('content-type', 'application/json');
|
|
44408
44502
|
}
|
|
44409
|
-
return new
|
|
44503
|
+
return new EventResponse(data, spirits._objectSpread2(spirits._objectSpread2({}, init), {}, {
|
|
44410
44504
|
headers: headers
|
|
44411
44505
|
}));
|
|
44412
44506
|
}
|
|
44413
44507
|
var encoder = new TextEncoder();
|
|
44414
44508
|
|
|
44509
|
+
exports.EventResponse = EventResponse;
|
|
44415
44510
|
exports.File = File;
|
|
44416
44511
|
exports.FormData = FormData;
|
|
44417
44512
|
exports.context = context;
|
package/dist/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require("./index-
|
|
6
|
-
var dev = require("./dev-
|
|
7
|
-
|
|
5
|
+
var index = require("./index-2aedbf12.cjs");
|
|
6
|
+
var dev = require("./dev-1afc1e7b.cjs");
|
|
7
|
+
require("./spirits-43ce19cf.cjs");
|
|
8
8
|
require('fs');
|
|
9
9
|
require('events');
|
|
10
10
|
require('path');
|
|
@@ -35,65 +35,24 @@ require('url');
|
|
|
35
35
|
require('tty');
|
|
36
36
|
require('os');
|
|
37
37
|
require('crypto');
|
|
38
|
+
require('node:events');
|
|
39
|
+
require('node:string_decoder');
|
|
38
40
|
require('node:process');
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
|
|
44
|
+
exports.EventResponse = index.EventResponse;
|
|
42
45
|
exports.context = index.context;
|
|
43
46
|
exports.did = index.did;
|
|
44
47
|
exports.json = index.json;
|
|
45
48
|
exports.run = index.run;
|
|
46
49
|
exports.sendEvent = index.sendEvent;
|
|
47
|
-
exports.ContextExampleSchema = dev.ContextExampleSchema;
|
|
48
|
-
exports.ContextExampleWithTrainingDataSchema = dev.ContextExampleWithTrainingDataSchema;
|
|
49
|
-
exports.ConversationContext = dev.ConversationContext;
|
|
50
|
-
exports.ConversationSchema = dev.ConversationSchema;
|
|
51
|
-
exports.EventResponse = dev.EventResponse;
|
|
52
|
-
exports.FollowupBaseSchema = dev.FollowupBaseSchema;
|
|
53
|
-
exports.FollowupSchema = dev.FollowupSchema;
|
|
54
|
-
exports.ForwardSchema = dev.ForwardSchema;
|
|
55
|
-
exports.InstructionObjectSchema = dev.InstructionObjectSchema;
|
|
56
|
-
exports.InstructionSchema = dev.InstructionSchema;
|
|
57
|
-
exports.IntentWorkflowEventSchema = dev.IntentWorkflowEventSchema;
|
|
58
|
-
exports.MessageSchema = dev.MessageSchema;
|
|
59
|
-
exports.Scout9ProjectBuildConfigSchema = dev.Scout9ProjectBuildConfigSchema;
|
|
60
|
-
exports.Scout9ProjectConfigSchema = dev.Scout9ProjectConfigSchema;
|
|
61
50
|
exports.Scout9Test = dev.Scout9Test;
|
|
62
|
-
exports.WorkflowConfigurationSchema = dev.WorkflowConfigurationSchema;
|
|
63
|
-
exports.WorkflowEventSchema = dev.WorkflowEventSchema;
|
|
64
|
-
exports.WorkflowFunctionSchema = dev.WorkflowFunctionSchema;
|
|
65
|
-
exports.WorkflowResponseMessage = dev.WorkflowResponseMessage;
|
|
66
|
-
exports.WorkflowResponseMessageApiRequest = dev.WorkflowResponseMessageApiRequest;
|
|
67
|
-
exports.WorkflowResponseMessageApiResponse = dev.WorkflowResponseMessageApiResponse;
|
|
68
|
-
exports.WorkflowResponseSchema = dev.WorkflowResponseSchema;
|
|
69
|
-
exports.WorkflowResponseSlotBaseSchema = dev.WorkflowResponseSlotBaseSchema;
|
|
70
|
-
exports.WorkflowResponseSlotSchema = dev.WorkflowResponseSlotSchema;
|
|
71
|
-
exports.WorkflowsConfigurationSchema = dev.WorkflowsConfigurationSchema;
|
|
72
|
-
exports.agentBaseConfigurationSchema = dev.agentBaseConfigurationSchema;
|
|
73
|
-
exports.agentConfigurationSchema = dev.agentConfigurationSchema;
|
|
74
|
-
exports.agentsBaseConfigurationSchema = dev.agentsBaseConfigurationSchema;
|
|
75
|
-
exports.agentsConfigurationSchema = dev.agentsConfigurationSchema;
|
|
76
|
-
exports.apiFunctionSchema = dev.apiFunctionSchema;
|
|
77
51
|
exports.createMockAgent = dev.createMockAgent;
|
|
78
52
|
exports.createMockConversation = dev.createMockConversation;
|
|
79
53
|
exports.createMockCustomer = dev.createMockCustomer;
|
|
80
54
|
exports.createMockMessage = dev.createMockMessage;
|
|
81
55
|
exports.createMockWorkflowEvent = dev.createMockWorkflowEvent;
|
|
82
|
-
exports.customerSchema = dev.customerSchema;
|
|
83
|
-
exports.customerValueSchema = dev.customerValueSchema;
|
|
84
|
-
exports.deleteApiFunctionSchema = dev.deleteApiFunctionSchema;
|
|
85
|
-
exports.entitiesRootConfigurationSchema = dev.entitiesRootConfigurationSchema;
|
|
86
|
-
exports.entitiesRootProjectConfigurationSchema = dev.entitiesRootProjectConfigurationSchema;
|
|
87
|
-
exports.entityApiConfigurationSchema = dev.entityApiConfigurationSchema;
|
|
88
|
-
exports.entityConfigurationSchema = dev.entityConfigurationSchema;
|
|
89
|
-
exports.entityRootProjectConfigurationSchema = dev.entityRootProjectConfigurationSchema;
|
|
90
|
-
exports.eventResponseSchema = dev.eventResponseSchema;
|
|
91
56
|
exports.forward = dev.forward;
|
|
92
|
-
exports.getApiFunctionSchema = dev.getApiFunctionSchema;
|
|
93
57
|
exports.instruct = dev.instruct;
|
|
94
|
-
exports.patchApiFunctionSchema = dev.patchApiFunctionSchema;
|
|
95
|
-
exports.postApiFunctionSchema = dev.postApiFunctionSchema;
|
|
96
|
-
exports.putApiFunctionSchema = dev.putApiFunctionSchema;
|
|
97
|
-
exports.queryApiFunctionSchema = dev.queryApiFunctionSchema;
|
|
98
58
|
exports.reply = dev.reply;
|
|
99
|
-
exports.Spirits = spirits.Spirits;
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
require('node:fs');
|
|
4
4
|
require('node:path');
|
|
5
|
-
var index = require("./index-
|
|
6
|
-
require("./spirits-
|
|
7
|
-
require("./dev-
|
|
5
|
+
var index = require("./index-2aedbf12.cjs");
|
|
6
|
+
require("./spirits-43ce19cf.cjs");
|
|
7
|
+
require("./dev-1afc1e7b.cjs");
|
|
8
8
|
require('util');
|
|
9
9
|
require('stream');
|
|
10
10
|
require('path');
|
|
@@ -19,19 +19,21 @@ require('zlib');
|
|
|
19
19
|
require('events');
|
|
20
20
|
require('crypto');
|
|
21
21
|
require('node:fs/promises');
|
|
22
|
-
require('
|
|
23
|
-
require('
|
|
22
|
+
require('node:url');
|
|
23
|
+
require('node:events');
|
|
24
|
+
require('node:stream');
|
|
25
|
+
require('node:string_decoder');
|
|
24
26
|
require('node:readline');
|
|
25
27
|
require('node:process');
|
|
26
|
-
require('node:url');
|
|
27
28
|
require('node:os');
|
|
29
|
+
require('fs/promises');
|
|
28
30
|
require('constants');
|
|
29
31
|
require('buffer');
|
|
30
32
|
require('node:http');
|
|
31
33
|
require('node:https');
|
|
32
34
|
require('node:zlib');
|
|
33
|
-
require('node:stream');
|
|
34
35
|
require('node:buffer');
|
|
36
|
+
require('string_decoder');
|
|
35
37
|
require('node:util');
|
|
36
38
|
require('node:net');
|
|
37
39
|
|