digipair 0.116.3 → 0.117.0
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/assets/digipairs/role-openapi-apikey/config.json +25 -0
- package/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/conversation.json +28 -22
- package/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/fallback.json +20 -7
- package/assets/templates/openapi-apikey/config.json +3 -0
- package/main.js +134 -44
- package/package.json +38 -38
- package/src/app/assets/digipairs/role-openapi-apikey/config.json +25 -0
- package/src/app/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/conversation.json +28 -22
- package/src/app/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/fallback.json +20 -7
- package/src/app/assets/templates/openapi-apikey/config.json +3 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "role openApi apiKey",
|
|
3
|
+
"description": "openApi apiKey default role",
|
|
4
|
+
"metadata": {
|
|
5
|
+
},
|
|
6
|
+
"libraries": {
|
|
7
|
+
"@digipair/skill-service": "latest",
|
|
8
|
+
"@digipair/skill-chatbot": "latest",
|
|
9
|
+
"@digipair/skill-dsp": "latest",
|
|
10
|
+
"@digipair/skill-web": "latest",
|
|
11
|
+
"@digipair/skill-basic": "latest",
|
|
12
|
+
"@digipair/skill-http": "latest",
|
|
13
|
+
"@digipair/skill-factory": "latest",
|
|
14
|
+
"@digipair/skill-debug": "latest",
|
|
15
|
+
"@digipair/skill-web-debug": "latest",
|
|
16
|
+
"@digipair/skill-web-chatbot": "latest",
|
|
17
|
+
"@digipair/skill-web-inputs": "latest",
|
|
18
|
+
"@digipair/skill-web-interact": "latest"
|
|
19
|
+
},
|
|
20
|
+
"variables": {},
|
|
21
|
+
"privates": {
|
|
22
|
+
},
|
|
23
|
+
"digipair": "role-openapi-apikey",
|
|
24
|
+
"id": "role-openapi-apikey"
|
|
25
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Generating a response for the user via the chatbot.",
|
|
3
|
-
"summary": "Conversation",
|
|
3
|
+
"summary": "Conversation générique openApi-apiKey",
|
|
4
4
|
"library": "@digipair/skill-chatbot",
|
|
5
5
|
"element": "boost",
|
|
6
6
|
"metadata": {
|
|
@@ -27,37 +27,43 @@
|
|
|
27
27
|
"properties": {
|
|
28
28
|
"signature": "\"You are a helpful assistant, capable of explaining concepts in a simple manner.\" \nuserQuestion:string,\nhistory?:string[] ->\n answer: string \"Assistant answer\"",
|
|
29
29
|
"input": {
|
|
30
|
-
"userQuestion": "
|
|
30
|
+
"userQuestion": "FEEL:request.body.prompt",
|
|
31
31
|
"history": "FEEL:variables.history"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"library": "digipair
|
|
37
|
-
"element": "
|
|
36
|
+
"library": "@digipair/skill-factory",
|
|
37
|
+
"element": "start",
|
|
38
38
|
"properties": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
39
|
+
"digipair": "FEEL:request.digipair",
|
|
40
|
+
"reasoning": "answer",
|
|
41
|
+
"body": {
|
|
42
|
+
"assistant": "FEEL:previous.answer",
|
|
43
|
+
"boost": [
|
|
44
|
+
{
|
|
45
|
+
"prompt": true,
|
|
46
|
+
"required": true,
|
|
47
|
+
"step": "Conversation",
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"library": "@digipair/skill-web-inputs",
|
|
51
|
+
"element": "digipair-input-hidden",
|
|
52
|
+
"properties": {
|
|
53
|
+
"value": "FEEL:flatten([variables.history, [\n \"user: \" + request.body.prompt,\n \"assistant: \" + parent.previous.answer\n]])"
|
|
54
|
+
}
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"conditions": {},
|
|
62
|
+
"name": "digipair"
|
|
57
63
|
}
|
|
58
64
|
]
|
|
59
65
|
}
|
|
60
66
|
]
|
|
61
67
|
},
|
|
62
68
|
"pins": []
|
|
63
|
-
}
|
|
69
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Mécanisme d'appel d'une API",
|
|
3
|
-
"summary": "Fallback",
|
|
3
|
+
"summary": "Fallback générique openApi-apiKey",
|
|
4
4
|
"library": "@digipair/skill-factory",
|
|
5
5
|
"element": "task",
|
|
6
6
|
"metadata": {},
|
|
@@ -13,9 +13,15 @@
|
|
|
13
13
|
"name": "openapi",
|
|
14
14
|
"execute": [
|
|
15
15
|
{
|
|
16
|
-
"library": "digipair
|
|
17
|
-
"element": "
|
|
18
|
-
"properties": {
|
|
16
|
+
"library": "@digipair/skill-factory",
|
|
17
|
+
"element": "start",
|
|
18
|
+
"properties": {
|
|
19
|
+
"digipair": "FEEL:request.digipair",
|
|
20
|
+
"reasoning": "openapi",
|
|
21
|
+
"body": {}
|
|
22
|
+
},
|
|
23
|
+
"conditions": {},
|
|
24
|
+
"name": "digipair"
|
|
19
25
|
}
|
|
20
26
|
]
|
|
21
27
|
}
|
|
@@ -166,7 +172,9 @@
|
|
|
166
172
|
{
|
|
167
173
|
"library": "@digipair/skill-basic",
|
|
168
174
|
"element": "transform",
|
|
169
|
-
"properties": {
|
|
175
|
+
"properties": {
|
|
176
|
+
"value": "FEEL:item"
|
|
177
|
+
}
|
|
170
178
|
},
|
|
171
179
|
{
|
|
172
180
|
"library": "@digipair/skill-basic",
|
|
@@ -185,7 +193,9 @@
|
|
|
185
193
|
}
|
|
186
194
|
]
|
|
187
195
|
},
|
|
188
|
-
"conditions": {
|
|
196
|
+
"conditions": {
|
|
197
|
+
"each": "FEEL:variables.parametersPath"
|
|
198
|
+
}
|
|
189
199
|
},
|
|
190
200
|
{
|
|
191
201
|
"library": "@digipair/skill-basic",
|
|
@@ -231,7 +241,10 @@
|
|
|
231
241
|
{
|
|
232
242
|
"library": "@digipair/skill-basic",
|
|
233
243
|
"element": "setVariable",
|
|
234
|
-
"properties": {
|
|
244
|
+
"properties": {
|
|
245
|
+
"name": "body",
|
|
246
|
+
"value": "FEEL:request.body.body"
|
|
247
|
+
},
|
|
235
248
|
"conditions": {
|
|
236
249
|
"if": "FEEL:variables.infos.value[item.key = variables.method].value.requestBody[1] != null"
|
|
237
250
|
}
|
package/main.js
CHANGED
|
@@ -102,7 +102,7 @@ let AppController = class AppController {
|
|
|
102
102
|
params = params.slice(2);
|
|
103
103
|
}
|
|
104
104
|
try {
|
|
105
|
-
const skillProcess = __webpack_require__(
|
|
105
|
+
const skillProcess = __webpack_require__(15);
|
|
106
106
|
const { id, signal } = skillProcess.add(digipair, reasoning, null);
|
|
107
107
|
const method = request.method;
|
|
108
108
|
res.on('close', () => {
|
|
@@ -166,6 +166,7 @@ const tslib_1 = __webpack_require__(1);
|
|
|
166
166
|
const engine_1 = __webpack_require__(10);
|
|
167
167
|
const common_1 = __webpack_require__(2);
|
|
168
168
|
const fs_1 = __webpack_require__(8);
|
|
169
|
+
const path = tslib_1.__importStar(__webpack_require__(11));
|
|
169
170
|
engine_1.config.set('ALIAS', [
|
|
170
171
|
{
|
|
171
172
|
name: 'digipair',
|
|
@@ -178,39 +179,40 @@ engine_1.config.set('ALIAS', [
|
|
|
178
179
|
},
|
|
179
180
|
},
|
|
180
181
|
]);
|
|
181
|
-
engine_1.config.set('LOGGER', (level,
|
|
182
|
+
engine_1.config.set('LOGGER', (level, logPath, message, context, data) => {
|
|
182
183
|
const time = new Date().toISOString();
|
|
184
|
+
const prefix = `[${time}][${context.request.digipair}@${context.request.reasoning}][${logPath}]`;
|
|
183
185
|
switch (level) {
|
|
184
186
|
case 'INFO':
|
|
185
|
-
console.log(
|
|
187
|
+
console.log(`${prefix} ${message}`);
|
|
186
188
|
break;
|
|
187
189
|
case 'ERROR':
|
|
188
|
-
console.error(
|
|
190
|
+
console.error(`${prefix} ${message}`, data);
|
|
189
191
|
break;
|
|
190
192
|
case 'DEBUG':
|
|
191
|
-
console.debug(
|
|
193
|
+
console.debug(`${prefix} ${message}`, data);
|
|
192
194
|
break;
|
|
193
195
|
default:
|
|
194
|
-
console.log(
|
|
196
|
+
console.log(`${prefix} ${message}`);
|
|
195
197
|
break;
|
|
196
198
|
}
|
|
197
199
|
});
|
|
198
200
|
let AppService = class AppService {
|
|
199
201
|
async onModuleInit() {
|
|
200
|
-
const
|
|
202
|
+
const basePath = process.env.DIGIPAIR_FACTORY_PATH
|
|
201
203
|
? `${process.env.DIGIPAIR_FACTORY_PATH}/digipairs`
|
|
202
204
|
: './factory/digipairs';
|
|
203
205
|
// initialize logs management
|
|
204
|
-
const skillLogger = __webpack_require__(
|
|
206
|
+
const skillLogger = __webpack_require__(12);
|
|
205
207
|
await skillLogger.initialize();
|
|
206
208
|
// initialize factory skill
|
|
207
|
-
const skillFactory = __webpack_require__(
|
|
208
|
-
skillFactory.initialize((context, digipair, reasoning, body) => this.agent(
|
|
209
|
+
const skillFactory = __webpack_require__(13);
|
|
210
|
+
skillFactory.initialize((context, digipair, reasoning, body) => this.agent(basePath, digipair, reasoning, body, [], {}, null, {}, context, context.protected.req, context.protected.res, context.protected.signal));
|
|
209
211
|
// start cron manager
|
|
210
212
|
try {
|
|
211
|
-
const skillCron = __webpack_require__(
|
|
213
|
+
const skillCron = __webpack_require__(14);
|
|
212
214
|
skillCron.initialize(async (path, digipair, reasoning, cronTime, cronId) => {
|
|
213
|
-
const skillProcess = __webpack_require__(
|
|
215
|
+
const skillProcess = __webpack_require__(15);
|
|
214
216
|
const { id, signal } = skillProcess.add(digipair, reasoning, null);
|
|
215
217
|
try {
|
|
216
218
|
await this.agent(path, digipair, reasoning, {}, [], {}, null, {}, { cronTime, cronId }, null, null, signal);
|
|
@@ -223,14 +225,14 @@ let AppService = class AppService {
|
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
});
|
|
226
|
-
skillCron.start(
|
|
228
|
+
skillCron.start(basePath);
|
|
227
229
|
}
|
|
228
230
|
catch (error) {
|
|
229
231
|
console.error(error);
|
|
230
232
|
}
|
|
231
233
|
// start workflow manager
|
|
232
234
|
try {
|
|
233
|
-
const skillTemporal = __webpack_require__(
|
|
235
|
+
const skillTemporal = __webpack_require__(16);
|
|
234
236
|
if (process.env.TEMPORAL_CLUSTER_HOST) {
|
|
235
237
|
skillTemporal.initialize();
|
|
236
238
|
}
|
|
@@ -239,24 +241,30 @@ let AppService = class AppService {
|
|
|
239
241
|
console.error(error);
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
|
-
async agent(
|
|
244
|
+
async agent(basePath, digipair, reasoning, body, params, query, method, headers, requester, req, res, signal, isHttpRequest = false) {
|
|
243
245
|
const assets = process.env.DIGIPAIR_FACTORY_PATH || './factory';
|
|
244
246
|
let context;
|
|
245
247
|
try {
|
|
248
|
+
// --- Load core configs ---
|
|
246
249
|
let content;
|
|
247
250
|
content = await fs_1.promises.readFile(`${assets}/default.json`, 'utf8');
|
|
248
251
|
const defaultConfig = JSON.parse(content);
|
|
249
|
-
content = await fs_1.promises.readFile(`${
|
|
252
|
+
content = await fs_1.promises.readFile(`${basePath}/common/config.json`, 'utf8');
|
|
250
253
|
const commonConfig = JSON.parse(content);
|
|
251
|
-
content = await fs_1.promises.readFile(`${
|
|
254
|
+
content = await fs_1.promises.readFile(`${basePath}/${digipair}/config.json`, 'utf8');
|
|
252
255
|
const config = JSON.parse(content);
|
|
256
|
+
// --- Merge all roles configs recursively ---
|
|
257
|
+
const roles = config?.roles ?? {};
|
|
258
|
+
const rolesMerged = await this.mergeRolesForAgent(basePath, roles);
|
|
259
|
+
// --- Build execution context ---
|
|
253
260
|
context = {
|
|
254
261
|
...requester,
|
|
255
262
|
config: {
|
|
256
|
-
VERSIONS: { ...defaultConfig.libraries, ...commonConfig.libraries, ...config.libraries },
|
|
263
|
+
VERSIONS: { ...defaultConfig.libraries, ...commonConfig.libraries, ...rolesMerged.libraries, ...config.libraries },
|
|
257
264
|
WEB_VERSIONS: {
|
|
258
265
|
...defaultConfig.webLibraries,
|
|
259
266
|
...commonConfig.webLibraries,
|
|
267
|
+
...rolesMerged.webLibraries,
|
|
260
268
|
...config.webLibraries,
|
|
261
269
|
},
|
|
262
270
|
},
|
|
@@ -264,12 +272,14 @@ let AppService = class AppService {
|
|
|
264
272
|
...requester.privates,
|
|
265
273
|
...defaultConfig.privates,
|
|
266
274
|
...commonConfig.privates,
|
|
275
|
+
...rolesMerged.privates,
|
|
267
276
|
...config.privates,
|
|
268
277
|
},
|
|
269
278
|
variables: {
|
|
270
279
|
...requester.variables,
|
|
271
280
|
...defaultConfig.variables,
|
|
272
281
|
...commonConfig.variables,
|
|
282
|
+
...rolesMerged.variables,
|
|
273
283
|
...config.variables,
|
|
274
284
|
},
|
|
275
285
|
request: {
|
|
@@ -288,28 +298,33 @@ let AppService = class AppService {
|
|
|
288
298
|
},
|
|
289
299
|
requester,
|
|
290
300
|
};
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
301
|
+
// --- Reasoning lookup ---
|
|
302
|
+
// 1. agent-specific reasoning
|
|
303
|
+
content = await this.tryRead(path.join(basePath, digipair, `${reasoning}.json`));
|
|
304
|
+
// 2. inherited roles (deep search)
|
|
305
|
+
content ||= await (async () => {
|
|
306
|
+
const rolePath = await this.findFileInRoles(basePath, roles, `${reasoning}.json`);
|
|
307
|
+
return rolePath ? this.tryRead(rolePath) : null;
|
|
308
|
+
})();
|
|
309
|
+
// 3. common reasoning
|
|
310
|
+
content ||= await this.tryRead(path.join(basePath, 'common', `${reasoning}.json`));
|
|
311
|
+
// 4. digipair fallback
|
|
312
|
+
content ||= await this.tryRead(path.join(basePath, digipair, 'fallback.json'));
|
|
313
|
+
// 5. fallback via inherited roles (deep search)
|
|
314
|
+
content ||= await (async () => {
|
|
315
|
+
const fb = await this.findFileInRoles(basePath, roles, 'fallback.json');
|
|
316
|
+
return fb ? this.tryRead(fb) : null;
|
|
317
|
+
})();
|
|
318
|
+
// 6. final fallback
|
|
319
|
+
content ||= await this.tryRead(path.join(basePath, 'common', 'fallback.json'));
|
|
320
|
+
if (!content) {
|
|
304
321
|
res.status(404);
|
|
305
322
|
return { status: 'not found' };
|
|
306
323
|
}
|
|
324
|
+
// --- Parse and execute reasoning ---
|
|
307
325
|
const settings = JSON.parse(content);
|
|
308
|
-
if (isHttpRequest
|
|
309
|
-
|
|
310
|
-
settings.element !== 'service' &&
|
|
311
|
-
settings.element !== 'event' &&
|
|
312
|
-
settings.element !== 'boost') {
|
|
326
|
+
if (isHttpRequest &&
|
|
327
|
+
!['page', 'service', 'event', 'boost'].includes(settings.element)) {
|
|
313
328
|
// for external calls, only 'page' and 'service' elements are allowed
|
|
314
329
|
res.status(400);
|
|
315
330
|
return { status: 'bad request' };
|
|
@@ -328,10 +343,85 @@ let AppService = class AppService {
|
|
|
328
343
|
if (!context) {
|
|
329
344
|
return;
|
|
330
345
|
}
|
|
331
|
-
const skillLogger = __webpack_require__(
|
|
346
|
+
const skillLogger = __webpack_require__(12);
|
|
332
347
|
skillLogger.addLog(context, 'ERROR', error.message);
|
|
333
348
|
}
|
|
334
349
|
}
|
|
350
|
+
// --- UTILITIES ---
|
|
351
|
+
async tryRead(path) {
|
|
352
|
+
if (path && (0, fs_1.existsSync)(path)) {
|
|
353
|
+
return fs_1.promises.readFile(path, 'utf8');
|
|
354
|
+
}
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
/** Recursively load a role config and its inherited roles */
|
|
358
|
+
async loadRoleConfig(rolePath, roleName, version = 'latest', visited = new Set()) {
|
|
359
|
+
const roleFile = path.join(rolePath, roleName, 'config.json');
|
|
360
|
+
if (!((0, fs_1.existsSync)(roleFile)))
|
|
361
|
+
return {};
|
|
362
|
+
if (visited.has(roleName)) {
|
|
363
|
+
console.debug(`Circular role reference detected: ${roleName}`);
|
|
364
|
+
return {};
|
|
365
|
+
}
|
|
366
|
+
visited.add(roleName);
|
|
367
|
+
const content = await fs_1.promises.readFile(roleFile, 'utf8');
|
|
368
|
+
const config = JSON.parse(content);
|
|
369
|
+
let mergedConfig = {};
|
|
370
|
+
// Recursively merge inherited roles first (their settings can be overridden by this role)
|
|
371
|
+
const entries = Object.entries(config?.roles ?? {});
|
|
372
|
+
for (const [subRoleName, subVersion] of entries) {
|
|
373
|
+
const subConfig = await this.loadRoleConfig(rolePath, subRoleName, subVersion, visited);
|
|
374
|
+
mergedConfig = this.mergeConfigs(mergedConfig, subConfig);
|
|
375
|
+
}
|
|
376
|
+
// Merge current role last (highest priority)
|
|
377
|
+
mergedConfig = this.mergeConfigs(mergedConfig, config);
|
|
378
|
+
return mergedConfig;
|
|
379
|
+
}
|
|
380
|
+
/** Merge role configuration objects */
|
|
381
|
+
mergeConfigs(base, override) {
|
|
382
|
+
return {
|
|
383
|
+
...base,
|
|
384
|
+
...override,
|
|
385
|
+
variables: { ...(base.variables ?? {}), ...(override.variables ?? {}) },
|
|
386
|
+
privates: { ...(base.privates ?? {}), ...(override.privates ?? {}) },
|
|
387
|
+
libraries: { ...(base.libraries ?? {}), ...(override.libraries ?? {}) },
|
|
388
|
+
webLibraries: { ...(base.webLibraries ?? {}), ...(override.webLibraries ?? {}) },
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
/** Merge all roles for a given agent */
|
|
392
|
+
async mergeRolesForAgent(basePath, roles) {
|
|
393
|
+
let merged = {};
|
|
394
|
+
const entries = Object.entries(roles);
|
|
395
|
+
for (const [roleName, version] of entries) {
|
|
396
|
+
const roleConfig = await this.loadRoleConfig(basePath, roleName, version);
|
|
397
|
+
merged = this.mergeConfigs(merged, roleConfig);
|
|
398
|
+
}
|
|
399
|
+
return merged;
|
|
400
|
+
}
|
|
401
|
+
/** Recursively find file, ie reasoning/fallback JSON, in roles or their parents */
|
|
402
|
+
async findFileInRoles(basePath, roles, targetFile, depth = Infinity, priorityLast = true) {
|
|
403
|
+
let entries = Object.entries(roles);
|
|
404
|
+
if (priorityLast)
|
|
405
|
+
entries = entries.reverse();
|
|
406
|
+
for (const [roleName] of entries) {
|
|
407
|
+
const rolePath = path.join(basePath, roleName);
|
|
408
|
+
const filePath = path.join(rolePath, targetFile);
|
|
409
|
+
if ((0, fs_1.existsSync)(filePath)) {
|
|
410
|
+
// console.debug(`[FIND] Found ${targetFile} in role: ${roleName}`);
|
|
411
|
+
return filePath;
|
|
412
|
+
}
|
|
413
|
+
if (depth > 1) {
|
|
414
|
+
const configFile = path.join(rolePath, 'config.json');
|
|
415
|
+
if ((0, fs_1.existsSync)(configFile)) {
|
|
416
|
+
const config = JSON.parse(await fs_1.promises.readFile(configFile, 'utf8'));
|
|
417
|
+
const found = await this.findFileInRoles(basePath, config.roles ?? {}, targetFile, depth === Infinity ? Infinity : depth - 1, priorityLast);
|
|
418
|
+
if (found)
|
|
419
|
+
return found;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return null;
|
|
424
|
+
}
|
|
335
425
|
};
|
|
336
426
|
exports.AppService = AppService;
|
|
337
427
|
exports.AppService = AppService = tslib_1.__decorate([
|
|
@@ -349,37 +439,37 @@ module.exports = require("@digipair/engine");
|
|
|
349
439
|
/* 11 */
|
|
350
440
|
/***/ ((module) => {
|
|
351
441
|
|
|
352
|
-
module.exports = require("
|
|
442
|
+
module.exports = require("path");
|
|
353
443
|
|
|
354
444
|
/***/ }),
|
|
355
445
|
/* 12 */
|
|
356
446
|
/***/ ((module) => {
|
|
357
447
|
|
|
358
|
-
module.exports = require("@digipair/skill-
|
|
448
|
+
module.exports = require("@digipair/skill-logger");
|
|
359
449
|
|
|
360
450
|
/***/ }),
|
|
361
451
|
/* 13 */
|
|
362
452
|
/***/ ((module) => {
|
|
363
453
|
|
|
364
|
-
module.exports = require("@digipair/skill-
|
|
454
|
+
module.exports = require("@digipair/skill-factory");
|
|
365
455
|
|
|
366
456
|
/***/ }),
|
|
367
457
|
/* 14 */
|
|
368
458
|
/***/ ((module) => {
|
|
369
459
|
|
|
370
|
-
module.exports = require("@digipair/skill-
|
|
460
|
+
module.exports = require("@digipair/skill-cron");
|
|
371
461
|
|
|
372
462
|
/***/ }),
|
|
373
463
|
/* 15 */
|
|
374
464
|
/***/ ((module) => {
|
|
375
465
|
|
|
376
|
-
module.exports = require("@digipair/skill-
|
|
466
|
+
module.exports = require("@digipair/skill-process");
|
|
377
467
|
|
|
378
468
|
/***/ }),
|
|
379
469
|
/* 16 */
|
|
380
470
|
/***/ ((module) => {
|
|
381
471
|
|
|
382
|
-
module.exports = require("
|
|
472
|
+
module.exports = require("@digipair/skill-temporal");
|
|
383
473
|
|
|
384
474
|
/***/ })
|
|
385
475
|
/******/ ]);
|
|
@@ -425,7 +515,7 @@ const core_1 = __webpack_require__(3);
|
|
|
425
515
|
const bodyParser = tslib_1.__importStar(__webpack_require__(4));
|
|
426
516
|
const app_module_1 = __webpack_require__(5);
|
|
427
517
|
const fs_1 = __webpack_require__(8);
|
|
428
|
-
const path_1 = tslib_1.__importDefault(__webpack_require__(
|
|
518
|
+
const path_1 = tslib_1.__importDefault(__webpack_require__(11));
|
|
429
519
|
function copyDirectoryRecursive(source, target) {
|
|
430
520
|
if (!(0, fs_1.existsSync)(source)) {
|
|
431
521
|
common_1.Logger.error(`The source directory "${source}" doesn't exist.`);
|
package/package.json
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "digipair",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"bin": {
|
|
6
6
|
"digipair": "./bin/digipair.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@digipair/engine": "0.
|
|
10
|
-
"@digipair/skill-basic": "0.
|
|
11
|
-
"@digipair/skill-canvas": "0.
|
|
12
|
-
"@digipair/skill-chatbot": "0.
|
|
13
|
-
"@digipair/skill-client-mcp": "0.
|
|
14
|
-
"@digipair/skill-codex": "0.
|
|
15
|
-
"@digipair/skill-common": "0.
|
|
16
|
-
"@digipair/skill-cron": "0.
|
|
17
|
-
"@digipair/skill-debug": "0.
|
|
18
|
-
"@digipair/skill-dsp": "0.
|
|
19
|
-
"@digipair/skill-editor": "0.
|
|
20
|
-
"@digipair/skill-factory": "0.
|
|
21
|
-
"@digipair/skill-http": "0.
|
|
22
|
-
"@digipair/skill-imap": "0.
|
|
23
|
-
"@digipair/skill-llm": "0.
|
|
24
|
-
"@digipair/skill-logger": "0.
|
|
25
|
-
"@digipair/skill-mcp": "0.
|
|
26
|
-
"@digipair/skill-oauth2": "0.
|
|
27
|
-
"@digipair/skill-openai": "0.
|
|
28
|
-
"@digipair/skill-process": "0.
|
|
29
|
-
"@digipair/skill-sendmail": "0.
|
|
30
|
-
"@digipair/skill-service": "0.
|
|
31
|
-
"@digipair/skill-sse": "0.
|
|
32
|
-
"@digipair/skill-temporal": "0.
|
|
33
|
-
"@digipair/skill-tool": "0.
|
|
34
|
-
"@digipair/skill-web": "0.
|
|
35
|
-
"@digipair/skill-web-chatbot": "0.
|
|
36
|
-
"@digipair/skill-web-debug": "0.
|
|
37
|
-
"@digipair/skill-web-editor": "0.
|
|
38
|
-
"@digipair/skill-web-font-awesome": "0.
|
|
39
|
-
"@digipair/skill-web-inputs": "0.
|
|
40
|
-
"@digipair/skill-web-interact": "0.
|
|
41
|
-
"@digipair/skill-web-jsoneditor": "0.
|
|
42
|
-
"@digipair/skill-web-notification": "0.
|
|
43
|
-
"@digipair/skill-web-spectrum": "0.
|
|
44
|
-
"@digipair/skill-worker": "0.
|
|
45
|
-
"@digipair/skill-yaml": "0.
|
|
9
|
+
"@digipair/engine": "0.117.0",
|
|
10
|
+
"@digipair/skill-basic": "0.117.0",
|
|
11
|
+
"@digipair/skill-canvas": "0.117.0",
|
|
12
|
+
"@digipair/skill-chatbot": "0.117.0",
|
|
13
|
+
"@digipair/skill-client-mcp": "0.117.0",
|
|
14
|
+
"@digipair/skill-codex": "0.117.0",
|
|
15
|
+
"@digipair/skill-common": "0.117.0",
|
|
16
|
+
"@digipair/skill-cron": "0.117.0",
|
|
17
|
+
"@digipair/skill-debug": "0.117.0",
|
|
18
|
+
"@digipair/skill-dsp": "0.117.0",
|
|
19
|
+
"@digipair/skill-editor": "0.117.0",
|
|
20
|
+
"@digipair/skill-factory": "0.117.0",
|
|
21
|
+
"@digipair/skill-http": "0.117.0",
|
|
22
|
+
"@digipair/skill-imap": "0.117.0",
|
|
23
|
+
"@digipair/skill-llm": "0.117.0",
|
|
24
|
+
"@digipair/skill-logger": "0.117.0",
|
|
25
|
+
"@digipair/skill-mcp": "0.117.0",
|
|
26
|
+
"@digipair/skill-oauth2": "0.117.0",
|
|
27
|
+
"@digipair/skill-openai": "0.117.0",
|
|
28
|
+
"@digipair/skill-process": "0.117.0",
|
|
29
|
+
"@digipair/skill-sendmail": "0.117.0",
|
|
30
|
+
"@digipair/skill-service": "0.117.0",
|
|
31
|
+
"@digipair/skill-sse": "0.117.0",
|
|
32
|
+
"@digipair/skill-temporal": "0.117.0",
|
|
33
|
+
"@digipair/skill-tool": "0.117.0",
|
|
34
|
+
"@digipair/skill-web": "0.117.0",
|
|
35
|
+
"@digipair/skill-web-chatbot": "0.117.0",
|
|
36
|
+
"@digipair/skill-web-debug": "0.117.0",
|
|
37
|
+
"@digipair/skill-web-editor": "0.117.0",
|
|
38
|
+
"@digipair/skill-web-font-awesome": "0.117.0",
|
|
39
|
+
"@digipair/skill-web-inputs": "0.117.0",
|
|
40
|
+
"@digipair/skill-web-interact": "0.117.0",
|
|
41
|
+
"@digipair/skill-web-jsoneditor": "0.117.0",
|
|
42
|
+
"@digipair/skill-web-notification": "0.117.0",
|
|
43
|
+
"@digipair/skill-web-spectrum": "0.117.0",
|
|
44
|
+
"@digipair/skill-worker": "0.117.0",
|
|
45
|
+
"@digipair/skill-yaml": "0.117.0",
|
|
46
46
|
"@nestjs/common": "^10.3.9",
|
|
47
47
|
"@nestjs/core": "^10.3.9",
|
|
48
48
|
"@nestjs/platform-express": "^10.3.9",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "role openApi apiKey",
|
|
3
|
+
"description": "openApi apiKey default role",
|
|
4
|
+
"metadata": {
|
|
5
|
+
},
|
|
6
|
+
"libraries": {
|
|
7
|
+
"@digipair/skill-service": "latest",
|
|
8
|
+
"@digipair/skill-chatbot": "latest",
|
|
9
|
+
"@digipair/skill-dsp": "latest",
|
|
10
|
+
"@digipair/skill-web": "latest",
|
|
11
|
+
"@digipair/skill-basic": "latest",
|
|
12
|
+
"@digipair/skill-http": "latest",
|
|
13
|
+
"@digipair/skill-factory": "latest",
|
|
14
|
+
"@digipair/skill-debug": "latest",
|
|
15
|
+
"@digipair/skill-web-debug": "latest",
|
|
16
|
+
"@digipair/skill-web-chatbot": "latest",
|
|
17
|
+
"@digipair/skill-web-inputs": "latest",
|
|
18
|
+
"@digipair/skill-web-interact": "latest"
|
|
19
|
+
},
|
|
20
|
+
"variables": {},
|
|
21
|
+
"privates": {
|
|
22
|
+
},
|
|
23
|
+
"digipair": "role-openapi-apikey",
|
|
24
|
+
"id": "role-openapi-apikey"
|
|
25
|
+
}
|
package/src/app/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/conversation.json
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Generating a response for the user via the chatbot.",
|
|
3
|
-
"summary": "Conversation",
|
|
3
|
+
"summary": "Conversation générique openApi-apiKey",
|
|
4
4
|
"library": "@digipair/skill-chatbot",
|
|
5
5
|
"element": "boost",
|
|
6
6
|
"metadata": {
|
|
@@ -27,37 +27,43 @@
|
|
|
27
27
|
"properties": {
|
|
28
28
|
"signature": "\"You are a helpful assistant, capable of explaining concepts in a simple manner.\" \nuserQuestion:string,\nhistory?:string[] ->\n answer: string \"Assistant answer\"",
|
|
29
29
|
"input": {
|
|
30
|
-
"userQuestion": "
|
|
30
|
+
"userQuestion": "FEEL:request.body.prompt",
|
|
31
31
|
"history": "FEEL:variables.history"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"library": "digipair
|
|
37
|
-
"element": "
|
|
36
|
+
"library": "@digipair/skill-factory",
|
|
37
|
+
"element": "start",
|
|
38
38
|
"properties": {
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
39
|
+
"digipair": "FEEL:request.digipair",
|
|
40
|
+
"reasoning": "answer",
|
|
41
|
+
"body": {
|
|
42
|
+
"assistant": "FEEL:previous.answer",
|
|
43
|
+
"boost": [
|
|
44
|
+
{
|
|
45
|
+
"prompt": true,
|
|
46
|
+
"required": true,
|
|
47
|
+
"step": "Conversation",
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"library": "@digipair/skill-web-inputs",
|
|
51
|
+
"element": "digipair-input-hidden",
|
|
52
|
+
"properties": {
|
|
53
|
+
"value": "FEEL:flatten([variables.history, [\n \"user: \" + request.body.prompt,\n \"assistant: \" + parent.previous.answer\n]])"
|
|
54
|
+
}
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"conditions": {},
|
|
62
|
+
"name": "digipair"
|
|
57
63
|
}
|
|
58
64
|
]
|
|
59
65
|
}
|
|
60
66
|
]
|
|
61
67
|
},
|
|
62
68
|
"pins": []
|
|
63
|
-
}
|
|
69
|
+
}
|
package/src/app/assets/{templates/openapi-apikey → digipairs/role-openapi-apikey}/fallback.json
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"description": "Mécanisme d'appel d'une API",
|
|
3
|
-
"summary": "Fallback",
|
|
3
|
+
"summary": "Fallback générique openApi-apiKey",
|
|
4
4
|
"library": "@digipair/skill-factory",
|
|
5
5
|
"element": "task",
|
|
6
6
|
"metadata": {},
|
|
@@ -13,9 +13,15 @@
|
|
|
13
13
|
"name": "openapi",
|
|
14
14
|
"execute": [
|
|
15
15
|
{
|
|
16
|
-
"library": "digipair
|
|
17
|
-
"element": "
|
|
18
|
-
"properties": {
|
|
16
|
+
"library": "@digipair/skill-factory",
|
|
17
|
+
"element": "start",
|
|
18
|
+
"properties": {
|
|
19
|
+
"digipair": "FEEL:request.digipair",
|
|
20
|
+
"reasoning": "openapi",
|
|
21
|
+
"body": {}
|
|
22
|
+
},
|
|
23
|
+
"conditions": {},
|
|
24
|
+
"name": "digipair"
|
|
19
25
|
}
|
|
20
26
|
]
|
|
21
27
|
}
|
|
@@ -166,7 +172,9 @@
|
|
|
166
172
|
{
|
|
167
173
|
"library": "@digipair/skill-basic",
|
|
168
174
|
"element": "transform",
|
|
169
|
-
"properties": {
|
|
175
|
+
"properties": {
|
|
176
|
+
"value": "FEEL:item"
|
|
177
|
+
}
|
|
170
178
|
},
|
|
171
179
|
{
|
|
172
180
|
"library": "@digipair/skill-basic",
|
|
@@ -185,7 +193,9 @@
|
|
|
185
193
|
}
|
|
186
194
|
]
|
|
187
195
|
},
|
|
188
|
-
"conditions": {
|
|
196
|
+
"conditions": {
|
|
197
|
+
"each": "FEEL:variables.parametersPath"
|
|
198
|
+
}
|
|
189
199
|
},
|
|
190
200
|
{
|
|
191
201
|
"library": "@digipair/skill-basic",
|
|
@@ -231,7 +241,10 @@
|
|
|
231
241
|
{
|
|
232
242
|
"library": "@digipair/skill-basic",
|
|
233
243
|
"element": "setVariable",
|
|
234
|
-
"properties": {
|
|
244
|
+
"properties": {
|
|
245
|
+
"name": "body",
|
|
246
|
+
"value": "FEEL:request.body.body"
|
|
247
|
+
},
|
|
235
248
|
"conditions": {
|
|
236
249
|
"if": "FEEL:variables.infos.value[item.key = variables.method].value.requestBody[1] != null"
|
|
237
250
|
}
|