@opengeni/sdk 0.46.0 → 0.52.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 (103) hide show
  1. package/README.md +94 -2
  2. package/dist/artifact-client.d.ts +20 -2
  3. package/dist/artifacts.d.ts +4 -0
  4. package/dist/artifacts.js +11 -0
  5. package/dist/artifacts.js.map +1 -0
  6. package/dist/chunk-FHI4DFIG.js +128 -0
  7. package/dist/chunk-FHI4DFIG.js.map +1 -0
  8. package/dist/chunk-FRJFNDIR.js +218 -0
  9. package/dist/chunk-FRJFNDIR.js.map +1 -0
  10. package/dist/{chunk-QKV5OCLJ.js → chunk-ILQZR5N6.js} +1380 -595
  11. package/dist/chunk-ILQZR5N6.js.map +1 -0
  12. package/dist/chunk-MZWTWOX6.js +661 -0
  13. package/dist/chunk-MZWTWOX6.js.map +1 -0
  14. package/dist/chunk-VWE2QIVO.js +1162 -0
  15. package/dist/chunk-VWE2QIVO.js.map +1 -0
  16. package/dist/chunk-VYCTL62C.js +230 -0
  17. package/dist/chunk-VYCTL62C.js.map +1 -0
  18. package/dist/client.d.ts +176 -20
  19. package/dist/codex-realtime-controller.d.ts +6 -6
  20. package/dist/codex-realtime-lifecycle.d.ts +1 -1
  21. package/dist/codex-realtime-v3.d.ts +3 -3
  22. package/dist/codex-realtime.d.ts +1 -1
  23. package/dist/company-profile.d.ts +100 -0
  24. package/dist/core.d.ts +5 -5
  25. package/dist/core.js +9 -4
  26. package/dist/desktop.d.ts +1 -1
  27. package/dist/editable-artifact-resources.d.ts +96 -0
  28. package/dist/editable-artifacts/browser-session.d.ts +35 -0
  29. package/dist/editable-artifacts/controller.d.ts +60 -0
  30. package/dist/editable-artifacts/errors.d.ts +23 -0
  31. package/dist/editable-artifacts/http-live-transport.d.ts +46 -0
  32. package/dist/editable-artifacts/index.d.ts +19 -0
  33. package/dist/editable-artifacts/pool.d.ts +15 -0
  34. package/dist/editable-artifacts/session.d.ts +96 -0
  35. package/dist/editable-artifacts/storage.d.ts +72 -0
  36. package/dist/editable-artifacts/types.d.ts +416 -0
  37. package/dist/editable-artifacts/worker/browser-client.d.ts +80 -0
  38. package/dist/editable-artifacts/worker/browser-entry.d.ts +6 -0
  39. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +45 -0
  40. package/dist/editable-artifacts/worker/rpc-protocol.d.ts +92 -0
  41. package/dist/editable-artifacts/worker/runtime.d.ts +66 -0
  42. package/dist/editable-artifacts/worker/wire-codec.d.ts +52 -0
  43. package/dist/editable-artifacts-worker.d.ts +8 -0
  44. package/dist/editable-artifacts-worker.js +1708 -0
  45. package/dist/editable-artifacts-worker.js.map +1 -0
  46. package/dist/editable-artifacts.d.ts +6 -0
  47. package/dist/editable-artifacts.js +5954 -0
  48. package/dist/editable-artifacts.js.map +1 -0
  49. package/dist/gateway-realtime-transport.d.ts +1 -1
  50. package/dist/index.d.ts +41 -35
  51. package/dist/index.js +104 -68
  52. package/dist/index.js.map +1 -1
  53. package/dist/interaction.d.ts +885 -0
  54. package/dist/interaction.js +55 -0
  55. package/dist/interaction.js.map +1 -0
  56. package/dist/memory-slack-client.d.ts +13 -0
  57. package/dist/memory-slack-delivery.d.ts +99 -0
  58. package/dist/memory-slack.d.ts +4 -0
  59. package/dist/memory-slack.js +44 -0
  60. package/dist/memory-slack.js.map +1 -0
  61. package/dist/proxy.d.ts +3 -3
  62. package/dist/realtime.d.ts +12 -12
  63. package/dist/retained-artifacts.d.ts +12 -0
  64. package/dist/stream.d.ts +16 -1
  65. package/dist/terminal.d.ts +1 -1
  66. package/dist/transcription.d.ts +2 -2
  67. package/dist/types.d.ts +1203 -23
  68. package/dist/workspace-control-stream.d.ts +2 -2
  69. package/dist/workspace-state.d.ts +1 -1
  70. package/package.json +29 -3
  71. package/src/artifact-client.ts +129 -0
  72. package/src/artifacts.ts +17 -0
  73. package/src/client.ts +1801 -206
  74. package/src/company-profile.ts +92 -0
  75. package/src/editable-artifact-resources.ts +119 -0
  76. package/src/editable-artifacts/browser-session.ts +176 -0
  77. package/src/editable-artifacts/controller.ts +2632 -0
  78. package/src/editable-artifacts/errors.ts +52 -0
  79. package/src/editable-artifacts/http-live-transport.ts +1449 -0
  80. package/src/editable-artifacts/index.ts +175 -0
  81. package/src/editable-artifacts/pool.ts +81 -0
  82. package/src/editable-artifacts/session.ts +778 -0
  83. package/src/editable-artifacts/storage.ts +1718 -0
  84. package/src/editable-artifacts/types.ts +499 -0
  85. package/src/editable-artifacts/worker/browser-client.ts +1167 -0
  86. package/src/editable-artifacts/worker/browser-entry.ts +57 -0
  87. package/src/editable-artifacts/worker/kernel-adapter.ts +1039 -0
  88. package/src/editable-artifacts/worker/rpc-protocol.ts +622 -0
  89. package/src/editable-artifacts/worker/runtime.ts +1204 -0
  90. package/src/editable-artifacts/worker/wire-codec.ts +852 -0
  91. package/src/editable-artifacts-worker.ts +8 -0
  92. package/src/editable-artifacts.ts +6 -0
  93. package/src/index.ts +194 -0
  94. package/src/interaction.ts +1830 -0
  95. package/src/memory-slack-client.ts +71 -0
  96. package/src/memory-slack-delivery.ts +128 -0
  97. package/src/memory-slack.ts +19 -0
  98. package/src/retained-artifacts.ts +326 -0
  99. package/src/stream.ts +102 -4
  100. package/src/transcription.ts +2 -2
  101. package/src/types.ts +1430 -33
  102. package/src/workspace-control-stream.ts +15 -5
  103. package/dist/chunk-QKV5OCLJ.js.map +0 -1
@@ -0,0 +1,55 @@
1
+ import {
2
+ AttachedBrowserDeviceCollection,
3
+ AttachedBrowserDeviceResource,
4
+ BROWSER_CONTROL_MAX_FRAME_HEADER_BYTES,
5
+ BROWSER_CONTROL_WEBSOCKET_BEARER_PREFIX,
6
+ BROWSER_CONTROL_WEBSOCKET_PROTOCOL,
7
+ BROWSER_FRAME_MAX_BYTES,
8
+ BROWSER_FRAME_MAX_DIMENSION,
9
+ BROWSER_FRAME_MAX_PIXELS,
10
+ BrowserIdentityCollection,
11
+ BrowserIdentityResource,
12
+ BrowserSessionCollection,
13
+ BrowserSessionResource,
14
+ BrowserTargetCollection,
15
+ COMPUTER_CONTROL_WEBSOCKET_PROTOCOL,
16
+ ComputerSessionCollection,
17
+ ComputerSessionResource,
18
+ ComputerTargetCollection,
19
+ INTERACTION_PROTOCOL_VERSION,
20
+ OpenGeniInteractionClient,
21
+ browserFrameSocketUrl,
22
+ computerFrameSocketUrl,
23
+ decodeBrowserFrameMessage,
24
+ decodeComputerFrameMessage,
25
+ parseBrowserFrameMetadata,
26
+ parseComputerFrameMetadata
27
+ } from "./chunk-MZWTWOX6.js";
28
+ export {
29
+ AttachedBrowserDeviceCollection,
30
+ AttachedBrowserDeviceResource,
31
+ BROWSER_CONTROL_MAX_FRAME_HEADER_BYTES,
32
+ BROWSER_CONTROL_WEBSOCKET_BEARER_PREFIX,
33
+ BROWSER_CONTROL_WEBSOCKET_PROTOCOL,
34
+ BROWSER_FRAME_MAX_BYTES,
35
+ BROWSER_FRAME_MAX_DIMENSION,
36
+ BROWSER_FRAME_MAX_PIXELS,
37
+ BrowserIdentityCollection,
38
+ BrowserIdentityResource,
39
+ BrowserSessionCollection,
40
+ BrowserSessionResource,
41
+ BrowserTargetCollection,
42
+ COMPUTER_CONTROL_WEBSOCKET_PROTOCOL,
43
+ ComputerSessionCollection,
44
+ ComputerSessionResource,
45
+ ComputerTargetCollection,
46
+ INTERACTION_PROTOCOL_VERSION,
47
+ OpenGeniInteractionClient,
48
+ browserFrameSocketUrl,
49
+ computerFrameSocketUrl,
50
+ decodeBrowserFrameMessage,
51
+ decodeComputerFrameMessage,
52
+ parseBrowserFrameMetadata,
53
+ parseComputerFrameMetadata
54
+ };
55
+ //# sourceMappingURL=interaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,13 @@
1
+ import type { OpenGeniClient as OpenGeniCoreClient } from "./client.js";
2
+ import type { MemorySlackPublication, MemorySlackPublicationActionRequest, MemorySlackPublicationConfiguration, MemorySlackPublicationConfigurationResponse, MemorySlackPublicationHistoryResponse, SlackPublicationChannelListResponse, UpdateMemorySlackPublicationConfigurationRequest } from "./memory-slack-delivery.js";
3
+ export type OpenGeniMemorySlackTransport = Pick<OpenGeniCoreClient, "requestJson">;
4
+ /** Optional Memory-to-Slack API surface, isolated from the eager core client graph. */
5
+ export declare class OpenGeniMemorySlackClient {
6
+ private readonly client;
7
+ constructor(client: OpenGeniMemorySlackTransport);
8
+ getMemorySlackPublicationConfiguration(workspaceId: string): Promise<MemorySlackPublicationConfigurationResponse>;
9
+ updateMemorySlackPublicationConfiguration(workspaceId: string, request: UpdateMemorySlackPublicationConfigurationRequest): Promise<MemorySlackPublicationConfiguration>;
10
+ listMemorySlackPublicationChannels(workspaceId: string, connectionId: string, cursor?: string): Promise<SlackPublicationChannelListResponse>;
11
+ listMemorySlackPublications(workspaceId: string): Promise<MemorySlackPublicationHistoryResponse>;
12
+ actOnMemorySlackPublication(workspaceId: string, publicationId: string, request: MemorySlackPublicationActionRequest): Promise<MemorySlackPublication>;
13
+ }
@@ -0,0 +1,99 @@
1
+ export type MemorySlackImportance = "major" | "normal" | "minor";
2
+ export type MemorySlackRequestedMode = "auto" | "review" | "never";
3
+ export type MemorySlackPublicationDistribution = {
4
+ importance: MemorySlackImportance;
5
+ audience: "workspace";
6
+ slackMode: MemorySlackRequestedMode;
7
+ shareSummary: string;
8
+ };
9
+ export type MemorySlackPublicationConfiguration = {
10
+ id: string;
11
+ workspaceId: string;
12
+ revision: number;
13
+ enabled: boolean;
14
+ connectionId: string | null;
15
+ slackTeamId: string | null;
16
+ slackChannelId: string | null;
17
+ slackChannelName: string | null;
18
+ autoImportances: MemorySlackImportance[];
19
+ reviewImportances: MemorySlackImportance[];
20
+ createdBySubjectId: string;
21
+ createdAt: string;
22
+ };
23
+ export type UpdateMemorySlackPublicationConfigurationRequest = {
24
+ expectedRevision: number;
25
+ enabled: boolean;
26
+ connectionId: string | null;
27
+ slackChannelId: string | null;
28
+ slackChannelName: string | null;
29
+ autoImportances: MemorySlackImportance[];
30
+ reviewImportances: MemorySlackImportance[];
31
+ };
32
+ export type MemorySlackPublicationConfigurationResponse = {
33
+ current: MemorySlackPublicationConfiguration | null;
34
+ history: MemorySlackPublicationConfiguration[];
35
+ };
36
+ export type MemorySlackPublicationState = "review_pending" | "queued" | "delivering" | "retry_wait" | "delivered" | "rejected" | "failed" | "cancelled";
37
+ export type MemorySlackPublicationReceiptKind = "enqueued" | "review_approved" | "review_rejected" | "delivery_claimed" | "retry_scheduled" | "delivered" | "failed" | "cancelled" | "manual_retry";
38
+ export type MemorySlackPublicationReceipt = {
39
+ id: string;
40
+ publicationId: string;
41
+ sequence: number;
42
+ kind: MemorySlackPublicationReceiptKind;
43
+ state: MemorySlackPublicationState;
44
+ attemptNumber: number;
45
+ actorKind: "human" | "agent" | "service";
46
+ actorSubjectId: string;
47
+ operationId: string;
48
+ errorCode: string | null;
49
+ retryAt: string | null;
50
+ slackChannelId: string | null;
51
+ slackMessageTimestamp: string | null;
52
+ createdAt: string;
53
+ };
54
+ export type MemorySlackPublication = {
55
+ id: string;
56
+ workspaceId: string;
57
+ configurationRevision: number;
58
+ connectionId: string;
59
+ slackTeamId: string;
60
+ slackChannelId: string;
61
+ sourceType: "workspace_memory" | "durable_learning";
62
+ sourceId: string;
63
+ sourceVersion: string | null;
64
+ importance: MemorySlackImportance;
65
+ deliveryMode: "auto" | "review";
66
+ state: MemorySlackPublicationState;
67
+ summary: string;
68
+ sourceLabel: string;
69
+ authoritativePath: string | null;
70
+ initiatorKind: "human" | "agent" | "service";
71
+ initiatorSubjectId: string;
72
+ initiatingHumanSubjectId: string | null;
73
+ attemptCount: number;
74
+ retryAt: string | null;
75
+ lastErrorCode: string | null;
76
+ slackMessageTimestamp: string | null;
77
+ deliveredAt: string | null;
78
+ terminalAt: string | null;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ receipts: MemorySlackPublicationReceipt[];
82
+ };
83
+ export type MemorySlackPublicationHistoryResponse = {
84
+ publications: MemorySlackPublication[];
85
+ nextCursor: string | null;
86
+ };
87
+ export type MemorySlackPublicationActionRequest = {
88
+ action: "approve" | "reject" | "retry";
89
+ expectedState: MemorySlackPublicationState;
90
+ };
91
+ export type SlackPublicationChannel = {
92
+ id: string;
93
+ name: string | null;
94
+ isPrivate: boolean;
95
+ };
96
+ export type SlackPublicationChannelListResponse = {
97
+ channels: SlackPublicationChannel[];
98
+ nextCursor: string | null;
99
+ };
@@ -0,0 +1,4 @@
1
+ /** Optional Memory-to-Slack API client; import this entry only where the capability is used. */
2
+ export { OpenGeniMemorySlackClient } from "./memory-slack-client.js";
3
+ export type { OpenGeniMemorySlackTransport } from "./memory-slack-client.js";
4
+ export type { MemorySlackImportance, MemorySlackPublication, MemorySlackPublicationActionRequest, MemorySlackPublicationConfiguration, MemorySlackPublicationConfigurationResponse, MemorySlackPublicationDistribution, MemorySlackPublicationHistoryResponse, MemorySlackPublicationReceipt, MemorySlackPublicationReceiptKind, MemorySlackPublicationState, MemorySlackRequestedMode, SlackPublicationChannel, SlackPublicationChannelListResponse, UpdateMemorySlackPublicationConfigurationRequest, } from "./memory-slack-delivery.js";
@@ -0,0 +1,44 @@
1
+ // src/memory-slack-client.ts
2
+ var OpenGeniMemorySlackClient = class {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async getMemorySlackPublicationConfiguration(workspaceId) {
7
+ return await this.client.requestJson(
8
+ "GET",
9
+ `/v1/workspaces/${workspaceId}/memory-slack-publications/configuration`
10
+ );
11
+ }
12
+ async updateMemorySlackPublicationConfiguration(workspaceId, request) {
13
+ return await this.client.requestJson(
14
+ "PUT",
15
+ `/v1/workspaces/${workspaceId}/memory-slack-publications/configuration`,
16
+ request
17
+ );
18
+ }
19
+ async listMemorySlackPublicationChannels(workspaceId, connectionId, cursor) {
20
+ const query = new URLSearchParams({ connectionId });
21
+ if (cursor) query.set("cursor", cursor);
22
+ return await this.client.requestJson(
23
+ "GET",
24
+ `/v1/workspaces/${workspaceId}/memory-slack-publications/channels?${query}`
25
+ );
26
+ }
27
+ async listMemorySlackPublications(workspaceId) {
28
+ return await this.client.requestJson(
29
+ "GET",
30
+ `/v1/workspaces/${workspaceId}/memory-slack-publications`
31
+ );
32
+ }
33
+ async actOnMemorySlackPublication(workspaceId, publicationId, request) {
34
+ return await this.client.requestJson(
35
+ "POST",
36
+ `/v1/workspaces/${workspaceId}/memory-slack-publications/${encodeURIComponent(publicationId)}/action`,
37
+ request
38
+ );
39
+ }
40
+ };
41
+ export {
42
+ OpenGeniMemorySlackClient
43
+ };
44
+ //# sourceMappingURL=memory-slack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/memory-slack-client.ts"],"sourcesContent":["import type { OpenGeniClient as OpenGeniCoreClient } from \"./client\";\nimport type {\n MemorySlackPublication,\n MemorySlackPublicationActionRequest,\n MemorySlackPublicationConfiguration,\n MemorySlackPublicationConfigurationResponse,\n MemorySlackPublicationHistoryResponse,\n SlackPublicationChannelListResponse,\n UpdateMemorySlackPublicationConfigurationRequest,\n} from \"./memory-slack-delivery\";\n\nexport type OpenGeniMemorySlackTransport = Pick<OpenGeniCoreClient, \"requestJson\">;\n\n/** Optional Memory-to-Slack API surface, isolated from the eager core client graph. */\nexport class OpenGeniMemorySlackClient {\n constructor(private readonly client: OpenGeniMemorySlackTransport) {}\n\n async getMemorySlackPublicationConfiguration(\n workspaceId: string,\n ): Promise<MemorySlackPublicationConfigurationResponse> {\n return await this.client.requestJson<MemorySlackPublicationConfigurationResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/memory-slack-publications/configuration`,\n );\n }\n\n async updateMemorySlackPublicationConfiguration(\n workspaceId: string,\n request: UpdateMemorySlackPublicationConfigurationRequest,\n ): Promise<MemorySlackPublicationConfiguration> {\n return await this.client.requestJson<MemorySlackPublicationConfiguration>(\n \"PUT\",\n `/v1/workspaces/${workspaceId}/memory-slack-publications/configuration`,\n request,\n );\n }\n\n async listMemorySlackPublicationChannels(\n workspaceId: string,\n connectionId: string,\n cursor?: string,\n ): Promise<SlackPublicationChannelListResponse> {\n const query = new URLSearchParams({ connectionId });\n if (cursor) query.set(\"cursor\", cursor);\n return await this.client.requestJson<SlackPublicationChannelListResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/memory-slack-publications/channels?${query}`,\n );\n }\n\n async listMemorySlackPublications(\n workspaceId: string,\n ): Promise<MemorySlackPublicationHistoryResponse> {\n return await this.client.requestJson<MemorySlackPublicationHistoryResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/memory-slack-publications`,\n );\n }\n\n async actOnMemorySlackPublication(\n workspaceId: string,\n publicationId: string,\n request: MemorySlackPublicationActionRequest,\n ): Promise<MemorySlackPublication> {\n return await this.client.requestJson<MemorySlackPublication>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/memory-slack-publications/${encodeURIComponent(publicationId)}/action`,\n request,\n );\n }\n}\n"],"mappings":";AAcO,IAAM,4BAAN,MAAgC;AAAA,EACrC,YAA6B,QAAsC;AAAtC;AAAA,EAAuC;AAAA,EAEpE,MAAM,uCACJ,aACsD;AACtD,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,MAAM,0CACJ,aACA,SAC8C;AAC9C,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,mCACJ,aACA,cACA,QAC8C;AAC9C,UAAM,QAAQ,IAAI,gBAAgB,EAAE,aAAa,CAAC;AAClD,QAAI,OAAQ,OAAM,IAAI,UAAU,MAAM;AACtC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW,uCAAuC,KAAK;AAAA,IAC3E;AAAA,EACF;AAAA,EAEA,MAAM,4BACJ,aACgD;AAChD,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,MAAM,4BACJ,aACA,eACA,SACiC;AACjC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW,8BAA8B,mBAAmB,aAAa,CAAC;AAAA,MAC5F;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/dist/proxy.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { OpenGeniClient } from "./client";
2
- import type { StreamSessionEventsOptions } from "./stream";
3
- import type { SessionEvent } from "./types";
1
+ import type { OpenGeniClient } from "./client.js";
2
+ import type { StreamSessionEventsOptions } from "./stream.js";
3
+ import type { SessionEvent } from "./types.js";
4
4
  /**
5
5
  * Proxy-through-your-own-API helpers.
6
6
  *
@@ -4,9 +4,9 @@
4
4
  * Import this subpath lazily in browser applications. The base `@opengeni/sdk`
5
5
  * entry remains free of eager realtime transport initialization.
6
6
  */
7
- import { createCodexRealtimeController, hasStoredSessionRealtimeOwnerProof, sessionRealtimeOwnerStorageKey, sessionRealtimeOwnerStorageNamespace, type CodexRealtimeController, type CodexRealtimeControllerClient, type CodexRealtimeControllerSnapshot, type CodexRealtimeControllerStatus, type CodexRealtimeDiagnostic, type CodexRealtimeDiagnosticKind, type CodexRealtimeMicrophoneState, type CodexRealtimeOwnerStorage, type CreateCodexRealtimeControllerOptions, type RealtimeControllerTransportStarter } from "./codex-realtime-controller";
8
- import { createGatewayRealtimeTransportStarter } from "./gateway-realtime-transport";
9
- import type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from "./types";
7
+ import { createCodexRealtimeController, hasStoredSessionRealtimeOwnerProof, sessionRealtimeOwnerStorageKey, sessionRealtimeOwnerStorageNamespace, type CodexRealtimeController, type CodexRealtimeControllerClient, type CodexRealtimeControllerSnapshot, type CodexRealtimeControllerStatus, type CodexRealtimeDiagnostic, type CodexRealtimeDiagnosticKind, type CodexRealtimeMicrophoneState, type CodexRealtimeOwnerStorage, type CreateCodexRealtimeControllerOptions, type RealtimeControllerTransportStarter } from "./codex-realtime-controller.js";
8
+ import { createGatewayRealtimeTransportStarter } from "./gateway-realtime-transport.js";
9
+ import type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from "./types.js";
10
10
  /** Exact backend-facing methods required by the batteries-included realtime SDK. */
11
11
  export type SessionRealtimeClientLike = CodexRealtimeControllerClient & {
12
12
  getWorkspaceRealtimeModelCatalog(workspaceId: string): Promise<WorkspaceRealtimeModelCatalogResponse>;
@@ -34,12 +34,12 @@ export declare function sessionRealtimeTransportKind(model: SessionRealtimeModel
34
34
  export declare function createSessionRealtimeController(options: CreateSessionRealtimeControllerOptions): SessionRealtimeController;
35
35
  export { createCodexRealtimeController, createGatewayRealtimeTransportStarter, hasStoredSessionRealtimeOwnerProof, sessionRealtimeOwnerStorageKey, sessionRealtimeOwnerStorageNamespace, };
36
36
  export type { CodexRealtimeController, CodexRealtimeControllerClient, CodexRealtimeControllerSnapshot, CodexRealtimeControllerStatus, CodexRealtimeDiagnostic, CodexRealtimeDiagnosticKind, CodexRealtimeMicrophoneState, CodexRealtimeOwnerStorage, CreateCodexRealtimeControllerOptions, RealtimeControllerTransportStarter, };
37
- export { CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS, projectSessionRealtimeLifecycle, } from "./codex-realtime-controller";
38
- export type { SessionRealtimeLifecycleProjection } from "./codex-realtime-lifecycle";
39
- export { CodexRealtimeMicrophoneError, acquireCodexRealtimeMicrophone, codexRealtimeMicrophoneHealthy, startCodexRealtimeWebrtc, } from "./codex-realtime";
40
- export type { AcquireCodexRealtimeMicrophoneOptions, CodexRealtimeAudibleOutputState, CodexRealtimeConnectionHealth, CodexRealtimeMicrophoneErrorCode, CodexRealtimeNegotiator, CodexRealtimeWebrtcSession, StartCodexRealtimeWebrtcOptions, } from "./codex-realtime";
41
- export { CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES, CODEX_REALTIME_V3_MAX_EVENT_BYTES, CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES, CODEX_REALTIME_V3_MAX_TEXT_BYTES, CODEX_REALTIME_V3_PENDING_MAX_BYTES, CODEX_REALTIME_V3_PENDING_MAX_ENTRIES, CODEX_REALTIME_V3_SYNC_MAX_ENTRIES, contextAppendChunks, createCodexRealtimeV3Bridge, encodeCodexRealtimeV3DelegationContextAppend, encodeCodexRealtimeV3SessionContextAppend, parseCodexRealtimeV3Event, } from "./codex-realtime-v3";
42
- export type { CodexRealtimeV3Bridge, CodexRealtimeV3BridgeFatal, CodexRealtimeV3BridgeOptions, CodexRealtimeV3BridgeSnapshot, CodexRealtimeV3ContextAppendChannel, CodexRealtimeV3DelegationContextAppend, CodexRealtimeV3Event, CodexRealtimeV3ParseFailure, CodexRealtimeV3ParseResult, CodexRealtimeV3SessionContextAppend, } from "./codex-realtime-v3";
43
- export { CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT, CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS, } from "./codex-realtime-v3-wire";
44
- export type { CodexRealtimeInitialItem } from "./codex-realtime-v3-wire";
45
- export type { ActivateCodexRealtimeConnectionRequest, BeginSessionRealtimeRequest, CodexRealtimeVoice, CodexRealtimeWebrtcRequest, CodexRealtimeWebrtcResponse, CodexRealtimeWebrtcVersion, EndSessionRealtimeRequest, GatewayRealtimeConnectRequest, GatewayRealtimeConnectResponse, GatewayRealtimeInitialItem, RenewSessionRealtimeRequest, SessionRealtimeEndReason, SessionRealtimeLedgerEntry, SessionRealtimeMode, SessionRealtimeModel, SessionRealtimeMutationResponse, SessionRealtimeState, SyncSessionRealtimeLedgerRequest, SyncSessionRealtimeLedgerResponse, WorkspaceRealtimeModelCatalogItem, WorkspaceRealtimeModelCatalogResponse, } from "./types";
37
+ export { CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS, projectSessionRealtimeLifecycle, } from "./codex-realtime-controller.js";
38
+ export type { SessionRealtimeLifecycleProjection } from "./codex-realtime-lifecycle.js";
39
+ export { CodexRealtimeMicrophoneError, acquireCodexRealtimeMicrophone, codexRealtimeMicrophoneHealthy, startCodexRealtimeWebrtc, } from "./codex-realtime.js";
40
+ export type { AcquireCodexRealtimeMicrophoneOptions, CodexRealtimeAudibleOutputState, CodexRealtimeConnectionHealth, CodexRealtimeMicrophoneErrorCode, CodexRealtimeNegotiator, CodexRealtimeWebrtcSession, StartCodexRealtimeWebrtcOptions, } from "./codex-realtime.js";
41
+ export { CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES, CODEX_REALTIME_V3_MAX_EVENT_BYTES, CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES, CODEX_REALTIME_V3_MAX_TEXT_BYTES, CODEX_REALTIME_V3_PENDING_MAX_BYTES, CODEX_REALTIME_V3_PENDING_MAX_ENTRIES, CODEX_REALTIME_V3_SYNC_MAX_ENTRIES, contextAppendChunks, createCodexRealtimeV3Bridge, encodeCodexRealtimeV3DelegationContextAppend, encodeCodexRealtimeV3SessionContextAppend, parseCodexRealtimeV3Event, } from "./codex-realtime-v3.js";
42
+ export type { CodexRealtimeV3Bridge, CodexRealtimeV3BridgeFatal, CodexRealtimeV3BridgeOptions, CodexRealtimeV3BridgeSnapshot, CodexRealtimeV3ContextAppendChannel, CodexRealtimeV3DelegationContextAppend, CodexRealtimeV3Event, CodexRealtimeV3ParseFailure, CodexRealtimeV3ParseResult, CodexRealtimeV3SessionContextAppend, } from "./codex-realtime-v3.js";
43
+ export { CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT, CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS, } from "./codex-realtime-v3-wire.js";
44
+ export type { CodexRealtimeInitialItem } from "./codex-realtime-v3-wire.js";
45
+ export type { ActivateCodexRealtimeConnectionRequest, BeginSessionRealtimeRequest, CodexRealtimeVoice, CodexRealtimeWebrtcRequest, CodexRealtimeWebrtcResponse, CodexRealtimeWebrtcVersion, EndSessionRealtimeRequest, GatewayRealtimeConnectRequest, GatewayRealtimeConnectResponse, GatewayRealtimeInitialItem, RenewSessionRealtimeRequest, SessionRealtimeEndReason, SessionRealtimeLedgerEntry, SessionRealtimeMode, SessionRealtimeModel, SessionRealtimeMutationResponse, SessionRealtimeState, SyncSessionRealtimeLedgerRequest, SyncSessionRealtimeLedgerResponse, WorkspaceRealtimeModelCatalogItem, WorkspaceRealtimeModelCatalogResponse, } from "./types.js";
@@ -0,0 +1,12 @@
1
+ import type { GeneratedImageReceipt, GeneratedVideoReceipt, MediaGenerationResult, RetainedArtifactReference } from "./types.js";
2
+ /** Zero-dependency validation for the SDK's permanent generated-image wire receipt. */
3
+ export declare function parseRetainedGeneratedImageReference(value: unknown, expectedWorkspaceId?: string): RetainedArtifactReference | null;
4
+ export declare function generatedImageSandboxPathMatches(artifact: RetainedArtifactReference, sandboxPath: unknown): sandboxPath is string;
5
+ /** Parse the complete closed generated-image tool result. */
6
+ export declare function parseGeneratedImageReceipt(value: unknown, expectedWorkspaceId?: string): GeneratedImageReceipt | null;
7
+ /** Zero-dependency validation for a permanent generated-video reference. */
8
+ export declare function parseRetainedGeneratedVideoReference(value: unknown, expectedWorkspaceId?: string): RetainedArtifactReference | null;
9
+ /** Parse the compact successful video result placed in model/timeline history. */
10
+ export declare function parseGeneratedVideoReceipt(value: unknown, expectedWorkspaceId?: string): GeneratedVideoReceipt | null;
11
+ /** Parse one closed terminal envelope; failures never fabricate an artifact. */
12
+ export declare function parseMediaGenerationResult(value: unknown, expectedWorkspaceId?: string): MediaGenerationResult | null;
package/dist/stream.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { SessionEvent } from "./types";
1
+ import type { SessionEvent } from "./types.js";
2
2
  /**
3
3
  * Transport boundary for the streaming core. The client implements it with
4
4
  * `fetch`; unit tests script it directly.
@@ -21,13 +21,25 @@ export type StreamSessionEventsOptions = {
21
21
  reconnectDelayMs?: number;
22
22
  /** Backoff ceiling. Defaults to 10s. */
23
23
  maxReconnectDelayMs?: number;
24
+ /** Random backoff spread as a fraction of the delay. Defaults to 0.2. */
25
+ reconnectJitterRatio?: number;
24
26
  /**
25
27
  * Give up after this many consecutive failed reconnect attempts (i.e. N
26
28
  * reconnects = N+1 total open-stream calls). Defaults to unlimited.
27
29
  */
28
30
  maxReconnectAttempts?: number;
31
+ /**
32
+ * Notify the consumer as soon as the SSE response body is open. This callback
33
+ * is deliberately synchronous and non-blocking: use it to start projection
34
+ * reconciliation without delaying consumption of live event bytes.
35
+ */
36
+ onOpen?: (() => void) | undefined;
29
37
  /** Await authoritative client reconciliation before exposing `live`. */
30
38
  beforeLive?: (() => void | Promise<void>) | undefined;
39
+ /** Maximum reconciliation time before reconnecting. Defaults to 15s. */
40
+ beforeLiveTimeoutMs?: number;
41
+ /** Maximum time without any SSE bytes before reconnecting. Defaults to 45s. */
42
+ heartbeatTimeoutMs?: number;
31
43
  onStateChange?: (state: StreamConnectionState) => void;
32
44
  };
33
45
  /**
@@ -46,3 +58,6 @@ export type StreamSessionEventsOptions = {
46
58
  * `reconnect` is false, or with an error for non-retryable failures.
47
59
  */
48
60
  export declare function streamSessionEvents(transport: SessionEventStreamTransport, options?: StreamSessionEventsOptions): AsyncGenerator<SessionEvent, void, void>;
61
+ export declare function runBeforeLive(beforeLive: (() => void | Promise<void>) | undefined, timeoutMs: number, signal: AbortSignal | undefined): Promise<void>;
62
+ export declare function jitteredDelay(delayMs: number, ratio: number): number;
63
+ export declare function withStreamInactivityTimeout(stream: ReadableStream<Uint8Array>, timeoutMs: number, signal: AbortSignal | undefined): ReadableStream<Uint8Array>;
@@ -1,4 +1,4 @@
1
- import type { TerminalCapability } from "./types";
1
+ import type { TerminalCapability } from "./types.js";
2
2
  /**
3
3
  * Translate the negotiated `pty-ws` Terminal capability into the WebSocket URL
4
4
  * the ttyd client dials. The scoped provider token is ALREADY embedded in the
@@ -99,7 +99,7 @@ export type TranscriptionResultMetadata = {
99
99
  export type TranscriptionDiagnostic = {
100
100
  operation: "start" | "session" | "cancel" | "close";
101
101
  code: TranscriptionErrorCode;
102
- /** Diagnostic-only detail. React sanitizes and bounds this before forwarding it. */
102
+ /** Exact diagnostic detail forwarded by React without content rewriting. */
103
103
  detail: string;
104
104
  };
105
105
  type TranscriptionEventBase = {
@@ -160,7 +160,7 @@ export type TranscriptionEventListener = (event: TranscriptionEvent) => void;
160
160
  export type TranscriptionAdapterStartContext = {
161
161
  /** Aborted on local cancellation, policy replacement, timeout, or unmount. */
162
162
  signal: AbortSignal;
163
- /** Non-UI observability seam; callers receive only bounded, redacted detail. */
163
+ /** Non-UI observability seam; callers receive the exact provider detail. */
164
164
  reportDiagnostic: (diagnostic: TranscriptionDiagnostic) => void;
165
165
  };
166
166
  export type TranscriptionSession = {