@opengeni/sdk 0.52.1 → 1.0.1

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 +67 -7
  2. package/dist/artifacts.js +5 -5
  3. package/dist/{chunk-FRJFNDIR.js → chunk-4DV37UUA.js} +6 -2
  4. package/dist/chunk-4DV37UUA.js.map +1 -0
  5. package/dist/{chunk-KIHGPM7H.js → chunk-A5DC5WEM.js} +288 -45
  6. package/dist/chunk-A5DC5WEM.js.map +1 -0
  7. package/dist/{chunk-V5F253OG.js → chunk-GU6JF75T.js} +6 -3
  8. package/dist/chunk-GU6JF75T.js.map +1 -0
  9. package/dist/{chunk-MZWTWOX6.js → chunk-ST5DDKJP.js} +327 -1
  10. package/dist/chunk-ST5DDKJP.js.map +1 -0
  11. package/dist/{chunk-FHI4DFIG.js → chunk-TYZ4JL4J.js} +2 -2
  12. package/dist/{chunk-ILQZR5N6.js → chunk-YGH5P47G.js} +693 -34
  13. package/dist/chunk-YGH5P47G.js.map +1 -0
  14. package/dist/{chunk-DXDL7EEW.js → chunk-YKZME56C.js} +197 -113
  15. package/dist/chunk-YKZME56C.js.map +1 -0
  16. package/dist/client.d.ts +108 -18
  17. package/dist/codex-realtime-controller.d.ts +5 -0
  18. package/dist/codex-realtime-controller.js +2 -2
  19. package/dist/codex-realtime-v3.d.ts +13 -2
  20. package/dist/core.js +7 -7
  21. package/dist/desktop.d.ts +8 -0
  22. package/dist/editable-artifacts.js +4 -4
  23. package/dist/gateway-realtime-transport.d.ts +1 -0
  24. package/dist/gateway-realtime-transport.js +5 -3
  25. package/dist/index.d.ts +6 -2
  26. package/dist/index.js +68 -34
  27. package/dist/index.js.map +1 -1
  28. package/dist/interaction-revision-stream.d.ts +11 -0
  29. package/dist/interaction.d.ts +604 -5
  30. package/dist/interaction.js +27 -1
  31. package/dist/realtime.d.ts +3 -3
  32. package/dist/realtime.js +11 -7
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/types.d.ts +283 -69
  35. package/dist/workspace-live-stream.d.ts +14 -0
  36. package/package.json +2 -2
  37. package/src/client.ts +863 -62
  38. package/src/codex-realtime-controller.ts +239 -12
  39. package/src/codex-realtime-lifecycle.ts +1 -0
  40. package/src/codex-realtime-v3.ts +162 -31
  41. package/src/desktop.ts +11 -1
  42. package/src/errors.ts +16 -2
  43. package/src/gateway-realtime-transport.ts +252 -109
  44. package/src/index.ts +42 -13
  45. package/src/interaction-revision-stream.ts +117 -0
  46. package/src/interaction.ts +1049 -5
  47. package/src/realtime.ts +14 -4
  48. package/src/types.ts +353 -72
  49. package/src/workspace-live-stream.ts +137 -0
  50. package/dist/chunk-DXDL7EEW.js.map +0 -1
  51. package/dist/chunk-FRJFNDIR.js.map +0 -1
  52. package/dist/chunk-ILQZR5N6.js.map +0 -1
  53. package/dist/chunk-KIHGPM7H.js.map +0 -1
  54. package/dist/chunk-MZWTWOX6.js.map +0 -1
  55. package/dist/chunk-V5F253OG.js.map +0 -1
  56. /package/dist/{chunk-FHI4DFIG.js.map → chunk-TYZ4JL4J.js.map} +0 -0
package/README.md CHANGED
@@ -139,6 +139,60 @@ and long-lived credentials are never placed in the WebSocket URL. Hosts may
139
139
  inject both `fetch` and the WebSocket factory for authenticated proxies and
140
140
  tests; negotiated frame and mutation limits are enforced before work is queued.
141
141
 
142
+ ## Browser and computer interaction (`@opengeni/sdk/interaction`)
143
+
144
+ An interaction **resource** is a workspace-scoped, durable object with a stable
145
+ id and lifecycle, such as a `BrowserSession`, `ComputerSession`, browser
146
+ identity, network route, auth run, or pending human intervention. This use of
147
+ "resource" is unrelated to the file/repository `resources` attached to a chat
148
+ message. A **facade** is only the typed, resource-oriented SDK organization
149
+ shown below; it owns no state or authority of its own.
150
+
151
+ `OpenGeniClient.interaction` is the framework-free resource facade over the same
152
+ public BrowserSession, ComputerSession, identity, auth, network-route, and human
153
+ intervention APIs used by OpenGeni itself. It adds no second state or execution
154
+ path: facade methods call the ordinary typed transport, and every mutation still
155
+ uses the canonical generation fences, operation receipt, permission check, and
156
+ placement controller.
157
+
158
+ ```ts
159
+ const browser = await client.interaction.browsers.currentOrOpen({
160
+ workspaceId,
161
+ associationSessionId: session.id,
162
+ initialUrl: "http://127.0.0.1:3000",
163
+ });
164
+
165
+ const { targets } = await browser.tabs.list();
166
+ const target = targets.find((candidate) => candidate.selected) ?? targets[0]!;
167
+ const page = await browser.observe(target.id);
168
+
169
+ const receipt = await browser.act({
170
+ operationId: crypto.randomUUID(),
171
+ targetId: target.id,
172
+ expectedTargetGeneration: target.targetGeneration,
173
+ expectedDocumentGeneration: target.documentGeneration,
174
+ expectedFrameId: page.frameId,
175
+ action: { type: "click", locator: { kind: "role", role: "button", name: "Continue" } },
176
+ });
177
+
178
+ if (receipt.state === "outcome_unknown") {
179
+ // Do not replay a mutation blindly. Re-observe, then inspect this exact receipt.
180
+ console.log(await browser.receipt(receipt.operationId));
181
+ }
182
+ ```
183
+
184
+ Browser identities are immutable version graphs: live browser state stays
185
+ private until `browser.publishRevision(...)` explicitly creates a new revision.
186
+ Protected auth fills resolve connection secrets only inside the broker/controller
187
+ path; normal SDK reads, observations, diagnostics, receipts, and logs never
188
+ return credential values. `client.openWorkspaceInteractionRevisionStream(...)`
189
+ is the low-volume latest-wins invalidation stream for keeping resource catalogs
190
+ fresh without attaching them to an inference/session event stream.
191
+
192
+ Use the flat `OpenGeniClient` interaction methods when implementing a proxy or
193
+ custom transport. Use `client.interaction` for application logic. Both are the
194
+ same API and authority boundary.
195
+
142
196
  ## Workspace artifacts
143
197
 
144
198
  Workspace artifacts are generic, immutable HTML publications. The SDK does not
@@ -484,13 +538,13 @@ Every public endpoint group has typed methods:
484
538
  | Packs | `listPacks`, `registerPack`, `getPack`, `enablePack`, `deletePack`, `listPackInstallations` |
485
539
  | Capabilities | `listCapabilities`, `createCapability`, `enableCapability`, `disableCapability`, `discoverMcpCapabilities` |
486
540
  | Plugin packages | `previewPlugin`, `installPlugin`, `previewPluginUninstall`, `uninstallPlugin` |
487
- | API Integrations | `listApiIntegrationPresets`, `listApiIntegrations`, `previewApiIntegration`, `startApiIntegrationOAuth`, `installApiIntegration`, `previewApiIntegrationUninstall`, `uninstallApiIntegration`, `listIntegrationFeatures`, `configureIntegrationFeature`, `pauseIntegrationFeature`, `resumeIntegrationFeature`, `removeIntegrationFeature`, `browseGoogleDriveIntegrationSource`, `saveGoogleDriveIntegrationSource` |
541
+ | API Integrations | `listIntegrationDefinitions`, `listApiIntegrations`, `previewApiIntegration`, `startApiIntegrationOAuth`, `installApiIntegration`, `previewApiIntegrationUninstall`, `uninstallApiIntegration`, `listIntegrationFacets`, `configureIntegrationFacet`, `pauseIntegrationFacet`, `resumeIntegrationFacet`, `removeIntegrationFacet`, `browseGoogleDriveFacetSource`, `saveGoogleDriveFacetSource` |
488
542
  | Remote Skills | `previewSkillImport`, `installSkill`, `previewSkillUninstall`, `uninstallSkill` |
489
543
  | GitHub | `getGitHubApp`, `githubConnectUrl`, `listGitHubRepositories`, `syncGitHubRepositories`, `createGitHubAppManifest` |
490
544
  | API keys | `listApiKeys`, `createApiKey`, `deleteApiKey` |
491
545
  | Billing | `getBilling`, `getBillingUsage`, `getBillingEntitlements`, `createBillingCheckout` |
492
546
 
493
- `listApiIntegrationPresets` returns safe curated-provider metadata without any
547
+ `listIntegrationDefinitions` returns safe Integration Definition metadata without any
494
548
  deployment OAuth client credentials. API Integrations are multi-instance:
495
549
  `installApiIntegration` may supply a
496
550
  stable `instanceKey`, display name, and exact Connection. The returned
@@ -499,14 +553,14 @@ selected in one session without tool-name collision. Uninstall preview and
499
553
  uninstall both require the exact `instanceKey` and instance version; neither
500
554
  operation disconnects the underlying Connection.
501
555
 
502
- Adapter-owned Integration features are listed and mutated under the exact
503
- `capabilityId` + `instanceKey` + `featureKey`. Generic primitive schemas use
504
- `configureIntegrationFeature`; lifecycle changes and removal require the
556
+ Adapter-owned Integration facets are listed and mutated under the exact
557
+ `capabilityId` + `instanceKey` + `facetKey`. Generic primitive schemas use
558
+ `configureIntegrationFacet`; lifecycle changes and removal require the
505
559
  binding's exact optimistic version plus a caller UUID idempotency key. Google
506
560
  Drive's nested folder/Shared Drive source schema has dedicated
507
- `browseGoogleDriveIntegrationSource` and `saveGoogleDriveIntegrationSource`
561
+ `browseGoogleDriveFacetSource` and `saveGoogleDriveFacetSource`
508
562
  methods. They verify provider metadata through that instance's exact Connection
509
- and persist only a versioned feature binding—never provider credentials, page
563
+ and persist only a versioned facet binding—never provider credentials, page
510
564
  tokens, or selected-source configuration on the Connection.
511
565
 
512
566
  ### Protocol routes (deliberately not in the SDK)
@@ -560,3 +614,9 @@ packages. `test/contract-parity.test.ts` pins them to `@opengeni/contracts`,
560
614
  so contract drift fails the repo gate instead of shipping. `SessionEvent.type`
561
615
  is an open union: unknown event types from newer servers flow through instead
562
616
  of breaking older SDK consumers.
617
+
618
+ Hosts, test doubles, and same-origin proxies must import
619
+ `OPENGENI_API_CONTRACT_REVISION` from `@opengeni/sdk` when constructing a client
620
+ configuration or contract header. Do not copy its string value: the revision is
621
+ an executable compatibility boundary, and `getClientConfig()` intentionally
622
+ fails closed when server and SDK revisions differ.
package/dist/artifacts.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  OpenGeniClient
3
- } from "./chunk-FHI4DFIG.js";
4
- import "./chunk-ILQZR5N6.js";
5
- import "./chunk-V5F253OG.js";
6
- import "./chunk-MZWTWOX6.js";
7
- import "./chunk-FRJFNDIR.js";
3
+ } from "./chunk-TYZ4JL4J.js";
4
+ import "./chunk-YGH5P47G.js";
5
+ import "./chunk-4DV37UUA.js";
6
+ import "./chunk-GU6JF75T.js";
7
+ import "./chunk-ST5DDKJP.js";
8
8
  export {
9
9
  OpenGeniClient
10
10
  };
@@ -47,6 +47,9 @@ var SESSION_EVENT_TYPES = [
47
47
  "artifact.created",
48
48
  "goal.set",
49
49
  "goal.updated",
50
+ "goal.progress",
51
+ "goal.rewrite.proposed",
52
+ "goal.rewrite.rejected",
50
53
  "goal.completed",
51
54
  "goal.paused",
52
55
  "goal.resumed",
@@ -86,6 +89,7 @@ var SESSION_EVENT_TYPES = [
86
89
  "terminal.pty.output.delta",
87
90
  "terminal.pty.exited",
88
91
  "session.title_set",
92
+ "session.visibility.changed",
89
93
  "session.mcp.approval_policy.updated",
90
94
  "session.tool_policy.updated",
91
95
  // Multi-account Codex (P1): the session's inference account changed.
@@ -175,7 +179,7 @@ var KNOWN_PERMISSIONS = [
175
179
  "artifacts:read",
176
180
  "artifacts:publish"
177
181
  ];
178
- var OPENGENI_API_CONTRACT_REVISION = "2026-08-social-provider-tools-v1";
182
+ var OPENGENI_API_CONTRACT_REVISION = "2026-08-model-context-v1";
179
183
  var OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract";
180
184
  var OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id";
181
185
  var RETAINED_OUTPUT_DEFAULT_PAGE_BYTES = 256 * 1024;
@@ -215,4 +219,4 @@ export {
215
219
  GENERATED_VIDEO_MAX_BYTES,
216
220
  KNOWN_USAGE_EVENT_TYPES
217
221
  };
218
- //# sourceMappingURL=chunk-FRJFNDIR.js.map
222
+ //# sourceMappingURL=chunk-4DV37UUA.js.map