@soat/sdk 0.13.20 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +239 -6
- package/dist/index.d.cts +3253 -2224
- package/dist/index.d.mts +3253 -2224
- package/dist/index.mjs +238 -7
- package/package.json +7 -9
package/dist/index.mjs
CHANGED
|
@@ -106,7 +106,8 @@ function createSseClient({ onRequest, onSseError, onSseEvent, responseTransforme
|
|
|
106
106
|
} catch (error) {
|
|
107
107
|
onSseError?.(error);
|
|
108
108
|
if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) break;
|
|
109
|
-
|
|
109
|
+
const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
|
|
110
|
+
await sleep(backoff);
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
};
|
|
@@ -1220,6 +1221,109 @@ var Conversations = class {
|
|
|
1220
1221
|
});
|
|
1221
1222
|
}
|
|
1222
1223
|
};
|
|
1224
|
+
var Discussions = class {
|
|
1225
|
+
/**
|
|
1226
|
+
* List discussions
|
|
1227
|
+
*
|
|
1228
|
+
* Returns all discussions the caller has access to. If project_id is provided, returns only discussions in that project.
|
|
1229
|
+
*/
|
|
1230
|
+
static listDiscussions(options) {
|
|
1231
|
+
return (options?.client ?? client).get({
|
|
1232
|
+
url: "/api/v1/discussions",
|
|
1233
|
+
...options
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Create a discussion
|
|
1238
|
+
*
|
|
1239
|
+
* Creates a new discussion config. project keys infer the project from the key's scope; JWT callers must supply project_id.
|
|
1240
|
+
*/
|
|
1241
|
+
static createDiscussion(options) {
|
|
1242
|
+
return (options.client ?? client).post({
|
|
1243
|
+
url: "/api/v1/discussions",
|
|
1244
|
+
...options,
|
|
1245
|
+
headers: {
|
|
1246
|
+
"Content-Type": "application/json",
|
|
1247
|
+
...options.headers
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Get a discussion run by ID
|
|
1253
|
+
*
|
|
1254
|
+
* Returns a single discussion run, including its outcome, transcript conversation, and outcome document.
|
|
1255
|
+
*/
|
|
1256
|
+
static getDiscussionRun(options) {
|
|
1257
|
+
return (options.client ?? client).get({
|
|
1258
|
+
url: "/api/v1/discussions/runs/{run_id}",
|
|
1259
|
+
...options
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Delete a discussion
|
|
1264
|
+
*
|
|
1265
|
+
* Deletes a discussion config and its participants.
|
|
1266
|
+
*/
|
|
1267
|
+
static deleteDiscussion(options) {
|
|
1268
|
+
return (options.client ?? client).delete({
|
|
1269
|
+
url: "/api/v1/discussions/{discussion_id}",
|
|
1270
|
+
...options
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Get a discussion by ID
|
|
1275
|
+
*
|
|
1276
|
+
* Returns a discussion config with its participants.
|
|
1277
|
+
*/
|
|
1278
|
+
static getDiscussion(options) {
|
|
1279
|
+
return (options.client ?? client).get({
|
|
1280
|
+
url: "/api/v1/discussions/{discussion_id}",
|
|
1281
|
+
...options
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Update a discussion
|
|
1286
|
+
*
|
|
1287
|
+
* Updates a discussion. Providing participants replaces the full set (not merged).
|
|
1288
|
+
*/
|
|
1289
|
+
static updateDiscussion(options) {
|
|
1290
|
+
return (options.client ?? client).patch({
|
|
1291
|
+
url: "/api/v1/discussions/{discussion_id}",
|
|
1292
|
+
...options,
|
|
1293
|
+
headers: {
|
|
1294
|
+
"Content-Type": "application/json",
|
|
1295
|
+
...options.headers
|
|
1296
|
+
}
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* List a discussion's runs
|
|
1301
|
+
*
|
|
1302
|
+
* Returns the run history of a discussion, most recent first.
|
|
1303
|
+
*/
|
|
1304
|
+
static listDiscussionRuns(options) {
|
|
1305
|
+
return (options.client ?? client).get({
|
|
1306
|
+
url: "/api/v1/discussions/{discussion_id}/runs",
|
|
1307
|
+
...options
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Invoke a discussion
|
|
1312
|
+
*
|
|
1313
|
+
* Runs the discussion synchronously over the given topic and returns the completed run, whose outcome inlines the synthesized text. The run's transcript is persisted as a conversation and the outcome as a document.
|
|
1314
|
+
*
|
|
1315
|
+
*/
|
|
1316
|
+
static createDiscussionRun(options) {
|
|
1317
|
+
return (options.client ?? client).post({
|
|
1318
|
+
url: "/api/v1/discussions/{discussion_id}/runs",
|
|
1319
|
+
...options,
|
|
1320
|
+
headers: {
|
|
1321
|
+
"Content-Type": "application/json",
|
|
1322
|
+
...options.headers
|
|
1323
|
+
}
|
|
1324
|
+
});
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1223
1327
|
var Documents = class {
|
|
1224
1328
|
/**
|
|
1225
1329
|
* List documents
|
|
@@ -2061,7 +2165,7 @@ var Orchestrations = class {
|
|
|
2061
2165
|
/**
|
|
2062
2166
|
* Start an orchestration run
|
|
2063
2167
|
*
|
|
2064
|
-
* Creates a new run for the orchestration named by orchestration_id. By default the run executes durably in the background: the response returns immediately with status "running" and progress is observed via get-orchestration-run or run lifecycle webhook events (orchestration_runs.started/
|
|
2168
|
+
* Creates a new run for the orchestration named by orchestration_id. By default the run executes durably in the background: the response returns immediately with status "running" and progress is observed via get-orchestration-run or run lifecycle webhook events (orchestration_runs.started/awaiting_input/succeeded/failed). Delay and poll waits park the run as "sleeping" and are woken by a background scheduler, surviving restarts. Pass wait=true to block until the run reaches a terminal or awaiting_input state (the legacy synchronous behaviour).
|
|
2065
2169
|
*/
|
|
2066
2170
|
static startOrchestrationRun(options) {
|
|
2067
2171
|
return (options.client ?? client).post({
|
|
@@ -2076,7 +2180,7 @@ var Orchestrations = class {
|
|
|
2076
2180
|
/**
|
|
2077
2181
|
* Cancel an orchestration run
|
|
2078
2182
|
*
|
|
2079
|
-
* Cancels a
|
|
2183
|
+
* Cancels a run that has not yet reached a terminal state.
|
|
2080
2184
|
*/
|
|
2081
2185
|
static cancelOrchestrationRun(options) {
|
|
2082
2186
|
return (options.client ?? client).post({
|
|
@@ -2087,7 +2191,7 @@ var Orchestrations = class {
|
|
|
2087
2191
|
/**
|
|
2088
2192
|
* Submit human input
|
|
2089
2193
|
*
|
|
2090
|
-
* Provides human input to a
|
|
2194
|
+
* Provides human input to a run that is awaiting_input at a human node.
|
|
2091
2195
|
*/
|
|
2092
2196
|
static submitHumanInput(options) {
|
|
2093
2197
|
return (options.client ?? client).post({
|
|
@@ -2102,7 +2206,7 @@ var Orchestrations = class {
|
|
|
2102
2206
|
/**
|
|
2103
2207
|
* Resume an orchestration run
|
|
2104
2208
|
*
|
|
2105
|
-
* Resumes
|
|
2209
|
+
* Resumes an awaiting_input orchestration run from its last checkpoint.
|
|
2106
2210
|
*/
|
|
2107
2211
|
static resumeOrchestrationRun(options) {
|
|
2108
2212
|
return (options.client ?? client).post({
|
|
@@ -2355,7 +2459,8 @@ var Sessions = class {
|
|
|
2355
2459
|
/**
|
|
2356
2460
|
* Delete a session
|
|
2357
2461
|
*
|
|
2358
|
-
* Deletes the session and its underlying conversation and
|
|
2462
|
+
* Deletes the session and its underlying conversation and messages. The session's actor is not deleted. Generations and traces produced by the session are not deleted either, since they are not linked to the session or conversation.
|
|
2463
|
+
*
|
|
2359
2464
|
*/
|
|
2360
2465
|
static deleteSession(options) {
|
|
2361
2466
|
return (options.client ?? client).delete({
|
|
@@ -2598,6 +2703,130 @@ var Traces = class {
|
|
|
2598
2703
|
});
|
|
2599
2704
|
}
|
|
2600
2705
|
};
|
|
2706
|
+
var Triggers = class {
|
|
2707
|
+
/**
|
|
2708
|
+
* List triggers
|
|
2709
|
+
*
|
|
2710
|
+
* Lists triggers. Filter by project, starter type, or target type.
|
|
2711
|
+
*/
|
|
2712
|
+
static listTriggers(options) {
|
|
2713
|
+
return (options?.client ?? client).get({
|
|
2714
|
+
url: "/api/v1/triggers",
|
|
2715
|
+
...options
|
|
2716
|
+
});
|
|
2717
|
+
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Create a trigger
|
|
2720
|
+
*
|
|
2721
|
+
* Creates a new trigger for a project
|
|
2722
|
+
*/
|
|
2723
|
+
static createTrigger(options) {
|
|
2724
|
+
return (options.client ?? client).post({
|
|
2725
|
+
url: "/api/v1/triggers",
|
|
2726
|
+
...options,
|
|
2727
|
+
headers: {
|
|
2728
|
+
"Content-Type": "application/json",
|
|
2729
|
+
...options.headers
|
|
2730
|
+
}
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* Delete a trigger
|
|
2735
|
+
*
|
|
2736
|
+
* Deletes a trigger
|
|
2737
|
+
*/
|
|
2738
|
+
static deleteTrigger(options) {
|
|
2739
|
+
return (options.client ?? client).delete({
|
|
2740
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2741
|
+
...options
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
/**
|
|
2745
|
+
* Get a trigger
|
|
2746
|
+
*
|
|
2747
|
+
* Retrieves the details of a specific trigger
|
|
2748
|
+
*/
|
|
2749
|
+
static getTrigger(options) {
|
|
2750
|
+
return (options.client ?? client).get({
|
|
2751
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2752
|
+
...options
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Update a trigger
|
|
2757
|
+
*
|
|
2758
|
+
* Updates an existing trigger's configuration. The type is immutable.
|
|
2759
|
+
*/
|
|
2760
|
+
static updateTrigger(options) {
|
|
2761
|
+
return (options.client ?? client).patch({
|
|
2762
|
+
url: "/api/v1/triggers/{trigger_id}",
|
|
2763
|
+
...options,
|
|
2764
|
+
headers: {
|
|
2765
|
+
"Content-Type": "application/json",
|
|
2766
|
+
...options.headers
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* Fire a trigger
|
|
2772
|
+
*
|
|
2773
|
+
* Fires a trigger synchronously and returns the terminal firing record.
|
|
2774
|
+
*/
|
|
2775
|
+
static fireTrigger(options) {
|
|
2776
|
+
return (options.client ?? client).post({
|
|
2777
|
+
url: "/api/v1/triggers/{trigger_id}/fire",
|
|
2778
|
+
...options,
|
|
2779
|
+
headers: {
|
|
2780
|
+
"Content-Type": "application/json",
|
|
2781
|
+
...options.headers
|
|
2782
|
+
}
|
|
2783
|
+
});
|
|
2784
|
+
}
|
|
2785
|
+
/**
|
|
2786
|
+
* Get trigger secret
|
|
2787
|
+
*
|
|
2788
|
+
* Retrieves the signing secret for a webhook trigger
|
|
2789
|
+
*/
|
|
2790
|
+
static getTriggerSecret(options) {
|
|
2791
|
+
return (options.client ?? client).get({
|
|
2792
|
+
url: "/api/v1/triggers/{trigger_id}/secret",
|
|
2793
|
+
...options
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
/**
|
|
2797
|
+
* Rotate trigger secret
|
|
2798
|
+
*
|
|
2799
|
+
* Rotates the signing secret for a webhook trigger
|
|
2800
|
+
*/
|
|
2801
|
+
static rotateTriggerSecret(options) {
|
|
2802
|
+
return (options.client ?? client).post({
|
|
2803
|
+
url: "/api/v1/triggers/{trigger_id}/rotate-secret",
|
|
2804
|
+
...options
|
|
2805
|
+
});
|
|
2806
|
+
}
|
|
2807
|
+
/**
|
|
2808
|
+
* List trigger firings
|
|
2809
|
+
*
|
|
2810
|
+
* Lists firings for a trigger (trigger_id is required).
|
|
2811
|
+
*/
|
|
2812
|
+
static listTriggerFirings(options) {
|
|
2813
|
+
return (options.client ?? client).get({
|
|
2814
|
+
url: "/api/v1/trigger-firings",
|
|
2815
|
+
...options
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
/**
|
|
2819
|
+
* Get a trigger firing
|
|
2820
|
+
*
|
|
2821
|
+
* Retrieves the details of a specific trigger firing
|
|
2822
|
+
*/
|
|
2823
|
+
static getTriggerFiring(options) {
|
|
2824
|
+
return (options.client ?? client).get({
|
|
2825
|
+
url: "/api/v1/trigger-firings/{firing_id}",
|
|
2826
|
+
...options
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
};
|
|
2601
2830
|
var Users = class {
|
|
2602
2831
|
/**
|
|
2603
2832
|
* Get the current authenticated user
|
|
@@ -2876,6 +3105,7 @@ var SoatClient = class {
|
|
|
2876
3105
|
sessions;
|
|
2877
3106
|
tools;
|
|
2878
3107
|
traces;
|
|
3108
|
+
triggers;
|
|
2879
3109
|
users;
|
|
2880
3110
|
webhooks;
|
|
2881
3111
|
constructor({ baseUrl, token, headers } = {}) {
|
|
@@ -2906,9 +3136,10 @@ var SoatClient = class {
|
|
|
2906
3136
|
this.sessions = bindResource(Sessions, httpClient);
|
|
2907
3137
|
this.tools = bindResource(Tools, httpClient);
|
|
2908
3138
|
this.traces = bindResource(Traces, httpClient);
|
|
3139
|
+
this.triggers = bindResource(Triggers, httpClient);
|
|
2909
3140
|
this.users = bindResource(Users, httpClient);
|
|
2910
3141
|
this.webhooks = bindResource(Webhooks, httpClient);
|
|
2911
3142
|
}
|
|
2912
3143
|
};
|
|
2913
3144
|
//#endregion
|
|
2914
|
-
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Users, Webhooks, createClient, createConfig };
|
|
3145
|
+
export { Actors, Agents, AiProviders, ApiKeys, Chats, Conversations, Discussions, Documents, Embeddings, Files, Formations, Generations, IngestionRules, Knowledge, Memories, MemoryEntries, Orchestrations, Policies, Projects, Secrets, Sessions, SoatClient, Tools, Traces, Triggers, Users, Webhooks, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soat/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "TypeScript SDK for the SOAT API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -29,14 +29,12 @@
|
|
|
29
29
|
"provenance": true
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@hey-api/
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"tsdown": "^0.22.1",
|
|
39
|
-
"tsx": "^4.22.4"
|
|
32
|
+
"@hey-api/openapi-ts": "^0.99.0",
|
|
33
|
+
"@ttoss/config": "^1.37.17",
|
|
34
|
+
"@types/node": "^24.13.2",
|
|
35
|
+
"js-yaml": "^5.2.1",
|
|
36
|
+
"tsdown": "^0.22.3",
|
|
37
|
+
"tsx": "^4.23.0"
|
|
40
38
|
},
|
|
41
39
|
"scripts": {
|
|
42
40
|
"build": "pnpm generate && tsdown",
|