@opengeni/sdk 0.37.0 → 0.40.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.
@@ -31,6 +31,75 @@ export type WorkspaceStateMemoryKindCounts = {
31
31
  preference: number;
32
32
  };
33
33
  export type WorkspaceStateGapCode = "no_document_bases" | "no_visible_documents" | "failed_documents" | "processing_documents" | "missing_topic_coverage" | "no_memory_records" | "pending_memory_review" | "partial_inventory";
34
+ export type WorkspaceStateGovernanceDriftStatus = "identical" | "changed" | "superseded" | "missing" | "unavailable" | "truncated";
35
+ export type WorkspaceStateGetOptions = {
36
+ attemptId?: string;
37
+ };
38
+ export type WorkspaceStateAttemptGovernance = {
39
+ status: "not_requested";
40
+ } | {
41
+ status: "unavailable";
42
+ reason: "attempt_not_found_or_not_authorized";
43
+ driftStatus: "unavailable";
44
+ } | {
45
+ status: "available";
46
+ attemptId: string;
47
+ executionGeneration: number;
48
+ acceptedAt: string;
49
+ policySnapshot: {
50
+ status: "missing";
51
+ } | {
52
+ status: "available";
53
+ id: string;
54
+ createdAt: string;
55
+ entryHash: string;
56
+ policyRole: string | null;
57
+ roleSource: "session_binding" | "metadata_fallback" | "none" | "invalid_metadata_fallback";
58
+ entries: Array<{
59
+ kind: WorkspaceInstructionPolicyKind;
60
+ scope: WorkspaceInstructionPolicyScope;
61
+ roleKey: string | null;
62
+ revisionId: string;
63
+ revision: number;
64
+ contentHash: string;
65
+ activationVersion: number;
66
+ activatedAt: string;
67
+ provenance: {
68
+ source: WorkspaceInstructionPolicyProvenanceSource;
69
+ sourceIdHash: string | null;
70
+ };
71
+ }>;
72
+ };
73
+ preferenceSnapshot: {
74
+ status: "missing";
75
+ } | {
76
+ status: "available";
77
+ id: string;
78
+ createdAt: string;
79
+ descriptorHash: string;
80
+ descriptorCount: number;
81
+ truncated: boolean;
82
+ };
83
+ drift: {
84
+ overall: WorkspaceStateGovernanceDriftStatus;
85
+ policy: {
86
+ status: WorkspaceStateGovernanceDriftStatus;
87
+ snapshotHash: string | null;
88
+ currentHash: string | null;
89
+ snapshotTargetCount: number;
90
+ currentTargetCount: number;
91
+ };
92
+ preferences: {
93
+ status: WorkspaceStateGovernanceDriftStatus;
94
+ snapshotHash: string | null;
95
+ currentHash: string | null;
96
+ snapshotDescriptorCount: number;
97
+ currentDescriptorCount: number;
98
+ snapshotTruncated: boolean;
99
+ currentTruncated: boolean;
100
+ };
101
+ };
102
+ };
34
103
  export type WorkspaceStateResponse = {
35
104
  workspaceId: string;
36
105
  generatedAt: string;
@@ -39,10 +108,7 @@ export type WorkspaceStateResponse = {
39
108
  source: "read_time_projection";
40
109
  capturedAt: string;
41
110
  };
42
- policySnapshot: {
43
- status: "not_captured";
44
- reason: "workspace_instruction_policy_snapshot_not_implemented";
45
- };
111
+ attemptGovernance: WorkspaceStateAttemptGovernance;
46
112
  };
47
113
  policy: {
48
114
  authority: "workspace_instruction_policy_heads";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/sdk",
3
- "version": "0.37.0",
3
+ "version": "0.40.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": {
@@ -26,6 +26,10 @@
26
26
  "types": "./dist/core.d.ts",
27
27
  "import": "./dist/core.js"
28
28
  },
29
+ "./realtime": {
30
+ "types": "./dist/realtime.d.ts",
31
+ "import": "./dist/realtime.js"
32
+ },
29
33
  "./codex-realtime-controller": {
30
34
  "types": "./dist/codex-realtime-controller.d.ts",
31
35
  "import": "./dist/codex-realtime-controller.js"
package/src/client.ts CHANGED
@@ -90,6 +90,8 @@ import type {
90
90
  GetPackResponse,
91
91
  GitHubAppInfo,
92
92
  GitHubRepositoriesResponse,
93
+ GoogleDriveDisconnectRequest,
94
+ GoogleDriveLifecycleActionRequest,
93
95
  KnowledgeMemory,
94
96
  KnowledgeMemorySearchRequest,
95
97
  ListApiKeysResponse,
@@ -229,7 +231,7 @@ import type {
229
231
  WorkspaceInstructionPolicyListResponse,
230
232
  WorkspaceInstructionPolicyRevision,
231
233
  } from "./workspace-instruction-policies";
232
- import type { WorkspaceStateResponse } from "./workspace-state";
234
+ import type { WorkspaceStateGetOptions, WorkspaceStateResponse } from "./workspace-state";
233
235
  import type {
234
236
  ActivatePreferenceRegistryRevisionRequest,
235
237
  ChangePreferenceRegistryScopeRequest,
@@ -1892,10 +1894,16 @@ export class OpenGeniClient {
1892
1894
  }
1893
1895
 
1894
1896
  /** Read-time, secret-safe inventory of policy heads and visible workspace knowledge. */
1895
- async getWorkspaceState(workspaceId: string): Promise<WorkspaceStateResponse> {
1897
+ async getWorkspaceState(
1898
+ workspaceId: string,
1899
+ options: WorkspaceStateGetOptions = {},
1900
+ ): Promise<WorkspaceStateResponse> {
1901
+ const params = new URLSearchParams();
1902
+ if (options.attemptId) params.set("attemptId", options.attemptId);
1903
+ const query = params.size > 0 ? `?${params.toString()}` : "";
1896
1904
  return await this.requestJson<WorkspaceStateResponse>(
1897
1905
  "GET",
1898
- `/v1/workspaces/${workspaceId}/workspace-state`,
1906
+ `/v1/workspaces/${workspaceId}/workspace-state${query}`,
1899
1907
  );
1900
1908
  }
1901
1909
 
@@ -3048,6 +3056,32 @@ export class OpenGeniClient {
3048
3056
  return response.connection;
3049
3057
  }
3050
3058
 
3059
+ async disconnectGoogleDriveConnection(
3060
+ workspaceId: string,
3061
+ connectionId: string,
3062
+ request: GoogleDriveDisconnectRequest,
3063
+ ): Promise<ConnectionMetadata> {
3064
+ const response = await this.requestJson<ConnectionResponse>(
3065
+ "DELETE",
3066
+ `/v1/workspaces/${workspaceId}/connections/${connectionId}`,
3067
+ request,
3068
+ );
3069
+ return response.connection;
3070
+ }
3071
+
3072
+ async transitionGoogleDriveLifecycle(
3073
+ workspaceId: string,
3074
+ connectionId: string,
3075
+ request: GoogleDriveLifecycleActionRequest,
3076
+ ): Promise<ConnectionMetadata> {
3077
+ const response = await this.requestJson<ConnectionResponse>(
3078
+ "PATCH",
3079
+ `/v1/workspaces/${workspaceId}/connections/google-drive/${connectionId}/lifecycle`,
3080
+ request,
3081
+ );
3082
+ return response.connection;
3083
+ }
3084
+
3051
3085
  /** Start an OAuth connection flow; redirect the user to the returned `authorizationUrl`. */
3052
3086
  async startConnectionOAuth(
3053
3087
  workspaceId: string,
@@ -147,6 +147,44 @@ export type CodexRealtimeControllerClient = {
147
147
 
148
148
  export type CodexRealtimeOwnerStorage = Pick<Storage, "getItem" | "setItem" | "removeItem">;
149
149
 
150
+ /** Canonical browser-owner storage namespace for a public realtime model. */
151
+ export function sessionRealtimeOwnerStorageNamespace(model: SessionRealtimeModel): string {
152
+ return model === "gpt-live-1-boulder-alpha" ? "codex-realtime-owner" : "gateway-realtime-owner";
153
+ }
154
+
155
+ /** Canonical browser-owner storage key shared by the SDK controller and React facade. */
156
+ export function sessionRealtimeOwnerStorageKey(
157
+ workspaceId: string,
158
+ sessionId: string,
159
+ model: SessionRealtimeModel,
160
+ ): string {
161
+ return ownerStorageKey(workspaceId, sessionId, sessionRealtimeOwnerStorageNamespace(model));
162
+ }
163
+
164
+ /**
165
+ * Preserve the existing pre-controller owner-presence projection used by the
166
+ * lazy React control. The controller remains the sole authority that validates
167
+ * or removes malformed records once it is constructed.
168
+ */
169
+ export function hasStoredSessionRealtimeOwnerProof(input: {
170
+ workspaceId: string;
171
+ sessionId: string;
172
+ model: SessionRealtimeModel;
173
+ storage?: CodexRealtimeOwnerStorage | undefined;
174
+ }): boolean {
175
+ const storage = input.storage ?? defaultStorage();
176
+ if (!storage) return false;
177
+ try {
178
+ return (
179
+ storage.getItem(
180
+ sessionRealtimeOwnerStorageKey(input.workspaceId, input.sessionId, input.model),
181
+ ) !== null
182
+ );
183
+ } catch {
184
+ return false;
185
+ }
186
+ }
187
+
150
188
  export type CreateCodexRealtimeControllerOptions = {
151
189
  client: CodexRealtimeControllerClient;
152
190
  workspaceId: string;
package/src/index.ts CHANGED
@@ -136,6 +136,7 @@ export type {
136
136
  WorkspaceInstructionPolicyKind,
137
137
  WorkspaceInstructionPolicyListOptions,
138
138
  WorkspaceInstructionPolicyListResponse,
139
+ WorkspaceInstructionPolicyOperationReuseResponse,
139
140
  WorkspaceInstructionPolicyProvenanceSource,
140
141
  WorkspaceInstructionPolicyRevision,
141
142
  WorkspaceInstructionPolicyRevisionIdentity,
@@ -144,7 +145,10 @@ export type {
144
145
  } from "./workspace-instruction-policies";
145
146
  export type {
146
147
  WorkspaceStateDocumentStatusCounts,
148
+ WorkspaceStateAttemptGovernance,
147
149
  WorkspaceStateGapCode,
150
+ WorkspaceStateGetOptions,
151
+ WorkspaceStateGovernanceDriftStatus,
148
152
  WorkspaceStateMemoryKindCounts,
149
153
  WorkspaceStateMemoryStatusCounts,
150
154
  WorkspaceStateResponse,
@@ -208,6 +212,7 @@ export type {
208
212
  WorkspaceTranscriptionTarget,
209
213
  } from "./transcription";
210
214
  export {
215
+ DEFAULT_FILE_RESOURCE_MOUNT_ROOT,
211
216
  KNOWN_PERMISSIONS,
212
217
  KNOWN_USAGE_EVENT_TYPES,
213
218
  OPENGENI_API_CONTRACT_HEADER,
@@ -348,6 +353,7 @@ export type {
348
353
  CreateWorkspaceRequest,
349
354
  DiscoverMcpCapabilitiesResponse,
350
355
  Document,
356
+ DocumentAuthorityKind,
351
357
  DocumentBase,
352
358
  DocumentCuration,
353
359
  DocumentCurationStatus,
@@ -383,7 +389,11 @@ export type {
383
389
  GitHubRepositoriesResponse,
384
390
  GoogleDriveBrowseItem,
385
391
  GoogleDriveBrowseResponse,
392
+ GoogleDriveConnectionLifecycle,
393
+ GoogleDriveConnectionLifecycleState,
386
394
  GoogleDriveConnectionMetadata,
395
+ GoogleDriveDisconnectRequest,
396
+ GoogleDriveLifecycleActionRequest,
387
397
  GoogleDriveOAuthStartRequest,
388
398
  GoogleDriveOAuthStartResponse,
389
399
  GoogleDriveReadPolicy,
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Public, provider-neutral realtime browser SDK.
3
+ *
4
+ * Import this subpath lazily in browser applications. The base `@opengeni/sdk`
5
+ * entry remains free of eager realtime transport initialization.
6
+ */
7
+ import {
8
+ createCodexRealtimeController,
9
+ hasStoredSessionRealtimeOwnerProof,
10
+ sessionRealtimeOwnerStorageKey,
11
+ sessionRealtimeOwnerStorageNamespace,
12
+ type CodexRealtimeController,
13
+ type CodexRealtimeControllerClient,
14
+ type CodexRealtimeControllerSnapshot,
15
+ type CodexRealtimeControllerStatus,
16
+ type CodexRealtimeDiagnostic,
17
+ type CodexRealtimeDiagnosticKind,
18
+ type CodexRealtimeMicrophoneState,
19
+ type CodexRealtimeOwnerStorage,
20
+ type CreateCodexRealtimeControllerOptions,
21
+ type RealtimeControllerTransportStarter,
22
+ } from "./codex-realtime-controller";
23
+ import { createGatewayRealtimeTransportStarter } from "./gateway-realtime-transport";
24
+ import type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from "./types";
25
+
26
+ /** Exact backend-facing methods required by the batteries-included realtime SDK. */
27
+ export type SessionRealtimeClientLike = CodexRealtimeControllerClient & {
28
+ getWorkspaceRealtimeModelCatalog(
29
+ workspaceId: string,
30
+ ): Promise<WorkspaceRealtimeModelCatalogResponse>;
31
+ };
32
+
33
+ export type SessionRealtimeTransportKind = "codex" | "gateway";
34
+
35
+ /** Provider-neutral names for the existing, battle-tested controller projection. */
36
+ export type SessionRealtimeController = CodexRealtimeController;
37
+ export type SessionRealtimeControllerSnapshot = CodexRealtimeControllerSnapshot;
38
+ export type SessionRealtimeControllerStatus = CodexRealtimeControllerStatus;
39
+ export type SessionRealtimeDiagnostic = CodexRealtimeDiagnostic;
40
+ export type SessionRealtimeDiagnosticKind = CodexRealtimeDiagnosticKind;
41
+ export type SessionRealtimeMicrophoneState = CodexRealtimeMicrophoneState;
42
+ export type SessionRealtimeOwnerStorage = CodexRealtimeOwnerStorage;
43
+
44
+ export type CreateSessionRealtimeControllerOptions = Omit<
45
+ CreateCodexRealtimeControllerOptions,
46
+ "client" | "model" | "ownerStorageNamespace" | "startTransport"
47
+ > & {
48
+ client: CodexRealtimeControllerClient;
49
+ model: SessionRealtimeModel;
50
+ };
51
+
52
+ /** Select the existing transport without exposing provider mechanics to hosts. */
53
+ export function sessionRealtimeTransportKind(
54
+ model: SessionRealtimeModel,
55
+ ): SessionRealtimeTransportKind {
56
+ return model === "gpt-live-1-boulder-alpha" ? "codex" : "gateway";
57
+ }
58
+
59
+ /**
60
+ * Compose the exact current controller with its existing Codex Live or AI
61
+ * Gateway transport. Wire, ledger, delegation, recovery, and lifecycle
62
+ * semantics remain owned by the existing implementations below this facade.
63
+ */
64
+ export function createSessionRealtimeController(
65
+ options: CreateSessionRealtimeControllerOptions,
66
+ ): SessionRealtimeController {
67
+ const transport = sessionRealtimeTransportKind(options.model);
68
+ return createCodexRealtimeController({
69
+ ...options,
70
+ ownerStorageNamespace: sessionRealtimeOwnerStorageNamespace(options.model),
71
+ ...(transport === "gateway" ? { startTransport: createGatewayRealtimeTransportStarter() } : {}),
72
+ });
73
+ }
74
+
75
+ export {
76
+ createCodexRealtimeController,
77
+ createGatewayRealtimeTransportStarter,
78
+ hasStoredSessionRealtimeOwnerProof,
79
+ sessionRealtimeOwnerStorageKey,
80
+ sessionRealtimeOwnerStorageNamespace,
81
+ };
82
+ export type {
83
+ CodexRealtimeController,
84
+ CodexRealtimeControllerClient,
85
+ CodexRealtimeControllerSnapshot,
86
+ CodexRealtimeControllerStatus,
87
+ CodexRealtimeDiagnostic,
88
+ CodexRealtimeDiagnosticKind,
89
+ CodexRealtimeMicrophoneState,
90
+ CodexRealtimeOwnerStorage,
91
+ CreateCodexRealtimeControllerOptions,
92
+ RealtimeControllerTransportStarter,
93
+ };
94
+
95
+ export {
96
+ CODEX_REALTIME_NEGOTIATION_TIMEOUT_MS,
97
+ projectSessionRealtimeLifecycle,
98
+ } from "./codex-realtime-controller";
99
+ export type { SessionRealtimeLifecycleProjection } from "./codex-realtime-lifecycle";
100
+
101
+ export {
102
+ CodexRealtimeMicrophoneError,
103
+ acquireCodexRealtimeMicrophone,
104
+ codexRealtimeMicrophoneHealthy,
105
+ startCodexRealtimeWebrtc,
106
+ } from "./codex-realtime";
107
+ export type {
108
+ AcquireCodexRealtimeMicrophoneOptions,
109
+ CodexRealtimeAudibleOutputState,
110
+ CodexRealtimeConnectionHealth,
111
+ CodexRealtimeMicrophoneErrorCode,
112
+ CodexRealtimeNegotiator,
113
+ CodexRealtimeWebrtcSession,
114
+ StartCodexRealtimeWebrtcOptions,
115
+ } from "./codex-realtime";
116
+
117
+ export {
118
+ CODEX_REALTIME_CONTEXT_APPEND_MAX_BYTES,
119
+ CODEX_REALTIME_V3_MAX_EVENT_BYTES,
120
+ CODEX_REALTIME_V3_MAX_IDENTIFIER_BYTES,
121
+ CODEX_REALTIME_V3_MAX_TEXT_BYTES,
122
+ CODEX_REALTIME_V3_PENDING_MAX_BYTES,
123
+ CODEX_REALTIME_V3_PENDING_MAX_ENTRIES,
124
+ CODEX_REALTIME_V3_SYNC_MAX_ENTRIES,
125
+ contextAppendChunks,
126
+ createCodexRealtimeV3Bridge,
127
+ encodeCodexRealtimeV3DelegationContextAppend,
128
+ encodeCodexRealtimeV3SessionContextAppend,
129
+ parseCodexRealtimeV3Event,
130
+ } from "./codex-realtime-v3";
131
+ export type {
132
+ CodexRealtimeV3Bridge,
133
+ CodexRealtimeV3BridgeFatal,
134
+ CodexRealtimeV3BridgeOptions,
135
+ CodexRealtimeV3BridgeSnapshot,
136
+ CodexRealtimeV3ContextAppendChannel,
137
+ CodexRealtimeV3DelegationContextAppend,
138
+ CodexRealtimeV3Event,
139
+ CodexRealtimeV3ParseFailure,
140
+ CodexRealtimeV3ParseResult,
141
+ CodexRealtimeV3SessionContextAppend,
142
+ } from "./codex-realtime-v3";
143
+
144
+ export {
145
+ CODEX_REALTIME_INITIAL_ITEMS_MAX_COUNT,
146
+ CODEX_REALTIME_INITIAL_ITEMS_MAX_TOKENS,
147
+ } from "./codex-realtime-v3-wire";
148
+ export type { CodexRealtimeInitialItem } from "./codex-realtime-v3-wire";
149
+
150
+ export type {
151
+ ActivateCodexRealtimeConnectionRequest,
152
+ BeginSessionRealtimeRequest,
153
+ CodexRealtimeVoice,
154
+ CodexRealtimeWebrtcRequest,
155
+ CodexRealtimeWebrtcResponse,
156
+ CodexRealtimeWebrtcVersion,
157
+ EndSessionRealtimeRequest,
158
+ GatewayRealtimeConnectRequest,
159
+ GatewayRealtimeConnectResponse,
160
+ GatewayRealtimeInitialItem,
161
+ RenewSessionRealtimeRequest,
162
+ SessionRealtimeEndReason,
163
+ SessionRealtimeLedgerEntry,
164
+ SessionRealtimeMode,
165
+ SessionRealtimeModel,
166
+ SessionRealtimeMutationResponse,
167
+ SessionRealtimeState,
168
+ SyncSessionRealtimeLedgerRequest,
169
+ SyncSessionRealtimeLedgerResponse,
170
+ WorkspaceRealtimeModelCatalogItem,
171
+ WorkspaceRealtimeModelCatalogResponse,
172
+ } from "./types";
package/src/types.ts CHANGED
@@ -461,10 +461,13 @@ export type RepositoryResourceRef = {
461
461
  githubRepositoryId?: number | undefined;
462
462
  };
463
463
 
464
+ /** Value mirror of `@opengeni/contracts`; parity-tested without adding an SDK runtime dependency. */
465
+ export const DEFAULT_FILE_RESOURCE_MOUNT_ROOT = ".opengeni/files" as const;
466
+
464
467
  export type FileResourceRef = {
465
468
  kind: "file";
466
469
  fileId: string;
467
- /** Optional workspace-relative override; defaults to `files/<file-id>`. */
470
+ /** Optional workspace-relative override; defaults to `.opengeni/files/<file-id>`. */
468
471
  mountPath?: string | undefined;
469
472
  };
470
473
 
@@ -641,6 +644,22 @@ export type OpenGeniSlackBotInstallStart = {
641
644
  export type GoogleDriveTargetScope = "user" | "workspace" | "organization";
642
645
  export type GoogleDriveSyncCadence = "manual" | "hourly" | "daily";
643
646
  export type GoogleDriveReadPolicy = "allow" | "ask" | "block";
647
+ export type GoogleDriveConnectionLifecycleState =
648
+ | "active"
649
+ | "paused"
650
+ | "token_revoked"
651
+ | "app_removed"
652
+ | "disconnected"
653
+ | "reconnect_required"
654
+ | "reconsent_required";
655
+
656
+ export type GoogleDriveConnectionLifecycle =
657
+ | {
658
+ state: Exclude<GoogleDriveConnectionLifecycleState, "app_removed">;
659
+ recoverable: true;
660
+ observedAt: string;
661
+ }
662
+ | { state: "app_removed"; recoverable: false; observedAt: string };
644
663
 
645
664
  export type GoogleDriveSelectedSource = {
646
665
  id: string;
@@ -661,6 +680,7 @@ export type GoogleDriveConnectionMetadata = {
661
680
  googleDisplayName: string | null;
662
681
  verifiedAt: string;
663
682
  accessMode: "metadata_readonly" | "readonly";
683
+ lifecycle?: GoogleDriveConnectionLifecycle | undefined;
664
684
  selectedSources?: GoogleDriveSelectedSource[] | undefined;
665
685
  /** @deprecated Read selectedSources; retained while existing connections migrate. */
666
686
  selectedSource?: GoogleDriveSelectedSource | null | undefined;
@@ -676,6 +696,16 @@ export type GoogleDriveOAuthStartResponse = {
676
696
  expiresAt: string;
677
697
  };
678
698
 
699
+ export type GoogleDriveLifecycleActionRequest = {
700
+ action: "pause" | "resume";
701
+ expectedVersion: number;
702
+ };
703
+
704
+ export type GoogleDriveDisconnectRequest = {
705
+ expectedVersion: number;
706
+ idempotencyKey: string;
707
+ };
708
+
679
709
  export type GoogleDriveBrowseItem = {
680
710
  id: string;
681
711
  name: string;
@@ -1000,8 +1030,6 @@ export type HumanInputQuestion = {
1000
1030
  allowOther: boolean;
1001
1031
  validation?:
1002
1032
  | {
1003
- minLength?: number | null | undefined;
1004
- maxLength?: number | null | undefined;
1005
1033
  minSelections?: number | null | undefined;
1006
1034
  maxSelections?: number | null | undefined;
1007
1035
  }
@@ -2104,6 +2132,7 @@ export type ModelCapabilitiesV1 = {
2104
2132
  codeExecution: ModelCapabilityStateV1;
2105
2133
  };
2106
2134
  inputModalities: Array<"text" | "image" | "audio">;
2135
+ inputFileMediaTypes?: string[] | undefined;
2107
2136
  outputModalities: Array<"text" | "image" | "audio">;
2108
2137
  transports: {
2109
2138
  sse: ModelCapabilityStateV1;
@@ -3365,6 +3394,8 @@ export type KnowledgeSourceKind =
3365
3394
  | "other";
3366
3395
  export type DocumentSearchMode = "hybrid" | "vector" | "keyword";
3367
3396
 
3397
+ export type DocumentAuthorityKind = "organization" | "workspace" | "personal";
3398
+
3368
3399
  export type DocumentVisibility = "workspace" | "private";
3369
3400
 
3370
3401
  export type DocumentCurationStatus = "none" | "pending" | "suggested" | "auto_filed" | "failed";
@@ -3406,6 +3437,9 @@ export type Document = {
3406
3437
  sourceUpdatedAt: string | null;
3407
3438
  sourceVersion: string | null;
3408
3439
  aclTags: string[];
3440
+ authorityKind: DocumentAuthorityKind;
3441
+ authorityWorkspaceId: string | null;
3442
+ authoritySubjectId: string | null;
3409
3443
  visibility: DocumentVisibility;
3410
3444
  createdBy: string | null;
3411
3445
  agentAccess: boolean;
@@ -3440,6 +3474,9 @@ export type DocumentSearchResult = {
3440
3474
  sourceUpdatedAt: string | null;
3441
3475
  sourceVersion: string | null;
3442
3476
  aclTags: string[];
3477
+ authorityKind: DocumentAuthorityKind;
3478
+ authorityWorkspaceId: string | null;
3479
+ authoritySubjectId: string | null;
3443
3480
  };
3444
3481
 
3445
3482
  export type CreateDocumentBaseRequest = {
@@ -3459,6 +3496,7 @@ export type AddDocumentRequest = {
3459
3496
  sourceUpdatedAt?: string | undefined;
3460
3497
  sourceVersion?: string | undefined;
3461
3498
  aclTags?: string[] | undefined;
3499
+ authorityKind?: DocumentAuthorityKind | undefined;
3462
3500
  visibility?: DocumentVisibility | undefined;
3463
3501
  agentAccess?: boolean | undefined;
3464
3502
  };
@@ -3468,6 +3506,7 @@ export type CreateKnowledgeDropRequest = {
3468
3506
  fileId?: string | undefined;
3469
3507
  filename?: string | undefined;
3470
3508
  title?: string | undefined;
3509
+ authorityKind?: DocumentAuthorityKind | undefined;
3471
3510
  visibility?: DocumentVisibility | undefined;
3472
3511
  agentAccess?: boolean | undefined;
3473
3512
  };
@@ -29,6 +29,7 @@ export type WorkspaceInstructionPolicyRevisionIdentity = {
29
29
 
30
30
  export type WorkspaceInstructionPolicyRevision = WorkspaceInstructionPolicyRevisionIdentity &
31
31
  WorkspaceInstructionPolicyTarget & {
32
+ operationId: string;
32
33
  accountId: string;
33
34
  workspaceId: string;
34
35
  content: string;
@@ -52,6 +53,7 @@ export type WorkspaceInstructionPolicyHead = WorkspaceInstructionPolicyTarget &
52
53
 
53
54
  export type WorkspaceInstructionPolicyActivationEvent = WorkspaceInstructionPolicyTarget & {
54
55
  id: string;
56
+ operationId: string;
55
57
  accountId: string;
56
58
  workspaceId: string;
57
59
  type: WorkspaceInstructionPolicyActivationType;
@@ -64,6 +66,7 @@ export type WorkspaceInstructionPolicyActivationEvent = WorkspaceInstructionPoli
64
66
  };
65
67
 
66
68
  export type CreateWorkspaceInstructionPolicyDraftRequest = WorkspaceInstructionPolicyTarget & {
69
+ operationId?: string;
67
70
  content: string;
68
71
  provenanceSource?: WorkspaceInstructionPolicyDraftProvenanceSource;
69
72
  provenanceSourceId?: string | null;
@@ -71,6 +74,7 @@ export type CreateWorkspaceInstructionPolicyDraftRequest = WorkspaceInstructionP
71
74
  };
72
75
 
73
76
  export type ImportLegacyWorkspaceInstructionPolicyDraftRequest = {
77
+ operationId?: string;
74
78
  supersedesRevisionId?: string | null;
75
79
  };
76
80
 
@@ -102,13 +106,17 @@ export type WorkspaceInstructionPolicyDiffResponse = {
102
106
  };
103
107
 
104
108
  export type ActivateWorkspaceInstructionPolicyRequest = {
109
+ operationId?: string;
105
110
  expectedCurrentRevisionId: string | null;
111
+ expectedActivationVersion?: number;
106
112
  reason: string;
107
113
  };
108
114
 
109
115
  export type RollbackWorkspaceInstructionPolicyRequest = {
116
+ operationId?: string;
110
117
  targetRevisionId: string;
111
118
  expectedCurrentRevisionId: string;
119
+ expectedActivationVersion?: number;
112
120
  reason: string;
113
121
  };
114
122
 
@@ -122,3 +130,8 @@ export type WorkspaceInstructionPolicyConflictResponse = {
122
130
  message: string;
123
131
  currentHead: WorkspaceInstructionPolicyHead | null;
124
132
  };
133
+
134
+ export type WorkspaceInstructionPolicyOperationReuseResponse = {
135
+ code: "WORKSPACE_INSTRUCTION_POLICY_OPERATION_REUSED";
136
+ message: string;
137
+ };