@opengeni/sdk 3.1.0 → 3.3.2
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 +60 -8
- package/dist/accounts.d.ts +5 -1
- package/dist/accounts.js +13 -1
- package/dist/accounts.js.map +1 -1
- package/dist/artifacts.js +5 -5
- package/dist/browser.js +3 -3
- package/dist/{chunk-YTAWBDO2.js → chunk-JUS2UYRP.js} +2 -1
- package/dist/chunk-JUS2UYRP.js.map +1 -0
- package/dist/{chunk-GW3EJ2GP.js → chunk-KKRO2VCP.js} +27 -2
- package/dist/{chunk-GW3EJ2GP.js.map → chunk-KKRO2VCP.js.map} +1 -1
- package/dist/{chunk-VUQZAB3O.js → chunk-QT3KFVDP.js} +2 -2
- package/dist/{chunk-7ZXBPJZP.js → chunk-TRNI7KEO.js} +213 -42
- package/dist/chunk-TRNI7KEO.js.map +1 -0
- package/dist/{chunk-TX3EIENU.js → chunk-YXQX7RQT.js} +2 -2
- package/dist/client.d.ts +35 -11
- package/dist/company-profile.d.ts +13 -0
- package/dist/core.js +4 -4
- package/dist/document-authority.js +4 -4
- package/dist/editable-artifacts.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +215 -5
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +3 -0
- package/dist/interaction.js +3 -1
- package/dist/realtime.d.ts +3 -1
- package/dist/realtime.js.map +1 -1
- package/dist/session-titles.d.ts +28 -0
- package/dist/types.d.ts +58 -2
- package/package.json +2 -2
- package/src/accounts.ts +18 -0
- package/src/client.ts +291 -35
- package/src/company-profile.ts +13 -0
- package/src/index.ts +18 -0
- package/src/interaction.ts +32 -0
- package/src/realtime.ts +1 -0
- package/src/session-titles.ts +84 -0
- package/src/types.ts +64 -1
- package/dist/chunk-7ZXBPJZP.js.map +0 -1
- package/dist/chunk-YTAWBDO2.js.map +0 -1
- /package/dist/{chunk-VUQZAB3O.js.map → chunk-QT3KFVDP.js.map} +0 -0
- /package/dist/{chunk-TX3EIENU.js.map → chunk-YXQX7RQT.js.map} +0 -0
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 ): 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AUTOMATIC_SESSION_TITLE_FALLBACK } from "@opengeni/contracts/session-titles";
|
|
2
|
+
import type { Session } from "./types.js";
|
|
3
|
+
export { AUTOMATIC_SESSION_TITLE_FALLBACK };
|
|
4
|
+
export type SessionDisplayTitleInput = {
|
|
5
|
+
title?: Session["title"] | undefined;
|
|
6
|
+
titleSource?: Session["titleSource"] | undefined;
|
|
7
|
+
initialMessage?: Session["initialMessage"] | null | undefined;
|
|
8
|
+
metadata?: Readonly<Record<string, unknown>> | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type SessionDisplayTitleOptions = {
|
|
11
|
+
/** Optional metadata fields to try before the opening-prompt preview. */
|
|
12
|
+
metadataKeys?: readonly string[] | undefined;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Whether the durable title still represents the automatic-title pending state.
|
|
16
|
+
* A user-authored title always wins, even when its literal value is the fallback.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sessionTitleIsPending(input: SessionDisplayTitleInput): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Derive the title a client should display for a session.
|
|
21
|
+
*
|
|
22
|
+
* A semantic agent title or human rename wins. While automatic naming is still
|
|
23
|
+
* pending, clients show a short, sensitive-safe preview of the opening prompt;
|
|
24
|
+
* the preview is never persisted as title metadata and is replaced naturally
|
|
25
|
+
* when `session.title_set` arrives. Obvious credential-, URL-, or identifier-
|
|
26
|
+
* shaped prompt prefixes retain the generic fallback.
|
|
27
|
+
*/
|
|
28
|
+
export declare function deriveSessionDisplayTitle(input: SessionDisplayTitleInput, options?: SessionDisplayTitleOptions): string;
|
package/dist/types.d.ts
CHANGED
|
@@ -220,6 +220,7 @@ export type SessionCapabilities = {
|
|
|
220
220
|
codecs: ("h264-mp4" | "vp9-webm")[];
|
|
221
221
|
reason: CapabilityUnavailableReason | null;
|
|
222
222
|
};
|
|
223
|
+
/** @deprecated Use the managed ComputerSession interaction tools. */
|
|
223
224
|
ComputerUse: {
|
|
224
225
|
available: boolean;
|
|
225
226
|
readOnly: boolean;
|
|
@@ -232,6 +233,7 @@ export type TerminalCapability = SessionCapabilities["Terminal"];
|
|
|
232
233
|
export type GitCapability = SessionCapabilities["Git"];
|
|
233
234
|
export type DesktopStreamCapability = SessionCapabilities["DesktopStream"];
|
|
234
235
|
export type RecordingCapability = SessionCapabilities["Recording"];
|
|
236
|
+
/** @deprecated Use the managed ComputerSession interaction tools. */
|
|
235
237
|
export type ComputerUseCapability = SessionCapabilities["ComputerUse"];
|
|
236
238
|
export type StreamUrlRotatedPayload = {
|
|
237
239
|
url: string;
|
|
@@ -461,6 +463,7 @@ export type McpPersonalConnectionDelegation = {
|
|
|
461
463
|
export type McpPersonalConnectionSummary = Pick<McpPersonalConnectionDelegation, "serverId" | "providerDomain">;
|
|
462
464
|
export type ConnectionMetadata = {
|
|
463
465
|
id: string;
|
|
466
|
+
authorityId?: string | undefined;
|
|
464
467
|
accountId: string;
|
|
465
468
|
workspaceId: string;
|
|
466
469
|
subjectId: string | null;
|
|
@@ -1084,6 +1087,7 @@ export type Session = {
|
|
|
1084
1087
|
pausedDescendants: number;
|
|
1085
1088
|
failedDescendants: number;
|
|
1086
1089
|
unreadDescendants?: number | undefined;
|
|
1090
|
+
unreadFailedDescendants?: number | undefined;
|
|
1087
1091
|
activelyWorkingDescendants?: number | undefined;
|
|
1088
1092
|
/**
|
|
1089
1093
|
* Earliest moment one of the counted `attentionDescendants` entered
|
|
@@ -2107,6 +2111,10 @@ export type ScheduledTaskAgentConfig = {
|
|
|
2107
2111
|
model?: string | undefined;
|
|
2108
2112
|
reasoningEffort?: ReasoningEffort | undefined;
|
|
2109
2113
|
sandboxBackend?: SandboxBackend | undefined;
|
|
2114
|
+
machineTarget?: {
|
|
2115
|
+
targetSandboxId: string;
|
|
2116
|
+
workingDir?: string | undefined;
|
|
2117
|
+
} | undefined;
|
|
2110
2118
|
goal?: GoalSpec | undefined;
|
|
2111
2119
|
executionClass?: "incident_telemetry" | undefined;
|
|
2112
2120
|
incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
|
|
@@ -2225,7 +2233,7 @@ export type CreateSessionRequest = {
|
|
|
2225
2233
|
groupId: string;
|
|
2226
2234
|
} | undefined;
|
|
2227
2235
|
};
|
|
2228
|
-
export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:attach", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
|
|
2236
|
+
export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "capabilities:manage", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:attach", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
|
|
2229
2237
|
export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
|
|
2230
2238
|
/**
|
|
2231
2239
|
* Permissions the SDK knows about today, kept open so a newer OpenGeni server
|
|
@@ -2387,6 +2395,17 @@ export type CodexConnectionStatus = {
|
|
|
2387
2395
|
} | null;
|
|
2388
2396
|
/** How many Codex accounts the workspace has connected. */
|
|
2389
2397
|
accountCount?: number;
|
|
2398
|
+
source?: WorkspaceCodexSubscriptionSource;
|
|
2399
|
+
};
|
|
2400
|
+
export type WorkspaceCodexSubscriptionMode = "automatic" | "workspace" | "organization" | "disabled";
|
|
2401
|
+
export type WorkspaceCodexSubscriptionSource = {
|
|
2402
|
+
accountId: string;
|
|
2403
|
+
workspaceId: string;
|
|
2404
|
+
workspaceKind: "personal" | "shared";
|
|
2405
|
+
mode: WorkspaceCodexSubscriptionMode;
|
|
2406
|
+
effectiveSource: "workspace" | "organization" | "disabled";
|
|
2407
|
+
workspaceAvailable: boolean;
|
|
2408
|
+
organizationAvailable: boolean;
|
|
2390
2409
|
};
|
|
2391
2410
|
/**
|
|
2392
2411
|
* One normalized Codex usage window (5h or weekly), camelCase end-to-end (the
|
|
@@ -2436,6 +2455,7 @@ export type CodexUsagePayload = {
|
|
|
2436
2455
|
/** One connected Codex (ChatGPT) account in a workspace (multi-account P1). Metadata only. */
|
|
2437
2456
|
export type CodexAccount = {
|
|
2438
2457
|
id: string;
|
|
2458
|
+
source?: "workspace" | "organization";
|
|
2439
2459
|
chatgptAccountId?: string | null;
|
|
2440
2460
|
label?: string | null;
|
|
2441
2461
|
email?: string | null;
|
|
@@ -2537,6 +2557,7 @@ export type CodexRotationSettings = {
|
|
|
2537
2557
|
export type CodexAccountsResponse = {
|
|
2538
2558
|
accounts: CodexAccount[];
|
|
2539
2559
|
activeAccountId: string | null;
|
|
2560
|
+
source?: WorkspaceCodexSubscriptionSource;
|
|
2540
2561
|
/** Added by Apps-aware servers; absent on older same-major deployments. */
|
|
2541
2562
|
apps?: {
|
|
2542
2563
|
available: boolean;
|
|
@@ -2547,6 +2568,7 @@ export type CodexAccountsResponse = {
|
|
|
2547
2568
|
};
|
|
2548
2569
|
settings: CodexRotationSettings;
|
|
2549
2570
|
};
|
|
2571
|
+
export type OrganizationCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source">;
|
|
2550
2572
|
export type CodexAppsUpdate = {
|
|
2551
2573
|
credentialId: string | null;
|
|
2552
2574
|
version: number;
|
|
@@ -2680,6 +2702,8 @@ export type ClientAuthConfig = {
|
|
|
2680
2702
|
session: "cookie";
|
|
2681
2703
|
/** Defaults to true when omitted by an older deployment. */
|
|
2682
2704
|
emailVerificationRequired?: boolean;
|
|
2705
|
+
/** Configured managed sign-in providers; omitted by older deployments. */
|
|
2706
|
+
socialProviders?: ("google" | "github")[];
|
|
2683
2707
|
};
|
|
2684
2708
|
export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-organization-recovery-custody-v1";
|
|
2685
2709
|
export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
|
|
@@ -2701,6 +2725,7 @@ export type ClientConfig = {
|
|
|
2701
2725
|
models: ClientModel[];
|
|
2702
2726
|
defaultReasoningEffort: ReasoningEffort;
|
|
2703
2727
|
allowedReasoningEfforts: ReasoningEffort[];
|
|
2728
|
+
defaultSandboxBackend?: SandboxBackend | undefined;
|
|
2704
2729
|
mcpServers: {
|
|
2705
2730
|
id: string;
|
|
2706
2731
|
name: string;
|
|
@@ -3350,6 +3375,18 @@ export type CreateWorkspaceRequest = {
|
|
|
3350
3375
|
externalId?: string | undefined;
|
|
3351
3376
|
agentInstructions?: string | null | undefined;
|
|
3352
3377
|
};
|
|
3378
|
+
export type EnsureWorkspaceRequest = {
|
|
3379
|
+
accountId: string;
|
|
3380
|
+
externalSource: string;
|
|
3381
|
+
externalId: string;
|
|
3382
|
+
name: string;
|
|
3383
|
+
slug?: string | undefined;
|
|
3384
|
+
agentInstructions?: string | null | undefined;
|
|
3385
|
+
};
|
|
3386
|
+
export type EnsureWorkspaceResponse = {
|
|
3387
|
+
workspace: Workspace;
|
|
3388
|
+
created: boolean;
|
|
3389
|
+
};
|
|
3353
3390
|
export type UpdateWorkspaceRequest = {
|
|
3354
3391
|
name?: string | undefined;
|
|
3355
3392
|
slug?: string | null | undefined;
|
|
@@ -3380,6 +3417,11 @@ export type CreateApiKeyResponse = {
|
|
|
3380
3417
|
/** The full secret token — shown once at creation, never returned again. */
|
|
3381
3418
|
token: string;
|
|
3382
3419
|
};
|
|
3420
|
+
export type CreateOrganizationApiKeyRequest = {
|
|
3421
|
+
name: string;
|
|
3422
|
+
description?: string | undefined;
|
|
3423
|
+
expiresAt?: string | undefined;
|
|
3424
|
+
};
|
|
3383
3425
|
export type ListApiKeysResponse = {
|
|
3384
3426
|
apiKeys: ApiKey[];
|
|
3385
3427
|
};
|
|
@@ -3393,8 +3435,18 @@ export type WorkspaceMember = {
|
|
|
3393
3435
|
export type ListWorkspaceMembersResponse = {
|
|
3394
3436
|
members: WorkspaceMember[];
|
|
3395
3437
|
};
|
|
3438
|
+
export type WorkspaceMemberCandidate = {
|
|
3439
|
+
organizationMembershipId: string;
|
|
3440
|
+
subjectId: string;
|
|
3441
|
+
name: string | null;
|
|
3442
|
+
email: string | null;
|
|
3443
|
+
organizationRole: "owner" | "admin" | "member";
|
|
3444
|
+
};
|
|
3445
|
+
export type ListWorkspaceMemberCandidatesResponse = {
|
|
3446
|
+
members: WorkspaceMemberCandidate[];
|
|
3447
|
+
};
|
|
3396
3448
|
export type AddWorkspaceMemberRequest = {
|
|
3397
|
-
|
|
3449
|
+
organizationMembershipId: string;
|
|
3398
3450
|
role?: string | undefined;
|
|
3399
3451
|
permissions: Permission[];
|
|
3400
3452
|
};
|
|
@@ -3790,6 +3842,10 @@ export type ScheduledTaskAgentConfigInput = {
|
|
|
3790
3842
|
model?: string | undefined;
|
|
3791
3843
|
reasoningEffort?: ReasoningEffort | undefined;
|
|
3792
3844
|
sandboxBackend?: SandboxBackend | undefined;
|
|
3845
|
+
machineTarget?: {
|
|
3846
|
+
targetSandboxId: string;
|
|
3847
|
+
workingDir?: string | undefined;
|
|
3848
|
+
} | undefined;
|
|
3793
3849
|
goal?: GoalSpec | undefined;
|
|
3794
3850
|
executionClass?: "incident_telemetry" | undefined;
|
|
3795
3851
|
incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Framework-agnostic TypeScript SDK for the OpenGeni API: typed client, session lifecycle, SSE event streaming with reconnect + replay-by-sequence, and proxy re-streaming helpers.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"prepublishOnly": "bash ../../scripts/prepublish-guard"
|
|
102
102
|
},
|
|
103
103
|
"dependencies": {
|
|
104
|
-
"@opengeni/contracts": "^2.
|
|
104
|
+
"@opengeni/contracts": "^2.9.2"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
107
|
"node": ">=18"
|
package/src/accounts.ts
CHANGED
|
@@ -15,6 +15,8 @@ import {
|
|
|
15
15
|
ManagedAuthSessionSetErrorCode,
|
|
16
16
|
ResolveManagedAuthDeepLinkRequest,
|
|
17
17
|
SelectManagedAuthLoginSlotRequest,
|
|
18
|
+
StartManagedAuthSocialTransactionRequest,
|
|
19
|
+
StartManagedAuthSocialTransactionResponse,
|
|
18
20
|
type BeginManagedAuthLoginTransactionRequest as BeginManagedAuthLoginTransactionRequestType,
|
|
19
21
|
type BootstrapManagedAuthSessionSetRequest as BootstrapManagedAuthSessionSetRequestType,
|
|
20
22
|
type CancelManagedAuthLoginTransactionRequest as CancelManagedAuthLoginTransactionRequestType,
|
|
@@ -28,6 +30,8 @@ import {
|
|
|
28
30
|
type ManagedAuthSessionSetProjection as ManagedAuthSessionSetProjectionType,
|
|
29
31
|
type ResolveManagedAuthDeepLinkRequest as ResolveManagedAuthDeepLinkRequestType,
|
|
30
32
|
type SelectManagedAuthLoginSlotRequest as SelectManagedAuthLoginSlotRequestType,
|
|
33
|
+
type StartManagedAuthSocialTransactionRequest as StartManagedAuthSocialTransactionRequestType,
|
|
34
|
+
type StartManagedAuthSocialTransactionResponse as StartManagedAuthSocialTransactionResponseType,
|
|
31
35
|
} from "@opengeni/contracts/managed-auth-session-sets";
|
|
32
36
|
import type { z } from "zod";
|
|
33
37
|
|
|
@@ -53,6 +57,9 @@ export interface BrowserAccountsClientLike {
|
|
|
53
57
|
completeEmailPasswordTransaction(
|
|
54
58
|
request: CompleteManagedAuthEmailPasswordTransactionRequestType,
|
|
55
59
|
): Promise<CompleteManagedAuthLoginTransactionResponseType>;
|
|
60
|
+
startSocialTransaction?(
|
|
61
|
+
request: StartManagedAuthSocialTransactionRequestType,
|
|
62
|
+
): Promise<StartManagedAuthSocialTransactionResponseType>;
|
|
56
63
|
cancelLoginTransaction(
|
|
57
64
|
request: CancelManagedAuthLoginTransactionRequestType,
|
|
58
65
|
): Promise<ManagedAuthSessionSetProjectionType>;
|
|
@@ -178,6 +185,17 @@ export class BrowserAccountsClient implements BrowserAccountsClientLike {
|
|
|
178
185
|
return response;
|
|
179
186
|
}
|
|
180
187
|
|
|
188
|
+
async startSocialTransaction(request: StartManagedAuthSocialTransactionRequestType) {
|
|
189
|
+
return StartManagedAuthSocialTransactionResponse.parse(
|
|
190
|
+
await this.#mutation(
|
|
191
|
+
"POST",
|
|
192
|
+
"/v1/auth/session-set/transactions/social",
|
|
193
|
+
StartManagedAuthSocialTransactionRequest,
|
|
194
|
+
request,
|
|
195
|
+
),
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
181
199
|
async cancelLoginTransaction(request: CancelManagedAuthLoginTransactionRequestType) {
|
|
182
200
|
return this.#projectionResponse(
|
|
183
201
|
"DELETE",
|