@opengeni/sdk 6.1.0 → 7.0.0

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
@@ -1,9 +1,17 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-64S3VKJU.js";
3
+ } from "./chunk-7ESHQLTB.js";
4
4
 
5
5
  // src/document-authority-client.ts
6
6
  var OpenGeniDocumentAuthorityClient = class extends OpenGeniClient {
7
+ /** Issue an exact-session or standing personal-resource grant. */
8
+ async issueUserResourceGrant(workspaceId, authorityId, request) {
9
+ return await this.requestJson(
10
+ "POST",
11
+ `/v1/workspaces/${workspaceId}/user-resource-authorities/${authorityId}/grants`,
12
+ request
13
+ );
14
+ }
7
15
  async listDocumentBases(workspaceId) {
8
16
  return await this.requestJson(
9
17
  "GET",
@@ -124,4 +132,4 @@ var OpenGeniDocumentAuthorityClient = class extends OpenGeniClient {
124
132
  export {
125
133
  OpenGeniDocumentAuthorityClient
126
134
  };
127
- //# sourceMappingURL=chunk-IZH5F7QC.js.map
135
+ //# sourceMappingURL=chunk-L3MYVTPO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/document-authority-client.ts"],"sourcesContent":["import type { CompanyBrainOkfDownload, CompanyBrainOkfPackage } from \"./company-brain\";\nimport { OpenGeniClient as OpenGeniCoreClient } from \"./client\";\nimport type {\n Document,\n IssueUserResourceGrantRequest,\n UserResourceGrantMutationResponse,\n DocumentBase,\n FileDownloadUrlResponse,\n DocumentAuthorityReclassification,\n DocumentDefaultCollectionBackfill,\n DocumentDefaultCollectionBackfillAudit,\n GetDocumentDefaultCollectionBackfillAuditOptions,\n ListDocumentAuthorityReclassificationsOptions,\n ListDocumentAuthorityReclassificationsResponse,\n ListDocumentDefaultCollectionBackfillRunsResponse,\n ListOrganizationDocumentAuthorityReclassificationsResponse,\n ReclassifyDocumentAuthorityRequest,\n RunDocumentDefaultCollectionBackfillRequest,\n} from \"./types\";\n\n/**\n * Operator-only Document authority and tenancy-backfill surface.\n *\n * The public root and legacy `core` clients extend this class for compatibility.\n * Browser consoles that import `@opengeni/sdk/browser` do not retain these\n * methods or their routes.\n */\nexport class OpenGeniDocumentAuthorityClient extends OpenGeniCoreClient {\n /** Issue an exact-session or standing personal-resource grant. */\n async issueUserResourceGrant(\n workspaceId: string,\n authorityId: string,\n request: IssueUserResourceGrantRequest,\n ): Promise<UserResourceGrantMutationResponse> {\n return await this.requestJson<UserResourceGrantMutationResponse>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/user-resource-authorities/${authorityId}/grants`,\n request,\n );\n }\n\n async listDocumentBases(workspaceId: string): Promise<DocumentBase[]> {\n return await this.requestJson<DocumentBase[]>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/document-bases`,\n );\n }\n\n /**\n * List every Document the current human can manage from this workspace,\n * including portable personal and organization-scoped Documents whose\n * immutable ingestion workspace is different.\n */\n async listAccessibleDocuments(workspaceId: string): Promise<Document[]> {\n return await this.requestJson<Document[]>(\"GET\", `/v1/workspaces/${workspaceId}/documents`);\n }\n\n /** Mint a source-file URL through the Document's effective authority. */\n async createDocumentOriginalFileDownloadUrl(\n workspaceId: string,\n documentId: string,\n ): Promise<FileDownloadUrlResponse> {\n return await this.requestJson<FileDownloadUrlResponse>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/documents/${documentId}/original-file/download-url`,\n );\n }\n\n /** Retry indexing for a failed document. */\n async reindexDocument(\n workspaceId: string,\n baseId: string,\n documentId: string,\n ): Promise<Document> {\n return await this.requestJson<Document>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/document-bases/${baseId}/documents/${documentId}/reindex`,\n );\n }\n\n /** Permission-filtered Company Brain package with authorized guidance bodies. */\n getCompanyBrain(workspaceId: string): Promise<CompanyBrainOkfPackage> {\n return this.requestJson<CompanyBrainOkfPackage>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/company-brain`,\n );\n }\n\n /** Download the deterministic Markdown/YAML Company Brain package. */\n async exportCompanyBrainOkf(workspaceId: string): Promise<CompanyBrainOkfDownload> {\n const response = await this.requestResponse(\n \"GET\",\n `/v1/workspaces/${workspaceId}/company-brain/export`,\n );\n const headers = response.headers;\n return {\n content: await response.text(),\n contentType: headers.get(\"content-type\") ?? \"text/markdown\",\n filename: headers.get(\"content-disposition\")?.split('\"')[1] ?? \"company-brain.okf.md\",\n };\n }\n\n /**\n * Atomically reclassify a Document's authority and every indexed chunk.\n * The operation is replay-safe and rejects a stale expected authority tuple.\n */\n async reclassifyDocumentAuthority(\n workspaceId: string,\n documentId: string,\n request: ReclassifyDocumentAuthorityRequest,\n ): Promise<DocumentAuthorityReclassification> {\n return await this.requestJson<DocumentAuthorityReclassification>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/documents/${documentId}/authority-reclassifications`,\n request,\n );\n }\n\n /** List the current actor's durable authority-reclassification receipts. */\n async listDocumentAuthorityReclassifications(\n workspaceId: string,\n documentId: string,\n options: ListDocumentAuthorityReclassificationsOptions = {},\n ): Promise<ListDocumentAuthorityReclassificationsResponse> {\n const params = new URLSearchParams();\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.cursor) params.set(\"cursor\", options.cursor);\n const query = params.size > 0 ? `?${params.toString()}` : \"\";\n return await this.requestJson<ListDocumentAuthorityReclassificationsResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/documents/${documentId}/authority-reclassifications${query}`,\n );\n }\n\n /**\n * Advance one resumable, organization-scoped Default collection backfill.\n * Reusing an operation ID is idempotent; keep the run ID across batches.\n */\n async runDocumentDefaultCollectionBackfill(\n workspaceId: string,\n request: RunDocumentDefaultCollectionBackfillRequest,\n ): Promise<DocumentDefaultCollectionBackfill> {\n return await this.requestJson<DocumentDefaultCollectionBackfill>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/document-default-collection-backfills`,\n request,\n );\n }\n\n /** List organization-scoped Default collection backfill runs (organization admin only). */\n async listDocumentDefaultCollectionBackfillRuns(\n workspaceId: string,\n options: ListDocumentAuthorityReclassificationsOptions = {},\n ): Promise<ListDocumentDefaultCollectionBackfillRunsResponse> {\n const params = new URLSearchParams();\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.cursor) params.set(\"cursor\", options.cursor);\n const query = params.size > 0 ? `?${params.toString()}` : \"\";\n return await this.requestJson<ListDocumentDefaultCollectionBackfillRunsResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/document-default-collection-backfills${query}`,\n );\n }\n\n /** Read bounded operation and workspace receipts for one Default-collection backfill run. */\n async getDocumentDefaultCollectionBackfillAudit(\n workspaceId: string,\n runId: string,\n options: GetDocumentDefaultCollectionBackfillAuditOptions = {},\n ): Promise<DocumentDefaultCollectionBackfillAudit> {\n const params = new URLSearchParams();\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.operationCursor) params.set(\"operationCursor\", options.operationCursor);\n if (options.receiptCursor) params.set(\"receiptCursor\", options.receiptCursor);\n const query = params.size > 0 ? `?${params.toString()}` : \"\";\n return await this.requestJson<DocumentDefaultCollectionBackfillAudit>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/document-default-collection-backfills/${runId}${query}`,\n );\n }\n\n /** List organization-wide Document authority changes (organization admin only). */\n async listOrganizationDocumentAuthorityReclassifications(\n workspaceId: string,\n options: ListDocumentAuthorityReclassificationsOptions = {},\n ): Promise<ListOrganizationDocumentAuthorityReclassificationsResponse> {\n const params = new URLSearchParams();\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.cursor) params.set(\"cursor\", options.cursor);\n const query = params.size > 0 ? `?${params.toString()}` : \"\";\n return await this.requestJson<ListOrganizationDocumentAuthorityReclassificationsResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/document-authority-reclassifications${query}`,\n );\n }\n}\n"],"mappings":";;;;;AA2BO,IAAM,kCAAN,cAA8C,eAAmB;AAAA;AAAA,EAEtE,MAAM,uBACJ,aACA,aACA,SAC4C;AAC5C,WAAO,MAAM,KAAK;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW,8BAA8B,WAAW;AAAA,MACtE;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,kBAAkB,aAA8C;AACpE,WAAO,MAAM,KAAK;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW;AAAA,IAC/B;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,wBAAwB,aAA0C;AACtE,WAAO,MAAM,KAAK,YAAwB,OAAO,kBAAkB,WAAW,YAAY;AAAA,EAC5F;AAAA;AAAA,EAGA,MAAM,sCACJ,aACA,YACkC;AAClC,WAAO,MAAM,KAAK;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW,cAAc,UAAU;AAAA,IACvD;AAAA,EACF;AAAA;AAAA,EAGA,MAAM,gBACJ,aACA,QACA,YACmB;AACnB,WAAO,MAAM,KAAK;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW,mBAAmB,MAAM,cAAc,UAAU;AAAA,IAChF;AAAA,EACF;AAAA;AAAA,EAGA,gBAAgB,aAAsD;AACpE,WAAO,KAAK;AAAA,MACV;AAAA,MACA,kBA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-64S3VKJU.js";
6
+ } from "./chunk-7ESHQLTB.js";
7
7
  import {
8
8
  OpenGeniApiError
9
9
  } from "./chunk-OO5LPTO7.js";
@@ -636,4 +636,4 @@ export {
636
636
  isOpenGeniSiteBridgeCancelMessage,
637
637
  sanitizeOpenGeniSiteToolCallRequest
638
638
  };
639
- //# sourceMappingURL=chunk-CFSYTYMA.js.map
639
+ //# sourceMappingURL=chunk-MXQX4M36.js.map
@@ -1,39 +1,17 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-4ZQQQBOH.js";
3
+ } from "./chunk-RCVWE6UR.js";
4
4
 
5
5
  // src/embedding-client.ts
6
6
  var OpenGeniEmbeddingClient = class extends OpenGeniClient {
7
- /** Server-only organization administration. First registration opts the whole
8
- * organization into exact namespace routing, including future workspaces. */
9
- async putHostMcpResolver(organizationId, externalSource, request, options) {
10
- return this.requestJson(
11
- "PUT",
12
- `/v1/organizations/${organizationId}/mcp-credential-resolvers/${encodeURIComponent(externalSource)}`,
13
- request,
14
- {},
15
- options
16
- );
17
- }
18
- async getHostMcpResolver(organizationId, externalSource, options) {
19
- return this.requestJson(
7
+ /** Recover this actor's connection creation result without resending secrets.
8
+ * A 404 means no visible committed result, not proof that an in-flight write failed. */
9
+ async getConnectionCreationResult(workspaceId, operationId) {
10
+ const response = await this.requestJson(
20
11
  "GET",
21
- `/v1/organizations/${organizationId}/mcp-credential-resolvers/${encodeURIComponent(externalSource)}`,
22
- void 0,
23
- {},
24
- options
25
- );
26
- }
27
- /** Retains registration identity and namespace opt-in. Replays never restore
28
- * a previous endpoint/secret. Use put with the current generation to reactivate. */
29
- async revokeHostMcpResolver(organizationId, externalSource, request, options) {
30
- return this.requestJson(
31
- "POST",
32
- `/v1/organizations/${organizationId}/mcp-credential-resolvers/${encodeURIComponent(externalSource)}/revoke`,
33
- request,
34
- {},
35
- options
12
+ `/v1/workspaces/${encodeURIComponent(workspaceId)}/connections/operations/${encodeURIComponent(operationId)}`
36
13
  );
14
+ return response.connection;
37
15
  }
38
16
  /** Rotate existing inline credentials only while no credential-consuming work
39
17
  * is pending or active. Reuse the operation key and exact request to reconcile
@@ -160,63 +138,6 @@ var OpenGeniEmbeddingClient = class extends OpenGeniClient {
160
138
  async listConnectProviders(workspaceId) {
161
139
  return this.requestJson("GET", `/v1/workspaces/${workspaceId}/connect/catalog`);
162
140
  }
163
- /** Register credential-free, external-owner host authority. Does not itself
164
- * authorize an execution or install MCP tools. */
165
- async createHostMcpBinding(workspaceId, request, options = {}) {
166
- return this.requestJson(
167
- "POST",
168
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings`,
169
- request,
170
- {},
171
- options
172
- );
173
- }
174
- async getHostMcpBinding(workspaceId, bindingId, options = {}) {
175
- return this.requestJson(
176
- "GET",
177
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings/${encodeURIComponent(bindingId)}`,
178
- void 0,
179
- {},
180
- options
181
- );
182
- }
183
- async revokeHostMcpBinding(workspaceId, bindingId, request, options = {}) {
184
- return this.requestJson(
185
- "POST",
186
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-bindings/${encodeURIComponent(bindingId)}/revoke`,
187
- request,
188
- {},
189
- options
190
- );
191
- }
192
- /** Issue owner-scoped grant metadata; accepted execution must separately admit it. */
193
- async issueHostMcpDelegation(workspaceId, request, options = {}) {
194
- return this.requestJson(
195
- "POST",
196
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations`,
197
- request,
198
- {},
199
- options
200
- );
201
- }
202
- async getHostMcpDelegation(workspaceId, delegationId, options = {}) {
203
- return this.requestJson(
204
- "GET",
205
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations/${encodeURIComponent(delegationId)}`,
206
- void 0,
207
- {},
208
- options
209
- );
210
- }
211
- async revokeHostMcpDelegation(workspaceId, delegationId, request, options = {}) {
212
- return this.requestJson(
213
- "POST",
214
- `/v1/workspaces/${encodeURIComponent(workspaceId)}/host-mcp-delegations/${encodeURIComponent(delegationId)}/revoke`,
215
- request,
216
- {},
217
- options
218
- );
219
- }
220
141
  async listConnectAccounts(workspaceId) {
221
142
  return this.requestJson("GET", `/v1/workspaces/${workspaceId}/connect/accounts`);
222
143
  }
@@ -250,4 +171,4 @@ var OpenGeniEmbeddingClient = class extends OpenGeniClient {
250
171
  export {
251
172
  OpenGeniEmbeddingClient
252
173
  };
253
- //# sourceMappingURL=chunk-VDACQXJZ.js.map
174
+ //# sourceMappingURL=chunk-N76DIO4E.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/embedding-client.ts"],"sourcesContent":["import { OpenGeniClient as OpenGeniArtifactClient } from \"./artifact-client\";\nimport type { OpenGeniClientOptions } from \"./client\";\nimport type { AddWorkspaceMemberRequest } from \"./types\";\nimport type {\n ExternalIdentityLink,\n BeginExternalIdentityLinkRequest,\n BeginExternalIdentityLinkResponse,\n ConfirmExternalIdentityLinkRequest,\n ExternalIdentityLinkPreview,\n ExternalIdentityLinkPage,\n} from \"@opengeni/contracts/external-identities\";\n\n/** Public product embedding administration, kept out of the native browser client. */\nexport class OpenGeniEmbeddingClient extends OpenGeniArtifactClient {\n /** Recover this actor's connection creation result without resending secrets.\n * A 404 means no visible committed result, not proof that an in-flight write failed. */\n async getConnectionCreationResult(\n workspaceId: string,\n operationId: string,\n ): Promise<import(\"./types\").ConnectionMetadata> {\n const response = await this.requestJson<import(\"./types\").ConnectionResponse>(\n \"GET\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/connections/operations/${encodeURIComponent(operationId)}`,\n );\n return response.connection;\n }\n\n /** Rotate existing inline credentials only while no credential-consuming work\n * is pending or active. Reuse the operation key and exact request to reconcile\n * a lost response. This operation never schedules or retries model work. */\n async rotateSessionMcpCredentials(\n workspaceId: string,\n sessionId: string,\n request: import(\"./types\").RotateSessionMcpCredentialsRequest,\n ): Promise<import(\"./types\").RotateSessionMcpCredentialsReceipt> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${workspaceId}/sessions/${sessionId}/mcp-credentials/rotate`,\n request,\n );\n }\n\n /** Server-side organization-key client scoped to one host-authenticated user.\n * Does not mutate this client, provision workspace membership, or link native\n * identities. The API verifies key and membership authority on each request. */\n asUser(externalId: string, options: { source?: string } = {}): this {\n if (typeof window !== \"undefined\")\n throw new Error(\"asUser is a server-side API; keep organization keys on your backend\");\n const source = options.source ?? \"default\";\n const validOpaqueText = (value: unknown, maxBytes: number): value is string =>\n typeof value === \"string\" &&\n value.length > 0 &&\n value.length <= maxBytes &&\n !value.includes(\"\\0\") &&\n !/[\\uD800-\\uDFFF]/u.test(value) &&\n new TextEncoder().encode(value).byteLength <= maxBytes;\n if (!validOpaqueText(externalId, 1024) || !validOpaqueText(source, 200)) {\n throw new Error(\"Invalid external identity reference\");\n }\n const Client = this.constructor as new (options: OpenGeniClientOptions) => this;\n const client = new Client({ ...this.options });\n client.externalActorHeader = encodeURIComponent(\n JSON.stringify({ mode: \"external\", identity: { externalId, source } }),\n );\n return client;\n }\n\n /** Explicitly use a confirmed native delegation. Unlike asUser, new resources\n * belong to the native user. Existing external resources are never reassigned.\n * A stale, expired or revoked link is rejected by the server on every request. */\n asLinkedUser(\n externalId: string,\n options: { source?: string; linkId: string; expectedLinkRevision: number },\n ): this {\n if (\n !/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(options.linkId) ||\n !Number.isSafeInteger(options.expectedLinkRevision) ||\n options.expectedLinkRevision < 1\n )\n throw new Error(\"A confirmed identity link and its exact revision are required\");\n const client = this.asUser(\n externalId,\n options.source === undefined ? {} : { source: options.source },\n );\n const identity = JSON.parse(decodeURIComponent(client.externalActorHeader!)).identity;\n client.externalActorHeader = encodeURIComponent(\n JSON.stringify({\n mode: \"linked_native\",\n identity,\n linkId: options.linkId,\n expectedLinkRevision: options.expectedLinkRevision,\n }),\n );\n return client;\n }\n\n /** Optional native-account delegation. Invoke on a server-side asUser client.\n * Pass the one-time challenge to the native consent screen, never a URL query\n * or analytics event. Ordinary external embedding needs none of this. */\n async beginIdentityLink(\n workspaceId: string,\n input: BeginExternalIdentityLinkRequest,\n ): Promise<BeginExternalIdentityLinkResponse> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links`,\n input,\n );\n }\n\n async getIdentityLink(workspaceId: string, linkId: string): Promise<ExternalIdentityLink> {\n return this.requestJson(\n \"GET\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links/${encodeURIComponent(linkId)}`,\n );\n }\n\n /** Only links belonging to the effective participant; no organization-wide directory. */\n async listIdentityLinks(workspaceId: string, cursor?: string): Promise<ExternalIdentityLinkPage> {\n return this.requestJson(\n \"GET\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links${cursor ? `?cursor=${encodeURIComponent(cursor)}` : \"\"}`,\n );\n }\n\n /** Requires a canonical native browser session, not an organization API key. */\n async previewIdentityLink(\n workspaceId: string,\n linkId: string,\n challenge: string,\n ): Promise<ExternalIdentityLinkPreview> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links/${encodeURIComponent(linkId)}/preview`,\n { challenge },\n );\n }\n\n async confirmIdentityLink(\n workspaceId: string,\n linkId: string,\n input: ConfirmExternalIdentityLinkRequest,\n ): Promise<ExternalIdentityLink> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links/${encodeURIComponent(linkId)}/confirm`,\n input,\n );\n }\n\n async revokeIdentityLink(\n workspaceId: string,\n linkId: string,\n expectedRevision: number,\n ): Promise<ExternalIdentityLink> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${encodeURIComponent(workspaceId)}/identity-links/${encodeURIComponent(linkId)}/revoke`,\n { expectedRevision },\n );\n }\n\n /** Service-only lifecycle for an external actor's organization membership.\n * A successful reactivation does not restore revoked workspace grants. */\n async updateExternalIdentityMembership(\n organizationId: string,\n membershipId: string,\n request: import(\"@opengeni/contracts/external-identities\").UpdateExternalIdentityMembershipRequest,\n options: { signal?: AbortSignal } = {},\n ): Promise<import(\"@opengeni/contracts\").OrganizationMember> {\n return this.requestJson(\n \"PATCH\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/external-members/${encodeURIComponent(membershipId)}`,\n request,\n undefined,\n options,\n );\n }\n\n /** Non-provisioning, content-free service lookup, including inactive identities. */\n async lookupExternalIdentity(\n organizationId: string,\n identity: import(\"@opengeni/contracts/external-identities\").ExternalIdentityReference,\n ): Promise<import(\"@opengeni/contracts/external-identities\").ExternalIdentityLookup> {\n return this.requestJson(\n \"POST\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/external-identities/lookup`,\n identity,\n );\n }\n\n /** Withdraw an external member's shared-workspace access and fence an exact\n * pending keyed grant. Reuse the exact cancellation body after response loss. */\n async cancelExternalWorkspaceMemberGrant(\n organizationId: string,\n workspaceId: string,\n membershipId: string,\n request: import(\"@opengeni/contracts/external-identities\").CancelExternalWorkspaceMemberGrantRequest,\n ): Promise<\n import(\"@opengeni/contracts/external-identities\").CancelExternalWorkspaceMemberGrantResponse\n > {\n return this.requestJson(\n \"POST\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/workspaces/${encodeURIComponent(workspaceId)}/members/${encodeURIComponent(membershipId)}/revoke`,\n request,\n );\n }\n\n async listConnectProviders(\n workspaceId: string,\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectProvider[]> {\n return this.requestJson(\"GET\", `/v1/workspaces/${workspaceId}/connect/catalog`);\n }\n\n async listConnectAccounts(\n workspaceId: string,\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectAccount[]> {\n return this.requestJson(\"GET\", `/v1/workspaces/${workspaceId}/connect/accounts`);\n }\n\n async getConnectAttempt(\n workspaceId: string,\n attemptId: string,\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectAttempt> {\n return this.requestJson(\"GET\", `/v1/workspaces/${workspaceId}/connect/attempts/${attemptId}`);\n }\n\n async listPendingConnectAttempts(\n workspaceId: string,\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectAttempt[]> {\n return this.requestJson(\"GET\", `/v1/workspaces/${workspaceId}/connect/attempts`);\n }\n\n async advanceConnectAttempt(\n workspaceId: string,\n attemptId: string,\n request: {\n expectedRevision: number;\n idempotencyKey: string;\n action: import(\"@opengeni/contracts/connect\").ConnectAdvance;\n },\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectAttempt> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${workspaceId}/connect/attempts/${attemptId}/advance`,\n request,\n );\n }\n\n /** Stops setup; does not revoke already committed provider credentials. */\n async cancelConnectAttempt(\n workspaceId: string,\n attemptId: string,\n request: {\n expectedRevision: number;\n idempotencyKey: string;\n },\n ): Promise<import(\"@opengeni/contracts/connect\").ConnectAttempt> {\n return this.requestJson(\n \"POST\",\n `/v1/workspaces/${workspaceId}/connect/attempts/${attemptId}/cancel`,\n request,\n );\n }\n\n /** Explicit organization-service-key onboarding; asUser never grants membership. */\n async addExternalWorkspaceMember(\n workspaceId: string,\n request: {\n identity: { externalId: string; source?: string };\n permissions: AddWorkspaceMemberRequest[\"permissions\"];\n operationId?: string;\n },\n ): Promise<import(\"@opengeni/contracts/external-identities\").ExternalIdentity> {\n return this.requestJson(\"POST\", `/v1/workspaces/${workspaceId}/external-members`, request);\n }\n}\n"],"mappings":";;;;;AAaO,IAAM,0BAAN,cAAsC,eAAuB;AAAA;AAAA;AAAA,EAGlE,MAAM,4BACJ,aACA,aAC+C;AAC/C,UAAM,WAAW,MAAM,KAAK;AAAA,MAC1B;AAAA,MACA,kBAAkB,mBAAmB,WAAW,CAAC,2BAA2B,mBAAmB,WAAW,CAAC;AAAA,IAC7G;AACA,WAAO,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,4BACJ,aACA,WACA,SAC+D;AAC/D,WAAO,KAAK;AAAA,MACV;AAA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,aACA,SAK6E;AAC7E,WAAO,KAAK,YAAY,QAAQ,kBAAkB,WAAW,qBAAqB,OAAO;AAAA,EAC3F;AACF;","names":[]}
@@ -200,7 +200,7 @@ var KNOWN_PERMISSIONS = [
200
200
  "artifacts:read",
201
201
  "artifacts:publish"
202
202
  ];
203
- var OPENGENI_API_CONTRACT_REVISION = "2026-08-organization-recovery-custody-v1";
203
+ var OPENGENI_API_CONTRACT_REVISION = "2026-09-plugins-and-skills-v1";
204
204
  var OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract";
205
205
  var OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id";
206
206
  var RETAINED_OUTPUT_DEFAULT_PAGE_BYTES = 256 * 1024;
@@ -243,4 +243,4 @@ export {
243
243
  GENERATED_VIDEO_MAX_BYTES,
244
244
  KNOWN_USAGE_EVENT_TYPES
245
245
  };
246
- //# sourceMappingURL=chunk-CMEU67C4.js.map
246
+ //# sourceMappingURL=chunk-P7OFNKCH.js.map