@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
package/dist/hooks.js CHANGED
@@ -32,15 +32,15 @@ import {
32
32
  ActionRunFailedError2,
33
33
  isFailedActionRun,
34
34
  uploadFile2
35
- } from "./chunk-90q7wa43.js";
35
+ } from "./chunk-4t68c4gf.js";
36
36
  import {
37
37
  isSixbApiError2
38
38
  } from "./chunk-br10prhs.js";
39
39
  import {
40
40
  objectQueryReadsAny,
41
41
  createHttpQueryExecutor2
42
- } from "./chunk-bgpzb1fn.js";
43
- import"./chunk-ktqfenfd.js";
42
+ } from "./chunk-6caavk8p.js";
43
+ import"./chunk-3dxa8d3r.js";
44
44
  import"./chunk-0ka9ykez.js";
45
45
  import {
46
46
  createDeviceAuthorization2,
@@ -109,6 +109,8 @@ import {
109
109
  getLakeHealth2,
110
110
  listSyncs2,
111
111
  getSync2,
112
+ listConnectorAccounts2,
113
+ listConnectorConnectionSyncRuns2,
112
114
  listSyncRuns2,
113
115
  requestSyncRun2,
114
116
  listPipelines2,
@@ -172,15 +174,21 @@ import {
172
174
  removeAgentThreadParticipant2,
173
175
  forkAgentThread2,
174
176
  recreateAgentThreadSandbox2,
177
+ restoreAgentThreadSandbox2,
175
178
  listAgentThreadMessages2,
176
179
  postAgentThreadMessage2,
177
180
  getAgentMessageFileContent2,
181
+ listAgentThreadInbox2,
182
+ withdrawAgentThreadInboxItem2,
183
+ updateAgentThreadInboxItem2,
184
+ editAgentThreadMessage2,
178
185
  cancelAgentRun2,
179
186
  retryAgentRun2,
180
187
  getAgentThreadContext2,
181
188
  listAgentThreadRuns2,
182
189
  getAgentRun2,
183
190
  cancelAgentRunById2,
191
+ markAgentThreadRead2,
184
192
  listAgentThreadChildren2,
185
193
  getAgentChildFileContent2,
186
194
  listAgentComputers2,
@@ -226,6 +234,8 @@ import {
226
234
  restoreArtifact2,
227
235
  createArtifactFrame2,
228
236
  getArtifactVersion2,
237
+ getArtifactPdf2,
238
+ printArtifactPdf2,
229
239
  getArtifactBoardPreview2,
230
240
  getArtifactQuery2,
231
241
  getArtifactFileContent2,
@@ -251,7 +261,7 @@ import {
251
261
  listProjectionRuns2,
252
262
  getProjectionRun2,
253
263
  listWebhookRuns2
254
- } from "./chunk-zerhr00d.js";
264
+ } from "./chunk-vydypkf1.js";
255
265
 
256
266
  // src/hooks.ts
257
267
  import { infiniteQueryOptions as infiniteQueryOptions3, queryOptions as queryOptions5 } from "@tanstack/react-query";
@@ -1280,6 +1290,32 @@ var getSyncOptions = (options) => queryOptions({
1280
1290
  },
1281
1291
  queryKey: getSyncQueryKey(options)
1282
1292
  });
1293
+ var listConnectorAccountsQueryKey = (options) => createQueryKey("listConnectorAccounts", options);
1294
+ var listConnectorAccountsOptions = (options) => queryOptions({
1295
+ queryFn: async ({ queryKey, signal }) => {
1296
+ const { data } = await listConnectorAccounts2({
1297
+ ...options,
1298
+ ...queryKey[0],
1299
+ signal,
1300
+ throwOnError: true
1301
+ });
1302
+ return data;
1303
+ },
1304
+ queryKey: listConnectorAccountsQueryKey(options)
1305
+ });
1306
+ var listConnectorConnectionSyncRunsQueryKey = (options) => createQueryKey("listConnectorConnectionSyncRuns", options);
1307
+ var listConnectorConnectionSyncRunsOptions = (options) => queryOptions({
1308
+ queryFn: async ({ queryKey, signal }) => {
1309
+ const { data } = await listConnectorConnectionSyncRuns2({
1310
+ ...options,
1311
+ ...queryKey[0],
1312
+ signal,
1313
+ throwOnError: true
1314
+ });
1315
+ return data;
1316
+ },
1317
+ queryKey: listConnectorConnectionSyncRunsQueryKey(options)
1318
+ });
1283
1319
  var listSyncRunsQueryKey = (options) => createQueryKey("listSyncRuns", options);
1284
1320
  var listSyncRunsOptions = (options) => queryOptions({
1285
1321
  queryFn: async ({ queryKey, signal }) => {
@@ -2225,6 +2261,19 @@ var recreateAgentThreadSandboxMutation = (options) => {
2225
2261
  };
2226
2262
  return mutationOptions;
2227
2263
  };
2264
+ var restoreAgentThreadSandboxMutation = (options) => {
2265
+ const mutationOptions = {
2266
+ mutationFn: async (fnOptions) => {
2267
+ const { data } = await restoreAgentThreadSandbox2({
2268
+ ...options,
2269
+ ...fnOptions,
2270
+ throwOnError: true
2271
+ });
2272
+ return data;
2273
+ }
2274
+ };
2275
+ return mutationOptions;
2276
+ };
2228
2277
  var listAgentThreadMessagesQueryKey = (options) => createQueryKey("listAgentThreadMessages", options);
2229
2278
  var listAgentThreadMessagesOptions = (options) => queryOptions({
2230
2279
  queryFn: async ({ queryKey, signal }) => {
@@ -2283,6 +2332,58 @@ var getAgentMessageFileContentOptions = (options) => queryOptions({
2283
2332
  },
2284
2333
  queryKey: getAgentMessageFileContentQueryKey(options)
2285
2334
  });
2335
+ var listAgentThreadInboxQueryKey = (options) => createQueryKey("listAgentThreadInbox", options);
2336
+ var listAgentThreadInboxOptions = (options) => queryOptions({
2337
+ queryFn: async ({ queryKey, signal }) => {
2338
+ const { data } = await listAgentThreadInbox2({
2339
+ ...options,
2340
+ ...queryKey[0],
2341
+ signal,
2342
+ throwOnError: true
2343
+ });
2344
+ return data;
2345
+ },
2346
+ queryKey: listAgentThreadInboxQueryKey(options)
2347
+ });
2348
+ var withdrawAgentThreadInboxItemMutation = (options) => {
2349
+ const mutationOptions = {
2350
+ mutationFn: async (fnOptions) => {
2351
+ const { data } = await withdrawAgentThreadInboxItem2({
2352
+ ...options,
2353
+ ...fnOptions,
2354
+ throwOnError: true
2355
+ });
2356
+ return data;
2357
+ }
2358
+ };
2359
+ return mutationOptions;
2360
+ };
2361
+ var updateAgentThreadInboxItemMutation = (options) => {
2362
+ const mutationOptions = {
2363
+ mutationFn: async (fnOptions) => {
2364
+ const { data } = await updateAgentThreadInboxItem2({
2365
+ ...options,
2366
+ ...fnOptions,
2367
+ throwOnError: true
2368
+ });
2369
+ return data;
2370
+ }
2371
+ };
2372
+ return mutationOptions;
2373
+ };
2374
+ var editAgentThreadMessageMutation = (options) => {
2375
+ const mutationOptions = {
2376
+ mutationFn: async (fnOptions) => {
2377
+ const { data } = await editAgentThreadMessage2({
2378
+ ...options,
2379
+ ...fnOptions,
2380
+ throwOnError: true
2381
+ });
2382
+ return data;
2383
+ }
2384
+ };
2385
+ return mutationOptions;
2386
+ };
2286
2387
  var cancelAgentRunMutation = (options) => {
2287
2388
  const mutationOptions = {
2288
2389
  mutationFn: async (fnOptions) => {
@@ -2380,6 +2481,19 @@ var cancelAgentRunByIdMutation = (options) => {
2380
2481
  };
2381
2482
  return mutationOptions;
2382
2483
  };
2484
+ var markAgentThreadReadMutation = (options) => {
2485
+ const mutationOptions = {
2486
+ mutationFn: async (fnOptions) => {
2487
+ const { data } = await markAgentThreadRead2({
2488
+ ...options,
2489
+ ...fnOptions,
2490
+ throwOnError: true
2491
+ });
2492
+ return data;
2493
+ }
2494
+ };
2495
+ return mutationOptions;
2496
+ };
2383
2497
  var listAgentThreadChildrenQueryKey = (options) => createQueryKey("listAgentThreadChildren", options);
2384
2498
  var listAgentThreadChildrenOptions = (options) => queryOptions({
2385
2499
  queryFn: async ({ queryKey, signal }) => {
@@ -3079,6 +3193,32 @@ var getArtifactVersionOptions = (options) => queryOptions({
3079
3193
  },
3080
3194
  queryKey: getArtifactVersionQueryKey(options)
3081
3195
  });
3196
+ var getArtifactPdfQueryKey = (options) => createQueryKey("getArtifactPdf", options);
3197
+ var getArtifactPdfOptions = (options) => queryOptions({
3198
+ queryFn: async ({ queryKey, signal }) => {
3199
+ const { data } = await getArtifactPdf2({
3200
+ ...options,
3201
+ ...queryKey[0],
3202
+ signal,
3203
+ throwOnError: true
3204
+ });
3205
+ return data;
3206
+ },
3207
+ queryKey: getArtifactPdfQueryKey(options)
3208
+ });
3209
+ var printArtifactPdfMutation = (options) => {
3210
+ const mutationOptions = {
3211
+ mutationFn: async (fnOptions) => {
3212
+ const { data } = await printArtifactPdf2({
3213
+ ...options,
3214
+ ...fnOptions,
3215
+ throwOnError: true
3216
+ });
3217
+ return data;
3218
+ }
3219
+ };
3220
+ return mutationOptions;
3221
+ };
3082
3222
  var getArtifactBoardPreviewQueryKey = (options) => createQueryKey("getArtifactBoardPreview", options);
3083
3223
  var getArtifactBoardPreviewOptions = (options) => queryOptions({
3084
3224
  queryFn: async ({ queryKey, signal }) => {
@@ -3790,6 +3930,7 @@ function optionalNonblank(value, field) {
3790
3930
  var CONNECTOR_CALLBACK_CONNECTOR_PARAM = "connectionConnectorId";
3791
3931
  var CONNECTOR_CALLBACK_RUN_PARAM = "connectionRunId";
3792
3932
  var RUN_POLL_INTERVAL_MS = 1000;
3933
+ var SYNC_POLL_INTERVAL_MS = 5000;
3793
3934
  function useConnectorConnection({
3794
3935
  connectorId,
3795
3936
  owner = "project",
@@ -3827,6 +3968,14 @@ function useConnectorConnection({
3827
3968
  refetchInterval: (query) => isRunInProgress(query.state.data) ? RUN_POLL_INTERVAL_MS : false
3828
3969
  });
3829
3970
  const resumedRun = runQuery.data && fillsSlot(runQuery.data) ? runQuery.data : undefined;
3971
+ const syncRunsQuery = useQuery2({
3972
+ ...listConnectorConnectionSyncRunsOptions({
3973
+ client: providerClient,
3974
+ path: { connectorId, connectionId: connection?.id ?? "" }
3975
+ }),
3976
+ enabled: connection !== undefined,
3977
+ refetchInterval: (query) => summarizeSync(query.state.data?.runs)?.status === "syncing" ? SYNC_POLL_INTERVAL_MS : false
3978
+ });
3830
3979
  const resolvedReturnTo = returnTo ?? connectorConnectionReturnTo();
3831
3980
  const connectMutation = useConnectConnector({
3832
3981
  connectorId,
@@ -3929,6 +4078,8 @@ function useConnectorConnection({
3929
4078
  }
3930
4079
  }
3931
4080
  await refreshConnectionsAndConsumeCallback(completedCallback);
4081
+ if (connection)
4082
+ await syncRunsQuery.refetch();
3932
4083
  }
3933
4084
  function dismiss() {
3934
4085
  if (!callback)
@@ -3971,6 +4122,7 @@ function useConnectorConnection({
3971
4122
  canConnect,
3972
4123
  isPending: status === "loading" || status === "authorizing" || mutationPending,
3973
4124
  selectedAccountId: selectMutation.variables?.accountId,
4125
+ sync: connection ? summarizeSync(syncRunsQuery.data?.runs) : undefined,
3974
4126
  connect,
3975
4127
  selectAccount,
3976
4128
  disconnect,
@@ -3980,6 +4132,14 @@ function useConnectorConnection({
3980
4132
  resetError
3981
4133
  };
3982
4134
  }
4135
+ function summarizeSync(runs) {
4136
+ const latest = (status, matching) => {
4137
+ const at = matching.map((run) => status === "syncing" ? run.startedAt ?? run.queuedAt : run.finishedAt).filter((value) => value !== undefined).sort().at(-1);
4138
+ return at === undefined ? undefined : { status, at };
4139
+ };
4140
+ const all = runs ?? [];
4141
+ return latest("syncing", all.filter((run) => run.status === "queued" || run.status === "running")) ?? latest("failed", all.filter((run) => run.status === "failed")) ?? latest("synced", all.filter((run) => run.status === "succeeded"));
4142
+ }
3983
4143
  function isConnectorReplacementRequired(error) {
3984
4144
  if (isSixbApiError2(error))
3985
4145
  return error.code === "connector.replacement_required";
@@ -5544,6 +5704,7 @@ export {
5544
5704
  disableAuthServiceAccountMutation,
5545
5705
  disconnectConnectorConnectionMutation,
5546
5706
  disconnectConnectorMutationOptions,
5707
+ editAgentThreadMessageMutation,
5547
5708
  events2 as events,
5548
5709
  exchangeDeviceAuthorizationMutation,
5549
5710
  exchangeSharedAccessMutation,
@@ -5599,6 +5760,8 @@ export {
5599
5760
  getArtifactFileContentOptions,
5600
5761
  getArtifactFileContentQueryKey,
5601
5762
  getArtifactOptions,
5763
+ getArtifactPdfOptions,
5764
+ getArtifactPdfQueryKey,
5602
5765
  getArtifactQueryKey,
5603
5766
  getArtifactQueryOptions,
5604
5767
  getArtifactQueryQueryKey,
@@ -5726,6 +5889,8 @@ export {
5726
5889
  listAgentThreadApprovalsQueryKey,
5727
5890
  listAgentThreadChildrenOptions,
5728
5891
  listAgentThreadChildrenQueryKey,
5892
+ listAgentThreadInboxOptions,
5893
+ listAgentThreadInboxQueryKey,
5729
5894
  listAgentThreadMessagesInfiniteOptions,
5730
5895
  listAgentThreadMessagesInfiniteQueryKey,
5731
5896
  listAgentThreadMessagesOptions,
@@ -5774,6 +5939,10 @@ export {
5774
5939
  listAuthServiceAccountsQueryKey,
5775
5940
  listAuthSessionsOptions,
5776
5941
  listAuthSessionsQueryKey,
5942
+ listConnectorAccountsOptions,
5943
+ listConnectorAccountsQueryKey,
5944
+ listConnectorConnectionSyncRunsOptions,
5945
+ listConnectorConnectionSyncRunsQueryKey,
5777
5946
  listConnectorConnectionsOptions,
5778
5947
  listConnectorConnectionsQueryKey,
5779
5948
  listConnectorsOptions,
@@ -5860,6 +6029,7 @@ export {
5860
6029
  listWorkflowRunsQueryKey,
5861
6030
  listWorkflowsOptions,
5862
6031
  listWorkflowsQueryKey,
6032
+ markAgentThreadReadMutation,
5863
6033
  matchesSubscription2 as matchesSubscription,
5864
6034
  moveAgentThreadToCloudMutation,
5865
6035
  moveAgentThreadToComputerMutation,
@@ -5875,6 +6045,7 @@ export {
5875
6045
  parseAgentRunStreamServerMessage2 as parseAgentRunStreamServerMessage,
5876
6046
  parseEventStreamMessage2 as parseEventStreamMessage,
5877
6047
  postAgentThreadMessageMutation,
6048
+ printArtifactPdfMutation,
5878
6049
  queryObjectLinksMutation,
5879
6050
  queryObjectsMutation,
5880
6051
  reactivateAuthMemberMutation,
@@ -5889,6 +6060,7 @@ export {
5889
6060
  requestSyncRunMutation,
5890
6061
  requestWorkflowRunMutation,
5891
6062
  resolveArtifactCommentMutation,
6063
+ restoreAgentThreadSandboxMutation,
5892
6064
  restoreArtifactMutation,
5893
6065
  retryAgentRunMutation,
5894
6066
  revokeAuthAccessTokenMutation,
@@ -5920,6 +6092,7 @@ export {
5920
6092
  telemetryUpdateKey2 as telemetryUpdateKey,
5921
6093
  transcribeAudioMutation,
5922
6094
  updateAgentPreferencesMutation,
6095
+ updateAgentThreadInboxItemMutation,
5923
6096
  updateAiLimitPolicyMutation,
5924
6097
  updateArtifactMutation,
5925
6098
  updateAuthMemberGroupsMutation,
@@ -5957,7 +6130,8 @@ export {
5957
6130
  useUser,
5958
6131
  useUsers,
5959
6132
  userQueryOptions,
5960
- usersQueryOptions
6133
+ usersQueryOptions,
6134
+ withdrawAgentThreadInboxItemMutation
5961
6135
  };
5962
6136
 
5963
- //# debugId=5DCDF53148520CA964756E2164756E21
6137
+ //# debugId=7DF982258C28817364756E2164756E21