@opengeni/sdk 0.42.1 → 0.44.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/dist/{chunk-M7TPZ3ED.js → chunk-74LY67W7.js} +12 -2
- package/dist/chunk-74LY67W7.js.map +1 -0
- package/dist/{chunk-XBBPYTI5.js → chunk-SLJ33Y7V.js} +2 -2
- package/dist/{chunk-OINSI33U.js → chunk-UD2DNDSS.js} +22 -3
- package/dist/chunk-UD2DNDSS.js.map +1 -0
- package/dist/client.d.ts +3 -1
- package/dist/codex-realtime-controller.js +2 -2
- package/dist/core.js +2 -2
- package/dist/errors.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/realtime.js +2 -2
- package/dist/types.d.ts +4 -0
- package/dist/workspace-state.d.ts +26 -0
- package/package.json +1 -1
- package/src/client.ts +19 -1
- package/src/errors.ts +22 -1
- package/src/index.ts +3 -0
- package/src/types.ts +4 -0
- package/src/workspace-state.ts +32 -0
- package/dist/chunk-M7TPZ3ED.js.map +0 -1
- package/dist/chunk-OINSI33U.js.map +0 -1
- /package/dist/{chunk-XBBPYTI5.js.map → chunk-SLJ33Y7V.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
OpenGeniApiError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UD2DNDSS.js";
|
|
4
4
|
|
|
5
5
|
// src/codex-realtime-v3-wire.ts
|
|
6
6
|
var CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT = 128;
|
|
@@ -2015,4 +2015,4 @@ export {
|
|
|
2015
2015
|
hasStoredSessionRealtimeOwnerProof,
|
|
2016
2016
|
createCodexRealtimeController
|
|
2017
2017
|
};
|
|
2018
|
-
//# sourceMappingURL=chunk-
|
|
2018
|
+
//# sourceMappingURL=chunk-SLJ33Y7V.js.map
|
|
@@ -7,6 +7,7 @@ var OpenGeniApiError = class extends Error {
|
|
|
7
7
|
/** True only when an uncontrolled transport failed after a mutation may have been accepted. */
|
|
8
8
|
outcomeUnknown;
|
|
9
9
|
body;
|
|
10
|
+
details;
|
|
10
11
|
constructor(status, body, options = {}) {
|
|
11
12
|
const decoded = decodeApiErrorBody(body);
|
|
12
13
|
const correlationId = decoded?.requestId ?? boundedCorrelationId(options.correlationId);
|
|
@@ -22,6 +23,7 @@ var OpenGeniApiError = class extends Error {
|
|
|
22
23
|
this.correlationId = correlationId;
|
|
23
24
|
this.outcomeUnknown = options.outcomeUnknown ?? (gatewayFailure && !!options.mutation && !decoded);
|
|
24
25
|
this.body = !fromResponse || decoded ? body : "";
|
|
26
|
+
this.details = decoded?.details;
|
|
25
27
|
}
|
|
26
28
|
};
|
|
27
29
|
function decodeApiErrorBody(body) {
|
|
@@ -35,17 +37,34 @@ function decodeApiErrorBody(body) {
|
|
|
35
37
|
const message = boundedApiField(nested.message);
|
|
36
38
|
const requestId = boundedCorrelationId(nested.requestId);
|
|
37
39
|
const retryable = typeof nested.retryable === "boolean" ? nested.retryable : void 0;
|
|
38
|
-
|
|
40
|
+
const details = boundedApiDetails(nested.details);
|
|
41
|
+
if (!code && !message && !requestId && retryable === void 0 && !details) return null;
|
|
39
42
|
return {
|
|
40
43
|
code,
|
|
41
44
|
message,
|
|
42
45
|
requestId,
|
|
43
|
-
retryable
|
|
46
|
+
retryable,
|
|
47
|
+
details
|
|
44
48
|
};
|
|
45
49
|
} catch {
|
|
46
50
|
return null;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
53
|
+
function boundedApiDetails(value) {
|
|
54
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
55
|
+
const entries = Object.entries(value).slice(0, 16);
|
|
56
|
+
const details = {};
|
|
57
|
+
for (const [key, entry] of entries) {
|
|
58
|
+
if (!/^[a-zA-Z][\w.-]{0,63}$/.test(key)) continue;
|
|
59
|
+
if (typeof entry === "string") {
|
|
60
|
+
const bounded = boundedApiField(entry);
|
|
61
|
+
if (bounded !== void 0) details[key] = bounded;
|
|
62
|
+
} else if (typeof entry === "number" || typeof entry === "boolean" || entry === null) {
|
|
63
|
+
details[key] = entry;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return Object.keys(details).length > 0 ? details : void 0;
|
|
67
|
+
}
|
|
49
68
|
function boundedApiField(value) {
|
|
50
69
|
if (typeof value !== "string") return;
|
|
51
70
|
const bytes = new TextEncoder().encode(value);
|
|
@@ -94,4 +113,4 @@ export {
|
|
|
94
113
|
isAbortError,
|
|
95
114
|
isRetryableStreamError
|
|
96
115
|
};
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-UD2DNDSS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["/** Error for a non-2xx OpenGeni API response. */\nexport class OpenGeniApiError extends Error {\n readonly status: number;\n readonly code: string | undefined;\n readonly retryable: boolean;\n readonly correlationId: string | undefined;\n /** True only when an uncontrolled transport failed after a mutation may have been accepted. */\n readonly outcomeUnknown: boolean;\n readonly body: string;\n readonly details: Record<string, unknown> | undefined;\n\n constructor(\n status: number,\n body: string,\n options: {\n code?: string | undefined;\n retryable?: boolean | undefined;\n correlationId?: string | undefined;\n outcomeUnknown?: boolean | undefined;\n displayMessage?: string | undefined;\n mutation?: boolean | undefined;\n } = {},\n ) {\n const decoded = decodeApiErrorBody(body);\n const correlationId = decoded?.requestId ?? boundedCorrelationId(options.correlationId);\n const gatewayFailure = status >= 502 && status <= 504;\n const fromResponse = options.mutation !== undefined;\n const message = decoded?.message ?? (fromResponse ? \"Request failed.\" : body || \"(empty body)\");\n const displayMessage =\n options.displayMessage ??\n (gatewayFailure && fromResponse\n ? \"OpenGeni is temporarily unavailable — retry.\"\n : `OpenGeni API ${status}: ${message}`);\n super(correlationId ? `${displayMessage} Reference: ${correlationId}.` : displayMessage);\n this.name = \"OpenGeniApiError\";\n this.status = status;\n this.code =\n options.code ??\n decoded?.code ??\n (gatewayFailure && fromResponse ? \"upstream_unavailable\" : undefined);\n this.retryable = options.retryable ?? decoded?.retryable ?? retryableApiStatus(status);\n this.correlationId = correlationId;\n this.outcomeUnknown =\n options.outcomeUnknown ?? (gatewayFailure && !!options.mutation && !decoded);\n this.body = !fromResponse || decoded ? body : \"\";\n this.details = decoded?.details;\n }\n}\n\nfunction decodeApiErrorBody(body: string): {\n code: string | undefined;\n message: string | undefined;\n requestId: string | undefined;\n retryable: boolean | undefined;\n details: Record<string, unknown> | undefined;\n} | null {\n if (!body) return null;\n try {\n const decoded: unknown = JSON.parse(body);\n if (!decoded || typeof decoded !== \"object\" || Array.isArray(decoded)) return null;\n const record = decoded as Record<string, unknown>;\n const nested =\n record.error && typeof record.error === \"object\" && !Array.isArray(record.error)\n ? (record.error as Record<string, unknown>)\n : record;\n const code = boundedApiField(nested.code);\n const message = boundedApiField(nested.message);\n const requestId = boundedCorrelationId(nested.requestId);\n const retryable = typeof nested.retryable === \"boolean\" ? nested.retryable : undefined;\n const details = boundedApiDetails(nested.details);\n if (!code && !message && !requestId && retryable === undefined && !details) return null;\n return {\n code,\n message,\n requestId,\n retryable,\n details,\n };\n } catch {\n return null;\n }\n}\n\nfunction boundedApiDetails(value: unknown): Record<string, unknown> | undefined {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return;\n const entries = Object.entries(value as Record<string, unknown>).slice(0, 16);\n const details: Record<string, unknown> = {};\n for (const [key, entry] of entries) {\n if (!/^[a-zA-Z][\\w.-]{0,63}$/.test(key)) continue;\n if (typeof entry === \"string\") {\n const bounded = boundedApiField(entry);\n if (bounded !== undefined) details[key] = bounded;\n } else if (typeof entry === \"number\" || typeof entry === \"boolean\" || entry === null) {\n details[key] = entry;\n }\n }\n return Object.keys(details).length > 0 ? details : undefined;\n}\n\nfunction boundedApiField(value: unknown): string | undefined {\n if (typeof value !== \"string\") return;\n const bytes = new TextEncoder().encode(value);\n return bytes.byteLength <= 512 ? value : new TextDecoder().decode(bytes.slice(0, 512));\n}\n\nfunction retryableApiStatus(status: number): boolean {\n return status === 408 || status === 409 || status === 425 || status === 429 || status >= 500;\n}\n\nfunction boundedCorrelationId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length > 128 || !/^[\\w.:-]+$/.test(value)) {\n return;\n }\n return value;\n}\n\n/** A short-lived session-list snapshot cursor can no longer be continued. */\nexport class OpenGeniSessionListCursorError extends OpenGeniApiError {}\n\n/** The browser bundle and API disagree about their state-changing wire contract. */\nexport class OpenGeniApiContractMismatchError extends Error {\n readonly expected: string;\n readonly actual: string;\n\n constructor(expected: string, actual: string) {\n super(`OpenGeni API contract mismatch: client expects ${expected}, API serves ${actual}`);\n this.name = \"OpenGeniApiContractMismatchError\";\n this.expected = expected;\n this.actual = actual;\n }\n}\n\n/** Error for an unrecoverable event-stream condition (not a transient drop). */\nexport class OpenGeniStreamError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"OpenGeniStreamError\";\n }\n}\n\nexport function isAbortError(error: unknown): boolean {\n return (\n (error instanceof DOMException && error.name === \"AbortError\") ||\n (error instanceof Error && error.name === \"AbortError\")\n );\n}\n\n/**\n * Transient conditions worth a reconnect: network-level failures (`fetch`\n * rejects with `TypeError`) and HTTP statuses that signal a temporary server\n * or contention condition. Auth/validation failures (401/403/404/...) are\n * permanent and surface to the caller instead.\n */\nexport function isRetryableStreamError(error: unknown): boolean {\n if (error instanceof OpenGeniApiError) return error.retryable;\n return error instanceof TypeError;\n}\n"],"mappings":"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","names":[]}
|
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type SessionEventStreamTransport, type StreamSessionEventsOptions } fro
|
|
|
2
2
|
import { type WorkspaceControlStreamTransport } from "./workspace-control-stream";
|
|
3
3
|
import type { AccessContext, ActivateCodexRealtimeConnectionRequest, AddWorkspaceMemberRequest, ApiKey, BillingEntitlementsResponse, CodexAccount, CodexAccountsResponse, CodexRotationSettings, CodexOverviewResponse, CodexAllocatorUpdate, CodexConnectionStatus, CodexRealtimeWebrtcRequest, CodexRealtimeWebrtcResponse, GatewayRealtimeConnectRequest, GatewayRealtimeConnectResponse, CodexConnectPoll, CodexConnectStart, CodexUsage, CodexUsageMap, BillingSummary, BillingUsageResponse, InsightsRange, WorkspaceInsightsResponse, BeginSessionRealtimeRequest, CapabilityCatalogItem, CapabilityCatalogResponse, CapabilityInstallation, AddDocumentRequest, CreateKnowledgeDropRequest, MoveDocumentRequest, ClientConfig, WorkspaceModelCatalogResponse, WorkspaceRealtimeModelCatalogResponse, ClientSessionEventInput, CompactSessionContextResult, ConnectionMetadata, CreateApiKeyRequest, CreateApiKeyResponse, CreateCapabilityCatalogItemRequest, CreateCheckoutRequest, CreateCheckoutResponse, OpenGeniSlackBotInstallRequest, OpenGeniSlackBotInstallStart, SlackReactionChannelListResponse, CreateConnectionRequest, CreateDocumentBaseRequest, CreateFileUploadRequest, CreateFileUploadResponse, CreateGitHubAppManifestRequest, CreateGitHubAppManifestResponse, CreateKnowledgeMemoryRequest, CreateScheduledTaskRequest, CreateSessionRequest, CreateSessionResponse, CreateVariableSetRequest, CreateRigRequest, CreateWorkspaceRequest, DeviceEnrollmentApproveResponse, DeviceEnrollmentDenyResponse, DeviceEnrollmentLookupResponse, MintEnrollTokenResponse, EndSessionRealtimeRequest, DiscoverMcpCapabilitiesResponse, Document, DocumentBase, DocumentSearchRequest, DocumentSearchResponse, EnableCapabilityRequest, EnablePackRequest, FileAsset, FileDownloadUrlResponse, GetPackResponse, GitHubAppInfo, GitHubRepositoriesResponse, GoogleDriveDisconnectRequest, GoogleDriveLifecycleActionRequest, KnowledgeMemory, KnowledgeMemorySearchRequest, ListPacksResponse, MachinesResponse, MetricSample, SwapActiveSandboxRequest, SwapActiveSandboxResponse, PackInstallation, LatencyMode, ReasoningEffort, RetainedArtifactContent, RetainedArtifactContentOptions, RetainedArtifactMetadata, RegisterCapabilityPackRequest, ResourceRef, ScheduledTask, ScheduledTaskRun, Session, SessionListResponse, UpdateSessionPinRequest, SessionEvent, SessionEventCompactResult, SessionEventCompactResultOptions, SessionEventListOptions, SessionEventPage, SessionGoal, SessionHumanInputRequest, SessionLineageResponse, SessionRealtimeMutationResponse, SyncSessionRealtimeLedgerRequest, SyncSessionRealtimeLedgerResponse, RenewSessionRealtimeRequest, SessionMcpCredentialUpdateInput, UpdateSessionMcpApprovalPolicyRequest, UpdateSessionMcpApprovalPolicyResponse, SessionQueueSnapshot, SessionQueueMutationResponse, ComposerDraft, DeleteSessionQueueItemRequest, EditSessionQueueItemRequest, MoveSessionQueueItemRequest, NewSessionDraft, SaveComposerDraftRequest, SaveNewSessionDraftRequest, SteerSessionQueueItemRequest, SessionControlResponse, WorkspaceInferenceControlResponse, WorkspaceControlEvent, SessionTurn, SubmitHumanInputResponseRequest, SessionCapabilities, AttachViewerRequest, AttachViewerResponse, AcknowledgeStreamRequest, AcknowledgeStreamResponse, ViewerHeartbeatRequest, ViewerHeartbeatResponse, FsListRequest, FsListResponse, FsReadRequest, FsReadResponse, FsWriteRequest, FsWriteResponse, FsDeleteRequest, FsDeleteResponse, FsMoveRequest, FsMoveResponse, FsMkdirRequest, FsMkdirResponse, GitStatusRequest, GitStatusResponse, GitDiffRequest, GitDiffResponse, GitLogRequest, GitLogResponse, GitShowRequest, GitShowResponse, GetWorkspaceCaptureResponse, GetWorkspaceCaptureFileResponse, TerminalExecRequest, TerminalExecResponse, PtyOpenRequest, PtyOpenResponse, PtyWriteRequest, PtyResizeRequest, PtyCloseRequest, ToolRef, TranscribeAudioResponse, UpdateConnectionRequest, UpdateKnowledgeMemoryRequest, UpdateScheduledTaskRequest, UpdateSessionGoalRequest, UpdateSessionRequest, UpdateSessionToolPolicyRequest, UpdateVariableSetRequest, UpdateRigRequest, UpdateWorkspaceMemberRequest, UpdateWorkspaceRequest, UpdateWorkspaceSettingsRequest, SetWorkspaceDefaultRigRequest, UploadFileInput, VariableSet, VariableSetVariableMetadata, Rig, RigVersion, RigChange, ProposeRigChangeRequest, WorkspaceMember, WorkspaceMemorySearchRequest, WorkspaceMemorySearchResponse, WorkspaceRegisteredPack, Workspace, OAuthStartRequest, OAuthStartResponse, SocialConnection, SocialOAuthStartRequest } from "./types";
|
|
4
4
|
import type { ActivateWorkspaceInstructionPolicyRequest, CreateWorkspaceInstructionPolicyDraftRequest, CreateWorkspaceInstructionPolicyOnboardingProposalRequest, ImportLegacyWorkspaceInstructionPolicyDraftRequest, RollbackWorkspaceInstructionPolicyRequest, WorkspaceInstructionPolicyActivationResponse, WorkspaceInstructionPolicyDiffRequest, WorkspaceInstructionPolicyDiffResponse, WorkspaceInstructionPolicyListOptions, WorkspaceInstructionPolicyListResponse, WorkspaceInstructionPolicyOnboardingProposal, WorkspaceInstructionPolicyOnboardingProposalListOptions, WorkspaceInstructionPolicyOnboardingProposalListResponse, WorkspaceInstructionPolicyRevision } from "./workspace-instruction-policies";
|
|
5
|
-
import type { WorkspaceStateGetOptions, WorkspaceStateResponse } from "./workspace-state";
|
|
5
|
+
import type { WorkspaceStateExportResponse, WorkspaceStateGetOptions, WorkspaceStateResponse } from "./workspace-state";
|
|
6
6
|
import type { ActivatePreferenceRegistryRevisionRequest, ChangePreferenceRegistryScopeRequest, CorrectPreferenceRegistryRequest, CreatePreferenceRegistryProposalRequest, DeactivatePreferenceRegistryRequest, PreferenceRegistryDetailResponse, PreferenceRegistryFullContent, PreferenceRegistryListOptions, PreferenceRegistryListResponse, PreferenceRegistryMutationResponse, PreferenceRegistryRecord, PreferenceRegistrySnapshot, RejectPreferenceRegistryProposalRequest, SupersedePreferenceRegistryRequest } from "./preference-registry";
|
|
7
7
|
export type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
8
8
|
export type WorkspaceControlEventPage = {
|
|
@@ -391,6 +391,8 @@ export declare class OpenGeniClient {
|
|
|
391
391
|
getWorkspace(workspaceId: string): Promise<Workspace>;
|
|
392
392
|
/** Read-time, secret-safe inventory of policy heads and visible workspace knowledge. */
|
|
393
393
|
getWorkspaceState(workspaceId: string, options?: WorkspaceStateGetOptions): Promise<WorkspaceStateResponse>;
|
|
394
|
+
/** Download the canonical, explicitly sanitized Workspace State export. */
|
|
395
|
+
exportWorkspaceState(workspaceId: string, options?: WorkspaceStateGetOptions): Promise<WorkspaceStateExportResponse>;
|
|
394
396
|
updateWorkspace(workspaceId: string, request: UpdateWorkspaceRequest): Promise<Workspace>;
|
|
395
397
|
/** Inspect immutable instruction-policy history, active heads, and activation audit evidence. */
|
|
396
398
|
listWorkspaceInstructionPolicies(workspaceId: string, options?: WorkspaceInstructionPolicyListOptions): Promise<WorkspaceInstructionPolicyListResponse>;
|
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
projectSessionRealtimeLifecycle,
|
|
6
6
|
sessionRealtimeOwnerStorageKey,
|
|
7
7
|
sessionRealtimeOwnerStorageNamespace
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SLJ33Y7V.js";
|
|
9
|
+
import "./chunk-UD2DNDSS.js";
|
|
10
10
|
export {
|
|
11
11
|
CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,
|
|
12
12
|
createCodexRealtimeController,
|
package/dist/core.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
OPENGENI_API_CONTRACT_REVISION,
|
|
4
4
|
OpenGeniClient,
|
|
5
5
|
resolveWorkspaceVoiceInputEnabled
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-74LY67W7.js";
|
|
7
7
|
import {
|
|
8
8
|
OpenGeniApiContractMismatchError,
|
|
9
9
|
OpenGeniApiError,
|
|
10
10
|
OpenGeniSessionListCursorError,
|
|
11
11
|
OpenGeniStreamError,
|
|
12
12
|
isRetryableStreamError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UD2DNDSS.js";
|
|
14
14
|
export {
|
|
15
15
|
OPENGENI_API_CONTRACT_HEADER,
|
|
16
16
|
OPENGENI_API_CONTRACT_REVISION,
|
package/dist/errors.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare class OpenGeniApiError extends Error {
|
|
|
7
7
|
/** True only when an uncontrolled transport failed after a mutation may have been accepted. */
|
|
8
8
|
readonly outcomeUnknown: boolean;
|
|
9
9
|
readonly body: string;
|
|
10
|
+
readonly details: Record<string, unknown> | undefined;
|
|
10
11
|
constructor(status: number, body: string, options?: {
|
|
11
12
|
code?: string | undefined;
|
|
12
13
|
retryable?: boolean | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export type { WorkspaceControlStreamTransport } from "./workspace-control-stream
|
|
|
26
26
|
export type { CreateWorkspaceArtifactRequest, PublishWorkspaceArtifactVersionRequest, RollbackWorkspaceArtifactRequest, WorkspaceArtifact, WorkspaceArtifactContentResponse, WorkspaceArtifactDetailResponse, WorkspaceArtifactEvent, WorkspaceArtifactListOptions, WorkspaceArtifactListResponse, WorkspaceArtifactMutationResponse, WorkspaceArtifactVersion, } from "./workspace-artifacts";
|
|
27
27
|
export { normalizeWorkspaceInstructionPolicyRoleKey, WORKSPACE_INSTRUCTION_POLICY_CONTENT_MAX_CHARS, } from "./workspace-instruction-policies";
|
|
28
28
|
export type { ActivateWorkspaceInstructionPolicyRequest, CreateWorkspaceInstructionPolicyDraftRequest, CreateWorkspaceInstructionPolicyOnboardingProposalRequest, ImportLegacyWorkspaceInstructionPolicyDraftRequest, RollbackWorkspaceInstructionPolicyRequest, WorkspaceInstructionPolicyActivationEvent, WorkspaceInstructionPolicyActivationResponse, WorkspaceInstructionPolicyActivationType, WorkspaceInstructionPolicyConflictResponse, WorkspaceInstructionPolicyDiffRequest, WorkspaceInstructionPolicyDiffResponse, WorkspaceInstructionPolicyDraftProvenanceSource, WorkspaceInstructionPolicyHead, WorkspaceInstructionPolicyKind, WorkspaceInstructionPolicyListOptions, WorkspaceInstructionPolicyListResponse, WorkspaceInstructionPolicyOnboardingProposal, WorkspaceInstructionPolicyOnboardingProposalConflictResponse, WorkspaceInstructionPolicyOnboardingProposalContentErrorResponse, WorkspaceInstructionPolicyOnboardingProposalListOptions, WorkspaceInstructionPolicyOnboardingProposalListResponse, WorkspaceInstructionPolicyOnboardingProposalSource, WorkspaceInstructionPolicyOnboardingProposalStaleResponse, WorkspaceInstructionPolicyOperationReuseResponse, WorkspaceInstructionPolicyProvenanceSource, WorkspaceInstructionPolicyRevision, WorkspaceInstructionPolicyRevisionIdentity, WorkspaceInstructionPolicyScope, WorkspaceInstructionPolicyTarget, } from "./workspace-instruction-policies";
|
|
29
|
-
export type { WorkspaceStateDocumentStatusCounts, WorkspaceStateAttemptGovernance, WorkspaceStateGapCode, WorkspaceStateGetOptions, WorkspaceStateGovernanceDriftStatus, WorkspaceStateMemoryKindCounts, WorkspaceStateMemoryStatusCounts, WorkspaceStateResponse, WorkspaceStateSourceKindCounts, } from "./workspace-state";
|
|
29
|
+
export type { WorkspaceStateDocumentStatusCounts, WorkspaceStateDocumentAuthorityKindCounts, WorkspaceStateAttemptGovernance, WorkspaceStateExportOmission, WorkspaceStateExportResponse, WorkspaceStateGapCode, WorkspaceStateGetOptions, WorkspaceStateGovernanceDriftStatus, WorkspaceStateMemoryKindCounts, WorkspaceStateMemoryStatusCounts, WorkspaceStateResponse, WorkspaceStateSourceKindCounts, } from "./workspace-state";
|
|
30
30
|
export { normalizePreferenceRegistryStableKey } from "./preference-registry";
|
|
31
31
|
export type { ActivatePreferenceRegistryRevisionRequest, ChangePreferenceRegistryScopeRequest, CorrectPreferenceRegistryRequest, CreatePreferenceRegistryProposalRequest, DeactivatePreferenceRegistryRequest, PreferenceRegistryConflictStrategy, PreferenceRegistryDescriptor, PreferenceRegistryDescriptorProvenance, PreferenceRegistryDetailResponse, PreferenceRegistryEvent, PreferenceRegistryFullContent, PreferenceRegistryListOptions, PreferenceRegistryListResponse, PreferenceRegistryMutationResponse, PreferenceRegistryPrecedence, PreferenceRegistryProvenanceSource, PreferenceRegistryRecord, PreferenceRegistryRevisionSummary, PreferenceRegistryScope, PreferenceRegistryScopeTarget, PreferenceRegistrySnapshot, PreferenceRegistryStatus, PreferenceRegistryTrust, RejectPreferenceRegistryProposalRequest, SupersedePreferenceRegistryRequest, } from "./preference-registry";
|
|
32
32
|
export { DEFAULT_WORKSPACE_TRANSCRIPTION_POLICY, authorizeTranscriptionAdapter, createTranscriptionSessionRequest, resolveWorkspaceVoiceInputEnabled, resolveWorkspaceTranscriptionPolicy, } from "./transcription";
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
resolveWorkspaceVoiceInputEnabled,
|
|
18
18
|
streamSessionEvents,
|
|
19
19
|
streamWorkspaceControlEvents
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-74LY67W7.js";
|
|
21
21
|
import {
|
|
22
22
|
CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,
|
|
23
23
|
CodexRealtimeMicrophoneError,
|
|
@@ -31,14 +31,14 @@ import {
|
|
|
31
31
|
parseCodexRealtimeV3Event,
|
|
32
32
|
projectSessionRealtimeLifecycle,
|
|
33
33
|
startCodexRealtimeWebrtc
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SLJ33Y7V.js";
|
|
35
35
|
import {
|
|
36
36
|
OpenGeniApiContractMismatchError,
|
|
37
37
|
OpenGeniApiError,
|
|
38
38
|
OpenGeniSessionListCursorError,
|
|
39
39
|
OpenGeniStreamError,
|
|
40
40
|
isRetryableStreamError
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-UD2DNDSS.js";
|
|
42
42
|
import {
|
|
43
43
|
createGatewayRealtimeTransportStarter
|
|
44
44
|
} from "./chunk-DXDL7EEW.js";
|
package/dist/realtime.js
CHANGED
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
sessionRealtimeOwnerStorageKey,
|
|
24
24
|
sessionRealtimeOwnerStorageNamespace,
|
|
25
25
|
startCodexRealtimeWebrtc
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-SLJ33Y7V.js";
|
|
27
|
+
import "./chunk-UD2DNDSS.js";
|
|
28
28
|
import {
|
|
29
29
|
createGatewayRealtimeTransportStarter
|
|
30
30
|
} from "./chunk-DXDL7EEW.js";
|
package/dist/types.d.ts
CHANGED
|
@@ -668,6 +668,8 @@ export type Session = {
|
|
|
668
668
|
sandboxGroupId: string;
|
|
669
669
|
activeSandboxId: string | null;
|
|
670
670
|
activeEpoch: number;
|
|
671
|
+
/** Explicit connected-machine project root; null uses the agent launch root. */
|
|
672
|
+
workingDir: string | null;
|
|
671
673
|
variableSetId: string | null;
|
|
672
674
|
/** @deprecated use variableSetId */
|
|
673
675
|
environmentId: string | null;
|
|
@@ -1634,6 +1636,8 @@ export type ModelPricingScheduleV1 = {
|
|
|
1634
1636
|
export type ClientModel = {
|
|
1635
1637
|
id: string;
|
|
1636
1638
|
label: string;
|
|
1639
|
+
/** Optional curated compact label for dense UI (e.g. mobile composer). */
|
|
1640
|
+
shortLabel?: string | undefined;
|
|
1637
1641
|
/** Provider id (e.g. `openai`, `azure`, or a registry provider id). */
|
|
1638
1642
|
provider: string;
|
|
1639
1643
|
providerLabel: string;
|
|
@@ -15,6 +15,11 @@ export type WorkspaceStateSourceKindCounts = {
|
|
|
15
15
|
web: number;
|
|
16
16
|
other: number;
|
|
17
17
|
};
|
|
18
|
+
export type WorkspaceStateDocumentAuthorityKindCounts = {
|
|
19
|
+
organization: number;
|
|
20
|
+
workspace: number;
|
|
21
|
+
personal: number;
|
|
22
|
+
};
|
|
18
23
|
export type WorkspaceStateMemoryStatusCounts = {
|
|
19
24
|
proposed: number;
|
|
20
25
|
approved: number;
|
|
@@ -142,6 +147,17 @@ export type WorkspaceStateResponse = {
|
|
|
142
147
|
status: "not_implemented";
|
|
143
148
|
};
|
|
144
149
|
};
|
|
150
|
+
preferences: {
|
|
151
|
+
authority: "preference_registry_preferences";
|
|
152
|
+
activeDescriptorCount: number;
|
|
153
|
+
activeDescriptorHash: string;
|
|
154
|
+
scopeCounts: {
|
|
155
|
+
organization: number;
|
|
156
|
+
workspace: number;
|
|
157
|
+
user: number;
|
|
158
|
+
};
|
|
159
|
+
truncated: boolean;
|
|
160
|
+
};
|
|
145
161
|
knowledge: {
|
|
146
162
|
availability: "unavailable";
|
|
147
163
|
reason: "missing_permission";
|
|
@@ -161,6 +177,7 @@ export type WorkspaceStateResponse = {
|
|
|
161
177
|
inspectedVisibleDocumentCount: number;
|
|
162
178
|
documentStatusCounts: WorkspaceStateDocumentStatusCounts;
|
|
163
179
|
sourceKindCounts: WorkspaceStateSourceKindCounts;
|
|
180
|
+
authorityKindCounts: WorkspaceStateDocumentAuthorityKindCounts;
|
|
164
181
|
topics: Array<{
|
|
165
182
|
name: string;
|
|
166
183
|
documentCount: number;
|
|
@@ -186,3 +203,12 @@ export type WorkspaceStateResponse = {
|
|
|
186
203
|
}>;
|
|
187
204
|
};
|
|
188
205
|
};
|
|
206
|
+
export type WorkspaceStateExportOmission = "hidden_platform_prompts" | "policy_bodies" | "preference_content" | "document_content_and_private_metadata" | "memory_content_and_provenance" | "secret_values_and_credentials" | "session_messages_and_tool_outputs";
|
|
207
|
+
export type WorkspaceStateExportResponse = {
|
|
208
|
+
kind: "opengeni.workspace_state.sanitized_export";
|
|
209
|
+
schemaVersion: 1;
|
|
210
|
+
generatedAt: string;
|
|
211
|
+
stateSha256: string;
|
|
212
|
+
omissions: WorkspaceStateExportOmission[];
|
|
213
|
+
state: WorkspaceStateResponse;
|
|
214
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeni/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
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": {
|
package/src/client.ts
CHANGED
|
@@ -235,7 +235,11 @@ import type {
|
|
|
235
235
|
WorkspaceInstructionPolicyOnboardingProposalListResponse,
|
|
236
236
|
WorkspaceInstructionPolicyRevision,
|
|
237
237
|
} from "./workspace-instruction-policies";
|
|
238
|
-
import type {
|
|
238
|
+
import type {
|
|
239
|
+
WorkspaceStateExportResponse,
|
|
240
|
+
WorkspaceStateGetOptions,
|
|
241
|
+
WorkspaceStateResponse,
|
|
242
|
+
} from "./workspace-state";
|
|
239
243
|
import type {
|
|
240
244
|
ActivatePreferenceRegistryRevisionRequest,
|
|
241
245
|
ChangePreferenceRegistryScopeRequest,
|
|
@@ -1911,6 +1915,20 @@ export class OpenGeniClient {
|
|
|
1911
1915
|
);
|
|
1912
1916
|
}
|
|
1913
1917
|
|
|
1918
|
+
/** Download the canonical, explicitly sanitized Workspace State export. */
|
|
1919
|
+
async exportWorkspaceState(
|
|
1920
|
+
workspaceId: string,
|
|
1921
|
+
options: WorkspaceStateGetOptions = {},
|
|
1922
|
+
): Promise<WorkspaceStateExportResponse> {
|
|
1923
|
+
const params = new URLSearchParams();
|
|
1924
|
+
if (options.attemptId) params.set("attemptId", options.attemptId);
|
|
1925
|
+
const query = params.size > 0 ? `?${params.toString()}` : "";
|
|
1926
|
+
return await this.requestJson<WorkspaceStateExportResponse>(
|
|
1927
|
+
"GET",
|
|
1928
|
+
`/v1/workspaces/${workspaceId}/workspace-state/export${query}`,
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1914
1932
|
async updateWorkspace(workspaceId: string, request: UpdateWorkspaceRequest): Promise<Workspace> {
|
|
1915
1933
|
return await this.requestJson<Workspace>("PATCH", `/v1/workspaces/${workspaceId}`, request);
|
|
1916
1934
|
}
|
package/src/errors.ts
CHANGED
|
@@ -7,6 +7,7 @@ export class OpenGeniApiError extends Error {
|
|
|
7
7
|
/** True only when an uncontrolled transport failed after a mutation may have been accepted. */
|
|
8
8
|
readonly outcomeUnknown: boolean;
|
|
9
9
|
readonly body: string;
|
|
10
|
+
readonly details: Record<string, unknown> | undefined;
|
|
10
11
|
|
|
11
12
|
constructor(
|
|
12
13
|
status: number,
|
|
@@ -42,6 +43,7 @@ export class OpenGeniApiError extends Error {
|
|
|
42
43
|
this.outcomeUnknown =
|
|
43
44
|
options.outcomeUnknown ?? (gatewayFailure && !!options.mutation && !decoded);
|
|
44
45
|
this.body = !fromResponse || decoded ? body : "";
|
|
46
|
+
this.details = decoded?.details;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -50,6 +52,7 @@ function decodeApiErrorBody(body: string): {
|
|
|
50
52
|
message: string | undefined;
|
|
51
53
|
requestId: string | undefined;
|
|
52
54
|
retryable: boolean | undefined;
|
|
55
|
+
details: Record<string, unknown> | undefined;
|
|
53
56
|
} | null {
|
|
54
57
|
if (!body) return null;
|
|
55
58
|
try {
|
|
@@ -64,18 +67,36 @@ function decodeApiErrorBody(body: string): {
|
|
|
64
67
|
const message = boundedApiField(nested.message);
|
|
65
68
|
const requestId = boundedCorrelationId(nested.requestId);
|
|
66
69
|
const retryable = typeof nested.retryable === "boolean" ? nested.retryable : undefined;
|
|
67
|
-
|
|
70
|
+
const details = boundedApiDetails(nested.details);
|
|
71
|
+
if (!code && !message && !requestId && retryable === undefined && !details) return null;
|
|
68
72
|
return {
|
|
69
73
|
code,
|
|
70
74
|
message,
|
|
71
75
|
requestId,
|
|
72
76
|
retryable,
|
|
77
|
+
details,
|
|
73
78
|
};
|
|
74
79
|
} catch {
|
|
75
80
|
return null;
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
|
|
84
|
+
function boundedApiDetails(value: unknown): Record<string, unknown> | undefined {
|
|
85
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
86
|
+
const entries = Object.entries(value as Record<string, unknown>).slice(0, 16);
|
|
87
|
+
const details: Record<string, unknown> = {};
|
|
88
|
+
for (const [key, entry] of entries) {
|
|
89
|
+
if (!/^[a-zA-Z][\w.-]{0,63}$/.test(key)) continue;
|
|
90
|
+
if (typeof entry === "string") {
|
|
91
|
+
const bounded = boundedApiField(entry);
|
|
92
|
+
if (bounded !== undefined) details[key] = bounded;
|
|
93
|
+
} else if (typeof entry === "number" || typeof entry === "boolean" || entry === null) {
|
|
94
|
+
details[key] = entry;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return Object.keys(details).length > 0 ? details : undefined;
|
|
98
|
+
}
|
|
99
|
+
|
|
79
100
|
function boundedApiField(value: unknown): string | undefined {
|
|
80
101
|
if (typeof value !== "string") return;
|
|
81
102
|
const bytes = new TextEncoder().encode(value);
|
package/src/index.ts
CHANGED
|
@@ -156,7 +156,10 @@ export type {
|
|
|
156
156
|
} from "./workspace-instruction-policies";
|
|
157
157
|
export type {
|
|
158
158
|
WorkspaceStateDocumentStatusCounts,
|
|
159
|
+
WorkspaceStateDocumentAuthorityKindCounts,
|
|
159
160
|
WorkspaceStateAttemptGovernance,
|
|
161
|
+
WorkspaceStateExportOmission,
|
|
162
|
+
WorkspaceStateExportResponse,
|
|
160
163
|
WorkspaceStateGapCode,
|
|
161
164
|
WorkspaceStateGetOptions,
|
|
162
165
|
WorkspaceStateGovernanceDriftStatus,
|
package/src/types.ts
CHANGED
|
@@ -881,6 +881,8 @@ export type Session = {
|
|
|
881
881
|
sandboxGroupId: string;
|
|
882
882
|
activeSandboxId: string | null;
|
|
883
883
|
activeEpoch: number;
|
|
884
|
+
/** Explicit connected-machine project root; null uses the agent launch root. */
|
|
885
|
+
workingDir: string | null;
|
|
884
886
|
variableSetId: string | null;
|
|
885
887
|
/** @deprecated use variableSetId */
|
|
886
888
|
environmentId: string | null;
|
|
@@ -2203,6 +2205,8 @@ export type ModelPricingScheduleV1 = {
|
|
|
2203
2205
|
export type ClientModel = {
|
|
2204
2206
|
id: string;
|
|
2205
2207
|
label: string;
|
|
2208
|
+
/** Optional curated compact label for dense UI (e.g. mobile composer). */
|
|
2209
|
+
shortLabel?: string | undefined;
|
|
2206
2210
|
/** Provider id (e.g. `openai`, `azure`, or a registry provider id). */
|
|
2207
2211
|
provider: string;
|
|
2208
2212
|
providerLabel: string;
|
package/src/workspace-state.ts
CHANGED
|
@@ -22,6 +22,12 @@ export type WorkspaceStateSourceKindCounts = {
|
|
|
22
22
|
other: number;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
export type WorkspaceStateDocumentAuthorityKindCounts = {
|
|
26
|
+
organization: number;
|
|
27
|
+
workspace: number;
|
|
28
|
+
personal: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
25
31
|
export type WorkspaceStateMemoryStatusCounts = {
|
|
26
32
|
proposed: number;
|
|
27
33
|
approved: number;
|
|
@@ -167,6 +173,13 @@ export type WorkspaceStateResponse = {
|
|
|
167
173
|
};
|
|
168
174
|
runtimeComposition: { status: "not_implemented" };
|
|
169
175
|
};
|
|
176
|
+
preferences: {
|
|
177
|
+
authority: "preference_registry_preferences";
|
|
178
|
+
activeDescriptorCount: number;
|
|
179
|
+
activeDescriptorHash: string;
|
|
180
|
+
scopeCounts: { organization: number; workspace: number; user: number };
|
|
181
|
+
truncated: boolean;
|
|
182
|
+
};
|
|
170
183
|
knowledge:
|
|
171
184
|
| {
|
|
172
185
|
availability: "unavailable";
|
|
@@ -188,6 +201,7 @@ export type WorkspaceStateResponse = {
|
|
|
188
201
|
inspectedVisibleDocumentCount: number;
|
|
189
202
|
documentStatusCounts: WorkspaceStateDocumentStatusCounts;
|
|
190
203
|
sourceKindCounts: WorkspaceStateSourceKindCounts;
|
|
204
|
+
authorityKindCounts: WorkspaceStateDocumentAuthorityKindCounts;
|
|
191
205
|
topics: Array<{ name: string; documentCount: number }>;
|
|
192
206
|
topicsTruncated: boolean;
|
|
193
207
|
latestDocumentUpdatedAt: string | null;
|
|
@@ -210,3 +224,21 @@ export type WorkspaceStateResponse = {
|
|
|
210
224
|
}>;
|
|
211
225
|
};
|
|
212
226
|
};
|
|
227
|
+
|
|
228
|
+
export type WorkspaceStateExportOmission =
|
|
229
|
+
| "hidden_platform_prompts"
|
|
230
|
+
| "policy_bodies"
|
|
231
|
+
| "preference_content"
|
|
232
|
+
| "document_content_and_private_metadata"
|
|
233
|
+
| "memory_content_and_provenance"
|
|
234
|
+
| "secret_values_and_credentials"
|
|
235
|
+
| "session_messages_and_tool_outputs";
|
|
236
|
+
|
|
237
|
+
export type WorkspaceStateExportResponse = {
|
|
238
|
+
kind: "opengeni.workspace_state.sanitized_export";
|
|
239
|
+
schemaVersion: 1;
|
|
240
|
+
generatedAt: string;
|
|
241
|
+
stateSha256: string;
|
|
242
|
+
omissions: WorkspaceStateExportOmission[];
|
|
243
|
+
state: WorkspaceStateResponse;
|
|
244
|
+
};
|