@sixb/client 0.1.20 → 0.1.22
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/activity-attribution.d.ts +29 -0
- package/dist/activity-attribution.d.ts.map +1 -0
- package/dist/activity-tracker.d.ts +105 -0
- package/dist/activity-tracker.d.ts.map +1 -0
- package/dist/agent-streams.d.ts +5 -3
- package/dist/agent-streams.d.ts.map +1 -1
- package/dist/browser.d.ts +2 -0
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +513 -11
- package/dist/browser.js.map +6 -4
- package/dist/{chunk-awbb496e.js → chunk-1v736aje.js} +1 -1
- package/dist/{chunk-g05ar78c.js → chunk-263m4e9p.js} +38 -7
- package/dist/chunk-263m4e9p.js.map +17 -0
- package/dist/{chunk-tkjkrcdt.js → chunk-59f4fbnk.js} +505 -3
- package/dist/chunk-59f4fbnk.js.map +19 -0
- package/dist/{chunk-95bnb04n.js → chunk-9gz30dxy.js} +1 -1
- package/dist/{chunk-12s8gbwj.js → chunk-k2j71x7a.js} +2 -2
- package/dist/{chunk-3aa3m9z6.js → chunk-tttfv49k.js} +51 -6
- package/dist/chunk-tttfv49k.js.map +10 -0
- package/dist/connectors/queries.d.ts.map +1 -1
- package/dist/events-builder.d.ts +12 -0
- package/dist/events-builder.d.ts.map +1 -1
- package/dist/generated/@tanstack/react-query.gen.d.ts +13887 -2984
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/sdk.gen.d.ts +308 -2
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/types.gen.d.ts +12014 -5652
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +1150 -90
- package/dist/hooks.js.map +9 -8
- package/dist/index.js +120 -6
- package/dist/index.js.map +1 -1
- package/dist/logs.js +3 -3
- package/dist/models.js +116 -2
- package/dist/models.js.map +1 -1
- package/dist/query-hooks.d.ts +1 -1
- package/dist/query-hooks.d.ts.map +1 -1
- package/dist/query.d.ts +12 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +7 -5
- package/dist/query.js.map +1 -1
- package/dist/useAgentActivityStream.d.ts +3 -1
- package/dist/useAgentActivityStream.d.ts.map +1 -1
- package/dist/users-hooks.d.ts +109 -0
- package/dist/users-hooks.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/activity-attribution.ts +211 -0
- package/src/activity-tracker.ts +527 -0
- package/src/agent-streams.ts +16 -5
- package/src/browser.ts +14 -1
- package/src/events-builder.ts +51 -0
- package/src/generated/@tanstack/react-query.gen.ts +2100 -30
- package/src/generated/index.ts +349 -0
- package/src/generated/sdk.gen.ts +1334 -30
- package/src/generated/types.gen.ts +10044 -2418
- package/src/hooks.ts +8 -0
- package/src/query-hooks.ts +1 -1
- package/src/query.ts +86 -5
- package/src/useAgentActivityStream.ts +10 -1
- package/src/users-hooks.ts +87 -0
- package/dist/chunk-3aa3m9z6.js.map +0 -10
- package/dist/chunk-g05ar78c.js.map +0 -17
- package/dist/chunk-tkjkrcdt.js.map +0 -19
- /package/dist/{chunk-awbb496e.js.map → chunk-1v736aje.js.map} +0 -0
- /package/dist/{chunk-95bnb04n.js.map → chunk-9gz30dxy.js.map} +0 -0
- /package/dist/{chunk-12s8gbwj.js.map → chunk-k2j71x7a.js.map} +0 -0
|
@@ -11,41 +11,70 @@ import {
|
|
|
11
11
|
import { client } from "../client.gen"
|
|
12
12
|
import {
|
|
13
13
|
abortFileUpload,
|
|
14
|
+
addAgentThreadParticipants,
|
|
14
15
|
addConnectorConnection,
|
|
15
16
|
appendTelemetry,
|
|
16
17
|
cancelAgentRun,
|
|
18
|
+
cancelAgentRunById,
|
|
17
19
|
cancelWorkflowIntervention,
|
|
18
20
|
cancelWorkflowRun,
|
|
21
|
+
captureActivity,
|
|
22
|
+
clearArtifactState,
|
|
19
23
|
completeFileUpload,
|
|
20
24
|
countObjects,
|
|
21
25
|
createAgentThread,
|
|
22
26
|
createAiLimitPolicy,
|
|
27
|
+
createArtifact,
|
|
28
|
+
createArtifactFrame,
|
|
23
29
|
createAuthInvitation,
|
|
24
30
|
createAuthPersonalAccessToken,
|
|
25
31
|
createAuthServiceAccount,
|
|
26
32
|
createAuthServiceAccountAccessToken,
|
|
27
33
|
createDeviceAuthorization,
|
|
28
34
|
createFileUpload,
|
|
35
|
+
decideAgentApproval,
|
|
36
|
+
deleteAgentMemory,
|
|
29
37
|
deleteAiLimitPolicy,
|
|
38
|
+
deleteArtifact,
|
|
39
|
+
deleteArtifactStateValue,
|
|
30
40
|
disableAuthServiceAccount,
|
|
31
41
|
disconnectConnectorConnection,
|
|
32
42
|
exchangeDeviceAuthorization,
|
|
33
43
|
exchangeSharedAccess,
|
|
34
44
|
existsObjects,
|
|
35
45
|
facetObjects,
|
|
46
|
+
forkAgentThread,
|
|
47
|
+
generateImages,
|
|
48
|
+
generateSpeech,
|
|
49
|
+
generateText,
|
|
36
50
|
getAction,
|
|
37
51
|
getActionRun,
|
|
38
52
|
getActionRunFileContent,
|
|
53
|
+
getActivityCalendar,
|
|
54
|
+
getActivityCaptureConfig,
|
|
55
|
+
getActivitySummary,
|
|
56
|
+
getActivityVisitTimeline,
|
|
39
57
|
getAgent,
|
|
58
|
+
getAgentChildFileContent,
|
|
59
|
+
getAgentMemory,
|
|
40
60
|
getAgentMessageFileContent,
|
|
61
|
+
getAgentPreferences,
|
|
41
62
|
getAgentRun,
|
|
42
63
|
getAgentThread,
|
|
43
64
|
getAiAccountingOverview,
|
|
44
65
|
getAiLimitStatus,
|
|
45
66
|
getAiLimitSubjectOptions,
|
|
67
|
+
getAiModelCallFileContent,
|
|
68
|
+
getAiModelCallFiles,
|
|
69
|
+
getArtifact,
|
|
70
|
+
getArtifactFileContent,
|
|
71
|
+
getArtifactQuery,
|
|
72
|
+
getArtifactState,
|
|
73
|
+
getArtifactVersion,
|
|
46
74
|
getAuthAccessManagementOptions,
|
|
47
75
|
getAuthInvitationOptions,
|
|
48
76
|
getAuthMembershipOptions,
|
|
77
|
+
getAuthProfile,
|
|
49
78
|
getAuthSession,
|
|
50
79
|
getBulkTelemetryHistory,
|
|
51
80
|
getConnector,
|
|
@@ -54,8 +83,12 @@ import {
|
|
|
54
83
|
getDatasetVersion,
|
|
55
84
|
getLatestTelemetry,
|
|
56
85
|
getObject,
|
|
86
|
+
getObjectByUniqueProperty,
|
|
57
87
|
getObjectFileContent,
|
|
58
88
|
getObjectType,
|
|
89
|
+
getObservedAgentChildFileContent,
|
|
90
|
+
getObservedAgentMessageFileContent,
|
|
91
|
+
getObservedAgentThread,
|
|
59
92
|
getPipeline,
|
|
60
93
|
getPipelineRun,
|
|
61
94
|
getProjectInfo,
|
|
@@ -66,6 +99,7 @@ import {
|
|
|
66
99
|
getStatus,
|
|
67
100
|
getSync,
|
|
68
101
|
getTelemetryHistory,
|
|
102
|
+
getUser,
|
|
69
103
|
getWorkflow,
|
|
70
104
|
getWorkflowAgentNodeExecution,
|
|
71
105
|
getWorkflowIntervention,
|
|
@@ -75,12 +109,20 @@ import {
|
|
|
75
109
|
issueSharedAccessGrant,
|
|
76
110
|
listActionRuns,
|
|
77
111
|
listActions,
|
|
112
|
+
listActivityConnections,
|
|
113
|
+
listActivityUsers,
|
|
114
|
+
listActivityVisits,
|
|
115
|
+
listAgentApprovals,
|
|
116
|
+
listAgentMemoryRevisions,
|
|
117
|
+
listAgentThreadApprovals,
|
|
118
|
+
listAgentThreadChildren,
|
|
78
119
|
listAgentThreadMessages,
|
|
79
120
|
listAgentThreadRuns,
|
|
80
121
|
listAgentThreads,
|
|
81
122
|
listAiLimitPolicies,
|
|
82
123
|
listAiModelCallGroups,
|
|
83
124
|
listAiModelCalls,
|
|
125
|
+
listArtifacts,
|
|
84
126
|
listAuthAccessTokens,
|
|
85
127
|
listAuthInvitations,
|
|
86
128
|
listAuthMembers,
|
|
@@ -97,6 +139,9 @@ import {
|
|
|
97
139
|
listModels,
|
|
98
140
|
listObjects,
|
|
99
141
|
listObjectTypes,
|
|
142
|
+
listObservedAgentThreadChildren,
|
|
143
|
+
listObservedAgentThreadMessages,
|
|
144
|
+
listObservedAgentThreadRuns,
|
|
100
145
|
listPendingConnectorConnectionRuns,
|
|
101
146
|
listPipelineRuns,
|
|
102
147
|
listPipelines,
|
|
@@ -107,18 +152,21 @@ import {
|
|
|
107
152
|
listSharedAccessGrants,
|
|
108
153
|
listSyncRuns,
|
|
109
154
|
listSyncs,
|
|
155
|
+
listUsers,
|
|
110
156
|
listWebhookRuns,
|
|
111
157
|
listWorkflowInterventions,
|
|
112
158
|
listWorkflowRuns,
|
|
113
159
|
listWorkflows,
|
|
114
160
|
type Options,
|
|
115
161
|
postAgentThreadMessage,
|
|
162
|
+
publishArtifactVersion,
|
|
116
163
|
queryObjectLinks,
|
|
117
164
|
queryObjects,
|
|
118
165
|
reactivateAuthMember,
|
|
119
166
|
reauthorizeConnectorConnection,
|
|
120
167
|
recreateAgentThreadSandbox,
|
|
121
168
|
refreshAuthSession,
|
|
169
|
+
removeAgentThreadParticipant,
|
|
122
170
|
removeObjectLink,
|
|
123
171
|
requestAction,
|
|
124
172
|
requestPipelineRun,
|
|
@@ -131,8 +179,11 @@ import {
|
|
|
131
179
|
revokeAuthSession,
|
|
132
180
|
revokeConnectorConnection,
|
|
133
181
|
revokeSharedAccessGrant,
|
|
182
|
+
saveAgentMemory,
|
|
134
183
|
searchObjects,
|
|
135
184
|
selectConnectorConnectionRunAccount,
|
|
185
|
+
setAgentThreadApprovalMode,
|
|
186
|
+
setArtifactState,
|
|
136
187
|
signFileUploadPart,
|
|
137
188
|
signOut,
|
|
138
189
|
signOutAll,
|
|
@@ -140,8 +191,11 @@ import {
|
|
|
140
191
|
startConnectorConnectionRun,
|
|
141
192
|
submitWorkflowIntervention,
|
|
142
193
|
suspendAuthMember,
|
|
194
|
+
transcribeAudio,
|
|
195
|
+
updateAgentPreferences,
|
|
143
196
|
updateAiLimitPolicy,
|
|
144
197
|
updateAuthMemberGroups,
|
|
198
|
+
updateAuthProfile,
|
|
145
199
|
uploadFileContent,
|
|
146
200
|
uploadFileRaw,
|
|
147
201
|
upsertObject,
|
|
@@ -151,12 +205,18 @@ import type {
|
|
|
151
205
|
AbortFileUploadData,
|
|
152
206
|
AbortFileUploadError,
|
|
153
207
|
AbortFileUploadResponse,
|
|
208
|
+
AddAgentThreadParticipantsData,
|
|
209
|
+
AddAgentThreadParticipantsError,
|
|
210
|
+
AddAgentThreadParticipantsResponse,
|
|
154
211
|
AddConnectorConnectionData,
|
|
155
212
|
AddConnectorConnectionError,
|
|
156
213
|
AddConnectorConnectionResponse,
|
|
157
214
|
AppendTelemetryData,
|
|
158
215
|
AppendTelemetryError,
|
|
159
216
|
AppendTelemetryResponse,
|
|
217
|
+
CancelAgentRunByIdData,
|
|
218
|
+
CancelAgentRunByIdError,
|
|
219
|
+
CancelAgentRunByIdResponse,
|
|
160
220
|
CancelAgentRunData,
|
|
161
221
|
CancelAgentRunError,
|
|
162
222
|
CancelAgentRunResponse,
|
|
@@ -166,6 +226,12 @@ import type {
|
|
|
166
226
|
CancelWorkflowRunData,
|
|
167
227
|
CancelWorkflowRunError,
|
|
168
228
|
CancelWorkflowRunResponse,
|
|
229
|
+
CaptureActivityData,
|
|
230
|
+
CaptureActivityError,
|
|
231
|
+
CaptureActivityResponse,
|
|
232
|
+
ClearArtifactStateData,
|
|
233
|
+
ClearArtifactStateError,
|
|
234
|
+
ClearArtifactStateResponse,
|
|
169
235
|
CompleteFileUploadData,
|
|
170
236
|
CompleteFileUploadError,
|
|
171
237
|
CompleteFileUploadResponse,
|
|
@@ -178,6 +244,12 @@ import type {
|
|
|
178
244
|
CreateAiLimitPolicyData,
|
|
179
245
|
CreateAiLimitPolicyError,
|
|
180
246
|
CreateAiLimitPolicyResponse,
|
|
247
|
+
CreateArtifactData,
|
|
248
|
+
CreateArtifactError,
|
|
249
|
+
CreateArtifactFrameData,
|
|
250
|
+
CreateArtifactFrameError,
|
|
251
|
+
CreateArtifactFrameResponse,
|
|
252
|
+
CreateArtifactResponse,
|
|
181
253
|
CreateAuthInvitationData,
|
|
182
254
|
CreateAuthInvitationError,
|
|
183
255
|
CreateAuthInvitationResponse,
|
|
@@ -196,9 +268,21 @@ import type {
|
|
|
196
268
|
CreateFileUploadData,
|
|
197
269
|
CreateFileUploadError,
|
|
198
270
|
CreateFileUploadResponse,
|
|
271
|
+
DecideAgentApprovalData,
|
|
272
|
+
DecideAgentApprovalError,
|
|
273
|
+
DecideAgentApprovalResponse,
|
|
274
|
+
DeleteAgentMemoryData,
|
|
275
|
+
DeleteAgentMemoryError,
|
|
276
|
+
DeleteAgentMemoryResponse,
|
|
199
277
|
DeleteAiLimitPolicyData,
|
|
200
278
|
DeleteAiLimitPolicyError,
|
|
201
279
|
DeleteAiLimitPolicyResponse,
|
|
280
|
+
DeleteArtifactData,
|
|
281
|
+
DeleteArtifactError,
|
|
282
|
+
DeleteArtifactResponse,
|
|
283
|
+
DeleteArtifactStateValueData,
|
|
284
|
+
DeleteArtifactStateValueError,
|
|
285
|
+
DeleteArtifactStateValueResponse,
|
|
202
286
|
DisableAuthServiceAccountData,
|
|
203
287
|
DisableAuthServiceAccountError,
|
|
204
288
|
DisableAuthServiceAccountResponse,
|
|
@@ -216,6 +300,18 @@ import type {
|
|
|
216
300
|
FacetObjectsData,
|
|
217
301
|
FacetObjectsError,
|
|
218
302
|
FacetObjectsResponse,
|
|
303
|
+
ForkAgentThreadData,
|
|
304
|
+
ForkAgentThreadError,
|
|
305
|
+
ForkAgentThreadResponse,
|
|
306
|
+
GenerateImagesData,
|
|
307
|
+
GenerateImagesError,
|
|
308
|
+
GenerateImagesResponse,
|
|
309
|
+
GenerateSpeechData,
|
|
310
|
+
GenerateSpeechError,
|
|
311
|
+
GenerateSpeechResponse,
|
|
312
|
+
GenerateTextData,
|
|
313
|
+
GenerateTextError,
|
|
314
|
+
GenerateTextResponse,
|
|
219
315
|
GetActionData,
|
|
220
316
|
GetActionError,
|
|
221
317
|
GetActionResponse,
|
|
@@ -225,11 +321,32 @@ import type {
|
|
|
225
321
|
GetActionRunFileContentError,
|
|
226
322
|
GetActionRunFileContentResponse,
|
|
227
323
|
GetActionRunResponse,
|
|
324
|
+
GetActivityCalendarData,
|
|
325
|
+
GetActivityCalendarError,
|
|
326
|
+
GetActivityCalendarResponse,
|
|
327
|
+
GetActivityCaptureConfigData,
|
|
328
|
+
GetActivityCaptureConfigError,
|
|
329
|
+
GetActivityCaptureConfigResponse,
|
|
330
|
+
GetActivitySummaryData,
|
|
331
|
+
GetActivitySummaryError,
|
|
332
|
+
GetActivitySummaryResponse,
|
|
333
|
+
GetActivityVisitTimelineData,
|
|
334
|
+
GetActivityVisitTimelineError,
|
|
335
|
+
GetActivityVisitTimelineResponse,
|
|
336
|
+
GetAgentChildFileContentData,
|
|
337
|
+
GetAgentChildFileContentError,
|
|
338
|
+
GetAgentChildFileContentResponse,
|
|
228
339
|
GetAgentData,
|
|
229
340
|
GetAgentError,
|
|
341
|
+
GetAgentMemoryData,
|
|
342
|
+
GetAgentMemoryError,
|
|
343
|
+
GetAgentMemoryResponse,
|
|
230
344
|
GetAgentMessageFileContentData,
|
|
231
345
|
GetAgentMessageFileContentError,
|
|
232
346
|
GetAgentMessageFileContentResponse,
|
|
347
|
+
GetAgentPreferencesData,
|
|
348
|
+
GetAgentPreferencesError,
|
|
349
|
+
GetAgentPreferencesResponse,
|
|
233
350
|
GetAgentResponse,
|
|
234
351
|
GetAgentRunData,
|
|
235
352
|
GetAgentRunError,
|
|
@@ -246,6 +363,27 @@ import type {
|
|
|
246
363
|
GetAiLimitSubjectOptionsData,
|
|
247
364
|
GetAiLimitSubjectOptionsError,
|
|
248
365
|
GetAiLimitSubjectOptionsResponse,
|
|
366
|
+
GetAiModelCallFileContentData,
|
|
367
|
+
GetAiModelCallFileContentError,
|
|
368
|
+
GetAiModelCallFileContentResponse,
|
|
369
|
+
GetAiModelCallFilesData,
|
|
370
|
+
GetAiModelCallFilesError,
|
|
371
|
+
GetAiModelCallFilesResponse,
|
|
372
|
+
GetArtifactData,
|
|
373
|
+
GetArtifactError,
|
|
374
|
+
GetArtifactFileContentData,
|
|
375
|
+
GetArtifactFileContentError,
|
|
376
|
+
GetArtifactFileContentResponse,
|
|
377
|
+
GetArtifactQueryData,
|
|
378
|
+
GetArtifactQueryError,
|
|
379
|
+
GetArtifactQueryResponse,
|
|
380
|
+
GetArtifactResponse,
|
|
381
|
+
GetArtifactStateData,
|
|
382
|
+
GetArtifactStateError,
|
|
383
|
+
GetArtifactStateResponse,
|
|
384
|
+
GetArtifactVersionData,
|
|
385
|
+
GetArtifactVersionError,
|
|
386
|
+
GetArtifactVersionResponse,
|
|
249
387
|
GetAuthAccessManagementOptionsData,
|
|
250
388
|
GetAuthAccessManagementOptionsError,
|
|
251
389
|
GetAuthAccessManagementOptionsResponse,
|
|
@@ -255,6 +393,9 @@ import type {
|
|
|
255
393
|
GetAuthMembershipOptionsData,
|
|
256
394
|
GetAuthMembershipOptionsError,
|
|
257
395
|
GetAuthMembershipOptionsResponse,
|
|
396
|
+
GetAuthProfileData,
|
|
397
|
+
GetAuthProfileError,
|
|
398
|
+
GetAuthProfileResponse,
|
|
258
399
|
GetAuthSessionData,
|
|
259
400
|
GetAuthSessionResponse,
|
|
260
401
|
GetBulkTelemetryHistoryData,
|
|
@@ -275,6 +416,9 @@ import type {
|
|
|
275
416
|
GetLatestTelemetryData,
|
|
276
417
|
GetLatestTelemetryError,
|
|
277
418
|
GetLatestTelemetryResponse,
|
|
419
|
+
GetObjectByUniquePropertyData,
|
|
420
|
+
GetObjectByUniquePropertyError,
|
|
421
|
+
GetObjectByUniquePropertyResponse,
|
|
278
422
|
GetObjectData,
|
|
279
423
|
GetObjectError,
|
|
280
424
|
GetObjectFileContentData,
|
|
@@ -284,6 +428,15 @@ import type {
|
|
|
284
428
|
GetObjectTypeData,
|
|
285
429
|
GetObjectTypeError,
|
|
286
430
|
GetObjectTypeResponse,
|
|
431
|
+
GetObservedAgentChildFileContentData,
|
|
432
|
+
GetObservedAgentChildFileContentError,
|
|
433
|
+
GetObservedAgentChildFileContentResponse,
|
|
434
|
+
GetObservedAgentMessageFileContentData,
|
|
435
|
+
GetObservedAgentMessageFileContentError,
|
|
436
|
+
GetObservedAgentMessageFileContentResponse,
|
|
437
|
+
GetObservedAgentThreadData,
|
|
438
|
+
GetObservedAgentThreadError,
|
|
439
|
+
GetObservedAgentThreadResponse,
|
|
287
440
|
GetPipelineData,
|
|
288
441
|
GetPipelineError,
|
|
289
442
|
GetPipelineResponse,
|
|
@@ -312,6 +465,9 @@ import type {
|
|
|
312
465
|
GetTelemetryHistoryData,
|
|
313
466
|
GetTelemetryHistoryError,
|
|
314
467
|
GetTelemetryHistoryResponse,
|
|
468
|
+
GetUserData,
|
|
469
|
+
GetUserError,
|
|
470
|
+
GetUserResponse,
|
|
315
471
|
GetWorkflowAgentNodeExecutionData,
|
|
316
472
|
GetWorkflowAgentNodeExecutionError,
|
|
317
473
|
GetWorkflowAgentNodeExecutionResponse,
|
|
@@ -338,6 +494,27 @@ import type {
|
|
|
338
494
|
ListActionRunsResponse,
|
|
339
495
|
ListActionsData,
|
|
340
496
|
ListActionsResponse,
|
|
497
|
+
ListActivityConnectionsData,
|
|
498
|
+
ListActivityConnectionsError,
|
|
499
|
+
ListActivityConnectionsResponse,
|
|
500
|
+
ListActivityUsersData,
|
|
501
|
+
ListActivityUsersError,
|
|
502
|
+
ListActivityUsersResponse,
|
|
503
|
+
ListActivityVisitsData,
|
|
504
|
+
ListActivityVisitsError,
|
|
505
|
+
ListActivityVisitsResponse,
|
|
506
|
+
ListAgentApprovalsData,
|
|
507
|
+
ListAgentApprovalsError,
|
|
508
|
+
ListAgentApprovalsResponse,
|
|
509
|
+
ListAgentMemoryRevisionsData,
|
|
510
|
+
ListAgentMemoryRevisionsError,
|
|
511
|
+
ListAgentMemoryRevisionsResponse,
|
|
512
|
+
ListAgentThreadApprovalsData,
|
|
513
|
+
ListAgentThreadApprovalsError,
|
|
514
|
+
ListAgentThreadApprovalsResponse,
|
|
515
|
+
ListAgentThreadChildrenData,
|
|
516
|
+
ListAgentThreadChildrenError,
|
|
517
|
+
ListAgentThreadChildrenResponse,
|
|
341
518
|
ListAgentThreadMessagesData,
|
|
342
519
|
ListAgentThreadMessagesError,
|
|
343
520
|
ListAgentThreadMessagesResponse,
|
|
@@ -356,6 +533,9 @@ import type {
|
|
|
356
533
|
ListAiModelCallsData,
|
|
357
534
|
ListAiModelCallsError,
|
|
358
535
|
ListAiModelCallsResponse,
|
|
536
|
+
ListArtifactsData,
|
|
537
|
+
ListArtifactsError,
|
|
538
|
+
ListArtifactsResponse,
|
|
359
539
|
ListAuthAccessTokensData,
|
|
360
540
|
ListAuthAccessTokensError,
|
|
361
541
|
ListAuthAccessTokensResponse,
|
|
@@ -401,6 +581,15 @@ import type {
|
|
|
401
581
|
ListObjectsResponse,
|
|
402
582
|
ListObjectTypesData,
|
|
403
583
|
ListObjectTypesResponse,
|
|
584
|
+
ListObservedAgentThreadChildrenData,
|
|
585
|
+
ListObservedAgentThreadChildrenError,
|
|
586
|
+
ListObservedAgentThreadChildrenResponse,
|
|
587
|
+
ListObservedAgentThreadMessagesData,
|
|
588
|
+
ListObservedAgentThreadMessagesError,
|
|
589
|
+
ListObservedAgentThreadMessagesResponse,
|
|
590
|
+
ListObservedAgentThreadRunsData,
|
|
591
|
+
ListObservedAgentThreadRunsError,
|
|
592
|
+
ListObservedAgentThreadRunsResponse,
|
|
404
593
|
ListPendingConnectorConnectionRunsData,
|
|
405
594
|
ListPendingConnectorConnectionRunsError,
|
|
406
595
|
ListPendingConnectorConnectionRunsResponse,
|
|
@@ -427,6 +616,9 @@ import type {
|
|
|
427
616
|
ListSyncRunsResponse,
|
|
428
617
|
ListSyncsData,
|
|
429
618
|
ListSyncsResponse,
|
|
619
|
+
ListUsersData,
|
|
620
|
+
ListUsersError,
|
|
621
|
+
ListUsersResponse,
|
|
430
622
|
ListWebhookRunsData,
|
|
431
623
|
ListWebhookRunsError,
|
|
432
624
|
ListWebhookRunsResponse,
|
|
@@ -441,6 +633,9 @@ import type {
|
|
|
441
633
|
PostAgentThreadMessageData,
|
|
442
634
|
PostAgentThreadMessageError,
|
|
443
635
|
PostAgentThreadMessageResponse,
|
|
636
|
+
PublishArtifactVersionData,
|
|
637
|
+
PublishArtifactVersionError,
|
|
638
|
+
PublishArtifactVersionResponse,
|
|
444
639
|
QueryObjectLinksData,
|
|
445
640
|
QueryObjectLinksError,
|
|
446
641
|
QueryObjectLinksResponse,
|
|
@@ -459,6 +654,8 @@ import type {
|
|
|
459
654
|
RefreshAuthSessionData,
|
|
460
655
|
RefreshAuthSessionError,
|
|
461
656
|
RefreshAuthSessionResponse,
|
|
657
|
+
RemoveAgentThreadParticipantData,
|
|
658
|
+
RemoveAgentThreadParticipantError,
|
|
462
659
|
RemoveObjectLinkData,
|
|
463
660
|
RemoveObjectLinkError,
|
|
464
661
|
RemoveObjectLinkResponse,
|
|
@@ -495,12 +692,21 @@ import type {
|
|
|
495
692
|
RevokeSharedAccessGrantData,
|
|
496
693
|
RevokeSharedAccessGrantError,
|
|
497
694
|
RevokeSharedAccessGrantResponse,
|
|
695
|
+
SaveAgentMemoryData,
|
|
696
|
+
SaveAgentMemoryError,
|
|
697
|
+
SaveAgentMemoryResponse,
|
|
498
698
|
SearchObjectsData,
|
|
499
699
|
SearchObjectsError,
|
|
500
700
|
SearchObjectsResponse,
|
|
501
701
|
SelectConnectorConnectionRunAccountData,
|
|
502
702
|
SelectConnectorConnectionRunAccountError,
|
|
503
703
|
SelectConnectorConnectionRunAccountResponse,
|
|
704
|
+
SetAgentThreadApprovalModeData,
|
|
705
|
+
SetAgentThreadApprovalModeError,
|
|
706
|
+
SetAgentThreadApprovalModeResponse,
|
|
707
|
+
SetArtifactStateData,
|
|
708
|
+
SetArtifactStateError,
|
|
709
|
+
SetArtifactStateResponse,
|
|
504
710
|
SignFileUploadPartData,
|
|
505
711
|
SignFileUploadPartError,
|
|
506
712
|
SignFileUploadPartResponse,
|
|
@@ -522,12 +728,21 @@ import type {
|
|
|
522
728
|
SuspendAuthMemberData,
|
|
523
729
|
SuspendAuthMemberError,
|
|
524
730
|
SuspendAuthMemberResponse,
|
|
731
|
+
TranscribeAudioData,
|
|
732
|
+
TranscribeAudioError,
|
|
733
|
+
TranscribeAudioResponse,
|
|
734
|
+
UpdateAgentPreferencesData,
|
|
735
|
+
UpdateAgentPreferencesError,
|
|
736
|
+
UpdateAgentPreferencesResponse,
|
|
525
737
|
UpdateAiLimitPolicyData,
|
|
526
738
|
UpdateAiLimitPolicyError,
|
|
527
739
|
UpdateAiLimitPolicyResponse,
|
|
528
740
|
UpdateAuthMemberGroupsData,
|
|
529
741
|
UpdateAuthMemberGroupsError,
|
|
530
742
|
UpdateAuthMemberGroupsResponse,
|
|
743
|
+
UpdateAuthProfileData,
|
|
744
|
+
UpdateAuthProfileError,
|
|
745
|
+
UpdateAuthProfileResponse,
|
|
531
746
|
UploadFileContentData,
|
|
532
747
|
UploadFileContentError,
|
|
533
748
|
UploadFileContentResponse,
|
|
@@ -781,6 +996,60 @@ export const signOutAllMutation = (
|
|
|
781
996
|
return mutationOptions
|
|
782
997
|
}
|
|
783
998
|
|
|
999
|
+
export const getAuthProfileQueryKey = (options?: Options<GetAuthProfileData>) =>
|
|
1000
|
+
createQueryKey("getAuthProfile", options)
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* Get the current user's profile
|
|
1004
|
+
*/
|
|
1005
|
+
export const getAuthProfileOptions = (options?: Options<GetAuthProfileData>) =>
|
|
1006
|
+
queryOptions<
|
|
1007
|
+
GetAuthProfileResponse,
|
|
1008
|
+
GetAuthProfileError,
|
|
1009
|
+
GetAuthProfileResponse,
|
|
1010
|
+
ReturnType<typeof getAuthProfileQueryKey>
|
|
1011
|
+
>({
|
|
1012
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
1013
|
+
const { data } = await getAuthProfile({
|
|
1014
|
+
...options,
|
|
1015
|
+
...queryKey[0],
|
|
1016
|
+
signal,
|
|
1017
|
+
throwOnError: true,
|
|
1018
|
+
})
|
|
1019
|
+
return data
|
|
1020
|
+
},
|
|
1021
|
+
queryKey: getAuthProfileQueryKey(options),
|
|
1022
|
+
})
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* Update the current user's name or picture
|
|
1026
|
+
*
|
|
1027
|
+
* Fields the identity provider manages, listed in `managedFields`, are refused with 403.
|
|
1028
|
+
*/
|
|
1029
|
+
export const updateAuthProfileMutation = (
|
|
1030
|
+
options?: Partial<Options<UpdateAuthProfileData>>
|
|
1031
|
+
): UseMutationOptions<
|
|
1032
|
+
UpdateAuthProfileResponse,
|
|
1033
|
+
UpdateAuthProfileError,
|
|
1034
|
+
Options<UpdateAuthProfileData>
|
|
1035
|
+
> => {
|
|
1036
|
+
const mutationOptions: UseMutationOptions<
|
|
1037
|
+
UpdateAuthProfileResponse,
|
|
1038
|
+
UpdateAuthProfileError,
|
|
1039
|
+
Options<UpdateAuthProfileData>
|
|
1040
|
+
> = {
|
|
1041
|
+
mutationFn: async (fnOptions) => {
|
|
1042
|
+
const { data } = await updateAuthProfile({
|
|
1043
|
+
...options,
|
|
1044
|
+
...fnOptions,
|
|
1045
|
+
throwOnError: true,
|
|
1046
|
+
})
|
|
1047
|
+
return data
|
|
1048
|
+
},
|
|
1049
|
+
}
|
|
1050
|
+
return mutationOptions
|
|
1051
|
+
}
|
|
1052
|
+
|
|
784
1053
|
export const getAuthAccessManagementOptionsQueryKey = (
|
|
785
1054
|
options?: Options<GetAuthAccessManagementOptionsData>
|
|
786
1055
|
) => createQueryKey("getAuthAccessManagementOptions", options)
|
|
@@ -1727,6 +1996,153 @@ export const listAiModelCallGroupsInfiniteOptions = (options: Options<ListAiMode
|
|
|
1727
1996
|
}
|
|
1728
1997
|
)
|
|
1729
1998
|
|
|
1999
|
+
export const getAiModelCallFilesQueryKey = (options: Options<GetAiModelCallFilesData>) =>
|
|
2000
|
+
createQueryKey("getAiModelCallFiles", options)
|
|
2001
|
+
|
|
2002
|
+
/**
|
|
2003
|
+
* Get the files a model call produced
|
|
2004
|
+
*/
|
|
2005
|
+
export const getAiModelCallFilesOptions = (options: Options<GetAiModelCallFilesData>) =>
|
|
2006
|
+
queryOptions<
|
|
2007
|
+
GetAiModelCallFilesResponse,
|
|
2008
|
+
GetAiModelCallFilesError,
|
|
2009
|
+
GetAiModelCallFilesResponse,
|
|
2010
|
+
ReturnType<typeof getAiModelCallFilesQueryKey>
|
|
2011
|
+
>({
|
|
2012
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2013
|
+
const { data } = await getAiModelCallFiles({
|
|
2014
|
+
...options,
|
|
2015
|
+
...queryKey[0],
|
|
2016
|
+
signal,
|
|
2017
|
+
throwOnError: true,
|
|
2018
|
+
})
|
|
2019
|
+
return data
|
|
2020
|
+
},
|
|
2021
|
+
queryKey: getAiModelCallFilesQueryKey(options),
|
|
2022
|
+
})
|
|
2023
|
+
|
|
2024
|
+
export const getAiModelCallFileContentQueryKey = (
|
|
2025
|
+
options: Options<GetAiModelCallFileContentData>
|
|
2026
|
+
) => createQueryKey("getAiModelCallFileContent", options)
|
|
2027
|
+
|
|
2028
|
+
/**
|
|
2029
|
+
* Get model call file content
|
|
2030
|
+
*/
|
|
2031
|
+
export const getAiModelCallFileContentOptions = (options: Options<GetAiModelCallFileContentData>) =>
|
|
2032
|
+
queryOptions<
|
|
2033
|
+
GetAiModelCallFileContentResponse,
|
|
2034
|
+
GetAiModelCallFileContentError,
|
|
2035
|
+
GetAiModelCallFileContentResponse,
|
|
2036
|
+
ReturnType<typeof getAiModelCallFileContentQueryKey>
|
|
2037
|
+
>({
|
|
2038
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
2039
|
+
const { data } = await getAiModelCallFileContent({
|
|
2040
|
+
...options,
|
|
2041
|
+
...queryKey[0],
|
|
2042
|
+
signal,
|
|
2043
|
+
throwOnError: true,
|
|
2044
|
+
})
|
|
2045
|
+
return data
|
|
2046
|
+
},
|
|
2047
|
+
queryKey: getAiModelCallFileContentQueryKey(options),
|
|
2048
|
+
})
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Generate text with a language model
|
|
2052
|
+
*/
|
|
2053
|
+
export const generateTextMutation = (
|
|
2054
|
+
options?: Partial<Options<GenerateTextData>>
|
|
2055
|
+
): UseMutationOptions<GenerateTextResponse, GenerateTextError, Options<GenerateTextData>> => {
|
|
2056
|
+
const mutationOptions: UseMutationOptions<
|
|
2057
|
+
GenerateTextResponse,
|
|
2058
|
+
GenerateTextError,
|
|
2059
|
+
Options<GenerateTextData>
|
|
2060
|
+
> = {
|
|
2061
|
+
mutationFn: async (fnOptions) => {
|
|
2062
|
+
const { data } = await generateText({
|
|
2063
|
+
...options,
|
|
2064
|
+
...fnOptions,
|
|
2065
|
+
throwOnError: true,
|
|
2066
|
+
})
|
|
2067
|
+
return data
|
|
2068
|
+
},
|
|
2069
|
+
}
|
|
2070
|
+
return mutationOptions
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
/**
|
|
2074
|
+
* Generate images with an image model
|
|
2075
|
+
*/
|
|
2076
|
+
export const generateImagesMutation = (
|
|
2077
|
+
options?: Partial<Options<GenerateImagesData>>
|
|
2078
|
+
): UseMutationOptions<GenerateImagesResponse, GenerateImagesError, Options<GenerateImagesData>> => {
|
|
2079
|
+
const mutationOptions: UseMutationOptions<
|
|
2080
|
+
GenerateImagesResponse,
|
|
2081
|
+
GenerateImagesError,
|
|
2082
|
+
Options<GenerateImagesData>
|
|
2083
|
+
> = {
|
|
2084
|
+
mutationFn: async (fnOptions) => {
|
|
2085
|
+
const { data } = await generateImages({
|
|
2086
|
+
...options,
|
|
2087
|
+
...fnOptions,
|
|
2088
|
+
throwOnError: true,
|
|
2089
|
+
})
|
|
2090
|
+
return data
|
|
2091
|
+
},
|
|
2092
|
+
}
|
|
2093
|
+
return mutationOptions
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
/**
|
|
2097
|
+
* Generate speech with a speech model
|
|
2098
|
+
*/
|
|
2099
|
+
export const generateSpeechMutation = (
|
|
2100
|
+
options?: Partial<Options<GenerateSpeechData>>
|
|
2101
|
+
): UseMutationOptions<GenerateSpeechResponse, GenerateSpeechError, Options<GenerateSpeechData>> => {
|
|
2102
|
+
const mutationOptions: UseMutationOptions<
|
|
2103
|
+
GenerateSpeechResponse,
|
|
2104
|
+
GenerateSpeechError,
|
|
2105
|
+
Options<GenerateSpeechData>
|
|
2106
|
+
> = {
|
|
2107
|
+
mutationFn: async (fnOptions) => {
|
|
2108
|
+
const { data } = await generateSpeech({
|
|
2109
|
+
...options,
|
|
2110
|
+
...fnOptions,
|
|
2111
|
+
throwOnError: true,
|
|
2112
|
+
})
|
|
2113
|
+
return data
|
|
2114
|
+
},
|
|
2115
|
+
}
|
|
2116
|
+
return mutationOptions
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
/**
|
|
2120
|
+
* Transcribe audio with a transcription model
|
|
2121
|
+
*/
|
|
2122
|
+
export const transcribeAudioMutation = (
|
|
2123
|
+
options?: Partial<Options<TranscribeAudioData>>
|
|
2124
|
+
): UseMutationOptions<
|
|
2125
|
+
TranscribeAudioResponse,
|
|
2126
|
+
TranscribeAudioError,
|
|
2127
|
+
Options<TranscribeAudioData>
|
|
2128
|
+
> => {
|
|
2129
|
+
const mutationOptions: UseMutationOptions<
|
|
2130
|
+
TranscribeAudioResponse,
|
|
2131
|
+
TranscribeAudioError,
|
|
2132
|
+
Options<TranscribeAudioData>
|
|
2133
|
+
> = {
|
|
2134
|
+
mutationFn: async (fnOptions) => {
|
|
2135
|
+
const { data } = await transcribeAudio({
|
|
2136
|
+
...options,
|
|
2137
|
+
...fnOptions,
|
|
2138
|
+
throwOnError: true,
|
|
2139
|
+
})
|
|
2140
|
+
return data
|
|
2141
|
+
},
|
|
2142
|
+
}
|
|
2143
|
+
return mutationOptions
|
|
2144
|
+
}
|
|
2145
|
+
|
|
1730
2146
|
export const getProjectInfoQueryKey = (options?: Options<GetProjectInfoData>) =>
|
|
1731
2147
|
createQueryKey("getProjectInfo", options)
|
|
1732
2148
|
|
|
@@ -3629,6 +4045,35 @@ export const upsertObjectMutation = (
|
|
|
3629
4045
|
return mutationOptions
|
|
3630
4046
|
}
|
|
3631
4047
|
|
|
4048
|
+
/**
|
|
4049
|
+
* Get object by a unique property
|
|
4050
|
+
*
|
|
4051
|
+
* Returns the object of exactly this type that holds the value, compared as writes store it.
|
|
4052
|
+
*/
|
|
4053
|
+
export const getObjectByUniquePropertyMutation = (
|
|
4054
|
+
options?: Partial<Options<GetObjectByUniquePropertyData>>
|
|
4055
|
+
): UseMutationOptions<
|
|
4056
|
+
GetObjectByUniquePropertyResponse,
|
|
4057
|
+
GetObjectByUniquePropertyError,
|
|
4058
|
+
Options<GetObjectByUniquePropertyData>
|
|
4059
|
+
> => {
|
|
4060
|
+
const mutationOptions: UseMutationOptions<
|
|
4061
|
+
GetObjectByUniquePropertyResponse,
|
|
4062
|
+
GetObjectByUniquePropertyError,
|
|
4063
|
+
Options<GetObjectByUniquePropertyData>
|
|
4064
|
+
> = {
|
|
4065
|
+
mutationFn: async (fnOptions) => {
|
|
4066
|
+
const { data } = await getObjectByUniqueProperty({
|
|
4067
|
+
...options,
|
|
4068
|
+
...fnOptions,
|
|
4069
|
+
throwOnError: true,
|
|
4070
|
+
})
|
|
4071
|
+
return data
|
|
4072
|
+
},
|
|
4073
|
+
}
|
|
4074
|
+
return mutationOptions
|
|
4075
|
+
}
|
|
4076
|
+
|
|
3632
4077
|
export const listActionsQueryKey = (options?: Options<ListActionsData>) =>
|
|
3633
4078
|
createQueryKey("listActions", options)
|
|
3634
4079
|
|
|
@@ -4125,6 +4570,91 @@ export const getAgentThreadOptions = (options: Options<GetAgentThreadData>) =>
|
|
|
4125
4570
|
queryKey: getAgentThreadQueryKey(options),
|
|
4126
4571
|
})
|
|
4127
4572
|
|
|
4573
|
+
/**
|
|
4574
|
+
* Add participants to an agent thread
|
|
4575
|
+
*
|
|
4576
|
+
* Only the thread's owner adds participants: active users of the project, by id or by email. They read the whole conversation, its files and its live stream, and send messages that run with their own rights. Nothing checks what they may see: the conversation holds what the Agent read with the rights of whoever asked.
|
|
4577
|
+
*/
|
|
4578
|
+
export const addAgentThreadParticipantsMutation = (
|
|
4579
|
+
options?: Partial<Options<AddAgentThreadParticipantsData>>
|
|
4580
|
+
): UseMutationOptions<
|
|
4581
|
+
AddAgentThreadParticipantsResponse,
|
|
4582
|
+
AddAgentThreadParticipantsError,
|
|
4583
|
+
Options<AddAgentThreadParticipantsData>
|
|
4584
|
+
> => {
|
|
4585
|
+
const mutationOptions: UseMutationOptions<
|
|
4586
|
+
AddAgentThreadParticipantsResponse,
|
|
4587
|
+
AddAgentThreadParticipantsError,
|
|
4588
|
+
Options<AddAgentThreadParticipantsData>
|
|
4589
|
+
> = {
|
|
4590
|
+
mutationFn: async (fnOptions) => {
|
|
4591
|
+
const { data } = await addAgentThreadParticipants({
|
|
4592
|
+
...options,
|
|
4593
|
+
...fnOptions,
|
|
4594
|
+
throwOnError: true,
|
|
4595
|
+
})
|
|
4596
|
+
return data
|
|
4597
|
+
},
|
|
4598
|
+
}
|
|
4599
|
+
return mutationOptions
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
/**
|
|
4603
|
+
* Remove a participant from an agent thread
|
|
4604
|
+
*
|
|
4605
|
+
* The thread's owner removes anyone; a participant removes only themself, to leave. Removing someone who does not take part changes nothing.
|
|
4606
|
+
*/
|
|
4607
|
+
export const removeAgentThreadParticipantMutation = (
|
|
4608
|
+
options?: Partial<Options<RemoveAgentThreadParticipantData>>
|
|
4609
|
+
): UseMutationOptions<
|
|
4610
|
+
unknown,
|
|
4611
|
+
RemoveAgentThreadParticipantError,
|
|
4612
|
+
Options<RemoveAgentThreadParticipantData>
|
|
4613
|
+
> => {
|
|
4614
|
+
const mutationOptions: UseMutationOptions<
|
|
4615
|
+
unknown,
|
|
4616
|
+
RemoveAgentThreadParticipantError,
|
|
4617
|
+
Options<RemoveAgentThreadParticipantData>
|
|
4618
|
+
> = {
|
|
4619
|
+
mutationFn: async (fnOptions) => {
|
|
4620
|
+
const { data } = await removeAgentThreadParticipant({
|
|
4621
|
+
...options,
|
|
4622
|
+
...fnOptions,
|
|
4623
|
+
throwOnError: true,
|
|
4624
|
+
})
|
|
4625
|
+
return data
|
|
4626
|
+
},
|
|
4627
|
+
}
|
|
4628
|
+
return mutationOptions
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
/**
|
|
4632
|
+
* Continue an agent thread in a new one the caller owns
|
|
4633
|
+
*/
|
|
4634
|
+
export const forkAgentThreadMutation = (
|
|
4635
|
+
options?: Partial<Options<ForkAgentThreadData>>
|
|
4636
|
+
): UseMutationOptions<
|
|
4637
|
+
ForkAgentThreadResponse,
|
|
4638
|
+
ForkAgentThreadError,
|
|
4639
|
+
Options<ForkAgentThreadData>
|
|
4640
|
+
> => {
|
|
4641
|
+
const mutationOptions: UseMutationOptions<
|
|
4642
|
+
ForkAgentThreadResponse,
|
|
4643
|
+
ForkAgentThreadError,
|
|
4644
|
+
Options<ForkAgentThreadData>
|
|
4645
|
+
> = {
|
|
4646
|
+
mutationFn: async (fnOptions) => {
|
|
4647
|
+
const { data } = await forkAgentThread({
|
|
4648
|
+
...options,
|
|
4649
|
+
...fnOptions,
|
|
4650
|
+
throwOnError: true,
|
|
4651
|
+
})
|
|
4652
|
+
return data
|
|
4653
|
+
},
|
|
4654
|
+
}
|
|
4655
|
+
return mutationOptions
|
|
4656
|
+
}
|
|
4657
|
+
|
|
4128
4658
|
/**
|
|
4129
4659
|
* Explicitly recreate an unavailable or uncertain workspace without deleting its previous state
|
|
4130
4660
|
*/
|
|
@@ -4281,6 +4811,8 @@ export const getAgentMessageFileContentOptions = (
|
|
|
4281
4811
|
|
|
4282
4812
|
/**
|
|
4283
4813
|
* Cancel an agent thread's active run
|
|
4814
|
+
*
|
|
4815
|
+
* Whoever asked for the run, or the thread's owner, can cancel it.
|
|
4284
4816
|
*/
|
|
4285
4817
|
export const cancelAgentRunMutation = (
|
|
4286
4818
|
options?: Partial<Options<CancelAgentRunData>>
|
|
@@ -4304,6 +4836,8 @@ export const cancelAgentRunMutation = (
|
|
|
4304
4836
|
|
|
4305
4837
|
/**
|
|
4306
4838
|
* Retry a failed or interrupted agent run
|
|
4839
|
+
*
|
|
4840
|
+
* Only whoever asked for the run can retry it: it runs again with their rights.
|
|
4307
4841
|
*/
|
|
4308
4842
|
export const retryAgentRunMutation = (
|
|
4309
4843
|
options?: Partial<Options<RetryAgentRunData>>
|
|
@@ -4400,6 +4934,8 @@ export const getAgentRunQueryKey = (options: Options<GetAgentRunData>) =>
|
|
|
4400
4934
|
|
|
4401
4935
|
/**
|
|
4402
4936
|
* Get agent run
|
|
4937
|
+
*
|
|
4938
|
+
* A conversation's turn, or a sub-agent's run (`kind: "subagent"`), read through its thread: a sub-agent's run is visible exactly when its conversation is.
|
|
4403
4939
|
*/
|
|
4404
4940
|
export const getAgentRunOptions = (options: Options<GetAgentRunData>) =>
|
|
4405
4941
|
queryOptions<
|
|
@@ -4420,21 +4956,52 @@ export const getAgentRunOptions = (options: Options<GetAgentRunData>) =>
|
|
|
4420
4956
|
queryKey: getAgentRunQueryKey(options),
|
|
4421
4957
|
})
|
|
4422
4958
|
|
|
4423
|
-
|
|
4424
|
-
|
|
4959
|
+
/**
|
|
4960
|
+
* Stop an agent run
|
|
4961
|
+
*
|
|
4962
|
+
* A turn, or a sub-agent's run. Whoever asked for the turn, or the conversation's owner, can stop it, and a sub-agent's run as its turn. A queued run is cancelled at once; a running one is still running in the response, with the stop signal sent. A sub-agent's parent reads that it was stopped.
|
|
4963
|
+
*/
|
|
4964
|
+
export const cancelAgentRunByIdMutation = (
|
|
4965
|
+
options?: Partial<Options<CancelAgentRunByIdData>>
|
|
4966
|
+
): UseMutationOptions<
|
|
4967
|
+
CancelAgentRunByIdResponse,
|
|
4968
|
+
CancelAgentRunByIdError,
|
|
4969
|
+
Options<CancelAgentRunByIdData>
|
|
4970
|
+
> => {
|
|
4971
|
+
const mutationOptions: UseMutationOptions<
|
|
4972
|
+
CancelAgentRunByIdResponse,
|
|
4973
|
+
CancelAgentRunByIdError,
|
|
4974
|
+
Options<CancelAgentRunByIdData>
|
|
4975
|
+
> = {
|
|
4976
|
+
mutationFn: async (fnOptions) => {
|
|
4977
|
+
const { data } = await cancelAgentRunById({
|
|
4978
|
+
...options,
|
|
4979
|
+
...fnOptions,
|
|
4980
|
+
throwOnError: true,
|
|
4981
|
+
})
|
|
4982
|
+
return data
|
|
4983
|
+
},
|
|
4984
|
+
}
|
|
4985
|
+
return mutationOptions
|
|
4986
|
+
}
|
|
4987
|
+
|
|
4988
|
+
export const listAgentThreadChildrenQueryKey = (options: Options<ListAgentThreadChildrenData>) =>
|
|
4989
|
+
createQueryKey("listAgentThreadChildren", options)
|
|
4425
4990
|
|
|
4426
4991
|
/**
|
|
4427
|
-
* List the
|
|
4992
|
+
* List the sub-agents of an agent conversation
|
|
4993
|
+
*
|
|
4994
|
+
* A sub-agent is visible exactly when its conversation is: to the thread's owner and participants; observers read it through the observed routes. What it did is its thread's messages, at `GET /api/agent-threads/:threadId/messages` with its `threadId`. `runId` keeps those one turn spawned. Each lists every run it took, the one at work by `activeRunId`.
|
|
4428
4995
|
*/
|
|
4429
|
-
export const
|
|
4996
|
+
export const listAgentThreadChildrenOptions = (options: Options<ListAgentThreadChildrenData>) =>
|
|
4430
4997
|
queryOptions<
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
ReturnType<typeof
|
|
4998
|
+
ListAgentThreadChildrenResponse,
|
|
4999
|
+
ListAgentThreadChildrenError,
|
|
5000
|
+
ListAgentThreadChildrenResponse,
|
|
5001
|
+
ReturnType<typeof listAgentThreadChildrenQueryKey>
|
|
4435
5002
|
>({
|
|
4436
5003
|
queryFn: async ({ queryKey, signal }) => {
|
|
4437
|
-
const { data } = await
|
|
5004
|
+
const { data } = await listAgentThreadChildren({
|
|
4438
5005
|
...options,
|
|
4439
5006
|
...queryKey[0],
|
|
4440
5007
|
signal,
|
|
@@ -4442,38 +5009,1195 @@ export const listModelsOptions = (options?: Options<ListModelsData>) =>
|
|
|
4442
5009
|
})
|
|
4443
5010
|
return data
|
|
4444
5011
|
},
|
|
4445
|
-
queryKey:
|
|
5012
|
+
queryKey: listAgentThreadChildrenQueryKey(options),
|
|
4446
5013
|
})
|
|
4447
5014
|
|
|
5015
|
+
export const getAgentChildFileContentQueryKey = (options: Options<GetAgentChildFileContentData>) =>
|
|
5016
|
+
createQueryKey("getAgentChildFileContent", options)
|
|
5017
|
+
|
|
4448
5018
|
/**
|
|
4449
|
-
*
|
|
5019
|
+
* Get a file of a sub-agent
|
|
5020
|
+
*
|
|
5021
|
+
* A sub-agent is visible exactly when its conversation is: to the thread's owner and participants; observers read it through the observed routes. What it did is its thread's messages, at `GET /api/agent-threads/:threadId/messages` with its `threadId`. `threadId` is the sub-agent's thread, `run` one of its runs, and `path` points into it: `/handedFiles/0/fileRef`, or `/files/0/fileRef` for what the run returned.
|
|
4450
5022
|
*/
|
|
4451
|
-
export const
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
>
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
RemoveObjectLinkError,
|
|
4461
|
-
Options<RemoveObjectLinkData>
|
|
4462
|
-
> = {
|
|
4463
|
-
mutationFn: async (fnOptions) => {
|
|
4464
|
-
const { data } = await removeObjectLink({
|
|
5023
|
+
export const getAgentChildFileContentOptions = (options: Options<GetAgentChildFileContentData>) =>
|
|
5024
|
+
queryOptions<
|
|
5025
|
+
GetAgentChildFileContentResponse,
|
|
5026
|
+
GetAgentChildFileContentError,
|
|
5027
|
+
GetAgentChildFileContentResponse,
|
|
5028
|
+
ReturnType<typeof getAgentChildFileContentQueryKey>
|
|
5029
|
+
>({
|
|
5030
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5031
|
+
const { data } = await getAgentChildFileContent({
|
|
4465
5032
|
...options,
|
|
4466
|
-
...
|
|
5033
|
+
...queryKey[0],
|
|
5034
|
+
signal,
|
|
4467
5035
|
throwOnError: true,
|
|
4468
5036
|
})
|
|
4469
5037
|
return data
|
|
4470
5038
|
},
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
5039
|
+
queryKey: getAgentChildFileContentQueryKey(options),
|
|
5040
|
+
})
|
|
5041
|
+
|
|
5042
|
+
export const getAgentPreferencesQueryKey = (options?: Options<GetAgentPreferencesData>) =>
|
|
5043
|
+
createQueryKey("getAgentPreferences", options)
|
|
4474
5044
|
|
|
4475
5045
|
/**
|
|
4476
|
-
*
|
|
5046
|
+
* Get your Agent preferences
|
|
5047
|
+
*/
|
|
5048
|
+
export const getAgentPreferencesOptions = (options?: Options<GetAgentPreferencesData>) =>
|
|
5049
|
+
queryOptions<
|
|
5050
|
+
GetAgentPreferencesResponse,
|
|
5051
|
+
GetAgentPreferencesError,
|
|
5052
|
+
GetAgentPreferencesResponse,
|
|
5053
|
+
ReturnType<typeof getAgentPreferencesQueryKey>
|
|
5054
|
+
>({
|
|
5055
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5056
|
+
const { data } = await getAgentPreferences({
|
|
5057
|
+
...options,
|
|
5058
|
+
...queryKey[0],
|
|
5059
|
+
signal,
|
|
5060
|
+
throwOnError: true,
|
|
5061
|
+
})
|
|
5062
|
+
return data
|
|
5063
|
+
},
|
|
5064
|
+
queryKey: getAgentPreferencesQueryKey(options),
|
|
5065
|
+
})
|
|
5066
|
+
|
|
5067
|
+
/**
|
|
5068
|
+
* Update your Agent preferences
|
|
5069
|
+
*
|
|
5070
|
+
* `approvalMode` is your default in the threads where you chose none: `manual` asks before every action and workflow, `accept-edits` runs the actions that only change Sixb, `auto` runs everything.
|
|
5071
|
+
*/
|
|
5072
|
+
export const updateAgentPreferencesMutation = (
|
|
5073
|
+
options?: Partial<Options<UpdateAgentPreferencesData>>
|
|
5074
|
+
): UseMutationOptions<
|
|
5075
|
+
UpdateAgentPreferencesResponse,
|
|
5076
|
+
UpdateAgentPreferencesError,
|
|
5077
|
+
Options<UpdateAgentPreferencesData>
|
|
5078
|
+
> => {
|
|
5079
|
+
const mutationOptions: UseMutationOptions<
|
|
5080
|
+
UpdateAgentPreferencesResponse,
|
|
5081
|
+
UpdateAgentPreferencesError,
|
|
5082
|
+
Options<UpdateAgentPreferencesData>
|
|
5083
|
+
> = {
|
|
5084
|
+
mutationFn: async (fnOptions) => {
|
|
5085
|
+
const { data } = await updateAgentPreferences({
|
|
5086
|
+
...options,
|
|
5087
|
+
...fnOptions,
|
|
5088
|
+
throwOnError: true,
|
|
5089
|
+
})
|
|
5090
|
+
return data
|
|
5091
|
+
},
|
|
5092
|
+
}
|
|
5093
|
+
return mutationOptions
|
|
5094
|
+
}
|
|
5095
|
+
|
|
5096
|
+
/**
|
|
5097
|
+
* Choose your approval mode in an agent thread
|
|
5098
|
+
*
|
|
5099
|
+
* Applies to your next turns in the thread; other participants keep theirs. `null` follows your default again. A message can still pass its own `approvalMode`.
|
|
5100
|
+
*/
|
|
5101
|
+
export const setAgentThreadApprovalModeMutation = (
|
|
5102
|
+
options?: Partial<Options<SetAgentThreadApprovalModeData>>
|
|
5103
|
+
): UseMutationOptions<
|
|
5104
|
+
SetAgentThreadApprovalModeResponse,
|
|
5105
|
+
SetAgentThreadApprovalModeError,
|
|
5106
|
+
Options<SetAgentThreadApprovalModeData>
|
|
5107
|
+
> => {
|
|
5108
|
+
const mutationOptions: UseMutationOptions<
|
|
5109
|
+
SetAgentThreadApprovalModeResponse,
|
|
5110
|
+
SetAgentThreadApprovalModeError,
|
|
5111
|
+
Options<SetAgentThreadApprovalModeData>
|
|
5112
|
+
> = {
|
|
5113
|
+
mutationFn: async (fnOptions) => {
|
|
5114
|
+
const { data } = await setAgentThreadApprovalMode({
|
|
5115
|
+
...options,
|
|
5116
|
+
...fnOptions,
|
|
5117
|
+
throwOnError: true,
|
|
5118
|
+
})
|
|
5119
|
+
return data
|
|
5120
|
+
},
|
|
5121
|
+
}
|
|
5122
|
+
return mutationOptions
|
|
5123
|
+
}
|
|
5124
|
+
|
|
5125
|
+
export const listAgentThreadApprovalsQueryKey = (options: Options<ListAgentThreadApprovalsData>) =>
|
|
5126
|
+
createQueryKey("listAgentThreadApprovals", options)
|
|
5127
|
+
|
|
5128
|
+
/**
|
|
5129
|
+
* List an agent thread's held calls
|
|
5130
|
+
*
|
|
5131
|
+
* Oldest first. Whoever reads the thread reads its approvals.
|
|
5132
|
+
*/
|
|
5133
|
+
export const listAgentThreadApprovalsOptions = (options: Options<ListAgentThreadApprovalsData>) =>
|
|
5134
|
+
queryOptions<
|
|
5135
|
+
ListAgentThreadApprovalsResponse,
|
|
5136
|
+
ListAgentThreadApprovalsError,
|
|
5137
|
+
ListAgentThreadApprovalsResponse,
|
|
5138
|
+
ReturnType<typeof listAgentThreadApprovalsQueryKey>
|
|
5139
|
+
>({
|
|
5140
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5141
|
+
const { data } = await listAgentThreadApprovals({
|
|
5142
|
+
...options,
|
|
5143
|
+
...queryKey[0],
|
|
5144
|
+
signal,
|
|
5145
|
+
throwOnError: true,
|
|
5146
|
+
})
|
|
5147
|
+
return data
|
|
5148
|
+
},
|
|
5149
|
+
queryKey: listAgentThreadApprovalsQueryKey(options),
|
|
5150
|
+
})
|
|
5151
|
+
|
|
5152
|
+
export const listAgentThreadApprovalsInfiniteQueryKey = (
|
|
5153
|
+
options: Options<ListAgentThreadApprovalsData>
|
|
5154
|
+
): QueryKey<Options<ListAgentThreadApprovalsData>> =>
|
|
5155
|
+
createQueryKey("listAgentThreadApprovals", options, true)
|
|
5156
|
+
|
|
5157
|
+
/**
|
|
5158
|
+
* List an agent thread's held calls
|
|
5159
|
+
*
|
|
5160
|
+
* Oldest first. Whoever reads the thread reads its approvals.
|
|
5161
|
+
*/
|
|
5162
|
+
export const listAgentThreadApprovalsInfiniteOptions = (
|
|
5163
|
+
options: Options<ListAgentThreadApprovalsData>
|
|
5164
|
+
) =>
|
|
5165
|
+
infiniteQueryOptions<
|
|
5166
|
+
ListAgentThreadApprovalsResponse,
|
|
5167
|
+
ListAgentThreadApprovalsError,
|
|
5168
|
+
InfiniteData<ListAgentThreadApprovalsResponse>,
|
|
5169
|
+
QueryKey<Options<ListAgentThreadApprovalsData>>,
|
|
5170
|
+
| string
|
|
5171
|
+
| Pick<
|
|
5172
|
+
QueryKey<Options<ListAgentThreadApprovalsData>>[0],
|
|
5173
|
+
"body" | "headers" | "path" | "query"
|
|
5174
|
+
>
|
|
5175
|
+
>(
|
|
5176
|
+
// @ts-ignore
|
|
5177
|
+
{
|
|
5178
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5179
|
+
// @ts-ignore
|
|
5180
|
+
const page: Pick<
|
|
5181
|
+
QueryKey<Options<ListAgentThreadApprovalsData>>[0],
|
|
5182
|
+
"body" | "headers" | "path" | "query"
|
|
5183
|
+
> =
|
|
5184
|
+
typeof pageParam === "object"
|
|
5185
|
+
? pageParam
|
|
5186
|
+
: {
|
|
5187
|
+
query: {
|
|
5188
|
+
offset: pageParam,
|
|
5189
|
+
},
|
|
5190
|
+
}
|
|
5191
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5192
|
+
const { data } = await listAgentThreadApprovals({
|
|
5193
|
+
...options,
|
|
5194
|
+
...params,
|
|
5195
|
+
signal,
|
|
5196
|
+
throwOnError: true,
|
|
5197
|
+
})
|
|
5198
|
+
return data
|
|
5199
|
+
},
|
|
5200
|
+
queryKey: listAgentThreadApprovalsInfiniteQueryKey(options),
|
|
5201
|
+
}
|
|
5202
|
+
)
|
|
5203
|
+
|
|
5204
|
+
/**
|
|
5205
|
+
* Approve or deny a held agent call
|
|
5206
|
+
*
|
|
5207
|
+
* Only whoever asked for the turn decides: an approved call runs now, as the turn, with the rights their request carries, and the approval comes back with its outcome. A turn paused on its calls resumes once all of them are decided: `run` is the turn that continues it, and the Agent reads how each call ended. Once the call ran, the decision never fails: when the turn cannot resume, `resume` says why, and whether Sixb tries again, as it does once an AI limit resets. A new message sets the calls still waiting aside. None of these routes is reachable from the Agent's sandbox.
|
|
5208
|
+
*/
|
|
5209
|
+
export const decideAgentApprovalMutation = (
|
|
5210
|
+
options?: Partial<Options<DecideAgentApprovalData>>
|
|
5211
|
+
): UseMutationOptions<
|
|
5212
|
+
DecideAgentApprovalResponse,
|
|
5213
|
+
DecideAgentApprovalError,
|
|
5214
|
+
Options<DecideAgentApprovalData>
|
|
5215
|
+
> => {
|
|
5216
|
+
const mutationOptions: UseMutationOptions<
|
|
5217
|
+
DecideAgentApprovalResponse,
|
|
5218
|
+
DecideAgentApprovalError,
|
|
5219
|
+
Options<DecideAgentApprovalData>
|
|
5220
|
+
> = {
|
|
5221
|
+
mutationFn: async (fnOptions) => {
|
|
5222
|
+
const { data } = await decideAgentApproval({
|
|
5223
|
+
...options,
|
|
5224
|
+
...fnOptions,
|
|
5225
|
+
throwOnError: true,
|
|
5226
|
+
})
|
|
5227
|
+
return data
|
|
5228
|
+
},
|
|
5229
|
+
}
|
|
5230
|
+
return mutationOptions
|
|
5231
|
+
}
|
|
5232
|
+
|
|
5233
|
+
export const listAgentApprovalsQueryKey = (options?: Options<ListAgentApprovalsData>) =>
|
|
5234
|
+
createQueryKey("listAgentApprovals", options)
|
|
5235
|
+
|
|
5236
|
+
/**
|
|
5237
|
+
* List the calls held for your decision
|
|
5238
|
+
*
|
|
5239
|
+
* Your own, across threads, oldest first.
|
|
5240
|
+
*/
|
|
5241
|
+
export const listAgentApprovalsOptions = (options?: Options<ListAgentApprovalsData>) =>
|
|
5242
|
+
queryOptions<
|
|
5243
|
+
ListAgentApprovalsResponse,
|
|
5244
|
+
ListAgentApprovalsError,
|
|
5245
|
+
ListAgentApprovalsResponse,
|
|
5246
|
+
ReturnType<typeof listAgentApprovalsQueryKey>
|
|
5247
|
+
>({
|
|
5248
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5249
|
+
const { data } = await listAgentApprovals({
|
|
5250
|
+
...options,
|
|
5251
|
+
...queryKey[0],
|
|
5252
|
+
signal,
|
|
5253
|
+
throwOnError: true,
|
|
5254
|
+
})
|
|
5255
|
+
return data
|
|
5256
|
+
},
|
|
5257
|
+
queryKey: listAgentApprovalsQueryKey(options),
|
|
5258
|
+
})
|
|
5259
|
+
|
|
5260
|
+
export const listAgentApprovalsInfiniteQueryKey = (
|
|
5261
|
+
options?: Options<ListAgentApprovalsData>
|
|
5262
|
+
): QueryKey<Options<ListAgentApprovalsData>> => createQueryKey("listAgentApprovals", options, true)
|
|
5263
|
+
|
|
5264
|
+
/**
|
|
5265
|
+
* List the calls held for your decision
|
|
5266
|
+
*
|
|
5267
|
+
* Your own, across threads, oldest first.
|
|
5268
|
+
*/
|
|
5269
|
+
export const listAgentApprovalsInfiniteOptions = (options?: Options<ListAgentApprovalsData>) =>
|
|
5270
|
+
infiniteQueryOptions<
|
|
5271
|
+
ListAgentApprovalsResponse,
|
|
5272
|
+
ListAgentApprovalsError,
|
|
5273
|
+
InfiniteData<ListAgentApprovalsResponse>,
|
|
5274
|
+
QueryKey<Options<ListAgentApprovalsData>>,
|
|
5275
|
+
| string
|
|
5276
|
+
| Pick<QueryKey<Options<ListAgentApprovalsData>>[0], "body" | "headers" | "path" | "query">
|
|
5277
|
+
>(
|
|
5278
|
+
// @ts-ignore
|
|
5279
|
+
{
|
|
5280
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5281
|
+
// @ts-ignore
|
|
5282
|
+
const page: Pick<
|
|
5283
|
+
QueryKey<Options<ListAgentApprovalsData>>[0],
|
|
5284
|
+
"body" | "headers" | "path" | "query"
|
|
5285
|
+
> =
|
|
5286
|
+
typeof pageParam === "object"
|
|
5287
|
+
? pageParam
|
|
5288
|
+
: {
|
|
5289
|
+
query: {
|
|
5290
|
+
offset: pageParam,
|
|
5291
|
+
},
|
|
5292
|
+
}
|
|
5293
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5294
|
+
const { data } = await listAgentApprovals({
|
|
5295
|
+
...options,
|
|
5296
|
+
...params,
|
|
5297
|
+
signal,
|
|
5298
|
+
throwOnError: true,
|
|
5299
|
+
})
|
|
5300
|
+
return data
|
|
5301
|
+
},
|
|
5302
|
+
queryKey: listAgentApprovalsInfiniteQueryKey(options),
|
|
5303
|
+
}
|
|
5304
|
+
)
|
|
5305
|
+
|
|
5306
|
+
export const getObservedAgentThreadQueryKey = (options: Options<GetObservedAgentThreadData>) =>
|
|
5307
|
+
createQueryKey("getObservedAgentThread", options)
|
|
5308
|
+
|
|
5309
|
+
/**
|
|
5310
|
+
* Read another user's agent thread
|
|
5311
|
+
*
|
|
5312
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5313
|
+
*/
|
|
5314
|
+
export const getObservedAgentThreadOptions = (options: Options<GetObservedAgentThreadData>) =>
|
|
5315
|
+
queryOptions<
|
|
5316
|
+
GetObservedAgentThreadResponse,
|
|
5317
|
+
GetObservedAgentThreadError,
|
|
5318
|
+
GetObservedAgentThreadResponse,
|
|
5319
|
+
ReturnType<typeof getObservedAgentThreadQueryKey>
|
|
5320
|
+
>({
|
|
5321
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5322
|
+
const { data } = await getObservedAgentThread({
|
|
5323
|
+
...options,
|
|
5324
|
+
...queryKey[0],
|
|
5325
|
+
signal,
|
|
5326
|
+
throwOnError: true,
|
|
5327
|
+
})
|
|
5328
|
+
return data
|
|
5329
|
+
},
|
|
5330
|
+
queryKey: getObservedAgentThreadQueryKey(options),
|
|
5331
|
+
})
|
|
5332
|
+
|
|
5333
|
+
export const listObservedAgentThreadMessagesQueryKey = (
|
|
5334
|
+
options: Options<ListObservedAgentThreadMessagesData>
|
|
5335
|
+
) => createQueryKey("listObservedAgentThreadMessages", options)
|
|
5336
|
+
|
|
5337
|
+
/**
|
|
5338
|
+
* List another user's agent thread messages
|
|
5339
|
+
*
|
|
5340
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route. `authors` names who wrote the page's messages.
|
|
5341
|
+
*/
|
|
5342
|
+
export const listObservedAgentThreadMessagesOptions = (
|
|
5343
|
+
options: Options<ListObservedAgentThreadMessagesData>
|
|
5344
|
+
) =>
|
|
5345
|
+
queryOptions<
|
|
5346
|
+
ListObservedAgentThreadMessagesResponse,
|
|
5347
|
+
ListObservedAgentThreadMessagesError,
|
|
5348
|
+
ListObservedAgentThreadMessagesResponse,
|
|
5349
|
+
ReturnType<typeof listObservedAgentThreadMessagesQueryKey>
|
|
5350
|
+
>({
|
|
5351
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5352
|
+
const { data } = await listObservedAgentThreadMessages({
|
|
5353
|
+
...options,
|
|
5354
|
+
...queryKey[0],
|
|
5355
|
+
signal,
|
|
5356
|
+
throwOnError: true,
|
|
5357
|
+
})
|
|
5358
|
+
return data
|
|
5359
|
+
},
|
|
5360
|
+
queryKey: listObservedAgentThreadMessagesQueryKey(options),
|
|
5361
|
+
})
|
|
5362
|
+
|
|
5363
|
+
export const listObservedAgentThreadMessagesInfiniteQueryKey = (
|
|
5364
|
+
options: Options<ListObservedAgentThreadMessagesData>
|
|
5365
|
+
): QueryKey<Options<ListObservedAgentThreadMessagesData>> =>
|
|
5366
|
+
createQueryKey("listObservedAgentThreadMessages", options, true)
|
|
5367
|
+
|
|
5368
|
+
/**
|
|
5369
|
+
* List another user's agent thread messages
|
|
5370
|
+
*
|
|
5371
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route. `authors` names who wrote the page's messages.
|
|
5372
|
+
*/
|
|
5373
|
+
export const listObservedAgentThreadMessagesInfiniteOptions = (
|
|
5374
|
+
options: Options<ListObservedAgentThreadMessagesData>
|
|
5375
|
+
) =>
|
|
5376
|
+
infiniteQueryOptions<
|
|
5377
|
+
ListObservedAgentThreadMessagesResponse,
|
|
5378
|
+
ListObservedAgentThreadMessagesError,
|
|
5379
|
+
InfiniteData<ListObservedAgentThreadMessagesResponse>,
|
|
5380
|
+
QueryKey<Options<ListObservedAgentThreadMessagesData>>,
|
|
5381
|
+
| string
|
|
5382
|
+
| Pick<
|
|
5383
|
+
QueryKey<Options<ListObservedAgentThreadMessagesData>>[0],
|
|
5384
|
+
"body" | "headers" | "path" | "query"
|
|
5385
|
+
>
|
|
5386
|
+
>(
|
|
5387
|
+
// @ts-ignore
|
|
5388
|
+
{
|
|
5389
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5390
|
+
// @ts-ignore
|
|
5391
|
+
const page: Pick<
|
|
5392
|
+
QueryKey<Options<ListObservedAgentThreadMessagesData>>[0],
|
|
5393
|
+
"body" | "headers" | "path" | "query"
|
|
5394
|
+
> =
|
|
5395
|
+
typeof pageParam === "object"
|
|
5396
|
+
? pageParam
|
|
5397
|
+
: {
|
|
5398
|
+
query: {
|
|
5399
|
+
offset: pageParam,
|
|
5400
|
+
},
|
|
5401
|
+
}
|
|
5402
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5403
|
+
const { data } = await listObservedAgentThreadMessages({
|
|
5404
|
+
...options,
|
|
5405
|
+
...params,
|
|
5406
|
+
signal,
|
|
5407
|
+
throwOnError: true,
|
|
5408
|
+
})
|
|
5409
|
+
return data
|
|
5410
|
+
},
|
|
5411
|
+
queryKey: listObservedAgentThreadMessagesInfiniteQueryKey(options),
|
|
5412
|
+
}
|
|
5413
|
+
)
|
|
5414
|
+
|
|
5415
|
+
export const getObservedAgentMessageFileContentQueryKey = (
|
|
5416
|
+
options: Options<GetObservedAgentMessageFileContentData>
|
|
5417
|
+
) => createQueryKey("getObservedAgentMessageFileContent", options)
|
|
5418
|
+
|
|
5419
|
+
/**
|
|
5420
|
+
* Get a file of another user's agent message
|
|
5421
|
+
*
|
|
5422
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5423
|
+
*/
|
|
5424
|
+
export const getObservedAgentMessageFileContentOptions = (
|
|
5425
|
+
options: Options<GetObservedAgentMessageFileContentData>
|
|
5426
|
+
) =>
|
|
5427
|
+
queryOptions<
|
|
5428
|
+
GetObservedAgentMessageFileContentResponse,
|
|
5429
|
+
GetObservedAgentMessageFileContentError,
|
|
5430
|
+
GetObservedAgentMessageFileContentResponse,
|
|
5431
|
+
ReturnType<typeof getObservedAgentMessageFileContentQueryKey>
|
|
5432
|
+
>({
|
|
5433
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5434
|
+
const { data } = await getObservedAgentMessageFileContent({
|
|
5435
|
+
...options,
|
|
5436
|
+
...queryKey[0],
|
|
5437
|
+
signal,
|
|
5438
|
+
throwOnError: true,
|
|
5439
|
+
})
|
|
5440
|
+
return data
|
|
5441
|
+
},
|
|
5442
|
+
queryKey: getObservedAgentMessageFileContentQueryKey(options),
|
|
5443
|
+
})
|
|
5444
|
+
|
|
5445
|
+
export const listObservedAgentThreadRunsQueryKey = (
|
|
5446
|
+
options: Options<ListObservedAgentThreadRunsData>
|
|
5447
|
+
) => createQueryKey("listObservedAgentThreadRuns", options)
|
|
5448
|
+
|
|
5449
|
+
/**
|
|
5450
|
+
* List another user's agent thread runs
|
|
5451
|
+
*
|
|
5452
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5453
|
+
*/
|
|
5454
|
+
export const listObservedAgentThreadRunsOptions = (
|
|
5455
|
+
options: Options<ListObservedAgentThreadRunsData>
|
|
5456
|
+
) =>
|
|
5457
|
+
queryOptions<
|
|
5458
|
+
ListObservedAgentThreadRunsResponse,
|
|
5459
|
+
ListObservedAgentThreadRunsError,
|
|
5460
|
+
ListObservedAgentThreadRunsResponse,
|
|
5461
|
+
ReturnType<typeof listObservedAgentThreadRunsQueryKey>
|
|
5462
|
+
>({
|
|
5463
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5464
|
+
const { data } = await listObservedAgentThreadRuns({
|
|
5465
|
+
...options,
|
|
5466
|
+
...queryKey[0],
|
|
5467
|
+
signal,
|
|
5468
|
+
throwOnError: true,
|
|
5469
|
+
})
|
|
5470
|
+
return data
|
|
5471
|
+
},
|
|
5472
|
+
queryKey: listObservedAgentThreadRunsQueryKey(options),
|
|
5473
|
+
})
|
|
5474
|
+
|
|
5475
|
+
export const listObservedAgentThreadRunsInfiniteQueryKey = (
|
|
5476
|
+
options: Options<ListObservedAgentThreadRunsData>
|
|
5477
|
+
): QueryKey<Options<ListObservedAgentThreadRunsData>> =>
|
|
5478
|
+
createQueryKey("listObservedAgentThreadRuns", options, true)
|
|
5479
|
+
|
|
5480
|
+
/**
|
|
5481
|
+
* List another user's agent thread runs
|
|
5482
|
+
*
|
|
5483
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5484
|
+
*/
|
|
5485
|
+
export const listObservedAgentThreadRunsInfiniteOptions = (
|
|
5486
|
+
options: Options<ListObservedAgentThreadRunsData>
|
|
5487
|
+
) =>
|
|
5488
|
+
infiniteQueryOptions<
|
|
5489
|
+
ListObservedAgentThreadRunsResponse,
|
|
5490
|
+
ListObservedAgentThreadRunsError,
|
|
5491
|
+
InfiniteData<ListObservedAgentThreadRunsResponse>,
|
|
5492
|
+
QueryKey<Options<ListObservedAgentThreadRunsData>>,
|
|
5493
|
+
| string
|
|
5494
|
+
| Pick<
|
|
5495
|
+
QueryKey<Options<ListObservedAgentThreadRunsData>>[0],
|
|
5496
|
+
"body" | "headers" | "path" | "query"
|
|
5497
|
+
>
|
|
5498
|
+
>(
|
|
5499
|
+
// @ts-ignore
|
|
5500
|
+
{
|
|
5501
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5502
|
+
// @ts-ignore
|
|
5503
|
+
const page: Pick<
|
|
5504
|
+
QueryKey<Options<ListObservedAgentThreadRunsData>>[0],
|
|
5505
|
+
"body" | "headers" | "path" | "query"
|
|
5506
|
+
> =
|
|
5507
|
+
typeof pageParam === "object"
|
|
5508
|
+
? pageParam
|
|
5509
|
+
: {
|
|
5510
|
+
query: {
|
|
5511
|
+
offset: pageParam,
|
|
5512
|
+
},
|
|
5513
|
+
}
|
|
5514
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5515
|
+
const { data } = await listObservedAgentThreadRuns({
|
|
5516
|
+
...options,
|
|
5517
|
+
...params,
|
|
5518
|
+
signal,
|
|
5519
|
+
throwOnError: true,
|
|
5520
|
+
})
|
|
5521
|
+
return data
|
|
5522
|
+
},
|
|
5523
|
+
queryKey: listObservedAgentThreadRunsInfiniteQueryKey(options),
|
|
5524
|
+
}
|
|
5525
|
+
)
|
|
5526
|
+
|
|
5527
|
+
export const listObservedAgentThreadChildrenQueryKey = (
|
|
5528
|
+
options: Options<ListObservedAgentThreadChildrenData>
|
|
5529
|
+
) => createQueryKey("listObservedAgentThreadChildren", options)
|
|
5530
|
+
|
|
5531
|
+
/**
|
|
5532
|
+
* List the sub-agents of another user's agent conversation
|
|
5533
|
+
*
|
|
5534
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5535
|
+
*/
|
|
5536
|
+
export const listObservedAgentThreadChildrenOptions = (
|
|
5537
|
+
options: Options<ListObservedAgentThreadChildrenData>
|
|
5538
|
+
) =>
|
|
5539
|
+
queryOptions<
|
|
5540
|
+
ListObservedAgentThreadChildrenResponse,
|
|
5541
|
+
ListObservedAgentThreadChildrenError,
|
|
5542
|
+
ListObservedAgentThreadChildrenResponse,
|
|
5543
|
+
ReturnType<typeof listObservedAgentThreadChildrenQueryKey>
|
|
5544
|
+
>({
|
|
5545
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5546
|
+
const { data } = await listObservedAgentThreadChildren({
|
|
5547
|
+
...options,
|
|
5548
|
+
...queryKey[0],
|
|
5549
|
+
signal,
|
|
5550
|
+
throwOnError: true,
|
|
5551
|
+
})
|
|
5552
|
+
return data
|
|
5553
|
+
},
|
|
5554
|
+
queryKey: listObservedAgentThreadChildrenQueryKey(options),
|
|
5555
|
+
})
|
|
5556
|
+
|
|
5557
|
+
export const getObservedAgentChildFileContentQueryKey = (
|
|
5558
|
+
options: Options<GetObservedAgentChildFileContentData>
|
|
5559
|
+
) => createQueryKey("getObservedAgentChildFileContent", options)
|
|
5560
|
+
|
|
5561
|
+
/**
|
|
5562
|
+
* Get a file of another user's sub-agent
|
|
5563
|
+
*
|
|
5564
|
+
* Read-only, whoever owns the thread. Takes can.observe(agent.threads); the response matches the owner's route.
|
|
5565
|
+
*/
|
|
5566
|
+
export const getObservedAgentChildFileContentOptions = (
|
|
5567
|
+
options: Options<GetObservedAgentChildFileContentData>
|
|
5568
|
+
) =>
|
|
5569
|
+
queryOptions<
|
|
5570
|
+
GetObservedAgentChildFileContentResponse,
|
|
5571
|
+
GetObservedAgentChildFileContentError,
|
|
5572
|
+
GetObservedAgentChildFileContentResponse,
|
|
5573
|
+
ReturnType<typeof getObservedAgentChildFileContentQueryKey>
|
|
5574
|
+
>({
|
|
5575
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5576
|
+
const { data } = await getObservedAgentChildFileContent({
|
|
5577
|
+
...options,
|
|
5578
|
+
...queryKey[0],
|
|
5579
|
+
signal,
|
|
5580
|
+
throwOnError: true,
|
|
5581
|
+
})
|
|
5582
|
+
return data
|
|
5583
|
+
},
|
|
5584
|
+
queryKey: getObservedAgentChildFileContentQueryKey(options),
|
|
5585
|
+
})
|
|
5586
|
+
|
|
5587
|
+
/**
|
|
5588
|
+
* Delete an Agent memory repo
|
|
5589
|
+
*
|
|
5590
|
+
* Deletes the repo with its history.
|
|
5591
|
+
*/
|
|
5592
|
+
export const deleteAgentMemoryMutation = (
|
|
5593
|
+
options?: Partial<Options<DeleteAgentMemoryData>>
|
|
5594
|
+
): UseMutationOptions<
|
|
5595
|
+
DeleteAgentMemoryResponse,
|
|
5596
|
+
DeleteAgentMemoryError,
|
|
5597
|
+
Options<DeleteAgentMemoryData>
|
|
5598
|
+
> => {
|
|
5599
|
+
const mutationOptions: UseMutationOptions<
|
|
5600
|
+
DeleteAgentMemoryResponse,
|
|
5601
|
+
DeleteAgentMemoryError,
|
|
5602
|
+
Options<DeleteAgentMemoryData>
|
|
5603
|
+
> = {
|
|
5604
|
+
mutationFn: async (fnOptions) => {
|
|
5605
|
+
const { data } = await deleteAgentMemory({
|
|
5606
|
+
...options,
|
|
5607
|
+
...fnOptions,
|
|
5608
|
+
throwOnError: true,
|
|
5609
|
+
})
|
|
5610
|
+
return data
|
|
5611
|
+
},
|
|
5612
|
+
}
|
|
5613
|
+
return mutationOptions
|
|
5614
|
+
}
|
|
5615
|
+
|
|
5616
|
+
export const getAgentMemoryQueryKey = (options: Options<GetAgentMemoryData>) =>
|
|
5617
|
+
createQueryKey("getAgentMemory", options)
|
|
5618
|
+
|
|
5619
|
+
/**
|
|
5620
|
+
* Get an Agent memory repo
|
|
5621
|
+
*
|
|
5622
|
+
* Every file of the repo as of its latest revision, or as an earlier revision left it.
|
|
5623
|
+
*/
|
|
5624
|
+
export const getAgentMemoryOptions = (options: Options<GetAgentMemoryData>) =>
|
|
5625
|
+
queryOptions<
|
|
5626
|
+
GetAgentMemoryResponse,
|
|
5627
|
+
GetAgentMemoryError,
|
|
5628
|
+
GetAgentMemoryResponse,
|
|
5629
|
+
ReturnType<typeof getAgentMemoryQueryKey>
|
|
5630
|
+
>({
|
|
5631
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5632
|
+
const { data } = await getAgentMemory({
|
|
5633
|
+
...options,
|
|
5634
|
+
...queryKey[0],
|
|
5635
|
+
signal,
|
|
5636
|
+
throwOnError: true,
|
|
5637
|
+
})
|
|
5638
|
+
return data
|
|
5639
|
+
},
|
|
5640
|
+
queryKey: getAgentMemoryQueryKey(options),
|
|
5641
|
+
})
|
|
5642
|
+
|
|
5643
|
+
export const listAgentMemoryRevisionsQueryKey = (options: Options<ListAgentMemoryRevisionsData>) =>
|
|
5644
|
+
createQueryKey("listAgentMemoryRevisions", options)
|
|
5645
|
+
|
|
5646
|
+
/**
|
|
5647
|
+
* List an Agent memory repo's revisions
|
|
5648
|
+
*
|
|
5649
|
+
* Each save is one revision, newest first.
|
|
5650
|
+
*/
|
|
5651
|
+
export const listAgentMemoryRevisionsOptions = (options: Options<ListAgentMemoryRevisionsData>) =>
|
|
5652
|
+
queryOptions<
|
|
5653
|
+
ListAgentMemoryRevisionsResponse,
|
|
5654
|
+
ListAgentMemoryRevisionsError,
|
|
5655
|
+
ListAgentMemoryRevisionsResponse,
|
|
5656
|
+
ReturnType<typeof listAgentMemoryRevisionsQueryKey>
|
|
5657
|
+
>({
|
|
5658
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5659
|
+
const { data } = await listAgentMemoryRevisions({
|
|
5660
|
+
...options,
|
|
5661
|
+
...queryKey[0],
|
|
5662
|
+
signal,
|
|
5663
|
+
throwOnError: true,
|
|
5664
|
+
})
|
|
5665
|
+
return data
|
|
5666
|
+
},
|
|
5667
|
+
queryKey: listAgentMemoryRevisionsQueryKey(options),
|
|
5668
|
+
})
|
|
5669
|
+
|
|
5670
|
+
export const listAgentMemoryRevisionsInfiniteQueryKey = (
|
|
5671
|
+
options: Options<ListAgentMemoryRevisionsData>
|
|
5672
|
+
): QueryKey<Options<ListAgentMemoryRevisionsData>> =>
|
|
5673
|
+
createQueryKey("listAgentMemoryRevisions", options, true)
|
|
5674
|
+
|
|
5675
|
+
/**
|
|
5676
|
+
* List an Agent memory repo's revisions
|
|
5677
|
+
*
|
|
5678
|
+
* Each save is one revision, newest first.
|
|
5679
|
+
*/
|
|
5680
|
+
export const listAgentMemoryRevisionsInfiniteOptions = (
|
|
5681
|
+
options: Options<ListAgentMemoryRevisionsData>
|
|
5682
|
+
) =>
|
|
5683
|
+
infiniteQueryOptions<
|
|
5684
|
+
ListAgentMemoryRevisionsResponse,
|
|
5685
|
+
ListAgentMemoryRevisionsError,
|
|
5686
|
+
InfiniteData<ListAgentMemoryRevisionsResponse>,
|
|
5687
|
+
QueryKey<Options<ListAgentMemoryRevisionsData>>,
|
|
5688
|
+
| string
|
|
5689
|
+
| Pick<
|
|
5690
|
+
QueryKey<Options<ListAgentMemoryRevisionsData>>[0],
|
|
5691
|
+
"body" | "headers" | "path" | "query"
|
|
5692
|
+
>
|
|
5693
|
+
>(
|
|
5694
|
+
// @ts-ignore
|
|
5695
|
+
{
|
|
5696
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5697
|
+
// @ts-ignore
|
|
5698
|
+
const page: Pick<
|
|
5699
|
+
QueryKey<Options<ListAgentMemoryRevisionsData>>[0],
|
|
5700
|
+
"body" | "headers" | "path" | "query"
|
|
5701
|
+
> =
|
|
5702
|
+
typeof pageParam === "object"
|
|
5703
|
+
? pageParam
|
|
5704
|
+
: {
|
|
5705
|
+
query: {
|
|
5706
|
+
offset: pageParam,
|
|
5707
|
+
},
|
|
5708
|
+
}
|
|
5709
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5710
|
+
const { data } = await listAgentMemoryRevisions({
|
|
5711
|
+
...options,
|
|
5712
|
+
...params,
|
|
5713
|
+
signal,
|
|
5714
|
+
throwOnError: true,
|
|
5715
|
+
})
|
|
5716
|
+
return data
|
|
5717
|
+
},
|
|
5718
|
+
queryKey: listAgentMemoryRevisionsInfiniteQueryKey(options),
|
|
5719
|
+
}
|
|
5720
|
+
)
|
|
5721
|
+
|
|
5722
|
+
/**
|
|
5723
|
+
* Save changes to an Agent memory repo
|
|
5724
|
+
*
|
|
5725
|
+
* Stores the changes as the repo's next revision. When another save changed one of the files after baseRevision, nothing is saved and the response holds those files as they are now.
|
|
5726
|
+
*/
|
|
5727
|
+
export const saveAgentMemoryMutation = (
|
|
5728
|
+
options?: Partial<Options<SaveAgentMemoryData>>
|
|
5729
|
+
): UseMutationOptions<
|
|
5730
|
+
SaveAgentMemoryResponse,
|
|
5731
|
+
SaveAgentMemoryError,
|
|
5732
|
+
Options<SaveAgentMemoryData>
|
|
5733
|
+
> => {
|
|
5734
|
+
const mutationOptions: UseMutationOptions<
|
|
5735
|
+
SaveAgentMemoryResponse,
|
|
5736
|
+
SaveAgentMemoryError,
|
|
5737
|
+
Options<SaveAgentMemoryData>
|
|
5738
|
+
> = {
|
|
5739
|
+
mutationFn: async (fnOptions) => {
|
|
5740
|
+
const { data } = await saveAgentMemory({
|
|
5741
|
+
...options,
|
|
5742
|
+
...fnOptions,
|
|
5743
|
+
throwOnError: true,
|
|
5744
|
+
})
|
|
5745
|
+
return data
|
|
5746
|
+
},
|
|
5747
|
+
}
|
|
5748
|
+
return mutationOptions
|
|
5749
|
+
}
|
|
5750
|
+
|
|
5751
|
+
export const listArtifactsQueryKey = (options?: Options<ListArtifactsData>) =>
|
|
5752
|
+
createQueryKey("listArtifacts", options)
|
|
5753
|
+
|
|
5754
|
+
/**
|
|
5755
|
+
* List artifacts
|
|
5756
|
+
*
|
|
5757
|
+
* The caller's artifacts, most recently updated first. With thread, every artifact the conversation shares, for whoever reads it.
|
|
5758
|
+
*/
|
|
5759
|
+
export const listArtifactsOptions = (options?: Options<ListArtifactsData>) =>
|
|
5760
|
+
queryOptions<
|
|
5761
|
+
ListArtifactsResponse,
|
|
5762
|
+
ListArtifactsError,
|
|
5763
|
+
ListArtifactsResponse,
|
|
5764
|
+
ReturnType<typeof listArtifactsQueryKey>
|
|
5765
|
+
>({
|
|
5766
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5767
|
+
const { data } = await listArtifacts({
|
|
5768
|
+
...options,
|
|
5769
|
+
...queryKey[0],
|
|
5770
|
+
signal,
|
|
5771
|
+
throwOnError: true,
|
|
5772
|
+
})
|
|
5773
|
+
return data
|
|
5774
|
+
},
|
|
5775
|
+
queryKey: listArtifactsQueryKey(options),
|
|
5776
|
+
})
|
|
5777
|
+
|
|
5778
|
+
export const listArtifactsInfiniteQueryKey = (
|
|
5779
|
+
options?: Options<ListArtifactsData>
|
|
5780
|
+
): QueryKey<Options<ListArtifactsData>> => createQueryKey("listArtifacts", options, true)
|
|
5781
|
+
|
|
5782
|
+
/**
|
|
5783
|
+
* List artifacts
|
|
5784
|
+
*
|
|
5785
|
+
* The caller's artifacts, most recently updated first. With thread, every artifact the conversation shares, for whoever reads it.
|
|
5786
|
+
*/
|
|
5787
|
+
export const listArtifactsInfiniteOptions = (options?: Options<ListArtifactsData>) =>
|
|
5788
|
+
infiniteQueryOptions<
|
|
5789
|
+
ListArtifactsResponse,
|
|
5790
|
+
ListArtifactsError,
|
|
5791
|
+
InfiniteData<ListArtifactsResponse>,
|
|
5792
|
+
QueryKey<Options<ListArtifactsData>>,
|
|
5793
|
+
string | Pick<QueryKey<Options<ListArtifactsData>>[0], "body" | "headers" | "path" | "query">
|
|
5794
|
+
>(
|
|
5795
|
+
// @ts-ignore
|
|
5796
|
+
{
|
|
5797
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
5798
|
+
// @ts-ignore
|
|
5799
|
+
const page: Pick<
|
|
5800
|
+
QueryKey<Options<ListArtifactsData>>[0],
|
|
5801
|
+
"body" | "headers" | "path" | "query"
|
|
5802
|
+
> =
|
|
5803
|
+
typeof pageParam === "object"
|
|
5804
|
+
? pageParam
|
|
5805
|
+
: {
|
|
5806
|
+
query: {
|
|
5807
|
+
offset: pageParam,
|
|
5808
|
+
},
|
|
5809
|
+
}
|
|
5810
|
+
const params = createInfiniteParams(queryKey, page)
|
|
5811
|
+
const { data } = await listArtifacts({
|
|
5812
|
+
...options,
|
|
5813
|
+
...params,
|
|
5814
|
+
signal,
|
|
5815
|
+
throwOnError: true,
|
|
5816
|
+
})
|
|
5817
|
+
return data
|
|
5818
|
+
},
|
|
5819
|
+
queryKey: listArtifactsInfiniteQueryKey(options),
|
|
5820
|
+
}
|
|
5821
|
+
)
|
|
5822
|
+
|
|
5823
|
+
/**
|
|
5824
|
+
* Create an artifact
|
|
5825
|
+
*
|
|
5826
|
+
* Creates an artifact owned by the caller, with its first version. Store each file with POST /api/files first.
|
|
5827
|
+
*/
|
|
5828
|
+
export const createArtifactMutation = (
|
|
5829
|
+
options?: Partial<Options<CreateArtifactData>>
|
|
5830
|
+
): UseMutationOptions<CreateArtifactResponse, CreateArtifactError, Options<CreateArtifactData>> => {
|
|
5831
|
+
const mutationOptions: UseMutationOptions<
|
|
5832
|
+
CreateArtifactResponse,
|
|
5833
|
+
CreateArtifactError,
|
|
5834
|
+
Options<CreateArtifactData>
|
|
5835
|
+
> = {
|
|
5836
|
+
mutationFn: async (fnOptions) => {
|
|
5837
|
+
const { data } = await createArtifact({
|
|
5838
|
+
...options,
|
|
5839
|
+
...fnOptions,
|
|
5840
|
+
throwOnError: true,
|
|
5841
|
+
})
|
|
5842
|
+
return data
|
|
5843
|
+
},
|
|
5844
|
+
}
|
|
5845
|
+
return mutationOptions
|
|
5846
|
+
}
|
|
5847
|
+
|
|
5848
|
+
/**
|
|
5849
|
+
* Delete an artifact
|
|
5850
|
+
*
|
|
5851
|
+
* Deletes the artifact with every version, from every conversation that shares it. Only its owner can.
|
|
5852
|
+
*/
|
|
5853
|
+
export const deleteArtifactMutation = (
|
|
5854
|
+
options?: Partial<Options<DeleteArtifactData>>
|
|
5855
|
+
): UseMutationOptions<DeleteArtifactResponse, DeleteArtifactError, Options<DeleteArtifactData>> => {
|
|
5856
|
+
const mutationOptions: UseMutationOptions<
|
|
5857
|
+
DeleteArtifactResponse,
|
|
5858
|
+
DeleteArtifactError,
|
|
5859
|
+
Options<DeleteArtifactData>
|
|
5860
|
+
> = {
|
|
5861
|
+
mutationFn: async (fnOptions) => {
|
|
5862
|
+
const { data } = await deleteArtifact({
|
|
5863
|
+
...options,
|
|
5864
|
+
...fnOptions,
|
|
5865
|
+
throwOnError: true,
|
|
5866
|
+
})
|
|
5867
|
+
return data
|
|
5868
|
+
},
|
|
5869
|
+
}
|
|
5870
|
+
return mutationOptions
|
|
5871
|
+
}
|
|
5872
|
+
|
|
5873
|
+
export const getArtifactQueryKey = (options: Options<GetArtifactData>) =>
|
|
5874
|
+
createQueryKey("getArtifact", options)
|
|
5875
|
+
|
|
5876
|
+
/**
|
|
5877
|
+
* Get an artifact and its versions
|
|
5878
|
+
*/
|
|
5879
|
+
export const getArtifactOptions = (options: Options<GetArtifactData>) =>
|
|
5880
|
+
queryOptions<
|
|
5881
|
+
GetArtifactResponse,
|
|
5882
|
+
GetArtifactError,
|
|
5883
|
+
GetArtifactResponse,
|
|
5884
|
+
ReturnType<typeof getArtifactQueryKey>
|
|
5885
|
+
>({
|
|
5886
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5887
|
+
const { data } = await getArtifact({
|
|
5888
|
+
...options,
|
|
5889
|
+
...queryKey[0],
|
|
5890
|
+
signal,
|
|
5891
|
+
throwOnError: true,
|
|
5892
|
+
})
|
|
5893
|
+
return data
|
|
5894
|
+
},
|
|
5895
|
+
queryKey: getArtifactQueryKey(options),
|
|
5896
|
+
})
|
|
5897
|
+
|
|
5898
|
+
/**
|
|
5899
|
+
* Reset what a page keeps
|
|
5900
|
+
*
|
|
5901
|
+
* Deletes every value the artifact keeps for the caller.
|
|
5902
|
+
*/
|
|
5903
|
+
export const clearArtifactStateMutation = (
|
|
5904
|
+
options?: Partial<Options<ClearArtifactStateData>>
|
|
5905
|
+
): UseMutationOptions<
|
|
5906
|
+
ClearArtifactStateResponse,
|
|
5907
|
+
ClearArtifactStateError,
|
|
5908
|
+
Options<ClearArtifactStateData>
|
|
5909
|
+
> => {
|
|
5910
|
+
const mutationOptions: UseMutationOptions<
|
|
5911
|
+
ClearArtifactStateResponse,
|
|
5912
|
+
ClearArtifactStateError,
|
|
5913
|
+
Options<ClearArtifactStateData>
|
|
5914
|
+
> = {
|
|
5915
|
+
mutationFn: async (fnOptions) => {
|
|
5916
|
+
const { data } = await clearArtifactState({
|
|
5917
|
+
...options,
|
|
5918
|
+
...fnOptions,
|
|
5919
|
+
throwOnError: true,
|
|
5920
|
+
})
|
|
5921
|
+
return data
|
|
5922
|
+
},
|
|
5923
|
+
}
|
|
5924
|
+
return mutationOptions
|
|
5925
|
+
}
|
|
5926
|
+
|
|
5927
|
+
export const getArtifactStateQueryKey = (options: Options<GetArtifactStateData>) =>
|
|
5928
|
+
createQueryKey("getArtifactState", options)
|
|
5929
|
+
|
|
5930
|
+
/**
|
|
5931
|
+
* Read what a page keeps
|
|
5932
|
+
*
|
|
5933
|
+
* Every value the artifact keeps for the caller as its reader, as a page keeps it with sixb.state, across its versions.
|
|
5934
|
+
*/
|
|
5935
|
+
export const getArtifactStateOptions = (options: Options<GetArtifactStateData>) =>
|
|
5936
|
+
queryOptions<
|
|
5937
|
+
GetArtifactStateResponse,
|
|
5938
|
+
GetArtifactStateError,
|
|
5939
|
+
GetArtifactStateResponse,
|
|
5940
|
+
ReturnType<typeof getArtifactStateQueryKey>
|
|
5941
|
+
>({
|
|
5942
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
5943
|
+
const { data } = await getArtifactState({
|
|
5944
|
+
...options,
|
|
5945
|
+
...queryKey[0],
|
|
5946
|
+
signal,
|
|
5947
|
+
throwOnError: true,
|
|
5948
|
+
})
|
|
5949
|
+
return data
|
|
5950
|
+
},
|
|
5951
|
+
queryKey: getArtifactStateQueryKey(options),
|
|
5952
|
+
})
|
|
5953
|
+
|
|
5954
|
+
/**
|
|
5955
|
+
* Delete a value a page keeps
|
|
5956
|
+
*/
|
|
5957
|
+
export const deleteArtifactStateValueMutation = (
|
|
5958
|
+
options?: Partial<Options<DeleteArtifactStateValueData>>
|
|
5959
|
+
): UseMutationOptions<
|
|
5960
|
+
DeleteArtifactStateValueResponse,
|
|
5961
|
+
DeleteArtifactStateValueError,
|
|
5962
|
+
Options<DeleteArtifactStateValueData>
|
|
5963
|
+
> => {
|
|
5964
|
+
const mutationOptions: UseMutationOptions<
|
|
5965
|
+
DeleteArtifactStateValueResponse,
|
|
5966
|
+
DeleteArtifactStateValueError,
|
|
5967
|
+
Options<DeleteArtifactStateValueData>
|
|
5968
|
+
> = {
|
|
5969
|
+
mutationFn: async (fnOptions) => {
|
|
5970
|
+
const { data } = await deleteArtifactStateValue({
|
|
5971
|
+
...options,
|
|
5972
|
+
...fnOptions,
|
|
5973
|
+
throwOnError: true,
|
|
5974
|
+
})
|
|
5975
|
+
return data
|
|
5976
|
+
},
|
|
5977
|
+
}
|
|
5978
|
+
return mutationOptions
|
|
5979
|
+
}
|
|
5980
|
+
|
|
5981
|
+
/**
|
|
5982
|
+
* Keep a value for a page
|
|
5983
|
+
*
|
|
5984
|
+
* Keeps a JSON value under the key for the caller, replacing one there. Refused with 413 state_full past the limits.
|
|
5985
|
+
*/
|
|
5986
|
+
export const setArtifactStateMutation = (
|
|
5987
|
+
options?: Partial<Options<SetArtifactStateData>>
|
|
5988
|
+
): UseMutationOptions<
|
|
5989
|
+
SetArtifactStateResponse,
|
|
5990
|
+
SetArtifactStateError,
|
|
5991
|
+
Options<SetArtifactStateData>
|
|
5992
|
+
> => {
|
|
5993
|
+
const mutationOptions: UseMutationOptions<
|
|
5994
|
+
SetArtifactStateResponse,
|
|
5995
|
+
SetArtifactStateError,
|
|
5996
|
+
Options<SetArtifactStateData>
|
|
5997
|
+
> = {
|
|
5998
|
+
mutationFn: async (fnOptions) => {
|
|
5999
|
+
const { data } = await setArtifactState({
|
|
6000
|
+
...options,
|
|
6001
|
+
...fnOptions,
|
|
6002
|
+
throwOnError: true,
|
|
6003
|
+
})
|
|
6004
|
+
return data
|
|
6005
|
+
},
|
|
6006
|
+
}
|
|
6007
|
+
return mutationOptions
|
|
6008
|
+
}
|
|
6009
|
+
|
|
6010
|
+
/**
|
|
6011
|
+
* Publish an artifact's next version
|
|
6012
|
+
*
|
|
6013
|
+
* The kind must be the artifact's. The new version becomes the latest. With baseVersion, it is refused with 409 artifact_moved when another version was published since.
|
|
6014
|
+
*/
|
|
6015
|
+
export const publishArtifactVersionMutation = (
|
|
6016
|
+
options?: Partial<Options<PublishArtifactVersionData>>
|
|
6017
|
+
): UseMutationOptions<
|
|
6018
|
+
PublishArtifactVersionResponse,
|
|
6019
|
+
PublishArtifactVersionError,
|
|
6020
|
+
Options<PublishArtifactVersionData>
|
|
6021
|
+
> => {
|
|
6022
|
+
const mutationOptions: UseMutationOptions<
|
|
6023
|
+
PublishArtifactVersionResponse,
|
|
6024
|
+
PublishArtifactVersionError,
|
|
6025
|
+
Options<PublishArtifactVersionData>
|
|
6026
|
+
> = {
|
|
6027
|
+
mutationFn: async (fnOptions) => {
|
|
6028
|
+
const { data } = await publishArtifactVersion({
|
|
6029
|
+
...options,
|
|
6030
|
+
...fnOptions,
|
|
6031
|
+
throwOnError: true,
|
|
6032
|
+
})
|
|
6033
|
+
return data
|
|
6034
|
+
},
|
|
6035
|
+
}
|
|
6036
|
+
return mutationOptions
|
|
6037
|
+
}
|
|
6038
|
+
|
|
6039
|
+
/**
|
|
6040
|
+
* Open a version in a frame
|
|
6041
|
+
*
|
|
6042
|
+
* A short-lived path that serves the files of a version that opens in a sandboxed frame, as slides do. It expires within an hour. A kind that does not open in a frame is refused with 409 artifact_kind_mismatch.
|
|
6043
|
+
*/
|
|
6044
|
+
export const createArtifactFrameMutation = (
|
|
6045
|
+
options?: Partial<Options<CreateArtifactFrameData>>
|
|
6046
|
+
): UseMutationOptions<
|
|
6047
|
+
CreateArtifactFrameResponse,
|
|
6048
|
+
CreateArtifactFrameError,
|
|
6049
|
+
Options<CreateArtifactFrameData>
|
|
6050
|
+
> => {
|
|
6051
|
+
const mutationOptions: UseMutationOptions<
|
|
6052
|
+
CreateArtifactFrameResponse,
|
|
6053
|
+
CreateArtifactFrameError,
|
|
6054
|
+
Options<CreateArtifactFrameData>
|
|
6055
|
+
> = {
|
|
6056
|
+
mutationFn: async (fnOptions) => {
|
|
6057
|
+
const { data } = await createArtifactFrame({
|
|
6058
|
+
...options,
|
|
6059
|
+
...fnOptions,
|
|
6060
|
+
throwOnError: true,
|
|
6061
|
+
})
|
|
6062
|
+
return data
|
|
6063
|
+
},
|
|
6064
|
+
}
|
|
6065
|
+
return mutationOptions
|
|
6066
|
+
}
|
|
6067
|
+
|
|
6068
|
+
export const getArtifactVersionQueryKey = (options: Options<GetArtifactVersionData>) =>
|
|
6069
|
+
createQueryKey("getArtifactVersion", options)
|
|
6070
|
+
|
|
6071
|
+
/**
|
|
6072
|
+
* Get an artifact version
|
|
6073
|
+
*
|
|
6074
|
+
* Its files, outline, and references. Use "latest" for the newest version.
|
|
6075
|
+
*/
|
|
6076
|
+
export const getArtifactVersionOptions = (options: Options<GetArtifactVersionData>) =>
|
|
6077
|
+
queryOptions<
|
|
6078
|
+
GetArtifactVersionResponse,
|
|
6079
|
+
GetArtifactVersionError,
|
|
6080
|
+
GetArtifactVersionResponse,
|
|
6081
|
+
ReturnType<typeof getArtifactVersionQueryKey>
|
|
6082
|
+
>({
|
|
6083
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6084
|
+
const { data } = await getArtifactVersion({
|
|
6085
|
+
...options,
|
|
6086
|
+
...queryKey[0],
|
|
6087
|
+
signal,
|
|
6088
|
+
throwOnError: true,
|
|
6089
|
+
})
|
|
6090
|
+
return data
|
|
6091
|
+
},
|
|
6092
|
+
queryKey: getArtifactVersionQueryKey(options),
|
|
6093
|
+
})
|
|
6094
|
+
|
|
6095
|
+
export const getArtifactQueryQueryKey = (options: Options<GetArtifactQueryData>) =>
|
|
6096
|
+
createQueryKey("getArtifactQuery", options)
|
|
6097
|
+
|
|
6098
|
+
/**
|
|
6099
|
+
* Run an artifact's query
|
|
6100
|
+
*
|
|
6101
|
+
* Runs the version's queries/<name>.json as the caller, with their rights: a type they cannot view is refused with 403, and a marked property they are not cleared for is left out of each row. Rows are serialized as POST /api/objects/query returns them, beside the schema of what they hold as the caller may view it. Use "latest" for the newest version. A query the ontology no longer admits is refused with 409 query_invalid.
|
|
6102
|
+
*/
|
|
6103
|
+
export const getArtifactQueryOptions = (options: Options<GetArtifactQueryData>) =>
|
|
6104
|
+
queryOptions<
|
|
6105
|
+
GetArtifactQueryResponse,
|
|
6106
|
+
GetArtifactQueryError,
|
|
6107
|
+
GetArtifactQueryResponse,
|
|
6108
|
+
ReturnType<typeof getArtifactQueryQueryKey>
|
|
6109
|
+
>({
|
|
6110
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6111
|
+
const { data } = await getArtifactQuery({
|
|
6112
|
+
...options,
|
|
6113
|
+
...queryKey[0],
|
|
6114
|
+
signal,
|
|
6115
|
+
throwOnError: true,
|
|
6116
|
+
})
|
|
6117
|
+
return data
|
|
6118
|
+
},
|
|
6119
|
+
queryKey: getArtifactQueryQueryKey(options),
|
|
6120
|
+
})
|
|
6121
|
+
|
|
6122
|
+
export const getArtifactFileContentQueryKey = (options: Options<GetArtifactFileContentData>) =>
|
|
6123
|
+
createQueryKey("getArtifactFileContent", options)
|
|
6124
|
+
|
|
6125
|
+
/**
|
|
6126
|
+
* Get a file of an artifact version
|
|
6127
|
+
*/
|
|
6128
|
+
export const getArtifactFileContentOptions = (options: Options<GetArtifactFileContentData>) =>
|
|
6129
|
+
queryOptions<
|
|
6130
|
+
GetArtifactFileContentResponse,
|
|
6131
|
+
GetArtifactFileContentError,
|
|
6132
|
+
GetArtifactFileContentResponse,
|
|
6133
|
+
ReturnType<typeof getArtifactFileContentQueryKey>
|
|
6134
|
+
>({
|
|
6135
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6136
|
+
const { data } = await getArtifactFileContent({
|
|
6137
|
+
...options,
|
|
6138
|
+
...queryKey[0],
|
|
6139
|
+
signal,
|
|
6140
|
+
throwOnError: true,
|
|
6141
|
+
})
|
|
6142
|
+
return data
|
|
6143
|
+
},
|
|
6144
|
+
queryKey: getArtifactFileContentQueryKey(options),
|
|
6145
|
+
})
|
|
6146
|
+
|
|
6147
|
+
export const listModelsQueryKey = (options?: Options<ListModelsData>) =>
|
|
6148
|
+
createQueryKey("listModels", options)
|
|
6149
|
+
|
|
6150
|
+
/**
|
|
6151
|
+
* List the project's models of every kind, with their options and prices
|
|
6152
|
+
*/
|
|
6153
|
+
export const listModelsOptions = (options?: Options<ListModelsData>) =>
|
|
6154
|
+
queryOptions<
|
|
6155
|
+
ListModelsResponse,
|
|
6156
|
+
DefaultError,
|
|
6157
|
+
ListModelsResponse,
|
|
6158
|
+
ReturnType<typeof listModelsQueryKey>
|
|
6159
|
+
>({
|
|
6160
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6161
|
+
const { data } = await listModels({
|
|
6162
|
+
...options,
|
|
6163
|
+
...queryKey[0],
|
|
6164
|
+
signal,
|
|
6165
|
+
throwOnError: true,
|
|
6166
|
+
})
|
|
6167
|
+
return data
|
|
6168
|
+
},
|
|
6169
|
+
queryKey: listModelsQueryKey(options),
|
|
6170
|
+
})
|
|
6171
|
+
|
|
6172
|
+
/**
|
|
6173
|
+
* Remove object link
|
|
6174
|
+
*/
|
|
6175
|
+
export const removeObjectLinkMutation = (
|
|
6176
|
+
options?: Partial<Options<RemoveObjectLinkData>>
|
|
6177
|
+
): UseMutationOptions<
|
|
6178
|
+
RemoveObjectLinkResponse,
|
|
6179
|
+
RemoveObjectLinkError,
|
|
6180
|
+
Options<RemoveObjectLinkData>
|
|
6181
|
+
> => {
|
|
6182
|
+
const mutationOptions: UseMutationOptions<
|
|
6183
|
+
RemoveObjectLinkResponse,
|
|
6184
|
+
RemoveObjectLinkError,
|
|
6185
|
+
Options<RemoveObjectLinkData>
|
|
6186
|
+
> = {
|
|
6187
|
+
mutationFn: async (fnOptions) => {
|
|
6188
|
+
const { data } = await removeObjectLink({
|
|
6189
|
+
...options,
|
|
6190
|
+
...fnOptions,
|
|
6191
|
+
throwOnError: true,
|
|
6192
|
+
})
|
|
6193
|
+
return data
|
|
6194
|
+
},
|
|
6195
|
+
}
|
|
6196
|
+
return mutationOptions
|
|
6197
|
+
}
|
|
6198
|
+
|
|
6199
|
+
/**
|
|
6200
|
+
* Create or update object link
|
|
4477
6201
|
*/
|
|
4478
6202
|
export const upsertObjectLinkMutation = (
|
|
4479
6203
|
options?: Partial<Options<UpsertObjectLinkData>>
|
|
@@ -4653,6 +6377,352 @@ export const listLogsOptions = (options?: Options<ListLogsData>) =>
|
|
|
4653
6377
|
queryKey: listLogsQueryKey(options),
|
|
4654
6378
|
})
|
|
4655
6379
|
|
|
6380
|
+
export const getActivityCaptureConfigQueryKey = (options?: Options<GetActivityCaptureConfigData>) =>
|
|
6381
|
+
createQueryKey("getActivityCaptureConfig", options)
|
|
6382
|
+
|
|
6383
|
+
/**
|
|
6384
|
+
* Read whether this browser session records activity
|
|
6385
|
+
*
|
|
6386
|
+
* A browser or shared-link session only; a native client's session gets 403.
|
|
6387
|
+
*/
|
|
6388
|
+
export const getActivityCaptureConfigOptions = (options?: Options<GetActivityCaptureConfigData>) =>
|
|
6389
|
+
queryOptions<
|
|
6390
|
+
GetActivityCaptureConfigResponse,
|
|
6391
|
+
GetActivityCaptureConfigError,
|
|
6392
|
+
GetActivityCaptureConfigResponse,
|
|
6393
|
+
ReturnType<typeof getActivityCaptureConfigQueryKey>
|
|
6394
|
+
>({
|
|
6395
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6396
|
+
const { data } = await getActivityCaptureConfig({
|
|
6397
|
+
...options,
|
|
6398
|
+
...queryKey[0],
|
|
6399
|
+
signal,
|
|
6400
|
+
throwOnError: true,
|
|
6401
|
+
})
|
|
6402
|
+
return data
|
|
6403
|
+
},
|
|
6404
|
+
queryKey: getActivityCaptureConfigQueryKey(options),
|
|
6405
|
+
})
|
|
6406
|
+
|
|
6407
|
+
/**
|
|
6408
|
+
* Record page views, activity and interactions for this browser session
|
|
6409
|
+
*
|
|
6410
|
+
* A browser or shared-link session only; a native client's session gets 403. The visit belongs to the calling session.
|
|
6411
|
+
*/
|
|
6412
|
+
export const captureActivityMutation = (
|
|
6413
|
+
options?: Partial<Options<CaptureActivityData>>
|
|
6414
|
+
): UseMutationOptions<
|
|
6415
|
+
CaptureActivityResponse,
|
|
6416
|
+
CaptureActivityError,
|
|
6417
|
+
Options<CaptureActivityData>
|
|
6418
|
+
> => {
|
|
6419
|
+
const mutationOptions: UseMutationOptions<
|
|
6420
|
+
CaptureActivityResponse,
|
|
6421
|
+
CaptureActivityError,
|
|
6422
|
+
Options<CaptureActivityData>
|
|
6423
|
+
> = {
|
|
6424
|
+
mutationFn: async (fnOptions) => {
|
|
6425
|
+
const { data } = await captureActivity({
|
|
6426
|
+
...options,
|
|
6427
|
+
...fnOptions,
|
|
6428
|
+
throwOnError: true,
|
|
6429
|
+
})
|
|
6430
|
+
return data
|
|
6431
|
+
},
|
|
6432
|
+
}
|
|
6433
|
+
return mutationOptions
|
|
6434
|
+
}
|
|
6435
|
+
|
|
6436
|
+
export const listActivityVisitsQueryKey = (options: Options<ListActivityVisitsData>) =>
|
|
6437
|
+
createQueryKey("listActivityVisits", options)
|
|
6438
|
+
|
|
6439
|
+
/**
|
|
6440
|
+
* List the visits active in a period
|
|
6441
|
+
*/
|
|
6442
|
+
export const listActivityVisitsOptions = (options: Options<ListActivityVisitsData>) =>
|
|
6443
|
+
queryOptions<
|
|
6444
|
+
ListActivityVisitsResponse,
|
|
6445
|
+
ListActivityVisitsError,
|
|
6446
|
+
ListActivityVisitsResponse,
|
|
6447
|
+
ReturnType<typeof listActivityVisitsQueryKey>
|
|
6448
|
+
>({
|
|
6449
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6450
|
+
const { data } = await listActivityVisits({
|
|
6451
|
+
...options,
|
|
6452
|
+
...queryKey[0],
|
|
6453
|
+
signal,
|
|
6454
|
+
throwOnError: true,
|
|
6455
|
+
})
|
|
6456
|
+
return data
|
|
6457
|
+
},
|
|
6458
|
+
queryKey: listActivityVisitsQueryKey(options),
|
|
6459
|
+
})
|
|
6460
|
+
|
|
6461
|
+
export const listActivityUsersQueryKey = (options: Options<ListActivityUsersData>) =>
|
|
6462
|
+
createQueryKey("listActivityUsers", options)
|
|
6463
|
+
|
|
6464
|
+
/**
|
|
6465
|
+
* List the signed-in users active in a period
|
|
6466
|
+
*/
|
|
6467
|
+
export const listActivityUsersOptions = (options: Options<ListActivityUsersData>) =>
|
|
6468
|
+
queryOptions<
|
|
6469
|
+
ListActivityUsersResponse,
|
|
6470
|
+
ListActivityUsersError,
|
|
6471
|
+
ListActivityUsersResponse,
|
|
6472
|
+
ReturnType<typeof listActivityUsersQueryKey>
|
|
6473
|
+
>({
|
|
6474
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6475
|
+
const { data } = await listActivityUsers({
|
|
6476
|
+
...options,
|
|
6477
|
+
...queryKey[0],
|
|
6478
|
+
signal,
|
|
6479
|
+
throwOnError: true,
|
|
6480
|
+
})
|
|
6481
|
+
return data
|
|
6482
|
+
},
|
|
6483
|
+
queryKey: listActivityUsersQueryKey(options),
|
|
6484
|
+
})
|
|
6485
|
+
|
|
6486
|
+
export const getActivitySummaryQueryKey = (options: Options<GetActivitySummaryData>) =>
|
|
6487
|
+
createQueryKey("getActivitySummary", options)
|
|
6488
|
+
|
|
6489
|
+
/**
|
|
6490
|
+
* Count the users, visits and page views of a period
|
|
6491
|
+
*/
|
|
6492
|
+
export const getActivitySummaryOptions = (options: Options<GetActivitySummaryData>) =>
|
|
6493
|
+
queryOptions<
|
|
6494
|
+
GetActivitySummaryResponse,
|
|
6495
|
+
GetActivitySummaryError,
|
|
6496
|
+
GetActivitySummaryResponse,
|
|
6497
|
+
ReturnType<typeof getActivitySummaryQueryKey>
|
|
6498
|
+
>({
|
|
6499
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6500
|
+
const { data } = await getActivitySummary({
|
|
6501
|
+
...options,
|
|
6502
|
+
...queryKey[0],
|
|
6503
|
+
signal,
|
|
6504
|
+
throwOnError: true,
|
|
6505
|
+
})
|
|
6506
|
+
return data
|
|
6507
|
+
},
|
|
6508
|
+
queryKey: getActivitySummaryQueryKey(options),
|
|
6509
|
+
})
|
|
6510
|
+
|
|
6511
|
+
export const getActivityCalendarQueryKey = (options: Options<GetActivityCalendarData>) =>
|
|
6512
|
+
createQueryKey("getActivityCalendar", options)
|
|
6513
|
+
|
|
6514
|
+
/**
|
|
6515
|
+
* Read a user's active days in a UTC year
|
|
6516
|
+
*/
|
|
6517
|
+
export const getActivityCalendarOptions = (options: Options<GetActivityCalendarData>) =>
|
|
6518
|
+
queryOptions<
|
|
6519
|
+
GetActivityCalendarResponse,
|
|
6520
|
+
GetActivityCalendarError,
|
|
6521
|
+
GetActivityCalendarResponse,
|
|
6522
|
+
ReturnType<typeof getActivityCalendarQueryKey>
|
|
6523
|
+
>({
|
|
6524
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6525
|
+
const { data } = await getActivityCalendar({
|
|
6526
|
+
...options,
|
|
6527
|
+
...queryKey[0],
|
|
6528
|
+
signal,
|
|
6529
|
+
throwOnError: true,
|
|
6530
|
+
})
|
|
6531
|
+
return data
|
|
6532
|
+
},
|
|
6533
|
+
queryKey: getActivityCalendarQueryKey(options),
|
|
6534
|
+
})
|
|
6535
|
+
|
|
6536
|
+
export const getActivityVisitTimelineQueryKey = (options: Options<GetActivityVisitTimelineData>) =>
|
|
6537
|
+
createQueryKey("getActivityVisitTimeline", options)
|
|
6538
|
+
|
|
6539
|
+
/**
|
|
6540
|
+
* Read what one visit did
|
|
6541
|
+
*
|
|
6542
|
+
* Its page views and interactions, with the actions, workflows and Agent runs its session started, and the connection it came through. At most 200 page views and interactions, and 200 recorded executions: see truncated.
|
|
6543
|
+
*/
|
|
6544
|
+
export const getActivityVisitTimelineOptions = (options: Options<GetActivityVisitTimelineData>) =>
|
|
6545
|
+
queryOptions<
|
|
6546
|
+
GetActivityVisitTimelineResponse,
|
|
6547
|
+
GetActivityVisitTimelineError,
|
|
6548
|
+
GetActivityVisitTimelineResponse,
|
|
6549
|
+
ReturnType<typeof getActivityVisitTimelineQueryKey>
|
|
6550
|
+
>({
|
|
6551
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6552
|
+
const { data } = await getActivityVisitTimeline({
|
|
6553
|
+
...options,
|
|
6554
|
+
...queryKey[0],
|
|
6555
|
+
signal,
|
|
6556
|
+
throwOnError: true,
|
|
6557
|
+
})
|
|
6558
|
+
return data
|
|
6559
|
+
},
|
|
6560
|
+
queryKey: getActivityVisitTimelineQueryKey(options),
|
|
6561
|
+
})
|
|
6562
|
+
|
|
6563
|
+
export const listActivityConnectionsQueryKey = (options: Options<ListActivityConnectionsData>) =>
|
|
6564
|
+
createQueryKey("listActivityConnections", options)
|
|
6565
|
+
|
|
6566
|
+
/**
|
|
6567
|
+
* List a user's sign-ins with the visits each opened
|
|
6568
|
+
*
|
|
6569
|
+
* Newest first, revoked and expired sessions included.
|
|
6570
|
+
*/
|
|
6571
|
+
export const listActivityConnectionsOptions = (options: Options<ListActivityConnectionsData>) =>
|
|
6572
|
+
queryOptions<
|
|
6573
|
+
ListActivityConnectionsResponse,
|
|
6574
|
+
ListActivityConnectionsError,
|
|
6575
|
+
ListActivityConnectionsResponse,
|
|
6576
|
+
ReturnType<typeof listActivityConnectionsQueryKey>
|
|
6577
|
+
>({
|
|
6578
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6579
|
+
const { data } = await listActivityConnections({
|
|
6580
|
+
...options,
|
|
6581
|
+
...queryKey[0],
|
|
6582
|
+
signal,
|
|
6583
|
+
throwOnError: true,
|
|
6584
|
+
})
|
|
6585
|
+
return data
|
|
6586
|
+
},
|
|
6587
|
+
queryKey: listActivityConnectionsQueryKey(options),
|
|
6588
|
+
})
|
|
6589
|
+
|
|
6590
|
+
export const listActivityConnectionsInfiniteQueryKey = (
|
|
6591
|
+
options: Options<ListActivityConnectionsData>
|
|
6592
|
+
): QueryKey<Options<ListActivityConnectionsData>> =>
|
|
6593
|
+
createQueryKey("listActivityConnections", options, true)
|
|
6594
|
+
|
|
6595
|
+
/**
|
|
6596
|
+
* List a user's sign-ins with the visits each opened
|
|
6597
|
+
*
|
|
6598
|
+
* Newest first, revoked and expired sessions included.
|
|
6599
|
+
*/
|
|
6600
|
+
export const listActivityConnectionsInfiniteOptions = (
|
|
6601
|
+
options: Options<ListActivityConnectionsData>
|
|
6602
|
+
) =>
|
|
6603
|
+
infiniteQueryOptions<
|
|
6604
|
+
ListActivityConnectionsResponse,
|
|
6605
|
+
ListActivityConnectionsError,
|
|
6606
|
+
InfiniteData<ListActivityConnectionsResponse>,
|
|
6607
|
+
QueryKey<Options<ListActivityConnectionsData>>,
|
|
6608
|
+
| string
|
|
6609
|
+
| Pick<QueryKey<Options<ListActivityConnectionsData>>[0], "body" | "headers" | "path" | "query">
|
|
6610
|
+
>(
|
|
6611
|
+
// @ts-ignore
|
|
6612
|
+
{
|
|
6613
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
6614
|
+
// @ts-ignore
|
|
6615
|
+
const page: Pick<
|
|
6616
|
+
QueryKey<Options<ListActivityConnectionsData>>[0],
|
|
6617
|
+
"body" | "headers" | "path" | "query"
|
|
6618
|
+
> =
|
|
6619
|
+
typeof pageParam === "object"
|
|
6620
|
+
? pageParam
|
|
6621
|
+
: {
|
|
6622
|
+
query: {
|
|
6623
|
+
cursor: pageParam,
|
|
6624
|
+
},
|
|
6625
|
+
}
|
|
6626
|
+
const params = createInfiniteParams(queryKey, page)
|
|
6627
|
+
const { data } = await listActivityConnections({
|
|
6628
|
+
...options,
|
|
6629
|
+
...params,
|
|
6630
|
+
signal,
|
|
6631
|
+
throwOnError: true,
|
|
6632
|
+
})
|
|
6633
|
+
return data
|
|
6634
|
+
},
|
|
6635
|
+
queryKey: listActivityConnectionsInfiniteQueryKey(options),
|
|
6636
|
+
}
|
|
6637
|
+
)
|
|
6638
|
+
|
|
6639
|
+
export const listUsersQueryKey = (options?: Options<ListUsersData>) =>
|
|
6640
|
+
createQueryKey("listUsers", options)
|
|
6641
|
+
|
|
6642
|
+
/**
|
|
6643
|
+
* List project members
|
|
6644
|
+
*/
|
|
6645
|
+
export const listUsersOptions = (options?: Options<ListUsersData>) =>
|
|
6646
|
+
queryOptions<
|
|
6647
|
+
ListUsersResponse,
|
|
6648
|
+
ListUsersError,
|
|
6649
|
+
ListUsersResponse,
|
|
6650
|
+
ReturnType<typeof listUsersQueryKey>
|
|
6651
|
+
>({
|
|
6652
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6653
|
+
const { data } = await listUsers({
|
|
6654
|
+
...options,
|
|
6655
|
+
...queryKey[0],
|
|
6656
|
+
signal,
|
|
6657
|
+
throwOnError: true,
|
|
6658
|
+
})
|
|
6659
|
+
return data
|
|
6660
|
+
},
|
|
6661
|
+
queryKey: listUsersQueryKey(options),
|
|
6662
|
+
})
|
|
6663
|
+
|
|
6664
|
+
export const listUsersInfiniteQueryKey = (
|
|
6665
|
+
options?: Options<ListUsersData>
|
|
6666
|
+
): QueryKey<Options<ListUsersData>> => createQueryKey("listUsers", options, true)
|
|
6667
|
+
|
|
6668
|
+
/**
|
|
6669
|
+
* List project members
|
|
6670
|
+
*/
|
|
6671
|
+
export const listUsersInfiniteOptions = (options?: Options<ListUsersData>) =>
|
|
6672
|
+
infiniteQueryOptions<
|
|
6673
|
+
ListUsersResponse,
|
|
6674
|
+
ListUsersError,
|
|
6675
|
+
InfiniteData<ListUsersResponse>,
|
|
6676
|
+
QueryKey<Options<ListUsersData>>,
|
|
6677
|
+
number | Pick<QueryKey<Options<ListUsersData>>[0], "body" | "headers" | "path" | "query">
|
|
6678
|
+
>(
|
|
6679
|
+
// @ts-ignore
|
|
6680
|
+
{
|
|
6681
|
+
queryFn: async ({ pageParam, queryKey, signal }) => {
|
|
6682
|
+
// @ts-ignore
|
|
6683
|
+
const page: Pick<
|
|
6684
|
+
QueryKey<Options<ListUsersData>>[0],
|
|
6685
|
+
"body" | "headers" | "path" | "query"
|
|
6686
|
+
> =
|
|
6687
|
+
typeof pageParam === "object"
|
|
6688
|
+
? pageParam
|
|
6689
|
+
: {
|
|
6690
|
+
query: {
|
|
6691
|
+
offset: pageParam,
|
|
6692
|
+
},
|
|
6693
|
+
}
|
|
6694
|
+
const params = createInfiniteParams(queryKey, page)
|
|
6695
|
+
const { data } = await listUsers({
|
|
6696
|
+
...options,
|
|
6697
|
+
...params,
|
|
6698
|
+
signal,
|
|
6699
|
+
throwOnError: true,
|
|
6700
|
+
})
|
|
6701
|
+
return data
|
|
6702
|
+
},
|
|
6703
|
+
queryKey: listUsersInfiniteQueryKey(options),
|
|
6704
|
+
}
|
|
6705
|
+
)
|
|
6706
|
+
|
|
6707
|
+
export const getUserQueryKey = (options: Options<GetUserData>) => createQueryKey("getUser", options)
|
|
6708
|
+
|
|
6709
|
+
/**
|
|
6710
|
+
* Get a project member
|
|
6711
|
+
*/
|
|
6712
|
+
export const getUserOptions = (options: Options<GetUserData>) =>
|
|
6713
|
+
queryOptions<GetUserResponse, GetUserError, GetUserResponse, ReturnType<typeof getUserQueryKey>>({
|
|
6714
|
+
queryFn: async ({ queryKey, signal }) => {
|
|
6715
|
+
const { data } = await getUser({
|
|
6716
|
+
...options,
|
|
6717
|
+
...queryKey[0],
|
|
6718
|
+
signal,
|
|
6719
|
+
throwOnError: true,
|
|
6720
|
+
})
|
|
6721
|
+
return data
|
|
6722
|
+
},
|
|
6723
|
+
queryKey: getUserQueryKey(options),
|
|
6724
|
+
})
|
|
6725
|
+
|
|
4656
6726
|
export const listProjectionsQueryKey = (options?: Options<ListProjectionsData>) =>
|
|
4657
6727
|
createQueryKey("listProjections", options)
|
|
4658
6728
|
|