@sixb/client 0.1.21 → 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.
Files changed (60) hide show
  1. package/dist/agent-streams.d.ts +5 -3
  2. package/dist/agent-streams.d.ts.map +1 -1
  3. package/dist/browser.js +2 -2
  4. package/dist/{chunk-9wd8x2em.js → chunk-1v736aje.js} +1 -1
  5. package/dist/{chunk-3b154p8n.js → chunk-263m4e9p.js} +38 -7
  6. package/dist/chunk-263m4e9p.js.map +17 -0
  7. package/dist/{chunk-3f2pjdzk.js → chunk-59f4fbnk.js} +352 -3
  8. package/dist/chunk-59f4fbnk.js.map +19 -0
  9. package/dist/{chunk-qdq5gfqx.js → chunk-9gz30dxy.js} +1 -1
  10. package/dist/{chunk-s5zamywm.js → chunk-k2j71x7a.js} +2 -2
  11. package/dist/{chunk-ana8rtgb.js → chunk-tttfv49k.js} +51 -6
  12. package/dist/chunk-tttfv49k.js.map +10 -0
  13. package/dist/connectors/queries.d.ts.map +1 -1
  14. package/dist/events-builder.d.ts +12 -0
  15. package/dist/events-builder.d.ts.map +1 -1
  16. package/dist/generated/@tanstack/react-query.gen.d.ts +9504 -291
  17. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  18. package/dist/generated/index.d.ts +2 -2
  19. package/dist/generated/index.d.ts.map +1 -1
  20. package/dist/generated/sdk.gen.d.ts +225 -7
  21. package/dist/generated/sdk.gen.d.ts.map +1 -1
  22. package/dist/generated/types.gen.d.ts +7108 -1967
  23. package/dist/generated/types.gen.d.ts.map +1 -1
  24. package/dist/hooks.d.ts +1 -0
  25. package/dist/hooks.d.ts.map +1 -1
  26. package/dist/hooks.js +781 -14
  27. package/dist/hooks.js.map +9 -8
  28. package/dist/index.js +86 -6
  29. package/dist/index.js.map +1 -1
  30. package/dist/logs.js +3 -3
  31. package/dist/models.js +82 -2
  32. package/dist/models.js.map +1 -1
  33. package/dist/query-hooks.d.ts +1 -1
  34. package/dist/query-hooks.d.ts.map +1 -1
  35. package/dist/query.d.ts +12 -4
  36. package/dist/query.d.ts.map +1 -1
  37. package/dist/query.js +7 -5
  38. package/dist/query.js.map +1 -1
  39. package/dist/useAgentActivityStream.d.ts +3 -1
  40. package/dist/useAgentActivityStream.d.ts.map +1 -1
  41. package/dist/users-hooks.d.ts +109 -0
  42. package/dist/users-hooks.d.ts.map +1 -0
  43. package/package.json +2 -2
  44. package/src/agent-streams.ts +16 -5
  45. package/src/events-builder.ts +51 -0
  46. package/src/generated/@tanstack/react-query.gen.ts +1536 -46
  47. package/src/generated/index.ts +248 -0
  48. package/src/generated/sdk.gen.ts +964 -49
  49. package/src/generated/types.gen.ts +8324 -2013
  50. package/src/hooks.ts +8 -0
  51. package/src/query-hooks.ts +1 -1
  52. package/src/query.ts +86 -5
  53. package/src/useAgentActivityStream.ts +10 -1
  54. package/src/users-hooks.ts +87 -0
  55. package/dist/chunk-3b154p8n.js.map +0 -17
  56. package/dist/chunk-3f2pjdzk.js.map +0 -19
  57. package/dist/chunk-ana8rtgb.js.map +0 -10
  58. /package/dist/{chunk-9wd8x2em.js.map → chunk-1v736aje.js.map} +0 -0
  59. /package/dist/{chunk-qdq5gfqx.js.map → chunk-9gz30dxy.js.map} +0 -0
  60. /package/dist/{chunk-s5zamywm.js.map → chunk-k2j71x7a.js.map} +0 -0
@@ -11,12 +11,15 @@ 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,
19
21
  captureActivity,
22
+ clearArtifactState,
20
23
  completeFileUpload,
21
24
  countObjects,
22
25
  createAgentThread,
@@ -29,14 +32,21 @@ import {
29
32
  createAuthServiceAccountAccessToken,
30
33
  createDeviceAuthorization,
31
34
  createFileUpload,
35
+ decideAgentApproval,
36
+ deleteAgentMemory,
32
37
  deleteAiLimitPolicy,
33
38
  deleteArtifact,
39
+ deleteArtifactStateValue,
34
40
  disableAuthServiceAccount,
35
41
  disconnectConnectorConnection,
36
42
  exchangeDeviceAuthorization,
37
43
  exchangeSharedAccess,
38
44
  existsObjects,
39
45
  facetObjects,
46
+ forkAgentThread,
47
+ generateImages,
48
+ generateSpeech,
49
+ generateText,
40
50
  getAction,
41
51
  getActionRun,
42
52
  getActionRunFileContent,
@@ -45,18 +55,26 @@ import {
45
55
  getActivitySummary,
46
56
  getActivityVisitTimeline,
47
57
  getAgent,
58
+ getAgentChildFileContent,
59
+ getAgentMemory,
48
60
  getAgentMessageFileContent,
61
+ getAgentPreferences,
49
62
  getAgentRun,
50
63
  getAgentThread,
51
64
  getAiAccountingOverview,
52
65
  getAiLimitStatus,
53
66
  getAiLimitSubjectOptions,
67
+ getAiModelCallFileContent,
68
+ getAiModelCallFiles,
54
69
  getArtifact,
55
70
  getArtifactFileContent,
71
+ getArtifactQuery,
72
+ getArtifactState,
56
73
  getArtifactVersion,
57
74
  getAuthAccessManagementOptions,
58
75
  getAuthInvitationOptions,
59
76
  getAuthMembershipOptions,
77
+ getAuthProfile,
60
78
  getAuthSession,
61
79
  getBulkTelemetryHistory,
62
80
  getConnector,
@@ -65,8 +83,12 @@ import {
65
83
  getDatasetVersion,
66
84
  getLatestTelemetry,
67
85
  getObject,
86
+ getObjectByUniqueProperty,
68
87
  getObjectFileContent,
69
88
  getObjectType,
89
+ getObservedAgentChildFileContent,
90
+ getObservedAgentMessageFileContent,
91
+ getObservedAgentThread,
70
92
  getPipeline,
71
93
  getPipelineRun,
72
94
  getProjectInfo,
@@ -77,6 +99,7 @@ import {
77
99
  getStatus,
78
100
  getSync,
79
101
  getTelemetryHistory,
102
+ getUser,
80
103
  getWorkflow,
81
104
  getWorkflowAgentNodeExecution,
82
105
  getWorkflowIntervention,
@@ -89,6 +112,10 @@ import {
89
112
  listActivityConnections,
90
113
  listActivityUsers,
91
114
  listActivityVisits,
115
+ listAgentApprovals,
116
+ listAgentMemoryRevisions,
117
+ listAgentThreadApprovals,
118
+ listAgentThreadChildren,
92
119
  listAgentThreadMessages,
93
120
  listAgentThreadRuns,
94
121
  listAgentThreads,
@@ -112,6 +139,9 @@ import {
112
139
  listModels,
113
140
  listObjects,
114
141
  listObjectTypes,
142
+ listObservedAgentThreadChildren,
143
+ listObservedAgentThreadMessages,
144
+ listObservedAgentThreadRuns,
115
145
  listPendingConnectorConnectionRuns,
116
146
  listPipelineRuns,
117
147
  listPipelines,
@@ -122,6 +152,7 @@ import {
122
152
  listSharedAccessGrants,
123
153
  listSyncRuns,
124
154
  listSyncs,
155
+ listUsers,
125
156
  listWebhookRuns,
126
157
  listWorkflowInterventions,
127
158
  listWorkflowRuns,
@@ -135,6 +166,7 @@ import {
135
166
  reauthorizeConnectorConnection,
136
167
  recreateAgentThreadSandbox,
137
168
  refreshAuthSession,
169
+ removeAgentThreadParticipant,
138
170
  removeObjectLink,
139
171
  requestAction,
140
172
  requestPipelineRun,
@@ -147,8 +179,11 @@ import {
147
179
  revokeAuthSession,
148
180
  revokeConnectorConnection,
149
181
  revokeSharedAccessGrant,
182
+ saveAgentMemory,
150
183
  searchObjects,
151
184
  selectConnectorConnectionRunAccount,
185
+ setAgentThreadApprovalMode,
186
+ setArtifactState,
152
187
  signFileUploadPart,
153
188
  signOut,
154
189
  signOutAll,
@@ -156,8 +191,11 @@ import {
156
191
  startConnectorConnectionRun,
157
192
  submitWorkflowIntervention,
158
193
  suspendAuthMember,
194
+ transcribeAudio,
195
+ updateAgentPreferences,
159
196
  updateAiLimitPolicy,
160
197
  updateAuthMemberGroups,
198
+ updateAuthProfile,
161
199
  uploadFileContent,
162
200
  uploadFileRaw,
163
201
  upsertObject,
@@ -167,12 +205,18 @@ import type {
167
205
  AbortFileUploadData,
168
206
  AbortFileUploadError,
169
207
  AbortFileUploadResponse,
208
+ AddAgentThreadParticipantsData,
209
+ AddAgentThreadParticipantsError,
210
+ AddAgentThreadParticipantsResponse,
170
211
  AddConnectorConnectionData,
171
212
  AddConnectorConnectionError,
172
213
  AddConnectorConnectionResponse,
173
214
  AppendTelemetryData,
174
215
  AppendTelemetryError,
175
216
  AppendTelemetryResponse,
217
+ CancelAgentRunByIdData,
218
+ CancelAgentRunByIdError,
219
+ CancelAgentRunByIdResponse,
176
220
  CancelAgentRunData,
177
221
  CancelAgentRunError,
178
222
  CancelAgentRunResponse,
@@ -185,6 +229,9 @@ import type {
185
229
  CaptureActivityData,
186
230
  CaptureActivityError,
187
231
  CaptureActivityResponse,
232
+ ClearArtifactStateData,
233
+ ClearArtifactStateError,
234
+ ClearArtifactStateResponse,
188
235
  CompleteFileUploadData,
189
236
  CompleteFileUploadError,
190
237
  CompleteFileUploadResponse,
@@ -221,12 +268,21 @@ import type {
221
268
  CreateFileUploadData,
222
269
  CreateFileUploadError,
223
270
  CreateFileUploadResponse,
271
+ DecideAgentApprovalData,
272
+ DecideAgentApprovalError,
273
+ DecideAgentApprovalResponse,
274
+ DeleteAgentMemoryData,
275
+ DeleteAgentMemoryError,
276
+ DeleteAgentMemoryResponse,
224
277
  DeleteAiLimitPolicyData,
225
278
  DeleteAiLimitPolicyError,
226
279
  DeleteAiLimitPolicyResponse,
227
280
  DeleteArtifactData,
228
281
  DeleteArtifactError,
229
282
  DeleteArtifactResponse,
283
+ DeleteArtifactStateValueData,
284
+ DeleteArtifactStateValueError,
285
+ DeleteArtifactStateValueResponse,
230
286
  DisableAuthServiceAccountData,
231
287
  DisableAuthServiceAccountError,
232
288
  DisableAuthServiceAccountResponse,
@@ -244,6 +300,18 @@ import type {
244
300
  FacetObjectsData,
245
301
  FacetObjectsError,
246
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,
247
315
  GetActionData,
248
316
  GetActionError,
249
317
  GetActionResponse,
@@ -265,11 +333,20 @@ import type {
265
333
  GetActivityVisitTimelineData,
266
334
  GetActivityVisitTimelineError,
267
335
  GetActivityVisitTimelineResponse,
336
+ GetAgentChildFileContentData,
337
+ GetAgentChildFileContentError,
338
+ GetAgentChildFileContentResponse,
268
339
  GetAgentData,
269
340
  GetAgentError,
341
+ GetAgentMemoryData,
342
+ GetAgentMemoryError,
343
+ GetAgentMemoryResponse,
270
344
  GetAgentMessageFileContentData,
271
345
  GetAgentMessageFileContentError,
272
346
  GetAgentMessageFileContentResponse,
347
+ GetAgentPreferencesData,
348
+ GetAgentPreferencesError,
349
+ GetAgentPreferencesResponse,
273
350
  GetAgentResponse,
274
351
  GetAgentRunData,
275
352
  GetAgentRunError,
@@ -286,12 +363,24 @@ import type {
286
363
  GetAiLimitSubjectOptionsData,
287
364
  GetAiLimitSubjectOptionsError,
288
365
  GetAiLimitSubjectOptionsResponse,
366
+ GetAiModelCallFileContentData,
367
+ GetAiModelCallFileContentError,
368
+ GetAiModelCallFileContentResponse,
369
+ GetAiModelCallFilesData,
370
+ GetAiModelCallFilesError,
371
+ GetAiModelCallFilesResponse,
289
372
  GetArtifactData,
290
373
  GetArtifactError,
291
374
  GetArtifactFileContentData,
292
375
  GetArtifactFileContentError,
293
376
  GetArtifactFileContentResponse,
377
+ GetArtifactQueryData,
378
+ GetArtifactQueryError,
379
+ GetArtifactQueryResponse,
294
380
  GetArtifactResponse,
381
+ GetArtifactStateData,
382
+ GetArtifactStateError,
383
+ GetArtifactStateResponse,
295
384
  GetArtifactVersionData,
296
385
  GetArtifactVersionError,
297
386
  GetArtifactVersionResponse,
@@ -304,6 +393,9 @@ import type {
304
393
  GetAuthMembershipOptionsData,
305
394
  GetAuthMembershipOptionsError,
306
395
  GetAuthMembershipOptionsResponse,
396
+ GetAuthProfileData,
397
+ GetAuthProfileError,
398
+ GetAuthProfileResponse,
307
399
  GetAuthSessionData,
308
400
  GetAuthSessionResponse,
309
401
  GetBulkTelemetryHistoryData,
@@ -324,6 +416,9 @@ import type {
324
416
  GetLatestTelemetryData,
325
417
  GetLatestTelemetryError,
326
418
  GetLatestTelemetryResponse,
419
+ GetObjectByUniquePropertyData,
420
+ GetObjectByUniquePropertyError,
421
+ GetObjectByUniquePropertyResponse,
327
422
  GetObjectData,
328
423
  GetObjectError,
329
424
  GetObjectFileContentData,
@@ -333,6 +428,15 @@ import type {
333
428
  GetObjectTypeData,
334
429
  GetObjectTypeError,
335
430
  GetObjectTypeResponse,
431
+ GetObservedAgentChildFileContentData,
432
+ GetObservedAgentChildFileContentError,
433
+ GetObservedAgentChildFileContentResponse,
434
+ GetObservedAgentMessageFileContentData,
435
+ GetObservedAgentMessageFileContentError,
436
+ GetObservedAgentMessageFileContentResponse,
437
+ GetObservedAgentThreadData,
438
+ GetObservedAgentThreadError,
439
+ GetObservedAgentThreadResponse,
336
440
  GetPipelineData,
337
441
  GetPipelineError,
338
442
  GetPipelineResponse,
@@ -361,6 +465,9 @@ import type {
361
465
  GetTelemetryHistoryData,
362
466
  GetTelemetryHistoryError,
363
467
  GetTelemetryHistoryResponse,
468
+ GetUserData,
469
+ GetUserError,
470
+ GetUserResponse,
364
471
  GetWorkflowAgentNodeExecutionData,
365
472
  GetWorkflowAgentNodeExecutionError,
366
473
  GetWorkflowAgentNodeExecutionResponse,
@@ -396,6 +503,18 @@ import type {
396
503
  ListActivityVisitsData,
397
504
  ListActivityVisitsError,
398
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,
399
518
  ListAgentThreadMessagesData,
400
519
  ListAgentThreadMessagesError,
401
520
  ListAgentThreadMessagesResponse,
@@ -462,6 +581,15 @@ import type {
462
581
  ListObjectsResponse,
463
582
  ListObjectTypesData,
464
583
  ListObjectTypesResponse,
584
+ ListObservedAgentThreadChildrenData,
585
+ ListObservedAgentThreadChildrenError,
586
+ ListObservedAgentThreadChildrenResponse,
587
+ ListObservedAgentThreadMessagesData,
588
+ ListObservedAgentThreadMessagesError,
589
+ ListObservedAgentThreadMessagesResponse,
590
+ ListObservedAgentThreadRunsData,
591
+ ListObservedAgentThreadRunsError,
592
+ ListObservedAgentThreadRunsResponse,
465
593
  ListPendingConnectorConnectionRunsData,
466
594
  ListPendingConnectorConnectionRunsError,
467
595
  ListPendingConnectorConnectionRunsResponse,
@@ -488,6 +616,9 @@ import type {
488
616
  ListSyncRunsResponse,
489
617
  ListSyncsData,
490
618
  ListSyncsResponse,
619
+ ListUsersData,
620
+ ListUsersError,
621
+ ListUsersResponse,
491
622
  ListWebhookRunsData,
492
623
  ListWebhookRunsError,
493
624
  ListWebhookRunsResponse,
@@ -523,6 +654,8 @@ import type {
523
654
  RefreshAuthSessionData,
524
655
  RefreshAuthSessionError,
525
656
  RefreshAuthSessionResponse,
657
+ RemoveAgentThreadParticipantData,
658
+ RemoveAgentThreadParticipantError,
526
659
  RemoveObjectLinkData,
527
660
  RemoveObjectLinkError,
528
661
  RemoveObjectLinkResponse,
@@ -559,12 +692,21 @@ import type {
559
692
  RevokeSharedAccessGrantData,
560
693
  RevokeSharedAccessGrantError,
561
694
  RevokeSharedAccessGrantResponse,
695
+ SaveAgentMemoryData,
696
+ SaveAgentMemoryError,
697
+ SaveAgentMemoryResponse,
562
698
  SearchObjectsData,
563
699
  SearchObjectsError,
564
700
  SearchObjectsResponse,
565
701
  SelectConnectorConnectionRunAccountData,
566
702
  SelectConnectorConnectionRunAccountError,
567
703
  SelectConnectorConnectionRunAccountResponse,
704
+ SetAgentThreadApprovalModeData,
705
+ SetAgentThreadApprovalModeError,
706
+ SetAgentThreadApprovalModeResponse,
707
+ SetArtifactStateData,
708
+ SetArtifactStateError,
709
+ SetArtifactStateResponse,
568
710
  SignFileUploadPartData,
569
711
  SignFileUploadPartError,
570
712
  SignFileUploadPartResponse,
@@ -586,12 +728,21 @@ import type {
586
728
  SuspendAuthMemberData,
587
729
  SuspendAuthMemberError,
588
730
  SuspendAuthMemberResponse,
731
+ TranscribeAudioData,
732
+ TranscribeAudioError,
733
+ TranscribeAudioResponse,
734
+ UpdateAgentPreferencesData,
735
+ UpdateAgentPreferencesError,
736
+ UpdateAgentPreferencesResponse,
589
737
  UpdateAiLimitPolicyData,
590
738
  UpdateAiLimitPolicyError,
591
739
  UpdateAiLimitPolicyResponse,
592
740
  UpdateAuthMemberGroupsData,
593
741
  UpdateAuthMemberGroupsError,
594
742
  UpdateAuthMemberGroupsResponse,
743
+ UpdateAuthProfileData,
744
+ UpdateAuthProfileError,
745
+ UpdateAuthProfileResponse,
595
746
  UploadFileContentData,
596
747
  UploadFileContentError,
597
748
  UploadFileContentResponse,
@@ -845,6 +996,60 @@ export const signOutAllMutation = (
845
996
  return mutationOptions
846
997
  }
847
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
+
848
1053
  export const getAuthAccessManagementOptionsQueryKey = (
849
1054
  options?: Options<GetAuthAccessManagementOptionsData>
850
1055
  ) => createQueryKey("getAuthAccessManagementOptions", options)
@@ -1791,6 +1996,153 @@ export const listAiModelCallGroupsInfiniteOptions = (options: Options<ListAiMode
1791
1996
  }
1792
1997
  )
1793
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
+
1794
2146
  export const getProjectInfoQueryKey = (options?: Options<GetProjectInfoData>) =>
1795
2147
  createQueryKey("getProjectInfo", options)
1796
2148
 
@@ -3693,6 +4045,35 @@ export const upsertObjectMutation = (
3693
4045
  return mutationOptions
3694
4046
  }
3695
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
+
3696
4077
  export const listActionsQueryKey = (options?: Options<ListActionsData>) =>
3697
4078
  createQueryKey("listActions", options)
3698
4079
 
@@ -4189,6 +4570,91 @@ export const getAgentThreadOptions = (options: Options<GetAgentThreadData>) =>
4189
4570
  queryKey: getAgentThreadQueryKey(options),
4190
4571
  })
4191
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
+
4192
4658
  /**
4193
4659
  * Explicitly recreate an unavailable or uncertain workspace without deleting its previous state
4194
4660
  */
@@ -4345,6 +4811,8 @@ export const getAgentMessageFileContentOptions = (
4345
4811
 
4346
4812
  /**
4347
4813
  * Cancel an agent thread's active run
4814
+ *
4815
+ * Whoever asked for the run, or the thread's owner, can cancel it.
4348
4816
  */
4349
4817
  export const cancelAgentRunMutation = (
4350
4818
  options?: Partial<Options<CancelAgentRunData>>
@@ -4368,6 +4836,8 @@ export const cancelAgentRunMutation = (
4368
4836
 
4369
4837
  /**
4370
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.
4371
4841
  */
4372
4842
  export const retryAgentRunMutation = (
4373
4843
  options?: Partial<Options<RetryAgentRunData>>
@@ -4464,6 +4934,8 @@ export const getAgentRunQueryKey = (options: Options<GetAgentRunData>) =>
4464
4934
 
4465
4935
  /**
4466
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.
4467
4939
  */
4468
4940
  export const getAgentRunOptions = (options: Options<GetAgentRunData>) =>
4469
4941
  queryOptions<
@@ -4484,23 +4956,52 @@ export const getAgentRunOptions = (options: Options<GetAgentRunData>) =>
4484
4956
  queryKey: getAgentRunQueryKey(options),
4485
4957
  })
4486
4958
 
4487
- export const listArtifactsQueryKey = (options?: Options<ListArtifactsData>) =>
4488
- createQueryKey("listArtifacts", options)
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)
4489
4990
 
4490
4991
  /**
4491
- * List artifacts
4992
+ * List the sub-agents of an agent conversation
4492
4993
  *
4493
- * The caller's artifacts, most recently updated first.
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`.
4494
4995
  */
4495
- export const listArtifactsOptions = (options?: Options<ListArtifactsData>) =>
4996
+ export const listAgentThreadChildrenOptions = (options: Options<ListAgentThreadChildrenData>) =>
4496
4997
  queryOptions<
4497
- ListArtifactsResponse,
4498
- ListArtifactsError,
4499
- ListArtifactsResponse,
4500
- ReturnType<typeof listArtifactsQueryKey>
4998
+ ListAgentThreadChildrenResponse,
4999
+ ListAgentThreadChildrenError,
5000
+ ListAgentThreadChildrenResponse,
5001
+ ReturnType<typeof listAgentThreadChildrenQueryKey>
4501
5002
  >({
4502
5003
  queryFn: async ({ queryKey, signal }) => {
4503
- const { data } = await listArtifacts({
5004
+ const { data } = await listAgentThreadChildren({
4504
5005
  ...options,
4505
5006
  ...queryKey[0],
4506
5007
  signal,
@@ -4508,43 +5009,806 @@ export const listArtifactsOptions = (options?: Options<ListArtifactsData>) =>
4508
5009
  })
4509
5010
  return data
4510
5011
  },
4511
- queryKey: listArtifactsQueryKey(options),
5012
+ queryKey: listAgentThreadChildrenQueryKey(options),
4512
5013
  })
4513
5014
 
4514
- export const listArtifactsInfiniteQueryKey = (
4515
- options?: Options<ListArtifactsData>
4516
- ): QueryKey<Options<ListArtifactsData>> => createQueryKey("listArtifacts", options, true)
5015
+ export const getAgentChildFileContentQueryKey = (options: Options<GetAgentChildFileContentData>) =>
5016
+ createQueryKey("getAgentChildFileContent", options)
4517
5017
 
4518
5018
  /**
4519
- * List artifacts
5019
+ * Get a file of a sub-agent
4520
5020
  *
4521
- * The caller's artifacts, most recently updated first.
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.
4522
5022
  */
4523
- export const listArtifactsInfiniteOptions = (options?: Options<ListArtifactsData>) =>
4524
- infiniteQueryOptions<
4525
- ListArtifactsResponse,
4526
- ListArtifactsError,
4527
- InfiniteData<ListArtifactsResponse>,
4528
- QueryKey<Options<ListArtifactsData>>,
4529
- string | Pick<QueryKey<Options<ListArtifactsData>>[0], "body" | "headers" | "path" | "query">
4530
- >(
4531
- // @ts-ignore
4532
- {
4533
- queryFn: async ({ pageParam, queryKey, signal }) => {
4534
- // @ts-ignore
4535
- const page: Pick<
4536
- QueryKey<Options<ListArtifactsData>>[0],
4537
- "body" | "headers" | "path" | "query"
4538
- > =
4539
- typeof pageParam === "object"
4540
- ? pageParam
4541
- : {
4542
- query: {
4543
- offset: pageParam,
4544
- },
4545
- }
4546
- const params = createInfiniteParams(queryKey, page)
4547
- const { data } = await listArtifacts({
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({
5032
+ ...options,
5033
+ ...queryKey[0],
5034
+ signal,
5035
+ throwOnError: true,
5036
+ })
5037
+ return data
5038
+ },
5039
+ queryKey: getAgentChildFileContentQueryKey(options),
5040
+ })
5041
+
5042
+ export const getAgentPreferencesQueryKey = (options?: Options<GetAgentPreferencesData>) =>
5043
+ createQueryKey("getAgentPreferences", options)
5044
+
5045
+ /**
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({
4548
5812
  ...options,
4549
5813
  ...params,
4550
5814
  signal,
@@ -4584,7 +5848,7 @@ export const createArtifactMutation = (
4584
5848
  /**
4585
5849
  * Delete an artifact
4586
5850
  *
4587
- * Deletes the artifact with every version.
5851
+ * Deletes the artifact with every version, from every conversation that shares it. Only its owner can.
4588
5852
  */
4589
5853
  export const deleteArtifactMutation = (
4590
5854
  options?: Partial<Options<DeleteArtifactData>>
@@ -4631,10 +5895,122 @@ export const getArtifactOptions = (options: Options<GetArtifactData>) =>
4631
5895
  queryKey: getArtifactQueryKey(options),
4632
5896
  })
4633
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
+
4634
6010
  /**
4635
6011
  * Publish an artifact's next version
4636
6012
  *
4637
- * The kind must be the artifact's. The new version becomes the latest.
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.
4638
6014
  */
4639
6015
  export const publishArtifactVersionMutation = (
4640
6016
  options?: Partial<Options<PublishArtifactVersionData>>
@@ -4661,9 +6037,9 @@ export const publishArtifactVersionMutation = (
4661
6037
  }
4662
6038
 
4663
6039
  /**
4664
- * Open a deck's version in a frame
6040
+ * Open a version in a frame
4665
6041
  *
4666
- * A short-lived path that serves a slides version's files to a sandboxed frame. It expires within an hour. Any other kind is refused with 409 artifact_kind_mismatch.
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.
4667
6043
  */
4668
6044
  export const createArtifactFrameMutation = (
4669
6045
  options?: Partial<Options<CreateArtifactFrameData>>
@@ -4716,6 +6092,33 @@ export const getArtifactVersionOptions = (options: Options<GetArtifactVersionDat
4716
6092
  queryKey: getArtifactVersionQueryKey(options),
4717
6093
  })
4718
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
+
4719
6122
  export const getArtifactFileContentQueryKey = (options: Options<GetArtifactFileContentData>) =>
4720
6123
  createQueryKey("getArtifactFileContent", options)
4721
6124
 
@@ -4745,7 +6148,7 @@ export const listModelsQueryKey = (options?: Options<ListModelsData>) =>
4745
6148
  createQueryKey("listModels", options)
4746
6149
 
4747
6150
  /**
4748
- * List the project model catalog
6151
+ * List the project's models of every kind, with their options and prices
4749
6152
  */
4750
6153
  export const listModelsOptions = (options?: Options<ListModelsData>) =>
4751
6154
  queryOptions<
@@ -5233,6 +6636,93 @@ export const listActivityConnectionsInfiniteOptions = (
5233
6636
  }
5234
6637
  )
5235
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
+
5236
6726
  export const listProjectionsQueryKey = (options?: Options<ListProjectionsData>) =>
5237
6727
  createQueryKey("listProjections", options)
5238
6728