@sixb/client 0.1.12 → 0.1.13

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 (98) hide show
  1. package/dist/agent-streams.d.ts +7 -2
  2. package/dist/agent-streams.d.ts.map +1 -1
  3. package/dist/api.d.ts +8 -1
  4. package/dist/api.d.ts.map +1 -1
  5. package/dist/base-url.d.ts +2 -0
  6. package/dist/base-url.d.ts.map +1 -0
  7. package/dist/browser.js +7 -7
  8. package/dist/browser.js.map +3 -3
  9. package/dist/{chunk-sjb188se.js → chunk-1d0xnr6p.js} +38 -7
  10. package/dist/chunk-1d0xnr6p.js.map +10 -0
  11. package/dist/{chunk-bsy1hg20.js → chunk-50rkzhcy.js} +23 -30
  12. package/dist/chunk-50rkzhcy.js.map +10 -0
  13. package/dist/{chunk-hx3n4fer.js → chunk-6k1hzwk1.js} +13 -11
  14. package/dist/chunk-6k1hzwk1.js.map +17 -0
  15. package/dist/{chunk-e8qjsvha.js → chunk-hdgztpzs.js} +364 -71
  16. package/dist/chunk-hdgztpzs.js.map +19 -0
  17. package/dist/{chunk-tyym13kq.js → chunk-jh4ts8mt.js} +3 -1
  18. package/dist/chunk-jh4ts8mt.js.map +10 -0
  19. package/dist/{chunk-kh20z2mt.js → chunk-nkx0fxxn.js} +2 -2
  20. package/dist/chunk-nkx0fxxn.js.map +10 -0
  21. package/dist/{chunk-t50n91tk.js → chunk-tgyh8wz9.js} +7 -6
  22. package/dist/chunk-tgyh8wz9.js.map +12 -0
  23. package/dist/chunk-ys86w6hc.js +277 -0
  24. package/dist/chunk-ys86w6hc.js.map +12 -0
  25. package/dist/client-authority.d.ts +4 -0
  26. package/dist/client-authority.d.ts.map +1 -1
  27. package/dist/connectors/queries.d.ts.map +1 -1
  28. package/dist/events-builder.d.ts +2 -2
  29. package/dist/events-builder.d.ts.map +1 -1
  30. package/dist/events-transport.d.ts +4 -1
  31. package/dist/events-transport.d.ts.map +1 -1
  32. package/dist/generated/@tanstack/react-query.gen.d.ts +1019 -365
  33. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  34. package/dist/generated/index.d.ts +2 -2
  35. package/dist/generated/index.d.ts.map +1 -1
  36. package/dist/generated/sdk.gen.d.ts +5 -1
  37. package/dist/generated/sdk.gen.d.ts.map +1 -1
  38. package/dist/generated/types.gen.d.ts +332 -79
  39. package/dist/generated/types.gen.d.ts.map +1 -1
  40. package/dist/hooks.js +29 -12
  41. package/dist/hooks.js.map +6 -6
  42. package/dist/index.d.ts +2 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +21 -10
  45. package/dist/index.js.map +1 -1
  46. package/dist/logs-builder.d.ts +1 -1
  47. package/dist/logs-builder.d.ts.map +1 -1
  48. package/dist/logs-transport.d.ts +4 -1
  49. package/dist/logs-transport.d.ts.map +1 -1
  50. package/dist/logs.js +4 -4
  51. package/dist/models.d.ts +2 -1
  52. package/dist/models.d.ts.map +1 -1
  53. package/dist/models.js +5 -3
  54. package/dist/models.js.map +1 -1
  55. package/dist/query-hooks.d.ts +3 -21
  56. package/dist/query-hooks.d.ts.map +1 -1
  57. package/dist/query.d.ts +2 -4
  58. package/dist/query.d.ts.map +1 -1
  59. package/dist/query.js +4 -4
  60. package/dist/session.d.ts +56 -0
  61. package/dist/session.d.ts.map +1 -0
  62. package/dist/useAgentActivityStream.d.ts +3 -0
  63. package/dist/useAgentActivityStream.d.ts.map +1 -1
  64. package/dist/useAgentRunStream.d.ts +4 -1
  65. package/dist/useAgentRunStream.d.ts.map +1 -1
  66. package/dist/ws-socket.d.ts +3 -0
  67. package/dist/ws-socket.d.ts.map +1 -1
  68. package/package.json +2 -2
  69. package/src/agent-streams.ts +11 -4
  70. package/src/api.ts +37 -32
  71. package/src/base-url.ts +30 -0
  72. package/src/browser.ts +1 -1
  73. package/src/client-authority.ts +19 -0
  74. package/src/events-builder.ts +5 -9
  75. package/src/events-transport.ts +6 -2
  76. package/src/generated/@tanstack/react-query.gen.ts +31 -0
  77. package/src/generated/index.ts +6 -0
  78. package/src/generated/sdk.gen.ts +376 -69
  79. package/src/generated/types.gen.ts +429 -75
  80. package/src/index.ts +13 -1
  81. package/src/logs-builder.ts +2 -2
  82. package/src/logs-transport.ts +6 -2
  83. package/src/models.ts +4 -2
  84. package/src/query-hooks.ts +2 -17
  85. package/src/query.ts +6 -11
  86. package/src/session.ts +316 -0
  87. package/src/useAgentActivityStream.ts +6 -2
  88. package/src/useAgentRunStream.ts +7 -3
  89. package/src/ws-socket.ts +62 -5
  90. package/dist/chunk-65zz479s.js +0 -23
  91. package/dist/chunk-65zz479s.js.map +0 -10
  92. package/dist/chunk-bsy1hg20.js.map +0 -10
  93. package/dist/chunk-e8qjsvha.js.map +0 -19
  94. package/dist/chunk-hx3n4fer.js.map +0 -17
  95. package/dist/chunk-kh20z2mt.js.map +0 -10
  96. package/dist/chunk-sjb188se.js.map +0 -10
  97. package/dist/chunk-t50n91tk.js.map +0 -12
  98. package/dist/chunk-tyym13kq.js.map +0 -10
package/dist/hooks.js CHANGED
@@ -3,6 +3,7 @@ import {
3
3
  client2,
4
4
  createDeviceAuthorization2,
5
5
  exchangeDeviceAuthorization2,
6
+ refreshAuthSession2,
6
7
  getAuthSession2,
7
8
  signOut2,
8
9
  listAuthSessions2,
@@ -135,15 +136,15 @@ import {
135
136
  listProjectionRuns2,
136
137
  getProjectionRun2,
137
138
  listWebhookRuns2
138
- } from "./chunk-e8qjsvha.js";
139
+ } from "./chunk-hdgztpzs.js";
139
140
  import {
140
141
  encodeObjectId2,
141
142
  decodeObjectId2,
142
143
  toObjectSummary2,
143
144
  toObjectDetail2,
144
145
  toTelemetryHistoryWithRange2
145
- } from "./chunk-tyym13kq.js";
146
- import"./chunk-65zz479s.js";
146
+ } from "./chunk-jh4ts8mt.js";
147
+ import"./chunk-ys86w6hc.js";
147
148
  import {
148
149
  createSixbAgentsWebSocketUrl2,
149
150
  createAgentRunSocket2,
@@ -163,14 +164,14 @@ import {
163
164
  ActionRunFailedError2,
164
165
  requestActionAndWait2,
165
166
  uploadFile2
166
- } from "./chunk-hx3n4fer.js";
167
+ } from "./chunk-6k1hzwk1.js";
167
168
  import {
168
169
  isSixbApiError2
169
- } from "./chunk-bsy1hg20.js";
170
+ } from "./chunk-50rkzhcy.js";
170
171
  import {
171
172
  createHttpQueryExecutor2
172
- } from "./chunk-kh20z2mt.js";
173
- import"./chunk-sjb188se.js";
173
+ } from "./chunk-nkx0fxxn.js";
174
+ import"./chunk-1d0xnr6p.js";
174
175
  import"./chunk-0ka9ykez.js";
175
176
 
176
177
  // src/hooks.ts
@@ -220,6 +221,19 @@ var exchangeDeviceAuthorizationMutation = (options) => {
220
221
  };
221
222
  return mutationOptions;
222
223
  };
224
+ var refreshAuthSessionMutation = (options) => {
225
+ const mutationOptions = {
226
+ mutationFn: async (fnOptions) => {
227
+ const { data } = await refreshAuthSession2({
228
+ ...options,
229
+ ...fnOptions,
230
+ throwOnError: true
231
+ });
232
+ return data;
233
+ }
234
+ };
235
+ return mutationOptions;
236
+ };
223
237
  var createQueryKey = (id, options, infinite, tags) => {
224
238
  const params = {
225
239
  _id: id,
@@ -3675,7 +3689,7 @@ function useObjectsInfinite(query, options) {
3675
3689
  import { useEffect as useEffect5, useRef as useRef4, useState as useState4 } from "react";
3676
3690
  var DISCONNECTED4 = { connected: false, reconnecting: false, error: null };
3677
3691
  function useAgentActivityStream(options) {
3678
- const { enabled = true, reconnect, reconnectDelayMs } = options;
3692
+ const { enabled = true, reconnect, reconnectDelayMs, client } = options;
3679
3693
  const onActivityRef = useRef4(options.onActivity);
3680
3694
  onActivityRef.current = options.onActivity;
3681
3695
  const onSubscribedRef = useRef4(options.onSubscribed);
@@ -3691,20 +3705,21 @@ function useAgentActivityStream(options) {
3691
3705
  const socket = createAgentActivitySocket2({
3692
3706
  reconnect,
3693
3707
  reconnectDelayMs,
3708
+ client,
3694
3709
  onActivity: (event) => onActivityRef.current?.(event),
3695
3710
  onSubscribed: () => onSubscribedRef.current?.(),
3696
3711
  onError: (message) => onErrorRef.current?.(message),
3697
3712
  onStateChange: setState
3698
3713
  });
3699
3714
  return () => socket.close();
3700
- }, [enabled, reconnect, reconnectDelayMs]);
3715
+ }, [enabled, reconnect, reconnectDelayMs, client]);
3701
3716
  return state;
3702
3717
  }
3703
3718
  // src/useAgentRunStream.ts
3704
3719
  import { useEffect as useEffect6, useRef as useRef5, useState as useState5 } from "react";
3705
3720
  var DISCONNECTED5 = { connected: false, reconnecting: false, error: null };
3706
3721
  function useAgentRunStream(options) {
3707
- const { runId, afterCursor, enabled = true, reconnect, reconnectDelayMs } = options;
3722
+ const { runId, afterCursor, enabled = true, reconnect, reconnectDelayMs, client } = options;
3708
3723
  const onEventRef = useRef5(options.onEvent);
3709
3724
  onEventRef.current = options.onEvent;
3710
3725
  const onSnapshotRef = useRef5(options.onRunSnapshot);
@@ -3722,13 +3737,14 @@ function useAgentRunStream(options) {
3722
3737
  ...afterCursor ? { afterCursor } : {},
3723
3738
  reconnect,
3724
3739
  reconnectDelayMs,
3740
+ client,
3725
3741
  onEvent: (event, cursor) => onEventRef.current?.(event, cursor),
3726
3742
  onRunSnapshot: (run) => onSnapshotRef.current?.(run),
3727
3743
  onError: (message) => onErrorRef.current?.(message),
3728
3744
  onStateChange: setState
3729
3745
  });
3730
3746
  return () => socket.close();
3731
- }, [enabled, runId, afterCursor, reconnect, reconnectDelayMs]);
3747
+ }, [enabled, runId, afterCursor, reconnect, reconnectDelayMs, client]);
3732
3748
  return state;
3733
3749
  }
3734
3750
 
@@ -4286,6 +4302,7 @@ export {
4286
4302
  reauthorizeConnectorConnectionMutation,
4287
4303
  reauthorizeConnectorMutationOptions,
4288
4304
  recreateAgentThreadSandboxMutation,
4305
+ refreshAuthSessionMutation,
4289
4306
  removeObjectLinkMutation,
4290
4307
  requestActionMutation,
4291
4308
  requestPipelineRunMutation,
@@ -4348,4 +4365,4 @@ export {
4348
4365
  useUploadFile
4349
4366
  };
4350
4367
 
4351
- //# debugId=D95528493871918564756E2164756E21
4368
+ //# debugId=576D64CB4049339C64756E2164756E21