@sixb/client 0.2.5 → 0.2.7

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-zta9jf24.js → chunk-4t68c4gf.js} +10 -3
  8. package/dist/{chunk-zta9jf24.js.map → chunk-4t68c4gf.js.map} +3 -3
  9. package/dist/{chunk-tm588tr7.js → chunk-6caavk8p.js} +1 -1
  10. package/dist/{chunk-pn4b10k4.js → chunk-pzz6gtn5.js} +2 -2
  11. package/dist/{chunk-60fdvjxa.js → chunk-vydypkf1.js} +39 -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 +1068 -153
  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 +27 -3
  23. package/dist/generated/sdk.gen.d.ts.map +1 -1
  24. package/dist/generated/types.gen.d.ts +1011 -51
  25. package/dist/generated/types.gen.d.ts.map +1 -1
  26. package/dist/hooks.js +87 -5
  27. package/dist/hooks.js.map +4 -4
  28. package/dist/index.js +13 -5
  29. package/dist/index.js.map +1 -1
  30. package/dist/logs.js +3 -3
  31. package/dist/models.js +10 -2
  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 +22 -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 +131 -2
  42. package/src/generated/index.ts +20 -0
  43. package/src/generated/sdk.gen.ts +93 -2
  44. package/src/generated/types.gen.ts +1451 -37
  45. package/src/ws-socket.ts +62 -7
  46. package/dist/chunk-60fdvjxa.js.map +0 -10
  47. package/dist/chunk-ktqfenfd.js.map +0 -10
  48. /package/dist/{chunk-tm588tr7.js.map → chunk-6caavk8p.js.map} +0 -0
  49. /package/dist/{chunk-pn4b10k4.js.map → chunk-pzz6gtn5.js.map} +0 -0
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  withSharedAccess2,
31
31
  SixbFileUploadError2,
32
32
  uploadFile2
33
- } from "./chunk-zta9jf24.js";
33
+ } from "./chunk-4t68c4gf.js";
34
34
  import {
35
35
  SIXB_CSRF_HEADER_NAME2,
36
36
  SIXB_CSRF_TOKEN_RESPONSE_HEADER_NAME2,
@@ -56,8 +56,8 @@ import {
56
56
  logs2,
57
57
  isStoredLogLine2,
58
58
  isStoredLogLine3
59
- } from "./chunk-pn4b10k4.js";
60
- import"./chunk-ktqfenfd.js";
59
+ } from "./chunk-pzz6gtn5.js";
60
+ import"./chunk-3dxa8d3r.js";
61
61
  import"./chunk-0ka9ykez.js";
62
62
  import {
63
63
  createDeviceAuthorization2,
@@ -127,6 +127,8 @@ import {
127
127
  getLakeHealth2,
128
128
  listSyncs2,
129
129
  getSync2,
130
+ listConnectorAccounts2,
131
+ listConnectorConnectionSyncRuns2,
130
132
  listSyncRuns2,
131
133
  requestSyncRun2,
132
134
  listPipelines2,
@@ -202,12 +204,14 @@ import {
202
204
  listAgentThreadInbox2,
203
205
  withdrawAgentThreadInboxItem2,
204
206
  updateAgentThreadInboxItem2,
207
+ editAgentThreadMessage2,
205
208
  cancelAgentRun2,
206
209
  retryAgentRun2,
207
210
  getAgentThreadContext2,
208
211
  listAgentThreadRuns2,
209
212
  getAgentRun2,
210
213
  cancelAgentRunById2,
214
+ markAgentThreadRead2,
211
215
  listAgentThreadChildren2,
212
216
  getAgentChildFileContent2,
213
217
  headAgentChildFileContent2,
@@ -282,7 +286,7 @@ import {
282
286
  listProjectionRuns2,
283
287
  getProjectionRun2,
284
288
  listWebhookRuns2
285
- } from "./chunk-60fdvjxa.js";
289
+ } from "./chunk-vydypkf1.js";
286
290
  export {
287
291
  ActionRunFailedError2 as ActionRunFailedError,
288
292
  SIXB_CSRF_HEADER_NAME2 as SIXB_CSRF_HEADER_NAME,
@@ -335,6 +339,7 @@ export {
335
339
  deleteArtifactStateValue2 as deleteArtifactStateValue,
336
340
  disableAuthServiceAccount2 as disableAuthServiceAccount,
337
341
  disconnectConnectorConnection2 as disconnectConnectorConnection,
342
+ editAgentThreadMessage2 as editAgentThreadMessage,
338
343
  encodeObjectId2 as encodeObjectId,
339
344
  events2 as events,
340
345
  exchangeDeviceAuthorization2 as exchangeDeviceAuthorization,
@@ -456,6 +461,8 @@ export {
456
461
  listAuthServiceAccountAccessTokens2 as listAuthServiceAccountAccessTokens,
457
462
  listAuthServiceAccounts2 as listAuthServiceAccounts,
458
463
  listAuthSessions2 as listAuthSessions,
464
+ listConnectorAccounts2 as listConnectorAccounts,
465
+ listConnectorConnectionSyncRuns2 as listConnectorConnectionSyncRuns,
459
466
  listConnectorConnections2 as listConnectorConnections,
460
467
  listConnectors2 as listConnectors,
461
468
  listDatasetRows2 as listDatasetRows,
@@ -485,6 +492,7 @@ export {
485
492
  listWorkflowRuns2 as listWorkflowRuns,
486
493
  listWorkflows2 as listWorkflows,
487
494
  logs2 as logs,
495
+ markAgentThreadRead2 as markAgentThreadRead,
488
496
  matchesSubscription2 as matchesSubscription,
489
497
  moveAgentThreadToCloud2 as moveAgentThreadToCloud,
490
498
  moveAgentThreadToComputer2 as moveAgentThreadToComputer,
@@ -554,4 +562,4 @@ export {
554
562
  withdrawAgentThreadInboxItem2 as withdrawAgentThreadInboxItem
555
563
  };
556
564
 
557
- //# debugId=762F86D5C597DFA964756E2164756E21
565
+ //# debugId=2F24C76E14BC5F8264756E2164756E21
package/dist/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "762F86D5C597DFA964756E2164756E21",
7
+ "debugId": "2F24C76E14BC5F8264756E2164756E21",
8
8
  "names": []
9
9
  }
package/dist/logs.js CHANGED
@@ -6,11 +6,11 @@ import {
6
6
  logs2,
7
7
  isStoredLogLine2,
8
8
  isStoredLogLine3
9
- } from "./chunk-pn4b10k4.js";
10
- import"./chunk-ktqfenfd.js";
9
+ } from "./chunk-pzz6gtn5.js";
10
+ import"./chunk-3dxa8d3r.js";
11
11
  import"./chunk-0ka9ykez.js";
12
12
  import"./chunk-15ynvne0.js";
13
- import"./chunk-60fdvjxa.js";
13
+ import"./chunk-vydypkf1.js";
14
14
  import"./chunk-hj4h6hw6.js";
15
15
  export {
16
16
  createLogSocket2 as createLogSocket,
package/dist/models.js CHANGED
@@ -76,6 +76,8 @@ import {
76
76
  getLakeHealth2,
77
77
  listSyncs2,
78
78
  getSync2,
79
+ listConnectorAccounts2,
80
+ listConnectorConnectionSyncRuns2,
79
81
  listSyncRuns2,
80
82
  requestSyncRun2,
81
83
  listPipelines2,
@@ -151,12 +153,14 @@ import {
151
153
  listAgentThreadInbox2,
152
154
  withdrawAgentThreadInboxItem2,
153
155
  updateAgentThreadInboxItem2,
156
+ editAgentThreadMessage2,
154
157
  cancelAgentRun2,
155
158
  retryAgentRun2,
156
159
  getAgentThreadContext2,
157
160
  listAgentThreadRuns2,
158
161
  getAgentRun2,
159
162
  cancelAgentRunById2,
163
+ markAgentThreadRead2,
160
164
  listAgentThreadChildren2,
161
165
  getAgentChildFileContent2,
162
166
  headAgentChildFileContent2,
@@ -231,7 +235,7 @@ import {
231
235
  listProjectionRuns2,
232
236
  getProjectionRun2,
233
237
  listWebhookRuns2
234
- } from "./chunk-60fdvjxa.js";
238
+ } from "./chunk-vydypkf1.js";
235
239
  import {
236
240
  client2
237
241
  } from "./chunk-hj4h6hw6.js";
@@ -268,6 +272,7 @@ export {
268
272
  deleteArtifactStateValue2 as deleteArtifactStateValue,
269
273
  disableAuthServiceAccount2 as disableAuthServiceAccount,
270
274
  disconnectConnectorConnection2 as disconnectConnectorConnection,
275
+ editAgentThreadMessage2 as editAgentThreadMessage,
271
276
  encodeObjectId2 as encodeObjectId,
272
277
  exchangeDeviceAuthorization2 as exchangeDeviceAuthorization,
273
278
  exchangeSharedAccess2 as exchangeSharedAccess,
@@ -383,6 +388,8 @@ export {
383
388
  listAuthServiceAccountAccessTokens2 as listAuthServiceAccountAccessTokens,
384
389
  listAuthServiceAccounts2 as listAuthServiceAccounts,
385
390
  listAuthSessions2 as listAuthSessions,
391
+ listConnectorAccounts2 as listConnectorAccounts,
392
+ listConnectorConnectionSyncRuns2 as listConnectorConnectionSyncRuns,
386
393
  listConnectorConnections2 as listConnectorConnections,
387
394
  listConnectors2 as listConnectors,
388
395
  listDatasetRows2 as listDatasetRows,
@@ -411,6 +418,7 @@ export {
411
418
  listWorkflowInterventions2 as listWorkflowInterventions,
412
419
  listWorkflowRuns2 as listWorkflowRuns,
413
420
  listWorkflows2 as listWorkflows,
421
+ markAgentThreadRead2 as markAgentThreadRead,
414
422
  moveAgentThreadToCloud2 as moveAgentThreadToCloud,
415
423
  moveAgentThreadToComputer2 as moveAgentThreadToComputer,
416
424
  postAgentThreadMessage2 as postAgentThreadMessage,
@@ -467,4 +475,4 @@ export {
467
475
  withdrawAgentThreadInboxItem2 as withdrawAgentThreadInboxItem
468
476
  };
469
477
 
470
- //# debugId=587BF39BCB5F732664756E2164756E21
478
+ //# debugId=9BC2842EE6E1B83964756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "587BF39BCB5F732664756E2164756E21",
7
+ "debugId": "9BC2842EE6E1B83964756E2164756E21",
8
8
  "names": []
9
9
  }
package/dist/query.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  objects2,
5
5
  createHttpQueryExecutor2,
6
6
  currentUser2
7
- } from "./chunk-tm588tr7.js";
7
+ } from "./chunk-6caavk8p.js";
8
8
  import"./chunk-br10prhs.js";
9
9
  import"./chunk-15ynvne0.js";
10
- import"./chunk-60fdvjxa.js";
10
+ import"./chunk-vydypkf1.js";
11
11
  import"./chunk-hj4h6hw6.js";
12
12
  export {
13
13
  SixbQueryError2 as SixbQueryError,
@@ -1 +1 @@
1
- {"version":3,"file":"users-hooks.d.ts","sourceRoot":"","sources":["../src/users-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAgB,KAAK,cAAc,EAAY,MAAM,uBAAuB,CAAA;AAGnF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,GAC/D,eAAe,GAAG;IAChB,oGAAoG;IACpG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAEH,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG;IAC7C,oGAAoG;IACpG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,eAAoB;;;;mBAiGs8/pB,CAAC;iBAAwB,CAAC;;;;;;;;;mBAA1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;IAC7C,oGAAoG;IACpG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,eAAoB;;;;mBAiGg+lsB,CAAC;iBAAwB,CAAC;;;;;;;;;mBAA1B,CAAC;iBAAwB,CAAC;;;;;;;;;;uBAA1B,CAAC;qBAAwB,CAAC;;;;;;;;;;;;2BAA1B,CAAC;yBAAwB,CAAC;;;;;;;;EArFxjmsB;AAED,0FAA0F;AAC1F,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3E;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BnF;AA0BD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,cAAc,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAIhG;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,eAAe,EACrB,OAAO,GAAE,cAAmB,GAC3B,cAAc,CAAC,eAAe,GAAG,IAAI,EAAE,KAAK,CAAC,CAI/C"}
@@ -1,4 +1,6 @@
1
1
  import type { Client } from "./generated/client";
2
+ /** RFC 6455 Service Restart: sent when a server drains so clients hop silently to the new slot. */
3
+ export declare const SERVICE_RESTART_CLOSE_CODE = 1012;
2
4
  export interface ReconnectingSocketState {
3
5
  readonly connected: boolean;
4
6
  readonly reconnecting: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ws-socket.d.ts","sourceRoot":"","sources":["../src/ws-socket.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAQhD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,SAAS,EA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,OAAO,EAAE,OAAO,GAAG,OAAO,CAAA;IAC/B,4DAA4D;IAC5D,KAAK,IAAI,IAAI,CAAA;CACd;AAQD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,yBAAyB,GAAG,kBAAkB,CAoO/F;AA4CD,qGAAqG;AACrG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAO7E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/client",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Type-safe SDK for Sixb API with TanStack Query hooks",
5
5
  "keywords": [
6
6
  "sixb",
@@ -73,7 +73,7 @@
73
73
  "prepack": "bun run build"
74
74
  },
75
75
  "dependencies": {
76
- "@sixb/core": "^0.2.5"
76
+ "@sixb/core": "^0.2.7"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@tanstack/react-query": "^5.0.0",
@@ -3,6 +3,7 @@ import type {
3
3
  AgentApprovalActivityEvent,
4
4
  AgentComputerActivityEvent,
5
5
  AgentRunActivityEvent,
6
+ AgentRunStepsEvent,
6
7
  AgentRunStreamEvent,
7
8
  AgentThreadMovedEvent,
8
9
  } from "@sixb/core/agents/streams"
@@ -26,6 +27,8 @@ export type {
26
27
  AgentInboxReadMessage,
27
28
  AgentRunActivityEvent,
28
29
  AgentRunFailure,
30
+ AgentRunStepsEvent,
31
+ AgentRunStepsRead,
29
32
  AgentRunStreamEvent,
30
33
  AgentThreadMovedEvent,
31
34
  ModelUiChunk,
@@ -81,6 +84,8 @@ export type AgentRunStreamServerMessage =
81
84
  | { readonly type: "activity"; readonly event: AgentActivityEvent }
82
85
  | { readonly type: "error"; readonly message: string }
83
86
  | { readonly type: "run.snapshot"; readonly run: AgentRunSnapshot }
87
+ /** The turn's finished steps, sent before its live records to a reader who opens it late. */
88
+ | { readonly type: "run.steps"; readonly event: AgentRunStepsEvent }
84
89
  | { readonly type: "record"; readonly record: AgentRunStreamRecord }
85
90
 
86
91
  export function createSixbAgentsWebSocketUrl(baseUrl?: string): string {
@@ -96,6 +101,10 @@ export interface AgentRunSocketOptions {
96
101
  readonly baseUrl?: string
97
102
  /** The client whose API and credential the socket uses. Defaults to the package's shared client. */
98
103
  readonly client?: Client
104
+ /**
105
+ * Each event in order, with the cursor it was read at. The finished steps a late reader receives
106
+ * first come with the cursor before them: they are not a record of the stream.
107
+ */
99
108
  readonly onEvent: (event: AgentRunStreamEvent, cursor: string) => void
100
109
  readonly onRunSnapshot?: (run: AgentRunSnapshot) => void
101
110
  readonly onError?: (message: string) => void
@@ -157,6 +166,11 @@ export function createAgentRunSocket(options: AgentRunSocketOptions): Reconnecti
157
166
  return
158
167
  }
159
168
 
169
+ if (message.type === "run.steps") {
170
+ options.onEvent(message.event, latestCursor ?? "")
171
+ return
172
+ }
173
+
160
174
  if (message.type === "run.snapshot") {
161
175
  options.onRunSnapshot?.(message.run)
162
176
  return
@@ -227,6 +241,14 @@ export function parseAgentRunStreamServerMessage(
227
241
  return { type: "run.snapshot", run: parsed.run }
228
242
  }
229
243
 
244
+ if (
245
+ parsed.type === "run.steps" &&
246
+ isAgentRunStreamEvent(parsed.event) &&
247
+ parsed.event.type === "agent.ui.steps"
248
+ ) {
249
+ return { type: "run.steps", event: parsed.event }
250
+ }
251
+
230
252
  if (parsed.type === "error") {
231
253
  return { type: "error", message: String(parsed.message ?? "Agent stream error.") }
232
254
  }
@@ -3,9 +3,11 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"
3
3
  import { isSixbApiError } from "../api"
4
4
  import { useSixbProviderClient } from "../client-provider"
5
5
  import {
6
+ listConnectorConnectionSyncRunsOptions,
6
7
  listPendingConnectorConnectionRunsOptions,
7
8
  listPendingConnectorConnectionRunsQueryKey,
8
9
  } from "../generated/@tanstack/react-query.gen"
10
+ import type { ListConnectorConnectionSyncRunsResponse } from "../generated/types.gen"
9
11
  import {
10
12
  useConnectConnector,
11
13
  useDisconnectConnector,
@@ -24,6 +26,7 @@ import {
24
26
  const CONNECTOR_CALLBACK_CONNECTOR_PARAM = "connectionConnectorId"
25
27
  const CONNECTOR_CALLBACK_RUN_PARAM = "connectionRunId"
26
28
  const RUN_POLL_INTERVAL_MS = 1_000
29
+ const SYNC_POLL_INTERVAL_MS = 5_000
27
30
 
28
31
  interface ConnectorConnectionCallback {
29
32
  readonly connectorId: string
@@ -65,6 +68,17 @@ export interface ConnectorConnectionFailure {
65
68
  readonly cause: unknown
66
69
  }
67
70
 
71
+ /** How a connection's syncs last went, across every sync of its connector. */
72
+ export interface ConnectorConnectionSync {
73
+ /**
74
+ * `"syncing"` while a sync of the connection is queued or running, `"failed"` when a sync's latest
75
+ * run failed, and `"synced"` otherwise.
76
+ */
77
+ readonly status: "syncing" | "synced" | "failed"
78
+ /** When that run started, for `"syncing"`, or finished. ISO 8601. */
79
+ readonly at: string
80
+ }
81
+
68
82
  export interface ConnectorAccountSelectionOptions {
69
83
  readonly replace?: boolean
70
84
  }
@@ -78,6 +92,8 @@ export interface UseConnectorConnectionResult {
78
92
  readonly canConnect: boolean
79
93
  readonly isPending: boolean
80
94
  readonly selectedAccountId: string | undefined
95
+ /** How the connection's syncs last went. Undefined before its first sync. */
96
+ readonly sync: ConnectorConnectionSync | undefined
81
97
  connect(): Promise<void>
82
98
  selectAccount(accountId: string, options?: ConnectorAccountSelectionOptions): Promise<void>
83
99
  disconnect(): Promise<void>
@@ -145,6 +161,16 @@ export function useConnectorConnection({
145
161
  refetchInterval: (query) => (isRunInProgress(query.state.data) ? RUN_POLL_INTERVAL_MS : false),
146
162
  })
147
163
  const resumedRun = runQuery.data && fillsSlot(runQuery.data) ? runQuery.data : undefined
164
+ const syncRunsQuery = useQuery({
165
+ ...listConnectorConnectionSyncRunsOptions({
166
+ client: providerClient,
167
+ path: { connectorId, connectionId: connection?.id ?? "" },
168
+ }),
169
+ enabled: connection !== undefined,
170
+ // Polling only while a sync runs: its end is what the person is waiting to see.
171
+ refetchInterval: (query) =>
172
+ summarizeSync(query.state.data?.runs)?.status === "syncing" ? SYNC_POLL_INTERVAL_MS : false,
173
+ })
148
174
  const resolvedReturnTo = returnTo ?? connectorConnectionReturnTo()
149
175
 
150
176
  const connectMutation = useConnectConnector({
@@ -272,6 +298,7 @@ export function useConnectorConnection({
272
298
  }
273
299
  }
274
300
  await refreshConnectionsAndConsumeCallback(completedCallback)
301
+ if (connection) await syncRunsQuery.refetch()
275
302
  }
276
303
 
277
304
  function dismiss(): void {
@@ -329,6 +356,7 @@ export function useConnectorConnection({
329
356
  canConnect,
330
357
  isPending: status === "loading" || status === "authorizing" || mutationPending,
331
358
  selectedAccountId: selectMutation.variables?.accountId,
359
+ sync: connection ? summarizeSync(syncRunsQuery.data?.runs) : undefined,
332
360
  connect,
333
361
  selectAccount,
334
362
  disconnect,
@@ -339,6 +367,37 @@ export function useConnectorConnection({
339
367
  }
340
368
  }
341
369
 
370
+ type ConnectionSyncRun = ListConnectorConnectionSyncRunsResponse["runs"][number]
371
+
372
+ /** One status for every sync of a connection: running first, then any failure, then the last success. */
373
+ function summarizeSync(
374
+ runs: readonly ConnectionSyncRun[] | undefined
375
+ ): ConnectorConnectionSync | undefined {
376
+ const latest = (status: "syncing" | "synced" | "failed", matching: ConnectionSyncRun[]) => {
377
+ const at = matching
378
+ .map((run) => (status === "syncing" ? (run.startedAt ?? run.queuedAt) : run.finishedAt))
379
+ .filter((value): value is string => value !== undefined)
380
+ .sort()
381
+ .at(-1)
382
+ return at === undefined ? undefined : { status, at }
383
+ }
384
+ const all = runs ?? []
385
+ return (
386
+ latest(
387
+ "syncing",
388
+ all.filter((run) => run.status === "queued" || run.status === "running")
389
+ ) ??
390
+ latest(
391
+ "failed",
392
+ all.filter((run) => run.status === "failed")
393
+ ) ??
394
+ latest(
395
+ "synced",
396
+ all.filter((run) => run.status === "succeeded")
397
+ )
398
+ )
399
+ }
400
+
342
401
  export function isConnectorReplacementRequired(error: unknown): boolean {
343
402
  if (isSixbApiError(error)) return error.code === "connector.replacement_required"
344
403
  return (
@@ -3,6 +3,7 @@ export {
3
3
  type ConnectorConnectionFailure,
4
4
  type ConnectorConnectionOperation,
5
5
  type ConnectorConnectionStatus,
6
+ type ConnectorConnectionSync,
6
7
  isConnectorReplacementRequired,
7
8
  type UseConnectorConnectionOptions,
8
9
  type UseConnectorConnectionResult,
@@ -40,6 +40,7 @@ import {
40
40
  deleteArtifactStateValue,
41
41
  disableAuthServiceAccount,
42
42
  disconnectConnectorConnection,
43
+ editAgentThreadMessage,
43
44
  exchangeDeviceAuthorization,
44
45
  exchangeSharedAccess,
45
46
  existsObjects,
@@ -146,6 +147,8 @@ import {
146
147
  listAuthServiceAccountAccessTokens,
147
148
  listAuthServiceAccounts,
148
149
  listAuthSessions,
150
+ listConnectorAccounts,
151
+ listConnectorConnectionSyncRuns,
149
152
  listConnectorConnections,
150
153
  listConnectors,
151
154
  listDatasetRows,
@@ -174,6 +177,7 @@ import {
174
177
  listWorkflowInterventions,
175
178
  listWorkflowRuns,
176
179
  listWorkflows,
180
+ markAgentThreadRead,
177
181
  moveAgentThreadToCloud,
178
182
  moveAgentThreadToComputer,
179
183
  type Options,
@@ -317,6 +321,9 @@ import type {
317
321
  DisconnectConnectorConnectionData,
318
322
  DisconnectConnectorConnectionError,
319
323
  DisconnectConnectorConnectionResponse,
324
+ EditAgentThreadMessageData,
325
+ EditAgentThreadMessageError,
326
+ EditAgentThreadMessageResponse,
320
327
  ExchangeDeviceAuthorizationData,
321
328
  ExchangeDeviceAuthorizationResponse,
322
329
  ExchangeSharedAccessData,
@@ -630,6 +637,10 @@ import type {
630
637
  ListAuthSessionsData,
631
638
  ListAuthSessionsError,
632
639
  ListAuthSessionsResponse,
640
+ ListConnectorAccountsData,
641
+ ListConnectorAccountsResponse,
642
+ ListConnectorConnectionSyncRunsData,
643
+ ListConnectorConnectionSyncRunsResponse,
633
644
  ListConnectorConnectionsData,
634
645
  ListConnectorConnectionsError,
635
646
  ListConnectorConnectionsResponse,
@@ -706,6 +717,9 @@ import type {
706
717
  ListWorkflowRunsResponse,
707
718
  ListWorkflowsData,
708
719
  ListWorkflowsResponse,
720
+ MarkAgentThreadReadData,
721
+ MarkAgentThreadReadError,
722
+ MarkAgentThreadReadResponse,
709
723
  MoveAgentThreadToCloudData,
710
724
  MoveAgentThreadToCloudError,
711
725
  MoveAgentThreadToCloudResponse,
@@ -2846,6 +2860,63 @@ export const getSyncOptions = (options: Options<GetSyncData>) =>
2846
2860
  queryKey: getSyncQueryKey(options),
2847
2861
  })
2848
2862
 
2863
+ export const listConnectorAccountsQueryKey = (options: Options<ListConnectorAccountsData>) =>
2864
+ createQueryKey("listConnectorAccounts", options)
2865
+
2866
+ /**
2867
+ * List a connector's accounts and how they synced
2868
+ *
2869
+ * 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.
2870
+ */
2871
+ export const listConnectorAccountsOptions = (options: Options<ListConnectorAccountsData>) =>
2872
+ queryOptions<
2873
+ ListConnectorAccountsResponse,
2874
+ DefaultError,
2875
+ ListConnectorAccountsResponse,
2876
+ ReturnType<typeof listConnectorAccountsQueryKey>
2877
+ >({
2878
+ queryFn: async ({ queryKey, signal }) => {
2879
+ const { data } = await listConnectorAccounts({
2880
+ ...options,
2881
+ ...queryKey[0],
2882
+ signal,
2883
+ throwOnError: true,
2884
+ })
2885
+ return data
2886
+ },
2887
+ queryKey: listConnectorAccountsQueryKey(options),
2888
+ })
2889
+
2890
+ export const listConnectorConnectionSyncRunsQueryKey = (
2891
+ options: Options<ListConnectorConnectionSyncRunsData>
2892
+ ) => createQueryKey("listConnectorConnectionSyncRuns", options)
2893
+
2894
+ /**
2895
+ * Latest sync runs of a connection
2896
+ *
2897
+ * 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.
2898
+ */
2899
+ export const listConnectorConnectionSyncRunsOptions = (
2900
+ options: Options<ListConnectorConnectionSyncRunsData>
2901
+ ) =>
2902
+ queryOptions<
2903
+ ListConnectorConnectionSyncRunsResponse,
2904
+ DefaultError,
2905
+ ListConnectorConnectionSyncRunsResponse,
2906
+ ReturnType<typeof listConnectorConnectionSyncRunsQueryKey>
2907
+ >({
2908
+ queryFn: async ({ queryKey, signal }) => {
2909
+ const { data } = await listConnectorConnectionSyncRuns({
2910
+ ...options,
2911
+ ...queryKey[0],
2912
+ signal,
2913
+ throwOnError: true,
2914
+ })
2915
+ return data
2916
+ },
2917
+ queryKey: listConnectorConnectionSyncRunsQueryKey(options),
2918
+ })
2919
+
2849
2920
  export const listSyncRunsQueryKey = (options?: Options<ListSyncRunsData>) =>
2850
2921
  createQueryKey("listSyncRuns", options)
2851
2922
 
@@ -5098,6 +5169,35 @@ export const updateAgentThreadInboxItemMutation = (
5098
5169
  return mutationOptions
5099
5170
  }
5100
5171
 
5172
+ /**
5173
+ * Edit an agent thread message and restart from that turn
5174
+ *
5175
+ * 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.
5176
+ */
5177
+ export const editAgentThreadMessageMutation = (
5178
+ options?: Partial<Options<EditAgentThreadMessageData>>
5179
+ ): UseMutationOptions<
5180
+ EditAgentThreadMessageResponse,
5181
+ EditAgentThreadMessageError,
5182
+ Options<EditAgentThreadMessageData>
5183
+ > => {
5184
+ const mutationOptions: UseMutationOptions<
5185
+ EditAgentThreadMessageResponse,
5186
+ EditAgentThreadMessageError,
5187
+ Options<EditAgentThreadMessageData>
5188
+ > = {
5189
+ mutationFn: async (fnOptions) => {
5190
+ const { data } = await editAgentThreadMessage({
5191
+ ...options,
5192
+ ...fnOptions,
5193
+ throwOnError: true,
5194
+ })
5195
+ return data
5196
+ },
5197
+ }
5198
+ return mutationOptions
5199
+ }
5200
+
5101
5201
  /**
5102
5202
  * Cancel an agent thread's active run
5103
5203
  *
@@ -5301,6 +5401,35 @@ export const cancelAgentRunByIdMutation = (
5301
5401
  return mutationOptions
5302
5402
  }
5303
5403
 
5404
+ /**
5405
+ * Mark how far you have read an Agent thread
5406
+ *
5407
+ * 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.
5408
+ */
5409
+ export const markAgentThreadReadMutation = (
5410
+ options?: Partial<Options<MarkAgentThreadReadData>>
5411
+ ): UseMutationOptions<
5412
+ MarkAgentThreadReadResponse,
5413
+ MarkAgentThreadReadError,
5414
+ Options<MarkAgentThreadReadData>
5415
+ > => {
5416
+ const mutationOptions: UseMutationOptions<
5417
+ MarkAgentThreadReadResponse,
5418
+ MarkAgentThreadReadError,
5419
+ Options<MarkAgentThreadReadData>
5420
+ > = {
5421
+ mutationFn: async (fnOptions) => {
5422
+ const { data } = await markAgentThreadRead({
5423
+ ...options,
5424
+ ...fnOptions,
5425
+ throwOnError: true,
5426
+ })
5427
+ return data
5428
+ },
5429
+ }
5430
+ return mutationOptions
5431
+ }
5432
+
5304
5433
  export const listAgentThreadChildrenQueryKey = (options: Options<ListAgentThreadChildrenData>) =>
5305
5434
  createQueryKey("listAgentThreadChildren", options)
5306
5435
 
@@ -5385,7 +5514,7 @@ export const listAgentComputersOptions = (options?: Options<ListAgentComputersDa
5385
5514
  /**
5386
5515
  * Move a thread from your computer to the cloud
5387
5516
  *
5388
- * 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.
5517
+ * 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.
5389
5518
  */
5390
5519
  export const moveAgentThreadToCloudMutation = (
5391
5520
  options?: Partial<Options<MoveAgentThreadToCloudData>>
@@ -5414,7 +5543,7 @@ export const moveAgentThreadToCloudMutation = (
5414
5543
  /**
5415
5544
  * Move a thread to one of your computers, in a folder there
5416
5545
  *
5417
- * 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.
5546
+ * 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.
5418
5547
  */
5419
5548
  export const moveAgentThreadToComputerMutation = (
5420
5549
  options?: Partial<Options<MoveAgentThreadToComputerData>>