@opengeni/contracts 0.36.0 → 0.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ import { z } from "zod";
2
+ export declare const ConnectorDocumentDestinationAuthority: z.ZodEnum<{
3
+ organization: "organization";
4
+ personal: "personal";
5
+ workspace: "workspace";
6
+ }>;
7
+ export type ConnectorDocumentDestinationAuthority = z.infer<typeof ConnectorDocumentDestinationAuthority>;
8
+ export declare const ConnectorDocumentDestinationSelection: z.ZodObject<{
9
+ authorityKind: z.ZodEnum<{
10
+ organization: "organization";
11
+ personal: "personal";
12
+ workspace: "workspace";
13
+ }>;
14
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
15
+ }, z.core.$strip>;
16
+ export type ConnectorDocumentDestinationSelection = z.infer<typeof ConnectorDocumentDestinationSelection>;
17
+ export declare const ConnectorDocumentDestination: z.ZodObject<{
18
+ authorityKind: z.ZodEnum<{
19
+ organization: "organization";
20
+ personal: "personal";
21
+ workspace: "workspace";
22
+ }>;
23
+ authorityAccountId: z.ZodString;
24
+ authorityWorkspaceId: z.ZodNullable<z.ZodString>;
25
+ authoritySubjectId: z.ZodNullable<z.ZodString>;
26
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
27
+ }, z.core.$strip>;
28
+ export type ConnectorDocumentDestination = z.infer<typeof ConnectorDocumentDestination>;
29
+ export declare function bindConnectorDocumentDestination(selection: ConnectorDocumentDestinationSelection, context: {
30
+ accountId: string;
31
+ workspaceId: string;
32
+ initiatingSubjectId: string;
33
+ }): ConnectorDocumentDestination;
34
+ export declare function legacyWorkspaceConnectorDocumentDestination(context: {
35
+ accountId: string;
36
+ workspaceId: string;
37
+ }): ConnectorDocumentDestination;
38
+ export declare function resolveConnectorDocumentDestination(value: unknown, context: {
39
+ accountId: string;
40
+ workspaceId: string;
41
+ connectionSubjectId?: string | null | undefined;
42
+ }): ConnectorDocumentDestination;
43
+ export declare function connectorDestinationDocumentAuthority(destination: ConnectorDocumentDestination): {
44
+ authorityKind: ConnectorDocumentDestinationAuthority;
45
+ authorityWorkspaceId: string | null;
46
+ authoritySubjectId: string | null;
47
+ };
48
+ export declare function connectorDocumentDestinationCollectionId(destination: ConnectorDocumentDestination, defaultCollectionId: string): string;
@@ -0,0 +1,21 @@
1
+ import {
2
+ ConnectorDocumentDestination,
3
+ ConnectorDocumentDestinationAuthority,
4
+ ConnectorDocumentDestinationSelection,
5
+ bindConnectorDocumentDestination,
6
+ connectorDestinationDocumentAuthority,
7
+ connectorDocumentDestinationCollectionId,
8
+ legacyWorkspaceConnectorDocumentDestination,
9
+ resolveConnectorDocumentDestination
10
+ } from "./chunk-WYBDERIY.js";
11
+ export {
12
+ ConnectorDocumentDestination,
13
+ ConnectorDocumentDestinationAuthority,
14
+ ConnectorDocumentDestinationSelection,
15
+ bindConnectorDocumentDestination,
16
+ connectorDestinationDocumentAuthority,
17
+ connectorDocumentDestinationCollectionId,
18
+ legacyWorkspaceConnectorDocumentDestination,
19
+ resolveConnectorDocumentDestination
20
+ };
21
+ //# sourceMappingURL=connector-destinations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -25,6 +25,7 @@ export type GoogleDriveOAuthScopeDecision = {
25
25
  */
26
26
  export declare function googleDriveOAuthScopeDecision(grantedScopes: readonly string[]): GoogleDriveOAuthScopeDecision;
27
27
  export declare function googleDriveScopesAllowCapability(grantedScopes: readonly string[], capability: GoogleDriveOAuthCapability): boolean;
28
+ /** @deprecated Connector document destinations use organization/workspace/personal authority. */
28
29
  export declare const GoogleDriveTargetScope: z.ZodEnum<{
29
30
  organization: "organization";
30
31
  user: "user";
@@ -88,11 +89,22 @@ export declare const GoogleDriveSelectedSource: z.ZodObject<{
88
89
  name: z.ZodString;
89
90
  mimeType: z.ZodString;
90
91
  driveId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
91
- targetScope: z.ZodEnum<{
92
+ destination: z.ZodOptional<z.ZodObject<{
93
+ authorityKind: z.ZodEnum<{
94
+ organization: "organization";
95
+ personal: "personal";
96
+ workspace: "workspace";
97
+ }>;
98
+ authorityAccountId: z.ZodString;
99
+ authorityWorkspaceId: z.ZodNullable<z.ZodString>;
100
+ authoritySubjectId: z.ZodNullable<z.ZodString>;
101
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
102
+ }, z.core.$strip>>;
103
+ targetScope: z.ZodOptional<z.ZodEnum<{
92
104
  organization: "organization";
93
105
  user: "user";
94
106
  workspace: "workspace";
95
- }>;
107
+ }>>;
96
108
  syncCadence: z.ZodDefault<z.ZodEnum<{
97
109
  daily: "daily";
98
110
  hourly: "hourly";
@@ -146,16 +158,38 @@ export declare const GoogleDriveConnectionMetadata: z.ZodObject<{
146
158
  recoverable: z.ZodLiteral<true>;
147
159
  observedAt: z.ZodString;
148
160
  }, z.core.$strip>], "state">>;
161
+ documentDestination: z.ZodOptional<z.ZodObject<{
162
+ authorityKind: z.ZodEnum<{
163
+ organization: "organization";
164
+ personal: "personal";
165
+ workspace: "workspace";
166
+ }>;
167
+ authorityAccountId: z.ZodString;
168
+ authorityWorkspaceId: z.ZodNullable<z.ZodString>;
169
+ authoritySubjectId: z.ZodNullable<z.ZodString>;
170
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
171
+ }, z.core.$strip>>;
149
172
  selectedSources: z.ZodOptional<z.ZodArray<z.ZodObject<{
150
173
  id: z.ZodString;
151
174
  name: z.ZodString;
152
175
  mimeType: z.ZodString;
153
176
  driveId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
154
- targetScope: z.ZodEnum<{
177
+ destination: z.ZodOptional<z.ZodObject<{
178
+ authorityKind: z.ZodEnum<{
179
+ organization: "organization";
180
+ personal: "personal";
181
+ workspace: "workspace";
182
+ }>;
183
+ authorityAccountId: z.ZodString;
184
+ authorityWorkspaceId: z.ZodNullable<z.ZodString>;
185
+ authoritySubjectId: z.ZodNullable<z.ZodString>;
186
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
187
+ }, z.core.$strip>>;
188
+ targetScope: z.ZodOptional<z.ZodEnum<{
155
189
  organization: "organization";
156
190
  user: "user";
157
191
  workspace: "workspace";
158
- }>;
192
+ }>>;
159
193
  syncCadence: z.ZodDefault<z.ZodEnum<{
160
194
  daily: "daily";
161
195
  hourly: "hourly";
@@ -173,11 +207,22 @@ export declare const GoogleDriveConnectionMetadata: z.ZodObject<{
173
207
  name: z.ZodString;
174
208
  mimeType: z.ZodString;
175
209
  driveId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
176
- targetScope: z.ZodEnum<{
210
+ destination: z.ZodOptional<z.ZodObject<{
211
+ authorityKind: z.ZodEnum<{
212
+ organization: "organization";
213
+ personal: "personal";
214
+ workspace: "workspace";
215
+ }>;
216
+ authorityAccountId: z.ZodString;
217
+ authorityWorkspaceId: z.ZodNullable<z.ZodString>;
218
+ authoritySubjectId: z.ZodNullable<z.ZodString>;
219
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
220
+ }, z.core.$strip>>;
221
+ targetScope: z.ZodOptional<z.ZodEnum<{
177
222
  organization: "organization";
178
223
  user: "user";
179
224
  workspace: "workspace";
180
- }>;
225
+ }>>;
181
226
  syncCadence: z.ZodDefault<z.ZodEnum<{
182
227
  daily: "daily";
183
228
  hourly: "hourly";
@@ -299,11 +344,19 @@ export declare const SaveGoogleDriveSourceRequest: z.ZodObject<{
299
344
  mimeType: z.ZodString;
300
345
  driveId: z.ZodNullable<z.ZodString>;
301
346
  }, z.core.$strip>>;
302
- targetScope: z.ZodEnum<{
347
+ destination: z.ZodOptional<z.ZodObject<{
348
+ authorityKind: z.ZodEnum<{
349
+ organization: "organization";
350
+ personal: "personal";
351
+ workspace: "workspace";
352
+ }>;
353
+ collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
354
+ }, z.core.$strip>>;
355
+ targetScope: z.ZodOptional<z.ZodEnum<{
303
356
  organization: "organization";
304
357
  user: "user";
305
358
  workspace: "workspace";
306
- }>;
359
+ }>>;
307
360
  syncCadence: z.ZodDefault<z.ZodEnum<{
308
361
  daily: "daily";
309
362
  hourly: "hourly";
@@ -1,6 +1,10 @@
1
1
  import {
2
2
  ConnectionMetadata
3
- } from "./chunk-F4KMLKSL.js";
3
+ } from "./chunk-XRNQOQ2K.js";
4
+ import {
5
+ ConnectorDocumentDestination,
6
+ ConnectorDocumentDestinationSelection
7
+ } from "./chunk-WYBDERIY.js";
4
8
  import "./chunk-7JZMI22I.js";
5
9
 
6
10
  // src/google-drive.ts
@@ -93,7 +97,9 @@ var GoogleDriveSelectedSource = z.object({
93
97
  name: z.string().min(1).max(1024),
94
98
  mimeType: z.string().min(1).max(256),
95
99
  driveId: z.string().min(1).max(256).nullable().default(null),
96
- targetScope: GoogleDriveTargetScope,
100
+ destination: ConnectorDocumentDestination.optional(),
101
+ /** @deprecated Missing destinations resolve to the current workspace boundary. */
102
+ targetScope: GoogleDriveTargetScope.optional(),
97
103
  syncCadence: GoogleDriveSyncCadence.default("hourly"),
98
104
  readPolicy: GoogleDriveReadPolicy.default("allow"),
99
105
  selectedAt: z.string().datetime({ offset: true })
@@ -107,6 +113,7 @@ var GoogleDriveConnectionMetadata = z.object({
107
113
  verifiedAt: z.string().datetime({ offset: true }),
108
114
  accessMode: z.enum(["metadata_readonly", "readonly"]),
109
115
  lifecycle: GoogleDriveConnectionLifecycle.optional(),
116
+ documentDestination: ConnectorDocumentDestination.optional(),
110
117
  selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),
111
118
  /** @deprecated Read `selectedSources`; retained while existing connections migrate. */
112
119
  selectedSource: GoogleDriveSelectedSource.nullable().optional()
@@ -155,9 +162,13 @@ var SaveGoogleDriveSourceRequest = z.object({
155
162
  ).max(100).refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {
156
163
  message: "Google Drive sources must be unique"
157
164
  }),
158
- targetScope: GoogleDriveTargetScope,
165
+ destination: ConnectorDocumentDestinationSelection.optional(),
166
+ /** @deprecated Legacy requests are accepted but resolve to workspace authority. */
167
+ targetScope: GoogleDriveTargetScope.optional(),
159
168
  syncCadence: GoogleDriveSyncCadence.default("hourly"),
160
169
  readPolicy: GoogleDriveReadPolicy.default("allow")
170
+ }).refine((request) => request.destination !== void 0 || request.targetScope !== void 0, {
171
+ message: "Google Drive document destination is required"
161
172
  });
162
173
  export {
163
174
  GOOGLE_DRIVE_CREDENTIAL_LABEL,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/google-drive.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n targetScope: GoogleDriveTargetScope,\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nexport const SaveGoogleDriveSourceRequest = z.object({\n sources: z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n }),\n targetScope: GoogleDriveTargetScope,\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n});\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n"],"mappings":";;;;;;AAAA,SAAS,SAAS;AAIX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AACK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AAEtC,IAAM,6BAA6B,EAAE,KAAK;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAcM,SAAS,8BACd,eAC+B;AAC/B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,eAAe,QAAQ,IAAI,uBAAuB;AACxD,QAAM,uBAAuB,gBAAgB,QAAQ,IAAI,2BAA2B;AACpF,QAAM,6BACJ,wBAAwB,QAAQ,IAAI,oCAAoC;AAC1E,QAAM,oBAAoB,wBAAwB,QAAQ,IAAI,uBAAuB;AACrF,QAAM,eAA6C,CAAC;AACpD,MAAI,kBAAmB,cAAa,KAAK,kBAAkB;AAC3D,MAAI,2BAA4B,cAAa,KAAK,2BAA2B;AAC7E,MAAI,sBAAsB;AACxB,iBAAa,KAAK,uBAAuB,uBAAuB;AAAA,EAClE;AACA,SAAO;AA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E,SAAS;AAAA,EAC7D,MAAM,EAAE,OAAO,EAAE,MAAM,OAAO,EAAE,SAAS;AAAA,EACzC,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACzC,CAAC;AAGM,IAAM,4BAA4B,EAAE,OAAO;AAAA,EAChD,YAAY,EAAE,KAAK,MAAM,kBAAkB;AAAA,EAC3C,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACnC,SAAS,sBAAsB,SAAS;AAAA,EACxC,OAAO,EAAE,MAAM,qBAAqB;AAAA,EACpC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AAAA,EACpD,kBAAkB,EAAE,QAAQ;AAC9B,CAAC;AAGM,IAAM,+BAA+B,EAAE,OAAO;AAAA,EACnD,SAAS,EACN;AAAA,IACC,sBAAsB,KAAK;AAAA,MACzB,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACX,CAAC;AAAA,EACH,EACC,IAAI,GAAG,EACP,OAAO,CAAC,YAAY,IAAI,IAAI,QAAQ,IAAI,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,SAAS,QAAQ,QAAQ;AAAA,IACxF,SAAS;AAAA,EACX,CAAC;AAAA,EACH,aAAa;AAAA,EACb,aAAa,uBAAuB,QAAQ,QAAQ;AAAA,EACpD,YAAY,sBAAsB,QAAQ,OAAO;AACnD,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/google-drive.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\nimport {\n ConnectorDocumentDestination,\n ConnectorDocumentDestinationSelection,\n} from \"./connector-destinations\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\n/** @deprecated Connector document destinations use organization/workspace/personal authority. */\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n destination: ConnectorDocumentDestination.optional(),\n /** @deprecated Missing destinations resolve to the current workspace boundary. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n documentDestination: ConnectorDocumentDestination.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n }),\n destination: ConnectorDocumentDestinationSelection.optional(),\n /** @deprecated Legacy requests are accepted but resolve to workspace authority. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n })\n .refine((request) => request.destination !== undefined || request.targetScope !== undefined, {\n message: \"Google Drive document destination is required\",\n });\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n"],"mappings":";;;;;;;;;;AAAA,SAAS,SAAS;AAQX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AACK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AAEtC,IAAM,6BAA6B,EAAE,KAAK;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAcM,SAAS,8BACd,eAC+B;AAC/B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,eAAe,QAAQ,IAAI,uBAAuB;AACxD,QAAM,uBAAuB,gBAAgB,QAAQ,IAAI,2BAA2B;AACpF,QAAM,6BACJ,wBAAwB,QAAQ,IAAI,oCAAoC;AAC1E,QAAM,oBAAoB,wBAAwB,QAAQ,IAAI,uBAAuB;AACrF,QAAM,eAA6C,CAAC;AACpD,MAAI,kBAAmB,cAAa,KAAK,kBAAkB;AAC3D,MAAI,2BAA4B,cAAa,KAAK,2BAA2B;AAC7E,MAAI,sBAAsB;AACxB,iBAAa,KAAK,uBAAuB,uBAAuB;AAAA,EAClE;AACA,SAAO;AAAA,IACL,YAAY,uBACR,aACA,6BACE,sBACA;AAAA,IACN;AAAA,EACF;AACF;AAEO,SAAS,iCACd,eACA,YACS;AACT,SAAO,8BAA8B,aAAa,EAAE,aAAa,SAAS,UAAU;AACtF;AAGO,IAAM,yBAAyB,EAAE,KAAK,CAAC,QAAQ,aAAa,cAAc,CAAC;AAG3E,IAAM,yBAAyB,EAAE,KAAK,CAAC,UAAU,UAAU,OAAO,CAAC;AAGnE,IAAM,wBAAwB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M,kBAAkB;AAAA,EAC3C,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EACnC,SAAS,sBAAsB,SAAS;AAAA,EACxC,OAAO,EAAE,MAAM,qBAAqB;AAAA,EACpC,eAAe,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AAAA,EACpD,kBAAkB,EAAE,QAAQ;AAC9B,CAAC;AAGM,IAAM,+BAA+B,EACzC,OAAO;AAAA,EACN,SAAS,EACN;AAAA,IACC,sBAAsB,KAAK;AAAA,MACzB,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,MACV,SAAS;AAAA,IACX,CAAC;AAAA,EACH,EACC,IAAI,GAAG,EACP,OAAO,CAAC,YAAY,IAAI,IAAI,QAAQ,IAAI,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,SAAS,QAAQ,QAAQ;AAAA,IACxF,SAAS;AAAA,EACX,CAAC;AAAA,EACH,aAAa,sCAAsC,SAAS;AAAA;AAAA,EAE5D,aAAa,uBAAuB,SAAS;AAAA,EAC7C,aAAa,uBAAuB,QAAQ,QAAQ;AAAA,EACpD,YAAY,sBAAsB,QAAQ,OAAO;AACnD,CAAC,EACA,OAAO,CAAC,YAAY,QAAQ,gBAAgB,UAAa,QAAQ,gBAAgB,QAAW;AAAA,EAC3F,SAAS;AACX,CAAC;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { type SessionEventBoundarySurface } from "./event-preview";
3
3
  export * from "./slack-bot-scopes";
4
+ export * from "./connector-destinations";
4
5
  export { CreateWorkspaceArtifactRequest, PublishWorkspaceArtifactVersionRequest, RollbackWorkspaceArtifactRequest, WorkspaceArtifact, WorkspaceArtifactContentResponse, WorkspaceArtifactDetailResponse, WorkspaceArtifactEvent, WorkspaceArtifactEventType, WorkspaceArtifactHtml, WorkspaceArtifactListQuery, WorkspaceArtifactListResponse, WorkspaceArtifactMutationResponse, WorkspaceArtifactSlug, WorkspaceArtifactStatus, WorkspaceArtifactVersion, WORKSPACE_ARTIFACT_CURSOR_MAX_CHARS, WORKSPACE_ARTIFACT_DESCRIPTION_MAX_CHARS, WORKSPACE_ARTIFACT_HTML_MAX_UTF8_BYTES, WORKSPACE_ARTIFACT_LIST_DEFAULT, WORKSPACE_ARTIFACT_LIST_MAX, WORKSPACE_ARTIFACT_TITLE_MAX_CHARS, normalizeWorkspaceArtifactSlug, } from "./artifacts";
5
6
  export { SESSION_EVENT_PAYLOAD_MAX_BYTES, approximateSessionEventTokens, boundSessionEventPayload, measureSessionEventJson, sessionEventJsonBytes, sessionEventMediaPreview, sessionEventMediaPreviewFromDataUrl, sessionEventPayloadTruncation, type BoundSessionEventPayloadOptions, type SessionEventBoundarySurface, type SessionEventMediaPreview, type SessionEventJsonMeasurement, type SessionEventPayloadTruncation, } from "./event-preview";
6
7
  export { RETAINED_OUTPUT_DEFAULT_PAGE_BYTES, RETAINED_OUTPUT_MAX_PAGE_BYTES, RETAINED_OUTPUT_RECEIPT_MAX_BYTES, RetainedArtifactMetadataSchema, RetainedArtifactReferenceSchema, RetainedArtifactUnavailableSchema, RetainedOutputEvidenceSchema, RetainedOutputKind, RetainedOutputUnavailableReason, retainedArtifactReferenceFromFile, retainedOutputUnavailable, resolveRetainedOutputRange, validateRetainedOutputEvidence, type RetainedArtifactFileInput, type RetainedArtifactMetadata, type RetainedArtifactReference, type RetainedArtifactUnavailable, type RetainedOutputAvailableEvidence, type RetainedOutputEvidence, type RetainedOutputRangeResolution, type RetainedOutputResolvedRange, } from "./retained-output";
@@ -693,7 +694,7 @@ export declare const TranscribeAudioResponse: z.ZodObject<{
693
694
  languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
694
695
  }, z.core.$strict>;
695
696
  export type TranscribeAudioResponse = z.infer<typeof TranscribeAudioResponse>;
696
- /** Default ceilings for native voice input (hard-stop recording + upload). */
697
+ /** Default safety ceiling for one-shot native voice input (60 seconds). */
697
698
  export declare const VOICE_INPUT_MAX_DURATION_SECONDS: 60;
698
699
  export declare const VOICE_INPUT_MAX_SIZE_BYTES: number;
699
700
  export declare const VOICE_INPUT_ACCEPTED_MIME_TYPES: readonly ["audio/webm", "audio/webm;codecs=opus", "audio/mp4", "audio/ogg", "audio/ogg;codecs=opus", "audio/mpeg", "audio/wav", "audio/x-wav", "audio/mp3", "audio/m4a"];
@@ -8178,6 +8179,7 @@ export declare const Session: z.ZodObject<{
8178
8179
  sandboxGroupId: z.ZodString;
8179
8180
  activeSandboxId: z.ZodNullable<z.ZodString>;
8180
8181
  activeEpoch: z.ZodNumber;
8182
+ workingDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8181
8183
  variableSetId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8182
8184
  environmentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8183
8185
  rigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -8588,6 +8590,7 @@ export declare const CreateSessionResponse: z.ZodObject<{
8588
8590
  sandboxGroupId: z.ZodString;
8589
8591
  activeSandboxId: z.ZodNullable<z.ZodString>;
8590
8592
  activeEpoch: z.ZodNumber;
8593
+ workingDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8591
8594
  variableSetId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8592
8595
  environmentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
8593
8596
  rigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -9004,6 +9007,7 @@ export declare const SessionListResponse: z.ZodObject<{
9004
9007
  sandboxGroupId: z.ZodString;
9005
9008
  activeSandboxId: z.ZodNullable<z.ZodString>;
9006
9009
  activeEpoch: z.ZodNumber;
9010
+ workingDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9007
9011
  variableSetId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9008
9012
  environmentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9009
9013
  rigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -9409,6 +9413,7 @@ export declare const SessionListResponse: z.ZodObject<{
9409
9413
  sandboxGroupId: z.ZodString;
9410
9414
  activeSandboxId: z.ZodNullable<z.ZodString>;
9411
9415
  activeEpoch: z.ZodNumber;
9416
+ workingDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9412
9417
  variableSetId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9413
9418
  environmentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9414
9419
  rigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -9822,6 +9827,7 @@ export declare const SessionLineageResponse: z.ZodObject<{
9822
9827
  sandboxGroupId: z.ZodString;
9823
9828
  activeSandboxId: z.ZodNullable<z.ZodString>;
9824
9829
  activeEpoch: z.ZodNumber;
9830
+ workingDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9825
9831
  variableSetId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9826
9832
  environmentId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
9827
9833
  rigId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -14358,6 +14364,7 @@ export type ModelPricingScheduleV1 = z.infer<typeof ModelPricingScheduleV1>;
14358
14364
  export declare const ClientModel: z.ZodObject<{
14359
14365
  id: z.ZodString;
14360
14366
  label: z.ZodString;
14367
+ shortLabel: z.ZodOptional<z.ZodString>;
14361
14368
  provider: z.ZodString;
14362
14369
  providerLabel: z.ZodString;
14363
14370
  api: z.ZodEnum<{
@@ -14608,6 +14615,7 @@ export type ModelAvailabilityV1 = z.infer<typeof ModelAvailabilityV1>;
14608
14615
  export declare const WorkspaceModelCatalogModel: z.ZodObject<{
14609
14616
  id: z.ZodString;
14610
14617
  label: z.ZodString;
14618
+ shortLabel: z.ZodOptional<z.ZodString>;
14611
14619
  provider: z.ZodString;
14612
14620
  providerLabel: z.ZodString;
14613
14621
  api: z.ZodEnum<{
@@ -14857,6 +14865,7 @@ export declare const WorkspaceModelCatalogResponse: z.ZodObject<{
14857
14865
  models: z.ZodArray<z.ZodObject<{
14858
14866
  id: z.ZodString;
14859
14867
  label: z.ZodString;
14868
+ shortLabel: z.ZodOptional<z.ZodString>;
14860
14869
  provider: z.ZodString;
14861
14870
  providerLabel: z.ZodString;
14862
14871
  api: z.ZodEnum<{
@@ -15124,6 +15133,7 @@ export declare const ClientConfig: z.ZodObject<{
15124
15133
  models: z.ZodDefault<z.ZodArray<z.ZodObject<{
15125
15134
  id: z.ZodString;
15126
15135
  label: z.ZodString;
15136
+ shortLabel: z.ZodOptional<z.ZodString>;
15127
15137
  provider: z.ZodString;
15128
15138
  providerLabel: z.ZodString;
15129
15139
  api: z.ZodEnum<{
package/dist/index.js CHANGED
@@ -579,6 +579,7 @@ import {
579
579
  WORKSPACE_INSTRUCTION_POLICY_ROLE_KEY_MAX_CHARS,
580
580
  WORKSPACE_INSTRUCTION_POLICY_SOURCE_ID_MAX_CHARS,
581
581
  WORKSPACE_STATE_BASE_NAME_MAX_CHARS,
582
+ WORKSPACE_STATE_EXPORT_SCHEMA_VERSION,
582
583
  WORKSPACE_STATE_MAX_ACTIVE_POLICY_HEADS,
583
584
  WORKSPACE_STATE_MAX_BASES,
584
585
  WORKSPACE_STATE_MAX_GAPS,
@@ -660,7 +661,10 @@ import {
660
661
  WorkspaceSlackReactionChannelPolicy,
661
662
  WorkspaceSlackReactionSummonSettings,
662
663
  WorkspaceStateAttemptGovernance,
664
+ WorkspaceStateDocumentAuthorityKindCounts,
663
665
  WorkspaceStateDocumentStatusCounts,
666
+ WorkspaceStateExportOmission,
667
+ WorkspaceStateExportResponse,
664
668
  WorkspaceStateGap,
665
669
  WorkspaceStateGapCode,
666
670
  WorkspaceStateGovernanceDriftStatus,
@@ -673,6 +677,7 @@ import {
673
677
  WorkspaceStatePolicy,
674
678
  WorkspaceStatePolicyHead,
675
679
  WorkspaceStatePolicyRevisionSummary,
680
+ WorkspaceStatePreferences,
676
681
  WorkspaceStateQuery,
677
682
  WorkspaceStateResponse,
678
683
  WorkspaceStateSourceKindCounts,
@@ -760,7 +765,17 @@ import {
760
765
  verifyStreamToken,
761
766
  workspaceControlUtf8Bytes,
762
767
  workspaceSlackReactionChannelAllowed
763
- } from "./chunk-F4KMLKSL.js";
768
+ } from "./chunk-XRNQOQ2K.js";
769
+ import {
770
+ ConnectorDocumentDestination,
771
+ ConnectorDocumentDestinationAuthority,
772
+ ConnectorDocumentDestinationSelection,
773
+ bindConnectorDocumentDestination,
774
+ connectorDestinationDocumentAuthority,
775
+ connectorDocumentDestinationCollectionId,
776
+ legacyWorkspaceConnectorDocumentDestination,
777
+ resolveConnectorDocumentDestination
778
+ } from "./chunk-WYBDERIY.js";
764
779
  import {
765
780
  OPENGENI_MANAGED_PUBLIC_BASE_URL,
766
781
  OPENGENI_SLACK_BOT_EVENTS,
@@ -838,6 +853,9 @@ export {
838
853
  ConnectionOwnership,
839
854
  ConnectionResponse,
840
855
  ConnectionStatus,
856
+ ConnectorDocumentDestination,
857
+ ConnectorDocumentDestinationAuthority,
858
+ ConnectorDocumentDestinationSelection,
841
859
  CorrectPreferenceRegistryRequest,
842
860
  CreateApiKeyRequest,
843
861
  CreateApiKeyResponse,
@@ -1362,6 +1380,7 @@ export {
1362
1380
  WORKSPACE_INSTRUCTION_POLICY_ROLE_KEY_MAX_CHARS,
1363
1381
  WORKSPACE_INSTRUCTION_POLICY_SOURCE_ID_MAX_CHARS,
1364
1382
  WORKSPACE_STATE_BASE_NAME_MAX_CHARS,
1383
+ WORKSPACE_STATE_EXPORT_SCHEMA_VERSION,
1365
1384
  WORKSPACE_STATE_MAX_ACTIVE_POLICY_HEADS,
1366
1385
  WORKSPACE_STATE_MAX_BASES,
1367
1386
  WORKSPACE_STATE_MAX_GAPS,
@@ -1443,7 +1462,10 @@ export {
1443
1462
  WorkspaceSlackReactionChannelPolicy,
1444
1463
  WorkspaceSlackReactionSummonSettings,
1445
1464
  WorkspaceStateAttemptGovernance,
1465
+ WorkspaceStateDocumentAuthorityKindCounts,
1446
1466
  WorkspaceStateDocumentStatusCounts,
1467
+ WorkspaceStateExportOmission,
1468
+ WorkspaceStateExportResponse,
1447
1469
  WorkspaceStateGap,
1448
1470
  WorkspaceStateGapCode,
1449
1471
  WorkspaceStateGovernanceDriftStatus,
@@ -1456,6 +1478,7 @@ export {
1456
1478
  WorkspaceStatePolicy,
1457
1479
  WorkspaceStatePolicyHead,
1458
1480
  WorkspaceStatePolicyRevisionSummary,
1481
+ WorkspaceStatePreferences,
1459
1482
  WorkspaceStateQuery,
1460
1483
  WorkspaceStateResponse,
1461
1484
  WorkspaceStateSourceKindCounts,
@@ -1468,6 +1491,7 @@ export {
1468
1491
  areOpenGeniSlackBotScopesAccepted,
1469
1492
  assertUniqueResourceMountPaths,
1470
1493
  backendForNativeSnapshotProvider,
1494
+ bindConnectorDocumentDestination,
1471
1495
  boundSessionEvent,
1472
1496
  boundSessionEventPayload,
1473
1497
  boundWorkspaceControlEvent,
@@ -1478,6 +1502,8 @@ export {
1478
1502
  compactSessionEventResult,
1479
1503
  compareCodexFleetCanonicalStringsV1,
1480
1504
  comparePersonalSlackCanonicalConnections,
1505
+ connectorDestinationDocumentAuthority,
1506
+ connectorDocumentDestinationCollectionId,
1481
1507
  createCodexFleetReplayRecordV1,
1482
1508
  createSecretRedactor,
1483
1509
  decodeNativeSnapshotRef,
@@ -1494,6 +1520,7 @@ export {
1494
1520
  isCredentialHeaderName,
1495
1521
  isSensitiveFieldName,
1496
1522
  latencyModeForMetadata,
1523
+ legacyWorkspaceConnectorDocumentDestination,
1497
1524
  measureSessionEventJson,
1498
1525
  mergeResourceRefs,
1499
1526
  mergeToolRefs,
@@ -1514,6 +1541,7 @@ export {
1514
1541
  redactSerializedJson,
1515
1542
  renderSessionSystemUpdateBatch,
1516
1543
  replayCodexFleetDecisionV1,
1544
+ resolveConnectorDocumentDestination,
1517
1545
  resolveRetainedOutputRange,
1518
1546
  resolveSessionEventTypeFilters,
1519
1547
  resolveWorkspaceCodexCompactionDefault,