@opengeni/contracts 0.44.1 → 1.0.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.
Files changed (51) hide show
  1. package/dist/atlassian.js +10 -8
  2. package/dist/canonical-human-identities.d.ts +157 -0
  3. package/dist/canonical-human-identities.js +23 -0
  4. package/dist/canonical-human-identities.js.map +1 -0
  5. package/dist/chunk-CM6BMECR.js +24 -0
  6. package/dist/chunk-CM6BMECR.js.map +1 -0
  7. package/dist/{chunk-FJBG5E4O.js → chunk-JBCIY7QD.js} +12 -12
  8. package/dist/chunk-JUFK3T4Q.js +80 -0
  9. package/dist/chunk-JUFK3T4Q.js.map +1 -0
  10. package/dist/{chunk-H5BVCZKF.js → chunk-LW7OH6CS.js} +2 -2
  11. package/dist/{chunk-52SGB2QO.js → chunk-M5ZGRVIQ.js} +37 -6
  12. package/dist/chunk-M5ZGRVIQ.js.map +1 -0
  13. package/dist/{chunk-VA22KRHS.js → chunk-NX5JNF4L.js} +6533 -4923
  14. package/dist/chunk-NX5JNF4L.js.map +1 -0
  15. package/dist/codex-provider-account-authority.d.ts +23 -0
  16. package/dist/codex-provider-account-authority.js +23 -0
  17. package/dist/codex-provider-account-authority.js.map +1 -0
  18. package/dist/editable-artifact-codec-registry.js +5 -5
  19. package/dist/editable-artifact-live.js +3 -3
  20. package/dist/editable-artifact-serialized-commit.js +4 -4
  21. package/dist/editable-artifacts.js +27 -27
  22. package/dist/google-drive.d.ts +88 -1
  23. package/dist/google-drive.js +75 -13
  24. package/dist/google-drive.js.map +1 -1
  25. package/dist/index.d.ts +1385 -122
  26. package/dist/index.js +406 -80
  27. package/dist/interaction.d.ts +1415 -20
  28. package/dist/knowledge.d.ts +616 -0
  29. package/dist/slack-task-policy.d.ts +294 -0
  30. package/dist/task-notes.d.ts +128 -0
  31. package/dist/video-generation.d.ts +48 -0
  32. package/dist/video-generation.js +9 -1
  33. package/dist/xai-provider-account-authority.d.ts +23 -0
  34. package/dist/xai-provider-account-authority.js +9 -0
  35. package/dist/xai-provider-account-authority.js.map +1 -0
  36. package/package.json +13 -1
  37. package/src/artifacts.ts +1 -1
  38. package/src/canonical-human-identities.ts +93 -0
  39. package/src/codex-provider-account-authority.ts +37 -0
  40. package/src/google-drive.ts +76 -4
  41. package/src/index.ts +921 -270
  42. package/src/interaction.ts +886 -5
  43. package/src/knowledge.ts +222 -0
  44. package/src/slack-task-policy.ts +215 -0
  45. package/src/task-notes.ts +92 -0
  46. package/src/video-generation.ts +43 -6
  47. package/src/xai-provider-account-authority.ts +37 -0
  48. package/dist/chunk-52SGB2QO.js.map +0 -1
  49. package/dist/chunk-VA22KRHS.js.map +0 -1
  50. /package/dist/{chunk-FJBG5E4O.js.map → chunk-JBCIY7QD.js.map} +0 -0
  51. /package/dist/{chunk-H5BVCZKF.js.map → chunk-LW7OH6CS.js.map} +0 -0
@@ -0,0 +1,93 @@
1
+ import { z } from "zod";
2
+
3
+ export const CanonicalHumanIdentityStatus = z.enum([
4
+ "active",
5
+ "recovery_required",
6
+ "disputed",
7
+ "disabled",
8
+ ]);
9
+ export type CanonicalHumanIdentityStatus = z.infer<typeof CanonicalHumanIdentityStatus>;
10
+
11
+ export const CanonicalHumanLoginBindingStatus = z.enum([
12
+ "active",
13
+ "recovery_pending",
14
+ "stale",
15
+ "disputed",
16
+ "revoked",
17
+ ]);
18
+ export type CanonicalHumanLoginBindingStatus = z.infer<typeof CanonicalHumanLoginBindingStatus>;
19
+
20
+ export const CanonicalHumanRecoveryState = z.enum([
21
+ "ready",
22
+ "recovery_required",
23
+ "lost_factor",
24
+ "disputed",
25
+ "disabled",
26
+ ]);
27
+ export type CanonicalHumanRecoveryState = z.infer<typeof CanonicalHumanRecoveryState>;
28
+
29
+ export const CanonicalHumanLoginBinding = z.object({
30
+ id: z.string().uuid(),
31
+ providerId: z.string().min(1).max(128),
32
+ providerAccountId: z.string().min(1).max(1024),
33
+ status: CanonicalHumanLoginBindingStatus,
34
+ revision: z.number().int().positive(),
35
+ verifiedAt: z.string().datetime(),
36
+ lastVerifiedAt: z.string().datetime(),
37
+ revokedAt: z.string().datetime().nullable(),
38
+ createdAt: z.string().datetime(),
39
+ updatedAt: z.string().datetime(),
40
+ });
41
+ export type CanonicalHumanLoginBinding = z.infer<typeof CanonicalHumanLoginBinding>;
42
+
43
+ export const CanonicalHumanIdentityProjection = z.object({
44
+ activeIdentity: z.object({
45
+ id: z.string().uuid(),
46
+ displayName: z.string().min(1).max(256),
47
+ status: CanonicalHumanIdentityStatus,
48
+ identityRevision: z.number().int().positive(),
49
+ authRevision: z.number().int().positive(),
50
+ activeLoginBindingId: z.string().uuid().nullable(),
51
+ recoveryState: CanonicalHumanRecoveryState,
52
+ createdAt: z.string().datetime(),
53
+ updatedAt: z.string().datetime(),
54
+ }),
55
+ loginBindings: z.array(CanonicalHumanLoginBinding).max(64),
56
+ });
57
+ export type CanonicalHumanIdentityProjection = z.infer<typeof CanonicalHumanIdentityProjection>;
58
+
59
+ const OperationFields = {
60
+ operationId: z.string().uuid().optional(),
61
+ expectedIdentityRevision: z.number().int().positive(),
62
+ reason: z.string().trim().min(1).max(512),
63
+ } as const;
64
+
65
+ export const LinkCanonicalHumanLoginBindingRequest = z.object({
66
+ ...OperationFields,
67
+ providerId: z.string().trim().min(1).max(128),
68
+ providerAccountId: z.string().trim().min(1).max(1024),
69
+ });
70
+ export type LinkCanonicalHumanLoginBindingRequest = z.infer<
71
+ typeof LinkCanonicalHumanLoginBindingRequest
72
+ >;
73
+
74
+ export const CanonicalHumanBindingOperationRequest = z.object({
75
+ ...OperationFields,
76
+ });
77
+ export type CanonicalHumanBindingOperationRequest = z.infer<
78
+ typeof CanonicalHumanBindingOperationRequest
79
+ >;
80
+
81
+ export const CanonicalHumanIdentityMutationOutcome = z.enum(["applied", "lost_factor", "disputed"]);
82
+ export type CanonicalHumanIdentityMutationOutcome = z.infer<
83
+ typeof CanonicalHumanIdentityMutationOutcome
84
+ >;
85
+
86
+ export const CanonicalHumanIdentityMutationResponse = z.object({
87
+ outcome: CanonicalHumanIdentityMutationOutcome,
88
+ operationId: z.string().uuid(),
89
+ identity: CanonicalHumanIdentityProjection,
90
+ });
91
+ export type CanonicalHumanIdentityMutationResponse = z.infer<
92
+ typeof CanonicalHumanIdentityMutationResponse
93
+ >;
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+
3
+ const PositiveSafeInteger = z.number().int().positive().max(Number.MAX_SAFE_INTEGER);
4
+
5
+ /**
6
+ * Opaque authority frozen at a Codex provider-account acceptance boundary.
7
+ *
8
+ * The snapshot deliberately carries no organization, membership, credential,
9
+ * provider-account, subject, label, quota, token, or plan identity. A later
10
+ * activation slice may use the user generation only together with separately
11
+ * authorized durable state; this value is never sufficient authority alone.
12
+ */
13
+ export const CodexProviderAccountAuthoritySnapshotV1 = z.discriminatedUnion("scope", [
14
+ z
15
+ .object({
16
+ version: z.literal(1),
17
+ scope: z.literal("workspace"),
18
+ })
19
+ .strict(),
20
+ z
21
+ .object({
22
+ version: z.literal(1),
23
+ scope: z.literal("user"),
24
+ authorityGeneration: PositiveSafeInteger,
25
+ })
26
+ .strict(),
27
+ ]);
28
+
29
+ export type CodexProviderAccountAuthoritySnapshotV1 = z.infer<
30
+ typeof CodexProviderAccountAuthoritySnapshotV1
31
+ >;
32
+
33
+ /** Explicit compatibility value for all pre-foundation accepted work. */
34
+ export const LEGACY_WORKSPACE_CODEX_PROVIDER_ACCOUNT_AUTHORITY_SNAPSHOT_V1 = {
35
+ version: 1,
36
+ scope: "workspace",
37
+ } as const satisfies CodexProviderAccountAuthoritySnapshotV1;
@@ -17,9 +17,13 @@ export const GOOGLE_DRIVE_READONLY_SCOPE =
17
17
  export const GOOGLE_DRIVE_CREDENTIAL_ROLE = "google_drive_metadata" as const;
18
18
  export const GOOGLE_DRIVE_CREDENTIAL_LABEL = "Google Drive read-only source sync" as const;
19
19
  export const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = "Google Drive metadata browser" as const;
20
+ export const GOOGLE_DRIVE_PUBLICATION_SERVER_ID = "google-drive-publishing" as const;
21
+ export const GOOGLE_DRIVE_PUBLICATION_TOOL_NAME = "google_drive_publish_file" as const;
22
+ export const GOOGLE_DRIVE_PUBLICATION_CREATE_ACTION = "create" as const;
20
23
 
21
24
  export const GoogleDriveOAuthCapability = z.enum([
22
25
  "picker_file_read",
26
+ "publish_file",
23
27
  "source_metadata_discovery",
24
28
  "source_content_read",
25
29
  "recursive_source_sync",
@@ -27,7 +31,7 @@ export const GoogleDriveOAuthCapability = z.enum([
27
31
  export type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;
28
32
 
29
33
  export type GoogleDriveOAuthScopeDecision = {
30
- accessMode: "metadata_readonly" | "readonly" | null;
34
+ accessMode: "file_only" | "metadata_readonly" | "readonly" | null;
31
35
  capabilities: GoogleDriveOAuthCapability[];
32
36
  };
33
37
 
@@ -43,11 +47,13 @@ export function googleDriveOAuthScopeDecision(
43
47
  const granted = new Set(grantedScopes);
44
48
  const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);
45
49
  const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);
50
+ const hasFileWrite = hasFullDrive || granted.has(GOOGLE_DRIVE_FILE_SCOPE);
46
51
  const hasSourceMetadataDiscovery =
47
52
  hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);
48
- const hasPickerFileRead = hasSourceContentRead || granted.has(GOOGLE_DRIVE_FILE_SCOPE);
53
+ const hasPickerFileRead = hasSourceContentRead || hasFileWrite;
49
54
  const capabilities: GoogleDriveOAuthCapability[] = [];
50
55
  if (hasPickerFileRead) capabilities.push("picker_file_read");
56
+ if (hasFileWrite) capabilities.push("publish_file");
51
57
  if (hasSourceMetadataDiscovery) capabilities.push("source_metadata_discovery");
52
58
  if (hasSourceContentRead) {
53
59
  capabilities.push("source_content_read", "recursive_source_sync");
@@ -57,7 +63,9 @@ export function googleDriveOAuthScopeDecision(
57
63
  ? "readonly"
58
64
  : hasSourceMetadataDiscovery
59
65
  ? "metadata_readonly"
60
- : null,
66
+ : hasFileWrite
67
+ ? "file_only"
68
+ : null,
61
69
  capabilities,
62
70
  };
63
71
  }
@@ -148,6 +156,26 @@ export const GoogleDriveSelectedSource = z.object({
148
156
  });
149
157
  export type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;
150
158
 
159
+ export const GoogleDriveOutputDestination = z
160
+ .object({
161
+ folderId: z.string().min(1).max(256),
162
+ folderName: z.string().min(1).max(1024),
163
+ driveId: z.string().min(1).max(256).nullable(),
164
+ location: z.enum(["my_drive", "shared_drive"]),
165
+ selectedAt: z.string().datetime({ offset: true }),
166
+ })
167
+ .strict()
168
+ .superRefine((value, context) => {
169
+ if ((value.location === "my_drive") !== (value.driveId === null)) {
170
+ context.addIssue({
171
+ code: "custom",
172
+ path: ["driveId"],
173
+ message: "Google Drive destination location does not match its drive identity",
174
+ });
175
+ }
176
+ });
177
+ export type GoogleDriveOutputDestination = z.infer<typeof GoogleDriveOutputDestination>;
178
+
151
179
  export const GoogleDriveConnectionMetadata = z
152
180
  .object({
153
181
  credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),
@@ -159,8 +187,9 @@ export const GoogleDriveConnectionMetadata = z
159
187
  googleEmail: z.string().email().max(320),
160
188
  googleDisplayName: z.string().min(1).max(512).nullable(),
161
189
  verifiedAt: z.string().datetime({ offset: true }),
162
- accessMode: z.enum(["metadata_readonly", "readonly"]),
190
+ accessMode: z.enum(["file_only", "metadata_readonly", "readonly"]),
163
191
  lifecycle: GoogleDriveConnectionLifecycle.optional(),
192
+ outputDestination: GoogleDriveOutputDestination.optional(),
164
193
  documentDestination: ConnectorDocumentDestination.optional(),
165
194
  selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),
166
195
  /** @deprecated Read `selectedSources`; retained while existing connections migrate. */
@@ -171,6 +200,7 @@ export type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnection
171
200
 
172
201
  export const GoogleDriveOAuthStartRequest = z.object({
173
202
  connectionId: z.string().uuid().optional(),
203
+ capability: z.enum(["source_read", "publish"]).default("source_read"),
174
204
  });
175
205
  export type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;
176
206
 
@@ -192,6 +222,48 @@ export const GoogleDriveDisconnectRequest = z.object({
192
222
  });
193
223
  export type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;
194
224
 
225
+ export const GoogleDrivePublicationExportFile = z
226
+ .object({
227
+ fileId: z.string().uuid(),
228
+ filename: z.string().trim().min(1).max(512),
229
+ contentType: z.string().trim().min(1).max(256),
230
+ sizeBytes: z.number().int().positive(),
231
+ sha256: z.string().regex(/^[0-9a-f]{64}$/u),
232
+ artifactId: z.string().regex(/^[0-9a-f]{32}$/u),
233
+ versionId: z.string().regex(/^[0-9a-f]{32}$/u),
234
+ materializationJobId: z.string().regex(/^[0-9a-f]{32}$/u),
235
+ sourceHeadSequence: z.number().int().nonnegative(),
236
+ sourceStateHash: z.string().regex(/^sha256:[0-9a-f]{64}$/u),
237
+ })
238
+ .strict();
239
+ export type GoogleDrivePublicationExportFile = z.infer<typeof GoogleDrivePublicationExportFile>;
240
+
241
+ export const GoogleDrivePublicationToolInput = z
242
+ .object({
243
+ title: z.string().trim().min(1).max(512),
244
+ modality: z.enum(["document", "spreadsheet", "presentation"]),
245
+ file: GoogleDrivePublicationExportFile,
246
+ idempotencyKey: z.string().trim().min(1).max(200),
247
+ })
248
+ .strict();
249
+ export type GoogleDrivePublicationToolInput = z.infer<typeof GoogleDrivePublicationToolInput>;
250
+
251
+ export const GoogleDrivePublicationReceipt = z
252
+ .object({
253
+ connectionId: z.string().uuid(),
254
+ providerFileId: z.string().min(1).max(256),
255
+ webViewLink: z.string().url(),
256
+ mimeType: z.enum([
257
+ "application/vnd.google-apps.document",
258
+ "application/vnd.google-apps.spreadsheet",
259
+ "application/vnd.google-apps.presentation",
260
+ ]),
261
+ destination: GoogleDriveOutputDestination,
262
+ replayed: z.boolean(),
263
+ })
264
+ .strict();
265
+ export type GoogleDrivePublicationReceipt = z.infer<typeof GoogleDrivePublicationReceipt>;
266
+
195
267
  export const GoogleDriveBrowseItem = z.object({
196
268
  id: z.string().min(1).max(256),
197
269
  name: z.string().min(1).max(1024),