digipair 0.90.0 → 0.91.0-1

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.
Files changed (80) hide show
  1. package/main.js +466 -0
  2. package/main.js.map +1 -0
  3. package/package.json +92 -38
  4. package/bin/digipair.js +0 -3
  5. package/src/app/app.controller.js +0 -88
  6. package/src/app/app.controller.js.map +0 -1
  7. package/src/app/app.module.js +0 -18
  8. package/src/app/app.module.js.map +0 -1
  9. package/src/app/app.service.js +0 -160
  10. package/src/app/app.service.js.map +0 -1
  11. package/src/main.js +0 -65
  12. package/src/main.js.map +0 -1
  13. /package/{src/assets → assets}/default.json +0 -0
  14. /package/{src/assets → assets}/digipairs/admin/avatar.png +0 -0
  15. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-api.json +0 -0
  16. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-business-process.json +0 -0
  17. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-expert.json +0 -0
  18. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-imap-listener-oauth2.json +0 -0
  19. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-imap-listener.json +0 -0
  20. /package/{src/assets → assets}/digipairs/admin/boost-add-digipair-teams.json +0 -0
  21. /package/{src/assets → assets}/digipairs/admin/boost-add-reasoning.json +0 -0
  22. /package/{src/assets → assets}/digipairs/admin/boost-duplicate-reasoning.json +0 -0
  23. /package/{src/assets → assets}/digipairs/admin/boost-plan-reasoning.json +0 -0
  24. /package/{src/assets → assets}/digipairs/admin/compute-consumption-daily.json +0 -0
  25. /package/{src/assets → assets}/digipairs/admin/config.json +0 -0
  26. /package/{src/assets → assets}/digipairs/admin/consumptions-monthly.json +0 -0
  27. /package/{src/assets → assets}/digipairs/admin/consumptions.json +0 -0
  28. /package/{src/assets → assets}/digipairs/admin/digipair-list.json +0 -0
  29. /package/{src/assets → assets}/digipairs/admin/json-editor.json +0 -0
  30. /package/{src/assets → assets}/digipairs/admin/logs.json +0 -0
  31. /package/{src/assets → assets}/digipairs/admin/openapi2schema.json +0 -0
  32. /package/{src/assets → assets}/digipairs/admin/process-list.json +0 -0
  33. /package/{src/assets → assets}/digipairs/admin/reasoning-editor.json +0 -0
  34. /package/{src/assets → assets}/digipairs/admin/reasoning-list.json +0 -0
  35. /package/{src/assets → assets}/digipairs/admin/schema.json +0 -0
  36. /package/{src/assets → assets}/digipairs/common/answer.json +0 -0
  37. /package/{src/assets → assets}/digipairs/common/avatar.png +0 -0
  38. /package/{src/assets → assets}/digipairs/common/boosts.json +0 -0
  39. /package/{src/assets → assets}/digipairs/common/chat.json +0 -0
  40. /package/{src/assets → assets}/digipairs/common/config.json +0 -0
  41. /package/{src/assets → assets}/digipairs/common/conversation.json +0 -0
  42. /package/{src/assets → assets}/digipairs/common/history.json +0 -0
  43. /package/{src/assets → assets}/digipairs/common/metadata.json +0 -0
  44. /package/{src/assets → assets}/digipairs/common/notification.json +0 -0
  45. /package/{src/assets → assets}/digipairs/common/schema.json +0 -0
  46. /package/{src/assets → assets}/digipairs/common/schema.json.json +0 -0
  47. /package/{src/assets → assets}/digipairs/planning.jsonl +0 -0
  48. /package/{src/assets → assets}/domains.json +0 -0
  49. /package/{src/assets → assets}/public/push-notification.worker.js +0 -0
  50. /package/{src/assets → assets}/templates/business-process/avatar.png +0 -0
  51. /package/{src/assets → assets}/templates/business-process/config.json +0 -0
  52. /package/{src/assets → assets}/templates/business-process/schema.json +0 -0
  53. /package/{src/assets → assets}/templates/expert/avatar.png +0 -0
  54. /package/{src/assets → assets}/templates/expert/config.json +0 -0
  55. /package/{src/assets → assets}/templates/expert/conversation.json +0 -0
  56. /package/{src/assets → assets}/templates/expert/schema.json +0 -0
  57. /package/{src/assets → assets}/templates/imap-listener/action-message.json +0 -0
  58. /package/{src/assets → assets}/templates/imap-listener/avatar.png +0 -0
  59. /package/{src/assets → assets}/templates/imap-listener/config.json +0 -0
  60. /package/{src/assets → assets}/templates/imap-listener/conversation.json +0 -0
  61. /package/{src/assets → assets}/templates/imap-listener/imap.json +0 -0
  62. /package/{src/assets → assets}/templates/imap-listener/schema.json +0 -0
  63. /package/{src/assets → assets}/templates/imap-listener-oauth2/action-message.json +0 -0
  64. /package/{src/assets → assets}/templates/imap-listener-oauth2/avatar.png +0 -0
  65. /package/{src/assets → assets}/templates/imap-listener-oauth2/config.json +0 -0
  66. /package/{src/assets → assets}/templates/imap-listener-oauth2/conversation.json +0 -0
  67. /package/{src/assets → assets}/templates/imap-listener-oauth2/imap.json +0 -0
  68. /package/{src/assets → assets}/templates/imap-listener-oauth2/schema.json +0 -0
  69. /package/{src/assets → assets}/templates/msteams-incoming-webhook/avatar.png +0 -0
  70. /package/{src/assets → assets}/templates/msteams-incoming-webhook/config.json +0 -0
  71. /package/{src/assets → assets}/templates/msteams-incoming-webhook/conversation.json +0 -0
  72. /package/{src/assets → assets}/templates/msteams-incoming-webhook/messagecard.json +0 -0
  73. /package/{src/assets → assets}/templates/msteams-incoming-webhook/schema.json +0 -0
  74. /package/{src/assets → assets}/templates/openapi-apikey/avatar.png +0 -0
  75. /package/{src/assets → assets}/templates/openapi-apikey/config.json +0 -0
  76. /package/{src/assets → assets}/templates/openapi-apikey/conversation.json +0 -0
  77. /package/{src/assets → assets}/templates/openapi-apikey/fallback.json +0 -0
  78. /package/{src/assets → assets}/templates/openapi-apikey/openapi.json +0 -0
  79. /package/{src/assets → assets}/templates/openapi-apikey/request.json +0 -0
  80. /package/{src/assets → assets}/templates/openapi-apikey/schema.json +0 -0
package/main.js ADDED
@@ -0,0 +1,466 @@
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ([
4
+ /* 0 */,
5
+ /* 1 */
6
+ /***/ ((module) => {
7
+
8
+ module.exports = require("tslib");
9
+
10
+ /***/ }),
11
+ /* 2 */
12
+ /***/ ((module) => {
13
+
14
+ module.exports = require("@nestjs/common");
15
+
16
+ /***/ }),
17
+ /* 3 */
18
+ /***/ ((module) => {
19
+
20
+ module.exports = require("@nestjs/core");
21
+
22
+ /***/ }),
23
+ /* 4 */
24
+ /***/ ((module) => {
25
+
26
+ module.exports = require("body-parser");
27
+
28
+ /***/ }),
29
+ /* 5 */
30
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
31
+
32
+
33
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
34
+ exports.AppModule = void 0;
35
+ const tslib_1 = __webpack_require__(1);
36
+ const common_1 = __webpack_require__(2);
37
+ const app_controller_1 = __webpack_require__(6);
38
+ const app_service_1 = __webpack_require__(9);
39
+ let AppModule = class AppModule {
40
+ };
41
+ exports.AppModule = AppModule;
42
+ exports.AppModule = AppModule = tslib_1.__decorate([
43
+ (0, common_1.Module)({
44
+ imports: [],
45
+ controllers: [app_controller_1.AppController],
46
+ providers: [app_service_1.AppService],
47
+ })
48
+ ], AppModule);
49
+
50
+
51
+ /***/ }),
52
+ /* 6 */
53
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
54
+
55
+
56
+ var _a, _b, _c, _d, _e;
57
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
58
+ exports.AppController = void 0;
59
+ const tslib_1 = __webpack_require__(1);
60
+ const common_1 = __webpack_require__(2);
61
+ const express_1 = __webpack_require__(7);
62
+ const fs_1 = __webpack_require__(8);
63
+ const app_service_1 = __webpack_require__(9);
64
+ let AppController = class AppController {
65
+ constructor(appService) {
66
+ this.appService = appService;
67
+ }
68
+ async public(res, req) {
69
+ const filePath = `${__dirname}/assets/public${req.url.replace('/public', '')}`;
70
+ res.sendFile(filePath, err => {
71
+ if (err) {
72
+ res.status(404).send('File not found');
73
+ }
74
+ });
75
+ }
76
+ async domain(res, request, body, query) {
77
+ const assets = process.env.DIGIPAIR_FACTORY_PATH || './factory';
78
+ const host = request.headers.host.split(':')[0];
79
+ const path = request.params['0'];
80
+ let params, digipair, reasoning;
81
+ const domains = JSON.parse(await fs_1.promises.readFile(`${assets}/domains.json`, 'utf8'));
82
+ if (path === 'favicon.ico') {
83
+ return res.send(null);
84
+ }
85
+ params = path.split('/');
86
+ if (domains[host]) {
87
+ digipair = domains[host].digipair;
88
+ reasoning = params[0];
89
+ params = params.slice(1);
90
+ if (!reasoning) {
91
+ res.redirect(`/${domains[host].reasoning}`);
92
+ return;
93
+ }
94
+ }
95
+ else if (params.length < 2) {
96
+ res.redirect(`/admin/digipair-list`);
97
+ return;
98
+ }
99
+ else {
100
+ digipair = params[0];
101
+ reasoning = params[1];
102
+ params = params.slice(2);
103
+ }
104
+ try {
105
+ const skillProcess = __webpack_require__(14);
106
+ const { id, signal } = skillProcess.add(digipair, reasoning, null);
107
+ const method = request.method;
108
+ res.on('close', () => {
109
+ skillProcess.remove(id);
110
+ });
111
+ const result = await this.appService.agent(`${assets}/digipairs`, digipair, reasoning, body, params, query, method, request.headers, {}, request, res, signal);
112
+ res.send(result);
113
+ }
114
+ catch (error) {
115
+ if (error.type !== 'DIGIPAIR_KEEPALIVE') {
116
+ throw error;
117
+ }
118
+ }
119
+ }
120
+ };
121
+ exports.AppController = AppController;
122
+ tslib_1.__decorate([
123
+ (0, common_1.Get)('/public/*'),
124
+ tslib_1.__param(0, (0, common_1.Res)()),
125
+ tslib_1.__param(1, (0, common_1.Req)()),
126
+ tslib_1.__metadata("design:type", Function),
127
+ tslib_1.__metadata("design:paramtypes", [typeof (_b = typeof express_1.Response !== "undefined" && express_1.Response) === "function" ? _b : Object, typeof (_c = typeof express_1.Request !== "undefined" && express_1.Request) === "function" ? _c : Object]),
128
+ tslib_1.__metadata("design:returntype", Promise)
129
+ ], AppController.prototype, "public", null);
130
+ tslib_1.__decorate([
131
+ (0, common_1.All)('*'),
132
+ tslib_1.__param(0, (0, common_1.Res)()),
133
+ tslib_1.__param(1, (0, common_1.Req)()),
134
+ tslib_1.__param(2, (0, common_1.Body)()),
135
+ tslib_1.__param(3, (0, common_1.Query)()),
136
+ tslib_1.__metadata("design:type", Function),
137
+ tslib_1.__metadata("design:paramtypes", [typeof (_d = typeof express_1.Response !== "undefined" && express_1.Response) === "function" ? _d : Object, typeof (_e = typeof express_1.Request !== "undefined" && express_1.Request) === "function" ? _e : Object, Object, Object]),
138
+ tslib_1.__metadata("design:returntype", Promise)
139
+ ], AppController.prototype, "domain", null);
140
+ exports.AppController = AppController = tslib_1.__decorate([
141
+ (0, common_1.Controller)(),
142
+ tslib_1.__metadata("design:paramtypes", [typeof (_a = typeof app_service_1.AppService !== "undefined" && app_service_1.AppService) === "function" ? _a : Object])
143
+ ], AppController);
144
+
145
+
146
+ /***/ }),
147
+ /* 7 */
148
+ /***/ ((module) => {
149
+
150
+ module.exports = require("express");
151
+
152
+ /***/ }),
153
+ /* 8 */
154
+ /***/ ((module) => {
155
+
156
+ module.exports = require("fs");
157
+
158
+ /***/ }),
159
+ /* 9 */
160
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
161
+
162
+
163
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
164
+ exports.AppService = void 0;
165
+ const tslib_1 = __webpack_require__(1);
166
+ const engine_1 = __webpack_require__(10);
167
+ const common_1 = __webpack_require__(2);
168
+ const fs_1 = __webpack_require__(8);
169
+ engine_1.config.set('ALIAS', [
170
+ {
171
+ name: 'digipair',
172
+ library: '@digipair/skill-factory',
173
+ element: 'start',
174
+ properties: {
175
+ digipair: '{{settings.library}}',
176
+ reasoning: '{{settings.element}}',
177
+ version: '{{settings.version}}',
178
+ body: 'EVALUATE:settings.properties',
179
+ },
180
+ },
181
+ ]);
182
+ engine_1.config.set('LOGGER', (level, path, message, context, data) => {
183
+ const time = new Date().toISOString();
184
+ switch (level) {
185
+ case 'INFO':
186
+ console.log(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`);
187
+ break;
188
+ case 'ERROR':
189
+ console.error(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`, data);
190
+ break;
191
+ case 'DEBUG':
192
+ console.debug(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`, data);
193
+ break;
194
+ default:
195
+ console.log(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`);
196
+ break;
197
+ }
198
+ });
199
+ let AppService = class AppService {
200
+ async onModuleInit() {
201
+ const path = process.env.DIGIPAIR_FACTORY_PATH
202
+ ? `${process.env.DIGIPAIR_FACTORY_PATH}/digipairs`
203
+ : './factory/digipairs';
204
+ // initialize logs management
205
+ const skillLogger = __webpack_require__(11);
206
+ await skillLogger.initialize();
207
+ // initialize factory skill
208
+ const skillFactory = __webpack_require__(12);
209
+ skillFactory.initialize((context, digipair, reasoning, body) => this.agent(path, digipair, reasoning, body, [], {}, null, {}, context, null, null, context.protected.signal));
210
+ // start cron manager
211
+ try {
212
+ const skillCron = __webpack_require__(13);
213
+ skillCron.initialize(async (path, digipair, reasoning) => {
214
+ const skillProcess = __webpack_require__(14);
215
+ const { id, signal } = skillProcess.add(digipair, reasoning, null);
216
+ try {
217
+ await this.agent(path, digipair, reasoning, {}, [], {}, null, {}, {}, null, null, signal);
218
+ skillProcess.remove(id);
219
+ }
220
+ catch (error) {
221
+ if (error.type !== 'DIGIPAIR_KEEPALIVE') {
222
+ console.error(error);
223
+ skillProcess.remove(id);
224
+ }
225
+ }
226
+ });
227
+ skillCron.start(path);
228
+ }
229
+ catch (error) {
230
+ console.error(error);
231
+ }
232
+ // start workflow manager
233
+ try {
234
+ const skillTemporal = __webpack_require__(15);
235
+ if (process.env.TEMPORAL_CLUSTER_HOST) {
236
+ skillTemporal.initialize();
237
+ }
238
+ }
239
+ catch (error) {
240
+ console.error(error);
241
+ }
242
+ }
243
+ async agent(path, digipair, reasoning, body, params, query, method, headers, requester, req, res, signal) {
244
+ const assets = process.env.DIGIPAIR_FACTORY_PATH || './factory';
245
+ let context;
246
+ try {
247
+ let content;
248
+ content = await fs_1.promises.readFile(`${assets}/default.json`, 'utf8');
249
+ const defaultConfig = JSON.parse(content);
250
+ content = await fs_1.promises.readFile(`${path}/common/config.json`, 'utf8');
251
+ const commonConfig = JSON.parse(content);
252
+ content = await fs_1.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');
253
+ const config = JSON.parse(content);
254
+ context = {
255
+ config: {
256
+ VERSIONS: { ...defaultConfig.libraries, ...commonConfig.libraries, ...config.libraries },
257
+ WEB_VERSIONS: {
258
+ ...defaultConfig.webLibraries,
259
+ ...commonConfig.webLibraries,
260
+ ...config.webLibraries,
261
+ },
262
+ },
263
+ privates: { ...defaultConfig.privates, ...commonConfig.privates, ...config.privates },
264
+ variables: { ...defaultConfig.variables, ...commonConfig.variables, ...config.variables },
265
+ request: {
266
+ digipair,
267
+ reasoning,
268
+ method,
269
+ body,
270
+ params,
271
+ query,
272
+ headers,
273
+ },
274
+ protected: {
275
+ req,
276
+ res,
277
+ signal,
278
+ },
279
+ requester,
280
+ };
281
+ if ((0, fs_1.existsSync)(`${path}/${digipair}/${reasoning}.json`)) {
282
+ content = await fs_1.promises.readFile(`${path}/${digipair}/${reasoning}.json`, 'utf8');
283
+ }
284
+ else if ((0, fs_1.existsSync)(`${path}/common/${reasoning}.json`) === true) {
285
+ content = await fs_1.promises.readFile(`${path}/common/${reasoning}.json`, 'utf8');
286
+ }
287
+ else if ((0, fs_1.existsSync)(`${path}/${digipair}/fallback.json`)) {
288
+ content = await fs_1.promises.readFile(`${path}/${digipair}/fallback.json`, 'utf8');
289
+ }
290
+ else if ((0, fs_1.existsSync)(`${path}/common/fallback.json`) === true) {
291
+ content = await fs_1.promises.readFile(`${path}/common/fallback.json`, 'utf8');
292
+ }
293
+ else {
294
+ res.status(404);
295
+ return { status: 'not found' };
296
+ }
297
+ const settings = JSON.parse(content);
298
+ const result = await (0, engine_1.executePinsList)([settings], context, 'reasoning');
299
+ return result;
300
+ }
301
+ catch (error) {
302
+ if (error.type === 'DIGIPAIR_KEEPALIVE') {
303
+ throw error;
304
+ }
305
+ if (error.type === 'DIGIPAIR_STOP') {
306
+ return error.value;
307
+ }
308
+ console.error(error);
309
+ if (!context) {
310
+ return;
311
+ }
312
+ const skillLogger = __webpack_require__(11);
313
+ skillLogger.addLog(context, 'ERROR', error.message);
314
+ }
315
+ }
316
+ };
317
+ exports.AppService = AppService;
318
+ exports.AppService = AppService = tslib_1.__decorate([
319
+ (0, common_1.Injectable)()
320
+ ], AppService);
321
+
322
+
323
+ /***/ }),
324
+ /* 10 */
325
+ /***/ ((module) => {
326
+
327
+ module.exports = require("@digipair/engine");
328
+
329
+ /***/ }),
330
+ /* 11 */
331
+ /***/ ((module) => {
332
+
333
+ module.exports = require("@digipair/skill-logger");
334
+
335
+ /***/ }),
336
+ /* 12 */
337
+ /***/ ((module) => {
338
+
339
+ module.exports = require("@digipair/skill-factory");
340
+
341
+ /***/ }),
342
+ /* 13 */
343
+ /***/ ((module) => {
344
+
345
+ module.exports = require("@digipair/skill-cron");
346
+
347
+ /***/ }),
348
+ /* 14 */
349
+ /***/ ((module) => {
350
+
351
+ module.exports = require("@digipair/skill-process");
352
+
353
+ /***/ }),
354
+ /* 15 */
355
+ /***/ ((module) => {
356
+
357
+ module.exports = require("@digipair/skill-temporal");
358
+
359
+ /***/ }),
360
+ /* 16 */
361
+ /***/ ((module) => {
362
+
363
+ module.exports = require("path");
364
+
365
+ /***/ })
366
+ /******/ ]);
367
+ /************************************************************************/
368
+ /******/ // The module cache
369
+ /******/ var __webpack_module_cache__ = {};
370
+ /******/
371
+ /******/ // The require function
372
+ /******/ function __webpack_require__(moduleId) {
373
+ /******/ // Check if module is in cache
374
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
375
+ /******/ if (cachedModule !== undefined) {
376
+ /******/ return cachedModule.exports;
377
+ /******/ }
378
+ /******/ // Create a new module (and put it into the cache)
379
+ /******/ var module = __webpack_module_cache__[moduleId] = {
380
+ /******/ // no module.id needed
381
+ /******/ // no module.loaded needed
382
+ /******/ exports: {}
383
+ /******/ };
384
+ /******/
385
+ /******/ // Execute the module function
386
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
387
+ /******/
388
+ /******/ // Return the exports of the module
389
+ /******/ return module.exports;
390
+ /******/ }
391
+ /******/
392
+ /************************************************************************/
393
+ var __webpack_exports__ = {};
394
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
395
+ (() => {
396
+ var exports = __webpack_exports__;
397
+
398
+ /**
399
+ * This is not a production server yet!
400
+ * This is only a minimal backend to get started.
401
+ */
402
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
403
+ const tslib_1 = __webpack_require__(1);
404
+ const common_1 = __webpack_require__(2);
405
+ const core_1 = __webpack_require__(3);
406
+ const bodyParser = tslib_1.__importStar(__webpack_require__(4));
407
+ const app_module_1 = __webpack_require__(5);
408
+ const fs_1 = __webpack_require__(8);
409
+ const path_1 = tslib_1.__importDefault(__webpack_require__(16));
410
+ function copyDirectoryRecursive(source, target) {
411
+ if (!(0, fs_1.existsSync)(source)) {
412
+ common_1.Logger.error(`The source directory "${source}" doesn't exist.`);
413
+ return;
414
+ }
415
+ if (!(0, fs_1.existsSync)(target)) {
416
+ (0, fs_1.mkdirSync)(target);
417
+ }
418
+ const files = (0, fs_1.readdirSync)(source);
419
+ files.forEach(file => {
420
+ const sourcePath = path_1.default.join(source, file);
421
+ const targetPath = path_1.default.join(target, file);
422
+ if ((0, fs_1.lstatSync)(sourcePath).isDirectory()) {
423
+ copyDirectoryRecursive(sourcePath, targetPath);
424
+ }
425
+ else {
426
+ (0, fs_1.copyFileSync)(sourcePath, targetPath);
427
+ }
428
+ });
429
+ }
430
+ async function bootstrap() {
431
+ /* create factory directory and copy files from assets if empty or not exist */
432
+ const digipairsDir = process.env.DIGIPAIR_FACTORY_PATH || './factory';
433
+ common_1.Logger.log(`Check if the digipairs folder exists`);
434
+ if (!(0, fs_1.existsSync)(digipairsDir)) {
435
+ common_1.Logger.log(`-> digipairs folder not exists: ${digipairsDir}`);
436
+ (0, fs_1.mkdirSync)(digipairsDir);
437
+ common_1.Logger.log(`-> digipairs folder created: ${digipairsDir}`);
438
+ }
439
+ else {
440
+ common_1.Logger.log(`-> digipairs folder exists: ${digipairsDir}`);
441
+ }
442
+ const assetsDir = `${__dirname}/assets`;
443
+ const digipairsFiles = (0, fs_1.readdirSync)(digipairsDir);
444
+ common_1.Logger.log(`Check if the factory folder is already filled with digipairs files. Number files found: ${digipairsFiles.length}`);
445
+ if (!digipairsFiles.length) {
446
+ common_1.Logger.log(`Digipair files not found -> start copy from digipair assets folder: ${assetsDir}`);
447
+ copyDirectoryRecursive(assetsDir, digipairsDir);
448
+ common_1.Logger.log(`Copy finished`);
449
+ }
450
+ else {
451
+ common_1.Logger.log(`Digipair files already present: ${digipairsFiles.join(', ')}`);
452
+ }
453
+ const app = await core_1.NestFactory.create(app_module_1.AppModule);
454
+ app.use(bodyParser.json({ limit: '50mb' }));
455
+ app.enableCors();
456
+ const port = process.env.PORT || 8080;
457
+ await app.listen(port);
458
+ common_1.Logger.log(`🚀 Application is running on: http://localhost:${port}`);
459
+ }
460
+ bootstrap();
461
+
462
+ })();
463
+
464
+ /******/ })()
465
+ ;
466
+ //# sourceMappingURL=main.js.map
package/main.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","mappings":";;;;;;;AAAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,iBAAiB;AACjB,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,iBAAiB,mBAAO,CAAC,CAAgB;AACzC,yBAAyB,mBAAO,CAAC,CAAkB;AACnD,sBAAsB,mBAAO,CAAC,CAAe;AAC7C;AACA;AACA,iBAAiB;AACjB,iBAAiB;AACjB;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;AChBa;AACb;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,qBAAqB;AACrB,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,iBAAiB,mBAAO,CAAC,CAAgB;AACzC,kBAAkB,mBAAO,CAAC,CAAS;AACnC,aAAa,mBAAO,CAAC,CAAI;AACzB,sBAAsB,mBAAO,CAAC,CAAe;AAC7C;AACA;AACA;AACA;AACA;AACA,4BAA4B,UAAU,gBAAgB,+BAA+B;AACrF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,OAAO;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,wBAAwB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,mBAAO,CAAC,EAAyB;AAClE,oBAAoB,aAAa;AACjC;AACA;AACA;AACA,aAAa;AACb,0DAA0D,OAAO,kFAAkF;AACnJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;;;;;;;ACxFA;;;;;;ACAA;;;;;;ACAa;AACb,8CAA6C,EAAE,aAAa,EAAC;AAC7D,kBAAkB;AAClB,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,iBAAiB,mBAAO,CAAC,EAAkB;AAC3C,iBAAiB,mBAAO,CAAC,CAAgB;AACzC,aAAa,mBAAO,CAAC,CAAI;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C,0BAA0B,kBAAkB;AAC5C,wBAAwB,kBAAkB;AAC1C;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,4BAA4B,KAAK,IAAI,yBAAyB,GAAG,0BAA0B,IAAI,KAAK,IAAI,QAAQ;AAChH;AACA;AACA,8BAA8B,KAAK,IAAI,yBAAyB,GAAG,0BAA0B,IAAI,KAAK,IAAI,QAAQ;AAClH;AACA;AACA,8BAA8B,KAAK,IAAI,yBAAyB,GAAG,0BAA0B,IAAI,KAAK,IAAI,QAAQ;AAClH;AACA;AACA,4BAA4B,KAAK,IAAI,yBAAyB,GAAG,0BAA0B,IAAI,KAAK,IAAI,QAAQ;AAChH;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,iBAAiB,kCAAkC;AACnD;AACA;AACA,4BAA4B,mBAAO,CAAC,EAAwB;AAC5D;AACA;AACA,6BAA6B,mBAAO,CAAC,EAAyB;AAC9D,0HAA0H,UAAU;AACpI;AACA;AACA,8BAA8B,mBAAO,CAAC,EAAsB;AAC5D;AACA,qCAAqC,mBAAO,CAAC,EAAyB;AACtE,wBAAwB,aAAa;AACrC;AACA,kEAAkE,QAAQ,UAAU,IAAI;AACxF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mBAAO,CAAC,EAA0B;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA,sDAAsD,KAAK;AAC3D;AACA,sDAAsD,KAAK,GAAG,SAAS;AACvE;AACA;AACA;AACA,gCAAgC,4EAA4E;AAC5G;AACA;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB,4BAA4B,yEAAyE;AACrG,6BAA6B,4EAA4E;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,wCAAwC,KAAK,GAAG,SAAS,GAAG,UAAU;AACtE,0DAA0D,KAAK,GAAG,SAAS,GAAG,UAAU;AACxF;AACA,6CAA6C,KAAK,UAAU,UAAU;AACtE,0DAA0D,KAAK,UAAU,UAAU;AACnF;AACA,6CAA6C,KAAK,GAAG,SAAS;AAC9D,0DAA0D,KAAK,GAAG,SAAS;AAC3E;AACA,6CAA6C,KAAK;AAClD,0DAA0D,KAAK;AAC/D;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,mBAAO,CAAC,EAAwB;AAChE;AACA;AACA;AACA;AACA,kBAAkB;AAClB,kBAAkB;AAClB;AACA;;;;;;;AC9JA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;;ACAA;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA,8CAA6C,EAAE,aAAa,EAAC;AAC7D,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,iBAAiB,mBAAO,CAAC,CAAgB;AACzC,eAAe,mBAAO,CAAC,CAAc;AACrC,wCAAwC,mBAAO,CAAC,CAAa;AAC7D,qBAAqB,mBAAO,CAAC,CAAkB;AAC/C,aAAa,mBAAO,CAAC,CAAI;AACzB,uCAAuC,mBAAO,CAAC,EAAM;AACrD;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,aAAa;AAC5E;AACA,4DAA4D,aAAa;AACzE;AACA;AACA,2DAA2D,aAAa;AACxE;AACA,yBAAyB,UAAU;AACnC;AACA,mHAAmH,sBAAsB;AACzI;AACA,mGAAmG,UAAU;AAC7G;AACA;AACA;AACA;AACA,+DAA+D,0BAA0B;AACzF;AACA;AACA,8BAA8B,eAAe;AAC7C;AACA;AACA;AACA,0EAA0E,KAAK;AAC/E;AACA","sources":["webpack://digipair/external commonjs \"tslib\"","webpack://digipair/external commonjs \"@nestjs/common\"","webpack://digipair/external commonjs \"@nestjs/core\"","webpack://digipair/external commonjs \"body-parser\"","webpack://digipair/./src/app/app.module.ts","webpack://digipair/./src/app/app.controller.ts","webpack://digipair/external commonjs \"express\"","webpack://digipair/external node-commonjs \"fs\"","webpack://digipair/./src/app/app.service.ts","webpack://digipair/external commonjs \"@digipair/engine\"","webpack://digipair/external commonjs \"@digipair/skill-logger\"","webpack://digipair/external commonjs \"@digipair/skill-factory\"","webpack://digipair/external commonjs \"@digipair/skill-cron\"","webpack://digipair/external commonjs \"@digipair/skill-process\"","webpack://digipair/external commonjs \"@digipair/skill-temporal\"","webpack://digipair/external node-commonjs \"path\"","webpack://digipair/webpack/bootstrap","webpack://digipair/./src/main.ts"],"sourcesContent":["module.exports = require(\"tslib\");","module.exports = require(\"@nestjs/common\");","module.exports = require(\"@nestjs/core\");","module.exports = require(\"body-parser\");","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppModule = void 0;\nconst tslib_1 = require(\"tslib\");\nconst common_1 = require(\"@nestjs/common\");\nconst app_controller_1 = require(\"./app.controller\");\nconst app_service_1 = require(\"./app.service\");\nlet AppModule = class AppModule {\n};\nexports.AppModule = AppModule;\nexports.AppModule = AppModule = tslib_1.__decorate([\n (0, common_1.Module)({\n imports: [],\n controllers: [app_controller_1.AppController],\n providers: [app_service_1.AppService],\n })\n], AppModule);\n","\"use strict\";\nvar _a, _b, _c, _d, _e;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppController = void 0;\nconst tslib_1 = require(\"tslib\");\nconst common_1 = require(\"@nestjs/common\");\nconst express_1 = require(\"express\");\nconst fs_1 = require(\"fs\");\nconst app_service_1 = require(\"./app.service\");\nlet AppController = class AppController {\n constructor(appService) {\n this.appService = appService;\n }\n async public(res, req) {\n const filePath = `${__dirname}/assets/public${req.url.replace('/public', '')}`;\n res.sendFile(filePath, err => {\n if (err) {\n res.status(404).send('File not found');\n }\n });\n }\n async domain(res, request, body, query) {\n const assets = process.env.DIGIPAIR_FACTORY_PATH || './factory';\n const host = request.headers.host.split(':')[0];\n const path = request.params['0'];\n let params, digipair, reasoning;\n const domains = JSON.parse(await fs_1.promises.readFile(`${assets}/domains.json`, 'utf8'));\n if (path === 'favicon.ico') {\n return res.send(null);\n }\n params = path.split('/');\n if (domains[host]) {\n digipair = domains[host].digipair;\n reasoning = params[0];\n params = params.slice(1);\n if (!reasoning) {\n res.redirect(`/${domains[host].reasoning}`);\n return;\n }\n }\n else if (params.length < 2) {\n res.redirect(`/admin/digipair-list`);\n return;\n }\n else {\n digipair = params[0];\n reasoning = params[1];\n params = params.slice(2);\n }\n try {\n const skillProcess = require('@digipair/skill-process');\n const { id, signal } = skillProcess.add(digipair, reasoning, null);\n const method = request.method;\n res.on('close', () => {\n skillProcess.remove(id);\n });\n const result = await this.appService.agent(`${assets}/digipairs`, digipair, reasoning, body, params, query, method, request.headers, {}, request, res, signal);\n res.send(result);\n }\n catch (error) {\n if (error.type !== 'DIGIPAIR_KEEPALIVE') {\n throw error;\n }\n }\n }\n};\nexports.AppController = AppController;\ntslib_1.__decorate([\n (0, common_1.Get)('/public/*'),\n tslib_1.__param(0, (0, common_1.Res)()),\n tslib_1.__param(1, (0, common_1.Req)()),\n tslib_1.__metadata(\"design:type\", Function),\n tslib_1.__metadata(\"design:paramtypes\", [typeof (_b = typeof express_1.Response !== \"undefined\" && express_1.Response) === \"function\" ? _b : Object, typeof (_c = typeof express_1.Request !== \"undefined\" && express_1.Request) === \"function\" ? _c : Object]),\n tslib_1.__metadata(\"design:returntype\", Promise)\n], AppController.prototype, \"public\", null);\ntslib_1.__decorate([\n (0, common_1.All)('*'),\n tslib_1.__param(0, (0, common_1.Res)()),\n tslib_1.__param(1, (0, common_1.Req)()),\n tslib_1.__param(2, (0, common_1.Body)()),\n tslib_1.__param(3, (0, common_1.Query)()),\n tslib_1.__metadata(\"design:type\", Function),\n tslib_1.__metadata(\"design:paramtypes\", [typeof (_d = typeof express_1.Response !== \"undefined\" && express_1.Response) === \"function\" ? _d : Object, typeof (_e = typeof express_1.Request !== \"undefined\" && express_1.Request) === \"function\" ? _e : Object, Object, Object]),\n tslib_1.__metadata(\"design:returntype\", Promise)\n], AppController.prototype, \"domain\", null);\nexports.AppController = AppController = tslib_1.__decorate([\n (0, common_1.Controller)(),\n tslib_1.__metadata(\"design:paramtypes\", [typeof (_a = typeof app_service_1.AppService !== \"undefined\" && app_service_1.AppService) === \"function\" ? _a : Object])\n], AppController);\n","module.exports = require(\"express\");","module.exports = require(\"fs\");","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppService = void 0;\nconst tslib_1 = require(\"tslib\");\nconst engine_1 = require(\"@digipair/engine\");\nconst common_1 = require(\"@nestjs/common\");\nconst fs_1 = require(\"fs\");\nengine_1.config.set('ALIAS', [\n {\n name: 'digipair',\n library: '@digipair/skill-factory',\n element: 'start',\n properties: {\n digipair: '{{settings.library}}',\n reasoning: '{{settings.element}}',\n version: '{{settings.version}}',\n body: 'EVALUATE:settings.properties',\n },\n },\n]);\nengine_1.config.set('LOGGER', (level, path, message, context, data) => {\n const time = new Date().toISOString();\n switch (level) {\n case 'INFO':\n console.log(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`);\n break;\n case 'ERROR':\n console.error(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`, data);\n break;\n case 'DEBUG':\n console.debug(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`, data);\n break;\n default:\n console.log(`[${time}][${context.request.digipair}@${context.request.reasoning}][${path}] ${message}`);\n break;\n }\n});\nlet AppService = class AppService {\n async onModuleInit() {\n const path = process.env.DIGIPAIR_FACTORY_PATH\n ? `${process.env.DIGIPAIR_FACTORY_PATH}/digipairs`\n : './factory/digipairs';\n // initialize logs management\n const skillLogger = require('@digipair/skill-logger');\n await skillLogger.initialize();\n // initialize factory skill\n const skillFactory = require('@digipair/skill-factory');\n skillFactory.initialize((context, digipair, reasoning, body) => this.agent(path, digipair, reasoning, body, [], {}, null, {}, context, null, null, context.protected.signal));\n // start cron manager\n try {\n const skillCron = require('@digipair/skill-cron');\n skillCron.initialize(async (path, digipair, reasoning) => {\n const skillProcess = require('@digipair/skill-process');\n const { id, signal } = skillProcess.add(digipair, reasoning, null);\n try {\n await this.agent(path, digipair, reasoning, {}, [], {}, null, {}, {}, null, null, signal);\n skillProcess.remove(id);\n }\n catch (error) {\n if (error.type !== 'DIGIPAIR_KEEPALIVE') {\n console.error(error);\n skillProcess.remove(id);\n }\n }\n });\n skillCron.start(path);\n }\n catch (error) {\n console.error(error);\n }\n // start workflow manager\n try {\n const skillTemporal = require('@digipair/skill-temporal');\n if (process.env.TEMPORAL_CLUSTER_HOST) {\n skillTemporal.initialize();\n }\n }\n catch (error) {\n console.error(error);\n }\n }\n async agent(path, digipair, reasoning, body, params, query, method, headers, requester, req, res, signal) {\n const assets = process.env.DIGIPAIR_FACTORY_PATH || './factory';\n let context;\n try {\n let content;\n content = await fs_1.promises.readFile(`${assets}/default.json`, 'utf8');\n const defaultConfig = JSON.parse(content);\n content = await fs_1.promises.readFile(`${path}/common/config.json`, 'utf8');\n const commonConfig = JSON.parse(content);\n content = await fs_1.promises.readFile(`${path}/${digipair}/config.json`, 'utf8');\n const config = JSON.parse(content);\n context = {\n config: {\n VERSIONS: { ...defaultConfig.libraries, ...commonConfig.libraries, ...config.libraries },\n WEB_VERSIONS: {\n ...defaultConfig.webLibraries,\n ...commonConfig.webLibraries,\n ...config.webLibraries,\n },\n },\n privates: { ...defaultConfig.privates, ...commonConfig.privates, ...config.privates },\n variables: { ...defaultConfig.variables, ...commonConfig.variables, ...config.variables },\n request: {\n digipair,\n reasoning,\n method,\n body,\n params,\n query,\n headers,\n },\n protected: {\n req,\n res,\n signal,\n },\n requester,\n };\n if ((0, fs_1.existsSync)(`${path}/${digipair}/${reasoning}.json`)) {\n content = await fs_1.promises.readFile(`${path}/${digipair}/${reasoning}.json`, 'utf8');\n }\n else if ((0, fs_1.existsSync)(`${path}/common/${reasoning}.json`) === true) {\n content = await fs_1.promises.readFile(`${path}/common/${reasoning}.json`, 'utf8');\n }\n else if ((0, fs_1.existsSync)(`${path}/${digipair}/fallback.json`)) {\n content = await fs_1.promises.readFile(`${path}/${digipair}/fallback.json`, 'utf8');\n }\n else if ((0, fs_1.existsSync)(`${path}/common/fallback.json`) === true) {\n content = await fs_1.promises.readFile(`${path}/common/fallback.json`, 'utf8');\n }\n else {\n res.status(404);\n return { status: 'not found' };\n }\n const settings = JSON.parse(content);\n const result = await (0, engine_1.executePinsList)([settings], context, 'reasoning');\n return result;\n }\n catch (error) {\n if (error.type === 'DIGIPAIR_KEEPALIVE') {\n throw error;\n }\n if (error.type === 'DIGIPAIR_STOP') {\n return error.value;\n }\n console.error(error);\n if (!context) {\n return;\n }\n const skillLogger = require('@digipair/skill-logger');\n skillLogger.addLog(context, 'ERROR', error.message);\n }\n }\n};\nexports.AppService = AppService;\nexports.AppService = AppService = tslib_1.__decorate([\n (0, common_1.Injectable)()\n], AppService);\n","module.exports = require(\"@digipair/engine\");","module.exports = require(\"@digipair/skill-logger\");","module.exports = require(\"@digipair/skill-factory\");","module.exports = require(\"@digipair/skill-cron\");","module.exports = require(\"@digipair/skill-process\");","module.exports = require(\"@digipair/skill-temporal\");","module.exports = require(\"path\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\"use strict\";\n/**\n * This is not a production server yet!\n * This is only a minimal backend to get started.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\nconst common_1 = require(\"@nestjs/common\");\nconst core_1 = require(\"@nestjs/core\");\nconst bodyParser = tslib_1.__importStar(require(\"body-parser\"));\nconst app_module_1 = require(\"./app/app.module\");\nconst fs_1 = require(\"fs\");\nconst path_1 = tslib_1.__importDefault(require(\"path\"));\nfunction copyDirectoryRecursive(source, target) {\n if (!(0, fs_1.existsSync)(source)) {\n common_1.Logger.error(`The source directory \"${source}\" doesn't exist.`);\n return;\n }\n if (!(0, fs_1.existsSync)(target)) {\n (0, fs_1.mkdirSync)(target);\n }\n const files = (0, fs_1.readdirSync)(source);\n files.forEach(file => {\n const sourcePath = path_1.default.join(source, file);\n const targetPath = path_1.default.join(target, file);\n if ((0, fs_1.lstatSync)(sourcePath).isDirectory()) {\n copyDirectoryRecursive(sourcePath, targetPath);\n }\n else {\n (0, fs_1.copyFileSync)(sourcePath, targetPath);\n }\n });\n}\nasync function bootstrap() {\n /* create factory directory and copy files from assets if empty or not exist */\n const digipairsDir = process.env.DIGIPAIR_FACTORY_PATH || './factory';\n common_1.Logger.log(`Check if the digipairs folder exists`);\n if (!(0, fs_1.existsSync)(digipairsDir)) {\n common_1.Logger.log(`-> digipairs folder not exists: ${digipairsDir}`);\n (0, fs_1.mkdirSync)(digipairsDir);\n common_1.Logger.log(`-> digipairs folder created: ${digipairsDir}`);\n }\n else {\n common_1.Logger.log(`-> digipairs folder exists: ${digipairsDir}`);\n }\n const assetsDir = `${__dirname}/assets`;\n const digipairsFiles = (0, fs_1.readdirSync)(digipairsDir);\n common_1.Logger.log(`Check if the factory folder is already filled with digipairs files. Number files found: ${digipairsFiles.length}`);\n if (!digipairsFiles.length) {\n common_1.Logger.log(`Digipair files not found -> start copy from digipair assets folder: ${assetsDir}`);\n copyDirectoryRecursive(assetsDir, digipairsDir);\n common_1.Logger.log(`Copy finished`);\n }\n else {\n common_1.Logger.log(`Digipair files already present: ${digipairsFiles.join(', ')}`);\n }\n const app = await core_1.NestFactory.create(app_module_1.AppModule);\n app.use(bodyParser.json({ limit: '50mb' }));\n app.enableCors();\n const port = process.env.PORT || 8080;\n await app.listen(port);\n common_1.Logger.log(`🚀 Application is running on: http://localhost:${port}`);\n}\nbootstrap();\n"],"names":[],"sourceRoot":""}
package/package.json CHANGED
@@ -1,49 +1,103 @@
1
1
  {
2
2
  "name": "digipair",
3
- "version": "0.90.0",
3
+ "version": "0.91.0-1",
4
4
  "type": "commonjs",
5
5
  "bin": {
6
6
  "digipair": "./bin/digipair.js"
7
7
  },
8
8
  "dependencies": {
9
- "@digipair/engine": "0.90.0",
10
- "@digipair/skill-chatbot": "0.90.0",
11
- "@digipair/skill-common": "0.90.0",
12
- "@digipair/skill-cron": "0.90.0",
13
- "@digipair/skill-basic": "0.90.0",
14
- "@digipair/skill-debug": "0.90.0",
15
- "@digipair/skill-dsp": "0.90.0",
16
- "@digipair/skill-editor": "0.90.0",
17
- "@digipair/skill-factory": "0.90.0",
18
- "@digipair/skill-http": "0.90.0",
19
- "@digipair/skill-llm": "0.90.0",
20
- "@digipair/skill-openai": "0.90.0",
21
- "@digipair/skill-service": "0.90.0",
22
- "@digipair/skill-sse": "0.90.0",
23
- "@digipair/skill-temporal": "0.90.0",
24
- "@digipair/skill-web": "0.90.0",
25
- "@digipair/skill-logger": "0.90.0",
26
- "@digipair/skill-process": "0.90.0",
27
- "@digipair/skill-oauth2": "0.90.0",
28
- "@digipair/skill-imap": "0.90.0",
29
- "@digipair/skill-sendmail": "0.90.0",
30
- "@digipair/skill-web-debug": "0.90.0",
31
- "@digipair/skill-web-jsoneditor": "0.90.0",
32
- "@digipair/skill-web-notification": "0.90.0",
33
- "@digipair/skill-web-chatbot": "0.90.0",
34
- "@digipair/skill-web-editor": "0.90.0",
35
- "@digipair/skill-web-inputs": "0.90.0",
36
- "@digipair/skill-web-spectrum": "0.90.0",
37
- "@digipair/skill-web-interact": "0.90.0",
38
- "@digipair/skill-web-font-awesome": "0.90.0",
39
- "tslib": "^2.6.3",
40
- "@nestjs/common": "^10.3.9",
41
- "@nestjs/core": "^10.3.9",
42
- "@nestjs/platform-express": "^10.3.9",
9
+ "@digipair/engine": "latest",
10
+ "@digipair/skill-chatbot": "latest",
11
+ "@digipair/skill-common": "latest",
12
+ "@digipair/skill-cron": "latest",
13
+ "@digipair/skill-basic": "latest",
14
+ "@digipair/skill-debug": "latest",
15
+ "@digipair/skill-dsp": "latest",
16
+ "@digipair/skill-editor": "latest",
17
+ "@digipair/skill-factory": "latest",
18
+ "@digipair/skill-http": "latest",
19
+ "@digipair/skill-llm": "latest",
20
+ "@digipair/skill-openai": "latest",
21
+ "@digipair/skill-service": "latest",
22
+ "@digipair/skill-sse": "latest",
23
+ "@digipair/skill-temporal": "latest",
24
+ "@digipair/skill-web": "latest",
25
+ "@digipair/skill-logger": "latest",
26
+ "@digipair/skill-process": "latest",
27
+ "@digipair/skill-oauth2": "latest",
28
+ "@digipair/skill-imap": "latest",
29
+ "@digipair/skill-sendmail": "latest",
30
+ "@digipair/skill-web-debug": "latest",
31
+ "@digipair/skill-web-jsoneditor": "latest",
32
+ "@digipair/skill-web-notification": "latest",
33
+ "@digipair/skill-web-chatbot": "latest",
34
+ "@digipair/skill-web-editor": "latest",
35
+ "@digipair/skill-web-inputs": "latest",
36
+ "@digipair/skill-web-spectrum": "latest",
37
+ "@digipair/skill-web-interact": "latest",
38
+ "@digipair/skill-web-font-awesome": "latest",
43
39
  "@nestjs/serve-static": "^4.0.2",
44
- "reflect-metadata": "^0.2.2",
45
40
  "blockly": "10.4.3",
46
- "toastify-js": "1.12.0"
41
+ "toastify-js": "1.12.0",
42
+ "@nestjs/common": "10.4.19",
43
+ "@nestjs/core": "10.4.19",
44
+ "@nestjs/platform-express": "10.4.19",
45
+ "@temporalio/client": "1.11.8",
46
+ "@temporalio/common": "1.11.8",
47
+ "@temporalio/worker": "1.11.8",
48
+ "@temporalio/workflow": "1.11.8",
49
+ "body-parser": "1.20.3",
50
+ "class-transformer": "0.5.1",
51
+ "class-validator": "0.14.2",
52
+ "cron": "3.5.0",
53
+ "express": "4.21.0",
54
+ "handlebars": "4.7.8",
55
+ "reflect-metadata": "0.1.14",
56
+ "rxjs": "7.8.2",
57
+ "tslib": "2.8.1",
58
+ "uuid": "10.0.0"
47
59
  },
48
- "main": "./src/main.js"
60
+ "nx": {
61
+ "name": "factory",
62
+ "targets": {
63
+ "build": {
64
+ "executor": "nx:run-commands",
65
+ "options": {
66
+ "command": "webpack-cli build",
67
+ "args": [
68
+ "node-env=production"
69
+ ]
70
+ },
71
+ "configurations": {
72
+ "development": {
73
+ "args": [
74
+ "node-env=development"
75
+ ]
76
+ }
77
+ }
78
+ },
79
+ "serve": {
80
+ "continuous": true,
81
+ "executor": "@nx/js:node",
82
+ "defaultConfiguration": "development",
83
+ "dependsOn": [
84
+ "build"
85
+ ],
86
+ "options": {
87
+ "buildTarget": "factory:build",
88
+ "runBuildTargetDependencies": false
89
+ },
90
+ "configurations": {
91
+ "development": {
92
+ "buildTarget": "factory:build:development"
93
+ },
94
+ "production": {
95
+ "buildTarget": "factory:build:production"
96
+ }
97
+ }
98
+ }
99
+ }
100
+ },
101
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
102
+ "main": "main.js"
49
103
  }
package/bin/digipair.js DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- const path = require('path');
3
- require(path.join(__dirname, '../src/main.js'));