@opengeni/contracts 0.39.0 → 0.44.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.
- package/dist/atlassian.d.ts +278 -0
- package/dist/atlassian.js +55 -0
- package/dist/atlassian.js.map +1 -0
- package/dist/chunk-52SGB2QO.js +688 -0
- package/dist/chunk-52SGB2QO.js.map +1 -0
- package/dist/{chunk-7JZMI22I.js → chunk-5UDNP7AO.js} +34 -2
- package/dist/chunk-5UDNP7AO.js.map +1 -0
- package/dist/chunk-BVGIYW7D.js +11 -0
- package/dist/chunk-BVGIYW7D.js.map +1 -0
- package/dist/chunk-CADSX6UN.js +1145 -0
- package/dist/chunk-CADSX6UN.js.map +1 -0
- package/dist/chunk-D2HKF2EF.js +1460 -0
- package/dist/chunk-D2HKF2EF.js.map +1 -0
- package/dist/chunk-FJBG5E4O.js +194 -0
- package/dist/chunk-FJBG5E4O.js.map +1 -0
- package/dist/chunk-H5BVCZKF.js +382 -0
- package/dist/chunk-H5BVCZKF.js.map +1 -0
- package/dist/chunk-LSB7GRLG.js +779 -0
- package/dist/chunk-LSB7GRLG.js.map +1 -0
- package/dist/chunk-MYBZRDTY.js +340 -0
- package/dist/chunk-MYBZRDTY.js.map +1 -0
- package/dist/chunk-RIY7GYQS.js +1204 -0
- package/dist/chunk-RIY7GYQS.js.map +1 -0
- package/dist/chunk-TZ6YEYN4.js +386 -0
- package/dist/chunk-TZ6YEYN4.js.map +1 -0
- package/dist/chunk-VA22KRHS.js +15177 -0
- package/dist/chunk-VA22KRHS.js.map +1 -0
- package/dist/chunk-Y3MLSLB4.js +392 -0
- package/dist/chunk-Y3MLSLB4.js.map +1 -0
- package/dist/chunk-YRKRZ6OF.js +134 -0
- package/dist/chunk-YRKRZ6OF.js.map +1 -0
- package/dist/company-profile.d.ts +629 -0
- package/dist/document-artifact-commands.d.ts +282 -0
- package/dist/document-artifact-commands.js +54 -0
- package/dist/document-artifact-commands.js.map +1 -0
- package/dist/document-artifact-query.d.ts +2 -0
- package/dist/document-artifact-query.js +54 -0
- package/dist/document-artifact-query.js.map +1 -0
- package/dist/editable-artifact-binary.d.ts +56 -0
- package/dist/editable-artifact-causal-frontier.d.ts +12 -0
- package/dist/editable-artifact-causal-frontier.js +18 -0
- package/dist/editable-artifact-causal-frontier.js.map +1 -0
- package/dist/editable-artifact-codec-registry.d.ts +48 -0
- package/dist/editable-artifact-codec-registry.js +20 -0
- package/dist/editable-artifact-codec-registry.js.map +1 -0
- package/dist/editable-artifact-committed-transaction.d.ts +35 -0
- package/dist/editable-artifact-committed-transaction.js +19 -0
- package/dist/editable-artifact-committed-transaction.js.map +1 -0
- package/dist/editable-artifact-live.d.ts +276 -0
- package/dist/editable-artifact-live.js +907 -0
- package/dist/editable-artifact-live.js.map +1 -0
- package/dist/editable-artifact-serialized-commit.d.ts +53 -0
- package/dist/editable-artifact-serialized-commit.js +26 -0
- package/dist/editable-artifact-serialized-commit.js.map +1 -0
- package/dist/editable-artifact-versions.d.ts +6 -0
- package/dist/editable-artifact-versions.js +11 -0
- package/dist/editable-artifact-versions.js.map +1 -0
- package/dist/editable-artifacts.d.ts +46 -0
- package/dist/editable-artifacts.js +236 -0
- package/dist/editable-artifacts.js.map +1 -0
- package/dist/event-preview.d.ts +7 -7
- package/dist/google-drive.d.ts +114 -2
- package/dist/google-drive.js +70 -14
- package/dist/google-drive.js.map +1 -1
- package/dist/image-generation.d.ts +70 -0
- package/dist/index.d.ts +5180 -329
- package/dist/index.js +1173 -40
- package/dist/interaction.d.ts +6895 -0
- package/dist/mcp-receipts.d.ts +96 -0
- package/dist/memory-slack-delivery.d.ts +397 -0
- package/dist/presentation-artifact-commands.d.ts +349 -0
- package/dist/presentation-artifact-commands.js +66 -0
- package/dist/presentation-artifact-commands.js.map +1 -0
- package/dist/presentation-artifact-query.d.ts +2 -0
- package/dist/presentation-artifact-query.js +66 -0
- package/dist/presentation-artifact-query.js.map +1 -0
- package/dist/retained-output.d.ts +83 -6
- package/dist/sandbox-snapshots.d.ts +9 -0
- package/dist/scoped-knowledge.d.ts +14 -13
- package/dist/slack-bot-scopes.d.ts +4 -0
- package/dist/slack-bot-scopes.js +3 -1
- package/dist/spreadsheet-artifact-commands.d.ts +101 -0
- package/dist/spreadsheet-artifact-commands.js +27 -0
- package/dist/spreadsheet-artifact-commands.js.map +1 -0
- package/dist/spreadsheet-artifact-date.d.ts +4 -0
- package/dist/spreadsheet-artifact-query.d.ts +120 -0
- package/dist/spreadsheet-artifact-query.js +48 -0
- package/dist/spreadsheet-artifact-query.js.map +1 -0
- package/dist/tool-catalog.d.ts +576 -0
- package/dist/video-generation.d.ts +532 -0
- package/dist/video-generation.js +51 -0
- package/dist/video-generation.js.map +1 -0
- package/dist/workspace-learning-policy.d.ts +208 -0
- package/package.json +61 -1
- package/src/atlassian.ts +160 -0
- package/src/company-profile.ts +306 -0
- package/src/document-artifact-commands.ts +1709 -0
- package/src/document-artifact-query.ts +2 -0
- package/src/editable-artifact-binary.ts +396 -0
- package/src/editable-artifact-causal-frontier.ts +154 -0
- package/src/editable-artifact-codec-registry.ts +261 -0
- package/src/editable-artifact-committed-transaction.ts +478 -0
- package/src/editable-artifact-live.ts +1379 -0
- package/src/editable-artifact-serialized-commit.ts +494 -0
- package/src/editable-artifact-versions.ts +8 -0
- package/src/editable-artifacts.ts +473 -0
- package/src/event-preview.ts +6 -6
- package/src/google-drive.ts +68 -15
- package/src/image-generation.ts +106 -0
- package/src/index.ts +2535 -282
- package/src/interaction.ts +2292 -0
- package/src/mcp-receipts.ts +281 -0
- package/src/memory-slack-delivery.ts +183 -0
- package/src/presentation-artifact-commands.ts +2035 -0
- package/src/presentation-artifact-query.ts +2 -0
- package/src/retained-output.ts +248 -8
- package/src/sandbox-snapshots.ts +28 -1
- package/src/scoped-knowledge.ts +18 -4
- package/src/slack-bot-scopes.ts +34 -1
- package/src/spreadsheet-artifact-commands.ts +999 -0
- package/src/spreadsheet-artifact-date.ts +21 -0
- package/src/spreadsheet-artifact-query.ts +1411 -0
- package/src/tool-catalog.ts +334 -0
- package/src/video-generation.ts +394 -0
- package/src/workspace-learning-policy.ts +233 -0
- package/dist/chunk-7JZMI22I.js.map +0 -1
- package/dist/chunk-PCTCJEAF.js +0 -10799
- package/dist/chunk-PCTCJEAF.js.map +0 -1
- package/dist/secret-redaction.d.ts +0 -40
- package/src/secret-redaction.ts +0 -364
package/dist/google-drive.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ export declare const GOOGLE_DRIVE_FULL_SCOPE: "https://www.googleapis.com/auth/d
|
|
|
4
4
|
export declare const GOOGLE_DRIVE_FILE_SCOPE: "https://www.googleapis.com/auth/drive.file";
|
|
5
5
|
export declare const GOOGLE_DRIVE_METADATA_READONLY_SCOPE: "https://www.googleapis.com/auth/drive.metadata.readonly";
|
|
6
6
|
export declare const GOOGLE_DRIVE_READONLY_SCOPE: "https://www.googleapis.com/auth/drive.readonly";
|
|
7
|
+
/** Stable serialized role retained for existing connection rows; not product-facing copy. */
|
|
7
8
|
export declare const GOOGLE_DRIVE_CREDENTIAL_ROLE: "google_drive_metadata";
|
|
8
|
-
export declare const GOOGLE_DRIVE_CREDENTIAL_LABEL: "Google Drive
|
|
9
|
+
export declare const GOOGLE_DRIVE_CREDENTIAL_LABEL: "Google Drive read-only source sync";
|
|
10
|
+
export declare const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL: "Google Drive metadata browser";
|
|
9
11
|
export declare const GoogleDriveOAuthCapability: z.ZodEnum<{
|
|
10
12
|
picker_file_read: "picker_file_read";
|
|
11
13
|
recursive_source_sync: "recursive_source_sync";
|
|
@@ -110,6 +112,8 @@ export declare const GoogleDriveSelectedSource: z.ZodObject<{
|
|
|
110
112
|
hourly: "hourly";
|
|
111
113
|
manual: "manual";
|
|
112
114
|
}>>;
|
|
115
|
+
syncEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
+
configGeneration: z.ZodDefault<z.ZodNumber>;
|
|
113
117
|
readPolicy: z.ZodDefault<z.ZodEnum<{
|
|
114
118
|
allow: "allow";
|
|
115
119
|
ask: "ask";
|
|
@@ -120,7 +124,7 @@ export declare const GoogleDriveSelectedSource: z.ZodObject<{
|
|
|
120
124
|
export type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;
|
|
121
125
|
export declare const GoogleDriveConnectionMetadata: z.ZodObject<{
|
|
122
126
|
credentialRole: z.ZodLiteral<"google_drive_metadata">;
|
|
123
|
-
credentialLabel: z.ZodLiteral<"Google Drive metadata browser">;
|
|
127
|
+
credentialLabel: z.ZodUnion<readonly [z.ZodLiteral<"Google Drive read-only source sync">, z.ZodLiteral<"Google Drive metadata browser">]>;
|
|
124
128
|
googlePermissionId: z.ZodString;
|
|
125
129
|
googleEmail: z.ZodString;
|
|
126
130
|
googleDisplayName: z.ZodNullable<z.ZodString>;
|
|
@@ -195,6 +199,8 @@ export declare const GoogleDriveConnectionMetadata: z.ZodObject<{
|
|
|
195
199
|
hourly: "hourly";
|
|
196
200
|
manual: "manual";
|
|
197
201
|
}>>;
|
|
202
|
+
syncEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
203
|
+
configGeneration: z.ZodDefault<z.ZodNumber>;
|
|
198
204
|
readPolicy: z.ZodDefault<z.ZodEnum<{
|
|
199
205
|
allow: "allow";
|
|
200
206
|
ask: "ask";
|
|
@@ -228,6 +234,8 @@ export declare const GoogleDriveConnectionMetadata: z.ZodObject<{
|
|
|
228
234
|
hourly: "hourly";
|
|
229
235
|
manual: "manual";
|
|
230
236
|
}>>;
|
|
237
|
+
syncEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
238
|
+
configGeneration: z.ZodDefault<z.ZodNumber>;
|
|
231
239
|
readPolicy: z.ZodDefault<z.ZodEnum<{
|
|
232
240
|
allow: "allow";
|
|
233
241
|
ask: "ask";
|
|
@@ -362,6 +370,7 @@ export declare const SaveGoogleDriveSourceRequest: z.ZodObject<{
|
|
|
362
370
|
hourly: "hourly";
|
|
363
371
|
manual: "manual";
|
|
364
372
|
}>>;
|
|
373
|
+
syncEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
365
374
|
readPolicy: z.ZodDefault<z.ZodEnum<{
|
|
366
375
|
allow: "allow";
|
|
367
376
|
ask: "ask";
|
|
@@ -369,3 +378,106 @@ export declare const SaveGoogleDriveSourceRequest: z.ZodObject<{
|
|
|
369
378
|
}>>;
|
|
370
379
|
}, z.core.$strip>;
|
|
371
380
|
export type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;
|
|
381
|
+
export declare const GoogleDriveKnowledgeSourceItem: z.ZodObject<{
|
|
382
|
+
id: z.ZodString;
|
|
383
|
+
name: z.ZodString;
|
|
384
|
+
mimeType: z.ZodString;
|
|
385
|
+
driveId: z.ZodOptional<z.ZodString>;
|
|
386
|
+
sourceKind: z.ZodEnum<{
|
|
387
|
+
folder: "folder";
|
|
388
|
+
my_drive: "my_drive";
|
|
389
|
+
shared_drive: "shared_drive";
|
|
390
|
+
}>;
|
|
391
|
+
includeDescendants: z.ZodBoolean;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
export type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;
|
|
394
|
+
export declare const GoogleDriveKnowledgeSourceDestination: z.ZodObject<{
|
|
395
|
+
authorityKind: z.ZodEnum<{
|
|
396
|
+
organization: "organization";
|
|
397
|
+
personal: "personal";
|
|
398
|
+
workspace: "workspace";
|
|
399
|
+
}>;
|
|
400
|
+
authorityAccountId: z.ZodString;
|
|
401
|
+
authorityWorkspaceId: z.ZodOptional<z.ZodString>;
|
|
402
|
+
authoritySubjectId: z.ZodOptional<z.ZodString>;
|
|
403
|
+
collectionId: z.ZodOptional<z.ZodString>;
|
|
404
|
+
}, z.core.$strip>;
|
|
405
|
+
export type GoogleDriveKnowledgeSourceDestination = z.infer<typeof GoogleDriveKnowledgeSourceDestination>;
|
|
406
|
+
export declare const GoogleDriveKnowledgeSourceConfig: z.ZodObject<{
|
|
407
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
408
|
+
id: z.ZodString;
|
|
409
|
+
name: z.ZodString;
|
|
410
|
+
mimeType: z.ZodString;
|
|
411
|
+
driveId: z.ZodOptional<z.ZodString>;
|
|
412
|
+
sourceKind: z.ZodEnum<{
|
|
413
|
+
folder: "folder";
|
|
414
|
+
my_drive: "my_drive";
|
|
415
|
+
shared_drive: "shared_drive";
|
|
416
|
+
}>;
|
|
417
|
+
includeDescendants: z.ZodBoolean;
|
|
418
|
+
}, z.core.$strip>>;
|
|
419
|
+
destination: z.ZodObject<{
|
|
420
|
+
authorityKind: z.ZodEnum<{
|
|
421
|
+
organization: "organization";
|
|
422
|
+
personal: "personal";
|
|
423
|
+
workspace: "workspace";
|
|
424
|
+
}>;
|
|
425
|
+
authorityAccountId: z.ZodString;
|
|
426
|
+
authorityWorkspaceId: z.ZodOptional<z.ZodString>;
|
|
427
|
+
authoritySubjectId: z.ZodOptional<z.ZodString>;
|
|
428
|
+
collectionId: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
syncCadence: z.ZodEnum<{
|
|
431
|
+
daily: "daily";
|
|
432
|
+
hourly: "hourly";
|
|
433
|
+
manual: "manual";
|
|
434
|
+
}>;
|
|
435
|
+
readPolicy: z.ZodEnum<{
|
|
436
|
+
allow: "allow";
|
|
437
|
+
ask: "ask";
|
|
438
|
+
block: "block";
|
|
439
|
+
}>;
|
|
440
|
+
}, z.core.$strip>;
|
|
441
|
+
export type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;
|
|
442
|
+
export declare const SaveGoogleDriveIntegrationSourceRequest: z.ZodIntersection<z.ZodObject<{
|
|
443
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
444
|
+
id: z.ZodString;
|
|
445
|
+
name: z.ZodString;
|
|
446
|
+
mimeType: z.ZodString;
|
|
447
|
+
driveId: z.ZodNullable<z.ZodString>;
|
|
448
|
+
}, z.core.$strip>>;
|
|
449
|
+
destination: z.ZodOptional<z.ZodObject<{
|
|
450
|
+
authorityKind: z.ZodEnum<{
|
|
451
|
+
organization: "organization";
|
|
452
|
+
personal: "personal";
|
|
453
|
+
workspace: "workspace";
|
|
454
|
+
}>;
|
|
455
|
+
collectionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
456
|
+
}, z.core.$strip>>;
|
|
457
|
+
targetScope: z.ZodOptional<z.ZodEnum<{
|
|
458
|
+
organization: "organization";
|
|
459
|
+
user: "user";
|
|
460
|
+
workspace: "workspace";
|
|
461
|
+
}>>;
|
|
462
|
+
syncCadence: z.ZodDefault<z.ZodEnum<{
|
|
463
|
+
daily: "daily";
|
|
464
|
+
hourly: "hourly";
|
|
465
|
+
manual: "manual";
|
|
466
|
+
}>>;
|
|
467
|
+
syncEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
468
|
+
readPolicy: z.ZodDefault<z.ZodEnum<{
|
|
469
|
+
allow: "allow";
|
|
470
|
+
ask: "ask";
|
|
471
|
+
block: "block";
|
|
472
|
+
}>>;
|
|
473
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
474
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
475
|
+
id: z.ZodString;
|
|
476
|
+
name: z.ZodString;
|
|
477
|
+
mimeType: z.ZodString;
|
|
478
|
+
driveId: z.ZodNullable<z.ZodString>;
|
|
479
|
+
}, z.core.$strip>>;
|
|
480
|
+
expectedVersion: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
idempotencyKey: z.ZodString;
|
|
482
|
+
}, z.core.$strip>>;
|
|
483
|
+
export type SaveGoogleDriveIntegrationSourceRequest = z.infer<typeof SaveGoogleDriveIntegrationSourceRequest>;
|
package/dist/google-drive.js
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VA22KRHS.js";
|
|
4
|
+
import "./chunk-H5BVCZKF.js";
|
|
5
|
+
import "./chunk-5UDNP7AO.js";
|
|
6
|
+
import "./chunk-52SGB2QO.js";
|
|
7
|
+
import "./chunk-TZ6YEYN4.js";
|
|
8
|
+
import "./chunk-YRKRZ6OF.js";
|
|
4
9
|
import {
|
|
5
10
|
ConnectorDocumentDestination,
|
|
6
11
|
ConnectorDocumentDestinationSelection
|
|
7
12
|
} from "./chunk-WYBDERIY.js";
|
|
8
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-Y3MLSLB4.js";
|
|
14
|
+
import "./chunk-FJBG5E4O.js";
|
|
15
|
+
import "./chunk-CADSX6UN.js";
|
|
16
|
+
import "./chunk-RIY7GYQS.js";
|
|
17
|
+
import "./chunk-BVGIYW7D.js";
|
|
18
|
+
import "./chunk-D2HKF2EF.js";
|
|
19
|
+
import "./chunk-MYBZRDTY.js";
|
|
20
|
+
import "./chunk-LSB7GRLG.js";
|
|
9
21
|
|
|
10
22
|
// src/google-drive.ts
|
|
11
23
|
import { z } from "zod";
|
|
@@ -15,7 +27,8 @@ var GOOGLE_DRIVE_FILE_SCOPE = "https://www.googleapis.com/auth/drive.file";
|
|
|
15
27
|
var GOOGLE_DRIVE_METADATA_READONLY_SCOPE = "https://www.googleapis.com/auth/drive.metadata.readonly";
|
|
16
28
|
var GOOGLE_DRIVE_READONLY_SCOPE = "https://www.googleapis.com/auth/drive.readonly";
|
|
17
29
|
var GOOGLE_DRIVE_CREDENTIAL_ROLE = "google_drive_metadata";
|
|
18
|
-
var GOOGLE_DRIVE_CREDENTIAL_LABEL = "Google Drive
|
|
30
|
+
var GOOGLE_DRIVE_CREDENTIAL_LABEL = "Google Drive read-only source sync";
|
|
31
|
+
var GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = "Google Drive metadata browser";
|
|
19
32
|
var GoogleDriveOAuthCapability = z.enum([
|
|
20
33
|
"picker_file_read",
|
|
21
34
|
"source_metadata_discovery",
|
|
@@ -101,12 +114,17 @@ var GoogleDriveSelectedSource = z.object({
|
|
|
101
114
|
/** @deprecated Missing destinations resolve to the current workspace boundary. */
|
|
102
115
|
targetScope: GoogleDriveTargetScope.optional(),
|
|
103
116
|
syncCadence: GoogleDriveSyncCadence.default("hourly"),
|
|
117
|
+
syncEnabled: z.boolean().default(false),
|
|
118
|
+
configGeneration: z.number().int().positive().default(1),
|
|
104
119
|
readPolicy: GoogleDriveReadPolicy.default("allow"),
|
|
105
120
|
selectedAt: z.string().datetime({ offset: true })
|
|
106
121
|
});
|
|
107
122
|
var GoogleDriveConnectionMetadata = z.object({
|
|
108
123
|
credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),
|
|
109
|
-
credentialLabel: z.
|
|
124
|
+
credentialLabel: z.union([
|
|
125
|
+
z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),
|
|
126
|
+
z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL)
|
|
127
|
+
]),
|
|
110
128
|
googlePermissionId: z.string().min(1).max(256),
|
|
111
129
|
googleEmail: z.string().email().max(320),
|
|
112
130
|
googleDisplayName: z.string().min(1).max(512).nullable(),
|
|
@@ -151,30 +169,64 @@ var GoogleDriveBrowseResponse = z.object({
|
|
|
151
169
|
nextPageToken: z.string().min(1).max(4096).nullable(),
|
|
152
170
|
incompleteSearch: z.boolean()
|
|
153
171
|
});
|
|
172
|
+
var GoogleDriveSourceSelection = z.array(
|
|
173
|
+
GoogleDriveBrowseItem.pick({
|
|
174
|
+
id: true,
|
|
175
|
+
name: true,
|
|
176
|
+
mimeType: true,
|
|
177
|
+
driveId: true
|
|
178
|
+
})
|
|
179
|
+
).max(100).refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {
|
|
180
|
+
message: "Google Drive sources must be unique"
|
|
181
|
+
});
|
|
154
182
|
var SaveGoogleDriveSourceRequest = z.object({
|
|
155
|
-
sources:
|
|
156
|
-
GoogleDriveBrowseItem.pick({
|
|
157
|
-
id: true,
|
|
158
|
-
name: true,
|
|
159
|
-
mimeType: true,
|
|
160
|
-
driveId: true
|
|
161
|
-
})
|
|
162
|
-
).max(100).refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {
|
|
163
|
-
message: "Google Drive sources must be unique"
|
|
164
|
-
}),
|
|
183
|
+
sources: GoogleDriveSourceSelection,
|
|
165
184
|
destination: ConnectorDocumentDestinationSelection.optional(),
|
|
166
185
|
/** @deprecated Legacy requests are accepted but resolve to workspace authority. */
|
|
167
186
|
targetScope: GoogleDriveTargetScope.optional(),
|
|
168
187
|
syncCadence: GoogleDriveSyncCadence.default("hourly"),
|
|
188
|
+
syncEnabled: z.boolean().default(false),
|
|
169
189
|
readPolicy: GoogleDriveReadPolicy.default("allow")
|
|
170
190
|
}).refine((request) => request.destination !== void 0 || request.targetScope !== void 0, {
|
|
171
191
|
message: "Google Drive document destination is required"
|
|
172
192
|
});
|
|
193
|
+
var GoogleDriveKnowledgeSourceItem = z.object({
|
|
194
|
+
id: z.string().min(1).max(512),
|
|
195
|
+
name: z.string().min(1).max(1024),
|
|
196
|
+
mimeType: z.string().min(1).max(256),
|
|
197
|
+
driveId: z.string().min(1).max(512).optional(),
|
|
198
|
+
sourceKind: z.enum(["my_drive", "shared_drive", "folder"]),
|
|
199
|
+
includeDescendants: z.boolean()
|
|
200
|
+
});
|
|
201
|
+
var GoogleDriveKnowledgeSourceDestination = z.object({
|
|
202
|
+
authorityKind: z.enum(["organization", "workspace", "personal"]),
|
|
203
|
+
authorityAccountId: z.string().min(1).max(128),
|
|
204
|
+
authorityWorkspaceId: z.string().min(1).max(128).optional(),
|
|
205
|
+
authoritySubjectId: z.string().min(1).max(512).optional(),
|
|
206
|
+
collectionId: z.string().min(1).max(512).optional()
|
|
207
|
+
});
|
|
208
|
+
var GoogleDriveKnowledgeSourceConfig = z.object({
|
|
209
|
+
sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),
|
|
210
|
+
destination: GoogleDriveKnowledgeSourceDestination,
|
|
211
|
+
syncCadence: GoogleDriveSyncCadence,
|
|
212
|
+
readPolicy: GoogleDriveReadPolicy
|
|
213
|
+
});
|
|
214
|
+
var SaveGoogleDriveIntegrationSourceRequest = z.intersection(
|
|
215
|
+
SaveGoogleDriveSourceRequest,
|
|
216
|
+
z.object({
|
|
217
|
+
sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {
|
|
218
|
+
message: "At least one Google Drive source is required"
|
|
219
|
+
}),
|
|
220
|
+
expectedVersion: z.number().int().positive().optional(),
|
|
221
|
+
idempotencyKey: z.string().uuid()
|
|
222
|
+
})
|
|
223
|
+
);
|
|
173
224
|
export {
|
|
174
225
|
GOOGLE_DRIVE_CREDENTIAL_LABEL,
|
|
175
226
|
GOOGLE_DRIVE_CREDENTIAL_ROLE,
|
|
176
227
|
GOOGLE_DRIVE_FILE_SCOPE,
|
|
177
228
|
GOOGLE_DRIVE_FULL_SCOPE,
|
|
229
|
+
GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL,
|
|
178
230
|
GOOGLE_DRIVE_METADATA_READONLY_SCOPE,
|
|
179
231
|
GOOGLE_DRIVE_PROVIDER_DOMAIN,
|
|
180
232
|
GOOGLE_DRIVE_READONLY_SCOPE,
|
|
@@ -184,6 +236,9 @@ export {
|
|
|
184
236
|
GoogleDriveConnectionLifecycleState,
|
|
185
237
|
GoogleDriveConnectionMetadata,
|
|
186
238
|
GoogleDriveDisconnectRequest,
|
|
239
|
+
GoogleDriveKnowledgeSourceConfig,
|
|
240
|
+
GoogleDriveKnowledgeSourceDestination,
|
|
241
|
+
GoogleDriveKnowledgeSourceItem,
|
|
187
242
|
GoogleDriveLifecycleActionRequest,
|
|
188
243
|
GoogleDriveOAuthCapability,
|
|
189
244
|
GoogleDriveOAuthStartRequest,
|
|
@@ -192,6 +247,7 @@ export {
|
|
|
192
247
|
GoogleDriveSelectedSource,
|
|
193
248
|
GoogleDriveSyncCadence,
|
|
194
249
|
GoogleDriveTargetScope,
|
|
250
|
+
SaveGoogleDriveIntegrationSourceRequest,
|
|
195
251
|
SaveGoogleDriveSourceRequest,
|
|
196
252
|
googleDriveOAuthScopeDecision,
|
|
197
253
|
googleDriveScopesAllowCapability
|
package/dist/google-drive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,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,OAAO;AACnD,CAAC,EACA,OAAO,CAAC,YAAY,QAAQ,gBAAgB,UAAa,QAAQ,gBAAgB,QAAW;AAAA,EAC3F,SAAS;AACX,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;\n/** Stable serialized role retained for existing connection rows; not product-facing copy. */\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive read-only source sync\" as const;\nexport const GOOGLE_DRIVE_LEGACY_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 syncEnabled: z.boolean().default(false),\n configGeneration: z.number().int().positive().default(1),\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.union([\n z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL),\n ]),\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\nconst GoogleDriveSourceSelection = 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\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: GoogleDriveSourceSelection,\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 syncEnabled: z.boolean().default(false),\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\nexport const GoogleDriveKnowledgeSourceItem = z.object({\n id: z.string().min(1).max(512),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(512).optional(),\n sourceKind: z.enum([\"my_drive\", \"shared_drive\", \"folder\"]),\n includeDescendants: z.boolean(),\n});\nexport type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;\n\nexport const GoogleDriveKnowledgeSourceDestination = z.object({\n authorityKind: z.enum([\"organization\", \"workspace\", \"personal\"]),\n authorityAccountId: z.string().min(1).max(128),\n authorityWorkspaceId: z.string().min(1).max(128).optional(),\n authoritySubjectId: z.string().min(1).max(512).optional(),\n collectionId: z.string().min(1).max(512).optional(),\n});\nexport type GoogleDriveKnowledgeSourceDestination = z.infer<\n typeof GoogleDriveKnowledgeSourceDestination\n>;\n\nexport const GoogleDriveKnowledgeSourceConfig = z.object({\n sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),\n destination: GoogleDriveKnowledgeSourceDestination,\n syncCadence: GoogleDriveSyncCadence,\n readPolicy: GoogleDriveReadPolicy,\n});\nexport type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;\n\nexport const SaveGoogleDriveIntegrationSourceRequest = z.intersection(\n SaveGoogleDriveSourceRequest,\n z.object({\n sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {\n message: \"At least one Google Drive source is required\",\n }),\n expectedVersion: z.number().int().positive().optional(),\n idempotencyKey: z.string().uuid(),\n }),\n);\nexport type SaveGoogleDriveIntegrationSourceRequest = z.infer<\n typeof SaveGoogleDriveIntegrationSourceRequest\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAQX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AAEK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,uCAAuC;AAE7C,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,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AAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AACpD,CAAC;AAKM,IAAM,mCAAmC,EAAE,OAAO;AAAA,EACvD,SAAS,EAAE,MAAM,8BAA8B,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AACd,CAAC;AAGM,IAAM,0CAA0C,EAAE;AAAA,EACvD;AAAA,EACA,EAAE,OAAO;AAAA,IACP,SAAS,2BAA2B,OAAO,CAAC,YAAY,QAAQ,SAAS,GAAG;AAAA,MAC1E,SAAS;AAAA,IACX,CAAC;AAAA,IACD,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,IACtD,gBAAgB,EAAE,OAAO,EAAE,KAAK;AAAA,EAClC,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const IMAGE_GENERATION_MAX_REFERENCES = 4;
|
|
3
|
+
/** One ordered, workspace-owned input used to guide or edit an image. */
|
|
4
|
+
export declare const ImageGenerationReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
kind: z.ZodLiteral<"sandbox_path">;
|
|
6
|
+
path: z.ZodString;
|
|
7
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
8
|
+
kind: z.ZodLiteral<"file">;
|
|
9
|
+
fileId: z.ZodString;
|
|
10
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
11
|
+
kind: z.ZodLiteral<"artifact">;
|
|
12
|
+
artifactId: z.ZodString;
|
|
13
|
+
}, z.core.$strict>], "kind">;
|
|
14
|
+
export type ImageGenerationReference = z.infer<typeof ImageGenerationReferenceSchema>;
|
|
15
|
+
/** Provider-neutral minimum shared by native and adapter-backed image tools. */
|
|
16
|
+
export declare const GenerateImageToolInput: z.ZodObject<{
|
|
17
|
+
prompt: z.ZodString;
|
|
18
|
+
references: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
19
|
+
kind: z.ZodLiteral<"sandbox_path">;
|
|
20
|
+
path: z.ZodString;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"file">;
|
|
23
|
+
fileId: z.ZodString;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"artifact">;
|
|
26
|
+
artifactId: z.ZodString;
|
|
27
|
+
}, z.core.$strict>], "kind">>>>;
|
|
28
|
+
}, z.core.$strict>;
|
|
29
|
+
export type GenerateImageToolInput = z.infer<typeof GenerateImageToolInput>;
|
|
30
|
+
/** Closed durable result shared by native and adapter-backed image tools. */
|
|
31
|
+
export declare const GeneratedImageReceiptSchema: z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"generated_image">;
|
|
33
|
+
artifact: z.ZodObject<{
|
|
34
|
+
available: z.ZodLiteral<true>;
|
|
35
|
+
artifactId: z.ZodString;
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
assistant_completion: "assistant_completion";
|
|
38
|
+
computer_screenshot: "computer_screenshot";
|
|
39
|
+
event_media: "event_media";
|
|
40
|
+
file: "file";
|
|
41
|
+
generated_image: "generated_image";
|
|
42
|
+
generated_video: "generated_video";
|
|
43
|
+
internal_update: "internal_update";
|
|
44
|
+
tool_result: "tool_result";
|
|
45
|
+
}>;
|
|
46
|
+
contentType: z.ZodString;
|
|
47
|
+
originalBytes: z.ZodNumber;
|
|
48
|
+
sha256: z.ZodString;
|
|
49
|
+
retainedAt: z.ZodString;
|
|
50
|
+
dimensions: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
width: z.ZodNumber;
|
|
52
|
+
height: z.ZodNumber;
|
|
53
|
+
}, z.core.$strict>>;
|
|
54
|
+
retention: z.ZodUnion<readonly [z.ZodObject<{
|
|
55
|
+
policy: z.ZodLiteral<"workspace_file">;
|
|
56
|
+
expiresAt: z.ZodNull;
|
|
57
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
58
|
+
policy: z.ZodLiteral<"session_screenshot">;
|
|
59
|
+
expiresAt: z.ZodString;
|
|
60
|
+
}, z.core.$strict>]>;
|
|
61
|
+
retrieval: z.ZodObject<{
|
|
62
|
+
method: z.ZodLiteral<"GET">;
|
|
63
|
+
path: z.ZodString;
|
|
64
|
+
acceptRanges: z.ZodLiteral<"bytes">;
|
|
65
|
+
maxRangeBytes: z.ZodNumber;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
sandboxPath: z.ZodString;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
export type GeneratedImageReceipt = z.infer<typeof GeneratedImageReceiptSchema>;
|