@opengeni/sdk 6.1.0 → 7.0.0-canary.35585322809001

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 (56) hide show
  1. package/README.md +84 -45
  2. package/dist/artifacts.js +4 -4
  3. package/dist/browser.d.ts +2 -0
  4. package/dist/browser.js +2 -2
  5. package/dist/chat/index.js +5 -5
  6. package/dist/{chunk-64S3VKJU.js → chunk-7ESHQLTB.js} +130 -83
  7. package/dist/chunk-7ESHQLTB.js.map +1 -0
  8. package/dist/{chunk-IZH5F7QC.js → chunk-L3MYVTPO.js} +10 -2
  9. package/dist/chunk-L3MYVTPO.js.map +1 -0
  10. package/dist/{chunk-CFSYTYMA.js → chunk-MXQX4M36.js} +2 -2
  11. package/dist/{chunk-VDACQXJZ.js → chunk-N76DIO4E.js} +8 -87
  12. package/dist/chunk-N76DIO4E.js.map +1 -0
  13. package/dist/{chunk-CMEU67C4.js → chunk-P7OFNKCH.js} +2 -2
  14. package/dist/chunk-P7OFNKCH.js.map +1 -0
  15. package/dist/{chunk-4ZQQQBOH.js → chunk-RCVWE6UR.js} +2 -2
  16. package/dist/client.d.ts +47 -21
  17. package/dist/core.js +3 -3
  18. package/dist/document-authority-client.d.ts +3 -1
  19. package/dist/document-authority.js +3 -3
  20. package/dist/editable-artifacts.js +13 -2
  21. package/dist/editable-artifacts.js.map +1 -1
  22. package/dist/embedding-client.d.ts +3 -21
  23. package/dist/index.d.ts +3 -1
  24. package/dist/index.js +6 -6
  25. package/dist/knowledge.d.ts +5 -3
  26. package/dist/knowledge.js +12 -3
  27. package/dist/knowledge.js.map +1 -1
  28. package/dist/organization-integration-policy.d.ts +26 -0
  29. package/dist/organization-integration-policy.js +26 -0
  30. package/dist/organization-integration-policy.js.map +1 -0
  31. package/dist/session-message-search.d.ts +41 -0
  32. package/dist/site-browser-runtime.gen.d.ts +1 -1
  33. package/dist/site-document.js +1 -1
  34. package/dist/site-document.js.map +1 -1
  35. package/dist/site.js +3 -3
  36. package/dist/skills.d.ts +3 -0
  37. package/dist/types.d.ts +168 -380
  38. package/package.json +7 -3
  39. package/src/browser.ts +12 -0
  40. package/src/client.ts +206 -136
  41. package/src/document-authority-client.ts +15 -0
  42. package/src/editable-artifacts/controller.ts +25 -1
  43. package/src/embedding-client.ts +10 -134
  44. package/src/index.ts +25 -34
  45. package/src/knowledge.ts +22 -1
  46. package/src/organization-integration-policy.ts +54 -0
  47. package/src/session-message-search.ts +39 -0
  48. package/src/site-browser-runtime.gen.ts +1 -1
  49. package/src/skills.ts +3 -0
  50. package/src/types.ts +176 -432
  51. package/dist/chunk-64S3VKJU.js.map +0 -1
  52. package/dist/chunk-CMEU67C4.js.map +0 -1
  53. package/dist/chunk-IZH5F7QC.js.map +0 -1
  54. package/dist/chunk-VDACQXJZ.js.map +0 -1
  55. /package/dist/{chunk-CFSYTYMA.js.map → chunk-MXQX4M36.js.map} +0 -0
  56. /package/dist/{chunk-4ZQQQBOH.js.map → chunk-RCVWE6UR.js.map} +0 -0
package/README.md CHANGED
@@ -215,8 +215,8 @@ session. There is no organization-wide Skill registry or Skill inheritance in
215
215
  this integration contract. See the canonical guide for the complete route map,
216
216
  security boundary, and delivery checklist.
217
217
 
218
- Installed Pack Skills normally remain workspace-managed. A Pack may instead
219
- mark guidance as `session_selected`; installation then exposes it to no agent
218
+ Installed Skills can be workspace-managed or marked `session_selected`.
219
+ Session-selected guidance is exposed to no agent
220
220
  until `createSession` names the reviewed immutable component in
221
221
  `installedSkillIds`. OpenGeni copies that exact artifact into the new session,
222
222
  so omitting the field from customer-facing creates is a real contamination
@@ -286,6 +286,35 @@ the advisory UI without changing stored evidence or API authority. See
286
286
  [`docs/work-discovery.md`](../../docs/work-discovery.md) for ranking, bounds,
287
287
  claim lifecycle, and rollout semantics.
288
288
 
289
+ ## Full-history message search
290
+
291
+ `searchSessionMessages(workspaceId, { query, sessionId?, groupBy?, archiveStatus?, limit?,
292
+ cursor? }, { signal? })` searches durable user and **completed assistant** text,
293
+ including unloaded history. It returns every non-overlapping literal occurrence,
294
+ not tools, reasoning, model context, or delta-only assistant output.
295
+
296
+ Each match has a durable `eventId`/`sequence`, a UTF-16 `messageMatchOffset`, and
297
+ `snippet: { text, matchStart, matchEnd }` with original-text UTF-16 offsets.
298
+ Results include `nextCursor`, `hasMore`, cumulative `matchedMessageCount` and
299
+ `matchedOccurrenceCount`, `scannedMessages`, and `countIsExact`. Keep following
300
+ cursors even on empty pages while `hasMore` is true; counts are provisional until
301
+ exhaustion. Cancel superseded searches with the third argument's AbortSignal.
302
+ This is a live, authorized traversal rather than a frozen snapshot; restart to
303
+ refresh after concurrent history or visibility changes.
304
+
305
+ For workspace search, `groupBy: "session"` returns the first hit per matching
306
+ session and skips that session's remaining history, keeping prolific messages
307
+ from filling multiple picker pages. It cannot be combined with `sessionId`.
308
+ In grouped mode both matched counters count session representatives, not full
309
+ per-session message/occurrence totals; `scannedMessages` counts only visited
310
+ messages. Cursors bind the grouping mode. Omit it for every-occurrence Find.
311
+
312
+ The method and types are exported from the ordinary SDK and browser entry.
313
+ Use `listEventPage` around the hit's sequence for bounded context, and use the
314
+ returned search snippet when a large source message's ordinary projection does
315
+ not include the hit. Never download complete history to perform Find locally.
316
+ See [the API contract and bounds](../../docs/session-message-search.md).
317
+
289
318
  ## Session visibility and forks
290
319
 
291
320
  For organizations with session-tenancy activation, a canonical managed-cookie
@@ -321,49 +350,33 @@ user decision. A quiescence conflict identifies the stable blocker after live
321
350
  turns, goals, realtime, schedules, workspace writers, retained processes, and
322
351
  sandbox access have been settled. Forks copy exact same-workspace durable
323
352
  conversation content but no live turn, goal, credential, Connection/delegation,
324
- personal grant, Variable Set, Rig, MCP server configuration, process, sandbox
353
+ personal grant, Variable Set, Sandbox Environment, MCP server configuration, process, sandbox
325
354
  identity, pin, or workflow. Destination visibility and acknowledgement are
326
355
  idempotency-bound.
327
356
 
328
- ## Personal-resource grants
357
+ ## Connected accounts
329
358
 
330
- The same canonical managed-cookie owner can manage explicit personal-resource
331
- delegations after organization activation. Pages are bounded to one exact kind;
332
- the server derives the only valid action and returns the full credential-free
333
- delegation to attach through the resource's ordinary session API.
359
+ Authenticated messages use the initiating user's eligible connected accounts.
360
+ Conversation visibility does not share account access. Queued work, retries and
361
+ child work retain the initiating user. No per-conversation connection grant is
362
+ required. Multiple eligible accounts require an explicit account choice:
334
363
 
335
364
  ```ts
336
- const page = await browserClient.listUserResourceAuthorities(workspaceId, {
337
- resourceKind: "connection",
338
- limit: 50,
339
- });
340
- const authority = page.authorities[0];
341
- if (!authority) throw new Error("No personal Connection is available");
342
-
343
- const issued = await browserClient.issueUserResourceGrant(workspaceId, authority.authorityId, {
344
- scope: "user",
345
- resourceKind: "connection",
346
- mode: "session",
347
- context: "workspace_shared",
348
- sessionId,
349
- expectedAuthorityEpoch: current.tenancy.authorityEpoch,
350
- workspaceSharedAcknowledged: true,
351
- });
352
-
353
- await browserClient.revokeUserResourceGrant(workspaceId, issued.grant.grantId);
365
+ const accounts = await browserClient.listOwnConnectionAccounts(workspaceId);
366
+ // When choosing among multiple accounts, use the exact eligible server/account pair.
367
+ const selection = { serverId: "mail", connectionId: accounts[0]!.id };
354
368
  ```
355
369
 
356
- The SDK deliberately exposes only exact-session and standing (`always`) grant
357
- management. It does not expose standalone `once`, custom expiry, scheduled or
358
- cross-workspace authority, or an atomic create-session-and-attach workflow.
359
- Revocation prevents future reads but cannot retract output already shared.
370
+ General personal-resource grants for documents, variable sets and other resource
371
+ kinds remain available through the root/core SDK. They do not authorize native
372
+ connected accounts.
360
373
 
361
- ## Scheduled connection authority
374
+ ## Personal schedules
362
375
 
363
- Agent schedules may carry explicit personal Connection authority. The public
364
- request contains only the credential-free server, Connection, and common-user
365
- grant tuple returned by the authority-selection API; the SDK never receives or
366
- stores provider credentials:
376
+ A schedule created by an authenticated human or their active agent records that
377
+ human as its immutable owner. Only that owner or their verified agent may edit,
378
+ run, pause or delete it. Each occurrence resolves the owner's current accounts;
379
+ accepted retries retain their original identity and account selection.
367
380
 
368
381
  ```ts
369
382
  const task = await client.createScheduledTask(workspaceId, {
@@ -371,18 +384,15 @@ const task = await client.createScheduledTask(workspaceId, {
371
384
  schedule: { type: "calendar", hour: 8, minute: 0, timeZone: "Europe/Oslo" },
372
385
  runMode: "reusable_session",
373
386
  agentConfig: { prompt: "Triage the new support issues" },
374
- connectionAuthorities: [selection],
387
+ connectionAccounts: [selection],
375
388
  });
376
389
  ```
377
390
 
378
- PATCH semantics are deliberate: omit `connectionAuthorities` to preserve the
379
- exact prior immutable selection, pass `[]` to clear it, or pass a non-empty
380
- array to replace and revalidate it. Execution-changing edits that preserve
381
- personal authority must be made by the same causal human; use an explicit fresh
382
- selection when authority should move. `once` grants are consumed by the durable
383
- scheduled occurrence, not by an activity attempt, so retries reuse the same run
384
- receipt. `listScheduledTaskRuns` exposes terminal occurrence state while private
385
- Connection ids, subjects, and authority snapshots stay server-side.
391
+ Account selections narrow eligible accounts; they never transfer ownership.
392
+ Omitting `connectionAccounts` on update preserves the selection. Passing an
393
+ empty array clears explicit account choices without changing the schedule owner.
394
+ Service-owned schedules retain service execution and do not acquire a human's
395
+ personal accounts. Run history remains credential-free.
386
396
 
387
397
  Deleting a task is externally idempotent and immediately removes it from live
388
398
  lists and quota, but the server retains a tombstone plus run/session/turn audit
@@ -817,6 +827,36 @@ await client.cancelSession(workspaceId, sessionId, {
817
827
  await client.sendApprovalDecision(workspaceId, sessionId, { approvalId, decision: "approve" });
818
828
  ```
819
829
 
830
+ ## Retry a failed session without changing its intent
831
+
832
+ Try again is separate from Pause/Resume and `sendMessage`. Retain the request
833
+ across an ambiguous transport response; never synthesize a continuation prompt:
834
+
835
+ ```ts
836
+ const retryRequest = {
837
+ clientEventId: crypto.randomUUID(),
838
+ failureEventId, // the current durable turn.failed event id
839
+ model: selectedModel,
840
+ reasoningEffort: "high" as const,
841
+ latencyMode: "standard" as const,
842
+ };
843
+ const retry = await client.retrySession(workspaceId, sessionId, retryRequest);
844
+ // { outcome: "accepted" | "replayed", turnId, failureEventId }
845
+ ```
846
+
847
+ Requires `sessions:control` and session access. Recovery keeps the logical turn,
848
+ original question, frozen authority, and completed history/tool results; it
849
+ does not create a user message. Omitted policy fields retain the failed turn's
850
+ selection. The selected policy is revalidated for new admission. A duplicate
851
+ operation replays its receipt even after execution advances.
852
+
853
+ HTTP 409 codes distinguish `RETRY_STALE_FAILURE`, `RETRY_EXECUTION_UNRESOLVED`,
854
+ `RETRY_PAUSED`, `RETRY_UNSUPPORTED_FAILURE`, and `IDEMPOTENCY_KEY_REUSED`.
855
+ Unresolved tool outcomes cannot be blindly replayed. A deliberate Pause must
856
+ be resumed separately. Failure without a retained logical turn, a settled
857
+ scheduled occurrence, and idle credit exhaustion are not supported retry
858
+ boundaries. See [run lifecycle](../../docs/run-lifecycle.md).
859
+
820
860
  ## Session tool policy and native web search
821
861
 
822
862
  For standalone credential maintenance, use the dedicated operation rather than
@@ -987,7 +1027,6 @@ Every public endpoint group has typed methods:
987
1027
  | Variable sets | `listVariableSets`, `createVariableSet`, `getVariableSet`, `updateVariableSet`, `deleteVariableSet`, `setVariableSetVariable`, `deleteVariableSetVariable`; generic reads are metadata-only, while dedicated permissioned exact-value reads are part of the held client train |
988
1028
  | Files | `uploadFile`, `beginFileUpload`, `completeFileUpload`, `getFile`, `createFileDownloadUrl` |
989
1029
  | Documents | `createDocumentBase`, `listDocumentBases`, `getDocumentBase`, `addDocument`, `listDocuments`, `reindexDocument`, `searchDocuments`, `searchKnowledge` (effective organization + workspace + immutable initiating-user personal scope) |
990
- | Packs | `listPacks`, `registerPack`, `getPack`, `enablePack`, `deletePack`, `listPackInstallations` |
991
1030
  | Capabilities | `listCapabilities`, `createCapability`, `enableCapability`, `disableCapability`, `discoverMcpCapabilities` |
992
1031
  | Plugin packages | `previewPlugin`, `installPlugin`, `previewPluginUninstall`, `uninstallPlugin` |
993
1032
  | API Integrations | `listIntegrationDefinitions`, `listApiIntegrations`, `previewApiIntegration`, `startApiIntegrationOAuth`, `installApiIntegration`, `previewApiIntegrationUninstall`, `uninstallApiIntegration`, `listIntegrationFacets`, `configureIntegrationFacet`, `pauseIntegrationFacet`, `resumeIntegrationFacet`, `removeIntegrationFacet`, `browseGoogleDriveFacetSource`, `saveGoogleDriveFacetSource` |
package/dist/artifacts.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-4ZQQQBOH.js";
4
- import "./chunk-IZH5F7QC.js";
5
- import "./chunk-64S3VKJU.js";
3
+ } from "./chunk-RCVWE6UR.js";
4
+ import "./chunk-L3MYVTPO.js";
5
+ import "./chunk-7ESHQLTB.js";
6
6
  import "./chunk-QTBAMHEF.js";
7
- import "./chunk-CMEU67C4.js";
7
+ import "./chunk-P7OFNKCH.js";
8
8
  import "./chunk-OO5LPTO7.js";
9
9
  export {
10
10
  OpenGeniClient
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /** Browser-console client. Optional SDK surfaces must not enter this eager graph. */
2
2
  export { OpenGeniClient as OpenGeniBrowserClient } from "./client.js";
3
+ export type { SessionMessageSearchRequest, SessionMessageSearchMatch, SessionMessageSearchResponse, } from "./session-message-search.js";
3
4
  export { OpenGeniToolCallError, OpenGeniToolReapprovalRequiredError, OpenGeniToolsClient, } from "./tools.js";
4
5
  export type { OpenGeniGeneratedTools, OpenGeniDynamicToolNode, OpenGeniToolCallOptions, OpenGeniToolFunction, OpenGeniToolsFacade, OpenGeniWorkspaceTools, } from "./tools.js";
5
6
  export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
@@ -7,3 +8,4 @@ export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSecureConte
7
8
  export type { OpenGeniSecureContextRequiredReason } from "./errors.js";
8
9
  export { resolveWorkspaceVoiceInputEnabled } from "./transcription.js";
9
10
  export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types.js";
11
+ export type { ConnectorToolPermission, ConnectorToolPermissionEntry, ConnectorToolPermissionsResponse, UpdateConnectorToolPermissionsRequest, } from "./types.js";
package/dist/browser.js CHANGED
@@ -8,12 +8,12 @@ import {
8
8
  } from "./chunk-FMLDFJ2Q.js";
9
9
  import {
10
10
  OpenGeniClient
11
- } from "./chunk-64S3VKJU.js";
11
+ } from "./chunk-7ESHQLTB.js";
12
12
  import "./chunk-QTBAMHEF.js";
13
13
  import {
14
14
  OPENGENI_API_CONTRACT_HEADER,
15
15
  OPENGENI_API_CONTRACT_REVISION
16
- } from "./chunk-CMEU67C4.js";
16
+ } from "./chunk-P7OFNKCH.js";
17
17
  import {
18
18
  OpenGeniApiContractMismatchError,
19
19
  OpenGeniApiError,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  OpenGeniEmbeddingClient
3
- } from "../chunk-VDACQXJZ.js";
4
- import "../chunk-4ZQQQBOH.js";
5
- import "../chunk-IZH5F7QC.js";
3
+ } from "../chunk-N76DIO4E.js";
4
+ import "../chunk-RCVWE6UR.js";
5
+ import "../chunk-L3MYVTPO.js";
6
6
  import {
7
7
  parseSseStream
8
- } from "../chunk-64S3VKJU.js";
8
+ } from "../chunk-7ESHQLTB.js";
9
9
  import "../chunk-QTBAMHEF.js";
10
- import "../chunk-CMEU67C4.js";
10
+ import "../chunk-P7OFNKCH.js";
11
11
  import {
12
12
  OpenGeniApiError
13
13
  } from "../chunk-OO5LPTO7.js";
@@ -9,7 +9,7 @@ import {
9
9
  OPENGENI_API_CONTRACT_REVISION,
10
10
  OPENGENI_CORRELATION_HEADER,
11
11
  RETAINED_OUTPUT_MAX_PAGE_BYTES
12
- } from "./chunk-CMEU67C4.js";
12
+ } from "./chunk-P7OFNKCH.js";
13
13
  import {
14
14
  OpenGeniApiContractMismatchError,
15
15
  OpenGeniApiError,
@@ -1177,6 +1177,26 @@ var OpenGeniClient = class {
1177
1177
  request
1178
1178
  );
1179
1179
  }
1180
+ /** Search durable visible user/assistant text, including unloaded history.
1181
+ * Pages may be empty with hasMore=true. Never fall back to title search on
1182
+ * older servers. Use listEventPage before/after the returned sequence for context.
1183
+ */
1184
+ async searchSessionMessages(workspaceId, request, options = {}) {
1185
+ return this.requestJson(
1186
+ "GET",
1187
+ `/v1/workspaces/${workspaceId}/session-message-search`,
1188
+ void 0,
1189
+ {
1190
+ query: request.query,
1191
+ ...request.sessionId !== void 0 ? { sessionId: request.sessionId } : {},
1192
+ ...request.groupBy !== void 0 ? { groupBy: request.groupBy } : {},
1193
+ ...request.archiveStatus !== void 0 ? { archiveStatus: request.archiveStatus } : {},
1194
+ ...request.limit !== void 0 ? { limit: String(request.limit) } : {},
1195
+ ...request.cursor !== void 0 ? { cursor: request.cursor } : {}
1196
+ },
1197
+ options
1198
+ );
1199
+ }
1180
1200
  async listSessions(workspaceId, options = {}) {
1181
1201
  if (options.search?.trim() || options.originSiteId) {
1182
1202
  const page = await this.listSessionPage(workspaceId, options);
@@ -1229,7 +1249,9 @@ var OpenGeniClient = class {
1229
1249
  ...options.createdFrom ? { createdFrom: options.createdFrom } : {},
1230
1250
  ...options.createdBefore ? { createdBefore: options.createdBefore } : {},
1231
1251
  ...options.pinsOnly ? { pinsOnly: "true" } : {},
1232
- ...options.archivedOnly ? { archivedOnly: "true" } : {}
1252
+ ...options.archivedOnly ? { archivedOnly: "true" } : {},
1253
+ ...options.sortBy ? { sortBy: options.sortBy } : {},
1254
+ ...options.archiveStatus ? { archiveStatus: options.archiveStatus } : {}
1233
1255
  },
1234
1256
  { signal: options.signal }
1235
1257
  );
@@ -1245,6 +1267,11 @@ var OpenGeniClient = class {
1245
1267
  }
1246
1268
  throw error;
1247
1269
  }
1270
+ if (options.sortBy !== void 0 && (Array.isArray(response) || response.sortBy !== options.sortBy) || options.archiveStatus !== void 0 && (Array.isArray(response) || response.archiveStatus !== options.archiveStatus)) {
1271
+ throw new Error(
1272
+ "The connected OpenGeni API does not support the requested session sorting/archive filter"
1273
+ );
1274
+ }
1248
1275
  if (Array.isArray(response)) {
1249
1276
  if (options.cursor) {
1250
1277
  throw new Error("The connected OpenGeni API does not support stable session-page cursors");
@@ -1960,6 +1987,29 @@ var OpenGeniClient = class {
1960
1987
  request
1961
1988
  );
1962
1989
  }
1990
+ /** Inspect bounded checkpoint recovery eligibility without changing session state. */
1991
+ async getSandboxRecovery(workspaceId, sessionId) {
1992
+ return this.requestJson(
1993
+ "GET",
1994
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/sandbox-recovery`
1995
+ );
1996
+ }
1997
+ /** Restore only the explicitly selected checkpoint; never retry a command. */
1998
+ async recoverSandbox(workspaceId, sessionId, request) {
1999
+ return this.requestSessionCommand(
2000
+ "POST",
2001
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/sandbox-recovery`,
2002
+ request
2003
+ );
2004
+ }
2005
+ /** Retry the exact failed turn. Keep clientEventId unchanged on transport retries. */
2006
+ async retrySession(workspaceId, sessionId, request) {
2007
+ return await this.requestSessionCommand(
2008
+ "POST",
2009
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/retry`,
2010
+ request
2011
+ );
2012
+ }
1963
2013
  async controlSession(workspaceId, sessionId, request) {
1964
2014
  return await this.requestSessionCommand(
1965
2015
  "POST",
@@ -3285,14 +3335,6 @@ var OpenGeniClient = class {
3285
3335
  `/v1/workspaces/${workspaceId}/user-resource-authorities?${query.toString()}`
3286
3336
  );
3287
3337
  }
3288
- /** Issue an exact-session or standing personal-resource grant. */
3289
- async issueUserResourceGrant(workspaceId, authorityId, request) {
3290
- return await this.requestJson(
3291
- "POST",
3292
- `/v1/workspaces/${workspaceId}/user-resource-authorities/${authorityId}/grants`,
3293
- request
3294
- );
3295
- }
3296
3338
  /** Revoke an owner grant through the exact workspace it targets. */
3297
3339
  async revokeUserResourceGrant(workspaceId, grantId) {
3298
3340
  return await this.requestJson(
@@ -4369,7 +4411,7 @@ var OpenGeniClient = class {
4369
4411
  async getFile(workspaceId, fileId, options = {}) {
4370
4412
  return await this.requestJson(
4371
4413
  "GET",
4372
- `/v1/workspaces/${workspaceId}/files/${fileId}`,
4414
+ `/v1/workspaces/${workspaceId}/files/${fileId}${options.sessionId ? `?sessionId=${encodeURIComponent(options.sessionId)}` : ""}`,
4373
4415
  void 0,
4374
4416
  {},
4375
4417
  options
@@ -4526,7 +4568,7 @@ var OpenGeniClient = class {
4526
4568
  async createFileDownloadUrl(workspaceId, fileId, options = {}) {
4527
4569
  return await this.requestJson(
4528
4570
  "POST",
4529
- `/v1/workspaces/${workspaceId}/files/${fileId}/download-url`,
4571
+ `/v1/workspaces/${workspaceId}/files/${fileId}/download-url${options.sessionId ? `?sessionId=${encodeURIComponent(options.sessionId)}` : ""}`,
4530
4572
  void 0,
4531
4573
  {},
4532
4574
  options
@@ -4762,76 +4804,7 @@ var OpenGeniClient = class {
4762
4804
  request
4763
4805
  );
4764
4806
  }
4765
- // --- Capability packs ------------------------------------------------------------------
4766
- /** Built-in + registered packs, with the workspace's installations. */
4767
- async listPacks(workspaceId) {
4768
- return await this.requestJson("GET", `/v1/workspaces/${workspaceId}/packs`);
4769
- }
4770
- /** Register (or replace) a workspace-scoped pack from a manifest. */
4771
- async registerPack(workspaceId, manifest) {
4772
- return await this.requestJson(
4773
- "POST",
4774
- `/v1/workspaces/${workspaceId}/packs`,
4775
- manifest
4776
- );
4777
- }
4778
- async getPack(workspaceId, packId) {
4779
- return await this.requestJson(
4780
- "GET",
4781
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}`
4782
- );
4783
- }
4784
- async enablePack(workspaceId, packId, request = {}) {
4785
- return await this.requestJson(
4786
- "POST",
4787
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/enable`,
4788
- request
4789
- );
4790
- }
4791
4807
  /** Resolve pinned components, Variable Set, and Rig requirements before installation. */
4792
- async previewPackInstallation(workspaceId, packId, request = {}) {
4793
- return await this.requestJson(
4794
- "POST",
4795
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/installation-preview`,
4796
- request
4797
- );
4798
- }
4799
- /** Install, update, or repair a Pack from an exact previewed manifest. */
4800
- async installPack(workspaceId, packId, request) {
4801
- return await this.requestJson(
4802
- "POST",
4803
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/install`,
4804
- request
4805
- );
4806
- }
4807
- /** Preview which Pack-owned components will be retained by other owners. */
4808
- async previewPackUninstall(workspaceId, packId) {
4809
- return await this.requestJson(
4810
- "GET",
4811
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/uninstall-preview`
4812
- );
4813
- }
4814
- /** Safely release Pack ownership and disable only now-ownerless components. */
4815
- async uninstallPack(workspaceId, packId, request) {
4816
- return await this.requestJson(
4817
- "DELETE",
4818
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}/installation`,
4819
- request
4820
- );
4821
- }
4822
- /** Unregister a workspace-scoped pack (built-in packs cannot be deleted). */
4823
- async deletePack(workspaceId, packId) {
4824
- await this.requestVoid(
4825
- "DELETE",
4826
- `/v1/workspaces/${workspaceId}/packs/${encodeURIComponent(packId)}`
4827
- );
4828
- }
4829
- async listPackInstallations(workspaceId) {
4830
- return await this.requestJson(
4831
- "GET",
4832
- `/v1/workspaces/${workspaceId}/packs/installations`
4833
- );
4834
- }
4835
4808
  // --- Capabilities -------------------------------------------------------------------------
4836
4809
  async listCapabilities(workspaceId) {
4837
4810
  return await this.requestJson(
@@ -4847,6 +4820,24 @@ var OpenGeniClient = class {
4847
4820
  request
4848
4821
  );
4849
4822
  }
4823
+ async getConnectorToolPermissions(workspaceId, capabilityId, options = {}) {
4824
+ return await this.requestJson(
4825
+ "GET",
4826
+ `/v1/workspaces/${workspaceId}/capabilities/${encodeURIComponent(capabilityId)}/tool-permissions`,
4827
+ void 0,
4828
+ {},
4829
+ options
4830
+ );
4831
+ }
4832
+ async updateConnectorToolPermissions(workspaceId, capabilityId, request, options = {}) {
4833
+ return await this.requestJson(
4834
+ "PATCH",
4835
+ `/v1/workspaces/${workspaceId}/capabilities/${encodeURIComponent(capabilityId)}/tool-permissions`,
4836
+ request,
4837
+ {},
4838
+ options
4839
+ );
4840
+ }
4850
4841
  async enableCapability(workspaceId, capabilityId, request = {}) {
4851
4842
  return await this.requestJson(
4852
4843
  "POST",
@@ -5210,6 +5201,14 @@ var OpenGeniClient = class {
5210
5201
  );
5211
5202
  }
5212
5203
  // --- Connections -------------------------------------------------------------------------------
5204
+ /** The authenticated user's active accounts across this organization. */
5205
+ async listOwnConnectionAccounts(workspaceId) {
5206
+ const response = await this.requestJson(
5207
+ "GET",
5208
+ `/v1/workspaces/${workspaceId}/connections/accounts`
5209
+ );
5210
+ return response.connections;
5211
+ }
5213
5212
  async listConnections(workspaceId) {
5214
5213
  const response = await this.requestJson(
5215
5214
  "GET",
@@ -5414,6 +5413,20 @@ var OpenGeniClient = class {
5414
5413
  catalogAssetUrl(logoAssetPath) {
5415
5414
  return logoAssetPath ? `${this.baseUrl}/v1/${logoAssetPath}` : null;
5416
5415
  }
5416
+ /** Read a passive catalog mark through this client's authenticated transport.
5417
+ * Useful when an embedding backend protects even public upstream assets. */
5418
+ async downloadCatalogAsset(logoAssetPath, options = {}) {
5419
+ if (!/^catalog-assets\/[a-zA-Z0-9_./-]+$/.test(logoAssetPath) || logoAssetPath.split("/").some((part) => !part || part === "." || part === ".."))
5420
+ throw new TypeError("A catalog asset path is required");
5421
+ const response = await this.requestResponse("GET", `/v1/${logoAssetPath}`, {}, options);
5422
+ const type = response.headers.get("content-type")?.split(";")[0] ?? "";
5423
+ if (!type.startsWith("image/")) {
5424
+ await response.body?.cancel();
5425
+ throw new Error("The catalog asset is not an image");
5426
+ }
5427
+ const bytes = await readBoundedResponseBytes(response, 2e6, null);
5428
+ return new Blob([Uint8Array.from(bytes)], { type });
5429
+ }
5417
5430
  // --- GitHub ----------------------------------------------------------------------------------
5418
5431
  /** GitHub App server configuration plus truthful workspace binding status. */
5419
5432
  async getGitHubApp(workspaceId, options = {}) {
@@ -5563,6 +5576,32 @@ var OpenGeniClient = class {
5563
5576
  ...options.accountId !== void 0 ? { accountId: options.accountId } : {}
5564
5577
  });
5565
5578
  }
5579
+ async getOrganizationUsageSummary(options, requestOptions = {}) {
5580
+ return await this.requestJson(
5581
+ "GET",
5582
+ "/v1/billing/usage-summary",
5583
+ void 0,
5584
+ {
5585
+ accountId: options.accountId,
5586
+ period: options.period ?? "month"
5587
+ },
5588
+ requestOptions
5589
+ );
5590
+ }
5591
+ async getOrganizationUsageWorkspacePage(options, requestOptions = {}) {
5592
+ return await this.requestJson(
5593
+ "GET",
5594
+ "/v1/billing/usage-workspaces",
5595
+ void 0,
5596
+ {
5597
+ accountId: options.accountId,
5598
+ period: options.period ?? "month",
5599
+ until: options.until,
5600
+ ...options.afterWorkspaceId ? { afterWorkspaceId: options.afterWorkspaceId } : {}
5601
+ },
5602
+ requestOptions
5603
+ );
5604
+ }
5566
5605
  async getBillingUsage(options = {}) {
5567
5606
  return await this.requestJson("GET", "/v1/billing/usage", void 0, {
5568
5607
  ...options.accountId !== void 0 ? { accountId: options.accountId } : {},
@@ -5578,7 +5617,8 @@ var OpenGeniClient = class {
5578
5617
  range: options.range ?? "week",
5579
5618
  ...options.provider !== void 0 ? { provider: options.provider } : {},
5580
5619
  ...options.model !== void 0 ? { model: options.model } : {}
5581
- }
5620
+ },
5621
+ { signal: options.signal }
5582
5622
  );
5583
5623
  }
5584
5624
  async getBillingEntitlements(options = {}) {
@@ -5686,6 +5726,13 @@ var OpenGeniClient = class {
5686
5726
  `/v1/workspaces/${workspaceId}/codex/accounts`
5687
5727
  );
5688
5728
  }
5729
+ /** Session-authorized retry choices plus the current accepted account. */
5730
+ async listSessionCodexAccounts(workspaceId, sessionId) {
5731
+ return await this.requestJson(
5732
+ "GET",
5733
+ `/v1/workspaces/${workspaceId}/sessions/${sessionId}/codex-accounts`
5734
+ );
5735
+ }
5689
5736
  /** Switch the workspace ACTIVE Codex account (the one unpinned sessions use). */
5690
5737
  async activateCodexAccount(workspaceId, accountId) {
5691
5738
  return await this.requestJson(
@@ -6269,4 +6316,4 @@ export {
6269
6316
  parseMediaGenerationResult,
6270
6317
  OpenGeniClient
6271
6318
  };
6272
- //# sourceMappingURL=chunk-64S3VKJU.js.map
6319
+ //# sourceMappingURL=chunk-7ESHQLTB.js.map