@digipair/skill-worker 0.115.1 → 0.116.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/dist/index.cjs.js CHANGED
@@ -43,15 +43,26 @@ let WorkerService = class WorkerService {
43
43
  files
44
44
  };
45
45
  }
46
+ async execute(params, _pinsSettingsList, _context) {
47
+ const { execute, context = {} } = params;
48
+ const result = await engine.executePinsList(execute, {
49
+ ...context,
50
+ ..._context,
51
+ request: _context.requester?.request ?? _context.request
52
+ }, `${context.__PATH__}.execute`);
53
+ return result;
54
+ }
46
55
  };
47
56
  const task = (params, pinsSettingsList, context)=>new WorkerService().task(params, pinsSettingsList, context);
48
57
  const action = (params, pinsSettingsList, context)=>new WorkerService().action(params, pinsSettingsList, context);
49
58
  const activity = (params, pinsSettingsList, context)=>new WorkerService().activity(params, pinsSettingsList, context);
50
59
  const stop = (params, pinsSettingsList, context)=>new WorkerService().stop(params, pinsSettingsList, context);
51
60
  const answer = (params, pinsSettingsList, context)=>new WorkerService().answer(params, pinsSettingsList, context);
61
+ const execute = (params, pinsSettingsList, context)=>new WorkerService().execute(params, pinsSettingsList, context);
52
62
 
53
63
  exports.action = action;
54
64
  exports.activity = activity;
55
65
  exports.answer = answer;
66
+ exports.execute = execute;
56
67
  exports.stop = stop;
57
68
  exports.task = task;
package/dist/index.esm.js CHANGED
@@ -22838,14 +22838,14 @@ function indent(str, spaces) {
22838
22838
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
22839
22839
  // match is required
22840
22840
  if (!match) {
22841
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
22841
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
22842
22842
  v: nextMatch1
22843
22843
  };
22844
22844
  }
22845
22845
  var token = match.token, offset = match.offset;
22846
22846
  i1 += offset;
22847
22847
  if (token === ' ') {
22848
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22848
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22849
22849
  }
22850
22850
  tokens1 = _to_consumable_array$4(tokens1).concat([
22851
22851
  token
@@ -22864,7 +22864,7 @@ function indent(str, spaces) {
22864
22864
  if (contextKeys.some(function(el) {
22865
22865
  return el.startsWith(name);
22866
22866
  })) {
22867
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22867
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22868
22868
  }
22869
22869
  if (dateTimeIdentifiers.some(function(el) {
22870
22870
  return el === name;
@@ -22883,9 +22883,9 @@ function indent(str, spaces) {
22883
22883
  if (dateTimeIdentifiers.some(function(el) {
22884
22884
  return el.startsWith(name);
22885
22885
  })) {
22886
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
22886
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
22887
22887
  }
22888
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
22888
+ return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
22889
22889
  v: nextMatch1
22890
22890
  };
22891
22891
  };
@@ -44416,11 +44416,21 @@ let WorkerService = class WorkerService {
44416
44416
  files
44417
44417
  };
44418
44418
  }
44419
+ async execute(params, _pinsSettingsList, _context) {
44420
+ const { execute, context = {} } = params;
44421
+ const result = await executePinsList(execute, {
44422
+ ...context,
44423
+ ..._context,
44424
+ request: _context.requester?.request ?? _context.request
44425
+ }, `${context.__PATH__}.execute`);
44426
+ return result;
44427
+ }
44419
44428
  };
44420
44429
  const task = (params, pinsSettingsList, context)=>new WorkerService().task(params, pinsSettingsList, context);
44421
44430
  const action = (params, pinsSettingsList, context)=>new WorkerService().action(params, pinsSettingsList, context);
44422
44431
  const activity = (params, pinsSettingsList, context)=>new WorkerService().activity(params, pinsSettingsList, context);
44423
44432
  const stop = (params, pinsSettingsList, context)=>new WorkerService().stop(params, pinsSettingsList, context);
44424
44433
  const answer = (params, pinsSettingsList, context)=>new WorkerService().answer(params, pinsSettingsList, context);
44434
+ const execute = (params, pinsSettingsList, context)=>new WorkerService().execute(params, pinsSettingsList, context);
44425
44435
 
44426
- export { action, activity, answer, stop, task };
44436
+ export { action, activity, answer, execute, stop, task };
@@ -10,9 +10,7 @@
10
10
  "paths": {
11
11
  "/activity": {
12
12
  "post": {
13
- "tags": [
14
- "service"
15
- ],
13
+ "tags": ["service"],
16
14
  "summary": "Activité",
17
15
  "description": "Exécute une activité.",
18
16
  "parameters": [
@@ -56,9 +54,7 @@
56
54
  },
57
55
  "/stop": {
58
56
  "post": {
59
- "tags": [
60
- "service"
61
- ],
57
+ "tags": ["service"],
62
58
  "summary": "Stop",
63
59
  "description": "Stop le raisonnement",
64
60
  "parameters": [
@@ -89,9 +85,7 @@
89
85
  },
90
86
  "/answer": {
91
87
  "post": {
92
- "tags": [
93
- "service"
94
- ],
88
+ "tags": ["service"],
95
89
  "summary": "Répondre",
96
90
  "description": "Fournit une réponse de l'agent.",
97
91
  "parameters": [
@@ -187,9 +181,51 @@
187
181
  }
188
182
  }
189
183
  },
190
- "required": [
191
- "content"
192
- ]
184
+ "required": ["content"]
185
+ }
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "x-events": []
191
+ }
192
+ },
193
+ "/execute": {
194
+ "post": {
195
+ "tags": ["service"],
196
+ "summary": "Execute avec un contexte",
197
+ "description": "Execute des Pin's avec un contexte donné",
198
+ "parameters": [
199
+ {
200
+ "name": "execute",
201
+ "required": true,
202
+ "summary": "Actions à exécuter",
203
+ "description": "Actions à exécuter",
204
+ "schema": {
205
+ "type": "array",
206
+ "items": {
207
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
208
+ }
209
+ }
210
+ },
211
+ {
212
+ "name": "context",
213
+ "required": false,
214
+ "summary": "Contexte",
215
+ "description": "Contexte d'exécution",
216
+ "schema": {
217
+ "type": "object"
218
+ }
219
+ }
220
+ ],
221
+ "responses": {
222
+ "200": {
223
+ "description": "Résultat des commandes exécutées avec le contexte donné",
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "description": "Résultat d'executePinsList - type dynamique basé sur les commandes exécutées",
228
+ "additionalProperties": true
193
229
  }
194
230
  }
195
231
  }
@@ -203,9 +239,7 @@
203
239
  "/task": {
204
240
  "summary": "Tache",
205
241
  "description": "Exécution d'une tache.",
206
- "tags": [
207
- "service"
208
- ],
242
+ "tags": ["service"],
209
243
  "metadata": [],
210
244
  "parameters": [
211
245
  {
@@ -225,9 +259,7 @@
225
259
  "/action": {
226
260
  "summary": "Action",
227
261
  "description": "Action exécutable.",
228
- "tags": [
229
- "service"
230
- ],
262
+ "tags": ["service"],
231
263
  "metadata": [
232
264
  {
233
265
  "name": "parameters",
@@ -292,9 +324,7 @@
292
324
  "schemas": {
293
325
  "Parameter": {
294
326
  "type": "object",
295
- "tags": [
296
- "service"
297
- ],
327
+ "tags": ["service"],
298
328
  "summary": "Parameter",
299
329
  "properties": {
300
330
  "name": {
@@ -322,18 +352,11 @@
322
352
  "type": "string"
323
353
  }
324
354
  },
325
- "required": [
326
- "name",
327
- "summary",
328
- "required",
329
- "schema"
330
- ]
355
+ "required": ["name", "summary", "required", "schema"]
331
356
  },
332
357
  "File": {
333
358
  "type": "object",
334
- "tags": [
335
- "service"
336
- ],
359
+ "tags": ["service"],
337
360
  "summary": "File",
338
361
  "properties": {
339
362
  "filename": {
@@ -352,9 +375,7 @@
352
375
  },
353
376
  "Prompt": {
354
377
  "type": "object",
355
- "tags": [
356
- "service"
357
- ],
378
+ "tags": ["service"],
358
379
  "summary": "Prompt",
359
380
  "properties": {
360
381
  "title": {
@@ -378,13 +399,8 @@
378
399
  "summary": "Tags"
379
400
  }
380
401
  },
381
- "required": [
382
- "title",
383
- "prompt",
384
- "icon",
385
- "tags"
386
- ]
402
+ "required": ["title", "prompt", "icon", "tags"]
387
403
  }
388
404
  }
389
405
  }
390
- }
406
+ }
package/dist/schema.json CHANGED
@@ -10,9 +10,7 @@
10
10
  "paths": {
11
11
  "/activity": {
12
12
  "post": {
13
- "tags": [
14
- "service"
15
- ],
13
+ "tags": ["service"],
16
14
  "summary": "Activity",
17
15
  "description": "Execution of an activity.",
18
16
  "parameters": [
@@ -56,9 +54,7 @@
56
54
  },
57
55
  "/stop": {
58
56
  "post": {
59
- "tags": [
60
- "service"
61
- ],
57
+ "tags": ["service"],
62
58
  "summary": "Stop",
63
59
  "description": "Stop the reasoning",
64
60
  "parameters": [
@@ -89,9 +85,7 @@
89
85
  },
90
86
  "/answer": {
91
87
  "post": {
92
- "tags": [
93
- "service"
94
- ],
88
+ "tags": ["service"],
95
89
  "summary": "Answer",
96
90
  "description": "Provide an answer from the agent with content, assistant details, sources, and agent history.",
97
91
  "parameters": [
@@ -187,9 +181,51 @@
187
181
  }
188
182
  }
189
183
  },
190
- "required": [
191
- "content"
192
- ]
184
+ "required": ["content"]
185
+ }
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "x-events": []
191
+ }
192
+ },
193
+ "/execute": {
194
+ "post": {
195
+ "tags": ["service"],
196
+ "summary": "Execute with context",
197
+ "description": "Execute a Pin's with a given context",
198
+ "parameters": [
199
+ {
200
+ "name": "execute",
201
+ "required": true,
202
+ "summary": "Actions to execute",
203
+ "description": "Actions to execute",
204
+ "schema": {
205
+ "type": "array",
206
+ "items": {
207
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
208
+ }
209
+ }
210
+ },
211
+ {
212
+ "name": "context",
213
+ "required": false,
214
+ "summary": "Context",
215
+ "description": "Context of the execution",
216
+ "schema": {
217
+ "type": "object"
218
+ }
219
+ }
220
+ ],
221
+ "responses": {
222
+ "200": {
223
+ "description": "Result of executed commands with given context",
224
+ "content": {
225
+ "application/json": {
226
+ "schema": {
227
+ "description": "Result from executePinsList - dynamic type based on executed commands",
228
+ "additionalProperties": true
193
229
  }
194
230
  }
195
231
  }
@@ -203,9 +239,7 @@
203
239
  "schemas": {
204
240
  "Parameter": {
205
241
  "type": "object",
206
- "tags": [
207
- "service"
208
- ],
242
+ "tags": ["service"],
209
243
  "summary": "Parameter",
210
244
  "properties": {
211
245
  "name": {
@@ -233,18 +267,11 @@
233
267
  "type": "string"
234
268
  }
235
269
  },
236
- "required": [
237
- "name",
238
- "summary",
239
- "required",
240
- "schema"
241
- ]
270
+ "required": ["name", "summary", "required", "schema"]
242
271
  },
243
272
  "File": {
244
273
  "type": "object",
245
- "tags": [
246
- "service"
247
- ],
274
+ "tags": ["service"],
248
275
  "summary": "File",
249
276
  "properties": {
250
277
  "filename": {
@@ -263,9 +290,7 @@
263
290
  },
264
291
  "Prompt": {
265
292
  "type": "object",
266
- "tags": [
267
- "service"
268
- ],
293
+ "tags": ["service"],
269
294
  "summary": "Prompt",
270
295
  "properties": {
271
296
  "title": {
@@ -289,12 +314,7 @@
289
314
  "summary": "Tags"
290
315
  }
291
316
  },
292
- "required": [
293
- "title",
294
- "prompt",
295
- "icon",
296
- "tags"
297
- ]
317
+ "required": ["title", "prompt", "icon", "tags"]
298
318
  }
299
319
  }
300
320
  },
@@ -302,9 +322,7 @@
302
322
  "/task": {
303
323
  "summary": "Task",
304
324
  "description": "Execution of a task.",
305
- "tags": [
306
- "service"
307
- ],
325
+ "tags": ["service"],
308
326
  "metadata": [],
309
327
  "parameters": [
310
328
  {
@@ -324,9 +342,7 @@
324
342
  "/action": {
325
343
  "summary": "Action",
326
344
  "description": "Executable action.",
327
- "tags": [
328
- "service"
329
- ],
345
+ "tags": ["service"],
330
346
  "metadata": [
331
347
  {
332
348
  "name": "parameters",
@@ -387,4 +403,4 @@
387
403
  ]
388
404
  }
389
405
  }
390
- }
406
+ }
@@ -4,4 +4,5 @@ export declare const action: (params: any, pinsSettingsList: PinsSettings[], con
4
4
  export declare const activity: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
5
5
  export declare const stop: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
6
6
  export declare const answer: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
7
+ export declare const execute: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
7
8
  //# sourceMappingURL=skill-worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill-worker.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAmDjE,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAE9D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAEhE,eAAO,MAAM,QAAQ,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAElE,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAE9D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC"}
1
+ {"version":3,"file":"skill-worker.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAkEjE,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAE9D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAEhE,eAAO,MAAM,QAAQ,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAElE,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAE9D,eAAO,MAAM,MAAM,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC;AAEhE,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACnB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-worker",
3
- "version": "0.115.1",
3
+ "version": "0.116.0",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",