@sixb/client 0.2.1 → 0.2.3

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 (84) hide show
  1. package/dist/artifact-live.d.ts +31 -0
  2. package/dist/artifact-live.d.ts.map +1 -0
  3. package/dist/artifact-live.js +67 -0
  4. package/dist/artifact-live.js.map +10 -0
  5. package/dist/browser.d.ts +5 -0
  6. package/dist/browser.d.ts.map +1 -1
  7. package/dist/browser.js +38 -17
  8. package/dist/browser.js.map +3 -3
  9. package/dist/{chunk-j9t5h44d.js → chunk-15ynvne0.js} +40 -28
  10. package/dist/{chunk-j9t5h44d.js.map → chunk-15ynvne0.js.map} +4 -4
  11. package/dist/{chunk-0p42gyb5.js → chunk-90q7wa43.js} +30 -21
  12. package/dist/chunk-90q7wa43.js.map +17 -0
  13. package/dist/{chunk-rrexv1gk.js → chunk-bgpzb1fn.js} +6 -6
  14. package/dist/{chunk-rrexv1gk.js.map → chunk-bgpzb1fn.js.map} +1 -1
  15. package/dist/{chunk-hkn0keqj.js → chunk-br10prhs.js} +4 -4
  16. package/dist/{chunk-hkn0keqj.js.map → chunk-br10prhs.js.map} +1 -1
  17. package/dist/chunk-hj4h6hw6.js +827 -0
  18. package/dist/chunk-hj4h6hw6.js.map +18 -0
  19. package/dist/{chunk-3kfn00we.js → chunk-ktqfenfd.js} +43 -11
  20. package/dist/chunk-ktqfenfd.js.map +10 -0
  21. package/dist/{chunk-r50kxqa5.js → chunk-seeyb9k9.js} +8 -6
  22. package/dist/{chunk-r50kxqa5.js.map → chunk-seeyb9k9.js.map} +2 -2
  23. package/dist/{chunk-m2rmbshc.js → chunk-y9mhb8x4.js} +3 -1
  24. package/dist/chunk-y9mhb8x4.js.map +10 -0
  25. package/dist/{chunk-k2na62sa.js → chunk-zerhr00d.js} +155 -832
  26. package/dist/chunk-zerhr00d.js.map +10 -0
  27. package/dist/client-authority.d.ts +11 -0
  28. package/dist/client-authority.d.ts.map +1 -1
  29. package/dist/connectors/connection.d.ts +8 -3
  30. package/dist/connectors/connection.d.ts.map +1 -1
  31. package/dist/connectors/mutations.d.ts +4 -0
  32. package/dist/connectors/mutations.d.ts.map +1 -1
  33. package/dist/connectors/queries.d.ts +98 -0
  34. package/dist/connectors/queries.d.ts.map +1 -1
  35. package/dist/events-builder.d.ts +2 -0
  36. package/dist/events-builder.d.ts.map +1 -1
  37. package/dist/events-provider.d.ts.map +1 -1
  38. package/dist/events-transport.d.ts.map +1 -1
  39. package/dist/file.d.ts +8 -0
  40. package/dist/file.d.ts.map +1 -1
  41. package/dist/generated/@tanstack/react-query.gen.d.ts +1439 -234
  42. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  43. package/dist/generated/index.d.ts +2 -2
  44. package/dist/generated/index.d.ts.map +1 -1
  45. package/dist/generated/sdk.gen.d.ts +85 -5
  46. package/dist/generated/sdk.gen.d.ts.map +1 -1
  47. package/dist/generated/types.gen.d.ts +2717 -128
  48. package/dist/generated/types.gen.d.ts.map +1 -1
  49. package/dist/hooks.js +306 -57
  50. package/dist/hooks.js.map +7 -7
  51. package/dist/index.js +88 -56
  52. package/dist/index.js.map +1 -1
  53. package/dist/logs.js +6 -5
  54. package/dist/logs.js.map +1 -1
  55. package/dist/models.d.ts +5 -2
  56. package/dist/models.d.ts.map +1 -1
  57. package/dist/models.js +36 -6
  58. package/dist/models.js.map +1 -1
  59. package/dist/query.js +6 -5
  60. package/dist/query.js.map +1 -1
  61. package/dist/users-hooks.d.ts.map +1 -1
  62. package/dist/ws-socket.d.ts +17 -2
  63. package/dist/ws-socket.d.ts.map +1 -1
  64. package/package.json +8 -2
  65. package/src/artifact-live.ts +97 -0
  66. package/src/browser.ts +43 -5
  67. package/src/client-authority.ts +21 -0
  68. package/src/connectors/connection.ts +34 -12
  69. package/src/connectors/mutations.ts +8 -2
  70. package/src/connectors/queries.ts +6 -2
  71. package/src/events-builder.ts +9 -8
  72. package/src/events-provider.ts +13 -0
  73. package/src/events-transport.ts +3 -0
  74. package/src/file.ts +17 -0
  75. package/src/generated/@tanstack/react-query.gen.ts +458 -16
  76. package/src/generated/index.ts +90 -6
  77. package/src/generated/sdk.gen.ts +360 -11
  78. package/src/generated/types.gen.ts +3009 -227
  79. package/src/models.ts +6 -2
  80. package/src/ws-socket.ts +64 -10
  81. package/dist/chunk-0p42gyb5.js.map +0 -17
  82. package/dist/chunk-3kfn00we.js.map +0 -10
  83. package/dist/chunk-k2na62sa.js.map +0 -19
  84. package/dist/chunk-m2rmbshc.js.map +0 -10
@@ -12,6 +12,7 @@ import { client } from "../client.gen"
12
12
  import {
13
13
  abortFileUpload,
14
14
  addAgentThreadParticipants,
15
+ addArtifactComment,
15
16
  addConnectorConnection,
16
17
  cancelAgentRun,
17
18
  cancelAgentRunById,
@@ -35,6 +36,7 @@ import {
35
36
  deleteAgentMemory,
36
37
  deleteAiLimitPolicy,
37
38
  deleteArtifact,
39
+ deleteArtifactComment,
38
40
  deleteArtifactStateValue,
39
41
  disableAuthServiceAccount,
40
42
  disconnectConnectorConnection,
@@ -43,6 +45,7 @@ import {
43
45
  existsObjects,
44
46
  facetObjects,
45
47
  forkAgentThread,
48
+ freezeArtifactVersion,
46
49
  generateImages,
47
50
  generateSpeech,
48
51
  generateText,
@@ -67,8 +70,11 @@ import {
67
70
  getAiModelCallFileContent,
68
71
  getAiModelCallFiles,
69
72
  getArtifact,
73
+ getArtifactBoardPreview,
70
74
  getArtifactFileContent,
71
75
  getArtifactQuery,
76
+ getArtifactRestorePoint,
77
+ getArtifactRestorePointFileContent,
72
78
  getArtifactState,
73
79
  getArtifactVersion,
74
80
  getAuthAccessManagementOptions,
@@ -82,6 +88,7 @@ import {
82
88
  getDataset,
83
89
  getDatasetVersion,
84
90
  getDatasetVersionLineage,
91
+ getLakeHealth,
85
92
  getLatestTelemetry,
86
93
  getObject,
87
94
  getObjectByUniqueProperty,
@@ -117,6 +124,7 @@ import {
117
124
  listActivityUsers,
118
125
  listActivityVisits,
119
126
  listAgentApprovals,
127
+ listAgentComputers,
120
128
  listAgentMemoryRevisions,
121
129
  listAgentThreadApprovals,
122
130
  listAgentThreadChildren,
@@ -126,6 +134,9 @@ import {
126
134
  listAiLimitPolicies,
127
135
  listAiModelCallGroups,
128
136
  listAiModelCalls,
137
+ listArtifactComments,
138
+ listArtifactHolders,
139
+ listArtifactRestorePoints,
129
140
  listArtifacts,
130
141
  listAuthAccessTokens,
131
142
  listAuthInvitations,
@@ -165,7 +176,6 @@ import {
165
176
  moveAgentThreadToComputer,
166
177
  type Options,
167
178
  postAgentThreadMessage,
168
- publishArtifactVersion,
169
179
  queryObjectLinks,
170
180
  queryObjects,
171
181
  reactivateAuthMember,
@@ -178,6 +188,8 @@ import {
178
188
  requestPipelineRun,
179
189
  requestSyncRun,
180
190
  requestWorkflowRun,
191
+ resolveArtifactComment,
192
+ restoreArtifact,
181
193
  retryAgentRun,
182
194
  revokeAuthAccessToken,
183
195
  revokeAuthInvitation,
@@ -190,6 +202,7 @@ import {
190
202
  selectConnectorConnectionRunAccount,
191
203
  setAgentThreadApprovalMode,
192
204
  setArtifactState,
205
+ setSharedAccessGuestName,
193
206
  signFileUploadPart,
194
207
  signOut,
195
208
  signOutAll,
@@ -201,6 +214,7 @@ import {
201
214
  transcribeAudio,
202
215
  updateAgentPreferences,
203
216
  updateAiLimitPolicy,
217
+ updateArtifact,
204
218
  updateAuthMemberGroups,
205
219
  updateAuthProfile,
206
220
  uploadFileContent,
@@ -213,6 +227,9 @@ import type {
213
227
  AddAgentThreadParticipantsData,
214
228
  AddAgentThreadParticipantsError,
215
229
  AddAgentThreadParticipantsResponse,
230
+ AddArtifactCommentData,
231
+ AddArtifactCommentError,
232
+ AddArtifactCommentResponse,
216
233
  AddConnectorConnectionData,
217
234
  AddConnectorConnectionError,
218
235
  AddConnectorConnectionResponse,
@@ -279,6 +296,9 @@ import type {
279
296
  DeleteAiLimitPolicyData,
280
297
  DeleteAiLimitPolicyError,
281
298
  DeleteAiLimitPolicyResponse,
299
+ DeleteArtifactCommentData,
300
+ DeleteArtifactCommentError,
301
+ DeleteArtifactCommentResponse,
282
302
  DeleteArtifactData,
283
303
  DeleteArtifactError,
284
304
  DeleteArtifactResponse,
@@ -305,6 +325,9 @@ import type {
305
325
  ForkAgentThreadData,
306
326
  ForkAgentThreadError,
307
327
  ForkAgentThreadResponse,
328
+ FreezeArtifactVersionData,
329
+ FreezeArtifactVersionError,
330
+ FreezeArtifactVersionResponse,
308
331
  GenerateImagesData,
309
332
  GenerateImagesError,
310
333
  GenerateImagesResponse,
@@ -374,6 +397,9 @@ import type {
374
397
  GetAiModelCallFilesData,
375
398
  GetAiModelCallFilesError,
376
399
  GetAiModelCallFilesResponse,
400
+ GetArtifactBoardPreviewData,
401
+ GetArtifactBoardPreviewError,
402
+ GetArtifactBoardPreviewResponse,
377
403
  GetArtifactData,
378
404
  GetArtifactError,
379
405
  GetArtifactFileContentData,
@@ -383,6 +409,12 @@ import type {
383
409
  GetArtifactQueryError,
384
410
  GetArtifactQueryResponse,
385
411
  GetArtifactResponse,
412
+ GetArtifactRestorePointData,
413
+ GetArtifactRestorePointError,
414
+ GetArtifactRestorePointFileContentData,
415
+ GetArtifactRestorePointFileContentError,
416
+ GetArtifactRestorePointFileContentResponse,
417
+ GetArtifactRestorePointResponse,
386
418
  GetArtifactStateData,
387
419
  GetArtifactStateError,
388
420
  GetArtifactStateResponse,
@@ -421,6 +453,9 @@ import type {
421
453
  GetDatasetVersionLineageError,
422
454
  GetDatasetVersionLineageResponse,
423
455
  GetDatasetVersionResponse,
456
+ GetLakeHealthData,
457
+ GetLakeHealthError,
458
+ GetLakeHealthResponse,
424
459
  GetLatestTelemetryData,
425
460
  GetLatestTelemetryError,
426
461
  GetLatestTelemetryResponse,
@@ -523,6 +558,9 @@ import type {
523
558
  ListAgentApprovalsData,
524
559
  ListAgentApprovalsError,
525
560
  ListAgentApprovalsResponse,
561
+ ListAgentComputersData,
562
+ ListAgentComputersError,
563
+ ListAgentComputersResponse,
526
564
  ListAgentMemoryRevisionsData,
527
565
  ListAgentMemoryRevisionsError,
528
566
  ListAgentMemoryRevisionsResponse,
@@ -550,6 +588,15 @@ import type {
550
588
  ListAiModelCallsData,
551
589
  ListAiModelCallsError,
552
590
  ListAiModelCallsResponse,
591
+ ListArtifactCommentsData,
592
+ ListArtifactCommentsError,
593
+ ListArtifactCommentsResponse,
594
+ ListArtifactHoldersData,
595
+ ListArtifactHoldersError,
596
+ ListArtifactHoldersResponse,
597
+ ListArtifactRestorePointsData,
598
+ ListArtifactRestorePointsError,
599
+ ListArtifactRestorePointsResponse,
553
600
  ListArtifactsData,
554
601
  ListArtifactsError,
555
602
  ListArtifactsResponse,
@@ -656,9 +703,6 @@ import type {
656
703
  PostAgentThreadMessageData,
657
704
  PostAgentThreadMessageError,
658
705
  PostAgentThreadMessageResponse,
659
- PublishArtifactVersionData,
660
- PublishArtifactVersionError,
661
- PublishArtifactVersionResponse,
662
706
  QueryObjectLinksData,
663
707
  QueryObjectLinksError,
664
708
  QueryObjectLinksResponse,
@@ -693,6 +737,12 @@ import type {
693
737
  RequestWorkflowRunData,
694
738
  RequestWorkflowRunError,
695
739
  RequestWorkflowRunResponse,
740
+ ResolveArtifactCommentData,
741
+ ResolveArtifactCommentError,
742
+ ResolveArtifactCommentResponse,
743
+ RestoreArtifactData,
744
+ RestoreArtifactError,
745
+ RestoreArtifactResponse,
696
746
  RetryAgentRunData,
697
747
  RetryAgentRunError,
698
748
  RetryAgentRunResponse,
@@ -729,6 +779,9 @@ import type {
729
779
  SetArtifactStateData,
730
780
  SetArtifactStateError,
731
781
  SetArtifactStateResponse,
782
+ SetSharedAccessGuestNameData,
783
+ SetSharedAccessGuestNameError,
784
+ SetSharedAccessGuestNameResponse,
732
785
  SignFileUploadPartData,
733
786
  SignFileUploadPartError,
734
787
  SignFileUploadPartResponse,
@@ -762,6 +815,9 @@ import type {
762
815
  UpdateAiLimitPolicyData,
763
816
  UpdateAiLimitPolicyError,
764
817
  UpdateAiLimitPolicyResponse,
818
+ UpdateArtifactData,
819
+ UpdateArtifactError,
820
+ UpdateArtifactResponse,
765
821
  UpdateAuthMemberGroupsData,
766
822
  UpdateAuthMemberGroupsError,
767
823
  UpdateAuthMemberGroupsResponse,
@@ -2698,6 +2754,31 @@ export const listDatasetRowsInfiniteOptions = (options: Options<ListDatasetRowsD
2698
2754
  }
2699
2755
  )
2700
2756
 
2757
+ export const getLakeHealthQueryKey = (options?: Options<GetLakeHealthData>) =>
2758
+ createQueryKey("getLakeHealth", options)
2759
+
2760
+ /**
2761
+ * Describe how the lake stores each dataset, and what its retention does
2762
+ */
2763
+ export const getLakeHealthOptions = (options?: Options<GetLakeHealthData>) =>
2764
+ queryOptions<
2765
+ GetLakeHealthResponse,
2766
+ GetLakeHealthError,
2767
+ GetLakeHealthResponse,
2768
+ ReturnType<typeof getLakeHealthQueryKey>
2769
+ >({
2770
+ queryFn: async ({ queryKey, signal }) => {
2771
+ const { data } = await getLakeHealth({
2772
+ ...options,
2773
+ ...queryKey[0],
2774
+ signal,
2775
+ throwOnError: true,
2776
+ })
2777
+ return data
2778
+ },
2779
+ queryKey: getLakeHealthQueryKey(options),
2780
+ })
2781
+
2701
2782
  export const listSyncsQueryKey = (options?: Options<ListSyncsData>) =>
2702
2783
  createQueryKey("listSyncs", options)
2703
2784
 
@@ -3729,6 +3810,35 @@ export const getSharedAccessSessionOptions = (options: Options<GetSharedAccessSe
3729
3810
  queryKey: getSharedAccessSessionQueryKey(options),
3730
3811
  })
3731
3812
 
3813
+ /**
3814
+ * Name a shared-access session's visitor
3815
+ *
3816
+ * The visitor of a shared link has no account: they give their name once, and their comments and live presence carry it, marked as a guest's. Giving it again replaces it for what comes next; comments keep the name they were written under.
3817
+ */
3818
+ export const setSharedAccessGuestNameMutation = (
3819
+ options?: Partial<Options<SetSharedAccessGuestNameData>>
3820
+ ): UseMutationOptions<
3821
+ SetSharedAccessGuestNameResponse,
3822
+ SetSharedAccessGuestNameError,
3823
+ Options<SetSharedAccessGuestNameData>
3824
+ > => {
3825
+ const mutationOptions: UseMutationOptions<
3826
+ SetSharedAccessGuestNameResponse,
3827
+ SetSharedAccessGuestNameError,
3828
+ Options<SetSharedAccessGuestNameData>
3829
+ > = {
3830
+ mutationFn: async (fnOptions) => {
3831
+ const { data } = await setSharedAccessGuestName({
3832
+ ...options,
3833
+ ...fnOptions,
3834
+ throwOnError: true,
3835
+ })
3836
+ return data
3837
+ },
3838
+ }
3839
+ return mutationOptions
3840
+ }
3841
+
3732
3842
  /**
3733
3843
  * Sign out a shared-access session
3734
3844
  */
@@ -5116,6 +5226,33 @@ export const getAgentChildFileContentOptions = (options: Options<GetAgentChildFi
5116
5226
  queryKey: getAgentChildFileContentQueryKey(options),
5117
5227
  })
5118
5228
 
5229
+ export const listAgentComputersQueryKey = (options?: Options<ListAgentComputersData>) =>
5230
+ createQueryKey("listAgentComputers", options)
5231
+
5232
+ /**
5233
+ * List your computers with sixb open now
5234
+ *
5235
+ * Each of your computers with a live session, and the folders `sixb` is open in there: a thread created to run in one of them runs there now.
5236
+ */
5237
+ export const listAgentComputersOptions = (options?: Options<ListAgentComputersData>) =>
5238
+ queryOptions<
5239
+ ListAgentComputersResponse,
5240
+ ListAgentComputersError,
5241
+ ListAgentComputersResponse,
5242
+ ReturnType<typeof listAgentComputersQueryKey>
5243
+ >({
5244
+ queryFn: async ({ queryKey, signal }) => {
5245
+ const { data } = await listAgentComputers({
5246
+ ...options,
5247
+ ...queryKey[0],
5248
+ signal,
5249
+ throwOnError: true,
5250
+ })
5251
+ return data
5252
+ },
5253
+ queryKey: listAgentComputersQueryKey(options),
5254
+ })
5255
+
5119
5256
  /**
5120
5257
  * Move a thread from your computer to the cloud
5121
5258
  *
@@ -6117,6 +6254,33 @@ export const getArtifactOptions = (options: Options<GetArtifactData>) =>
6117
6254
  queryKey: getArtifactQueryKey(options),
6118
6255
  })
6119
6256
 
6257
+ export const listArtifactHoldersQueryKey = (options: Options<ListArtifactHoldersData>) =>
6258
+ createQueryKey("listArtifactHolders", options)
6259
+
6260
+ /**
6261
+ * List the objects that hold an artifact
6262
+ *
6263
+ * The objects whose property holds the artifact, among those you read with that property, in a stable order. Whoever reads such an object reads the artifact.
6264
+ */
6265
+ export const listArtifactHoldersOptions = (options: Options<ListArtifactHoldersData>) =>
6266
+ queryOptions<
6267
+ ListArtifactHoldersResponse,
6268
+ ListArtifactHoldersError,
6269
+ ListArtifactHoldersResponse,
6270
+ ReturnType<typeof listArtifactHoldersQueryKey>
6271
+ >({
6272
+ queryFn: async ({ queryKey, signal }) => {
6273
+ const { data } = await listArtifactHolders({
6274
+ ...options,
6275
+ ...queryKey[0],
6276
+ signal,
6277
+ throwOnError: true,
6278
+ })
6279
+ return data
6280
+ },
6281
+ queryKey: listArtifactHoldersQueryKey(options),
6282
+ })
6283
+
6120
6284
  /**
6121
6285
  * Reset what a page keeps
6122
6286
  *
@@ -6230,24 +6394,275 @@ export const setArtifactStateMutation = (
6230
6394
  }
6231
6395
 
6232
6396
  /**
6233
- * Publish an artifact's next version
6397
+ * Update an artifact
6398
+ *
6399
+ * Writes the artifact's latest version: its content is replaced while the version is open, and the next version opens when it is frozen. Either way the revision grows. The kind must be the artifact's. With baseRevision, it is refused with 409 artifact_moved when the artifact changed since. With a run token, only an artifact the run's conversation shares, its requester owns, or an object its requester edits holds; it is shared in that conversation, and the turn's first write to it keeps a restore point. A run that lost its execution gets 409 execution_lost.
6400
+ */
6401
+ export const updateArtifactMutation = (
6402
+ options?: Partial<Options<UpdateArtifactData>>
6403
+ ): UseMutationOptions<UpdateArtifactResponse, UpdateArtifactError, Options<UpdateArtifactData>> => {
6404
+ const mutationOptions: UseMutationOptions<
6405
+ UpdateArtifactResponse,
6406
+ UpdateArtifactError,
6407
+ Options<UpdateArtifactData>
6408
+ > = {
6409
+ mutationFn: async (fnOptions) => {
6410
+ const { data } = await updateArtifact({
6411
+ ...options,
6412
+ ...fnOptions,
6413
+ throwOnError: true,
6414
+ })
6415
+ return data
6416
+ },
6417
+ }
6418
+ return mutationOptions
6419
+ }
6420
+
6421
+ /**
6422
+ * Create a version
6423
+ *
6424
+ * Freezes the artifact's open latest version: it never changes again, and the next write opens the next version. A latest version already frozen is returned as it is. Whoever may update the artifact may create a version. With baseRevision, it is refused with 409 artifact_moved when the open version changed since.
6425
+ */
6426
+ export const freezeArtifactVersionMutation = (
6427
+ options?: Partial<Options<FreezeArtifactVersionData>>
6428
+ ): UseMutationOptions<
6429
+ FreezeArtifactVersionResponse,
6430
+ FreezeArtifactVersionError,
6431
+ Options<FreezeArtifactVersionData>
6432
+ > => {
6433
+ const mutationOptions: UseMutationOptions<
6434
+ FreezeArtifactVersionResponse,
6435
+ FreezeArtifactVersionError,
6436
+ Options<FreezeArtifactVersionData>
6437
+ > = {
6438
+ mutationFn: async (fnOptions) => {
6439
+ const { data } = await freezeArtifactVersion({
6440
+ ...options,
6441
+ ...fnOptions,
6442
+ throwOnError: true,
6443
+ })
6444
+ return data
6445
+ },
6446
+ }
6447
+ return mutationOptions
6448
+ }
6449
+
6450
+ export const listArtifactCommentsQueryKey = (options: Options<ListArtifactCommentsData>) =>
6451
+ createQueryKey("listArtifactComments", options)
6452
+
6453
+ /**
6454
+ * List an artifact's comments
6234
6455
  *
6235
- * 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. With a run token, only an artifact the run's conversation shares or its requester owns; the version is shared in that conversation. A run that lost its execution gets 409 execution_lost.
6456
+ * Every comment and reply, oldest first, resolved ones included. Whoever reads the artifact reads them.
6236
6457
  */
6237
- export const publishArtifactVersionMutation = (
6238
- options?: Partial<Options<PublishArtifactVersionData>>
6458
+ export const listArtifactCommentsOptions = (options: Options<ListArtifactCommentsData>) =>
6459
+ queryOptions<
6460
+ ListArtifactCommentsResponse,
6461
+ ListArtifactCommentsError,
6462
+ ListArtifactCommentsResponse,
6463
+ ReturnType<typeof listArtifactCommentsQueryKey>
6464
+ >({
6465
+ queryFn: async ({ queryKey, signal }) => {
6466
+ const { data } = await listArtifactComments({
6467
+ ...options,
6468
+ ...queryKey[0],
6469
+ signal,
6470
+ throwOnError: true,
6471
+ })
6472
+ return data
6473
+ },
6474
+ queryKey: listArtifactCommentsQueryKey(options),
6475
+ })
6476
+
6477
+ /**
6478
+ * Comment on an artifact
6479
+ *
6480
+ * Adds a comment, or a reply with parentId, as the caller. Whoever reads the artifact may, a shared link's guest included, under the name they gave its session (400 name_required until they give one). A canvas's comment can be about one of its boards, or an element of a board by its address. Readers receive artifact.commented.
6481
+ */
6482
+ export const addArtifactCommentMutation = (
6483
+ options?: Partial<Options<AddArtifactCommentData>>
6239
6484
  ): UseMutationOptions<
6240
- PublishArtifactVersionResponse,
6241
- PublishArtifactVersionError,
6242
- Options<PublishArtifactVersionData>
6485
+ AddArtifactCommentResponse,
6486
+ AddArtifactCommentError,
6487
+ Options<AddArtifactCommentData>
6243
6488
  > => {
6244
6489
  const mutationOptions: UseMutationOptions<
6245
- PublishArtifactVersionResponse,
6246
- PublishArtifactVersionError,
6247
- Options<PublishArtifactVersionData>
6490
+ AddArtifactCommentResponse,
6491
+ AddArtifactCommentError,
6492
+ Options<AddArtifactCommentData>
6248
6493
  > = {
6249
6494
  mutationFn: async (fnOptions) => {
6250
- const { data } = await publishArtifactVersion({
6495
+ const { data } = await addArtifactComment({
6496
+ ...options,
6497
+ ...fnOptions,
6498
+ throwOnError: true,
6499
+ })
6500
+ return data
6501
+ },
6502
+ }
6503
+ return mutationOptions
6504
+ }
6505
+
6506
+ /**
6507
+ * Resolve an artifact's comment
6508
+ *
6509
+ * Marks the comment resolved, or, with resolved false, opens it again. Its author, or whoever may update the artifact, may; anyone else is refused with 403 not_allowed. A guest's comment is resolved only by whoever may update the artifact.
6510
+ */
6511
+ export const resolveArtifactCommentMutation = (
6512
+ options?: Partial<Options<ResolveArtifactCommentData>>
6513
+ ): UseMutationOptions<
6514
+ ResolveArtifactCommentResponse,
6515
+ ResolveArtifactCommentError,
6516
+ Options<ResolveArtifactCommentData>
6517
+ > => {
6518
+ const mutationOptions: UseMutationOptions<
6519
+ ResolveArtifactCommentResponse,
6520
+ ResolveArtifactCommentError,
6521
+ Options<ResolveArtifactCommentData>
6522
+ > = {
6523
+ mutationFn: async (fnOptions) => {
6524
+ const { data } = await resolveArtifactComment({
6525
+ ...options,
6526
+ ...fnOptions,
6527
+ throwOnError: true,
6528
+ })
6529
+ return data
6530
+ },
6531
+ }
6532
+ return mutationOptions
6533
+ }
6534
+
6535
+ /**
6536
+ * Delete an artifact's comment
6537
+ *
6538
+ * Deletes the comment and its replies. Its author, or whoever may update the artifact, may.
6539
+ */
6540
+ export const deleteArtifactCommentMutation = (
6541
+ options?: Partial<Options<DeleteArtifactCommentData>>
6542
+ ): UseMutationOptions<
6543
+ DeleteArtifactCommentResponse,
6544
+ DeleteArtifactCommentError,
6545
+ Options<DeleteArtifactCommentData>
6546
+ > => {
6547
+ const mutationOptions: UseMutationOptions<
6548
+ DeleteArtifactCommentResponse,
6549
+ DeleteArtifactCommentError,
6550
+ Options<DeleteArtifactCommentData>
6551
+ > = {
6552
+ mutationFn: async (fnOptions) => {
6553
+ const { data } = await deleteArtifactComment({
6554
+ ...options,
6555
+ ...fnOptions,
6556
+ throwOnError: true,
6557
+ })
6558
+ return data
6559
+ },
6560
+ }
6561
+ return mutationOptions
6562
+ }
6563
+
6564
+ export const listArtifactRestorePointsQueryKey = (
6565
+ options: Options<ListArtifactRestorePointsData>
6566
+ ) => createQueryKey("listArtifactRestorePoints", options)
6567
+
6568
+ /**
6569
+ * List an artifact's restore points
6570
+ *
6571
+ * What the artifact's latest version held before each Agent turn's first write to it, and before each restore, newest first. They are not versions: restoring one puts its content back in the latest version.
6572
+ */
6573
+ export const listArtifactRestorePointsOptions = (options: Options<ListArtifactRestorePointsData>) =>
6574
+ queryOptions<
6575
+ ListArtifactRestorePointsResponse,
6576
+ ListArtifactRestorePointsError,
6577
+ ListArtifactRestorePointsResponse,
6578
+ ReturnType<typeof listArtifactRestorePointsQueryKey>
6579
+ >({
6580
+ queryFn: async ({ queryKey, signal }) => {
6581
+ const { data } = await listArtifactRestorePoints({
6582
+ ...options,
6583
+ ...queryKey[0],
6584
+ signal,
6585
+ throwOnError: true,
6586
+ })
6587
+ return data
6588
+ },
6589
+ queryKey: listArtifactRestorePointsQueryKey(options),
6590
+ })
6591
+
6592
+ export const getArtifactRestorePointQueryKey = (options: Options<GetArtifactRestorePointData>) =>
6593
+ createQueryKey("getArtifactRestorePoint", options)
6594
+
6595
+ /**
6596
+ * Get an artifact's restore point
6597
+ *
6598
+ * Its files, outline, and references, as the latest version held them. Read a file's bytes with GET /api/artifacts/{artifactId}/restore-points/{revision}/content.
6599
+ */
6600
+ export const getArtifactRestorePointOptions = (options: Options<GetArtifactRestorePointData>) =>
6601
+ queryOptions<
6602
+ GetArtifactRestorePointResponse,
6603
+ GetArtifactRestorePointError,
6604
+ GetArtifactRestorePointResponse,
6605
+ ReturnType<typeof getArtifactRestorePointQueryKey>
6606
+ >({
6607
+ queryFn: async ({ queryKey, signal }) => {
6608
+ const { data } = await getArtifactRestorePoint({
6609
+ ...options,
6610
+ ...queryKey[0],
6611
+ signal,
6612
+ throwOnError: true,
6613
+ })
6614
+ return data
6615
+ },
6616
+ queryKey: getArtifactRestorePointQueryKey(options),
6617
+ })
6618
+
6619
+ export const getArtifactRestorePointFileContentQueryKey = (
6620
+ options: Options<GetArtifactRestorePointFileContentData>
6621
+ ) => createQueryKey("getArtifactRestorePointFileContent", options)
6622
+
6623
+ /**
6624
+ * Get a file of an artifact's restore point
6625
+ */
6626
+ export const getArtifactRestorePointFileContentOptions = (
6627
+ options: Options<GetArtifactRestorePointFileContentData>
6628
+ ) =>
6629
+ queryOptions<
6630
+ GetArtifactRestorePointFileContentResponse,
6631
+ GetArtifactRestorePointFileContentError,
6632
+ GetArtifactRestorePointFileContentResponse,
6633
+ ReturnType<typeof getArtifactRestorePointFileContentQueryKey>
6634
+ >({
6635
+ queryFn: async ({ queryKey, signal }) => {
6636
+ const { data } = await getArtifactRestorePointFileContent({
6637
+ ...options,
6638
+ ...queryKey[0],
6639
+ signal,
6640
+ throwOnError: true,
6641
+ })
6642
+ return data
6643
+ },
6644
+ queryKey: getArtifactRestorePointFileContentQueryKey(options),
6645
+ })
6646
+
6647
+ /**
6648
+ * Restore an artifact
6649
+ *
6650
+ * Puts a restore point's content back in the latest version, as an update writes it: in place while it is open, as the next version when it is frozen. What it replaces becomes a restore point, so the restore can be undone. Whoever may update the artifact may restore it. With baseRevision, it is refused with 409 artifact_moved when the artifact changed since.
6651
+ */
6652
+ export const restoreArtifactMutation = (
6653
+ options?: Partial<Options<RestoreArtifactData>>
6654
+ ): UseMutationOptions<
6655
+ RestoreArtifactResponse,
6656
+ RestoreArtifactError,
6657
+ Options<RestoreArtifactData>
6658
+ > => {
6659
+ const mutationOptions: UseMutationOptions<
6660
+ RestoreArtifactResponse,
6661
+ RestoreArtifactError,
6662
+ Options<RestoreArtifactData>
6663
+ > = {
6664
+ mutationFn: async (fnOptions) => {
6665
+ const { data } = await restoreArtifact({
6251
6666
  ...options,
6252
6667
  ...fnOptions,
6253
6668
  throwOnError: true,
@@ -6261,7 +6676,7 @@ export const publishArtifactVersionMutation = (
6261
6676
  /**
6262
6677
  * Open a version in a frame
6263
6678
  *
6264
- * 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.
6679
+ * A short-lived path that serves the files of a version that opens in a sandboxed frame, as slides do, at the revision it has now: once the version is written again, the path serves nothing and a new one is needed. It expires within an hour. A kind that does not open in a frame is refused with 409 artifact_kind_mismatch.
6265
6680
  */
6266
6681
  export const createArtifactFrameMutation = (
6267
6682
  options?: Partial<Options<CreateArtifactFrameData>>
@@ -6314,6 +6729,33 @@ export const getArtifactVersionOptions = (options: Options<GetArtifactVersionDat
6314
6729
  queryKey: getArtifactVersionQueryKey(options),
6315
6730
  })
6316
6731
 
6732
+ export const getArtifactBoardPreviewQueryKey = (options: Options<GetArtifactBoardPreviewData>) =>
6733
+ createQueryKey("getArtifactBoardPreview", options)
6734
+
6735
+ /**
6736
+ * Get the preview of a canvas's board
6737
+ *
6738
+ * A picture of the board as its version shows it, in the reader's mode: a PNG at its own size, or with size=small a WebP at most 480 pixels wide, which a viewer shows until the board is opened. It shows the data the version's author can see. A frozen version's preview never changes, and is cached as such, as is one asked for at a revision; an open version's otherwise, and "latest", are revalidated. 404 preview_not_found until it is rendered, when it never will be, or when revision is not the version's current one: the version says which.
6739
+ */
6740
+ export const getArtifactBoardPreviewOptions = (options: Options<GetArtifactBoardPreviewData>) =>
6741
+ queryOptions<
6742
+ GetArtifactBoardPreviewResponse,
6743
+ GetArtifactBoardPreviewError,
6744
+ GetArtifactBoardPreviewResponse,
6745
+ ReturnType<typeof getArtifactBoardPreviewQueryKey>
6746
+ >({
6747
+ queryFn: async ({ queryKey, signal }) => {
6748
+ const { data } = await getArtifactBoardPreview({
6749
+ ...options,
6750
+ ...queryKey[0],
6751
+ signal,
6752
+ throwOnError: true,
6753
+ })
6754
+ return data
6755
+ },
6756
+ queryKey: getArtifactBoardPreviewQueryKey(options),
6757
+ })
6758
+
6317
6759
  export const getArtifactQueryQueryKey = (options: Options<GetArtifactQueryData>) =>
6318
6760
  createQueryKey("getArtifactQuery", options)
6319
6761