@applica-software-guru/persona-sdk 0.1.35 → 0.1.36

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,15 +1,15 @@
1
1
  var d = Object.defineProperty;
2
- var g = (o, t, s) => t in o ? d(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
3
- var u = (o, t, s) => g(o, typeof t != "symbol" ? t + "" : t, s);
4
- class p extends Error {
5
- constructor(s, e) {
6
- super(`API Error: ${s} - ${e}`);
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);
4
+ class l extends Error {
5
+ constructor(e, s) {
6
+ super(`API Error: ${e} - ${s}`);
7
7
  u(this, "statusCode");
8
8
  u(this, "body");
9
- this.statusCode = s, this.body = e;
9
+ this.statusCode = e, this.body = s;
10
10
  }
11
11
  }
12
- class y {
12
+ class m {
13
13
  constructor(t) {
14
14
  this.apiKey = t;
15
15
  }
@@ -21,10 +21,10 @@ class y {
21
21
  }
22
22
  }
23
23
  class c {
24
- constructor(t, s) {
24
+ constructor(t, e) {
25
25
  u(this, "baseUrl");
26
26
  u(this, "authProvider");
27
- this.baseUrl = t, this.authProvider = typeof s == "string" ? new y(s) : s;
27
+ this.baseUrl = t, this.authProvider = typeof e == "string" ? new m(e) : e;
28
28
  }
29
29
  getBaseUrl() {
30
30
  return this.baseUrl;
@@ -32,134 +32,134 @@ class c {
32
32
  getAuthProvider() {
33
33
  return this.authProvider;
34
34
  }
35
- normalizePageParams(t, s) {
35
+ normalizePageParams(t, e) {
36
36
  return {
37
37
  page: t === void 0 || t < 1 ? 1 : t,
38
- size: s === void 0 || s < 1 ? 20 : s
38
+ size: e === void 0 || e < 1 ? 20 : e
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, 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();
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();
50
50
  }
51
51
  async handleResponse(t) {
52
52
  if (!t.ok) {
53
- const e = await t.text();
54
- throw new p(t.status, e);
53
+ const s = await t.text();
54
+ throw new l(t.status, s);
55
55
  }
56
- const s = await t.text();
57
- return s ? JSON.parse(s) : void 0;
56
+ const e = await t.text();
57
+ return e ? JSON.parse(e) : void 0;
58
58
  }
59
- async httpGet(t, s) {
60
- const e = await fetch(this.buildUrl(t, s), {
59
+ async httpGet(t, e) {
60
+ const s = await fetch(this.buildUrl(t, e), {
61
61
  method: "GET",
62
62
  headers: this.buildHeaders()
63
63
  });
64
- return this.handleResponse(e);
64
+ return this.handleResponse(s);
65
65
  }
66
- async httpPost(t, s, e) {
67
- const r = await fetch(this.buildUrl(t, e), {
66
+ async httpPost(t, e, s) {
67
+ const r = await fetch(this.buildUrl(t, s), {
68
68
  method: "POST",
69
69
  headers: this.buildHeaders(),
70
- body: s ? JSON.stringify(s) : void 0
70
+ body: e ? JSON.stringify(e) : void 0
71
71
  });
72
72
  return this.handleResponse(r);
73
73
  }
74
- async httpPut(t, s) {
75
- const e = await fetch(this.baseUrl + t, {
74
+ async httpPut(t, e) {
75
+ const s = await fetch(this.baseUrl + t, {
76
76
  method: "PUT",
77
77
  headers: this.buildHeaders(),
78
- body: JSON.stringify(s)
78
+ body: JSON.stringify(e)
79
79
  });
80
- return this.handleResponse(e);
80
+ return this.handleResponse(s);
81
81
  }
82
- async httpPatch(t, s) {
83
- const e = await fetch(this.baseUrl + t, {
82
+ async httpPatch(t, e) {
83
+ const s = await fetch(this.baseUrl + t, {
84
84
  method: "PATCH",
85
85
  headers: this.buildHeaders(),
86
- body: JSON.stringify(s)
86
+ body: JSON.stringify(e)
87
87
  });
88
- return this.handleResponse(e);
88
+ return this.handleResponse(s);
89
89
  }
90
90
  async httpDelete(t) {
91
- const s = await fetch(this.baseUrl + t, {
91
+ const e = await fetch(this.baseUrl + t, {
92
92
  method: "DELETE",
93
93
  headers: this.buildHeaders()
94
94
  });
95
- if (!s.ok) {
96
- const e = await s.text();
97
- throw new p(s.status, e);
95
+ if (!e.ok) {
96
+ const s = await e.text();
97
+ throw new l(e.status, s);
98
98
  }
99
99
  }
100
100
  }
101
- class m extends c {
102
- constructor(s, e, r) {
103
- super(s, e);
101
+ class w extends c {
102
+ constructor(e, s, r) {
103
+ super(e, s);
104
104
  u(this, "billingBaseUrl");
105
- this.billingBaseUrl = (r || s).replace(/\/$/, "");
105
+ this.billingBaseUrl = (r || e).replace(/\/$/, "");
106
106
  }
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);
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);
110
110
  }
111
- async get(s) {
112
- return this.httpGet("/projects/" + s);
111
+ async get(e) {
112
+ return this.httpGet("/projects/" + e);
113
113
  }
114
114
  async getMine() {
115
115
  return this.httpGet("/projects/mine");
116
116
  }
117
- async create(s) {
118
- return this.httpPost("/projects", s);
117
+ async create(e) {
118
+ return this.httpPost("/projects", e);
119
119
  }
120
- async update(s) {
121
- return this.httpPut("/projects/" + s.projectId, s);
120
+ async update(e) {
121
+ return this.httpPut("/projects/" + e.projectId, e);
122
122
  }
123
- async remove(s) {
124
- await this.httpDelete("/projects/" + s);
123
+ async remove(e) {
124
+ await this.httpDelete("/projects/" + e);
125
125
  }
126
- async duplicate(s, e) {
127
- return this.httpPost("/projects/" + s + "/actions/duplicate", e);
126
+ async duplicate(e, s) {
127
+ return this.httpPost("/projects/" + e + "/actions/duplicate", s);
128
128
  }
129
- async getSubscription(s) {
130
- return this.billingRequest("/projects/" + s + "/subscription", "GET");
129
+ async getSubscription(e) {
130
+ return this.billingRequest("/projects/" + e + "/subscription", "GET");
131
131
  }
132
- async changeSubscriptionPlan(s, e) {
133
- return this.billingRequest("/projects/" + s + "/subscription/actions/change-plan", "POST", e);
132
+ async changeSubscriptionPlan(e, s) {
133
+ return this.billingRequest("/projects/" + e + "/subscription/actions/change-plan", "POST", s);
134
134
  }
135
- async addSubscriptionCredits(s, e) {
136
- return this.billingRequest("/projects/" + s + "/subscription/actions/add-credits", "POST", e);
135
+ async addSubscriptionCredits(e, s) {
136
+ return this.billingRequest("/projects/" + e + "/subscription/actions/add-credits", "POST", s);
137
137
  }
138
- async setInfiniteCredits(s, e) {
139
- return this.billingRequest("/projects/" + s + "/subscription/actions/set-infinite-credits", "POST", e);
138
+ async setInfiniteCredits(e, s) {
139
+ return this.billingRequest("/projects/" + e + "/subscription/actions/set-infinite-credits", "POST", s);
140
140
  }
141
- async billingRequest(s, e, r) {
141
+ async billingRequest(e, s, 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 + s, {
145
- method: e,
144
+ const a = await fetch(this.billingBaseUrl + e, {
145
+ method: s,
146
146
  headers: n,
147
147
  body: r ? JSON.stringify(r) : void 0
148
148
  });
149
149
  if (!a.ok) {
150
- const l = await a.text();
151
- throw new p(a.status, l);
150
+ const h = await a.text();
151
+ throw new l(a.status, h);
152
152
  }
153
153
  const i = await a.text();
154
154
  return i ? JSON.parse(i) : void 0;
155
155
  }
156
156
  }
157
- class w extends c {
158
- constructor(t, s) {
159
- super(t, s);
157
+ class P extends c {
158
+ constructor(t, e) {
159
+ super(t, e);
160
160
  }
161
- async list(t, s, e, r) {
162
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
161
+ async list(t, e, s, r) {
162
+ const { page: n, size: a } = this.normalizePageParams(e, s), 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 w extends c {
180
180
  async listRevisions(t) {
181
181
  return this.httpGet("/agents/" + t + "/revisions");
182
182
  }
183
- async getRevision(t, s) {
184
- return this.httpGet("/agents/" + t + "/revisions/" + s);
183
+ async getRevision(t, e) {
184
+ return this.httpGet("/agents/" + t + "/revisions/" + e);
185
185
  }
186
- async rollback(t, s) {
187
- return this.httpPost("/agents/" + t + "/revisions/" + s + "/rollback", {});
186
+ async rollback(t, e) {
187
+ return this.httpPost("/agents/" + t + "/revisions/" + e + "/rollback", {});
188
188
  }
189
- async generateSystemInstructions(t, s) {
190
- const e = { prompt: t };
191
- return s && (e.sessionId = s), (await this.httpPost("/agents/system-instructions", e)).instructions;
189
+ async generateSystemInstructions(t, e) {
190
+ const s = { prompt: t };
191
+ return e && (s.sessionId = e), (await this.httpPost("/agents/system-instructions", s)).instructions;
192
192
  }
193
193
  async getArchitect() {
194
194
  return this.httpGet("/agents/architect");
195
195
  }
196
196
  }
197
- class P extends c {
198
- constructor(s, e, r) {
199
- super(s, e);
197
+ class b extends c {
198
+ constructor(e, s, r) {
199
+ super(e, s);
200
200
  u(this, "knowledgeBaseId");
201
201
  this.knowledgeBaseId = r;
202
202
  }
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);
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);
206
206
  }
207
- async upload(s) {
208
- return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", s);
207
+ async upload(e) {
208
+ return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", e);
209
209
  }
210
- async get(s) {
211
- return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + s);
210
+ async get(e) {
211
+ return this.httpGet("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
212
212
  }
213
- async reprocess(s) {
214
- return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id: s });
213
+ async reprocess(e) {
214
+ return this.httpPost("/knowledge-bases/" + this.knowledgeBaseId + "/documents", { document_id: e });
215
215
  }
216
- async remove(s) {
217
- await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + s);
216
+ async remove(e) {
217
+ await this.httpDelete("/knowledge-bases/" + this.knowledgeBaseId + "/documents/" + e);
218
218
  }
219
219
  }
220
- class b extends c {
221
- constructor(t, s) {
222
- super(t, s);
220
+ class v extends c {
221
+ constructor(t, e) {
222
+ super(t, e);
223
223
  }
224
- async list(t, s, e, r) {
225
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
224
+ async list(t, e, s, r) {
225
+ const { page: n, size: a } = this.normalizePageParams(e, s), 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) {
@@ -238,43 +238,43 @@ class b extends c {
238
238
  await this.httpDelete("/knowledge-bases/" + t);
239
239
  }
240
240
  documents(t) {
241
- return new P(this.getBaseUrl(), this.getAuthProvider(), t);
241
+ return new b(this.getBaseUrl(), this.getAuthProvider(), t);
242
242
  }
243
- async searchChunks(t, s) {
244
- return this.httpPost("/knowledge-bases/" + t + "/search", s);
243
+ async searchChunks(t, e) {
244
+ return this.httpPost("/knowledge-bases/" + t + "/search", e);
245
245
  }
246
246
  }
247
- class v extends c {
248
- constructor(t, s) {
249
- super(t, s);
247
+ class f extends c {
248
+ constructor(t, e) {
249
+ super(t, e);
250
250
  }
251
- async list(t, s, e) {
252
- const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
251
+ async list(t, e, s) {
252
+ const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
253
253
  return this.httpGet("/workflows/" + t + "/executions", a);
254
254
  }
255
- async get(t, s) {
256
- return this.httpGet("/workflows/" + t + "/executions/" + s);
255
+ async get(t, e) {
256
+ return this.httpGet("/workflows/" + t + "/executions/" + e);
257
257
  }
258
- async run(t, s) {
259
- return this.httpPost("/workflows/" + t + "/executions", s);
258
+ async run(t, e) {
259
+ return this.httpPost("/workflows/" + t + "/executions", e);
260
260
  }
261
- async queue(t, s) {
262
- return this.httpPost("/workflows/" + t + "/executions/queue", s);
261
+ async queue(t, e) {
262
+ return this.httpPost("/workflows/" + t + "/executions/queue", e);
263
263
  }
264
264
  }
265
- class f extends c {
266
- constructor(t, s) {
267
- super(t, s);
265
+ class G extends c {
266
+ constructor(t, e) {
267
+ super(t, e);
268
268
  }
269
- async list(t, s, e, r) {
270
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
269
+ async list(t, e, s, r) {
270
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
271
271
  return t && (i.keyword = t), this.httpGet("/workflows", i);
272
272
  }
273
273
  async create(t) {
274
274
  return this.httpPost("/workflows", t);
275
275
  }
276
- async update(t, s) {
277
- return s.id = t, this.httpPut("/workflows/" + t, s);
276
+ async update(t, e) {
277
+ return e.id = t, this.httpPut("/workflows/" + t, e);
278
278
  }
279
279
  async remove(t) {
280
280
  await this.httpDelete("/workflows/" + t);
@@ -283,27 +283,27 @@ class f extends c {
283
283
  return this.httpGet("/workflows/" + t);
284
284
  }
285
285
  executions() {
286
- return new v(this.getBaseUrl(), this.getAuthProvider());
286
+ return new f(this.getBaseUrl(), this.getAuthProvider());
287
287
  }
288
288
  async listRevisions(t) {
289
289
  return this.httpGet("/workflows/" + t + "/revisions");
290
290
  }
291
- async getRevision(t, s) {
292
- return this.httpGet("/workflows/" + t + "/revisions/" + s);
291
+ async getRevision(t, e) {
292
+ return this.httpGet("/workflows/" + t + "/revisions/" + e);
293
293
  }
294
- async rollback(t, s) {
295
- return this.httpPost("/workflows/" + t + "/revisions/" + s + "/rollback", {});
294
+ async rollback(t, e) {
295
+ return this.httpPost("/workflows/" + t + "/revisions/" + e + "/rollback", {});
296
296
  }
297
297
  }
298
- class G extends c {
299
- constructor(t, s) {
300
- super(t, s);
298
+ class k extends c {
299
+ constructor(t, e) {
300
+ super(t, e);
301
301
  }
302
- async authorize(t, s) {
303
- return this.httpPost("/credentials/" + t + "/authorize", s);
302
+ async authorize(t, e) {
303
+ return this.httpPost("/credentials/" + t + "/authorize", e);
304
304
  }
305
- async handleOAuth2Callback(t, s, e, r) {
306
- const n = { code: s, state: e };
305
+ async handleOAuth2Callback(t, e, s, r) {
306
+ const n = { code: e, state: s };
307
307
  return r && (n.scope = r), this.httpGet("/credentials/" + t + "/oauth2/callback", n);
308
308
  }
309
309
  async list() {
@@ -319,12 +319,12 @@ class G extends c {
319
319
  await this.httpDelete("/credentials/all/" + t);
320
320
  }
321
321
  }
322
- class k extends c {
323
- constructor(t, s) {
324
- super(t, s);
322
+ class U extends c {
323
+ constructor(t, e) {
324
+ super(t, e);
325
325
  }
326
- async list(t, s, e, r) {
327
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
326
+ async list(t, e, s, r) {
327
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
328
328
  return t && (i.keyword = t), this.httpGet("/features/templates", i);
329
329
  }
330
330
  async get(t) {
@@ -333,40 +333,40 @@ class k extends c {
333
333
  async create(t) {
334
334
  return this.httpPost("/features/templates", t);
335
335
  }
336
- async update(t, s) {
337
- return this.httpPut("/features/templates/" + t, s);
336
+ async update(t, e) {
337
+ return this.httpPut("/features/templates/" + t, e);
338
338
  }
339
- async patch(t, s) {
340
- return this.httpPatch("/features/templates/" + t, s);
339
+ async patch(t, e) {
340
+ return this.httpPatch("/features/templates/" + t, e);
341
341
  }
342
342
  async remove(t) {
343
343
  await this.httpDelete("/features/templates/" + t);
344
344
  }
345
- async getMcpAvailableTools(t, s) {
346
- const e = s ? { credentialsId: s } : void 0;
347
- return this.httpPost("/features/templates/mcp/available-tools", t, e);
345
+ async getMcpAvailableTools(t, e) {
346
+ const s = e ? { credentialsId: e } : void 0;
347
+ return this.httpPost("/features/templates/mcp/available-tools", t, s);
348
348
  }
349
349
  }
350
350
  class z {
351
- constructor(t, s) {
351
+ constructor(t, e) {
352
352
  u(this, "baseUrl");
353
353
  u(this, "auth");
354
- this.baseUrl = t, this.auth = s;
354
+ this.baseUrl = t, this.auth = e;
355
355
  }
356
356
  templates() {
357
- return new k(this.baseUrl, this.auth);
357
+ return new U(this.baseUrl, this.auth);
358
358
  }
359
359
  }
360
- class U extends c {
361
- constructor(t, s) {
362
- super(t, s);
360
+ class x extends c {
361
+ constructor(t, e) {
362
+ super(t, e);
363
363
  }
364
- async list(t, s, e) {
365
- const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
364
+ async list(t, e, s) {
365
+ const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
366
366
  return this.httpGet("/triggers/" + t + "/executions", a);
367
367
  }
368
- async execute(t, s) {
369
- return this.httpPost("/triggers/" + t + "/executions", s);
368
+ async execute(t, e) {
369
+ return this.httpPost("/triggers/" + t + "/executions", e);
370
370
  }
371
371
  async get(t) {
372
372
  return this.httpGet("/triggers/executions/" + t);
@@ -375,19 +375,19 @@ class U extends c {
375
375
  await this.httpDelete("/triggers/executions/" + t);
376
376
  }
377
377
  }
378
- class x extends c {
379
- constructor(t, s) {
380
- super(t, s);
378
+ class S extends c {
379
+ constructor(t, e) {
380
+ super(t, e);
381
381
  }
382
- async list(t, s, e, r) {
383
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
382
+ async list(t, e, s, r) {
383
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
384
384
  return t && (i.keyword = t), this.httpGet("/triggers", i);
385
385
  }
386
386
  async create(t) {
387
387
  return this.httpPost("/triggers", t);
388
388
  }
389
- async update(t, s) {
390
- return this.httpPut("/triggers/" + t, s);
389
+ async update(t, e) {
390
+ return this.httpPut("/triggers/" + t, e);
391
391
  }
392
392
  async remove(t) {
393
393
  await this.httpDelete("/triggers/" + t);
@@ -396,15 +396,15 @@ class x extends c {
396
396
  return this.httpGet("/triggers/" + t);
397
397
  }
398
398
  executions() {
399
- return new U(this.getBaseUrl(), this.getAuthProvider());
399
+ return new x(this.getBaseUrl(), this.getAuthProvider());
400
400
  }
401
401
  }
402
- class S extends c {
403
- constructor(t, s) {
404
- super(t, s);
402
+ class T extends c {
403
+ constructor(t, e) {
404
+ super(t, e);
405
405
  }
406
- async list(t, s, e, r) {
407
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
406
+ async list(t, e, s, r) {
407
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
408
408
  return t && (i.keyword = t), this.httpGet("/service-prices", i);
409
409
  }
410
410
  async get(t) {
@@ -413,19 +413,19 @@ class S extends c {
413
413
  async create(t) {
414
414
  return this.httpPost("/service-prices", t);
415
415
  }
416
- async update(t, s) {
417
- return this.httpPut("/service-prices/" + t, s);
416
+ async update(t, e) {
417
+ return this.httpPut("/service-prices/" + t, e);
418
418
  }
419
419
  async remove(t) {
420
420
  await this.httpDelete("/service-prices/" + t);
421
421
  }
422
422
  }
423
- class T extends c {
424
- constructor(t, s) {
425
- super(t, s);
423
+ class C extends c {
424
+ constructor(t, e) {
425
+ super(t, e);
426
426
  }
427
- async list(t, s, e, r) {
428
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a, ...r };
427
+ async list(t, e, s, r) {
428
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a, ...r };
429
429
  return t && (i.keyword = t), this.httpGet("/known-models", i);
430
430
  }
431
431
  async get(t) {
@@ -434,20 +434,20 @@ class T extends c {
434
434
  async create(t) {
435
435
  return this.httpPost("/known-models", t);
436
436
  }
437
- async update(t, s) {
438
- return this.httpPut("/known-models/" + t, s);
437
+ async update(t, e) {
438
+ return this.httpPut("/known-models/" + t, e);
439
439
  }
440
440
  async remove(t) {
441
441
  await this.httpDelete("/known-models/" + t);
442
442
  }
443
443
  }
444
444
  class A extends c {
445
- constructor(t, s) {
446
- super(t, s);
445
+ constructor(t, e) {
446
+ super(t, e);
447
447
  }
448
- async list(t, s, e, r, n, a) {
449
- const { page: i, size: l } = this.normalizePageParams(n, a), h = { page: i, size: l };
450
- return t && (h.keyword = t), s && (h.status = s), e && (h.agentId = e), r && (h.userId = r), this.httpGet("/sessions", h);
448
+ async list(t, e, s, r, n, a) {
449
+ 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);
451
451
  }
452
452
  async get(t) {
453
453
  return this.httpGet("/sessions/" + t);
@@ -455,18 +455,18 @@ class A extends c {
455
455
  async getUsage(t) {
456
456
  return this.httpGet("/sessions/" + t + "/usage");
457
457
  }
458
- async generateMessage(t, s) {
459
- return this.httpPost("/sessions/" + t + "/messages", s);
458
+ async generateMessage(t, e) {
459
+ return this.httpPost("/sessions/" + t + "/messages", e);
460
460
  }
461
- async findMessages(t, s, e) {
462
- const { page: r, size: n } = this.normalizePageParams(s, e), a = { page: r, size: n };
461
+ async findMessages(t, e, s) {
462
+ const { page: r, size: n } = this.normalizePageParams(e, s), a = { page: r, size: n };
463
463
  return this.httpGet("/sessions/" + t + "/messages", a);
464
464
  }
465
465
  async remove(t) {
466
466
  await this.httpDelete("/sessions/" + t);
467
467
  }
468
- async rename(t, s) {
469
- return this.httpPut("/sessions/" + t + "/name", { name: s });
468
+ async rename(t, e) {
469
+ return this.httpPut("/sessions/" + t + "/name", { name: e });
470
470
  }
471
471
  // ─── Agent Execution Lifecycle ────────────────────────────────
472
472
  /**
@@ -487,19 +487,19 @@ class A extends c {
487
487
  /**
488
488
  * Steer a running agent execution by injecting an instruction.
489
489
  */
490
- async steerExecution(t, s) {
490
+ async steerExecution(t, e) {
491
491
  return this.httpPost(
492
492
  "/sessions/" + encodeURIComponent(t) + "/steer",
493
- { text: s }
493
+ { text: e }
494
494
  );
495
495
  }
496
496
  }
497
- class C extends c {
498
- constructor(t, s) {
499
- super(t, s);
497
+ class E extends c {
498
+ constructor(t, e) {
499
+ super(t, e);
500
500
  }
501
- async list(t, s, e, r) {
502
- const { page: n, size: a } = this.normalizePageParams(s, e), i = { page: n, size: a };
501
+ async list(t, e, s, r) {
502
+ const { page: n, size: a } = this.normalizePageParams(e, s), i = { page: n, size: a };
503
503
  return t && (i.keyword = t), r && (i.status = r), this.httpGet("/missions", i);
504
504
  }
505
505
  async get(t) {
@@ -508,8 +508,8 @@ class C extends c {
508
508
  async create(t) {
509
509
  return this.httpPost("/missions", t);
510
510
  }
511
- async update(t, s) {
512
- return this.httpPut("/missions/" + t, s);
511
+ async update(t, e) {
512
+ return this.httpPut("/missions/" + t, e);
513
513
  }
514
514
  async remove(t) {
515
515
  await this.httpDelete("/missions/" + t);
@@ -526,8 +526,8 @@ class C extends c {
526
526
  async replan(t) {
527
527
  return this.httpPost("/missions/" + t + "/replan");
528
528
  }
529
- async sendInstruction(t, s) {
530
- return this.httpPost("/missions/" + t + "/instructions", { instruction: s });
529
+ async sendInstruction(t, e) {
530
+ return this.httpPost("/missions/" + t + "/instructions", { instruction: e });
531
531
  }
532
532
  async stop(t) {
533
533
  return this.httpPost("/missions/" + t + "/stop");
@@ -536,25 +536,25 @@ class C extends c {
536
536
  return this.httpPost("/missions/" + t + "/continue");
537
537
  }
538
538
  }
539
- class B {
540
- constructor(t, s) {
539
+ class j {
540
+ constructor(t, e) {
541
541
  u(this, "baseUrl");
542
542
  u(this, "authProvider");
543
- this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider = s ?? null;
543
+ this.baseUrl = (t || "https://persona.applica.guru/billing").replace(/\/$/, ""), this.authProvider = e ?? null;
544
544
  }
545
545
  buildHeaders() {
546
546
  const t = new Headers();
547
547
  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
548
  }
549
- async request(t, s, e) {
549
+ async request(t, e, s) {
550
550
  const r = await fetch(this.baseUrl + t, {
551
- method: s,
551
+ method: e,
552
552
  headers: this.buildHeaders(),
553
- body: e ? JSON.stringify(e) : void 0
553
+ body: s ? JSON.stringify(s) : void 0
554
554
  });
555
555
  if (!r.ok) {
556
556
  const a = await r.text();
557
- throw new p(r.status, a);
557
+ throw new l(r.status, a);
558
558
  }
559
559
  const n = await r.text();
560
560
  return n ? JSON.parse(n) : void 0;
@@ -562,8 +562,8 @@ class B {
562
562
  async createCustomer(t) {
563
563
  return this.request("/customers", "POST", t);
564
564
  }
565
- async updateCustomer(t, s) {
566
- return this.request("/customers/" + t, "PUT", s);
565
+ async updateCustomer(t, e) {
566
+ return this.request("/customers/" + t, "PUT", e);
567
567
  }
568
568
  async getCustomer(t) {
569
569
  return this.request("/customers/" + t, "GET");
@@ -583,26 +583,26 @@ class B {
583
583
  async getProjectSubscription(t) {
584
584
  return this.request("/projects/" + t + "/subscription", "GET");
585
585
  }
586
- async changeProjectSubscriptionPlan(t, s) {
587
- return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST", s);
586
+ async changeProjectSubscriptionPlan(t, e) {
587
+ return this.request("/projects/" + t + "/subscription/actions/change-plan", "POST", e);
588
588
  }
589
- async addProjectSubscriptionCredits(t, s) {
590
- return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST", s);
589
+ async addProjectSubscriptionCredits(t, e) {
590
+ return this.request("/projects/" + t + "/subscription/actions/add-credits", "POST", e);
591
591
  }
592
- async beginUpgrade(t, s) {
593
- return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST", s);
592
+ async beginUpgrade(t, e) {
593
+ return this.request("/customers/" + t + "/subscription/actions/upgrade", "POST", e);
594
594
  }
595
- async downgrade(t, s) {
596
- return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST", s);
595
+ async downgrade(t, e) {
596
+ return this.request("/customers/" + t + "/subscription/actions/downgrade", "POST", e);
597
597
  }
598
- async mentorize(t, s) {
599
- return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST", s);
598
+ async mentorize(t, e) {
599
+ return this.request("/customers/" + t + "/subscription/actions/mentorize", "POST", e);
600
600
  }
601
- async addCredits(t, s) {
602
- return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: s });
601
+ async addCredits(t, e) {
602
+ return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: e });
603
603
  }
604
- async useCredits(t, s, e, r, n, a) {
605
- const i = { credits: s, services: e };
604
+ async useCredits(t, e, s, r, n, a) {
605
+ const i = { credits: e, services: s };
606
606
  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
607
  }
608
608
  async getCredits(t) {
@@ -619,25 +619,31 @@ class B {
619
619
  return !1;
620
620
  }
621
621
  }
622
- async listInvoices(t, s, e) {
622
+ async listInvoices(t, e, s) {
623
623
  const r = [];
624
- s && r.push("date_from=" + s), e && r.push("date_to=" + e);
624
+ e && r.push("date_from=" + e), s && r.push("date_to=" + s);
625
625
  const n = r.length > 0 ? "?" + r.join("&") : "";
626
626
  return this.request("/customers/" + t + "/invoices" + n, "GET");
627
627
  }
628
628
  async cancelSubscription(t) {
629
629
  return this.request("/customers/" + t + "/subscription/actions/cancel", "POST", {});
630
630
  }
631
- async getUsageStats(t, s, e, r) {
631
+ async getUsageStats(t, e, s, r) {
632
632
  const n = [];
633
- 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)));
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)));
634
634
  const a = n.length > 0 ? "?" + n.join("&") : "";
635
635
  return this.request("/projects/" + t + "/subscription/usage-stats" + a, "GET");
636
636
  }
637
+ async listUsages(t, e, s, r, n, a, i) {
638
+ 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)));
640
+ const p = h.length > 0 ? "?" + h.join("&") : "";
641
+ return this.request("/projects/" + t + "/subscription/usages" + p, "GET");
642
+ }
637
643
  }
638
- class E extends c {
639
- constructor(t, s) {
640
- super(t, s);
644
+ class q extends c {
645
+ constructor(t, e) {
646
+ super(t, e);
641
647
  }
642
648
  async get(t) {
643
649
  return this.httpGet("/values/" + t);
@@ -697,51 +703,51 @@ class E extends c {
697
703
  return this.httpGet("/values/trigger-destination-types");
698
704
  }
699
705
  }
700
- class q {
701
- constructor(t, s, e) {
706
+ class R {
707
+ constructor(t, e, s) {
702
708
  u(this, "baseUrl");
703
709
  u(this, "workflowsBaseUrl");
704
710
  u(this, "billingBaseUrl");
705
- this.baseUrl = t, this.workflowsBaseUrl = s, this.billingBaseUrl = e || "https://persona.applica.guru/billing";
711
+ this.baseUrl = t, this.workflowsBaseUrl = e, this.billingBaseUrl = s || "https://persona.applica.guru/billing";
706
712
  }
707
713
  projects(t) {
708
- return new m(this.baseUrl, t, this.billingBaseUrl);
714
+ return new w(this.baseUrl, t, this.billingBaseUrl);
709
715
  }
710
716
  agents(t) {
711
- return new w(this.baseUrl, t);
717
+ return new P(this.baseUrl, t);
712
718
  }
713
719
  knowledgeBases(t) {
714
- return new b(this.baseUrl, t);
720
+ return new v(this.baseUrl, t);
715
721
  }
716
722
  workflows(t) {
717
- return new f(this.workflowsBaseUrl, t);
723
+ return new G(this.workflowsBaseUrl, t);
718
724
  }
719
725
  credentials(t) {
720
- return new G(this.baseUrl, t);
726
+ return new k(this.baseUrl, t);
721
727
  }
722
728
  features(t) {
723
729
  return new z(this.baseUrl, t);
724
730
  }
725
731
  triggers(t) {
726
- return new x(this.baseUrl, t);
732
+ return new S(this.baseUrl, t);
727
733
  }
728
734
  servicePrices(t) {
729
- return new S(this.baseUrl, t);
735
+ return new T(this.baseUrl, t);
730
736
  }
731
737
  knownModels(t) {
732
- return new T(this.baseUrl, t);
738
+ return new C(this.baseUrl, t);
733
739
  }
734
740
  sessions(t) {
735
741
  return new A(this.baseUrl, t);
736
742
  }
737
743
  missions(t) {
738
- return new C(this.baseUrl, t);
744
+ return new E(this.baseUrl, t);
739
745
  }
740
746
  billing(t) {
741
- return new B(this.billingBaseUrl, t);
747
+ return new j(this.billingBaseUrl, t);
742
748
  }
743
749
  values(t) {
744
- return new E(this.baseUrl, t);
750
+ return new q(this.baseUrl, t);
745
751
  }
746
752
  }
747
753
  class O {
@@ -756,26 +762,26 @@ class O {
756
762
  }
757
763
  }
758
764
  export {
759
- w as AgentsApi,
760
- p as ApiException,
761
- y as ApiKeyAuthenticationProvider,
765
+ P as AgentsApi,
766
+ l as ApiException,
767
+ m as ApiKeyAuthenticationProvider,
762
768
  O as BearerTokenAuthenticationProvider,
763
- B as BillingClient,
764
- G as CredentialsApi,
765
- k as FeatureTemplatesApi,
769
+ j as BillingClient,
770
+ k as CredentialsApi,
771
+ U as FeatureTemplatesApi,
766
772
  z as FeaturesApi,
767
- P as KnowledgeBaseDocumentsApi,
768
- b as KnowledgeBasesApi,
769
- T as KnownModelsApi,
770
- C as MissionsApi,
771
- q as PersonaSdk,
772
- m as ProjectsApi,
773
- S as ServicePricesApi,
773
+ b as KnowledgeBaseDocumentsApi,
774
+ v as KnowledgeBasesApi,
775
+ C as KnownModelsApi,
776
+ E as MissionsApi,
777
+ R as PersonaSdk,
778
+ w as ProjectsApi,
779
+ T as ServicePricesApi,
774
780
  A as SessionsApi,
775
- U as TriggerExecutionsApi,
776
- x as TriggersApi,
777
- E as ValuesApi,
778
- v as WorkflowExecutionsApi,
779
- f as WorkflowsApi
781
+ x as TriggerExecutionsApi,
782
+ S as TriggersApi,
783
+ q as ValuesApi,
784
+ f as WorkflowExecutionsApi,
785
+ G as WorkflowsApi
780
786
  };
781
787
  //# sourceMappingURL=bundle.es.js.map