@applica-software-guru/persona-sdk 0.1.101 → 0.1.103

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/bundle.es.js CHANGED
@@ -1,12 +1,12 @@
1
- var d = Object.defineProperty;
2
- var y = (o, t, e) => t in o ? d(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
- var u = (o, t, e) => y(o, typeof t != "symbol" ? t + "" : t, e);
1
+ var g = Object.defineProperty;
2
+ var y = (o, t, s) => t in o ? g(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
3
+ var u = (o, t, s) => y(o, typeof t != "symbol" ? t + "" : t, s);
4
4
  class l extends Error {
5
- constructor(e, s) {
6
- super(`API Error: ${e} - ${s}`);
5
+ constructor(s, e) {
6
+ super(`API Error: ${s} - ${e}`);
7
7
  u(this, "statusCode");
8
8
  u(this, "body");
9
- this.statusCode = e, this.body = s;
9
+ this.statusCode = s, this.body = e;
10
10
  }
11
11
  }
12
12
  class m {
@@ -21,10 +21,10 @@ class m {
21
21
  }
22
22
  }
23
23
  class c {
24
- constructor(t, e) {
24
+ constructor(t, s) {
25
25
  u(this, "baseUrl");
26
26
  u(this, "authProvider");
27
- this.baseUrl = t, this.authProvider = typeof e == "string" ? new m(e) : e;
27
+ this.baseUrl = t, this.authProvider = typeof s == "string" ? new m(s) : s;
28
28
  }
29
29
  getBaseUrl() {
30
30
  return this.baseUrl;
@@ -32,117 +32,117 @@ class c {
32
32
  getAuthProvider() {
33
33
  return this.authProvider;
34
34
  }
35
- normalizePageParams(t, e) {
35
+ normalizePageParams(t, s) {
36
36
  return {
37
37
  page: t === void 0 || t < 1 ? 1 : t,
38
- size: e === void 0 || e < 1 ? 20 : e
38
+ size: s === void 0 || s < 1 ? 20 : s
39
39
  };
40
40
  }
41
41
  buildHeaders() {
42
42
  const t = new Headers();
43
43
  return t.set("Content-Type", "application/json"), this.authProvider.applyHeaders(t), t;
44
44
  }
45
- buildUrl(t, e) {
46
- const s = new URL(this.baseUrl + t);
47
- return e && Object.entries(e).forEach(([r, n]) => {
48
- n != null && s.searchParams.set(r, String(n));
49
- }), s.toString();
45
+ buildUrl(t, s) {
46
+ const e = new URL(this.baseUrl + t);
47
+ return s && Object.entries(s).forEach(([r, n]) => {
48
+ n != null && e.searchParams.set(r, String(n));
49
+ }), e.toString();
50
50
  }
51
51
  async handleResponse(t) {
52
52
  if (!t.ok) {
53
- const s = await t.text();
54
- throw new l(t.status, s);
53
+ const e = await t.text();
54
+ throw new l(t.status, e);
55
55
  }
56
- const e = await t.text();
57
- return e ? JSON.parse(e) : void 0;
56
+ const s = await t.text();
57
+ return s ? JSON.parse(s) : void 0;
58
58
  }
59
- async httpGet(t, e) {
60
- const s = await fetch(this.buildUrl(t, e), {
59
+ async httpGet(t, s) {
60
+ const e = await fetch(this.buildUrl(t, s), {
61
61
  method: "GET",
62
62
  headers: this.buildHeaders()
63
63
  });
64
- return this.handleResponse(s);
64
+ return this.handleResponse(e);
65
65
  }
66
- async httpPost(t, e, s) {
67
- const r = await fetch(this.buildUrl(t, s), {
66
+ async httpPost(t, s, e) {
67
+ const r = await fetch(this.buildUrl(t, e), {
68
68
  method: "POST",
69
69
  headers: this.buildHeaders(),
70
- body: e ? JSON.stringify(e) : void 0
70
+ body: s ? JSON.stringify(s) : void 0
71
71
  });
72
72
  return this.handleResponse(r);
73
73
  }
74
- async httpPut(t, e) {
75
- const s = await fetch(this.baseUrl + t, {
74
+ async httpPut(t, s) {
75
+ const e = await fetch(this.baseUrl + t, {
76
76
  method: "PUT",
77
77
  headers: this.buildHeaders(),
78
- body: JSON.stringify(e)
78
+ body: JSON.stringify(s)
79
79
  });
80
- return this.handleResponse(s);
80
+ return this.handleResponse(e);
81
81
  }
82
- async httpPatch(t, e) {
83
- const s = await fetch(this.baseUrl + t, {
82
+ async httpPatch(t, s) {
83
+ const e = await fetch(this.baseUrl + t, {
84
84
  method: "PATCH",
85
85
  headers: this.buildHeaders(),
86
- body: JSON.stringify(e)
86
+ body: JSON.stringify(s)
87
87
  });
88
- return this.handleResponse(s);
88
+ return this.handleResponse(e);
89
89
  }
90
90
  async httpDelete(t) {
91
- const e = await fetch(this.baseUrl + t, {
91
+ const s = await fetch(this.baseUrl + t, {
92
92
  method: "DELETE",
93
93
  headers: this.buildHeaders()
94
94
  });
95
- if (!e.ok) {
96
- const s = await e.text();
97
- throw new l(e.status, s);
95
+ if (!s.ok) {
96
+ const e = await s.text();
97
+ throw new l(s.status, e);
98
98
  }
99
99
  }
100
100
  }
101
101
  class w extends c {
102
- constructor(e, s, r) {
103
- super(e, s);
102
+ constructor(s, e, r) {
103
+ super(s, e);
104
104
  u(this, "billingBaseUrl");
105
- this.billingBaseUrl = (r || e).replace(/\/$/, "");
105
+ this.billingBaseUrl = (r || s).replace(/\/$/, "");
106
106
  }
107
- async list(e, s, r) {
108
- const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
109
- return e && (i.keyword = e), this.httpGet("/projects", i);
107
+ async list(s, e, r) {
108
+ const { page: n, size: a } = this.normalizePageParams(e, r), i = { page: n, size: a };
109
+ return s && (i.keyword = s), this.httpGet("/projects", i);
110
110
  }
111
- async get(e) {
112
- return this.httpGet("/projects/" + e);
111
+ async get(s) {
112
+ return this.httpGet("/projects/" + s);
113
113
  }
114
114
  async getMine() {
115
115
  return this.httpGet("/projects/mine");
116
116
  }
117
- async create(e) {
118
- return this.httpPost("/projects", e);
117
+ async create(s) {
118
+ return this.httpPost("/projects", s);
119
119
  }
120
- async update(e) {
121
- return this.httpPut("/projects/" + e.projectId, e);
120
+ async update(s) {
121
+ return this.httpPut("/projects/" + s.projectId, s);
122
122
  }
123
- async remove(e) {
124
- await this.httpDelete("/projects/" + e);
123
+ async remove(s) {
124
+ await this.httpDelete("/projects/" + s);
125
125
  }
126
- async duplicate(e, s) {
127
- return this.httpPost("/projects/" + e + "/actions/duplicate", s);
126
+ async duplicate(s, e) {
127
+ return this.httpPost("/projects/" + s + "/actions/duplicate", e);
128
128
  }
129
- async getSubscription(e) {
130
- return this.billingRequest("/projects/" + e + "/subscription", "GET");
129
+ async getSubscription(s) {
130
+ return this.billingRequest("/projects/" + s + "/subscription", "GET");
131
131
  }
132
- async changeSubscriptionPlan(e, s) {
133
- return this.billingRequest("/projects/" + e + "/subscription/actions/change-plan", "POST", s);
132
+ async changeSubscriptionPlan(s, e) {
133
+ return this.billingRequest("/projects/" + s + "/subscription/actions/change-plan", "POST", e);
134
134
  }
135
- async addSubscriptionCredits(e, s) {
136
- return this.billingRequest("/projects/" + e + "/subscription/actions/add-credits", "POST", s);
135
+ async addSubscriptionCredits(s, e) {
136
+ return this.billingRequest("/projects/" + s + "/subscription/actions/add-credits", "POST", e);
137
137
  }
138
- async setInfiniteCredits(e, s) {
139
- return this.billingRequest("/projects/" + e + "/subscription/actions/set-infinite-credits", "POST", s);
138
+ async setInfiniteCredits(s, e) {
139
+ return this.billingRequest("/projects/" + s + "/subscription/actions/set-infinite-credits", "POST", e);
140
140
  }
141
- async billingRequest(e, s, r) {
141
+ async billingRequest(s, e, r) {
142
142
  const n = new Headers();
143
143
  n.set("Content-Type", "application/json"), this.getAuthProvider().applyHeaders(n);
144
- const a = await fetch(this.billingBaseUrl + e, {
145
- method: s,
144
+ const a = await fetch(this.billingBaseUrl + s, {
145
+ method: e,
146
146
  headers: n,
147
147
  body: r ? JSON.stringify(r) : void 0
148
148
  });
@@ -155,11 +155,11 @@ class w extends c {
155
155
  }
156
156
  }
157
157
  class P extends c {
158
- constructor(t, e) {
159
- super(t, e);
158
+ constructor(t, s) {
159
+ super(t, s);
160
160
  }
161
- async list(t, e, s, r) {
162
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
161
+ async list(t, s, e, r) {
162
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
163
163
  return t && (i.keyword = t), this.httpGet("/agents", i);
164
164
  }
165
165
  async get(t) {
@@ -180,49 +180,49 @@ class P extends c {
180
180
  async listRevisions(t) {
181
181
  return this.httpGet("/agents/" + t + "/revisions");
182
182
  }
183
- async getRevision(t, e) {
184
- return this.httpGet("/agents/" + t + "/revisions/" + e);
183
+ async getRevision(t, s) {
184
+ return this.httpGet("/agents/" + t + "/revisions/" + s);
185
185
  }
186
- async rollback(t, e) {
187
- return this.httpPost("/agents/" + t + "/revisions/" + e + "/rollback", {});
186
+ async rollback(t, s) {
187
+ return this.httpPost("/agents/" + t + "/revisions/" + s + "/rollback", {});
188
188
  }
189
- async generateSystemInstructions(t, e) {
190
- const s = { prompt: t };
191
- return e && (s.sessionId = e), (await this.httpPost("/agents/system-instructions", s)).instructions;
189
+ async generateSystemInstructions(t, s) {
190
+ const e = { prompt: t };
191
+ return s && (e.sessionId = s), (await this.httpPost("/agents/system-instructions", e)).instructions;
192
192
  }
193
193
  async getArchitect() {
194
194
  return this.httpGet("/agents/architect");
195
195
  }
196
196
  }
197
197
  class b extends c {
198
- constructor(e, s, r) {
199
- super(e, s);
198
+ constructor(s, e, r) {
199
+ super(s, e);
200
200
  u(this, "knowledgeBaseId");
201
201
  this.knowledgeBaseId = r;
202
202
  }
203
- async list(e, s, r) {
204
- const { page: n, size: a } = this.normalizePageParams(s, r), i = { page: n, size: a };
205
- return e && (i.keyword = e), this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents", i);
203
+ async list(s, e, r) {
204
+ const { page: n, size: a } = this.normalizePageParams(e, r), i = { page: n, size: a };
205
+ return s && (i.keyword = s), this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents", i);
206
206
  }
207
- async upload(e) {
208
- return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", e);
207
+ async upload(s) {
208
+ return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", s);
209
209
  }
210
- async get(e) {
211
- return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
210
+ async get(s) {
211
+ return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + s);
212
212
  }
213
- async reprocess(e) {
214
- return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id: e });
213
+ async reprocess(s) {
214
+ return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id: s });
215
215
  }
216
- async remove(e) {
217
- await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
216
+ async remove(s) {
217
+ await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + s);
218
218
  }
219
219
  }
220
220
  class v extends c {
221
- constructor(t, e) {
222
- super(t, e);
221
+ constructor(t, s) {
222
+ super(t, s);
223
223
  }
224
- async list(t, e, s, r) {
225
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
224
+ async list(t, s, e, r) {
225
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
226
226
  return t && (i.keyword = t), this.httpGet("/knowledge-bases", i);
227
227
  }
228
228
  async get(t) {
@@ -240,41 +240,92 @@ class v extends c {
240
240
  documents(t) {
241
241
  return new b(this.getBaseUrl(), this.getAuthProvider(), t);
242
242
  }
243
- async searchChunks(t, e) {
244
- return this.httpPost("/knowledge-bases/" + t + "/search", e);
243
+ async searchChunks(t, s) {
244
+ return this.httpPost("/knowledge-bases/" + t + "/search", s);
245
245
  }
246
246
  }
247
247
  class f extends c {
248
- constructor(t, e) {
249
- super(t, e);
248
+ constructor(t, s) {
249
+ super(t, s);
250
250
  }
251
- async list(t, e, s) {
252
- const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
251
+ async list(t, s, e) {
252
+ const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
253
253
  return this.httpGet("/workflows/" + t + "/executions", a);
254
254
  }
255
- async get(t, e) {
256
- return this.httpGet("/workflows/" + t + "/executions/" + e);
255
+ async get(t, s) {
256
+ return this.httpGet("/workflows/" + t + "/executions/" + s);
257
257
  }
258
- async run(t, e) {
259
- return this.httpPost("/workflows/" + t + "/executions", e);
258
+ async run(t, s) {
259
+ return this.httpPost("/workflows/" + t + "/executions", s);
260
260
  }
261
- async queue(t, e) {
262
- return this.httpPost("/workflows/" + t + "/executions/queue", e);
261
+ async queue(t, s) {
262
+ return this.httpPost("/workflows/" + t + "/executions/queue", s);
263
+ }
264
+ /** Runs across all workflows in the project (filter by status/workflow/date). */
265
+ async listRuns(t = {}) {
266
+ const { page: s, size: e } = this.normalizePageParams(t.page, t.size), r = { page: s, size: e };
267
+ return t.status && (r.status = t.status), t.workflowId && (r.workflowId = t.workflowId), t.dateFrom && (r.dateFrom = t.dateFrom), t.dateTo && (r.dateTo = t.dateTo), this.httpGet("/executions", r);
268
+ }
269
+ /** Request cancellation of a running/waiting execution (cascades to sub-workflows). */
270
+ async cancel(t, s) {
271
+ return this.httpPost(
272
+ "/workflows/" + t + "/executions/" + s + "/cancel",
273
+ {}
274
+ );
275
+ }
276
+ /** Re-run an execution from a given node. mode: 'reuse_outputs' | 'fresh'. */
277
+ async rerun(t, s, e, r = "reuse_outputs") {
278
+ return this.httpPost(
279
+ "/workflows/" + t + "/executions/" + s + "/rerun",
280
+ { fromNodeId: e, mode: r }
281
+ );
282
+ }
283
+ /** Execute a single node in isolation with the given inputs (debugging). */
284
+ async dryRunNode(t, s, e = {}) {
285
+ return this.httpPost(
286
+ "/workflows/" + t + "/nodes/" + s + "/dry-run",
287
+ { inputs: e }
288
+ );
289
+ }
290
+ /** Normalized action trace of an agent step (reasoning, tool calls, messages). */
291
+ async stepTrace(t, s, e, r, n) {
292
+ const { page: a, size: i } = this.normalizePageParams(r, n ?? 200);
293
+ return this.httpGet(
294
+ "/workflows/" + t + "/executions/" + s + "/steps/" + e + "/trace",
295
+ { page: a, size: i }
296
+ );
297
+ }
298
+ }
299
+ class k extends c {
300
+ constructor(t, s) {
301
+ super(t, s);
302
+ }
303
+ /** The project's human-task inbox. */
304
+ async list(t = {}) {
305
+ const { page: s, size: e } = this.normalizePageParams(t.page, t.size ?? 50), r = { page: s, size: e };
306
+ return (t.status ?? "pending") && (r.status = t.status ?? "pending"), t.assignee && (r.assignee = t.assignee), t.workflowId && (r.workflowId = t.workflowId), t.executionId && (r.executionId = t.executionId), this.httpGet("/human-tasks", r);
307
+ }
308
+ /** Answer a pending human task, resuming the suspended workflow execution. */
309
+ async respond(t, s, e) {
310
+ return this.httpPost("/human-tasks/" + t + "/respond", {
311
+ response: s,
312
+ respondedBy: e
313
+ });
263
314
  }
264
315
  }
265
316
  class G extends c {
266
- constructor(t, e) {
267
- super(t, e);
317
+ constructor(t, s) {
318
+ super(t, s);
268
319
  }
269
- async list(t, e, s, r) {
270
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
320
+ async list(t, s, e, r) {
321
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
271
322
  return t && (i.keyword = t), this.httpGet("/workflows", i);
272
323
  }
273
324
  async create(t) {
274
325
  return this.httpPost("/workflows", t);
275
326
  }
276
- async update(t, e) {
277
- return e.id = t, this.httpPut("/workflows/" + t, e);
327
+ async update(t, s) {
328
+ return s.id = t, this.httpPut("/workflows/" + t, s);
278
329
  }
279
330
  async remove(t) {
280
331
  await this.httpDelete("/workflows/" + t);
@@ -285,25 +336,28 @@ class G extends c {
285
336
  executions() {
286
337
  return new f(this.getBaseUrl(), this.getAuthProvider());
287
338
  }
339
+ humanTasks() {
340
+ return new k(this.getBaseUrl(), this.getAuthProvider());
341
+ }
288
342
  async listRevisions(t) {
289
343
  return this.httpGet("/workflows/" + t + "/revisions");
290
344
  }
291
- async getRevision(t, e) {
292
- return this.httpGet("/workflows/" + t + "/revisions/" + e);
345
+ async getRevision(t, s) {
346
+ return this.httpGet("/workflows/" + t + "/revisions/" + s);
293
347
  }
294
- async rollback(t, e) {
295
- return this.httpPost("/workflows/" + t + "/revisions/" + e + "/rollback", {});
348
+ async rollback(t, s) {
349
+ return this.httpPost("/workflows/" + t + "/revisions/" + s + "/rollback", {});
296
350
  }
297
351
  }
298
- class k extends c {
299
- constructor(t, e) {
300
- super(t, e);
352
+ class z extends c {
353
+ constructor(t, s) {
354
+ super(t, s);
301
355
  }
302
- async authorize(t, e) {
303
- return this.httpPost("/credentials/" + t + "/authorize", e);
356
+ async authorize(t, s) {
357
+ return this.httpPost("/credentials/" + t + "/authorize", s);
304
358
  }
305
- async handleOAuth2Callback(t, e, s, r) {
306
- const n = { code: e, state: s };
359
+ async handleOAuth2Callback(t, s, e, r) {
360
+ const n = { code: s, state: e };
307
361
  return r && (n.scope = r), this.httpGet("/credentials/" + t + "/oauth2/callback", n);
308
362
  }
309
363
  async list() {
@@ -320,11 +374,11 @@ class k extends c {
320
374
  }
321
375
  }
322
376
  class U extends c {
323
- constructor(t, e) {
324
- super(t, e);
377
+ constructor(t, s) {
378
+ super(t, s);
325
379
  }
326
- async list(t, e, s, r) {
327
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
380
+ async list(t, s, e, r) {
381
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
328
382
  return t && (i.keyword = t), this.httpGet("/features/templates", i);
329
383
  }
330
384
  async get(t) {
@@ -333,40 +387,40 @@ class U extends c {
333
387
  async create(t) {
334
388
  return this.httpPost("/features/templates", t);
335
389
  }
336
- async update(t, e) {
337
- return this.httpPut("/features/templates/" + t, e);
390
+ async update(t, s) {
391
+ return this.httpPut("/features/templates/" + t, s);
338
392
  }
339
- async patch(t, e) {
340
- return this.httpPatch("/features/templates/" + t, e);
393
+ async patch(t, s) {
394
+ return this.httpPatch("/features/templates/" + t, s);
341
395
  }
342
396
  async remove(t) {
343
397
  await this.httpDelete("/features/templates/" + t);
344
398
  }
345
- async getMcpAvailableTools(t, e) {
346
- const s = e ? { credentialsId: e } : void 0;
347
- return this.httpPost("/features/templates/mcp/available-tools", t, s);
399
+ async getMcpAvailableTools(t, s) {
400
+ const e = s ? { credentialsId: s } : void 0;
401
+ return this.httpPost("/features/templates/mcp/available-tools", t, e);
348
402
  }
349
403
  }
350
- class z {
351
- constructor(t, e) {
404
+ class x {
405
+ constructor(t, s) {
352
406
  u(this, "baseUrl");
353
407
  u(this, "auth");
354
- this.baseUrl = t, this.auth = e;
408
+ this.baseUrl = t, this.auth = s;
355
409
  }
356
410
  templates() {
357
411
  return new U(this.baseUrl, this.auth);
358
412
  }
359
413
  }
360
- class x extends c {
361
- constructor(t, e) {
362
- super(t, e);
414
+ class S extends c {
415
+ constructor(t, s) {
416
+ super(t, s);
363
417
  }
364
- async list(t, e, s) {
365
- const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
418
+ async list(t, s, e) {
419
+ const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
366
420
  return this.httpGet("/triggers/" + t + "/executions", a);
367
421
  }
368
- async execute(t, e) {
369
- return this.httpPost("/triggers/" + t + "/executions", e);
422
+ async execute(t, s) {
423
+ return this.httpPost("/triggers/" + t + "/executions", s);
370
424
  }
371
425
  async get(t) {
372
426
  return this.httpGet("/triggers/executions/" + t);
@@ -375,19 +429,19 @@ class x extends c {
375
429
  await this.httpDelete("/triggers/executions/" + t);
376
430
  }
377
431
  }
378
- class S extends c {
379
- constructor(t, e) {
380
- super(t, e);
432
+ class T extends c {
433
+ constructor(t, s) {
434
+ super(t, s);
381
435
  }
382
- async list(t, e, s, r) {
383
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
436
+ async list(t, s, e, r) {
437
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
384
438
  return t && (i.keyword = t), this.httpGet("/triggers", i);
385
439
  }
386
440
  async create(t) {
387
441
  return this.httpPost("/triggers", t);
388
442
  }
389
- async update(t, e) {
390
- return this.httpPut("/triggers/" + t, e);
443
+ async update(t, s) {
444
+ return this.httpPut("/triggers/" + t, s);
391
445
  }
392
446
  async remove(t) {
393
447
  await this.httpDelete("/triggers/" + t);
@@ -396,15 +450,15 @@ class S extends c {
396
450
  return this.httpGet("/triggers/" + t);
397
451
  }
398
452
  executions() {
399
- return new x(this.getBaseUrl(), this.getAuthProvider());
453
+ return new S(this.getBaseUrl(), this.getAuthProvider());
400
454
  }
401
455
  }
402
- class T extends c {
403
- constructor(t, e) {
404
- super(t, e);
456
+ class C extends c {
457
+ constructor(t, s) {
458
+ super(t, s);
405
459
  }
406
- async list(t, e, s, r) {
407
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
460
+ async list(t, s, e, r) {
461
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
408
462
  return t && (i.keyword = t), this.httpGet("/service-prices", i);
409
463
  }
410
464
  async get(t) {
@@ -413,19 +467,19 @@ class T extends c {
413
467
  async create(t) {
414
468
  return this.httpPost("/service-prices", t);
415
469
  }
416
- async update(t, e) {
417
- return this.httpPut("/service-prices/" + t, e);
470
+ async update(t, s) {
471
+ return this.httpPut("/service-prices/" + t, s);
418
472
  }
419
473
  async remove(t) {
420
474
  await this.httpDelete("/service-prices/" + t);
421
475
  }
422
476
  }
423
- class C extends c {
424
- constructor(t, e) {
425
- super(t, e);
477
+ class A extends c {
478
+ constructor(t, s) {
479
+ super(t, s);
426
480
  }
427
- async list(t, e, s, r) {
428
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
481
+ async list(t, s, e, r) {
482
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
429
483
  return t && (i.keyword = t), this.httpGet("/known-models", i);
430
484
  }
431
485
  async get(t) {
@@ -434,20 +488,20 @@ class C extends c {
434
488
  async create(t) {
435
489
  return this.httpPost("/known-models", t);
436
490
  }
437
- async update(t, e) {
438
- return this.httpPut("/known-models/" + t, e);
491
+ async update(t, s) {
492
+ return this.httpPut("/known-models/" + t, s);
439
493
  }
440
494
  async remove(t) {
441
495
  await this.httpDelete("/known-models/" + t);
442
496
  }
443
497
  }
444
- class A extends c {
445
- constructor(t, e) {
446
- super(t, e);
498
+ class I extends c {
499
+ constructor(t, s) {
500
+ super(t, s);
447
501
  }
448
- async list(t, e, s, r, n, a) {
502
+ async list(t, s, e, r, n, a) {
449
503
  const { page: i, size: h } = this.normalizePageParams(n, a), p = { page: i, size: h };
450
- return t && (p.keyword = t), e && (p.status = e), s && (p.agentId = s), r && (p.userId = r), this.httpGet("/sessions", p);
504
+ return t && (p.keyword = t), s && (p.status = s), e && (p.agentId = e), r && (p.userId = r), this.httpGet("/sessions", p);
451
505
  }
452
506
  async get(t) {
453
507
  return this.httpGet("/sessions/" + t);
@@ -455,18 +509,18 @@ class A extends c {
455
509
  async getUsage(t) {
456
510
  return this.httpGet("/sessions/" + t + "/usage");
457
511
  }
458
- async generateMessage(t, e) {
459
- return this.httpPost("/sessions/" + t + "/messages", e);
512
+ async generateMessage(t, s) {
513
+ return this.httpPost("/sessions/" + t + "/messages", s);
460
514
  }
461
- async findMessages(t, e, s) {
462
- const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
515
+ async findMessages(t, s, e) {
516
+ const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
463
517
  return this.httpGet("/sessions/" + t + "/messages", a);
464
518
  }
465
519
  async remove(t) {
466
520
  await this.httpDelete("/sessions/" + t);
467
521
  }
468
- async rename(t, e) {
469
- return this.httpPut("/sessions/" + t + "/name", { name: e });
522
+ async rename(t, s) {
523
+ return this.httpPut("/sessions/" + t + "/name", { name: s });
470
524
  }
471
525
  // ─── Agent Execution Lifecycle ────────────────────────────────
472
526
  /**
@@ -487,19 +541,19 @@ class A extends c {
487
541
  /**
488
542
  * Steer a running agent execution by injecting an instruction.
489
543
  */
490
- async steerExecution(t, e) {
544
+ async steerExecution(t, s) {
491
545
  return this.httpPost(
492
546
  "/sessions/" + encodeURIComponent(t) + "/steer",
493
- { text: e }
547
+ { text: s }
494
548
  );
495
549
  }
496
550
  }
497
551
  class E extends c {
498
- constructor(t, e) {
499
- super(t, e);
552
+ constructor(t, s) {
553
+ super(t, s);
500
554
  }
501
- async list(t, e, s, r) {
502
- const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a };
555
+ async list(t, s, e, r) {
556
+ const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a };
503
557
  return t && (i.keyword = t), r && (i.status = r), this.httpGet("/missions", i);
504
558
  }
505
559
  async get(t) {
@@ -508,8 +562,8 @@ class E extends c {
508
562
  async create(t) {
509
563
  return this.httpPost("/missions", t);
510
564
  }
511
- async update(t, e) {
512
- return this.httpPut("/missions/" + t, e);
565
+ async update(t, s) {
566
+ return this.httpPut("/missions/" + t, s);
513
567
  }
514
568
  async remove(t) {
515
569
  await this.httpDelete("/missions/" + t);
@@ -526,8 +580,8 @@ class E extends c {
526
580
  async replan(t) {
527
581
  return this.httpPost("/missions/" + t + "/replan");
528
582
  }
529
- async sendInstruction(t, e) {
530
- return this.httpPost("/missions/" + t + "/instructions", { instruction: e });
583
+ async sendInstruction(t, s) {
584
+ return this.httpPost("/missions/" + t + "/instructions", { instruction: s });
531
585
  }
532
586
  async stop(t) {
533
587
  return this.httpPost("/missions/" + t + "/stop");
@@ -536,21 +590,21 @@ class E extends c {
536
590
  return this.httpPost("/missions/" + t + "/continue");
537
591
  }
538
592
  }
539
- class j {
540
- constructor(t, e) {
593
+ class B {
594
+ constructor(t, s) {
541
595
  u(this, "baseUrl");
542
596
  u(this, "authProvider");
543
- this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider = e ?? null;
597
+ this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider = s ?? null;
544
598
  }
545
599
  buildHeaders() {
546
600
  const t = new Headers();
547
601
  return t.set("Content-Type", "application/json"), this.authProvider && (typeof this.authProvider == "string" ? t.set("x-persona-apikey", this.authProvider) : this.authProvider.applyHeaders(t)), t;
548
602
  }
549
- async request(t, e, s) {
603
+ async request(t, s, e) {
550
604
  const r = await fetch(this.baseUrl + t, {
551
- method: e,
605
+ method: s,
552
606
  headers: this.buildHeaders(),
553
- body: s ? JSON.stringify(s) : void 0
607
+ body: e ? JSON.stringify(e) : void 0
554
608
  });
555
609
  if (!r.ok) {
556
610
  const a = await r.text();
@@ -562,8 +616,8 @@ class j {
562
616
  async createCustomer(t) {
563
617
  return this.request("/customers", "POST", t);
564
618
  }
565
- async updateCustomer(t, e) {
566
- return this.request("/customers/" + t, "PUT", e);
619
+ async updateCustomer(t, s) {
620
+ return this.request("/customers/" + t, "PUT", s);
567
621
  }
568
622
  async getCustomer(t) {
569
623
  return this.request("/customers/" + t, "GET");
@@ -583,26 +637,26 @@ class j {
583
637
  async getProjectSubscription(t) {
584
638
  return this.request("/projects/" + t + "/subscription", "GET");
585
639
  }
586
- async changeProjectSubscriptionPlan(t, e) {
587
- return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST", e);
640
+ async changeProjectSubscriptionPlan(t, s) {
641
+ return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST", s);
588
642
  }
589
- async addProjectSubscriptionCredits(t, e) {
590
- return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST", e);
643
+ async addProjectSubscriptionCredits(t, s) {
644
+ return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST", s);
591
645
  }
592
- async beginUpgrade(t, e) {
593
- return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST", e);
646
+ async beginUpgrade(t, s) {
647
+ return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST", s);
594
648
  }
595
- async downgrade(t, e) {
596
- return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST", e);
649
+ async downgrade(t, s) {
650
+ return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST", s);
597
651
  }
598
- async mentorize(t, e) {
599
- return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST", e);
652
+ async mentorize(t, s) {
653
+ return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST", s);
600
654
  }
601
- async addCredits(t, e) {
602
- return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: e });
655
+ async addCredits(t, s) {
656
+ return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: s });
603
657
  }
604
- async useCredits(t, e, s, r, n, a) {
605
- const i = { credits: e, services: s };
658
+ async useCredits(t, s, e, r, n, a) {
659
+ const i = { credits: s, services: e };
606
660
  return r && (i.referenceId = r), n !== void 0 && (i.totalCost = n), a !== void 0 && (i.totalPrice = a), this.request("/customers/" + t + "/subscription/credits", "DELETE", i);
607
661
  }
608
662
  async getCredits(t) {
@@ -619,31 +673,31 @@ class j {
619
673
  return !1;
620
674
  }
621
675
  }
622
- async listInvoices(t, e, s) {
676
+ async listInvoices(t, s, e) {
623
677
  const r = [];
624
- e && r.push("date_from=" + e), s && r.push("date_to=" + s);
678
+ s && r.push("date_from=" + s), e && r.push("date_to=" + e);
625
679
  const n = r.length > 0 ? "?" + r.join("&") : "";
626
680
  return this.request("/customers/" + t + "/invoices" + n, "GET");
627
681
  }
628
682
  async cancelSubscription(t) {
629
683
  return this.request("/customers/" + t + "/subscription/actions/cancel", "POST", {});
630
684
  }
631
- async getUsageStats(t, e, s, r) {
685
+ async getUsageStats(t, s, e, r) {
632
686
  const n = [];
633
- e && n.push("date_from=" + encodeURIComponent(e)), s && n.push("date_to=" + encodeURIComponent(s)), r != null && r.length && r.forEach((i) => n.push("model=" + encodeURIComponent(i)));
687
+ s && n.push("date_from=" + encodeURIComponent(s)), e && n.push("date_to=" + encodeURIComponent(e)), r != null && r.length && r.forEach((i) => n.push("model=" + encodeURIComponent(i)));
634
688
  const a = n.length > 0 ? "?" + n.join("&") : "";
635
689
  return this.request("/projects/" + t + "/subscription/usage-stats" + a, "GET");
636
690
  }
637
- async listUsages(t, e, s, r, n, a, i) {
691
+ async listUsages(t, s, e, r, n, a, i) {
638
692
  const h = [];
639
- e && h.push("date_from=" + encodeURIComponent(e)), s && h.push("date_to=" + encodeURIComponent(s)), r != null && r.length && r.forEach((g) => h.push("model=" + encodeURIComponent(g))), n && h.push("session_id=" + encodeURIComponent(n)), a !== void 0 && h.push("page=" + encodeURIComponent(String(a))), i !== void 0 && h.push("size=" + encodeURIComponent(String(i)));
693
+ s && h.push("date_from=" + encodeURIComponent(s)), e && h.push("date_to=" + encodeURIComponent(e)), r != null && r.length && r.forEach((d) => h.push("model=" + encodeURIComponent(d))), n && h.push("session_id=" + encodeURIComponent(n)), a !== void 0 && h.push("page=" + encodeURIComponent(String(a))), i !== void 0 && h.push("size=" + encodeURIComponent(String(i)));
640
694
  const p = h.length > 0 ? "?" + h.join("&") : "";
641
695
  return this.request("/projects/" + t + "/subscription/usages" + p, "GET");
642
696
  }
643
697
  }
644
- class q extends c {
645
- constructor(t, e) {
646
- super(t, e);
698
+ class R extends c {
699
+ constructor(t, s) {
700
+ super(t, s);
647
701
  }
648
702
  async get(t) {
649
703
  return this.httpGet("/values/" + t);
@@ -672,9 +726,6 @@ class q extends c {
672
726
  async getSynthesizerVoices(t) {
673
727
  return this.httpGet("/values/synthesizers/" + t + "/voices");
674
728
  }
675
- async getStmTypes() {
676
- return this.httpGet("/values/stm-types");
677
- }
678
729
  async getDocumentExtractors() {
679
730
  return this.httpGet("/values/document-extractors");
680
731
  }
@@ -703,12 +754,12 @@ class q extends c {
703
754
  return this.httpGet("/values/trigger-destination-types");
704
755
  }
705
756
  }
706
- class R {
707
- constructor(t, e, s) {
757
+ class q {
758
+ constructor(t, s, e) {
708
759
  u(this, "baseUrl");
709
760
  u(this, "workflowsBaseUrl");
710
761
  u(this, "billingBaseUrl");
711
- this.baseUrl = t, this.workflowsBaseUrl = e, this.billingBaseUrl = s || "https://persona.applica.guru/billing";
762
+ this.baseUrl = t, this.workflowsBaseUrl = s, this.billingBaseUrl = e || "https://persona.applica.guru/billing";
712
763
  }
713
764
  projects(t) {
714
765
  return new w(this.baseUrl, t, this.billingBaseUrl);
@@ -723,31 +774,31 @@ class R {
723
774
  return new G(this.workflowsBaseUrl, t);
724
775
  }
725
776
  credentials(t) {
726
- return new k(this.baseUrl, t);
777
+ return new z(this.baseUrl, t);
727
778
  }
728
779
  features(t) {
729
- return new z(this.baseUrl, t);
780
+ return new x(this.baseUrl, t);
730
781
  }
731
782
  triggers(t) {
732
- return new S(this.baseUrl, t);
783
+ return new T(this.baseUrl, t);
733
784
  }
734
785
  servicePrices(t) {
735
- return new T(this.baseUrl, t);
786
+ return new C(this.baseUrl, t);
736
787
  }
737
788
  knownModels(t) {
738
- return new C(this.baseUrl, t);
789
+ return new A(this.baseUrl, t);
739
790
  }
740
791
  sessions(t) {
741
- return new A(this.baseUrl, t);
792
+ return new I(this.baseUrl, t);
742
793
  }
743
794
  missions(t) {
744
795
  return new E(this.baseUrl, t);
745
796
  }
746
797
  billing(t) {
747
- return new j(this.billingBaseUrl, t);
798
+ return new B(this.billingBaseUrl, t);
748
799
  }
749
800
  values(t) {
750
- return new q(this.baseUrl, t);
801
+ return new R(this.baseUrl, t);
751
802
  }
752
803
  }
753
804
  class O {
@@ -766,21 +817,22 @@ export {
766
817
  l as ApiException,
767
818
  m as ApiKeyAuthenticationProvider,
768
819
  O as BearerTokenAuthenticationProvider,
769
- j as BillingClient,
770
- k as CredentialsApi,
820
+ B as BillingClient,
821
+ z as CredentialsApi,
771
822
  U as FeatureTemplatesApi,
772
- z as FeaturesApi,
823
+ x as FeaturesApi,
824
+ k as HumanTasksApi,
773
825
  b as KnowledgeBaseDocumentsApi,
774
826
  v as KnowledgeBasesApi,
775
- C as KnownModelsApi,
827
+ A as KnownModelsApi,
776
828
  E as MissionsApi,
777
- R as PersonaSdk,
829
+ q as PersonaSdk,
778
830
  w as ProjectsApi,
779
- T as ServicePricesApi,
780
- A as SessionsApi,
781
- x as TriggerExecutionsApi,
782
- S as TriggersApi,
783
- q as ValuesApi,
831
+ C as ServicePricesApi,
832
+ I as SessionsApi,
833
+ S as TriggerExecutionsApi,
834
+ T as TriggersApi,
835
+ R as ValuesApi,
784
836
  f as WorkflowExecutionsApi,
785
837
  G as WorkflowsApi
786
838
  };