@sixb/client 0.1.6 → 0.1.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 (41) hide show
  1. package/README.md +25 -0
  2. package/dist/browser.js +2 -2
  3. package/dist/{chunk-9bwme2g7.js → chunk-b3bfdm80.js} +1 -1
  4. package/dist/{chunk-hwg7mwq7.js → chunk-dcebhkmz.js} +25 -6
  5. package/dist/{chunk-hwg7mwq7.js.map → chunk-dcebhkmz.js.map} +4 -4
  6. package/dist/{chunk-g19v53kt.js → chunk-h80qj1f8.js} +1 -1
  7. package/dist/{chunk-5y58b4tr.js → chunk-m4by7m5r.js} +2 -2
  8. package/dist/{chunk-ks27bq5b.js → chunk-p0xrjaz6.js} +2 -2
  9. package/dist/{chunk-ehjnq01h.js → chunk-r8p88mbg.js} +78 -9
  10. package/dist/chunk-r8p88mbg.js.map +19 -0
  11. package/dist/connectors/queries.d.ts.map +1 -1
  12. package/dist/file.d.ts +11 -0
  13. package/dist/file.d.ts.map +1 -1
  14. package/dist/generated/@tanstack/react-query.gen.d.ts +2407 -367
  15. package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
  16. package/dist/generated/index.d.ts +2 -2
  17. package/dist/generated/index.d.ts.map +1 -1
  18. package/dist/generated/sdk.gen.d.ts +41 -7
  19. package/dist/generated/sdk.gen.d.ts.map +1 -1
  20. package/dist/generated/types.gen.d.ts +975 -172
  21. package/dist/generated/types.gen.d.ts.map +1 -1
  22. package/dist/hooks.js +166 -22
  23. package/dist/hooks.js.map +3 -3
  24. package/dist/index.js +26 -8
  25. package/dist/index.js.map +1 -1
  26. package/dist/logs.js +3 -3
  27. package/dist/models.js +20 -4
  28. package/dist/models.js.map +1 -1
  29. package/dist/query.js +3 -3
  30. package/package.json +2 -2
  31. package/src/agent-streams.ts +0 -1
  32. package/src/file.ts +36 -0
  33. package/src/generated/@tanstack/react-query.gen.ts +320 -31
  34. package/src/generated/index.ts +52 -4
  35. package/src/generated/sdk.gen.ts +197 -18
  36. package/src/generated/types.gen.ts +1266 -146
  37. package/dist/chunk-ehjnq01h.js.map +0 -19
  38. /package/dist/{chunk-9bwme2g7.js.map → chunk-b3bfdm80.js.map} +0 -0
  39. /package/dist/{chunk-g19v53kt.js.map → chunk-h80qj1f8.js.map} +0 -0
  40. /package/dist/{chunk-5y58b4tr.js.map → chunk-m4by7m5r.js.map} +0 -0
  41. /package/dist/{chunk-ks27bq5b.js.map → chunk-p0xrjaz6.js.map} +0 -0
package/dist/index.js CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  isSixbEvent,
15
15
  isTerminalActionRun,
16
16
  matchesSubscription,
17
+ objectFileContentUrl,
17
18
  objectIdAliases,
18
19
  parseAgentRunStreamServerMessage,
19
20
  parseEventStreamMessage,
@@ -22,7 +23,7 @@ import {
22
23
  telemetryUpdateKey,
23
24
  uploadFile,
24
25
  waitForActionRun
25
- } from "./chunk-hwg7mwq7.js";
26
+ } from "./chunk-dcebhkmz.js";
26
27
  import {
27
28
  createLogSocket,
28
29
  createSixbLogsWebSocketUrl,
@@ -30,8 +31,8 @@ import {
30
31
  isStoredLogLine1 as isStoredLogLine2,
31
32
  logs,
32
33
  parseLogStreamMessage
33
- } from "./chunk-5y58b4tr.js";
34
- import"./chunk-g19v53kt.js";
34
+ } from "./chunk-m4by7m5r.js";
35
+ import"./chunk-h80qj1f8.js";
35
36
  import {
36
37
  decodeObjectId,
37
38
  encodeObjectId,
@@ -50,7 +51,7 @@ import {
50
51
  createSixbClientConfig,
51
52
  isSixbApiError,
52
53
  normalizeSixbApiBaseUrl
53
- } from "./chunk-9bwme2g7.js";
54
+ } from "./chunk-b3bfdm80.js";
54
55
  import {
55
56
  abortFileUpload,
56
57
  addConnectorConnection,
@@ -62,13 +63,17 @@ import {
62
63
  completeFileUpload,
63
64
  countObjects,
64
65
  createAgentThread,
66
+ createAiLimitPolicy,
65
67
  createAuthInvitation,
66
68
  createAuthPersonalAccessToken,
67
69
  createAuthServiceAccount,
68
70
  createAuthServiceAccountAccessToken,
71
+ createDeviceAuthorization,
69
72
  createFileUpload,
73
+ deleteAiLimitPolicy,
70
74
  disableAuthServiceAccount,
71
75
  disconnectConnectorConnection,
76
+ exchangeDeviceAuthorization,
72
77
  existsObjects,
73
78
  facetObjects,
74
79
  getAction,
@@ -79,6 +84,8 @@ import {
79
84
  getAgentRun,
80
85
  getAgentThread,
81
86
  getAiAccountingOverview,
87
+ getAiLimitStatus,
88
+ getAiLimitSubjectOptions,
82
89
  getAuthAccessManagementOptions,
83
90
  getAuthInvitationOptions,
84
91
  getAuthMembershipOptions,
@@ -117,7 +124,8 @@ import {
117
124
  listAgentThreadMessages,
118
125
  listAgentThreadRuns,
119
126
  listAgentThreads,
120
- listAgents,
127
+ listAiLimitPolicies,
128
+ listAiModelCallGroups,
121
129
  listAiModelCalls,
122
130
  listAuthAccessTokens,
123
131
  listAuthInvitations,
@@ -171,12 +179,13 @@ import {
171
179
  startConnectorConnectionRun,
172
180
  submitWorkflowIntervention,
173
181
  suspendAuthMember,
182
+ updateAiLimitPolicy,
174
183
  updateAuthMemberGroups,
175
184
  uploadFileContent,
176
185
  uploadFileRaw,
177
186
  upsertObject,
178
187
  upsertObjectLink
179
- } from "./chunk-ehjnq01h.js";
188
+ } from "./chunk-r8p88mbg.js";
180
189
  export {
181
190
  waitForActionRun,
182
191
  upsertObjectLink,
@@ -185,6 +194,7 @@ export {
185
194
  uploadFileContent,
186
195
  uploadFile,
187
196
  updateAuthMemberGroups,
197
+ updateAiLimitPolicy,
188
198
  toTelemetryHistoryWithRange,
189
199
  toProjectInfo,
190
200
  toObjectSummary,
@@ -220,6 +230,7 @@ export {
220
230
  parseEventStreamMessage,
221
231
  parseAgentRunStreamServerMessage,
222
232
  objectIdAliases,
233
+ objectFileContentUrl,
223
234
  normalizeSixbApiBaseUrl,
224
235
  matchesSubscription,
225
236
  logs,
@@ -252,7 +263,8 @@ export {
252
263
  listAuthInvitations,
253
264
  listAuthAccessTokens,
254
265
  listAiModelCalls,
255
- listAgents,
266
+ listAiModelCallGroups,
267
+ listAiLimitPolicies,
256
268
  listAgentThreads,
257
269
  listAgentThreadRuns,
258
270
  listAgentThreadMessages,
@@ -296,6 +308,8 @@ export {
296
308
  getAuthMembershipOptions,
297
309
  getAuthInvitationOptions,
298
310
  getAuthAccessManagementOptions,
311
+ getAiLimitSubjectOptions,
312
+ getAiLimitStatus,
299
313
  getAiAccountingOverview,
300
314
  getAgentThread,
301
315
  getAgentRun,
@@ -306,10 +320,12 @@ export {
306
320
  getAction,
307
321
  facetObjects,
308
322
  existsObjects,
323
+ exchangeDeviceAuthorization,
309
324
  events,
310
325
  encodeObjectId,
311
326
  disconnectConnectorConnection,
312
327
  disableAuthServiceAccount,
328
+ deleteAiLimitPolicy,
313
329
  decodeObjectId,
314
330
  createWsSubscribeExecutor,
315
331
  createSixbLogsWebSocketUrl,
@@ -320,10 +336,12 @@ export {
320
336
  createLogSocket,
321
337
  createFileUpload,
322
338
  createEventSocket,
339
+ createDeviceAuthorization,
323
340
  createAuthServiceAccountAccessToken,
324
341
  createAuthServiceAccount,
325
342
  createAuthPersonalAccessToken,
326
343
  createAuthInvitation,
344
+ createAiLimitPolicy,
327
345
  createAgentThread,
328
346
  createAgentRunSocket,
329
347
  createAgentActivitySocket,
@@ -346,4 +364,4 @@ export {
346
364
  ActionRunFailedError
347
365
  };
348
366
 
349
- //# debugId=34865457087D1F5264756E2164756E21
367
+ //# debugId=817120382EDF53E964756E2164756E21
package/dist/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "34865457087D1F5264756E2164756E21",
7
+ "debugId": "817120382EDF53E964756E2164756E21",
8
8
  "names": []
9
9
  }
package/dist/logs.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  isStoredLogLine1 as isStoredLogLine2,
7
7
  logs,
8
8
  parseLogStreamMessage
9
- } from "./chunk-5y58b4tr.js";
10
- import"./chunk-g19v53kt.js";
9
+ } from "./chunk-m4by7m5r.js";
10
+ import"./chunk-h80qj1f8.js";
11
11
  import"./chunk-trpg18dp.js";
12
- import"./chunk-ehjnq01h.js";
12
+ import"./chunk-r8p88mbg.js";
13
13
  export {
14
14
  parseLogStreamMessage,
15
15
  logs,
package/dist/models.js CHANGED
@@ -19,13 +19,17 @@ import {
19
19
  completeFileUpload,
20
20
  countObjects,
21
21
  createAgentThread,
22
+ createAiLimitPolicy,
22
23
  createAuthInvitation,
23
24
  createAuthPersonalAccessToken,
24
25
  createAuthServiceAccount,
25
26
  createAuthServiceAccountAccessToken,
27
+ createDeviceAuthorization,
26
28
  createFileUpload,
29
+ deleteAiLimitPolicy,
27
30
  disableAuthServiceAccount,
28
31
  disconnectConnectorConnection,
32
+ exchangeDeviceAuthorization,
29
33
  existsObjects,
30
34
  facetObjects,
31
35
  getAction,
@@ -36,6 +40,8 @@ import {
36
40
  getAgentRun,
37
41
  getAgentThread,
38
42
  getAiAccountingOverview,
43
+ getAiLimitStatus,
44
+ getAiLimitSubjectOptions,
39
45
  getAuthAccessManagementOptions,
40
46
  getAuthInvitationOptions,
41
47
  getAuthMembershipOptions,
@@ -74,7 +80,8 @@ import {
74
80
  listAgentThreadMessages,
75
81
  listAgentThreadRuns,
76
82
  listAgentThreads,
77
- listAgents,
83
+ listAiLimitPolicies,
84
+ listAiModelCallGroups,
78
85
  listAiModelCalls,
79
86
  listAuthAccessTokens,
80
87
  listAuthInvitations,
@@ -128,18 +135,20 @@ import {
128
135
  startConnectorConnectionRun,
129
136
  submitWorkflowIntervention,
130
137
  suspendAuthMember,
138
+ updateAiLimitPolicy,
131
139
  updateAuthMemberGroups,
132
140
  uploadFileContent,
133
141
  uploadFileRaw,
134
142
  upsertObject,
135
143
  upsertObjectLink
136
- } from "./chunk-ehjnq01h.js";
144
+ } from "./chunk-r8p88mbg.js";
137
145
  export {
138
146
  upsertObjectLink,
139
147
  upsertObject,
140
148
  uploadFileRaw,
141
149
  uploadFileContent,
142
150
  updateAuthMemberGroups,
151
+ updateAiLimitPolicy,
143
152
  toTelemetryHistoryWithRange,
144
153
  toProjectInfo,
145
154
  toObjectSummary,
@@ -197,7 +206,8 @@ export {
197
206
  listAuthInvitations,
198
207
  listAuthAccessTokens,
199
208
  listAiModelCalls,
200
- listAgents,
209
+ listAiModelCallGroups,
210
+ listAiLimitPolicies,
201
211
  listAgentThreads,
202
212
  listAgentThreadRuns,
203
213
  listAgentThreadMessages,
@@ -236,6 +246,8 @@ export {
236
246
  getAuthMembershipOptions,
237
247
  getAuthInvitationOptions,
238
248
  getAuthAccessManagementOptions,
249
+ getAiLimitSubjectOptions,
250
+ getAiLimitStatus,
239
251
  getAiAccountingOverview,
240
252
  getAgentThread,
241
253
  getAgentRun,
@@ -246,15 +258,19 @@ export {
246
258
  getAction,
247
259
  facetObjects,
248
260
  existsObjects,
261
+ exchangeDeviceAuthorization,
249
262
  encodeObjectId,
250
263
  disconnectConnectorConnection,
251
264
  disableAuthServiceAccount,
265
+ deleteAiLimitPolicy,
252
266
  decodeObjectId,
253
267
  createFileUpload,
268
+ createDeviceAuthorization,
254
269
  createAuthServiceAccountAccessToken,
255
270
  createAuthServiceAccount,
256
271
  createAuthPersonalAccessToken,
257
272
  createAuthInvitation,
273
+ createAiLimitPolicy,
258
274
  createAgentThread,
259
275
  countObjects,
260
276
  completeFileUpload,
@@ -267,4 +283,4 @@ export {
267
283
  abortFileUpload
268
284
  };
269
285
 
270
- //# debugId=89FBAAF7E1FEDFB564756E2164756E21
286
+ //# debugId=688558CA2ED3E26764756E2164756E21
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "89FBAAF7E1FEDFB564756E2164756E21",
7
+ "debugId": "688558CA2ED3E26764756E2164756E21",
8
8
  "names": []
9
9
  }
package/dist/query.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  SixbQueryError,
4
4
  createHttpQueryExecutor,
5
5
  objects
6
- } from "./chunk-ks27bq5b.js";
7
- import"./chunk-9bwme2g7.js";
8
- import"./chunk-ehjnq01h.js";
6
+ } from "./chunk-p0xrjaz6.js";
7
+ import"./chunk-b3bfdm80.js";
8
+ import"./chunk-r8p88mbg.js";
9
9
  export {
10
10
  objects,
11
11
  createHttpQueryExecutor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/client",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Type-safe SDK for Sixb API with TanStack Query hooks",
5
5
  "keywords": [
6
6
  "sixb",
@@ -67,7 +67,7 @@
67
67
  "prepack": "bun run build"
68
68
  },
69
69
  "dependencies": {
70
- "@sixb/core": "^0.1.6"
70
+ "@sixb/core": "^0.1.7"
71
71
  },
72
72
  "peerDependencies": {
73
73
  "@tanstack/react-query": "^5.0.0",
@@ -254,7 +254,6 @@ function isAgentRunSnapshot(value: unknown): value is AgentRunSnapshot {
254
254
  typeof value.id === "string" &&
255
255
  typeof value.projectId === "string" &&
256
256
  typeof value.threadId === "string" &&
257
- typeof value.agentId === "string" &&
258
257
  typeof value.triggerMessageId === "string" &&
259
258
  (value.requestedBy === undefined ||
260
259
  (isRecord(value.requestedBy) &&
package/src/file.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { FileRef } from "@sixb/core"
2
2
  import { DEFAULT_SIMPLE_FILE_UPLOAD_BYTES } from "@sixb/core/blob-storage"
3
3
  import { isSixbApiError, type SixbClient } from "./api"
4
+ import { client as sharedClient } from "./generated/client.gen"
4
5
  import {
5
6
  abortFileUpload,
6
7
  completeFileUpload,
@@ -11,6 +12,41 @@ import {
11
12
  } from "./generated/sdk.gen"
12
13
  import { computeStreamingBlobDigest } from "./sha256"
13
14
 
15
+ export interface ObjectFileContentUrlInput {
16
+ readonly objectTypeId: string
17
+ readonly objectId: string
18
+ /** Property path segments, without the leading `properties` segment. */
19
+ readonly pathSegments: readonly string[]
20
+ readonly fileRef: FileRef
21
+ readonly disposition?: "inline" | "attachment"
22
+ readonly client?: SixbClient
23
+ }
24
+
25
+ /** Build a rendering/download URL that changes with the file's content or metadata. */
26
+ export function objectFileContentUrl(input: ObjectFileContentUrlInput): string {
27
+ if (!input.objectTypeId || !input.objectId || input.pathSegments.length === 0) {
28
+ throw new Error("[SixbClient] File content URLs require an object type, ID, and property path.")
29
+ }
30
+ const client = input.client ?? sharedClient
31
+ const { digest, fileName, mediaType, logicalPath } = input.fileRef
32
+ return client.buildUrl({
33
+ baseUrl: client.getConfig().baseUrl,
34
+ url: "/api/objects/{objectTypeId}/{objectId}/files/content",
35
+ path: { objectTypeId: input.objectTypeId, objectId: input.objectId },
36
+ query: {
37
+ path: `/properties/${input.pathSegments
38
+ .map((segment) => segment.replaceAll("~", "~0").replaceAll("/", "~1"))
39
+ .join("/")}`,
40
+ disposition: input.disposition,
41
+ // Opaque cache key, not a historical-file selector. Include per-reference metadata.
42
+ // Encode each field so Elysia won't interpret commas in filenames as an array.
43
+ v: [digest, fileName ?? "", mediaType ?? "", logicalPath ?? ""]
44
+ .map(encodeURIComponent)
45
+ .join(":"),
46
+ },
47
+ })
48
+ }
49
+
14
50
  export type SixbFileUploadStage =
15
51
  | "hash"
16
52
  | "create"