@opengeni/sdk 3.3.2 → 3.7.0-canary.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 (76) hide show
  1. package/README.md +80 -6
  2. package/dist/artifact-client.d.ts +4 -2
  3. package/dist/artifacts.d.ts +1 -1
  4. package/dist/artifacts.js +6 -6
  5. package/dist/browser.d.ts +5 -2
  6. package/dist/browser.js +14 -4
  7. package/dist/{chunk-YXQX7RQT.js → chunk-2E2BFEEN.js} +2 -2
  8. package/dist/{chunk-JUS2UYRP.js → chunk-3QDQTYOE.js} +3 -1
  9. package/dist/chunk-3QDQTYOE.js.map +1 -0
  10. package/dist/{chunk-C2H7HBNP.js → chunk-7S2MZ65L.js} +6 -6
  11. package/dist/chunk-FMLDFJ2Q.js +246 -0
  12. package/dist/chunk-FMLDFJ2Q.js.map +1 -0
  13. package/dist/{chunk-TRNI7KEO.js → chunk-IQTEPOI3.js} +228 -26
  14. package/dist/chunk-IQTEPOI3.js.map +1 -0
  15. package/dist/chunk-IRAEPLXG.js +350 -0
  16. package/dist/chunk-IRAEPLXG.js.map +1 -0
  17. package/dist/{chunk-QT3KFVDP.js → chunk-MPGVC7EO.js} +10 -2
  18. package/dist/chunk-MPGVC7EO.js.map +1 -0
  19. package/dist/{chunk-C4DJPZRU.js → chunk-OO5LPTO7.js} +14 -1
  20. package/dist/chunk-OO5LPTO7.js.map +1 -0
  21. package/dist/{chunk-KKRO2VCP.js → chunk-QTBAMHEF.js} +2 -2
  22. package/dist/client.d.ts +51 -11
  23. package/dist/codex-realtime-controller.js +2 -2
  24. package/dist/core.d.ts +5 -2
  25. package/dist/core.js +17 -7
  26. package/dist/document-authority.js +5 -5
  27. package/dist/editable-artifacts.js +4 -4
  28. package/dist/errors.d.ts +12 -0
  29. package/dist/github-repositories.d.ts +10 -0
  30. package/dist/github-repositories.js +36 -0
  31. package/dist/github-repositories.js.map +1 -0
  32. package/dist/index.d.ts +13 -6
  33. package/dist/index.js +99 -52
  34. package/dist/index.js.map +1 -1
  35. package/dist/interaction.js +2 -2
  36. package/dist/model-context.d.ts +49 -0
  37. package/dist/model-picker-order.d.ts +1 -0
  38. package/dist/model-picker-order.js +10 -0
  39. package/dist/model-picker-order.js.map +1 -0
  40. package/dist/proxy.d.ts +7 -5
  41. package/dist/realtime.js +2 -2
  42. package/dist/session-titles.d.ts +2 -28
  43. package/dist/site.d.ts +93 -0
  44. package/dist/site.js +35 -0
  45. package/dist/site.js.map +1 -0
  46. package/dist/stream.d.ts +2 -0
  47. package/dist/tools-FSTY4FAY.js +12 -0
  48. package/dist/tools-FSTY4FAY.js.map +1 -0
  49. package/dist/tools.d.ts +61 -0
  50. package/dist/types.d.ts +231 -9
  51. package/dist/workspace-artifacts.d.ts +26 -1
  52. package/package.json +14 -2
  53. package/src/artifact-client.ts +16 -1
  54. package/src/artifacts.ts +1 -0
  55. package/src/browser.ts +16 -0
  56. package/src/client.ts +332 -22
  57. package/src/core.ts +16 -0
  58. package/src/errors.ts +23 -0
  59. package/src/github-repositories.ts +60 -0
  60. package/src/index.ts +94 -1
  61. package/src/model-context.ts +69 -0
  62. package/src/model-picker-order.ts +6 -0
  63. package/src/proxy.ts +17 -6
  64. package/src/session-titles.ts +8 -82
  65. package/src/site.ts +544 -0
  66. package/src/stream.ts +29 -8
  67. package/src/tools.ts +396 -0
  68. package/src/types.ts +287 -10
  69. package/src/workspace-artifacts.ts +33 -2
  70. package/dist/chunk-C4DJPZRU.js.map +0 -1
  71. package/dist/chunk-JUS2UYRP.js.map +0 -1
  72. package/dist/chunk-QT3KFVDP.js.map +0 -1
  73. package/dist/chunk-TRNI7KEO.js.map +0 -1
  74. /package/dist/{chunk-YXQX7RQT.js.map → chunk-2E2BFEEN.js.map} +0 -0
  75. /package/dist/{chunk-C2H7HBNP.js.map → chunk-7S2MZ65L.js.map} +0 -0
  76. /package/dist/{chunk-KKRO2VCP.js.map → chunk-QTBAMHEF.js.map} +0 -0
package/README.md CHANGED
@@ -84,10 +84,22 @@ session. There is no organization-wide Skill registry or Skill inheritance in
84
84
  this integration contract. See the canonical guide for the complete route map,
85
85
  security boundary, and delivery checklist.
86
86
 
87
+ Installed Pack Skills normally remain workspace-managed. A Pack may instead
88
+ mark guidance as `session_selected`; installation then exposes it to no agent
89
+ until `createSession` names the reviewed immutable component in
90
+ `installedSkillIds`. OpenGeni copies that exact artifact into the new session,
91
+ so omitting the field from customer-facing creates is a real contamination
92
+ boundary rather than a prompt convention.
93
+ The ordered selection is part of keyed-create identity: reusing an
94
+ `idempotencyKey` with a different selection returns a conflict instead of the
95
+ session configured by the earlier request.
96
+
87
97
  For session lists, `deriveSessionDisplayTitle(session)` returns the durable
88
98
  agent/user title when available. While the automatic title is still pending, it
89
- shows a short, sensitive-safe preview of the opening prompt and automatically
90
- yields to the later `session.title_set` value.
99
+ shows the first short, sensitive-safe line of the opening prompt, skipping an
100
+ unsafe pasted URL or identifier when later safe text exists. If no safe line is
101
+ available, a short session reference keeps rows distinguishable. The display
102
+ automatically yields to the later `session.title_set` value.
91
103
 
92
104
  Browser consoles that do not need operator-only surfaces can import
93
105
  `OpenGeniBrowserClient` from `@opengeni/sdk/browser`. Document authority migration
@@ -410,10 +422,13 @@ assign product types such as app, page, dashboard, or gallery. List pages are
410
422
  bounded and expose both `truncated` and an opaque `nextCursor` so callers never
411
423
  mistake a partial page for the complete workspace catalog.
412
424
 
413
- The initial web renderer supports semantic HTML, inline CSS, CSS-only
414
- interactions, and inline SVG. It removes JavaScript, event handlers, forms,
415
- embeds, external URLs, and other active or navigation-capable markup before
416
- rendering. Executable artifacts require a later, stronger isolation boundary.
425
+ Each Site version retains one self-contained executable HTML runtime, its
426
+ bounded editable source bundle, and the exact canonical tool identities it
427
+ requested. The web host renders that runtime in an opaque-origin sandboxed
428
+ iframe. Credentials, cookies, API URLs, workspace ids, and parent DOM authority
429
+ never enter the iframe; `@opengeni/sdk/site` uses a single parent-owned
430
+ `MessagePort` that exposes only the retained tool allowlist intersected with the
431
+ current viewer's live workspace catalog.
417
432
 
418
433
  ```ts
419
434
  let cursor: string | undefined;
@@ -433,6 +448,64 @@ return the exact source session, turn, attempt, and execution generation that
433
448
  published them. Version and event history are bounded; inspect
434
449
  `versionsTruncated` and `eventsTruncated` on the detail response.
435
450
 
451
+ ## Workspace tools
452
+
453
+ The browser-safe SDK exposes the same gateway catalog and executor used by
454
+ model MCP calls and Codemode. Generated declarations augment the lazy namespace
455
+ for exact installed-tool types; canonical `{ serverId, toolName }` identity and
456
+ the server-side catalog remain authoritative.
457
+
458
+ ```ts
459
+ const tools = client.tools.forWorkspace(workspaceId);
460
+ const documents = await tools.docs.search({ query: "launch plan" });
461
+ ```
462
+
463
+ An approval-required call needs a server-issued capability. A trusted host
464
+ shows its approval UI first, then asks for one token bound to the current human,
465
+ workspace, operation id, catalog digest, exact tool identity, and arguments.
466
+ The token expires after five minutes, is stored only as a hash, and is consumed
467
+ once by the matching call.
468
+
469
+ Connection-backed tools configured for both provider policy and one-shot human
470
+ approval are omitted from this HTTP catalog until their provider adapter can
471
+ preflight credential and resource authorization before consuming the token.
472
+
473
+ ```ts
474
+ const operationId = crypto.randomUUID();
475
+ const identity = { serverId: "linear", toolName: "issues_update" };
476
+ const input = { issueId, state: "Done" };
477
+ const approval = await tools.$approve(identity, input, { operationId });
478
+
479
+ await tools.$call(identity, input, {
480
+ operationId,
481
+ approvalToken: approval.approvalToken,
482
+ });
483
+ ```
484
+
485
+ When a call or approval request receives the typed
486
+ `409 details.code = "catalog_stale"` response, the SDK refreshes the catalog,
487
+ re-resolves the exact identity or generated namespace path, preserves the
488
+ operation id (generating it before the first attempt when omitted), and retries
489
+ once. A call that already carries an approval token cannot reuse that
490
+ single-use capability after the catalog digest changes; instead it throws
491
+ `OpenGeniToolReapprovalRequiredError` with the refreshed identity and digest so
492
+ the trusted host can show approval again for the same operation id.
493
+
494
+ Reapproval is valid only before the original capability is consumed. Once a
495
+ call crosses that boundary, the server retains a hash-only tombstone for the
496
+ operation id and rejects another approval with
497
+ `409 details.code = "tool_gateway_operation_already_started"` and
498
+ `outcomeUnknown: true`. The host must reconcile the provider outcome; it must
499
+ not turn an ambiguous call into a second approved execution by minting a fresh
500
+ operation id automatically.
501
+
502
+ Do not request approval capabilities speculatively or expose them to Site iframe
503
+ code. The host projects only the active immutable version's requested identities,
504
+ supplies the Site context on direct calls, and the server revalidates the active
505
+ version and viewer's live authority. The requested set is a maximum allowlist,
506
+ not an authority grant; ordinary gateway approval still applies. Archived Sites
507
+ receive no tool bridge.
508
+
436
509
  Omit `firstPartyMcpTools` for the complete OpenGeni tool catalog. An explicit
437
510
  `[]` exposes no broad first-party tools; attached resources and separately
438
511
  selected `files`/`docs` MCP servers are unaffected.
@@ -748,6 +821,7 @@ Every public endpoint group has typed methods:
748
821
  | Group | Methods |
749
822
  | --- | --- |
750
823
  | Access + workspaces | `getAccessContext`, `listWorkspaces`, `createWorkspace`, `ensureWorkspace`, `getWorkspace`, `updateWorkspace` |
824
+ | Managed organizations | `createOrganization` for first-time compatibility; `createAdditionalOrganization` for an already-onboarded human; `listOrganizationMemberships`, `listOrganizationInvitations`, `acceptOrganizationInvitation` |
751
825
  | Sessions + events | `createSession`, `listSessions`, `listSessionPage`, `listAgentTopology`, `getSession`, `getSessionLineage`, `updateSession`, `listEvents`, `sendEvent`, `sendMessage`, `steerMessage`, `pauseSession`, `resumeSession`, `cancelSession`, `sendApprovalDecision`, `streamEvents`, `openEventStream` |
752
826
  | Machines (bring-your-own-compute) | `listMachines`, `machineMetricsSeries`, `swapActiveSandbox`, `mintEnrollToken`, `lookupDeviceEnrollment`, `approveDeviceEnrollment`, `denyDeviceEnrollment` |
753
827
  | Turn queue | `getQueue`, `moveQueueItem`, `editQueueItem`, `steerQueueItem`, `deleteQueueItem` |
@@ -1,6 +1,7 @@
1
1
  import { OpenGeniDocumentAuthorityClient } from "./document-authority-client.js";
2
+ import type { FetchResponse } from "./client.js";
2
3
  import type { CreateEditableArtifactMaterializationRequest, CreateEditableArtifactResourceRequest, EditableArtifactListResource, EditableArtifactMaterializationJobResource, EditableArtifactPinnedVersionResource, EditableArtifactResource, ImportEditableArtifactResourceRequest, ListSessionEditableArtifactResourcesOptions, PinEditableArtifactVersionRequest, ReadEditableArtifactMaterializationOptions, ReadEditableArtifactResourceOptions } from "./editable-artifact-resources.js";
3
- import type { CreateWorkspaceArtifactRequest, PublishWorkspaceArtifactVersionRequest, RollbackWorkspaceArtifactRequest, WorkspaceArtifactContentResponse, WorkspaceArtifactDetailResponse, WorkspaceArtifactListOptions, WorkspaceArtifactListResponse, WorkspaceArtifactMutationResponse } from "./workspace-artifacts.js";
4
+ import type { CreateWorkspaceArtifactRequest, PublishWorkspaceArtifactVersionRequest, RollbackWorkspaceArtifactRequest, SetWorkspaceArtifactStatusRequest, WorkspaceArtifactContentResponse, WorkspaceArtifactDetailResponse, WorkspaceArtifactListOptions, WorkspaceArtifactListResponse, WorkspaceArtifactMutationResponse } from "./workspace-artifacts.js";
4
5
  /** Public SDK client. Optional operator and artifact operations stay out of the console core. */
5
6
  export declare class OpenGeniClient extends OpenGeniDocumentAuthorityClient {
6
7
  createEditableArtifact(workspaceId: string, request: CreateEditableArtifactResourceRequest, options?: Readonly<{
@@ -19,11 +20,12 @@ export declare class OpenGeniClient extends OpenGeniDocumentAuthorityClient {
19
20
  }>): Promise<EditableArtifactMaterializationJobResource>;
20
21
  getEditableArtifactMaterialization(workspaceId: string, artifactId: string, jobId: string, options: ReadEditableArtifactMaterializationOptions): Promise<EditableArtifactMaterializationJobResource>;
21
22
  /** The caller owns the returned bounded response stream. */
22
- downloadEditableArtifactMaterialization(workspaceId: string, artifactId: string, jobId: string, options: ReadEditableArtifactMaterializationOptions): Promise<Response>;
23
+ downloadEditableArtifactMaterialization(workspaceId: string, artifactId: string, jobId: string, options: ReadEditableArtifactMaterializationOptions): Promise<FetchResponse>;
23
24
  listWorkspaceArtifacts(workspaceId: string, options?: WorkspaceArtifactListOptions): Promise<WorkspaceArtifactListResponse>;
24
25
  getWorkspaceArtifact(workspaceId: string, artifactId: string): Promise<WorkspaceArtifactDetailResponse>;
25
26
  getWorkspaceArtifactContent(workspaceId: string, artifactId: string, versionId?: string): Promise<WorkspaceArtifactContentResponse>;
26
27
  createWorkspaceArtifact(workspaceId: string, request: CreateWorkspaceArtifactRequest): Promise<WorkspaceArtifactMutationResponse>;
27
28
  publishWorkspaceArtifactVersion(workspaceId: string, artifactId: string, request: PublishWorkspaceArtifactVersionRequest): Promise<WorkspaceArtifactMutationResponse>;
28
29
  rollbackWorkspaceArtifact(workspaceId: string, artifactId: string, request: RollbackWorkspaceArtifactRequest): Promise<WorkspaceArtifactMutationResponse>;
30
+ setWorkspaceArtifactStatus(workspaceId: string, artifactId: string, request: SetWorkspaceArtifactStatusRequest): Promise<WorkspaceArtifactMutationResponse>;
29
31
  }
@@ -1,4 +1,4 @@
1
1
  /** Artifact-only API client entry; keeps unrelated SDK surfaces out of editor bundles. */
2
2
  export { OpenGeniClient } from "./artifact-client.js";
3
3
  export type { CreateEditableArtifactMaterializationRequest, CreateEditableArtifactResourceRequest, EditableArtifactListResource, EditableArtifactMaterializationFormat, EditableArtifactMaterializationJobResource, EditableArtifactMaterializationResultResource, EditableArtifactPinnedVersionResource, EditableArtifactResource, ListSessionEditableArtifactResourcesOptions, PinEditableArtifactVersionRequest, ReadEditableArtifactMaterializationOptions, ReadEditableArtifactResourceOptions, } from "./editable-artifact-resources.js";
4
- export type { FetchLike, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, } from "./client.js";
4
+ export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, } from "./client.js";
package/dist/artifacts.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-QT3KFVDP.js";
4
- import "./chunk-YXQX7RQT.js";
5
- import "./chunk-TRNI7KEO.js";
6
- import "./chunk-JUS2UYRP.js";
7
- import "./chunk-KKRO2VCP.js";
8
- import "./chunk-C4DJPZRU.js";
3
+ } from "./chunk-MPGVC7EO.js";
4
+ import "./chunk-2E2BFEEN.js";
5
+ import "./chunk-IQTEPOI3.js";
6
+ import "./chunk-QTBAMHEF.js";
7
+ import "./chunk-3QDQTYOE.js";
8
+ import "./chunk-OO5LPTO7.js";
9
9
  export {
10
10
  OpenGeniClient
11
11
  };
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,9 @@
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 { FetchLike, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
4
- export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSessionListCursorError, OpenGeniStreamError, isRetryableStreamError, } from "./errors.js";
3
+ export { OpenGeniToolCallError, OpenGeniToolReapprovalRequiredError, OpenGeniToolsClient, } from "./tools.js";
4
+ export type { OpenGeniGeneratedTools, OpenGeniDynamicToolNode, OpenGeniToolCallOptions, OpenGeniToolFunction, OpenGeniToolsFacade, OpenGeniWorkspaceTools, } from "./tools.js";
5
+ export type { FetchLike, FetchResponse, GetSessionOptions, OpenGeniClientOptions, OpenGeniRequestOptions, SendMessageInput, SteerMessageResult, TranscribeAudioInput, WorkspaceControlEventPage, } from "./client.js";
6
+ export { OpenGeniApiContractMismatchError, OpenGeniApiError, OpenGeniSecureContextRequiredError, OpenGeniSessionListCursorError, OpenGeniStreamError, isRetryableStreamError, } from "./errors.js";
7
+ export type { OpenGeniSecureContextRequiredReason } from "./errors.js";
5
8
  export { resolveWorkspaceVoiceInputEnabled } from "./transcription.js";
6
9
  export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types.js";
package/dist/browser.js CHANGED
@@ -1,29 +1,39 @@
1
1
  import {
2
2
  resolveWorkspaceVoiceInputEnabled
3
3
  } from "./chunk-VYCTL62C.js";
4
+ import {
5
+ OpenGeniToolCallError,
6
+ OpenGeniToolReapprovalRequiredError,
7
+ OpenGeniToolsClient
8
+ } from "./chunk-FMLDFJ2Q.js";
4
9
  import {
5
10
  OpenGeniClient
6
- } from "./chunk-TRNI7KEO.js";
11
+ } from "./chunk-IQTEPOI3.js";
12
+ import "./chunk-QTBAMHEF.js";
7
13
  import {
8
14
  OPENGENI_API_CONTRACT_HEADER,
9
15
  OPENGENI_API_CONTRACT_REVISION
10
- } from "./chunk-JUS2UYRP.js";
11
- import "./chunk-KKRO2VCP.js";
16
+ } from "./chunk-3QDQTYOE.js";
12
17
  import {
13
18
  OpenGeniApiContractMismatchError,
14
19
  OpenGeniApiError,
20
+ OpenGeniSecureContextRequiredError,
15
21
  OpenGeniSessionListCursorError,
16
22
  OpenGeniStreamError,
17
23
  isRetryableStreamError
18
- } from "./chunk-C4DJPZRU.js";
24
+ } from "./chunk-OO5LPTO7.js";
19
25
  export {
20
26
  OPENGENI_API_CONTRACT_HEADER,
21
27
  OPENGENI_API_CONTRACT_REVISION,
22
28
  OpenGeniApiContractMismatchError,
23
29
  OpenGeniApiError,
24
30
  OpenGeniClient as OpenGeniBrowserClient,
31
+ OpenGeniSecureContextRequiredError,
25
32
  OpenGeniSessionListCursorError,
26
33
  OpenGeniStreamError,
34
+ OpenGeniToolCallError,
35
+ OpenGeniToolReapprovalRequiredError,
36
+ OpenGeniToolsClient,
27
37
  isRetryableStreamError,
28
38
  resolveWorkspaceVoiceInputEnabled
29
39
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-TRNI7KEO.js";
3
+ } from "./chunk-IQTEPOI3.js";
4
4
 
5
5
  // src/document-authority-client.ts
6
6
  var OpenGeniDocumentAuthorityClient = class extends OpenGeniClient {
@@ -76,4 +76,4 @@ var OpenGeniDocumentAuthorityClient = class extends OpenGeniClient {
76
76
  export {
77
77
  OpenGeniDocumentAuthorityClient
78
78
  };
79
- //# sourceMappingURL=chunk-YXQX7RQT.js.map
79
+ //# sourceMappingURL=chunk-2E2BFEEN.js.map
@@ -52,6 +52,8 @@ var SESSION_EVENT_TYPES = [
52
52
  "sandbox.operation.failed",
53
53
  "session.command.backgrounded",
54
54
  "session.command.finished",
55
+ "session.wait.started",
56
+ "session.wait.finished",
55
57
  "sandbox.command.output.delta",
56
58
  "artifact.created",
57
59
  "goal.set",
@@ -236,4 +238,4 @@ export {
236
238
  GENERATED_VIDEO_MAX_BYTES,
237
239
  KNOWN_USAGE_EVENT_TYPES
238
240
  };
239
- //# sourceMappingURL=chunk-JUS2UYRP.js.map
241
+ //# sourceMappingURL=chunk-3QDQTYOE.js.map