@opengeni/sdk 3.3.2 → 3.4.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.
- package/README.md +1007 -72
- package/dist/adapters/express.d.ts +31 -0
- package/dist/adapters/express.js +87 -0
- package/dist/adapters/express.js.map +1 -0
- package/dist/adapters/hono.d.ts +16 -0
- package/dist/adapters/hono.js +8 -0
- package/dist/adapters/hono.js.map +1 -0
- package/dist/adapters/next.d.ts +29 -0
- package/dist/adapters/next.js +22 -0
- package/dist/adapters/next.js.map +1 -0
- package/dist/allowance-refusal.d.ts +2 -0
- package/dist/allowance-refusal.js +50 -0
- package/dist/allowance-refusal.js.map +1 -0
- package/dist/app-links.d.ts +42 -0
- package/dist/app-links.js +66 -0
- package/dist/app-links.js.map +1 -0
- package/dist/artifact-catalog.d.ts +40 -0
- package/dist/artifact-client.d.ts +20 -8
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +8 -6
- package/dist/automations.js +8 -2
- package/dist/automations.js.map +1 -1
- package/dist/azure-live-transport.d.ts +32 -0
- package/dist/browser.d.ts +7 -2
- package/dist/browser.js +27 -5
- package/dist/chat/fold.d.ts +75 -0
- package/dist/chat/handler.d.ts +41 -0
- package/dist/chat/http.d.ts +67 -0
- package/dist/chat/ids.d.ts +34 -0
- package/dist/chat/index.d.ts +9 -0
- package/dist/chat/index.js +1369 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/openai.d.ts +30 -0
- package/dist/chat/opengeni.d.ts +129 -0
- package/dist/chat/types.d.ts +207 -0
- package/dist/chat/vercel.d.ts +49 -0
- package/dist/chats.d.ts +8 -0
- package/dist/chunk-4AHR4KGA.js +301 -0
- package/dist/chunk-4AHR4KGA.js.map +1 -0
- package/dist/chunk-6GYGMLX4.js +332 -0
- package/dist/chunk-6GYGMLX4.js.map +1 -0
- package/dist/chunk-7EWT3PV6.js +368 -0
- package/dist/chunk-7EWT3PV6.js.map +1 -0
- package/dist/chunk-FTWVVPR6.js +1665 -0
- package/dist/chunk-FTWVVPR6.js.map +1 -0
- package/dist/{chunk-VYCTL62C.js → chunk-GZQSWAKD.js} +1 -1
- package/dist/chunk-GZQSWAKD.js.map +1 -0
- package/dist/chunk-KGEABAID.js +71 -0
- package/dist/chunk-KGEABAID.js.map +1 -0
- package/dist/{chunk-YKZME56C.js → chunk-KWADQ227.js} +3 -3
- package/dist/{chunk-YKZME56C.js.map → chunk-KWADQ227.js.map} +1 -1
- package/dist/{chunk-JUS2UYRP.js → chunk-NCU5OAN7.js} +27 -2
- package/dist/chunk-NCU5OAN7.js.map +1 -0
- package/dist/{chunk-YXQX7RQT.js → chunk-OI5YLASH.js} +73 -2
- package/dist/chunk-OI5YLASH.js.map +1 -0
- package/dist/chunk-OV3POE62.js +359 -0
- package/dist/chunk-OV3POE62.js.map +1 -0
- package/dist/chunk-P7UWKORG.js +561 -0
- package/dist/chunk-P7UWKORG.js.map +1 -0
- package/dist/chunk-QGEIL4TR.js +195 -0
- package/dist/chunk-QGEIL4TR.js.map +1 -0
- package/dist/{chunk-TRNI7KEO.js → chunk-S2NLS3ES.js} +3669 -1281
- package/dist/chunk-S2NLS3ES.js.map +1 -0
- package/dist/chunk-UM4ZXXJR.js +9 -0
- package/dist/chunk-UM4ZXXJR.js.map +1 -0
- package/dist/{chunk-QT3KFVDP.js → chunk-UME3X7CP.js} +28 -32
- package/dist/chunk-UME3X7CP.js.map +1 -0
- package/dist/chunk-VT4YM4XQ.js +210 -0
- package/dist/chunk-VT4YM4XQ.js.map +1 -0
- package/dist/chunk-WSYYXONG.js +1602 -0
- package/dist/chunk-WSYYXONG.js.map +1 -0
- package/dist/{chunk-C2H7HBNP.js → chunk-WVCJRSGJ.js} +119 -14
- package/dist/chunk-WVCJRSGJ.js.map +1 -0
- package/dist/chunk-X5ITQVXE.js +15 -0
- package/dist/chunk-X5ITQVXE.js.map +1 -0
- package/dist/chunk-XA7HVIHI.js +126 -0
- package/dist/chunk-XA7HVIHI.js.map +1 -0
- package/dist/{chunk-KKRO2VCP.js → chunk-YJCHB7R3.js} +60 -12
- package/dist/chunk-YJCHB7R3.js.map +1 -0
- package/dist/chunk-YKIHNLWD.js +153 -0
- package/dist/chunk-YKIHNLWD.js.map +1 -0
- package/dist/chunk-ZDUBPV33.js +277 -0
- package/dist/chunk-ZDUBPV33.js.map +1 -0
- package/dist/client.d.ts +1068 -118
- package/dist/codex-realtime-controller.d.ts +13 -0
- package/dist/codex-realtime-controller.js +4 -2
- package/dist/codex-realtime-v3-wire.d.ts +3 -2
- package/dist/codex-realtime.d.ts +5 -1
- package/dist/company-brain.d.ts +1 -11
- package/dist/core.d.ts +7 -2
- package/dist/core.js +25 -6
- package/dist/deprecation.d.ts +47 -0
- package/dist/document-authority-client.d.ts +24 -2
- package/dist/document-authority.js +7 -5
- package/dist/editable-artifacts/index.d.ts +1 -1
- package/dist/editable-artifacts/types.d.ts +12 -2
- package/dist/editable-artifacts.js +19 -3
- package/dist/editable-artifacts.js.map +1 -1
- package/dist/embedding-client.d.ts +129 -0
- package/dist/errors.d.ts +76 -1
- package/dist/external-vault-receiver.d.ts +203 -0
- package/dist/external-vault-receiver.js +564 -0
- package/dist/external-vault-receiver.js.map +1 -0
- package/dist/feedback.d.ts +23 -0
- package/dist/gateway-realtime-transport.js +1 -1
- package/dist/github-repositories.d.ts +10 -0
- package/dist/github-repositories.js +36 -0
- package/dist/github-repositories.js.map +1 -0
- package/dist/index.d.ts +62 -11
- package/dist/index.js +557 -338
- package/dist/index.js.map +1 -1
- package/dist/insights-usage.d.ts +33 -0
- package/dist/insights-usage.js +7 -0
- package/dist/insights-usage.js.map +1 -0
- package/dist/interaction.d.ts +165 -71
- package/dist/interaction.js +2 -2
- package/dist/knowledge.d.ts +7 -0
- package/dist/knowledge.js +20 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/known-tools.d.ts +4 -0
- package/dist/message-links.d.ts +68 -0
- package/dist/model-context.d.ts +68 -0
- package/dist/model-display.d.ts +2 -0
- package/dist/model-display.js +17 -0
- package/dist/model-display.js.map +1 -0
- package/dist/model-picker-order.d.ts +1 -0
- package/dist/model-picker-order.js +10 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-integration-policy.d.ts +26 -0
- package/dist/organization-integration-policy.js +26 -0
- package/dist/organization-integration-policy.js.map +1 -0
- package/dist/pr-review-client.d.ts +1 -1
- package/dist/pr-review.d.ts +1 -1
- package/dist/pr-review.js.map +1 -1
- package/dist/preference-registry.d.ts +1 -1
- package/dist/prepared-mcp-setup.d.ts +5 -0
- package/dist/proxy.d.ts +13 -11
- package/dist/realtime.d.ts +1 -1
- package/dist/realtime.js +253 -7
- package/dist/realtime.js.map +1 -1
- package/dist/session-history-import.d.ts +22 -0
- package/dist/session-history-import.js +36 -0
- package/dist/session-history-import.js.map +1 -0
- package/dist/session-list-entries.d.ts +1 -0
- package/dist/session-list-entries.js +7 -0
- package/dist/session-list-entries.js.map +1 -0
- package/dist/session-message-search.d.ts +53 -0
- package/dist/session-proxy-client.d.ts +28 -0
- package/dist/session-proxy.d.ts +334 -0
- package/dist/session-proxy.js +24 -0
- package/dist/session-proxy.js.map +1 -0
- package/dist/session-titles.d.ts +2 -28
- package/dist/session-usage-limits.d.ts +10 -0
- package/dist/session-usage-limits.js +43 -0
- package/dist/session-usage-limits.js.map +1 -0
- package/dist/shared-catalog-loader.d.ts +34 -0
- package/dist/site-ai.d.ts +35 -0
- package/dist/site-bridge-host.d.ts +112 -0
- package/dist/site-bridge-host.js +286 -0
- package/dist/site-bridge-host.js.map +1 -0
- package/dist/site-browser-entry.d.ts +1 -0
- package/dist/site-browser-runtime.gen.d.ts +1 -0
- package/dist/site-data.d.ts +178 -0
- package/dist/site-document.d.ts +5 -0
- package/dist/site-document.js +20 -0
- package/dist/site-document.js.map +1 -0
- package/dist/site-document.test.d.ts +1 -0
- package/dist/site-http.d.ts +17 -0
- package/dist/site-sql.d.ts +31 -0
- package/dist/site-tool-bridge.d.ts +57 -0
- package/dist/site.d.ts +186 -0
- package/dist/site.js +63 -0
- package/dist/site.js.map +1 -0
- package/dist/skills.d.ts +75 -0
- package/dist/sse.d.ts +1 -1
- package/dist/stream.d.ts +2 -0
- package/dist/tenant-workspaces.d.ts +47 -0
- package/dist/tenant-workspaces.js +8 -0
- package/dist/tenant-workspaces.js.map +1 -0
- package/dist/tool-auth.d.ts +87 -0
- package/dist/tool-auth.js +23 -0
- package/dist/tool-auth.js.map +1 -0
- package/dist/tool-display-metadata.d.ts +3 -0
- package/dist/tools-37DCTCNZ.js +12 -0
- package/dist/tools-37DCTCNZ.js.map +1 -0
- package/dist/tools.d.ts +81 -0
- package/dist/transcription.d.ts +1 -1
- package/dist/types.d.ts +2807 -583
- package/dist/usage-allowances.d.ts +36 -0
- package/dist/usage-allowances.js +80 -0
- package/dist/usage-allowances.js.map +1 -0
- package/dist/vault-types.d.ts +324 -0
- package/dist/vaults-api.d.ts +65 -0
- package/dist/workspace-artifacts.d.ts +47 -5
- package/dist/workspace-instruction-policies.d.ts +2 -2
- package/dist/workspace-integrations.d.ts +74 -0
- package/dist/workspace-integrations.js +67 -0
- package/dist/workspace-integrations.js.map +1 -0
- package/dist/workspace-state.d.ts +8 -71
- package/package.json +103 -5
- package/src/adapters/express.ts +136 -0
- package/src/adapters/hono.ts +18 -0
- package/src/adapters/next.ts +42 -0
- package/src/allowance-refusal.ts +5 -0
- package/src/app-links.ts +117 -0
- package/src/artifact-catalog.ts +51 -0
- package/src/artifact-client.ts +40 -49
- package/src/artifacts.ts +1 -0
- package/src/automations-client.ts +8 -2
- package/src/azure-live-transport.ts +286 -0
- package/src/browser.ts +37 -0
- package/src/chat/fold.ts +431 -0
- package/src/chat/handler.ts +240 -0
- package/src/chat/http.ts +257 -0
- package/src/chat/ids.ts +85 -0
- package/src/chat/index.ts +88 -0
- package/src/chat/openai.ts +439 -0
- package/src/chat/opengeni.ts +737 -0
- package/src/chat/types.ts +219 -0
- package/src/chat/vercel.ts +204 -0
- package/src/chats.ts +16 -0
- package/src/client.ts +5697 -1833
- package/src/codex-realtime-controller.ts +163 -8
- package/src/codex-realtime-v3-wire.ts +4 -3
- package/src/codex-realtime-v3.ts +12 -3
- package/src/codex-realtime.ts +11 -3
- package/src/company-brain.ts +0 -40
- package/src/core.ts +20 -0
- package/src/deprecation.ts +149 -0
- package/src/document-authority-client.ts +104 -1
- package/src/editable-artifacts/controller.ts +36 -2
- package/src/editable-artifacts/index.ts +1 -0
- package/src/editable-artifacts/types.ts +29 -16
- package/src/embedding-client.ts +519 -0
- package/src/errors.ts +303 -4
- package/src/external-vault-receiver.ts +914 -0
- package/src/feedback.ts +20 -0
- package/src/gateway-realtime-transport.ts +3 -3
- package/src/github-repositories.ts +60 -0
- package/src/index.ts +603 -65
- package/src/insights-usage.ts +64 -0
- package/src/interaction.ts +315 -93
- package/src/knowledge.ts +72 -0
- package/src/known-tools.ts +279 -0
- package/src/message-links.ts +178 -0
- package/src/model-context.ts +113 -0
- package/src/model-display.ts +11 -0
- package/src/model-picker-order.ts +6 -0
- package/src/organization-integration-policy.ts +54 -0
- package/src/pr-review-client.ts +1 -1
- package/src/pr-review.ts +1 -1
- package/src/preference-registry.ts +2 -0
- package/src/prepared-mcp-setup.ts +123 -0
- package/src/proxy.ts +23 -12
- package/src/realtime.ts +15 -6
- package/src/session-history-import.ts +84 -0
- package/src/session-list-entries.ts +1 -0
- package/src/session-message-search.ts +47 -0
- package/src/session-proxy-client.ts +68 -0
- package/src/session-proxy.ts +2098 -0
- package/src/session-titles.ts +8 -82
- package/src/session-usage-limits.ts +71 -0
- package/src/shared-catalog-loader.ts +169 -0
- package/src/site-ai.ts +284 -0
- package/src/site-bridge-host.ts +422 -0
- package/src/site-browser-entry.ts +6 -0
- package/src/site-browser-runtime.gen.ts +2 -0
- package/src/site-data.ts +372 -0
- package/src/site-document.test.ts +64 -0
- package/src/site-document.ts +18 -0
- package/src/site-http.ts +171 -0
- package/src/site-sql.ts +153 -0
- package/src/site-tool-bridge.ts +401 -0
- package/src/site.ts +878 -0
- package/src/skills.ts +69 -0
- package/src/sse.ts +9 -3
- package/src/stream.ts +33 -10
- package/src/tenant-workspaces.ts +148 -0
- package/src/tool-auth.ts +301 -0
- package/src/tool-display-metadata.ts +27 -0
- package/src/tools.ts +452 -0
- package/src/transcription.ts +3 -0
- package/src/types.ts +3170 -582
- package/src/usage-allowances.ts +189 -0
- package/src/vault-types.ts +379 -0
- package/src/vaults-api.ts +339 -0
- package/src/workspace-artifacts.ts +55 -6
- package/src/workspace-instruction-policies.ts +2 -1
- package/src/workspace-integrations.ts +402 -0
- package/src/workspace-state.ts +8 -82
- package/dist/chunk-C2H7HBNP.js.map +0 -1
- package/dist/chunk-C4DJPZRU.js +0 -119
- package/dist/chunk-C4DJPZRU.js.map +0 -1
- package/dist/chunk-JUS2UYRP.js.map +0 -1
- package/dist/chunk-KKRO2VCP.js.map +0 -1
- package/dist/chunk-QT3KFVDP.js.map +0 -1
- package/dist/chunk-TRNI7KEO.js.map +0 -1
- package/dist/chunk-VYCTL62C.js.map +0 -1
- package/dist/chunk-YXQX7RQT.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
humanizeModelSlug,
|
|
3
|
+
isRawModelLabel,
|
|
4
|
+
modelDisplayName,
|
|
5
|
+
modelLogoUrl,
|
|
6
|
+
modelSlug,
|
|
7
|
+
modelVendor
|
|
8
|
+
} from "./chunk-YKIHNLWD.js";
|
|
9
|
+
export {
|
|
10
|
+
humanizeModelSlug,
|
|
11
|
+
isRawModelLabel,
|
|
12
|
+
modelDisplayName,
|
|
13
|
+
modelLogoUrl,
|
|
14
|
+
modelSlug,
|
|
15
|
+
modelVendor
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=model-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { compareModelPickerOrder, modelPickerBillingClassFor, type ModelPickerBillingCandidate, type ModelPickerBillingClass, } from "@opengeni/contracts/model-picker-order";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/model-picker-order.ts
|
|
2
|
+
import {
|
|
3
|
+
compareModelPickerOrder,
|
|
4
|
+
modelPickerBillingClassFor
|
|
5
|
+
} from "@opengeni/contracts/model-picker-order";
|
|
6
|
+
export {
|
|
7
|
+
compareModelPickerOrder,
|
|
8
|
+
modelPickerBillingClassFor
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=model-picker-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/model-picker-order.ts"],"sourcesContent":["export {\n compareModelPickerOrder,\n modelPickerBillingClassFor,\n type ModelPickerBillingCandidate,\n type ModelPickerBillingClass,\n} from \"@opengeni/contracts/model-picker-order\";\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;","names":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { OpenGeniClient } from "./client.js";
|
|
2
|
+
export type OrganizationIntegrationPolicy = {
|
|
3
|
+
mode: "unrestricted" | "restricted";
|
|
4
|
+
allowedIntegrationKeys: string[];
|
|
5
|
+
revision: number;
|
|
6
|
+
};
|
|
7
|
+
export type UpdateOrganizationIntegrationPolicyRequest = {
|
|
8
|
+
mode: "unrestricted" | "restricted";
|
|
9
|
+
allowedIntegrationKeys: string[];
|
|
10
|
+
expectedRevision: number;
|
|
11
|
+
operationId: string;
|
|
12
|
+
};
|
|
13
|
+
type PolicyClient = Pick<OpenGeniClient, "requestJson">;
|
|
14
|
+
export type OrganizationIntegrationCatalog = {
|
|
15
|
+
integrations: Array<{
|
|
16
|
+
key: string;
|
|
17
|
+
label: string;
|
|
18
|
+
kind: "curated" | "custom";
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
/** Discover stable policy identities; integrations must not guess provider identifiers. */
|
|
22
|
+
export declare function getOrganizationIntegrationCatalog(client: PolicyClient, organizationId: string): Promise<OrganizationIntegrationCatalog>;
|
|
23
|
+
export declare function getOrganizationIntegrationPolicy(client: PolicyClient, organizationId: string): Promise<OrganizationIntegrationPolicy>;
|
|
24
|
+
/** Retain operationId and the exact request when reconciling an uncertain outcome. */
|
|
25
|
+
export declare function updateOrganizationIntegrationPolicy(client: PolicyClient, organizationId: string, request: UpdateOrganizationIntegrationPolicyRequest): Promise<OrganizationIntegrationPolicy>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/organization-integration-policy.ts
|
|
2
|
+
async function getOrganizationIntegrationCatalog(client, organizationId) {
|
|
3
|
+
return client.requestJson(
|
|
4
|
+
"GET",
|
|
5
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy/catalog`
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
async function getOrganizationIntegrationPolicy(client, organizationId) {
|
|
9
|
+
return client.requestJson(
|
|
10
|
+
"GET",
|
|
11
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
async function updateOrganizationIntegrationPolicy(client, organizationId, request) {
|
|
15
|
+
return client.requestJson(
|
|
16
|
+
"PUT",
|
|
17
|
+
`/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`,
|
|
18
|
+
request
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
getOrganizationIntegrationCatalog,
|
|
23
|
+
getOrganizationIntegrationPolicy,
|
|
24
|
+
updateOrganizationIntegrationPolicy
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=organization-integration-policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/organization-integration-policy.ts"],"sourcesContent":["import type { OpenGeniClient } from \"./client\";\n\nexport type OrganizationIntegrationPolicy = {\n mode: \"unrestricted\" | \"restricted\";\n allowedIntegrationKeys: string[];\n revision: number;\n};\n\nexport type UpdateOrganizationIntegrationPolicyRequest = {\n mode: \"unrestricted\" | \"restricted\";\n allowedIntegrationKeys: string[];\n expectedRevision: number;\n operationId: string;\n};\n\ntype PolicyClient = Pick<OpenGeniClient, \"requestJson\">;\n\nexport type OrganizationIntegrationCatalog = {\n integrations: Array<{ key: string; label: string; kind: \"curated\" | \"custom\" }>;\n};\n\n/** Discover stable policy identities; integrations must not guess provider identifiers. */\nexport async function getOrganizationIntegrationCatalog(\n client: PolicyClient,\n organizationId: string,\n): Promise<OrganizationIntegrationCatalog> {\n return client.requestJson(\n \"GET\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy/catalog`,\n );\n}\n\nexport async function getOrganizationIntegrationPolicy(\n client: PolicyClient,\n organizationId: string,\n): Promise<OrganizationIntegrationPolicy> {\n return client.requestJson(\n \"GET\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`,\n );\n}\n\n/** Retain operationId and the exact request when reconciling an uncertain outcome. */\nexport async function updateOrganizationIntegrationPolicy(\n client: PolicyClient,\n organizationId: string,\n request: UpdateOrganizationIntegrationPolicyRequest,\n): Promise<OrganizationIntegrationPolicy> {\n return client.requestJson(\n \"PUT\",\n `/v1/organizations/${encodeURIComponent(organizationId)}/integration-policy`,\n request,\n );\n}\n"],"mappings":";AAsBA,eAAsB,kCACpB,QACA,gBACyC;AACzC,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,qBAAqB,mBAAmB,cAAc,CAAC;AAAA,EACzD;AACF;AAEA,eAAsB,iCACpB,QACA,gBACwC;AACxC,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,qBAAqB,mBAAmB,cAAc,CAAC;AAAA,EACzD;AACF;AAGA,eAAsB,oCACpB,QACA,gBACA,SACwC;AACxC,SAAO,OAAO;AAAA,IACZ;AAAA,IACA,qBAAqB,mBAAmB,cAAc,CAAC;AAAA,IACvD;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenGeniClient as OpenGeniCoreClient } from "./client.js";
|
|
2
2
|
import type { CreatePrReviewAppRegistrationRequest, CreatePrReviewRepositoryBindingRequest, PrReviewAppRegistration, PrReviewRepositoryBinding, ListPrReviewConfigurationResponse, PrReviewManagedGitHubSetup, UpdatePrReviewAppRegistrationRequest, UpdatePrReviewRepositoryBindingRequest } from "./types.js";
|
|
3
3
|
export type OpenGeniPrReviewTransport = Pick<OpenGeniCoreClient, "requestJson" | "requestVoid">;
|
|
4
|
-
/** Optional
|
|
4
|
+
/** Optional Opengeni Review Bot API surface, isolated from the eager core client graph. */
|
|
5
5
|
export declare class OpenGeniPrReviewClient {
|
|
6
6
|
private readonly client;
|
|
7
7
|
constructor(client: OpenGeniPrReviewTransport);
|
package/dist/pr-review.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Optional
|
|
1
|
+
/** Optional Opengeni Review Bot API client; import this entry only where the capability is used. */
|
|
2
2
|
export { OpenGeniPrReviewClient } from "./pr-review-client.js";
|
|
3
3
|
export type { OpenGeniPrReviewTransport } from "./pr-review-client.js";
|
|
4
4
|
export type { CreatePrReviewAppRegistrationRequest, CreatePrReviewRepositoryBindingRequest, PrReviewAppRegistration, PrReviewCredentialKind, PrReviewProvider, PrReviewManagedGitHubInstallation, PrReviewManagedGitHubSetup, PrReviewRepositoryBinding, PrReviewWebhookAuthKind, ListPrReviewConfigurationResponse, UpdatePrReviewAppRegistrationRequest, UpdatePrReviewRepositoryBindingRequest, } from "./types.js";
|
package/dist/pr-review.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/pr-review-client.ts"],"sourcesContent":["import type { OpenGeniClient as OpenGeniCoreClient } from \"./client\";\nimport type {\n CreatePrReviewAppRegistrationRequest,\n CreatePrReviewRepositoryBindingRequest,\n PrReviewAppRegistration,\n PrReviewRepositoryBinding,\n ListPrReviewConfigurationResponse,\n PrReviewManagedGitHubSetup,\n UpdatePrReviewAppRegistrationRequest,\n UpdatePrReviewRepositoryBindingRequest,\n} from \"./types\";\n\nexport type OpenGeniPrReviewTransport = Pick<OpenGeniCoreClient, \"requestJson\" | \"requestVoid\">;\n\n/** Optional
|
|
1
|
+
{"version":3,"sources":["../src/pr-review-client.ts"],"sourcesContent":["import type { OpenGeniClient as OpenGeniCoreClient } from \"./client\";\nimport type {\n CreatePrReviewAppRegistrationRequest,\n CreatePrReviewRepositoryBindingRequest,\n PrReviewAppRegistration,\n PrReviewRepositoryBinding,\n ListPrReviewConfigurationResponse,\n PrReviewManagedGitHubSetup,\n UpdatePrReviewAppRegistrationRequest,\n UpdatePrReviewRepositoryBindingRequest,\n} from \"./types\";\n\nexport type OpenGeniPrReviewTransport = Pick<OpenGeniCoreClient, \"requestJson\" | \"requestVoid\">;\n\n/** Optional Opengeni Review Bot API surface, isolated from the eager core client graph. */\nexport class OpenGeniPrReviewClient {\n constructor(private readonly client: OpenGeniPrReviewTransport) {}\n\n async listConfiguration(workspaceId: string): Promise<ListPrReviewConfigurationResponse> {\n return await this.client.requestJson<ListPrReviewConfigurationResponse>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/pr-review/registrations`,\n );\n }\n\n async getManagedGitHubSetup(workspaceId: string): Promise<PrReviewManagedGitHubSetup> {\n return await this.client.requestJson<PrReviewManagedGitHubSetup>(\n \"GET\",\n `/v1/workspaces/${workspaceId}/pr-review/github`,\n );\n }\n\n async createAppRegistration(\n workspaceId: string,\n request: CreatePrReviewAppRegistrationRequest,\n ): Promise<PrReviewAppRegistration> {\n return await this.client.requestJson<PrReviewAppRegistration>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/pr-review/registrations`,\n request,\n );\n }\n\n async updateAppRegistration(\n workspaceId: string,\n registrationId: string,\n request: UpdatePrReviewAppRegistrationRequest,\n ): Promise<PrReviewAppRegistration> {\n return await this.client.requestJson<PrReviewAppRegistration>(\n \"PATCH\",\n `/v1/workspaces/${workspaceId}/pr-review/registrations/${encodeURIComponent(registrationId)}`,\n request,\n );\n }\n\n async deleteAppRegistration(workspaceId: string, registrationId: string): Promise<void> {\n await this.client.requestVoid(\n \"DELETE\",\n `/v1/workspaces/${workspaceId}/pr-review/registrations/${encodeURIComponent(registrationId)}`,\n );\n }\n\n async createRepositoryBinding(\n workspaceId: string,\n request: CreatePrReviewRepositoryBindingRequest,\n ): Promise<PrReviewRepositoryBinding> {\n return await this.client.requestJson<PrReviewRepositoryBinding>(\n \"POST\",\n `/v1/workspaces/${workspaceId}/pr-review/repositories`,\n request,\n );\n }\n\n async updateRepositoryBinding(\n workspaceId: string,\n bindingId: string,\n request: UpdatePrReviewRepositoryBindingRequest,\n ): Promise<PrReviewRepositoryBinding> {\n return await this.client.requestJson<PrReviewRepositoryBinding>(\n \"PATCH\",\n `/v1/workspaces/${workspaceId}/pr-review/repositories/${encodeURIComponent(bindingId)}`,\n request,\n );\n }\n\n async deleteRepositoryBinding(workspaceId: string, bindingId: string): Promise<void> {\n await this.client.requestVoid(\n \"DELETE\",\n `/v1/workspaces/${workspaceId}/pr-review/repositories/${encodeURIComponent(bindingId)}`,\n );\n }\n}\n"],"mappings":";AAeO,IAAM,yBAAN,MAA6B;AAAA,EAClC,YAA6B,QAAmC;AAAnC;AAAA,EAAoC;AAAA,EAEjE,MAAM,kBAAkB,aAAiE;AACvF,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,MAAM,sBAAsB,aAA0D;AACpF,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,MAAM,sBACJ,aACA,SACkC;AAClC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,sBACJ,aACA,gBACA,SACkC;AAClC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW,4BAA4B,mBAAmB,cAAc,CAAC;AAAA,MAC3F;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,sBAAsB,aAAqB,gBAAuC;AACtF,UAAM,KAAK,OAAO;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW,4BAA4B,mBAAmB,cAAc,CAAC;AAAA,IAC7F;AAAA,EACF;AAAA,EAEA,MAAM,wBACJ,aACA,SACoC;AACpC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW;AAAA,MAC7B;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,wBACJ,aACA,WACA,SACoC;AACpC,WAAO,MAAM,KAAK,OAAO;AAAA,MACvB;AAAA,MACA,kBAAkB,WAAW,2BAA2B,mBAAmB,SAAS,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAM,wBAAwB,aAAqB,WAAkC;AACnF,UAAM,KAAK,OAAO;AAAA,MAChB;AAAA,MACA,kBAAkB,WAAW,2BAA2B,mBAAmB,SAAS,CAAC;AAAA,IACvF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type PreferenceRegistryScope = "organization" | "workspace" | "user";
|
|
2
2
|
export type PreferenceRegistryStatus = "proposed" | "active" | "inactive" | "rejected" | "superseded" | "expired";
|
|
3
|
-
export type PreferenceRegistryProvenanceSource = "human" | "onboarding" | "knowledge_proposal" | "imported_document" | "slack" | "meeting_transcript" | "call_transcript";
|
|
3
|
+
export type PreferenceRegistryProvenanceSource = "human" | "onboarding" | "knowledge_proposal" | "agent" | "portable_skill" | "imported_document" | "slack" | "meeting_transcript" | "call_transcript";
|
|
4
4
|
export type PreferenceRegistryTrust = "untrusted_proposal" | "personal" | "workspace_managed" | "organization_managed";
|
|
5
5
|
export type PreferenceRegistryConflictStrategy = "override" | "merge" | "reject" | "inform";
|
|
6
6
|
export declare function normalizePreferenceRegistryStableKey(value: string): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CustomMcpSetupRequest } from "@opengeni/contracts/prepared-mcp-setup";
|
|
2
|
+
/** Browser/native-safe display projection. The API owns authoritative schema
|
|
3
|
+
* validation; parity tests keep this lightweight parser aligned without pulling
|
|
4
|
+
* schema runtimes into the SDK or replaying unknown fields into a secret form. */
|
|
5
|
+
export declare function parseCustomMcpSetupRequest(value: unknown): CustomMcpSetupRequest | null;
|
package/dist/proxy.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import type { OpenGeniClient } from "./client.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type StreamSessionEventsOptions } from "./stream.js";
|
|
3
3
|
import type { SessionEvent } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Proxy-through-your-own-API helpers.
|
|
6
6
|
*
|
|
7
|
-
* The intended pattern: a customer's server consumes the
|
|
7
|
+
* The intended pattern: a customer's server consumes the Opengeni event
|
|
8
8
|
* stream with its own API key (`client.streamEvents(...)`) and re-emits it to
|
|
9
|
-
* its browser clients over its own authenticated endpoint — the
|
|
9
|
+
* its browser clients over its own authenticated endpoint — the Opengeni key
|
|
10
10
|
* never reaches the browser. The re-emitted wire format is identical to
|
|
11
|
-
*
|
|
11
|
+
* Opengeni's own SSE stream (`id: <sequence>`, `event: <type>`,
|
|
12
12
|
* `data: <event JSON>`), so the browser side can consume it with this same
|
|
13
13
|
* SDK's streaming core (or a plain `EventSource`), including resume via
|
|
14
|
-
* `?after=` / `Last-Event-ID`.
|
|
14
|
+
* `?after=` / `Last-Event-ID`. An ordinary event uses its own sequence as the
|
|
15
|
+
* SSE `id`; a compact event uses the server-owned sequence it covers through.
|
|
15
16
|
*/
|
|
16
|
-
/** Format one event
|
|
17
|
+
/** Format one event with the exact Opengeni data and resume-cursor semantics. */
|
|
17
18
|
export declare function formatSseEvent(event: SessionEvent): string;
|
|
18
19
|
export type SseReStreamOptions = {
|
|
19
20
|
/**
|
|
@@ -23,7 +24,7 @@ export type SseReStreamOptions = {
|
|
|
23
24
|
heartbeatMs?: number;
|
|
24
25
|
/**
|
|
25
26
|
* Called when the downstream consumer cancels (e.g. the browser
|
|
26
|
-
* disconnected). Use it to abort the upstream
|
|
27
|
+
* disconnected). Use it to abort the upstream Opengeni stream — an async
|
|
27
28
|
* iterator that is mid-`await` cannot be interrupted by `return()` alone.
|
|
28
29
|
*/
|
|
29
30
|
onCancel?: () => void;
|
|
@@ -38,8 +39,9 @@ export declare function sessionEventsToSseStream(events: AsyncIterable<SessionEv
|
|
|
38
39
|
export declare function sessionEventsToSseResponse(events: AsyncIterable<SessionEvent>, options?: SseReStreamOptions): Response;
|
|
39
40
|
/**
|
|
40
41
|
* Read the resume cursor a reconnecting SSE client sent: the `after` query
|
|
41
|
-
* parameter, or the standard `Last-Event-ID` header
|
|
42
|
-
*
|
|
42
|
+
* parameter, or the standard `Last-Event-ID` header. Re-emitted streams set
|
|
43
|
+
* `id:` to the event sequence for ordinary events and the covered high-water
|
|
44
|
+
* sequence for compact events. Returns 0 (full replay) when absent.
|
|
43
45
|
*/
|
|
44
46
|
export declare function resumeSequenceFromRequest(request: Request): number;
|
|
45
47
|
export type ProxySessionEventStreamOptions = Omit<StreamSessionEventsOptions, "after"> & {
|
|
@@ -52,12 +54,12 @@ export type ProxySessionEventStreamOptions = Omit<StreamSessionEventsOptions, "a
|
|
|
52
54
|
heartbeatMs?: number;
|
|
53
55
|
};
|
|
54
56
|
/**
|
|
55
|
-
* One-call proxy: consume the
|
|
57
|
+
* One-call proxy: consume the Opengeni stream server-side and return an SSE
|
|
56
58
|
* `Response` for your own browser clients. Works anywhere WHATWG `Response`
|
|
57
59
|
* is the handler return type (Hono, Next.js route handlers, Bun.serve,
|
|
58
60
|
* Cloudflare Workers, ...).
|
|
59
61
|
*
|
|
60
|
-
* The upstream
|
|
62
|
+
* The upstream Opengeni connection is torn down when the downstream client
|
|
61
63
|
* disconnects, and also when `options.signal` (e.g. the incoming request's
|
|
62
64
|
* signal) aborts.
|
|
63
65
|
*/
|
package/dist/realtime.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type SessionRealtimeClientLike = CodexRealtimeControllerClient & {
|
|
|
13
13
|
signal?: AbortSignal | undefined;
|
|
14
14
|
}): Promise<WorkspaceRealtimeModelCatalogResponse>;
|
|
15
15
|
};
|
|
16
|
-
export type SessionRealtimeTransportKind = "codex" | "gateway" | "xai-subscription";
|
|
16
|
+
export type SessionRealtimeTransportKind = "codex" | "gateway" | "xai-subscription" | "azure-live";
|
|
17
17
|
/** Provider-neutral names for the existing, battle-tested controller projection. */
|
|
18
18
|
export type SessionRealtimeController = CodexRealtimeController;
|
|
19
19
|
export type SessionRealtimeControllerSnapshot = CodexRealtimeControllerSnapshot;
|
package/dist/realtime.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createGatewayRealtimeTransportStarter,
|
|
3
|
-
createXaiSubscriptionRealtimeTransportStarter
|
|
4
|
-
} from "./chunk-YKZME56C.js";
|
|
5
1
|
import {
|
|
6
2
|
CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,
|
|
7
3
|
CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT,
|
|
@@ -27,11 +23,256 @@ import {
|
|
|
27
23
|
sessionRealtimeOwnerStorageKey,
|
|
28
24
|
sessionRealtimeOwnerStorageNamespace,
|
|
29
25
|
startCodexRealtimeWebrtc
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import
|
|
26
|
+
} from "./chunk-WVCJRSGJ.js";
|
|
27
|
+
import {
|
|
28
|
+
createGatewayRealtimeTransportStarter,
|
|
29
|
+
createXaiSubscriptionRealtimeTransportStarter
|
|
30
|
+
} from "./chunk-KWADQ227.js";
|
|
31
|
+
import "./chunk-7EWT3PV6.js";
|
|
32
|
+
|
|
33
|
+
// src/azure-live-transport.ts
|
|
34
|
+
var MAX_FRAGMENT_BYTES = 64e3;
|
|
35
|
+
function takeUtf8Tail(text, maxBytes = MAX_FRAGMENT_BYTES) {
|
|
36
|
+
const encoder = new TextEncoder();
|
|
37
|
+
if (encoder.encode(text).byteLength <= maxBytes) return text;
|
|
38
|
+
let tail = text.slice(-maxBytes);
|
|
39
|
+
while (encoder.encode(tail).byteLength > maxBytes) tail = tail.slice(1);
|
|
40
|
+
return tail;
|
|
41
|
+
}
|
|
42
|
+
var AzureLiveDataChannel = class extends EventTarget {
|
|
43
|
+
constructor(raw, drainTimeoutMs = 5e3) {
|
|
44
|
+
super();
|
|
45
|
+
this.raw = raw;
|
|
46
|
+
this.drainTimeoutMs = drainTimeoutMs;
|
|
47
|
+
raw.addEventListener("open", this.onOpen);
|
|
48
|
+
raw.addEventListener("close", this.onClose);
|
|
49
|
+
raw.addEventListener("error", this.onError);
|
|
50
|
+
raw.addEventListener("message", this.onMessage);
|
|
51
|
+
}
|
|
52
|
+
pending = null;
|
|
53
|
+
timer = null;
|
|
54
|
+
ordinal = 0;
|
|
55
|
+
prefix = crypto.randomUUID();
|
|
56
|
+
closed = false;
|
|
57
|
+
closeSent = false;
|
|
58
|
+
providerClosed = false;
|
|
59
|
+
delegations = /* @__PURE__ */ new Set();
|
|
60
|
+
// Azure delegations carry no content, so the user's words since the previous
|
|
61
|
+
// delegation become the delegation input.
|
|
62
|
+
userSinceDelegation = "";
|
|
63
|
+
draining = null;
|
|
64
|
+
finishDrain = null;
|
|
65
|
+
onOpen = () => this.dispatchEvent(new Event("open"));
|
|
66
|
+
onClose = () => {
|
|
67
|
+
this.providerClosed = true;
|
|
68
|
+
this.flush();
|
|
69
|
+
this.finishDrain?.();
|
|
70
|
+
this.dispatchEvent(new Event("close"));
|
|
71
|
+
};
|
|
72
|
+
onError = () => this.dispatchEvent(new Event("error"));
|
|
73
|
+
onMessage = (event) => {
|
|
74
|
+
if (typeof event.data !== "string" || event.data.length > 1048576) return;
|
|
75
|
+
let value;
|
|
76
|
+
try {
|
|
77
|
+
value = JSON.parse(event.data);
|
|
78
|
+
} catch {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (!value || typeof value !== "object") return;
|
|
82
|
+
this.receive(value);
|
|
83
|
+
};
|
|
84
|
+
get readyState() {
|
|
85
|
+
return this.closed || this.providerClosed ? "closed" : this.closeSent ? "closing" : this.raw.readyState;
|
|
86
|
+
}
|
|
87
|
+
asRtcDataChannel() {
|
|
88
|
+
return this;
|
|
89
|
+
}
|
|
90
|
+
emit(value) {
|
|
91
|
+
if (!this.closed)
|
|
92
|
+
this.dispatchEvent(new MessageEvent("message", { data: JSON.stringify(value) }));
|
|
93
|
+
}
|
|
94
|
+
flush() {
|
|
95
|
+
if (this.timer) clearTimeout(this.timer);
|
|
96
|
+
this.timer = null;
|
|
97
|
+
const pending = this.pending;
|
|
98
|
+
this.pending = null;
|
|
99
|
+
if (!pending?.text) return;
|
|
100
|
+
this.emit({
|
|
101
|
+
type: "transcript.segment",
|
|
102
|
+
turn: {
|
|
103
|
+
id: `${this.prefix}:${++this.ordinal}`,
|
|
104
|
+
role: pending.role,
|
|
105
|
+
transcript: pending.text
|
|
106
|
+
},
|
|
107
|
+
start_ms: pending.startMs,
|
|
108
|
+
end_ms: pending.endMs
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
receive(value) {
|
|
112
|
+
if (this.closed) return;
|
|
113
|
+
if (value.type === "session.input_transcript.delta" || value.type === "session.output_transcript.delta") {
|
|
114
|
+
if (typeof value.delta !== "string" || typeof value.start_ms !== "number" || typeof value.end_ms !== "number")
|
|
115
|
+
return;
|
|
116
|
+
const role = value.type === "session.input_transcript.delta" ? "user" : "assistant";
|
|
117
|
+
if (role === "user")
|
|
118
|
+
this.userSinceDelegation = takeUtf8Tail(this.userSinceDelegation + value.delta);
|
|
119
|
+
if (this.pending && (this.pending.role !== role || new TextEncoder().encode(this.pending.text + value.delta).byteLength > MAX_FRAGMENT_BYTES))
|
|
120
|
+
this.flush();
|
|
121
|
+
if (new TextEncoder().encode(value.delta).byteLength > MAX_FRAGMENT_BYTES) {
|
|
122
|
+
this.emit({
|
|
123
|
+
type: "error",
|
|
124
|
+
error: { message: "Voice transcript fragment exceeded the supported size" }
|
|
125
|
+
});
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.pending = {
|
|
129
|
+
role,
|
|
130
|
+
text: (this.pending?.text ?? "") + value.delta,
|
|
131
|
+
startMs: this.pending?.startMs ?? value.start_ms,
|
|
132
|
+
endMs: value.end_ms
|
|
133
|
+
};
|
|
134
|
+
if (!this.timer) this.timer = setTimeout(() => this.flush(), 1e3);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (value.type === "session.delegation.created") {
|
|
138
|
+
const delegation = value.delegation;
|
|
139
|
+
if (delegation?.target !== "client" || typeof delegation.id !== "string") return;
|
|
140
|
+
this.delegations.add(delegation.id);
|
|
141
|
+
this.flush();
|
|
142
|
+
const spoken = this.userSinceDelegation.trim();
|
|
143
|
+
this.userSinceDelegation = "";
|
|
144
|
+
this.emit({
|
|
145
|
+
type: "delegation.created",
|
|
146
|
+
item: {
|
|
147
|
+
id: delegation.id,
|
|
148
|
+
type: "delegation",
|
|
149
|
+
target: "client",
|
|
150
|
+
content: spoken ? [{ type: "input_text", text: spoken }] : []
|
|
151
|
+
},
|
|
152
|
+
offset_ms: value.offset_ms
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
if (value.type === "session.closed") {
|
|
157
|
+
this.providerClosed = true;
|
|
158
|
+
this.flush();
|
|
159
|
+
this.finishDrain?.();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (value.type === "session.started" || value.type === "session.updated" || value.type === "error")
|
|
163
|
+
this.emit(value);
|
|
164
|
+
}
|
|
165
|
+
send(payload) {
|
|
166
|
+
if (this.readyState !== "open") throw Error("Hosted voice channel is not open");
|
|
167
|
+
const value = JSON.parse(payload);
|
|
168
|
+
if (value.type !== "session.context.append" && value.type !== "delegation.context.append")
|
|
169
|
+
throw Error("Unsupported hosted voice context event");
|
|
170
|
+
const content = Array.isArray(value.content) ? value.content.map((part) => typeof part?.text === "string" ? part.text : "").join("") : "";
|
|
171
|
+
this.raw.send(
|
|
172
|
+
JSON.stringify({
|
|
173
|
+
type: value.channel === "speakable" ? "session.commentary.append" : "session.thinking.append",
|
|
174
|
+
content,
|
|
175
|
+
// Replayed tasks from an earlier provider session are general context.
|
|
176
|
+
delegation_id: value.type === "delegation.context.append" && typeof value.delegation_item_id === "string" && this.delegations.has(value.delegation_item_id) ? value.delegation_item_id : null
|
|
177
|
+
})
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
drain() {
|
|
181
|
+
if (this.draining) return this.draining;
|
|
182
|
+
if (this.providerClosed || this.raw.readyState === "closed") {
|
|
183
|
+
this.flush();
|
|
184
|
+
return Promise.resolve();
|
|
185
|
+
}
|
|
186
|
+
if (this.closed || this.raw.readyState !== "open") {
|
|
187
|
+
return Promise.reject(new Error("Hosted voice close is not confirmed"));
|
|
188
|
+
}
|
|
189
|
+
const pending = new Promise((resolve, reject) => {
|
|
190
|
+
const timeout = setTimeout(() => {
|
|
191
|
+
this.flush();
|
|
192
|
+
this.finishDrain?.(
|
|
193
|
+
new Error("Hosted voice is still closing; retry to preserve final speech")
|
|
194
|
+
);
|
|
195
|
+
}, this.drainTimeoutMs);
|
|
196
|
+
this.finishDrain = (error) => {
|
|
197
|
+
clearTimeout(timeout);
|
|
198
|
+
this.finishDrain = null;
|
|
199
|
+
if (error) reject(error);
|
|
200
|
+
else resolve();
|
|
201
|
+
};
|
|
202
|
+
if (!this.closeSent) {
|
|
203
|
+
this.closeSent = true;
|
|
204
|
+
try {
|
|
205
|
+
this.raw.send(JSON.stringify({ type: "session.close" }));
|
|
206
|
+
} catch {
|
|
207
|
+
this.finishDrain(new Error("Hosted voice close could not be sent"));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
this.draining = pending;
|
|
212
|
+
void pending.then(
|
|
213
|
+
() => {
|
|
214
|
+
if (this.draining === pending) this.draining = null;
|
|
215
|
+
},
|
|
216
|
+
() => {
|
|
217
|
+
if (this.draining === pending) this.draining = null;
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
return pending;
|
|
221
|
+
}
|
|
222
|
+
close() {
|
|
223
|
+
if (this.closed) return;
|
|
224
|
+
if (this.timer) clearTimeout(this.timer);
|
|
225
|
+
this.timer = null;
|
|
226
|
+
this.pending = null;
|
|
227
|
+
this.finishDrain?.(new Error("Hosted voice channel was disposed before close confirmation"));
|
|
228
|
+
this.closed = true;
|
|
229
|
+
this.raw.removeEventListener("open", this.onOpen);
|
|
230
|
+
this.raw.removeEventListener("close", this.onClose);
|
|
231
|
+
this.raw.removeEventListener("error", this.onError);
|
|
232
|
+
this.raw.removeEventListener("message", this.onMessage);
|
|
233
|
+
this.dispatchEvent(new Event("close"));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
function createAzureLiveTransportStarter(options = {}) {
|
|
237
|
+
return async (input) => {
|
|
238
|
+
let channel;
|
|
239
|
+
try {
|
|
240
|
+
const transport = await startCodexRealtimeWebrtc({
|
|
241
|
+
...input,
|
|
242
|
+
...options,
|
|
243
|
+
activateRemoteAudio: false,
|
|
244
|
+
expectedModel: "opengeni-azure/gpt-live-1",
|
|
245
|
+
onEventsCreated(raw) {
|
|
246
|
+
channel = new AzureLiveDataChannel(raw);
|
|
247
|
+
input.onEventsCreated(channel.asRtcDataChannel());
|
|
248
|
+
},
|
|
249
|
+
negotiate: (request, requestOptions) => input.client.negotiateCodexRealtimeWebrtc(
|
|
250
|
+
input.workspaceId,
|
|
251
|
+
input.sessionId,
|
|
252
|
+
request,
|
|
253
|
+
requestOptions
|
|
254
|
+
)
|
|
255
|
+
});
|
|
256
|
+
const events = channel;
|
|
257
|
+
return {
|
|
258
|
+
...transport,
|
|
259
|
+
events: events.asRtcDataChannel(),
|
|
260
|
+
drain: () => events.drain(),
|
|
261
|
+
stop() {
|
|
262
|
+
events.close();
|
|
263
|
+
transport.stop();
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
} catch (error) {
|
|
267
|
+
channel?.close();
|
|
268
|
+
throw error;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
32
272
|
|
|
33
273
|
// src/realtime.ts
|
|
34
274
|
function sessionRealtimeTransportKind(model) {
|
|
275
|
+
if (model === "opengeni-azure/gpt-live-1") return "azure-live";
|
|
35
276
|
if (model === "gpt-live-1-boulder-alpha") return "codex";
|
|
36
277
|
if (model === "supergrok/grok-voice-think-fast-2.0") return "xai-subscription";
|
|
37
278
|
return "gateway";
|
|
@@ -41,7 +282,12 @@ function createSessionRealtimeController(options) {
|
|
|
41
282
|
return createCodexRealtimeController({
|
|
42
283
|
...options,
|
|
43
284
|
ownerStorageNamespace: sessionRealtimeOwnerStorageNamespace(options.model),
|
|
44
|
-
...transport === "
|
|
285
|
+
...transport === "azure-live" ? {
|
|
286
|
+
startTransport: createAzureLiveTransportStarter({
|
|
287
|
+
remoteAudio: options.remoteAudio,
|
|
288
|
+
createPeerConnection: options.createPeerConnection
|
|
289
|
+
})
|
|
290
|
+
} : transport === "gateway" ? { startTransport: createGatewayRealtimeTransportStarter() } : transport === "xai-subscription" ? { startTransport: createXaiSubscriptionRealtimeTransportStarter() } : {}
|
|
45
291
|
});
|
|
46
292
|
}
|
|
47
293
|
export {
|
package/dist/realtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/realtime.ts"],"sourcesContent":["/**\n * Public, provider-neutral realtime browser SDK.\n *\n * Import this subpath lazily in browser applications. The base `@opengeni/sdk`\n * entry remains free of eager realtime transport initialization.\n */\nimport {\n createCodexRealtimeController,\n hasStoredSessionRealtimeOwnerProof,\n sessionRealtimeOwnerStorageKey,\n sessionRealtimeOwnerStorageNamespace,\n type CodexRealtimeController,\n type CodexRealtimeControllerClient,\n type CodexRealtimeControllerSnapshot,\n type CodexRealtimeControllerStatus,\n type CodexRealtimeDiagnostic,\n type CodexRealtimeDiagnosticKind,\n type CodexRealtimeMicrophoneState,\n type CodexRealtimeOwnerStorage,\n type CreateCodexRealtimeControllerOptions,\n type RealtimeControllerTransportStarter,\n} from \"./codex-realtime-controller\";\nimport {\n createGatewayRealtimeTransportStarter,\n createXaiSubscriptionRealtimeTransportStarter,\n} from \"./gateway-realtime-transport\";\nimport type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from \"./types\";\n\n/** Exact backend-facing methods required by the batteries-included realtime SDK. */\nexport type SessionRealtimeClientLike = CodexRealtimeControllerClient & {\n getWorkspaceRealtimeModelCatalog(\n workspaceId: string,\n options?: { signal?: AbortSignal | undefined },\n ): Promise<WorkspaceRealtimeModelCatalogResponse>;\n};\n\nexport type SessionRealtimeTransportKind = \"codex\" | \"gateway\" | \"xai-subscription\";\n\n/** Provider-neutral names for the existing, battle-tested controller projection. */\nexport type SessionRealtimeController = CodexRealtimeController;\nexport type SessionRealtimeControllerSnapshot = CodexRealtimeControllerSnapshot;\nexport type SessionRealtimeControllerStatus = CodexRealtimeControllerStatus;\nexport type SessionRealtimeDiagnostic = CodexRealtimeDiagnostic;\nexport type SessionRealtimeDiagnosticKind = CodexRealtimeDiagnosticKind;\nexport type SessionRealtimeMicrophoneState = CodexRealtimeMicrophoneState;\nexport type SessionRealtimeOwnerStorage = CodexRealtimeOwnerStorage;\n\nexport type CreateSessionRealtimeControllerOptions = Omit<\n CreateCodexRealtimeControllerOptions,\n \"client\" | \"model\" | \"ownerStorageNamespace\" | \"startTransport\"\n> & {\n client: CodexRealtimeControllerClient;\n model: SessionRealtimeModel;\n};\n\n/** Select the existing transport without exposing provider mechanics to hosts. */\nexport function sessionRealtimeTransportKind(\n model: SessionRealtimeModel,\n): SessionRealtimeTransportKind {\n if (model === \"gpt-live-1-boulder-alpha\") return \"codex\";\n if (model === \"supergrok/grok-voice-think-fast-2.0\") return \"xai-subscription\";\n return \"gateway\";\n}\n\n/**\n * Compose the exact current controller with its existing Codex Live or AI\n * Gateway transport. Wire, ledger, delegation, recovery, and lifecycle\n * semantics remain owned by the existing implementations below this facade.\n */\nexport function createSessionRealtimeController(\n options: CreateSessionRealtimeControllerOptions,\n): SessionRealtimeController {\n const transport = sessionRealtimeTransportKind(options.model);\n return createCodexRealtimeController({\n ...options,\n ownerStorageNamespace: sessionRealtimeOwnerStorageNamespace(options.model),\n ...(transport === \"gateway\"\n ? { startTransport: createGatewayRealtimeTransportStarter() }\n : transport === \"xai-subscription\"\n ? { startTransport: createXaiSubscriptionRealtimeTransportStarter() }\n : {}),\n });\n}\n\nexport {\n createCodexRealtimeController,\n createGatewayRealtimeTransportStarter,\n createXaiSubscriptionRealtimeTransportStarter,\n hasStoredSessionRealtimeOwnerProof,\n sessionRealtimeOwnerStorageKey,\n sessionRealtimeOwnerStorageNamespace,\n};\nexport type {\n CodexRealtimeController,\n CodexRealtimeControllerClient,\n CodexRealtimeControllerSnapshot,\n CodexRealtimeControllerStatus,\n CodexRealtimeDiagnostic,\n CodexRealtimeDiagnosticKind,\n CodexRealtimeMicrophoneState,\n CodexRealtimeOwnerStorage,\n CreateCodexRealtimeControllerOptions,\n RealtimeControllerTransportStarter,\n};\n\nexport {\n CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,\n projectSessionRealtimeLifecycle,\n} from \"./codex-realtime-controller\";\nexport type { SessionRealtimeLifecycleProjection } from \"./codex-realtime-lifecycle\";\n\nexport {\n CodexRealtimeMicrophoneError,\n acquireCodexRealtimeMicrophone,\n codexRealtimeMicrophoneHealthy,\n startCodexRealtimeWebrtc,\n} from \"./codex-realtime\";\nexport type {\n AcquireCodexRealtimeMicrophoneOptions,\n CodexRealtimeAudibleOutputState,\n CodexRealtimeConnectionHealth,\n CodexRealtimeMicrophoneErrorCode,\n CodexRealtimeNegotiator,\n CodexRealtimeWebrtcSession,\n StartCodexRealtimeWebrtcOptions,\n} from \"./codex-realtime\";\n\nexport {\n CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,\n CODEX_REALTIME_V3_MAX_EVENT_BYTES,\n CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES,\n CODEX_REALTIME_V3_MAX_TEXT_BYTES,\n CODEX_REALTIME_V3_PENDING_MAX_BYTES,\n CODEX_REALTIME_V3_PENDING_MAX_ENTRIES,\n CODEX_REALTIME_V3_SYNC_MAX_ENTRIES,\n contextAppendChunks,\n createCodexRealtimeV3Bridge,\n encodeCodexRealtimeV3DelegationContextAppend,\n encodeCodexRealtimeV3SessionContextAppend,\n parseCodexRealtimeV3Event,\n} from \"./codex-realtime-v3\";\nexport type {\n CodexRealtimeV3Bridge,\n CodexRealtimeV3BridgeFatal,\n CodexRealtimeV3BridgeOptions,\n CodexRealtimeV3BridgeSnapshot,\n CodexRealtimeV3ContextAppendChannel,\n CodexRealtimeV3DelegationContextAppend,\n CodexRealtimeV3Event,\n CodexRealtimeV3ParseFailure,\n CodexRealtimeV3ParseResult,\n CodexRealtimeV3SessionContextAppend,\n} from \"./codex-realtime-v3\";\n\nexport {\n CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT,\n CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS,\n} from \"./codex-realtime-v3-wire\";\nexport type { CodexRealtimeInitialItem } from \"./codex-realtime-v3-wire\";\n\nexport type {\n ActivateCodexRealtimeConnectionRequest,\n BeginSessionRealtimeRequest,\n CodexRealtimeVoice,\n CodexRealtimeWebrtcRequest,\n CodexRealtimeWebrtcResponse,\n CodexRealtimeWebrtcVersion,\n EndSessionRealtimeRequest,\n GatewayRealtimeConnectRequest,\n GatewayRealtimeConnectResponse,\n GatewayRealtimeInitialItem,\n RenewSessionRealtimeRequest,\n SessionRealtimeEndReason,\n SessionRealtimeLedgerEntry,\n SessionRealtimeMode,\n SessionRealtimeModel,\n SessionRealtimeMutationResponse,\n SessionRealtimeState,\n SyncSessionRealtimeLedgerRequest,\n SyncSessionRealtimeLedgerResponse,\n WorkspaceRealtimeModelCatalogItem,\n WorkspaceRealtimeModelCatalogResponse,\n} from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDO,SAAS,6BACd,OAC8B;AAC9B,MAAI,UAAU,2BAA4B,QAAO;AACjD,MAAI,UAAU,sCAAuC,QAAO;AAC5D,SAAO;AACT;AAOO,SAAS,gCACd,SAC2B;AAC3B,QAAM,YAAY,6BAA6B,QAAQ,KAAK;AAC5D,SAAO,8BAA8B;AAAA,IACnC,GAAG;AAAA,IACH,uBAAuB,qCAAqC,QAAQ,KAAK;AAAA,IACzE,GAAI,cAAc,YACd,EAAE,gBAAgB,sCAAsC,EAAE,IAC1D,cAAc,qBACZ,EAAE,gBAAgB,8CAA8C,EAAE,IAClE,CAAC;AAAA,EACT,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/azure-live-transport.ts","../src/realtime.ts"],"sourcesContent":["import { startCodexRealtimeWebrtc, type StartCodexRealtimeWebrtcOptions } from \"./codex-realtime\";\nimport type { RealtimeControllerTransportStarter } from \"./codex-realtime-controller\";\n\ntype Envelope = Record<string, unknown>;\nconst MAX_FRAGMENT_BYTES = 64_000;\n\n/** The most recent speech wins when the user talks for a long time between delegations. */\nfunction takeUtf8Tail(text: string, maxBytes = MAX_FRAGMENT_BYTES): string {\n const encoder = new TextEncoder();\n if (encoder.encode(text).byteLength <= maxBytes) return text;\n let tail = text.slice(-maxBytes);\n while (encoder.encode(tail).byteLength > maxBytes) tail = tail.slice(1);\n return tail;\n}\n\n/** Azure Live has timed transcript fragments, not provider-finalized turns. */\nexport class AzureLiveDataChannel extends EventTarget {\n private pending: {\n role: \"user\" | \"assistant\";\n text: string;\n startMs: number;\n endMs: number;\n } | null = null;\n private timer: ReturnType<typeof setTimeout> | null = null;\n private ordinal = 0;\n private readonly prefix = crypto.randomUUID();\n private closed = false;\n private closeSent = false;\n private providerClosed = false;\n private readonly delegations = new Set<string>();\n // Azure delegations carry no content, so the user's words since the previous\n // delegation become the delegation input.\n private userSinceDelegation = \"\";\n private draining: Promise<void> | null = null;\n private finishDrain: ((error?: Error) => void) | null = null;\n private readonly onOpen = () => this.dispatchEvent(new Event(\"open\"));\n private readonly onClose = () => {\n this.providerClosed = true;\n this.flush();\n this.finishDrain?.();\n this.dispatchEvent(new Event(\"close\"));\n };\n private readonly onError = () => this.dispatchEvent(new Event(\"error\"));\n private readonly onMessage = (event: MessageEvent) => {\n if (typeof event.data !== \"string\" || event.data.length > 1_048_576) return;\n let value: unknown;\n try {\n value = JSON.parse(event.data);\n } catch {\n return;\n }\n if (!value || typeof value !== \"object\") return;\n this.receive(value as Envelope);\n };\n constructor(\n private readonly raw: RTCDataChannel,\n private readonly drainTimeoutMs = 5_000,\n ) {\n super();\n raw.addEventListener(\"open\", this.onOpen);\n raw.addEventListener(\"close\", this.onClose);\n raw.addEventListener(\"error\", this.onError);\n raw.addEventListener(\"message\", this.onMessage);\n }\n get readyState(): RTCDataChannelState {\n return this.closed || this.providerClosed\n ? \"closed\"\n : this.closeSent\n ? \"closing\"\n : this.raw.readyState;\n }\n asRtcDataChannel(): RTCDataChannel {\n return this as unknown as RTCDataChannel;\n }\n private emit(value: Envelope): void {\n if (!this.closed)\n this.dispatchEvent(new MessageEvent(\"message\", { data: JSON.stringify(value) }));\n }\n private flush(): void {\n if (this.timer) clearTimeout(this.timer);\n this.timer = null;\n const pending = this.pending;\n this.pending = null;\n if (!pending?.text) return;\n this.emit({\n type: \"transcript.segment\",\n turn: {\n id: `${this.prefix}:${++this.ordinal}`,\n role: pending.role,\n transcript: pending.text,\n },\n start_ms: pending.startMs,\n end_ms: pending.endMs,\n });\n }\n private receive(value: Envelope): void {\n if (this.closed) return;\n if (\n value.type === \"session.input_transcript.delta\" ||\n value.type === \"session.output_transcript.delta\"\n ) {\n if (\n typeof value.delta !== \"string\" ||\n typeof value.start_ms !== \"number\" ||\n typeof value.end_ms !== \"number\"\n )\n return;\n const role = value.type === \"session.input_transcript.delta\" ? \"user\" : \"assistant\";\n if (role === \"user\")\n this.userSinceDelegation = takeUtf8Tail(this.userSinceDelegation + value.delta);\n if (\n this.pending &&\n (this.pending.role !== role ||\n new TextEncoder().encode(this.pending.text + value.delta).byteLength > MAX_FRAGMENT_BYTES)\n )\n this.flush();\n if (new TextEncoder().encode(value.delta).byteLength > MAX_FRAGMENT_BYTES) {\n this.emit({\n type: \"error\",\n error: { message: \"Voice transcript fragment exceeded the supported size\" },\n });\n return;\n }\n this.pending = {\n role,\n text: (this.pending?.text ?? \"\") + value.delta,\n startMs: this.pending?.startMs ?? value.start_ms,\n endMs: value.end_ms,\n };\n // Application grouping only: never present silence as a provider turn boundary.\n if (!this.timer) this.timer = setTimeout(() => this.flush(), 1_000);\n return;\n }\n if (value.type === \"session.delegation.created\") {\n const delegation = value.delegation as Envelope | undefined;\n if (delegation?.target !== \"client\" || typeof delegation.id !== \"string\") return;\n this.delegations.add(delegation.id);\n this.flush();\n const spoken = this.userSinceDelegation.trim();\n this.userSinceDelegation = \"\";\n this.emit({\n type: \"delegation.created\",\n item: {\n id: delegation.id,\n type: \"delegation\",\n target: \"client\",\n content: spoken ? [{ type: \"input_text\", text: spoken }] : [],\n },\n offset_ms: value.offset_ms,\n });\n return;\n }\n if (value.type === \"session.closed\") {\n this.providerClosed = true;\n this.flush();\n this.finishDrain?.();\n return;\n }\n if (\n value.type === \"session.started\" ||\n value.type === \"session.updated\" ||\n value.type === \"error\"\n )\n this.emit(value);\n }\n send(payload: string): void {\n if (this.readyState !== \"open\") throw Error(\"Hosted voice channel is not open\");\n const value = JSON.parse(payload) as Envelope;\n if (value.type !== \"session.context.append\" && value.type !== \"delegation.context.append\")\n throw Error(\"Unsupported hosted voice context event\");\n const content = Array.isArray(value.content)\n ? value.content.map((part) => (typeof part?.text === \"string\" ? part.text : \"\")).join(\"\")\n : \"\";\n // Existing bridge chunks are <=500 UTF-8 bytes, below Live's 500-token bound.\n this.raw.send(\n JSON.stringify({\n type:\n value.channel === \"speakable\" ? \"session.commentary.append\" : \"session.thinking.append\",\n content,\n // Replayed tasks from an earlier provider session are general context.\n delegation_id:\n value.type === \"delegation.context.append\" &&\n typeof value.delegation_item_id === \"string\" &&\n this.delegations.has(value.delegation_item_id)\n ? value.delegation_item_id\n : null,\n }),\n );\n }\n drain(): Promise<void> {\n if (this.draining) return this.draining;\n if (this.providerClosed || this.raw.readyState === \"closed\") {\n this.flush();\n return Promise.resolve();\n }\n if (this.closed || this.raw.readyState !== \"open\") {\n return Promise.reject(new Error(\"Hosted voice close is not confirmed\"));\n }\n const pending = new Promise<void>((resolve, reject) => {\n const timeout = setTimeout(() => {\n this.flush();\n this.finishDrain?.(\n new Error(\"Hosted voice is still closing; retry to preserve final speech\"),\n );\n }, this.drainTimeoutMs);\n this.finishDrain = (error) => {\n clearTimeout(timeout);\n this.finishDrain = null;\n if (error) reject(error);\n else resolve();\n };\n if (!this.closeSent) {\n this.closeSent = true;\n try {\n this.raw.send(JSON.stringify({ type: \"session.close\" }));\n } catch {\n this.finishDrain(new Error(\"Hosted voice close could not be sent\"));\n }\n }\n });\n this.draining = pending;\n // An uncertain close remains retryable; never resend the provider mutation.\n void pending.then(\n () => {\n if (this.draining === pending) this.draining = null;\n },\n () => {\n if (this.draining === pending) this.draining = null;\n },\n );\n return pending;\n }\n close(): void {\n if (this.closed) return;\n if (this.timer) clearTimeout(this.timer);\n this.timer = null;\n this.pending = null;\n this.finishDrain?.(new Error(\"Hosted voice channel was disposed before close confirmation\"));\n this.closed = true;\n this.raw.removeEventListener(\"open\", this.onOpen);\n this.raw.removeEventListener(\"close\", this.onClose);\n this.raw.removeEventListener(\"error\", this.onError);\n this.raw.removeEventListener(\"message\", this.onMessage);\n this.dispatchEvent(new Event(\"close\"));\n }\n}\n\nexport function createAzureLiveTransportStarter(\n options: Pick<StartCodexRealtimeWebrtcOptions, \"remoteAudio\" | \"createPeerConnection\"> = {},\n): RealtimeControllerTransportStarter {\n return async (input) => {\n let channel: AzureLiveDataChannel | undefined;\n try {\n const transport = await startCodexRealtimeWebrtc({\n ...input,\n ...options,\n activateRemoteAudio: false,\n expectedModel: \"opengeni-azure/gpt-live-1\",\n onEventsCreated(raw) {\n channel = new AzureLiveDataChannel(raw);\n input.onEventsCreated(channel.asRtcDataChannel());\n },\n negotiate: (request, requestOptions) =>\n input.client.negotiateCodexRealtimeWebrtc(\n input.workspaceId,\n input.sessionId,\n request,\n requestOptions,\n ),\n });\n const events = channel!;\n return {\n ...transport,\n events: events.asRtcDataChannel(),\n drain: () => events.drain(),\n stop() {\n events.close();\n transport.stop();\n },\n };\n } catch (error) {\n channel?.close();\n throw error;\n }\n };\n}\n","import { createAzureLiveTransportStarter } from \"./azure-live-transport\";\n/**\n * Public, provider-neutral realtime browser SDK.\n *\n * Import this subpath lazily in browser applications. The base `@opengeni/sdk`\n * entry remains free of eager realtime transport initialization.\n */\nimport {\n createCodexRealtimeController,\n hasStoredSessionRealtimeOwnerProof,\n sessionRealtimeOwnerStorageKey,\n sessionRealtimeOwnerStorageNamespace,\n type CodexRealtimeController,\n type CodexRealtimeControllerClient,\n type CodexRealtimeControllerSnapshot,\n type CodexRealtimeControllerStatus,\n type CodexRealtimeDiagnostic,\n type CodexRealtimeDiagnosticKind,\n type CodexRealtimeMicrophoneState,\n type CodexRealtimeOwnerStorage,\n type CreateCodexRealtimeControllerOptions,\n type RealtimeControllerTransportStarter,\n} from \"./codex-realtime-controller\";\nimport {\n createGatewayRealtimeTransportStarter,\n createXaiSubscriptionRealtimeTransportStarter,\n} from \"./gateway-realtime-transport\";\nimport type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from \"./types\";\n\n/** Exact backend-facing methods required by the batteries-included realtime SDK. */\nexport type SessionRealtimeClientLike = CodexRealtimeControllerClient & {\n getWorkspaceRealtimeModelCatalog(\n workspaceId: string,\n options?: { signal?: AbortSignal | undefined },\n ): Promise<WorkspaceRealtimeModelCatalogResponse>;\n};\n\nexport type SessionRealtimeTransportKind = \"codex\" | \"gateway\" | \"xai-subscription\" | \"azure-live\";\n\n/** Provider-neutral names for the existing, battle-tested controller projection. */\nexport type SessionRealtimeController = CodexRealtimeController;\nexport type SessionRealtimeControllerSnapshot = CodexRealtimeControllerSnapshot;\nexport type SessionRealtimeControllerStatus = CodexRealtimeControllerStatus;\nexport type SessionRealtimeDiagnostic = CodexRealtimeDiagnostic;\nexport type SessionRealtimeDiagnosticKind = CodexRealtimeDiagnosticKind;\nexport type SessionRealtimeMicrophoneState = CodexRealtimeMicrophoneState;\nexport type SessionRealtimeOwnerStorage = CodexRealtimeOwnerStorage;\n\nexport type CreateSessionRealtimeControllerOptions = Omit<\n CreateCodexRealtimeControllerOptions,\n \"client\" | \"model\" | \"ownerStorageNamespace\" | \"startTransport\"\n> & {\n client: CodexRealtimeControllerClient;\n model: SessionRealtimeModel;\n};\n\n/** Select the existing transport without exposing provider mechanics to hosts. */\nexport function sessionRealtimeTransportKind(\n model: SessionRealtimeModel,\n): SessionRealtimeTransportKind {\n if (model === \"opengeni-azure/gpt-live-1\") return \"azure-live\";\n if (model === \"gpt-live-1-boulder-alpha\") return \"codex\";\n if (model === \"supergrok/grok-voice-think-fast-2.0\") return \"xai-subscription\";\n return \"gateway\";\n}\n\n/**\n * Compose the exact current controller with its existing Codex Live or AI\n * Gateway transport. Wire, ledger, delegation, recovery, and lifecycle\n * semantics remain owned by the existing implementations below this facade.\n */\nexport function createSessionRealtimeController(\n options: CreateSessionRealtimeControllerOptions,\n): SessionRealtimeController {\n const transport = sessionRealtimeTransportKind(options.model);\n return createCodexRealtimeController({\n ...options,\n ownerStorageNamespace: sessionRealtimeOwnerStorageNamespace(options.model),\n ...(transport === \"azure-live\"\n ? {\n startTransport: createAzureLiveTransportStarter({\n remoteAudio: options.remoteAudio,\n createPeerConnection: options.createPeerConnection,\n }),\n }\n : transport === \"gateway\"\n ? { startTransport: createGatewayRealtimeTransportStarter() }\n : transport === \"xai-subscription\"\n ? { startTransport: createXaiSubscriptionRealtimeTransportStarter() }\n : {}),\n });\n}\n\nexport {\n createCodexRealtimeController,\n createGatewayRealtimeTransportStarter,\n createXaiSubscriptionRealtimeTransportStarter,\n hasStoredSessionRealtimeOwnerProof,\n sessionRealtimeOwnerStorageKey,\n sessionRealtimeOwnerStorageNamespace,\n};\nexport type {\n CodexRealtimeController,\n CodexRealtimeControllerClient,\n CodexRealtimeControllerSnapshot,\n CodexRealtimeControllerStatus,\n CodexRealtimeDiagnostic,\n CodexRealtimeDiagnosticKind,\n CodexRealtimeMicrophoneState,\n CodexRealtimeOwnerStorage,\n CreateCodexRealtimeControllerOptions,\n RealtimeControllerTransportStarter,\n};\n\nexport {\n CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,\n projectSessionRealtimeLifecycle,\n} from \"./codex-realtime-controller\";\nexport type { SessionRealtimeLifecycleProjection } from \"./codex-realtime-lifecycle\";\n\nexport {\n CodexRealtimeMicrophoneError,\n acquireCodexRealtimeMicrophone,\n codexRealtimeMicrophoneHealthy,\n startCodexRealtimeWebrtc,\n} from \"./codex-realtime\";\nexport type {\n AcquireCodexRealtimeMicrophoneOptions,\n CodexRealtimeAudibleOutputState,\n CodexRealtimeConnectionHealth,\n CodexRealtimeMicrophoneErrorCode,\n CodexRealtimeNegotiator,\n CodexRealtimeWebrtcSession,\n StartCodexRealtimeWebrtcOptions,\n} from \"./codex-realtime\";\n\nexport {\n CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,\n CODEX_REALTIME_V3_MAX_EVENT_BYTES,\n CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES,\n CODEX_REALTIME_V3_MAX_TEXT_BYTES,\n CODEX_REALTIME_V3_PENDING_MAX_BYTES,\n CODEX_REALTIME_V3_PENDING_MAX_ENTRIES,\n CODEX_REALTIME_V3_SYNC_MAX_ENTRIES,\n contextAppendChunks,\n createCodexRealtimeV3Bridge,\n encodeCodexRealtimeV3DelegationContextAppend,\n encodeCodexRealtimeV3SessionContextAppend,\n parseCodexRealtimeV3Event,\n} from \"./codex-realtime-v3\";\nexport type {\n CodexRealtimeV3Bridge,\n CodexRealtimeV3BridgeFatal,\n CodexRealtimeV3BridgeOptions,\n CodexRealtimeV3BridgeSnapshot,\n CodexRealtimeV3ContextAppendChannel,\n CodexRealtimeV3DelegationContextAppend,\n CodexRealtimeV3Event,\n CodexRealtimeV3ParseFailure,\n CodexRealtimeV3ParseResult,\n CodexRealtimeV3SessionContextAppend,\n} from \"./codex-realtime-v3\";\n\nexport {\n CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT,\n CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS,\n} from \"./codex-realtime-v3-wire\";\nexport type { CodexRealtimeInitialItem } from \"./codex-realtime-v3-wire\";\n\nexport type {\n ActivateCodexRealtimeConnectionRequest,\n BeginSessionRealtimeRequest,\n CodexRealtimeVoice,\n CodexRealtimeWebrtcRequest,\n CodexRealtimeWebrtcResponse,\n CodexRealtimeWebrtcVersion,\n EndSessionRealtimeRequest,\n GatewayRealtimeConnectRequest,\n GatewayRealtimeConnectResponse,\n GatewayRealtimeInitialItem,\n RenewSessionRealtimeRequest,\n SessionRealtimeEndReason,\n SessionRealtimeLedgerEntry,\n SessionRealtimeMode,\n SessionRealtimeModel,\n SessionRealtimeMutationResponse,\n SessionRealtimeState,\n SyncSessionRealtimeLedgerRequest,\n SyncSessionRealtimeLedgerResponse,\n WorkspaceRealtimeModelCatalogItem,\n WorkspaceRealtimeModelCatalogResponse,\n} from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAM,qBAAqB;AAG3B,SAAS,aAAa,MAAc,WAAW,oBAA4B;AACzE,QAAM,UAAU,IAAI,YAAY;AAChC,MAAI,QAAQ,OAAO,IAAI,EAAE,cAAc,SAAU,QAAO;AACxD,MAAI,OAAO,KAAK,MAAM,CAAC,QAAQ;AAC/B,SAAO,QAAQ,OAAO,IAAI,EAAE,aAAa,SAAU,QAAO,KAAK,MAAM,CAAC;AACt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,SAAS,gCACd,SAC2B;AAC3B,QAAM,YAAY,6BAA6B,QAAQ,KAAK;AAC5D,SAAO,8BAA8B;AAAA,IACnC,GAAG;AAAA,IACH,uBAAuB,qCAAqC,QAAQ,KAAK;AAAA,IACzE,GAAI,cAAc,eACd;AAAA,MACE,gBAAgB,gCAAgC;AAAA,QAC9C,aAAa,QAAQ;AAAA,QACrB,sBAAsB,QAAQ;AAAA,MAChC,CAAC;AAAA,IACH,IACA,cAAc,YACZ,EAAE,gBAAgB,sCAAsC,EAAE,IAC1D,cAAc,qBACZ,EAAE,gBAAgB,8CAA8C,EAAE,IAClE,CAAC;AAAA,EACX,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { OpenGeniClient } from "./client.js";
|
|
2
|
+
import type { AppendArchivedSessionEventsRequest, AppendArchivedSessionEventsResponse, ImportArchivedSessionRequest, ImportArchivedSessionResponse } from "@opengeni/contracts";
|
|
3
|
+
export type { ArchivedSessionImportEvent, AppendArchivedSessionEventsRequest, AppendArchivedSessionEventsResponse, ImportArchivedSessionRequest, ImportArchivedSessionResponse, SessionImportedArchive, } from "@opengeni/contracts";
|
|
4
|
+
type SessionHistoryImportClient = Pick<OpenGeniClient, "requestJson">;
|
|
5
|
+
/**
|
|
6
|
+
* Server-only migration of a read-only archive, not model-facing conversation
|
|
7
|
+
* history. Use an asUser client to preserve the verified creator/owner. Persist
|
|
8
|
+
* importId and retry the exact request after an uncertain outcome.
|
|
9
|
+
* Requires sessions:create in the authenticated actor's permissions.
|
|
10
|
+
*/
|
|
11
|
+
export declare function importArchivedSession(client: SessionHistoryImportClient, workspaceId: string, request: ImportArchivedSessionRequest): Promise<ImportArchivedSessionResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* Append historical events at the acknowledged nextOffset. Retrying the exact
|
|
14
|
+
* batchId, offset and events replays its receipt; conflicting reuse returns 409.
|
|
15
|
+
* Each request accepts at most 100 events / 1 MiB, with 256 KiB per event.
|
|
16
|
+
* Requires sessions:control and the same authenticated importer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function appendArchivedSessionEvents(client: SessionHistoryImportClient, workspaceId: string, importId: string, request: AppendArchivedSessionEventsRequest): Promise<AppendArchivedSessionEventsResponse>;
|
|
19
|
+
/** Import through an existing external tenant mapping; this does not onboard it. */
|
|
20
|
+
export declare function importExternalWorkspaceArchivedSession(client: SessionHistoryImportClient, source: string, externalId: string, request: ImportArchivedSessionRequest): Promise<ImportArchivedSessionResponse>;
|
|
21
|
+
/** Append to an archive through the same external tenant mapping and actor. */
|
|
22
|
+
export declare function appendExternalWorkspaceArchivedSessionEvents(client: SessionHistoryImportClient, source: string, externalId: string, importId: string, request: AppendArchivedSessionEventsRequest): Promise<AppendArchivedSessionEventsResponse>;
|