@sixb/client 0.2.3 → 0.2.6

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 (49) hide show
  1. package/dist/agent-streams.d.ts +11 -2
  2. package/dist/agent-streams.d.ts.map +1 -1
  3. package/dist/artifact-live.js +1 -1
  4. package/dist/browser.js +1 -1
  5. package/dist/{chunk-ktqfenfd.js → chunk-3dxa8d3r.js} +46 -6
  6. package/dist/chunk-3dxa8d3r.js.map +10 -0
  7. package/dist/{chunk-90q7wa43.js → chunk-4t68c4gf.js} +10 -3
  8. package/dist/{chunk-90q7wa43.js.map → chunk-4t68c4gf.js.map} +3 -3
  9. package/dist/{chunk-bgpzb1fn.js → chunk-6caavk8p.js} +1 -1
  10. package/dist/{chunk-seeyb9k9.js → chunk-pzz6gtn5.js} +2 -2
  11. package/dist/{chunk-zerhr00d.js → chunk-vydypkf1.js} +98 -2
  12. package/dist/chunk-vydypkf1.js.map +10 -0
  13. package/dist/connectors/connection.d.ts +12 -0
  14. package/dist/connectors/connection.d.ts.map +1 -1
  15. package/dist/connectors/index.d.ts +1 -1
  16. package/dist/connectors/index.d.ts.map +1 -1
  17. package/dist/connectors/queries.d.ts.map +1 -1
  18. package/dist/generated/@tanstack/react-query.gen.d.ts +6678 -4623
  19. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  20. package/dist/generated/index.d.ts +2 -2
  21. package/dist/generated/index.d.ts.map +1 -1
  22. package/dist/generated/sdk.gen.d.ts +58 -6
  23. package/dist/generated/sdk.gen.d.ts.map +1 -1
  24. package/dist/generated/types.gen.d.ts +2468 -227
  25. package/dist/generated/types.gen.d.ts.map +1 -1
  26. package/dist/hooks.js +180 -6
  27. package/dist/hooks.js.map +4 -4
  28. package/dist/index.js +26 -6
  29. package/dist/index.js.map +1 -1
  30. package/dist/logs.js +3 -3
  31. package/dist/models.js +23 -3
  32. package/dist/models.js.map +1 -1
  33. package/dist/query.js +2 -2
  34. package/dist/users-hooks.d.ts.map +1 -1
  35. package/dist/ws-socket.d.ts +2 -0
  36. package/dist/ws-socket.d.ts.map +1 -1
  37. package/package.json +2 -2
  38. package/src/agent-streams.ts +23 -0
  39. package/src/connectors/connection.ts +59 -0
  40. package/src/connectors/index.ts +1 -0
  41. package/src/generated/@tanstack/react-query.gen.ts +319 -5
  42. package/src/generated/index.ts +55 -0
  43. package/src/generated/sdk.gen.ts +235 -5
  44. package/src/generated/types.gen.ts +3408 -187
  45. package/src/ws-socket.ts +62 -7
  46. package/dist/chunk-ktqfenfd.js.map +0 -10
  47. package/dist/chunk-zerhr00d.js.map +0 -10
  48. /package/dist/{chunk-bgpzb1fn.js.map → chunk-6caavk8p.js.map} +0 -0
  49. /package/dist/{chunk-seeyb9k9.js.map → chunk-pzz6gtn5.js.map} +0 -0
@@ -98,6 +98,9 @@ import type {
98
98
  DisconnectConnectorConnectionData,
99
99
  DisconnectConnectorConnectionErrors,
100
100
  DisconnectConnectorConnectionResponses,
101
+ EditAgentThreadMessageData,
102
+ EditAgentThreadMessageErrors,
103
+ EditAgentThreadMessageResponses,
101
104
  ExchangeDeviceAuthorizationData,
102
105
  ExchangeDeviceAuthorizationResponses,
103
106
  ExchangeSharedAccessData,
@@ -192,6 +195,9 @@ import type {
192
195
  GetArtifactFileContentData,
193
196
  GetArtifactFileContentErrors,
194
197
  GetArtifactFileContentResponses,
198
+ GetArtifactPdfData,
199
+ GetArtifactPdfErrors,
200
+ GetArtifactPdfResponses,
195
201
  GetArtifactQueryData,
196
202
  GetArtifactQueryErrors,
197
203
  GetArtifactQueryResponses,
@@ -381,6 +387,9 @@ import type {
381
387
  ListAgentThreadChildrenData,
382
388
  ListAgentThreadChildrenErrors,
383
389
  ListAgentThreadChildrenResponses,
390
+ ListAgentThreadInboxData,
391
+ ListAgentThreadInboxErrors,
392
+ ListAgentThreadInboxResponses,
384
393
  ListAgentThreadMessagesData,
385
394
  ListAgentThreadMessagesErrors,
386
395
  ListAgentThreadMessagesResponses,
@@ -429,6 +438,10 @@ import type {
429
438
  ListAuthSessionsData,
430
439
  ListAuthSessionsErrors,
431
440
  ListAuthSessionsResponses,
441
+ ListConnectorAccountsData,
442
+ ListConnectorAccountsResponses,
443
+ ListConnectorConnectionSyncRunsData,
444
+ ListConnectorConnectionSyncRunsResponses,
432
445
  ListConnectorConnectionsData,
433
446
  ListConnectorConnectionsErrors,
434
447
  ListConnectorConnectionsResponses,
@@ -505,6 +518,9 @@ import type {
505
518
  ListWorkflowRunsResponses,
506
519
  ListWorkflowsData,
507
520
  ListWorkflowsResponses,
521
+ MarkAgentThreadReadData,
522
+ MarkAgentThreadReadErrors,
523
+ MarkAgentThreadReadResponses,
508
524
  MoveAgentThreadToCloudData,
509
525
  MoveAgentThreadToCloudErrors,
510
526
  MoveAgentThreadToCloudResponses,
@@ -514,6 +530,9 @@ import type {
514
530
  PostAgentThreadMessageData,
515
531
  PostAgentThreadMessageErrors,
516
532
  PostAgentThreadMessageResponses,
533
+ PrintArtifactPdfData,
534
+ PrintArtifactPdfErrors,
535
+ PrintArtifactPdfResponses,
517
536
  QueryObjectLinksData,
518
537
  QueryObjectLinksErrors,
519
538
  QueryObjectLinksResponses,
@@ -553,6 +572,9 @@ import type {
553
572
  ResolveArtifactCommentData,
554
573
  ResolveArtifactCommentErrors,
555
574
  ResolveArtifactCommentResponses,
575
+ RestoreAgentThreadSandboxData,
576
+ RestoreAgentThreadSandboxErrors,
577
+ RestoreAgentThreadSandboxResponses,
556
578
  RestoreArtifactData,
557
579
  RestoreArtifactErrors,
558
580
  RestoreArtifactResponses,
@@ -625,6 +647,9 @@ import type {
625
647
  UpdateAgentPreferencesData,
626
648
  UpdateAgentPreferencesErrors,
627
649
  UpdateAgentPreferencesResponses,
650
+ UpdateAgentThreadInboxItemData,
651
+ UpdateAgentThreadInboxItemErrors,
652
+ UpdateAgentThreadInboxItemResponses,
628
653
  UpdateAiLimitPolicyData,
629
654
  UpdateAiLimitPolicyErrors,
630
655
  UpdateAiLimitPolicyResponses,
@@ -643,6 +668,9 @@ import type {
643
668
  UploadFileRawData,
644
669
  UploadFileRawErrors,
645
670
  UploadFileRawResponses,
671
+ WithdrawAgentThreadInboxItemData,
672
+ WithdrawAgentThreadInboxItemErrors,
673
+ WithdrawAgentThreadInboxItemResponses,
646
674
  } from "./types.gen"
647
675
 
648
676
  export type Options<
@@ -1880,6 +1908,37 @@ export const getSync = <ThrowOnError extends boolean = false>(
1880
1908
  ...options,
1881
1909
  })
1882
1910
 
1911
+ /**
1912
+ * List a connector's accounts and how they synced
1913
+ *
1914
+ * On an OAuth connector, each connected account you may see, with the latest run of each of its syncs you may run. Empty for a static connector.
1915
+ */
1916
+ export const listConnectorAccounts = <ThrowOnError extends boolean = false>(
1917
+ options: Options<ListConnectorAccountsData, ThrowOnError>
1918
+ ) =>
1919
+ (options.client ?? client).get<ListConnectorAccountsResponses, unknown, ThrowOnError>({
1920
+ security: [
1921
+ { scheme: "bearer", type: "http" },
1922
+ { scheme: "bearer", type: "http" },
1923
+ ],
1924
+ url: "/api/connectors/{connectorId}/accounts",
1925
+ ...options,
1926
+ })
1927
+
1928
+ /**
1929
+ * Latest sync runs of a connection
1930
+ *
1931
+ * The latest run of each sync of one connection: your own, or anyone's with can.manage on its connector. Empty for a connection you don't see.
1932
+ */
1933
+ export const listConnectorConnectionSyncRuns = <ThrowOnError extends boolean = false>(
1934
+ options: Options<ListConnectorConnectionSyncRunsData, ThrowOnError>
1935
+ ) =>
1936
+ (options.client ?? client).get<ListConnectorConnectionSyncRunsResponses, unknown, ThrowOnError>({
1937
+ security: [{ scheme: "bearer", type: "http" }],
1938
+ url: "/api/connectors/{connectorId}/connections/{connectionId}/sync-runs",
1939
+ ...options,
1940
+ })
1941
+
1883
1942
  /**
1884
1943
  * List sync run history
1885
1944
  */
@@ -3097,6 +3156,29 @@ export const recreateAgentThreadSandbox = <ThrowOnError extends boolean = false>
3097
3156
  },
3098
3157
  })
3099
3158
 
3159
+ /**
3160
+ * Explicitly go on in the workspace a failed save left, with its files as they were
3161
+ */
3162
+ export const restoreAgentThreadSandbox = <ThrowOnError extends boolean = false>(
3163
+ options: Options<RestoreAgentThreadSandboxData, ThrowOnError>
3164
+ ) =>
3165
+ (options.client ?? client).post<
3166
+ RestoreAgentThreadSandboxResponses,
3167
+ RestoreAgentThreadSandboxErrors,
3168
+ ThrowOnError
3169
+ >({
3170
+ security: [
3171
+ { name: "x-sixb-csrf", type: "apiKey" },
3172
+ { scheme: "bearer", type: "http" },
3173
+ ],
3174
+ url: "/api/agent-threads/{threadId}/sandbox/restore",
3175
+ ...options,
3176
+ headers: {
3177
+ "Content-Type": "application/json",
3178
+ ...options.headers,
3179
+ },
3180
+ })
3181
+
3100
3182
  /**
3101
3183
  * List agent thread messages
3102
3184
  */
@@ -3177,6 +3259,92 @@ export const headAgentMessageFileContent = <ThrowOnError extends boolean = false
3177
3259
  ...options,
3178
3260
  })
3179
3261
 
3262
+ /**
3263
+ * List agent thread inbox messages
3264
+ */
3265
+ export const listAgentThreadInbox = <ThrowOnError extends boolean = false>(
3266
+ options: Options<ListAgentThreadInboxData, ThrowOnError>
3267
+ ) =>
3268
+ (options.client ?? client).get<
3269
+ ListAgentThreadInboxResponses,
3270
+ ListAgentThreadInboxErrors,
3271
+ ThrowOnError
3272
+ >({
3273
+ security: [
3274
+ { scheme: "bearer", type: "http" },
3275
+ { scheme: "bearer", type: "http" },
3276
+ ],
3277
+ url: "/api/agent-threads/{threadId}/inbox",
3278
+ ...options,
3279
+ })
3280
+
3281
+ /**
3282
+ * Withdraw a waiting agent thread message
3283
+ */
3284
+ export const withdrawAgentThreadInboxItem = <ThrowOnError extends boolean = false>(
3285
+ options: Options<WithdrawAgentThreadInboxItemData, ThrowOnError>
3286
+ ) =>
3287
+ (options.client ?? client).delete<
3288
+ WithdrawAgentThreadInboxItemResponses,
3289
+ WithdrawAgentThreadInboxItemErrors,
3290
+ ThrowOnError
3291
+ >({
3292
+ security: [
3293
+ { name: "x-sixb-csrf", type: "apiKey" },
3294
+ { scheme: "bearer", type: "http" },
3295
+ ],
3296
+ url: "/api/agent-threads/{threadId}/inbox/{itemId}",
3297
+ ...options,
3298
+ })
3299
+
3300
+ /**
3301
+ * Update a waiting agent thread message
3302
+ */
3303
+ export const updateAgentThreadInboxItem = <ThrowOnError extends boolean = false>(
3304
+ options: Options<UpdateAgentThreadInboxItemData, ThrowOnError>
3305
+ ) =>
3306
+ (options.client ?? client).patch<
3307
+ UpdateAgentThreadInboxItemResponses,
3308
+ UpdateAgentThreadInboxItemErrors,
3309
+ ThrowOnError
3310
+ >({
3311
+ security: [
3312
+ { name: "x-sixb-csrf", type: "apiKey" },
3313
+ { scheme: "bearer", type: "http" },
3314
+ ],
3315
+ url: "/api/agent-threads/{threadId}/inbox/{itemId}",
3316
+ ...options,
3317
+ headers: {
3318
+ "Content-Type": "application/json",
3319
+ ...options.headers,
3320
+ },
3321
+ })
3322
+
3323
+ /**
3324
+ * Edit an agent thread message and restart from that turn
3325
+ *
3326
+ * Replaces a user-authored message in place, removes any messages and compaction summaries from that turn onward, and starts a new turn from the edited message. While a turn runs, the edit stops it and waits in the thread's inbox: the turn's end rewinds the thread and starts the edited message.
3327
+ */
3328
+ export const editAgentThreadMessage = <ThrowOnError extends boolean = false>(
3329
+ options: Options<EditAgentThreadMessageData, ThrowOnError>
3330
+ ) =>
3331
+ (options.client ?? client).post<
3332
+ EditAgentThreadMessageResponses,
3333
+ EditAgentThreadMessageErrors,
3334
+ ThrowOnError
3335
+ >({
3336
+ security: [
3337
+ { name: "x-sixb-csrf", type: "apiKey" },
3338
+ { scheme: "bearer", type: "http" },
3339
+ ],
3340
+ url: "/api/agent-threads/{threadId}/messages/{messageId}/edit",
3341
+ ...options,
3342
+ headers: {
3343
+ "Content-Type": "application/json",
3344
+ ...options.headers,
3345
+ },
3346
+ })
3347
+
3180
3348
  /**
3181
3349
  * Cancel an agent thread's active run
3182
3350
  *
@@ -3284,6 +3452,31 @@ export const cancelAgentRunById = <ThrowOnError extends boolean = false>(
3284
3452
  ...options,
3285
3453
  })
3286
3454
 
3455
+ /**
3456
+ * Mark how far you have read an Agent thread
3457
+ *
3458
+ * Record that your reading of a conversation reached a message, or its newest when `throughMessageId` is omitted, which is what a Done button sends. It never moves backwards, so another device that read further keeps its place; a message a retry or an edit took away marks nothing. Session routes only: a runner has no reading.
3459
+ */
3460
+ export const markAgentThreadRead = <ThrowOnError extends boolean = false>(
3461
+ options: Options<MarkAgentThreadReadData, ThrowOnError>
3462
+ ) =>
3463
+ (options.client ?? client).put<
3464
+ MarkAgentThreadReadResponses,
3465
+ MarkAgentThreadReadErrors,
3466
+ ThrowOnError
3467
+ >({
3468
+ security: [
3469
+ { name: "x-sixb-csrf", type: "apiKey" },
3470
+ { scheme: "bearer", type: "http" },
3471
+ ],
3472
+ url: "/api/agent-threads/{threadId}/read",
3473
+ ...options,
3474
+ headers: {
3475
+ "Content-Type": "application/json",
3476
+ ...options.headers,
3477
+ },
3478
+ })
3479
+
3287
3480
  /**
3288
3481
  * List the sub-agents of an agent conversation
3289
3482
  *
@@ -3363,7 +3556,7 @@ export const listAgentComputers = <ThrowOnError extends boolean = false>(
3363
3556
  /**
3364
3557
  * Move a thread from your computer to the cloud
3365
3558
  *
3366
- * Its turns run in the cloud from now on, starting with the one waiting for the computer, if any. The files it worked on stay on the computer. Refused while a turn runs there or waits on approvals.
3559
+ * Its turns run in the cloud from now on, starting with the one waiting for the computer, if any, and its owner can move it to a computer or folder again later. The files it worked on stay on the computer. Refused while a turn runs there or waits on approvals.
3367
3560
  */
3368
3561
  export const moveAgentThreadToCloud = <ThrowOnError extends boolean = false>(
3369
3562
  options: Options<MoveAgentThreadToCloudData, ThrowOnError>
@@ -3384,7 +3577,7 @@ export const moveAgentThreadToCloud = <ThrowOnError extends boolean = false>(
3384
3577
  /**
3385
3578
  * Move a thread to one of your computers, in a folder there
3386
3579
  *
3387
- * A thread that runs on its owner's computer runs there alone, in one folder: only `sixb` open in that folder claims its turns. Its owner moves it to another folder or computer. Refused while a turn runs or waits on approvals.
3580
+ * Its turns run there alone from now on, in that folder: only `sixb` open in it claims them. Its owner moves it from the cloud or from another folder or computer, as often as they need; files from where it ran before stay there. Refused while a turn runs or waits on approvals.
3388
3581
  */
3389
3582
  export const moveAgentThreadToComputer = <ThrowOnError extends boolean = false>(
3390
3583
  options: Options<MoveAgentThreadToComputerData, ThrowOnError>
@@ -4021,7 +4214,7 @@ export const freezeArtifactVersion = <ThrowOnError extends boolean = false>(
4021
4214
  /**
4022
4215
  * List an artifact's comments
4023
4216
  *
4024
- * Every comment and reply, oldest first, resolved ones included. Whoever reads the artifact reads them.
4217
+ * Every comment and reply, oldest first, resolved ones included. Whoever reads the artifact reads them; a shared link's guest reads only the threads started by a guest of the same link, with every reply in them.
4025
4218
  */
4026
4219
  export const listArtifactComments = <ThrowOnError extends boolean = false>(
4027
4220
  options: Options<ListArtifactCommentsData, ThrowOnError>
@@ -4043,7 +4236,7 @@ export const listArtifactComments = <ThrowOnError extends boolean = false>(
4043
4236
  /**
4044
4237
  * Comment on an artifact
4045
4238
  *
4046
- * 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.
4239
+ * 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), and replies only in a thread they read (404 comment_not_found otherwise). A canvas's comment can be about one of its boards, or an element of a board by its address. Readers of the thread receive artifact.commented.
4047
4240
  */
4048
4241
  export const addArtifactComment = <ThrowOnError extends boolean = false>(
4049
4242
  options: Options<AddArtifactCommentData, ThrowOnError>
@@ -4243,6 +4436,43 @@ export const getArtifactVersion = <ThrowOnError extends boolean = false>(
4243
4436
  ...options,
4244
4437
  })
4245
4438
 
4439
+ /**
4440
+ * Get a designed document's PDF
4441
+ *
4442
+ * The version printed to PDF, with the values its fields read as the caller reads them, as a download named after the title it printed with: for a document that shows live data, those its POST's key names. 404 pdf_not_found until it is printed: ask for it with POST first. A frozen version's PDF never changes, and is cached as such.
4443
+ */
4444
+ export const getArtifactPdf = <ThrowOnError extends boolean = false>(
4445
+ options: Options<GetArtifactPdfData, ThrowOnError>
4446
+ ) =>
4447
+ (options.client ?? client).get<GetArtifactPdfResponses, GetArtifactPdfErrors, ThrowOnError>({
4448
+ security: [
4449
+ { scheme: "bearer", type: "http" },
4450
+ { scheme: "bearer", type: "http" },
4451
+ { name: "x-sixb-share-grant", type: "apiKey" },
4452
+ ],
4453
+ url: "/api/artifacts/{artifactId}/versions/{version}/pdf",
4454
+ ...options,
4455
+ })
4456
+
4457
+ /**
4458
+ * Print a designed document to PDF
4459
+ *
4460
+ * Answers ready once the version is printed, and printing until then, having asked for it: ask again after a few seconds, then get it. Failed with why when it could not be printed; retry=true asks again. A document that shows live data answers with a key: ask again and get it with that key, which names the values the first ask printed. It prints as its stylesheets' @page rule lays it out, in a sandbox of the project. Whoever reads the artifact may ask. 400 invalid_artifact when the version is not a designed document; 501 pdf_unavailable in a project without sandboxes.
4461
+ */
4462
+ export const printArtifactPdf = <ThrowOnError extends boolean = false>(
4463
+ options: Options<PrintArtifactPdfData, ThrowOnError>
4464
+ ) =>
4465
+ (options.client ?? client).post<PrintArtifactPdfResponses, PrintArtifactPdfErrors, ThrowOnError>({
4466
+ security: [
4467
+ { name: "x-sixb-csrf", type: "apiKey" },
4468
+ { scheme: "bearer", type: "http" },
4469
+ { scheme: "bearer", type: "http" },
4470
+ { name: "x-sixb-share-grant", type: "apiKey" },
4471
+ ],
4472
+ url: "/api/artifacts/{artifactId}/versions/{version}/pdf",
4473
+ ...options,
4474
+ })
4475
+
4246
4476
  /**
4247
4477
  * Get the preview of a canvas's board
4248
4478
  *
@@ -4268,7 +4498,7 @@ export const getArtifactBoardPreview = <ThrowOnError extends boolean = false>(
4268
4498
  /**
4269
4499
  * Run an artifact's query
4270
4500
  *
4271
- * 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.
4501
+ * 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. A designed document's "holder" is the object that holds it, of the type it names, with the links its fields read through: 404 holder_not_found when no one such object the caller reads holds it.
4272
4502
  */
4273
4503
  export const getArtifactQuery = <ThrowOnError extends boolean = false>(
4274
4504
  options: Options<GetArtifactQueryData, ThrowOnError>