@sixb/client 0.1.11 → 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-y4g6jrvs.js → chunk-1d0xnr6p.js} +38 -7
  10. package/dist/chunk-1d0xnr6p.js.map +10 -0
  11. package/dist/{chunk-f4qeqxz2.js → chunk-50rkzhcy.js} +23 -30
  12. package/dist/chunk-50rkzhcy.js.map +10 -0
  13. package/dist/{chunk-65mmaq7r.js → chunk-6k1hzwk1.js} +13 -11
  14. package/dist/chunk-6k1hzwk1.js.map +17 -0
  15. package/dist/{chunk-7bv57jcq.js → chunk-hdgztpzs.js} +372 -70
  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-qaacaq2e.js → chunk-nkx0fxxn.js} +6 -4
  20. package/dist/chunk-nkx0fxxn.js.map +10 -0
  21. package/dist/{chunk-65bdf9vw.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 +1555 -366
  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 +9 -1
  37. package/dist/generated/sdk.gen.d.ts.map +1 -1
  38. package/dist/generated/types.gen.d.ts +594 -91
  39. package/dist/generated/types.gen.d.ts.map +1 -1
  40. package/dist/hooks.js +44 -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 +23 -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 +7 -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 +62 -0
  77. package/src/generated/index.ts +13 -0
  78. package/src/generated/sdk.gen.ts +398 -68
  79. package/src/generated/types.gen.ts +735 -87
  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 +9 -12
  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-65bdf9vw.js.map +0 -12
  91. package/dist/chunk-65mmaq7r.js.map +0 -17
  92. package/dist/chunk-65zz479s.js +0 -23
  93. package/dist/chunk-65zz479s.js.map +0 -10
  94. package/dist/chunk-7bv57jcq.js.map +0 -19
  95. package/dist/chunk-f4qeqxz2.js.map +0 -10
  96. package/dist/chunk-qaacaq2e.js.map +0 -10
  97. package/dist/chunk-tyym13kq.js.map +0 -10
  98. package/dist/chunk-y4g6jrvs.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,
@@ -113,6 +114,7 @@ import {
113
114
  listAgentThreads2,
114
115
  createAgentThread2,
115
116
  getAgentThread2,
117
+ recreateAgentThreadSandbox2,
116
118
  listAgentThreadMessages2,
117
119
  postAgentThreadMessage2,
118
120
  getAgentMessageFileContent2,
@@ -134,15 +136,15 @@ import {
134
136
  listProjectionRuns2,
135
137
  getProjectionRun2,
136
138
  listWebhookRuns2
137
- } from "./chunk-7bv57jcq.js";
139
+ } from "./chunk-hdgztpzs.js";
138
140
  import {
139
141
  encodeObjectId2,
140
142
  decodeObjectId2,
141
143
  toObjectSummary2,
142
144
  toObjectDetail2,
143
145
  toTelemetryHistoryWithRange2
144
- } from "./chunk-tyym13kq.js";
145
- import"./chunk-65zz479s.js";
146
+ } from "./chunk-jh4ts8mt.js";
147
+ import"./chunk-ys86w6hc.js";
146
148
  import {
147
149
  createSixbAgentsWebSocketUrl2,
148
150
  createAgentRunSocket2,
@@ -162,14 +164,14 @@ import {
162
164
  ActionRunFailedError2,
163
165
  requestActionAndWait2,
164
166
  uploadFile2
165
- } from "./chunk-65mmaq7r.js";
167
+ } from "./chunk-6k1hzwk1.js";
166
168
  import {
167
169
  isSixbApiError2
168
- } from "./chunk-f4qeqxz2.js";
170
+ } from "./chunk-50rkzhcy.js";
169
171
  import {
170
172
  createHttpQueryExecutor2
171
- } from "./chunk-qaacaq2e.js";
172
- import"./chunk-y4g6jrvs.js";
173
+ } from "./chunk-nkx0fxxn.js";
174
+ import"./chunk-1d0xnr6p.js";
173
175
  import"./chunk-0ka9ykez.js";
174
176
 
175
177
  // src/hooks.ts
@@ -219,6 +221,19 @@ var exchangeDeviceAuthorizationMutation = (options) => {
219
221
  };
220
222
  return mutationOptions;
221
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
+ };
222
237
  var createQueryKey = (id, options, infinite, tags) => {
223
238
  const params = {
224
239
  _id: id,
@@ -1923,6 +1938,19 @@ var getAgentThreadOptions = (options) => queryOptions({
1923
1938
  },
1924
1939
  queryKey: getAgentThreadQueryKey(options)
1925
1940
  });
1941
+ var recreateAgentThreadSandboxMutation = (options) => {
1942
+ const mutationOptions = {
1943
+ mutationFn: async (fnOptions) => {
1944
+ const { data } = await recreateAgentThreadSandbox2({
1945
+ ...options,
1946
+ ...fnOptions,
1947
+ throwOnError: true
1948
+ });
1949
+ return data;
1950
+ }
1951
+ };
1952
+ return mutationOptions;
1953
+ };
1926
1954
  var listAgentThreadMessagesQueryKey = (options) => createQueryKey("listAgentThreadMessages", options);
1927
1955
  var listAgentThreadMessagesOptions = (options) => queryOptions({
1928
1956
  queryFn: async ({ queryKey, signal }) => {
@@ -3661,7 +3689,7 @@ function useObjectsInfinite(query, options) {
3661
3689
  import { useEffect as useEffect5, useRef as useRef4, useState as useState4 } from "react";
3662
3690
  var DISCONNECTED4 = { connected: false, reconnecting: false, error: null };
3663
3691
  function useAgentActivityStream(options) {
3664
- const { enabled = true, reconnect, reconnectDelayMs } = options;
3692
+ const { enabled = true, reconnect, reconnectDelayMs, client } = options;
3665
3693
  const onActivityRef = useRef4(options.onActivity);
3666
3694
  onActivityRef.current = options.onActivity;
3667
3695
  const onSubscribedRef = useRef4(options.onSubscribed);
@@ -3677,20 +3705,21 @@ function useAgentActivityStream(options) {
3677
3705
  const socket = createAgentActivitySocket2({
3678
3706
  reconnect,
3679
3707
  reconnectDelayMs,
3708
+ client,
3680
3709
  onActivity: (event) => onActivityRef.current?.(event),
3681
3710
  onSubscribed: () => onSubscribedRef.current?.(),
3682
3711
  onError: (message) => onErrorRef.current?.(message),
3683
3712
  onStateChange: setState
3684
3713
  });
3685
3714
  return () => socket.close();
3686
- }, [enabled, reconnect, reconnectDelayMs]);
3715
+ }, [enabled, reconnect, reconnectDelayMs, client]);
3687
3716
  return state;
3688
3717
  }
3689
3718
  // src/useAgentRunStream.ts
3690
3719
  import { useEffect as useEffect6, useRef as useRef5, useState as useState5 } from "react";
3691
3720
  var DISCONNECTED5 = { connected: false, reconnecting: false, error: null };
3692
3721
  function useAgentRunStream(options) {
3693
- const { runId, afterCursor, enabled = true, reconnect, reconnectDelayMs } = options;
3722
+ const { runId, afterCursor, enabled = true, reconnect, reconnectDelayMs, client } = options;
3694
3723
  const onEventRef = useRef5(options.onEvent);
3695
3724
  onEventRef.current = options.onEvent;
3696
3725
  const onSnapshotRef = useRef5(options.onRunSnapshot);
@@ -3708,13 +3737,14 @@ function useAgentRunStream(options) {
3708
3737
  ...afterCursor ? { afterCursor } : {},
3709
3738
  reconnect,
3710
3739
  reconnectDelayMs,
3740
+ client,
3711
3741
  onEvent: (event, cursor) => onEventRef.current?.(event, cursor),
3712
3742
  onRunSnapshot: (run) => onSnapshotRef.current?.(run),
3713
3743
  onError: (message) => onErrorRef.current?.(message),
3714
3744
  onStateChange: setState
3715
3745
  });
3716
3746
  return () => socket.close();
3717
- }, [enabled, runId, afterCursor, reconnect, reconnectDelayMs]);
3747
+ }, [enabled, runId, afterCursor, reconnect, reconnectDelayMs, client]);
3718
3748
  return state;
3719
3749
  }
3720
3750
 
@@ -4271,6 +4301,8 @@ export {
4271
4301
  reactivateAuthMemberMutation,
4272
4302
  reauthorizeConnectorConnectionMutation,
4273
4303
  reauthorizeConnectorMutationOptions,
4304
+ recreateAgentThreadSandboxMutation,
4305
+ refreshAuthSessionMutation,
4274
4306
  removeObjectLinkMutation,
4275
4307
  requestActionMutation,
4276
4308
  requestPipelineRunMutation,
@@ -4333,4 +4365,4 @@ export {
4333
4365
  useUploadFile
4334
4366
  };
4335
4367
 
4336
- //# debugId=564A0EF1B391298564756E2164756E21
4368
+ //# debugId=576D64CB4049339C64756E2164756E21