@opengeni/sdk 1.0.1 → 2.3.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +117 -2
  2. package/dist/artifacts.js +5 -5
  3. package/dist/automations-client.d.ts +17 -0
  4. package/dist/automations.d.ts +3 -0
  5. package/dist/automations.js +78 -0
  6. package/dist/automations.js.map +1 -0
  7. package/dist/{chunk-YGH5P47G.js → chunk-6IPZY27S.js} +744 -57
  8. package/dist/chunk-6IPZY27S.js.map +1 -0
  9. package/dist/{chunk-TYZ4JL4J.js → chunk-AGUKZAXR.js} +2 -2
  10. package/dist/{chunk-A5DC5WEM.js → chunk-C2H7HBNP.js} +22 -2
  11. package/dist/chunk-C2H7HBNP.js.map +1 -0
  12. package/dist/{chunk-GU6JF75T.js → chunk-C4DJPZRU.js} +1 -1
  13. package/dist/{chunk-GU6JF75T.js.map → chunk-C4DJPZRU.js.map} +1 -1
  14. package/dist/{chunk-ST5DDKJP.js → chunk-GW3EJ2GP.js} +52 -1
  15. package/dist/chunk-GW3EJ2GP.js.map +1 -0
  16. package/dist/{chunk-4DV37UUA.js → chunk-TW5MNHUX.js} +16 -2
  17. package/dist/chunk-TW5MNHUX.js.map +1 -0
  18. package/dist/{chunk-VWE2QIVO.js → chunk-XNG7YGR3.js} +23 -6
  19. package/dist/chunk-XNG7YGR3.js.map +1 -0
  20. package/dist/client.d.ts +159 -26
  21. package/dist/codex-realtime-controller.d.ts +1 -0
  22. package/dist/codex-realtime-controller.js +2 -2
  23. package/dist/company-brain.d.ts +32 -0
  24. package/dist/company-profile.d.ts +1 -1
  25. package/dist/core.js +4 -4
  26. package/dist/editable-artifacts/browser-session.d.ts +7 -3
  27. package/dist/editable-artifacts/controller.d.ts +4 -1
  28. package/dist/editable-artifacts/errors.d.ts +1 -1
  29. package/dist/editable-artifacts/http-live-transport.d.ts +6 -2
  30. package/dist/editable-artifacts/index.d.ts +2 -0
  31. package/dist/editable-artifacts/open-failure.d.ts +9 -0
  32. package/dist/editable-artifacts/types.d.ts +4 -3
  33. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +1 -1
  34. package/dist/editable-artifacts-worker.js +44 -17
  35. package/dist/editable-artifacts-worker.js.map +1 -1
  36. package/dist/editable-artifacts.js +222 -119
  37. package/dist/editable-artifacts.js.map +1 -1
  38. package/dist/errors.d.ts +1 -1
  39. package/dist/index.d.ts +7 -4
  40. package/dist/index.js +61 -12
  41. package/dist/index.js.map +1 -1
  42. package/dist/interaction.d.ts +23 -0
  43. package/dist/interaction.js +4 -1
  44. package/dist/organization-private-session-settings.d.ts +6 -0
  45. package/dist/organization-private-session-settings.js +22 -0
  46. package/dist/organization-private-session-settings.js.map +1 -0
  47. package/dist/pr-review-client.d.ts +15 -0
  48. package/dist/pr-review.d.ts +4 -0
  49. package/dist/pr-review.js +56 -0
  50. package/dist/pr-review.js.map +1 -0
  51. package/dist/preference-registry.d.ts +8 -0
  52. package/dist/realtime.js +2 -2
  53. package/dist/retained-artifacts.d.ts +5 -1
  54. package/dist/types.d.ts +1023 -13
  55. package/dist/workspace-instruction-policies.d.ts +22 -0
  56. package/dist/workspace-learning.d.ts +124 -0
  57. package/package.json +14 -2
  58. package/src/automations-client.ts +118 -0
  59. package/src/automations.ts +15 -0
  60. package/src/client.ts +1049 -71
  61. package/src/codex-realtime-controller.ts +21 -0
  62. package/src/company-brain.ts +99 -0
  63. package/src/company-profile.ts +4 -1
  64. package/src/editable-artifacts/browser-session.ts +36 -22
  65. package/src/editable-artifacts/controller.ts +66 -45
  66. package/src/editable-artifacts/errors.ts +2 -0
  67. package/src/editable-artifacts/http-live-transport.ts +62 -37
  68. package/src/editable-artifacts/index.ts +6 -0
  69. package/src/editable-artifacts/open-failure.ts +79 -0
  70. package/src/editable-artifacts/storage.ts +31 -40
  71. package/src/editable-artifacts/types.ts +4 -3
  72. package/src/editable-artifacts/worker/kernel-adapter.ts +23 -7
  73. package/src/editable-artifacts/worker/runtime.ts +26 -13
  74. package/src/editable-artifacts/worker/wire-codec.ts +23 -5
  75. package/src/errors.ts +1 -1
  76. package/src/index.ts +134 -0
  77. package/src/interaction.ts +95 -0
  78. package/src/organization-private-session-settings.ts +33 -0
  79. package/src/pr-review-client.ts +84 -0
  80. package/src/pr-review.ts +15 -0
  81. package/src/preference-registry.ts +9 -0
  82. package/src/retained-artifacts.ts +101 -0
  83. package/src/stream.ts +13 -2
  84. package/src/types.ts +1174 -12
  85. package/src/workspace-instruction-policies.ts +24 -0
  86. package/src/workspace-learning.ts +138 -0
  87. package/dist/chunk-4DV37UUA.js.map +0 -1
  88. package/dist/chunk-A5DC5WEM.js.map +0 -1
  89. package/dist/chunk-ST5DDKJP.js.map +0 -1
  90. package/dist/chunk-VWE2QIVO.js.map +0 -1
  91. package/dist/chunk-YGH5P47G.js.map +0 -1
  92. /package/dist/{chunk-TYZ4JL4J.js.map → chunk-AGUKZAXR.js.map} +0 -0
package/src/types.ts CHANGED
@@ -172,7 +172,11 @@ export type WorkspaceRealtimeModelCatalogResponse = {
172
172
  models: WorkspaceRealtimeModelCatalogItem[];
173
173
  };
174
174
  export type SessionRealtimeState = "active" | "ended";
175
- export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired";
175
+ export type SessionRealtimeEndReason =
176
+ | "user_stop"
177
+ | "browser_unload"
178
+ | "lease_expired"
179
+ | "authority_revoked";
176
180
 
177
181
  export type SessionRealtimeMode = {
178
182
  id: string;
@@ -222,7 +226,7 @@ export type SessionStatus =
222
226
  | "failed"
223
227
  | "cancelled";
224
228
 
225
- // Mirror of `@opengeni/contracts` SandboxBackend (11 values; every member is
229
+ // Mirror of `@opengeni/contracts` SandboxBackend (12 values; every member is
226
230
  // additive at the end). 3-way enum parity is pinned by
227
231
  // `test/contract-parity.test.ts`.
228
232
  export type SandboxBackend =
@@ -236,7 +240,8 @@ export type SandboxBackend =
236
240
  | "blaxel"
237
241
  | "cloudflare"
238
242
  | "vercel"
239
- | "selfhosted";
243
+ | "selfhosted"
244
+ | "opensandbox";
240
245
 
241
246
  // Mirror of `@opengeni/contracts` SandboxOs. Only "linux" is reachable in v1.
242
247
  export type SandboxOs = "linux" | "macos" | "windows";
@@ -449,6 +454,8 @@ export type RepositoryResourceRef = {
449
454
  kind: "repository";
450
455
  uri: string;
451
456
  ref: string;
457
+ /** Exact immutable commit that repository materialization must produce. */
458
+ expectedCommitSha?: string | undefined;
452
459
  /**
453
460
  * Optional workspace-relative override. When omitted, OpenGeni persists
454
461
  * `repos/<encoded-host>/<owner>/<repo>` so equal names on different Git
@@ -458,6 +465,7 @@ export type RepositoryResourceRef = {
458
465
  mountPath?: string | undefined;
459
466
  subpath?: string | undefined;
460
467
  provider?: GitCredentialProvider | undefined;
468
+ connectionType?: "github_personal" | undefined;
461
469
  credentialBindingId?: GitCredentialBindingId | undefined;
462
470
  access?: GitRepositoryAccess | undefined;
463
471
  repositoryId?: number | string | undefined;
@@ -484,6 +492,7 @@ export type ToolRef = {
484
492
  kind: "mcp";
485
493
  id: string;
486
494
  optional?: boolean | undefined;
495
+ eager?: boolean | undefined;
487
496
  };
488
497
 
489
498
  export type SessionToolPolicy = {
@@ -529,6 +538,7 @@ export type SessionEffectiveToolPolicy = {
529
538
  export type GoalSpec = {
530
539
  text: string;
531
540
  successCriteria?: string | undefined;
541
+ rootConstraints?: string[] | undefined;
532
542
  maxAutoContinuations?: number | undefined;
533
543
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
534
544
  };
@@ -575,6 +585,27 @@ export type UpdateSessionMcpApprovalPolicyResponse = {
575
585
  export type ConnectionKind = "oauth2" | "api_key" | "app_install" | "delegated";
576
586
  export type ConnectionStatus = "active" | "needs_reauth" | "revoked" | "error";
577
587
 
588
+ export type UserResourceDelegation = {
589
+ authorityId: string;
590
+ grantId: string;
591
+ organizationId: string;
592
+ workspaceId: string;
593
+ sessionId: string | null;
594
+ action: string;
595
+ mode: "once" | "session" | "always";
596
+ context: "user_private" | "workspace_shared";
597
+ authorityEpoch: number | null;
598
+ authorityGeneration: number;
599
+ grantGeneration: number;
600
+ resourceVersionId?: string | null | undefined;
601
+ };
602
+
603
+ export type McpConnectionAuthoritySelection = {
604
+ serverId: string;
605
+ connectionId: string;
606
+ userDelegation: UserResourceDelegation;
607
+ };
608
+
578
609
  export type McpServerConnectionRef = {
579
610
  connectionId?: string | undefined;
580
611
  provider?: string | undefined;
@@ -639,6 +670,114 @@ export type CreateConnectionRequest = {
639
670
  metadata?: Record<string, unknown> | undefined;
640
671
  };
641
672
 
673
+ export type PersonalGitHubConnectionMetadata = {
674
+ credentialRole: "opengeni_github_personal";
675
+ providerFamily: "github";
676
+ providerPrincipalId: string;
677
+ githubUserId: string;
678
+ githubLogin: string;
679
+ oauthEnvironment: string;
680
+ oauthClientMarker: string;
681
+ credentialBindingId: string;
682
+ connectedAt: string;
683
+ lastVerifiedAt: string;
684
+ refreshTokenExpiresAt?: string | null | undefined;
685
+ disconnectedAt?: string | null | undefined;
686
+ [key: string]: unknown;
687
+ };
688
+
689
+ export type PersonalGitHubOAuthStartRequest = {
690
+ connectionId?: string | undefined;
691
+ returnPath?: string | undefined;
692
+ };
693
+
694
+ export type PersonalGitHubOAuthStartResponse = {
695
+ authorizationUrl: string;
696
+ expiresAt: string;
697
+ };
698
+
699
+ export type PersonalGitHubConnectionStatusResponse = {
700
+ enabled: boolean;
701
+ connection: ConnectionMetadata | null;
702
+ reviewUrl: string | null;
703
+ };
704
+
705
+ export type PersonalGitHubDisconnectRequest = {
706
+ expectedVersion: number;
707
+ idempotencyKey: string;
708
+ };
709
+
710
+ export type PersonalGitHubRepositoryAccess = "read" | "write";
711
+
712
+ export type PersonalGitHubRepositoryPermissions = {
713
+ pull: boolean;
714
+ push: boolean;
715
+ admin: boolean;
716
+ maintain: boolean;
717
+ triage: boolean;
718
+ };
719
+
720
+ export type PersonalGitHubRepository = {
721
+ repositoryId: string;
722
+ fullName: string;
723
+ canonicalUrl: string;
724
+ defaultBranch: string;
725
+ visibility: "public" | "private" | "internal";
726
+ private: boolean;
727
+ archived: boolean;
728
+ disabled: boolean;
729
+ permissions: PersonalGitHubRepositoryPermissions;
730
+ };
731
+
732
+ export type PersonalGitHubSelectedRepository = PersonalGitHubRepository & {
733
+ selectedAccess: PersonalGitHubRepositoryAccess;
734
+ selectionGeneration: number;
735
+ selectedAt: string;
736
+ lastVerifiedAt: string;
737
+ };
738
+
739
+ export type PersonalGitHubRepositorySelectionState = {
740
+ connectionAuthorityGeneration: number;
741
+ credentialBindingId: string;
742
+ providerPrincipalId: string;
743
+ selectionGeneration: number;
744
+ repositories: PersonalGitHubSelectedRepository[];
745
+ };
746
+
747
+ export type PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository & {
748
+ selectedAccess: PersonalGitHubRepositoryAccess | null;
749
+ };
750
+
751
+ export type ListPersonalGitHubRepositoriesOptions = {
752
+ cursor?: number | undefined;
753
+ limit?: number | undefined;
754
+ };
755
+
756
+ export type ListPersonalGitHubRepositoriesResponse = {
757
+ repositories: PersonalGitHubRepositoryCatalogItem[];
758
+ nextCursor: number | null;
759
+ selection: PersonalGitHubRepositorySelectionState;
760
+ };
761
+
762
+ export type PersonalGitHubRepositorySelectionInput = {
763
+ repositoryId: string;
764
+ fullName: string;
765
+ access: PersonalGitHubRepositoryAccess;
766
+ };
767
+
768
+ export type ReplacePersonalGitHubRepositorySelectionsRequest = {
769
+ expectedConnectionAuthorityGeneration: number;
770
+ expectedSelectionGeneration: number;
771
+ idempotencyKey: string;
772
+ repositories: PersonalGitHubRepositorySelectionInput[];
773
+ };
774
+
775
+ export type VerifyPersonalGitHubRepositorySelectionsRequest = {
776
+ expectedConnectionAuthorityGeneration: number;
777
+ expectedSelectionGeneration: number;
778
+ idempotencyKey: string;
779
+ };
780
+
642
781
  export type OpenGeniSlackBotInstallRequest = {
643
782
  /** Existing OpenGeni Slack bot connection to reinstall in place. */
644
783
  connectionId?: string | undefined;
@@ -681,7 +820,7 @@ export type SlackInstallationBinding = {
681
820
  slackTeamName: string;
682
821
  botId: string;
683
822
  botUserId: string;
684
- botDisplayName: "OpenGeni";
823
+ botDisplayName: "OpenGeni" | "OpenGeni Staging";
685
824
  state: SlackInstallationBindingState;
686
825
  quarantineReason: string | null;
687
826
  version: number;
@@ -1027,11 +1166,95 @@ export type IntegrationClientMetadata = {
1027
1166
  response_types: ["code"];
1028
1167
  };
1029
1168
 
1169
+ export type SessionVisibility = "private" | "workspace";
1170
+
1171
+ export type SessionTenancyCreateCapabilities = {
1172
+ activated: boolean;
1173
+ canCreatePrivate: boolean;
1174
+ reason: "available" | "not_activated" | "managed_session_required" | "unavailable";
1175
+ };
1176
+
1177
+ export type SessionTenancyPublicProjection = {
1178
+ visibility: SessionVisibility;
1179
+ authorityEpoch: number;
1180
+ ownedByCurrentUser: boolean;
1181
+ fork: {
1182
+ sourceVisibility: SessionVisibility;
1183
+ sourceAuthorityEpoch: number;
1184
+ forkedAt: string;
1185
+ } | null;
1186
+ };
1187
+
1188
+ export type UpdateSessionVisibilityRequest = {
1189
+ visibility: SessionVisibility;
1190
+ expectedAuthorityEpoch: number;
1191
+ idempotencyKey: string;
1192
+ };
1193
+
1194
+ export type UpdateSessionVisibilityResponse = {
1195
+ operationId: string;
1196
+ eventId: string | null;
1197
+ eventSequence: number | null;
1198
+ visibility: SessionVisibility;
1199
+ authorityEpoch: number;
1200
+ changed: boolean;
1201
+ replay: boolean;
1202
+ revokedGrantCount: number;
1203
+ };
1204
+
1205
+ export type ForkSessionRequest = {
1206
+ idempotencyKey: string;
1207
+ visibility: SessionVisibility;
1208
+ workspaceSharedAcknowledged: boolean;
1209
+ };
1210
+
1211
+ export type ForkSessionResponse = {
1212
+ operationId: string;
1213
+ eventId: string;
1214
+ eventSequence: number;
1215
+ sessionId: string;
1216
+ workspaceId: string;
1217
+ visibility: SessionVisibility;
1218
+ authorityEpoch: 1;
1219
+ copiedHistoryItemCount: number;
1220
+ replay: boolean;
1221
+ };
1222
+
1223
+ export type SessionBackgroundCommandActivity = {
1224
+ state: "running" | "stopping";
1225
+ count: number;
1226
+ };
1227
+
1228
+ export type SessionBackgroundCommand = {
1229
+ id: string;
1230
+ workspaceId: string;
1231
+ sessionId: string;
1232
+ provider: "managed" | "connected_machine";
1233
+ state: "running" | "stopping" | "exited" | "lost";
1234
+ commandPreview: string;
1235
+ cancelRequestedAt: string | null;
1236
+ exitCode: number | null;
1237
+ settlementReason: string | null;
1238
+ startedAt: string;
1239
+ settledAt: string | null;
1240
+ updatedAt: string;
1241
+ };
1242
+
1243
+ export type SessionBackgroundCommandListResponse = {
1244
+ commands: SessionBackgroundCommand[];
1245
+ };
1246
+
1247
+ export type CancelSessionBackgroundCommandResult = {
1248
+ command: SessionBackgroundCommand;
1249
+ accepted: boolean;
1250
+ };
1251
+
1030
1252
  export type Session = {
1031
1253
  id: string;
1032
1254
  workspaceId: string;
1033
1255
  accountId: string;
1034
1256
  status: SessionStatus;
1257
+ backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
1035
1258
  initialMessage: string;
1036
1259
  title: string | null;
1037
1260
  titleSource: "user" | "agent" | null;
@@ -1047,10 +1270,14 @@ export type Session = {
1047
1270
  toolPolicyVersion: number;
1048
1271
  effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
1049
1272
  metadata: Record<string, unknown>;
1273
+ /** Present only when session-tenancy product activation is enabled for the organization. */
1274
+ tenancy?: SessionTenancyPublicProjection | undefined;
1050
1275
  /** Frozen creator fact; later turns carry their own independent initiator. */
1051
1276
  createdBy: TurnInitiator;
1052
1277
  createdByContext: Record<string, unknown>;
1053
1278
  model: string;
1279
+ reasoningEffort: ReasoningEffort;
1280
+ latencyMode: LatencyMode;
1054
1281
  sandboxBackend: SandboxBackend;
1055
1282
  sandboxOs: SandboxOs;
1056
1283
  sandboxGroupId: string;
@@ -1101,6 +1328,17 @@ export type Session = {
1101
1328
  pinnedAt?: string | null;
1102
1329
  /** Optimistic pin-state revision; zero represents an absent pin relation. */
1103
1330
  pinVersion?: number;
1331
+ /** Personal explicit acknowledgment state. */
1332
+ unread?: boolean;
1333
+ /** Personal actively-working label. */
1334
+ activelyWorking?: boolean;
1335
+ /** Optimistic unread/actively-working revision. */
1336
+ attentionVersion?: number;
1337
+ /** Personal archive state. */
1338
+ archived?: boolean;
1339
+ archivedAt?: string | null;
1340
+ /** Optimistic archive-state revision. */
1341
+ archiveVersion?: number;
1104
1342
  /** Server-authoritative descendant counts populated by session-list reads. */
1105
1343
  treeStats?:
1106
1344
  | {
@@ -1111,10 +1349,22 @@ export type Session = {
1111
1349
  attentionDescendants: number;
1112
1350
  pausedDescendants: number;
1113
1351
  failedDescendants: number;
1352
+ unreadDescendants?: number | undefined;
1353
+ activelyWorkingDescendants?: number | undefined;
1354
+ /**
1355
+ * Earliest moment one of the counted `attentionDescendants` entered
1356
+ * `requires_action`; null when none is waiting, absent on older servers.
1357
+ */
1358
+ attentionSince?: string | null | undefined;
1114
1359
  /** Counts are lower bounds rather than exact totals when true. */
1115
1360
  truncated: boolean;
1116
1361
  }
1117
1362
  | undefined;
1363
+ /**
1364
+ * When this session's own open turn entered `requires_action`. Populated by
1365
+ * list and lineage reads for `requires_action` sessions; null otherwise.
1366
+ */
1367
+ requiresActionSince?: string | null | undefined;
1118
1368
  createdAt: string;
1119
1369
  updatedAt: string;
1120
1370
  };
@@ -1185,6 +1435,18 @@ export type UpdateSessionPinRequest = {
1185
1435
  expectedVersion?: number;
1186
1436
  };
1187
1437
 
1438
+ export type UpdateSessionAttentionRequest = {
1439
+ unread?: boolean;
1440
+ acknowledgedThroughSequence?: number;
1441
+ activelyWorking?: boolean;
1442
+ expectedVersion?: number;
1443
+ };
1444
+
1445
+ export type UpdateSessionArchiveRequest = {
1446
+ archived: boolean;
1447
+ expectedVersion?: number;
1448
+ };
1449
+
1188
1450
  export type LineageNode = {
1189
1451
  session: SessionSummary;
1190
1452
  children: LineageNode[];
@@ -1249,6 +1511,25 @@ export type TimelineAnnotation = DraftTimelineAnnotation & {
1249
1511
  ordinal: number;
1250
1512
  };
1251
1513
 
1514
+ export const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING_VERSION = 1 as const;
1515
+ export const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING =
1516
+ "Personal resources used in a workspace-shared session may influence outputs visible to other workspace members. The underlying credentials and secret values are not shared by the attachment itself.";
1517
+
1518
+ export type PersonalResourceAttachmentIntent = {
1519
+ mode: "once" | "session" | "always";
1520
+ expectedAuthorityEpoch?: number | undefined;
1521
+ workspaceSharedAcknowledged?: boolean | undefined;
1522
+ sharedOutputWarningVersion: 1;
1523
+ };
1524
+
1525
+ export type PersonalResourceAttachmentSummary = {
1526
+ mode: "once" | "session" | "always";
1527
+ context: "user_private" | "workspace_shared";
1528
+ resourceCount: number;
1529
+ resourceKinds: Array<"variable_set" | "rig" | "connected_machine">;
1530
+ sharedOutputWarningVersion: 1;
1531
+ };
1532
+
1252
1533
  export type SessionTurn = {
1253
1534
  id: string;
1254
1535
  workspaceId: string;
@@ -1276,6 +1557,7 @@ export type SessionTurn = {
1276
1557
  initiator: TurnInitiator;
1277
1558
  initiatorContext: Record<string, unknown>;
1278
1559
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
1560
+ personalResources?: PersonalResourceAttachmentSummary | null | undefined;
1279
1561
  cancelledBy?: string | null;
1280
1562
  cancelReason?: string | null;
1281
1563
  startedAt: string | null;
@@ -1369,6 +1651,9 @@ export const SESSION_EVENT_TYPES = [
1369
1651
  "turn.superseded",
1370
1652
  "turn.recovery.requested",
1371
1653
  "turn.capacity_waiting",
1654
+ "turn.startup.phase.started",
1655
+ "turn.startup.phase.completed",
1656
+ "turn.startup.phase.failed",
1372
1657
  "agent.message.delta",
1373
1658
  "agent.message.completed",
1374
1659
  "agent.reasoning.delta",
@@ -1386,6 +1671,8 @@ export const SESSION_EVENT_TYPES = [
1386
1671
  "sandbox.operation.started",
1387
1672
  "sandbox.operation.completed",
1388
1673
  "sandbox.operation.failed",
1674
+ "session.command.backgrounded",
1675
+ "session.command.finished",
1389
1676
  "sandbox.command.output.delta",
1390
1677
  "artifact.created",
1391
1678
  "goal.set",
@@ -1397,6 +1684,7 @@ export const SESSION_EVENT_TYPES = [
1397
1684
  "goal.paused",
1398
1685
  "goal.resumed",
1399
1686
  "goal.cleared",
1687
+ "goal.held",
1400
1688
  "goal.continuation",
1401
1689
  "system.update.pending",
1402
1690
  "system.update.delivered",
@@ -1433,6 +1721,7 @@ export const SESSION_EVENT_TYPES = [
1433
1721
  "terminal.pty.exited",
1434
1722
  "session.title_set",
1435
1723
  "session.visibility.changed",
1724
+ "session.personal_resources.attached",
1436
1725
  "session.mcp.approval_policy.updated",
1437
1726
  "session.tool_policy.updated",
1438
1727
  // Multi-account Codex (P1): the session's inference account changed.
@@ -1873,6 +2162,14 @@ export type FsReadResponse = {
1873
2162
  isBinary: boolean;
1874
2163
  revision: number;
1875
2164
  };
2165
+ export const SANDBOX_FILE_ARTIFACT_MAX_BYTES = 25 * 1024 * 1024 - 1;
2166
+ export type PublishSandboxFileArtifactRequest = { path: string };
2167
+ export type SandboxFileArtifactReceipt = {
2168
+ type: "sandbox_file";
2169
+ sandboxPath: string;
2170
+ filename: string;
2171
+ artifact: RetainedArtifactReference;
2172
+ };
1876
2173
  export type FsWriteRequest = {
1877
2174
  path: string;
1878
2175
  encoding?: FsEncoding;
@@ -2196,6 +2493,55 @@ export type ScheduledTaskScheduleSpec =
2196
2493
  daysOfWeek?: ScheduledTaskDayOfWeek[] | undefined;
2197
2494
  };
2198
2495
 
2496
+ export type IncidentTelemetrySeriesMetadata = {
2497
+ metric: string;
2498
+ labels: string[];
2499
+ };
2500
+
2501
+ export type IncidentTelemetryDataRoute =
2502
+ | { kind: "mcp"; serverId: string }
2503
+ | { kind: "first_party"; tool: FirstPartyMcpToolName }
2504
+ | { kind: "variable_set"; variableSetName: string; variableNames: string[] }
2505
+ | { kind: "rig_credential_hook"; credentialHookId: string };
2506
+
2507
+ export type IncidentTelemetryPreflight = {
2508
+ requiredResources: ResourceRef[];
2509
+ requiredMcpServerIds: string[];
2510
+ requiredFirstPartyMcpTools: FirstPartyMcpToolName[];
2511
+ requiredFirstPartyMcpPermissions: Permission[];
2512
+ requiredRig: { name: string; credentialHookIds: string[] } | null;
2513
+ requiredVariableSetNames: string[];
2514
+ requiredVariableNames: string[];
2515
+ dataSource: {
2516
+ kind: "prometheus";
2517
+ queryPath: "/api/v1/query" | "/api/v1/query_range";
2518
+ workspaceLabel: string;
2519
+ alertSelectorLabels: string[];
2520
+ route: IncidentTelemetryDataRoute;
2521
+ requiredSeries: IncidentTelemetrySeriesMetadata[];
2522
+ availableSeries: IncidentTelemetrySeriesMetadata[];
2523
+ };
2524
+ };
2525
+
2526
+ export type IncidentTelemetryPreflightInput = Omit<
2527
+ IncidentTelemetryPreflight,
2528
+ | "requiredResources"
2529
+ | "requiredMcpServerIds"
2530
+ | "requiredFirstPartyMcpTools"
2531
+ | "requiredFirstPartyMcpPermissions"
2532
+ | "requiredRig"
2533
+ | "requiredVariableSetNames"
2534
+ | "requiredVariableNames"
2535
+ > & {
2536
+ requiredResources?: ResourceRef[] | undefined;
2537
+ requiredMcpServerIds?: string[] | undefined;
2538
+ requiredFirstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2539
+ requiredFirstPartyMcpPermissions?: Permission[] | undefined;
2540
+ requiredRig?: { name: string; credentialHookIds?: string[] | undefined } | null | undefined;
2541
+ requiredVariableSetNames?: string[] | undefined;
2542
+ requiredVariableNames?: string[] | undefined;
2543
+ };
2544
+
2199
2545
  export type ScheduledTaskAgentConfig = {
2200
2546
  prompt: string;
2201
2547
  resources: ResourceRef[];
@@ -2206,6 +2552,8 @@ export type ScheduledTaskAgentConfig = {
2206
2552
  reasoningEffort?: ReasoningEffort | undefined;
2207
2553
  sandboxBackend?: SandboxBackend | undefined;
2208
2554
  goal?: GoalSpec | undefined;
2555
+ executionClass?: "incident_telemetry" | undefined;
2556
+ incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
2209
2557
  maxNestedAgentDepth?: number | undefined;
2210
2558
  };
2211
2559
 
@@ -2262,6 +2610,8 @@ export type ScheduledTask = {
2262
2610
  createdBy?: TurnInitiator | undefined;
2263
2611
  createdByContext?: TurnInitiatorContext | undefined;
2264
2612
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
2613
+ authorityRevision: number;
2614
+ executionDigest: string;
2265
2615
  targetSessionId: string | null;
2266
2616
  reusableSessionId: string | null;
2267
2617
  variableSetId: string | null;
@@ -2279,6 +2629,7 @@ export type CreateSessionRequest = {
2279
2629
  // projection before OpenGeni admits the initial turn. Replays must retain the
2280
2630
  // same UUID and idempotency key.
2281
2631
  requestedSessionId?: string | undefined;
2632
+ visibility?: SessionVisibility | undefined;
2282
2633
  initialMessage?: string | undefined;
2283
2634
  /** Create an idle session shell so realtime voice can be the first interaction. */
2284
2635
  startMode?: "realtime" | undefined;
@@ -2287,7 +2638,7 @@ export type CreateSessionRequest = {
2287
2638
  // Per-session agent persona/system instructions (org-visible metadata, not a
2288
2639
  // secret). Delivered system-level, composed AFTER the per-workspace persona —
2289
2640
  // how a host supplies per-agent-type prompts without leaking them into the
2290
- // user-visible timeline. Trimmed, non-empty, max 32768 chars.
2641
+ // user-visible timeline. Trimmed, non-empty, max 65536 chars.
2291
2642
  instructions?: string | undefined;
2292
2643
  /** Immutable normalized prompt-policy role; distinct from membership roles. */
2293
2644
  policyRole?: string | undefined;
@@ -2325,6 +2676,8 @@ export type CreateSessionRequest = {
2325
2676
  firstPartyMcpPermissions?: string[] | undefined;
2326
2677
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2327
2678
  mcpServers?: SessionMcpServerInput[] | undefined;
2679
+ /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2680
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
2328
2681
  // Shared-sandbox placement (mirror of `@opengeni/contracts` CreateSessionRequest.sandbox,
2329
2682
  // addendum 05 §D.1). Three-way union; OMITTED ⇒ the context-dependent server default
2330
2683
  // (from inside a session → "shared" with the creator's box, top-level → "new").
@@ -2374,6 +2727,7 @@ export const KNOWN_PERMISSIONS = [
2374
2727
  "variable-sets:read",
2375
2728
  "variable-sets:write",
2376
2729
  "variable-sets:manage",
2730
+ "variable-sets:attach",
2377
2731
  "variable-sets:use",
2378
2732
  "secrets:list",
2379
2733
  "secrets:read",
@@ -2402,6 +2756,7 @@ export type FirstPartyMcpToolName =
2402
2756
  | "goal_set"
2403
2757
  | "goal_update"
2404
2758
  | "goal_progress"
2759
+ | "goal_wait"
2405
2760
  | "goal_complete"
2406
2761
  | "goal_pause"
2407
2762
  | "memory_search"
@@ -2412,6 +2767,18 @@ export type FirstPartyMcpToolName =
2412
2767
  | "task_notes_list"
2413
2768
  | "task_note_save"
2414
2769
  | "task_note_archive"
2770
+ | "task_note_replace"
2771
+ | "knowledge_propose"
2772
+ | "knowledge_correct"
2773
+ | "task_note_promote_knowledge"
2774
+ | "task_note_promote_instruction_policy"
2775
+ | "task_note_promote_preference"
2776
+ | "instruction_policy_propose"
2777
+ | "preference_propose"
2778
+ | "remember"
2779
+ | "remember_confirm"
2780
+ | "company_profile_propose"
2781
+ | "company_profile_confirm"
2415
2782
  | "sandboxes_list"
2416
2783
  | "sandbox_attach"
2417
2784
  | "sandbox_swap"
@@ -2426,11 +2793,13 @@ export type FirstPartyMcpToolName =
2426
2793
  | "sessions_list"
2427
2794
  | "session_get"
2428
2795
  | "session_events"
2796
+ | "session_wait"
2429
2797
  | "session_create"
2430
2798
  | "session_send_message"
2431
2799
  | "session_pause"
2432
2800
  | "session_resume"
2433
2801
  | "session_steer"
2802
+ | "session_human_input_respond"
2434
2803
  | "set_other_session_title"
2435
2804
  | "interaction_discover"
2436
2805
  | "browser_open"
@@ -2489,6 +2858,7 @@ export type FirstPartyMcpToolName =
2489
2858
  | "scheduled_tasks_delete"
2490
2859
  | "scheduled_task_runs_list"
2491
2860
  | "slack_bot_list_channels"
2861
+ | "slack_bot_search"
2492
2862
  | "slack_bot_channel_history"
2493
2863
  | "slack_bot_thread_replies"
2494
2864
  | "slack_bot_list_users"
@@ -2510,6 +2880,7 @@ export type FirstPartyMcpToolName =
2510
2880
  | "atlassian_sources_list"
2511
2881
  | "atlassian_search"
2512
2882
  | "atlassian_get"
2883
+ | "sandbox_file_publish"
2513
2884
  | "artifacts_list"
2514
2885
  | "artifacts_get_source"
2515
2886
  | "artifacts_create"
@@ -2664,6 +3035,8 @@ export type ModelCredentialReadinessV1 = {
2664
3035
 
2665
3036
  export type WorkspaceModelCatalogModel = ClientModel & {
2666
3037
  credentialReadiness: ModelCredentialReadinessV1;
3038
+ /** Exact workspace-policy verdict without exposing provider identity. */
3039
+ policyAllowed?: boolean | undefined;
2667
3040
  availability: ModelAvailabilityV1;
2668
3041
  };
2669
3042
 
@@ -2671,6 +3044,21 @@ export type WorkspaceModelCatalogResponse = {
2671
3044
  models: WorkspaceModelCatalogModel[];
2672
3045
  };
2673
3046
 
3047
+ /**
3048
+ * The workspace's hard model/provider allowlist. `null` means unrestricted for
3049
+ * that dimension; an empty array is an explicit total block.
3050
+ */
3051
+ export type WorkspaceModelAccessPolicy = {
3052
+ allowedProviders: string[] | null;
3053
+ allowedModels: string[] | null;
3054
+ };
3055
+
3056
+ /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
3057
+ export type UpdateWorkspaceModelAccessPolicyRequest = {
3058
+ allowedProviders?: string[] | null | undefined;
3059
+ allowedModels?: string[] | null | undefined;
3060
+ };
3061
+
2674
3062
  /**
2675
3063
  * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
2676
3064
  * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
@@ -2818,6 +3206,12 @@ export type CodexAccountOverview = {
2818
3206
  credits: CodexResetCredit[];
2819
3207
  };
2820
3208
  canRedeem: boolean;
3209
+ /** Secret-free reason redemption is owner-actionable or view-only. */
3210
+ redemptionAccess: {
3211
+ ownership: "current_human" | "unowned" | "different_human" | "managed_human_unavailable";
3212
+ /** A direct managed-cookie admin may claim only an unowned same-provider row by reconnecting. */
3213
+ canClaimUnownedViaReconnect: boolean;
3214
+ };
2821
3215
  /** Owning managed-cookie human may replay durable completion without a healthy provider token. */
2822
3216
  canResumeRedemption: boolean;
2823
3217
  /** Durable owner-scoped ambiguity/completion discovery; never redemption authority for agents. */
@@ -2992,11 +3386,16 @@ export type ClientAuthConfig =
2992
3386
  | { mode: "none" }
2993
3387
  | { mode: "deploymentKey"; headerName: "x-opengeni-access-key" }
2994
3388
  | { mode: "configuredToken"; headerName: "authorization"; scheme: "bearer" }
2995
- | { mode: "managedSession"; session: "cookie" };
3389
+ | {
3390
+ mode: "managedSession";
3391
+ session: "cookie";
3392
+ /** Defaults to true when omitted by an older deployment. */
3393
+ emailVerificationRequired?: boolean;
3394
+ };
2996
3395
 
2997
3396
  // Kept value-identical to @opengeni/contracts and pinned by the SDK contract
2998
3397
  // parity suite. The SDK has no runtime dependency on the Zod contracts package.
2999
- export const OPENGENI_API_CONTRACT_REVISION = "2026-08-model-context-v1" as const;
3398
+ export const OPENGENI_API_CONTRACT_REVISION = "2026-08-atomic-session-fork-visibility-v1" as const;
3000
3399
  export const OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract" as const;
3001
3400
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
3002
3401
  export const OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id" as const;
@@ -3206,6 +3605,220 @@ export type ListManagedOrganizationMembershipsResponse = {
3206
3605
  memberships: ManagedOrganizationMembership[];
3207
3606
  };
3208
3607
 
3608
+ export type UserResourceKind =
3609
+ | "connection"
3610
+ | "document"
3611
+ | "variable_set"
3612
+ | "rig"
3613
+ | "connected_machine";
3614
+ export type UserResourceGrantAction =
3615
+ | "connection.use"
3616
+ | "document.read"
3617
+ | "variable_set.use"
3618
+ | "rig.use"
3619
+ | "connected_machine.use";
3620
+ export type UserResourceAuthorityGrant = {
3621
+ grantId: string;
3622
+ targetWorkspaceId: string;
3623
+ targetSessionId: string | null;
3624
+ action: UserResourceGrantAction;
3625
+ mode: "once" | "session" | "always";
3626
+ context: "user_private" | "workspace_shared";
3627
+ authorityEpoch: number | null;
3628
+ generation: number;
3629
+ status: "active" | "consumed" | "revoked" | "expired";
3630
+ expiresAt: string | null;
3631
+ delegation: UserResourceDelegation;
3632
+ };
3633
+ export type UserResourceAuthoritySummary = {
3634
+ authorityId: string;
3635
+ resourceKind: UserResourceKind;
3636
+ resourceId: string;
3637
+ originWorkspaceId: string | null;
3638
+ generation: number;
3639
+ status: "active" | "retained" | "revoked";
3640
+ grants: UserResourceAuthorityGrant[];
3641
+ };
3642
+ export type ListUserResourceAuthoritiesOptions = {
3643
+ resourceKind: UserResourceKind;
3644
+ cursor?: string | undefined;
3645
+ limit?: number | undefined;
3646
+ };
3647
+ export type ListUserResourceAuthoritiesResponse = {
3648
+ scope: "user";
3649
+ authorities: UserResourceAuthoritySummary[];
3650
+ nextCursor: string | null;
3651
+ };
3652
+ export type IssueUserResourceGrantRequest =
3653
+ | {
3654
+ scope: "user";
3655
+ resourceKind: UserResourceKind;
3656
+ mode: "session";
3657
+ context: "user_private" | "workspace_shared";
3658
+ sessionId: string;
3659
+ expectedAuthorityEpoch: number;
3660
+ workspaceSharedAcknowledged?: boolean | undefined;
3661
+ }
3662
+ | {
3663
+ scope: "user";
3664
+ resourceKind: UserResourceKind;
3665
+ mode: "always";
3666
+ context: "user_private" | "workspace_shared";
3667
+ sessionId?: null | undefined;
3668
+ expectedAuthorityEpoch?: null | undefined;
3669
+ workspaceSharedAcknowledged?: boolean | undefined;
3670
+ };
3671
+ export type UserResourceGrantMutationResponse = {
3672
+ scope: "user";
3673
+ grant: UserResourceAuthorityGrant;
3674
+ };
3675
+ export type RevokeUserResourceGrantResponse = {
3676
+ scope: "user";
3677
+ grant: {
3678
+ grantId: string;
3679
+ generation: number;
3680
+ status: "revoked";
3681
+ revokedAt: string;
3682
+ };
3683
+ };
3684
+
3685
+ export type OrganizationMembershipRole = "owner" | "admin" | "member";
3686
+ export type OrganizationInvitation = {
3687
+ id: string;
3688
+ organizationId: string;
3689
+ targetEmail: string;
3690
+ targetName: string | null;
3691
+ initialWorkspaceIds: string[];
3692
+ role: OrganizationMembershipRole;
3693
+ status: "pending" | "accepted" | "revoked" | "expired";
3694
+ revision: number;
3695
+ expiresAt: string;
3696
+ acceptedMembershipId: string | null;
3697
+ createdAt: string;
3698
+ updatedAt: string;
3699
+ };
3700
+ export type OrganizationMember = {
3701
+ id: string;
3702
+ organizationId: string;
3703
+ subjectId: string;
3704
+ name: string | null;
3705
+ email: string | null;
3706
+ role: OrganizationMembershipRole;
3707
+ status: "provisioning" | "active" | "suspended" | "revoked";
3708
+ authorizationRevision: number;
3709
+ personalWorkspaceId: string | null;
3710
+ revokedAt: string | null;
3711
+ personalRetentionUntil: string | null;
3712
+ createdAt: string;
3713
+ updatedAt: string;
3714
+ };
3715
+ export type OrganizationSummary = {
3716
+ id: string;
3717
+ name: string;
3718
+ createdAt: string;
3719
+ updatedAt: string;
3720
+ };
3721
+ export type OrganizationWorkspaceAccessMember = {
3722
+ membershipId: string;
3723
+ subjectId: string;
3724
+ subjectLabel: string | null;
3725
+ principalKind: "human" | "service";
3726
+ role: string;
3727
+ permissions: string[];
3728
+ createdAt: string;
3729
+ };
3730
+ export type OrganizationWorkspaceAccess = {
3731
+ id: string;
3732
+ name: string;
3733
+ slug: string | null;
3734
+ createdAt: string;
3735
+ updatedAt: string;
3736
+ members: OrganizationWorkspaceAccessMember[];
3737
+ };
3738
+ export type OrganizationAdministrationOverview = {
3739
+ organization: OrganizationSummary;
3740
+ workspaces: OrganizationWorkspaceAccess[];
3741
+ };
3742
+ export type OrganizationPrivateSessionSettings = {
3743
+ organizationId: string;
3744
+ enabled: boolean;
3745
+ available: boolean;
3746
+ version: number;
3747
+ updatedAt: string;
3748
+ changed?: boolean;
3749
+ };
3750
+ export type AddOrganizationWorkspaceMemberRequest = {
3751
+ organizationMembershipId: string;
3752
+ role?: string | undefined;
3753
+ permissions: Permission[];
3754
+ };
3755
+ export type CreateOrganizationWorkspaceRequest = {
3756
+ name: string;
3757
+ slug?: string | null;
3758
+ agentInstructions?: string | null;
3759
+ operationId: string;
3760
+ };
3761
+ export type CreateOrganizationRequest = {
3762
+ name: string;
3763
+ operationId: string;
3764
+ };
3765
+ export type CreateOrganizationResponse = {
3766
+ organization: OrganizationSummary;
3767
+ workspaceId: string;
3768
+ };
3769
+ export type UpdateOrganizationNameRequest = {
3770
+ name: string;
3771
+ expectedUpdatedAt: string;
3772
+ operationId: string;
3773
+ };
3774
+ export type UpdateOrganizationPrivateSessionSettingsRequest = {
3775
+ enabled: boolean;
3776
+ expectedVersion: number;
3777
+ operationId: string;
3778
+ };
3779
+ export type OrganizationRetentionPolicy = {
3780
+ organizationId: string;
3781
+ mode: "retain" | "delete_after";
3782
+ retentionDays: number | null;
3783
+ version: number;
3784
+ updatedAt: string;
3785
+ };
3786
+ export type CreateOrganizationInvitationRequest = {
3787
+ email: string;
3788
+ name?: string;
3789
+ initialWorkspaceIds?: string[];
3790
+ role?: OrganizationMembershipRole;
3791
+ expiresAt: string;
3792
+ operationId: string;
3793
+ };
3794
+ export type AcceptOrganizationInvitationRequest = {
3795
+ expectedRevision: number;
3796
+ operationId: string;
3797
+ };
3798
+ export type RevokeOrganizationInvitationRequest = AcceptOrganizationInvitationRequest;
3799
+ export type UpdateOrganizationMemberRequest = {
3800
+ kind: "change_role" | "suspend" | "reactivate" | "offboard";
3801
+ role?: OrganizationMembershipRole;
3802
+ expectedAuthorizationRevision: number;
3803
+ operationId: string;
3804
+ reason?: string;
3805
+ };
3806
+ export type UpdateOrganizationRetentionPolicyRequest = {
3807
+ mode: "retain" | "delete_after";
3808
+ retentionDays: number | null;
3809
+ expectedVersion: number;
3810
+ operationId: string;
3811
+ };
3812
+ export type ListOrganizationInvitationsPageResponse = {
3813
+ invitations: OrganizationInvitation[];
3814
+ nextCursor: string | null;
3815
+ };
3816
+ export type ListOrganizationMembersResponse = { members: OrganizationMember[] };
3817
+ export type AcceptOrganizationInvitationResponse = {
3818
+ invitation: OrganizationInvitation;
3819
+ membership: OrganizationMember;
3820
+ };
3821
+
3209
3822
  export type Workspace = {
3210
3823
  id: string;
3211
3824
  accountId: string;
@@ -3231,6 +3844,10 @@ export type WorkspaceSettings = {
3231
3844
  memoryEnabled?: boolean | undefined;
3232
3845
  /** Reversible Memory V1 prompt composition rollout. */
3233
3846
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3847
+ /** Model policy inherited by new chats and scheduled tasks. */
3848
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3849
+ /** Exact capability selection inherited by new top-level sessions. */
3850
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
3234
3851
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3235
3852
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3236
3853
  maxNestedAgentDepth?: number | null | undefined;
@@ -3239,15 +3856,38 @@ export type WorkspaceSettings = {
3239
3856
  /** Whether agents may invoke the built-in structured human-input tool. */
3240
3857
  agentHumanInputEnabled?: boolean | undefined;
3241
3858
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3859
+ /** Slack orchestration notices; both default off when absent or invalid. */
3860
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
3242
3861
  [key: string]: unknown;
3243
3862
  };
3244
3863
 
3864
+ export type WorkspaceSessionDefaults = {
3865
+ model: string;
3866
+ reasoningEffort: ReasoningEffort;
3867
+ };
3868
+
3869
+ export type WorkspaceSessionToolDefaults = {
3870
+ mcpServerIds: string[];
3871
+ firstPartyMcpTools: FirstPartyMcpToolName[];
3872
+ };
3873
+
3245
3874
  export type WorkspaceSlackReactionSummonSettings = {
3246
3875
  enabled: boolean;
3247
3876
  emoji: "genie";
3248
3877
  channelPolicy: { mode: "bot_member" } | { mode: "allowlist"; channelIds: string[] };
3249
3878
  };
3250
3879
 
3880
+ /**
3881
+ * Per-workspace switches for the two Slack orchestration notices. Both are off
3882
+ * unless the workspace explicitly turned them on.
3883
+ */
3884
+ export type WorkspaceSlackOrchestrationNoticeSettings = {
3885
+ /** Post a pointer card when a child worker blocks on input or an approval. */
3886
+ childRequiresAction?: boolean | undefined;
3887
+ /** Post one line when a goal pauses for budget or the continuation cap. */
3888
+ goalPaused?: boolean | undefined;
3889
+ };
3890
+
3251
3891
  export type SlackReactionChannel = {
3252
3892
  id: string;
3253
3893
  name: string | null;
@@ -3259,6 +3899,24 @@ export type SlackReactionChannelListResponse = {
3259
3899
  nextCursor: string | null;
3260
3900
  };
3261
3901
 
3902
+ export type SlackChannelRoute = {
3903
+ slackChannelId: string;
3904
+ targetWorkspaceId: string;
3905
+ targetWorkspaceName: string | null;
3906
+ source: "picker" | "admin";
3907
+ updatedAt: string;
3908
+ };
3909
+
3910
+ export type SlackChannelRouteListResponse = {
3911
+ routes: SlackChannelRoute[];
3912
+ routingEnabled: boolean;
3913
+ };
3914
+
3915
+ export type UpdateSlackChannelRoutesRequest = {
3916
+ connectionId: string;
3917
+ routes: Array<{ slackChannelId: string; targetWorkspaceId: string | null }>;
3918
+ };
3919
+
3262
3920
  export type WorkspaceVoiceInputSettings = {
3263
3921
  enabled: boolean;
3264
3922
  };
@@ -3266,12 +3924,15 @@ export type WorkspaceVoiceInputSettings = {
3266
3924
  export type UpdateWorkspaceSettingsRequest = {
3267
3925
  memoryEnabled?: boolean | undefined;
3268
3926
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3927
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3928
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
3269
3929
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3270
3930
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3271
3931
  maxNestedAgentDepth?: number | null | undefined;
3272
3932
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3273
3933
  agentHumanInputEnabled?: boolean | undefined;
3274
3934
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3935
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
3275
3936
  [key: string]: unknown;
3276
3937
  };
3277
3938
 
@@ -3299,6 +3960,7 @@ export type ApiKey = {
3299
3960
  accountId: string;
3300
3961
  workspaceId: string | null;
3301
3962
  name: string;
3963
+ description: string | null;
3302
3964
  prefix: string;
3303
3965
  permissions: Permission[];
3304
3966
  expiresAt: string | null;
@@ -3310,6 +3972,7 @@ export type ApiKey = {
3310
3972
 
3311
3973
  export type CreateApiKeyRequest = {
3312
3974
  name: string;
3975
+ description?: string | undefined;
3313
3976
  permissions: Permission[];
3314
3977
  expiresAt?: string | undefined;
3315
3978
  };
@@ -3417,12 +4080,14 @@ export type SessionGoalRevision = {
3417
4080
  resultObjectiveRevision: number | null;
3418
4081
  text: string;
3419
4082
  successCriteria: string | null;
4083
+ rootConstraints: string[];
3420
4084
  mutationPolicy: SessionGoalMutationPolicy;
3421
4085
  rationale: string;
3422
4086
  actor: "agent" | "api" | "scheduled_task";
3423
4087
  actorTurnId: string | null;
3424
4088
  actorAttemptId: string | null;
3425
4089
  proposalId: string | null;
4090
+ rollbackOfRevisionId: string | null;
3426
4091
  createdAt: string;
3427
4092
  };
3428
4093
 
@@ -3431,6 +4096,32 @@ export type ApplySessionGoalRevisionRequest = {
3431
4096
  rationale?: string | undefined;
3432
4097
  };
3433
4098
 
4099
+ export type ListSessionGoalRevisionsOptions = {
4100
+ limit?: number | undefined;
4101
+ before?: string | undefined;
4102
+ };
4103
+
4104
+ export type ListSessionGoalRevisionsResponse = {
4105
+ revisions: SessionGoalRevision[];
4106
+ hasMore: boolean;
4107
+ nextCursor: string | null;
4108
+ };
4109
+
4110
+ export type RejectSessionGoalRevisionRequest = {
4111
+ expectedObjectiveRevision: number;
4112
+ rationale: string;
4113
+ };
4114
+
4115
+ export type RejectSessionGoalRevisionResponse = {
4116
+ revision: SessionGoalRevision;
4117
+ replay: boolean;
4118
+ };
4119
+
4120
+ export type RollbackSessionGoalRevisionRequest = {
4121
+ expectedObjectiveRevision: number;
4122
+ rationale: string;
4123
+ };
4124
+
3434
4125
  export type SessionGoalContinuationState =
3435
4126
  | "inactive"
3436
4127
  | "scheduled"
@@ -3450,6 +4141,8 @@ export type SessionGoalContinuationReason =
3450
4141
  | "provider_backpressure"
3451
4142
  | "session_cancelled"
3452
4143
  | "system_work_pending"
4144
+ | "held_for_input"
4145
+ | "backoff_pending"
3453
4146
  | "missing_obligation";
3454
4147
 
3455
4148
  export type SessionGoalContinuation = {
@@ -3459,6 +4152,8 @@ export type SessionGoalContinuation = {
3459
4152
  observedRevision: number;
3460
4153
  nextAttemptAt: string | null;
3461
4154
  lastError: string | null;
4155
+ /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
4156
+ holdReason?: string | null | undefined;
3462
4157
  };
3463
4158
 
3464
4159
  export type SessionGoal = {
@@ -3469,6 +4164,7 @@ export type SessionGoal = {
3469
4164
  status: SessionGoalStatus;
3470
4165
  text: string;
3471
4166
  successCriteria: string | null;
4167
+ rootConstraints: string[];
3472
4168
  evidence: string | null;
3473
4169
  rationale: string | null;
3474
4170
  pausedReason: string | null;
@@ -3494,6 +4190,7 @@ export type UpdateSessionGoalRequest =
3494
4190
  | {
3495
4191
  text: string;
3496
4192
  successCriteria?: string | null | undefined;
4193
+ rootConstraints?: string[] | undefined;
3497
4194
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
3498
4195
  rationale: string;
3499
4196
  expectedObjectiveRevision: number;
@@ -3548,6 +4245,7 @@ export type EffectiveSessionControl = {
3548
4245
  interruptionPendingCount: number;
3549
4246
  quiescencePendingCount: number;
3550
4247
  } | null;
4248
+ backgroundCommandSettlement?: { state: "stopping"; commandCount: number } | null | undefined;
3551
4249
  };
3552
4250
 
3553
4251
  export type SessionCommandReceipt = {
@@ -3563,6 +4261,11 @@ export type SessionCommandReceipt = {
3563
4261
  createdAt: string;
3564
4262
  };
3565
4263
 
4264
+ export type SessionPromptRouting =
4265
+ | "accepted_for_execution"
4266
+ | "queued_for_execution"
4267
+ | "accepted_for_steering";
4268
+
3566
4269
  export type ComposerDraft = {
3567
4270
  revision: number;
3568
4271
  text: string;
@@ -3570,13 +4273,14 @@ export type ComposerDraft = {
3570
4273
  resources: ResourceRef[];
3571
4274
  model: string;
3572
4275
  reasoningEffort: ReasoningEffort;
3573
- latencyMode?: LatencyMode | undefined;
4276
+ latencyMode: LatencyMode;
3574
4277
  sourceTurnId: string | null;
3575
4278
  sourceTurnVersion: number | null;
3576
4279
  updatedAt: string | null;
3577
4280
  };
3578
4281
 
3579
4282
  export type NewSessionDraftOptions = {
4283
+ visibility?: SessionVisibility | undefined;
3580
4284
  sandboxBackend?: SandboxBackend | undefined;
3581
4285
  targetSandboxId?: string | undefined;
3582
4286
  workingDir?: string | undefined;
@@ -3587,6 +4291,17 @@ export type NewSessionDraftOptions = {
3587
4291
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
3588
4292
  };
3589
4293
 
4294
+ export type NewSessionSelectionHistory = {
4295
+ /** Most-recently used project first. Null channelId is the Default project. */
4296
+ projects: Array<{
4297
+ channelId: string | null;
4298
+ /** Null means the managed sandbox was used most recently in this project. */
4299
+ targetSandboxId: string | null;
4300
+ /** Most-recently used machine in this project first. */
4301
+ machines: Array<{ sandboxId: string; workingDir: string | null }>;
4302
+ }>;
4303
+ };
4304
+
3590
4305
  export type NewSessionDraft = {
3591
4306
  revision: number;
3592
4307
  text: string;
@@ -3596,8 +4311,9 @@ export type NewSessionDraft = {
3596
4311
  toolsProvided: boolean;
3597
4312
  model: string;
3598
4313
  reasoningEffort: ReasoningEffort;
3599
- latencyMode?: LatencyMode | undefined;
4314
+ latencyMode: LatencyMode;
3600
4315
  options: NewSessionDraftOptions;
4316
+ selectionHistory: NewSessionSelectionHistory;
3601
4317
  updatedAt: string | null;
3602
4318
  };
3603
4319
 
@@ -3631,7 +4347,12 @@ export type SessionSystemUpdateKind =
3631
4347
  | "agent_message"
3632
4348
  | "agent_steer_instruction"
3633
4349
  | "child_terminal_result"
3634
- | "media_generation_result";
4350
+ | "media_generation_result"
4351
+ | "child_requires_action"
4352
+ | "child_requires_action_resolved"
4353
+ | "child_paused"
4354
+ | "child_waiting_capacity"
4355
+ | "child_progress";
3635
4356
 
3636
4357
  export type SessionSystemUpdateState =
3637
4358
  | "pending"
@@ -3746,7 +4467,31 @@ export type SaveComposerDraftRequest = Omit<
3746
4467
  "revision" | "sourceTurnId" | "sourceTurnVersion" | "updatedAt"
3747
4468
  > & { expectedRevision: number };
3748
4469
 
3749
- export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "updatedAt"> & {
4470
+ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expectedRevision"> & {
4471
+ expectedDraftRevision: number;
4472
+ clientEventId: string;
4473
+ delivery: "send" | "steer";
4474
+ controlEtag?: string;
4475
+ modelContext?: string;
4476
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
4477
+ connectionAuthorities?: McpConnectionAuthoritySelection[];
4478
+ personalResourceAttachment?: PersonalResourceAttachmentIntent;
4479
+ };
4480
+
4481
+ export type SubmitComposerDraftResponse = {
4482
+ accepted: SessionEvent;
4483
+ turn: SessionTurn;
4484
+ draft: ComposerDraft;
4485
+ receipt: SessionCommandReceipt;
4486
+ routing: SessionPromptRouting;
4487
+ interruptionCount: number;
4488
+ replay: boolean;
4489
+ };
4490
+
4491
+ export type SaveNewSessionDraftRequest = Omit<
4492
+ NewSessionDraft,
4493
+ "revision" | "selectionHistory" | "updatedAt"
4494
+ > & {
3750
4495
  expectedRevision: number;
3751
4496
  };
3752
4497
 
@@ -3763,6 +4508,8 @@ export type ScheduledTaskAgentConfigInput = {
3763
4508
  reasoningEffort?: ReasoningEffort | undefined;
3764
4509
  sandboxBackend?: SandboxBackend | undefined;
3765
4510
  goal?: GoalSpec | undefined;
4511
+ executionClass?: "incident_telemetry" | undefined;
4512
+ incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
3766
4513
  maxNestedAgentDepth?: number | undefined;
3767
4514
  };
3768
4515
 
@@ -3772,6 +4519,7 @@ export type CreateAgentScheduledTaskRequest = {
3772
4519
  action?: { kind: "agent_turn" } | undefined;
3773
4520
  runMode?: ScheduledTaskRunMode | undefined;
3774
4521
  targetSessionId?: string | null | undefined;
4522
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
3775
4523
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3776
4524
  agentConfig: ScheduledTaskAgentConfigInput;
3777
4525
  status?: ScheduledTaskStatus | undefined;
@@ -3801,6 +4549,7 @@ export type UpdateScheduledTaskRequest = {
3801
4549
  schedule?: ScheduledTaskScheduleSpec | undefined;
3802
4550
  runMode?: ScheduledTaskRunMode | undefined;
3803
4551
  targetSessionId?: string | null | undefined;
4552
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
3804
4553
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3805
4554
  action?: ScheduledTaskAction | undefined;
3806
4555
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
@@ -3863,6 +4612,8 @@ export type ScheduledTaskRun = {
3863
4612
  accountId: string;
3864
4613
  workspaceId: string;
3865
4614
  taskId: string;
4615
+ taskAuthorityRevision: number | null;
4616
+ taskExecutionDigest: string | null;
3866
4617
  status: ScheduledTaskRunStatus;
3867
4618
  triggerType: ScheduledTaskTriggerType;
3868
4619
  scheduledAt: string | null;
@@ -3900,6 +4651,9 @@ export type VariableSet = {
3900
4651
  id: string;
3901
4652
  accountId: string;
3902
4653
  workspaceId: string;
4654
+ scope: "organization" | "workspace" | "user";
4655
+ generation: number;
4656
+ status: "active" | "revoked";
3903
4657
  name: string;
3904
4658
  description: string | null;
3905
4659
  variables: VariableSetVariableMetadata[];
@@ -3914,6 +4668,8 @@ export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3914
4668
  export type WorkspaceEnvironment = VariableSet;
3915
4669
 
3916
4670
  export type CreateVariableSetRequest = {
4671
+ /** Omitted remains the legacy workspace-owned path. */
4672
+ scope?: "organization" | "workspace" | "user" | undefined;
3917
4673
  name: string;
3918
4674
  description?: string | undefined;
3919
4675
  /** Initial variables. Values are write-only: they never come back on reads. */
@@ -4012,6 +4768,8 @@ export type Channel = {
4012
4768
  workspaceId: string;
4013
4769
  name: string;
4014
4770
  description: string | null;
4771
+ pinned: boolean;
4772
+ sortOrder: number;
4015
4773
  createdBy: string | null;
4016
4774
  createdAt: string;
4017
4775
  updatedAt: string;
@@ -4025,6 +4783,12 @@ export type CreateChannelRequest = {
4025
4783
  export type UpdateChannelRequest = {
4026
4784
  name?: string;
4027
4785
  description?: string | null;
4786
+ pinned?: boolean;
4787
+ };
4788
+
4789
+ /** Complete workspace project order. It is replaced atomically after a drag. */
4790
+ export type ReorderChannelsRequest = {
4791
+ channelIds: string[];
4028
4792
  };
4029
4793
 
4030
4794
  /** Re-files one session; null moves it back to the unfiled inbox. */
@@ -4036,6 +4800,9 @@ export type Rig = {
4036
4800
  id: string;
4037
4801
  accountId: string;
4038
4802
  workspaceId: string;
4803
+ scope: ResourceAuthorityScope;
4804
+ generation: number;
4805
+ status: "active" | "revoked";
4039
4806
  name: string;
4040
4807
  description: string | null;
4041
4808
  createdBy: string | null;
@@ -4080,6 +4847,7 @@ export type RigChange = {
4080
4847
  };
4081
4848
 
4082
4849
  export type CreateRigRequest = {
4850
+ scope?: ResourceAuthorityScope;
4083
4851
  name: string;
4084
4852
  description?: string | undefined;
4085
4853
  image?: string | undefined;
@@ -4476,6 +5244,7 @@ export type Document = {
4476
5244
  authorityKind: DocumentAuthorityKind;
4477
5245
  authorityWorkspaceId: string | null;
4478
5246
  authoritySubjectId: string | null;
5247
+ authorityId?: string | null | undefined;
4479
5248
  visibility: DocumentVisibility;
4480
5249
  createdBy: string | null;
4481
5250
  agentAccess: boolean;
@@ -4551,6 +5320,110 @@ export type MoveDocumentRequest = {
4551
5320
  targetBaseId?: string | undefined;
4552
5321
  };
4553
5322
 
5323
+ export type DocumentAuthorityTuple = {
5324
+ kind: DocumentAuthorityKind;
5325
+ workspaceId: string | null;
5326
+ subjectId: string | null;
5327
+ authorityId: string | null;
5328
+ };
5329
+
5330
+ export type ReclassifyDocumentAuthorityRequest = {
5331
+ operationId: string;
5332
+ expectedAuthority: DocumentAuthorityTuple;
5333
+ targetAuthorityKind: DocumentAuthorityKind;
5334
+ };
5335
+
5336
+ export type DocumentAuthorityReclassification = {
5337
+ operationId: string;
5338
+ documentId: string;
5339
+ previousAuthority: DocumentAuthorityTuple;
5340
+ authority: DocumentAuthorityTuple;
5341
+ createdAt: string;
5342
+ };
5343
+
5344
+ export type ListDocumentAuthorityReclassificationsOptions = {
5345
+ limit?: number | undefined;
5346
+ cursor?: string | undefined;
5347
+ };
5348
+
5349
+ export type ListDocumentAuthorityReclassificationsResponse = {
5350
+ receipts: DocumentAuthorityReclassification[];
5351
+ hasMore: boolean;
5352
+ nextCursor: string | null;
5353
+ };
5354
+
5355
+ export type RunDocumentDefaultCollectionBackfillRequest = {
5356
+ runId: string;
5357
+ operationId: string;
5358
+ batchSize?: number | undefined;
5359
+ };
5360
+
5361
+ export type DocumentDefaultCollectionBackfill = {
5362
+ runId: string;
5363
+ operationId: string;
5364
+ status: "running" | "completed";
5365
+ lastWorkspaceId: string | null;
5366
+ processedCount: number;
5367
+ createdCount: number;
5368
+ adoptedCount: number;
5369
+ completedAt: string | null;
5370
+ };
5371
+
5372
+ export type DocumentDefaultCollectionBackfillRunAudit = Omit<
5373
+ DocumentDefaultCollectionBackfill,
5374
+ "operationId"
5375
+ > & {
5376
+ actorSubjectId: string;
5377
+ startedAt: string;
5378
+ updatedAt: string;
5379
+ };
5380
+
5381
+ export type DocumentDefaultCollectionBackfillOperationAudit = {
5382
+ operationId: string;
5383
+ result: DocumentDefaultCollectionBackfill;
5384
+ createdAt: string;
5385
+ };
5386
+
5387
+ export type DocumentDefaultCollectionBackfillReceiptAudit = {
5388
+ workspaceId: string;
5389
+ baseId: string;
5390
+ outcome: "created" | "adopted";
5391
+ createdAt: string;
5392
+ };
5393
+
5394
+ export type ListDocumentDefaultCollectionBackfillRunsResponse = {
5395
+ runs: DocumentDefaultCollectionBackfillRunAudit[];
5396
+ hasMore: boolean;
5397
+ nextCursor: string | null;
5398
+ };
5399
+
5400
+ export type DocumentDefaultCollectionBackfillAudit = {
5401
+ run: DocumentDefaultCollectionBackfillRunAudit;
5402
+ operations: DocumentDefaultCollectionBackfillOperationAudit[];
5403
+ receipts: DocumentDefaultCollectionBackfillReceiptAudit[];
5404
+ operationsHasMore: boolean;
5405
+ operationsNextCursor: string | null;
5406
+ receiptsHasMore: boolean;
5407
+ receiptsNextCursor: string | null;
5408
+ };
5409
+
5410
+ export type GetDocumentDefaultCollectionBackfillAuditOptions = {
5411
+ limit?: number | undefined;
5412
+ operationCursor?: string | undefined;
5413
+ receiptCursor?: string | undefined;
5414
+ };
5415
+
5416
+ export type OrganizationDocumentAuthorityReclassification = DocumentAuthorityReclassification & {
5417
+ actorSubjectId: string;
5418
+ requestWorkspaceId: string;
5419
+ };
5420
+
5421
+ export type ListOrganizationDocumentAuthorityReclassificationsResponse = {
5422
+ receipts: OrganizationDocumentAuthorityReclassification[];
5423
+ hasMore: boolean;
5424
+ nextCursor: string | null;
5425
+ };
5426
+
4554
5427
  export type DocumentSearchRequest = {
4555
5428
  query: string;
4556
5429
  baseIds?: string[] | undefined;
@@ -4701,6 +5574,30 @@ export type CapabilityPackScheduledTaskTemplate = {
4701
5574
  prompt?: string | undefined;
4702
5575
  };
4703
5576
 
5577
+ export type CapabilityPackAutomationTemplate = {
5578
+ id: string;
5579
+ name: string;
5580
+ description: string;
5581
+ adapterId: string;
5582
+ eventTypes: string[];
5583
+ sessionTemplate: {
5584
+ prompt: string;
5585
+ instructions: string | null;
5586
+ resources: ResourceRef[];
5587
+ skills: CapabilityPackSkill[];
5588
+ tools: ToolRef[];
5589
+ firstPartyMcpTools: string[];
5590
+ firstPartyMcpPermissions: Permission[];
5591
+ model: string | null;
5592
+ reasoningEffort: ReasoningEffort | null;
5593
+ sandboxBackend: SandboxBackend | null;
5594
+ policyRole: string | null;
5595
+ metadata: Record<string, unknown>;
5596
+ };
5597
+ configuration: Record<string, unknown>;
5598
+ connectionRequirement: string | null;
5599
+ };
5600
+
4704
5601
  export type CapabilityPackSkillFile = {
4705
5602
  path: string;
4706
5603
  content: string;
@@ -4783,6 +5680,7 @@ export type CapabilityPack = {
4783
5680
  connectors: CapabilityPackConnector[];
4784
5681
  knowledge: CapabilityPackKnowledge[];
4785
5682
  scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
5683
+ automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
4786
5684
  variableSet?: CapabilityPackVariableSetSpec | undefined;
4787
5685
  metadata: Record<string, unknown>;
4788
5686
  };
@@ -4887,6 +5785,31 @@ export type RegisterCapabilityPackRequest = {
4887
5785
  prompt?: string | undefined;
4888
5786
  }[]
4889
5787
  | undefined;
5788
+ automationTemplates?:
5789
+ | {
5790
+ id: string;
5791
+ name: string;
5792
+ description: string;
5793
+ adapterId: string;
5794
+ eventTypes: string[];
5795
+ sessionTemplate: {
5796
+ prompt: string;
5797
+ instructions?: string | null | undefined;
5798
+ resources?: ResourceRef[] | undefined;
5799
+ skills?: CapabilityPackSkill[] | undefined;
5800
+ tools?: ToolRef[] | undefined;
5801
+ firstPartyMcpTools?: string[] | undefined;
5802
+ firstPartyMcpPermissions?: Permission[] | undefined;
5803
+ model?: string | null | undefined;
5804
+ reasoningEffort?: ReasoningEffort | null | undefined;
5805
+ sandboxBackend?: SandboxBackend | null | undefined;
5806
+ policyRole?: string | null | undefined;
5807
+ metadata?: Record<string, unknown> | undefined;
5808
+ };
5809
+ configuration?: Record<string, unknown> | undefined;
5810
+ connectionRequirement?: string | null | undefined;
5811
+ }[]
5812
+ | undefined;
4890
5813
  variableSet?:
4891
5814
  | {
4892
5815
  description: string;
@@ -4923,6 +5846,100 @@ export type PackInstallation = {
4923
5846
  updatedAt: string;
4924
5847
  };
4925
5848
 
5849
+ // --- OpenGeni Review Bot ------------------------------------------------------------
5850
+
5851
+ export type PrReviewProvider = GitCredentialProvider;
5852
+ export type PrReviewCredentialKind = "github_app" | "provider_token";
5853
+ export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
5854
+
5855
+ export type CreatePrReviewAppRegistrationRequest = {
5856
+ name: string;
5857
+ provider: PrReviewProvider;
5858
+ providerBaseUrl?: string | undefined;
5859
+ appId?: string | undefined;
5860
+ credentialKind: PrReviewCredentialKind;
5861
+ privateKey?: string | undefined;
5862
+ accessToken?: string | undefined;
5863
+ accessTokenExpiresAt?: string | null | undefined;
5864
+ webhookSecret: string;
5865
+ webhookUsername?: string | undefined;
5866
+ };
5867
+
5868
+ export type UpdatePrReviewAppRegistrationRequest = {
5869
+ name?: string | undefined;
5870
+ privateKey?: string | undefined;
5871
+ accessToken?: string | undefined;
5872
+ accessTokenExpiresAt?: string | null | undefined;
5873
+ webhookSecret?: string | undefined;
5874
+ webhookUsername?: string | undefined;
5875
+ status?: "active" | "disabled" | undefined;
5876
+ };
5877
+
5878
+ export type PrReviewAppRegistration = {
5879
+ id: string;
5880
+ sourceId: string;
5881
+ accountId: string;
5882
+ workspaceId: string;
5883
+ name: string;
5884
+ provider: PrReviewProvider;
5885
+ providerBaseUrl: string;
5886
+ appId: string | null;
5887
+ credentialKind: PrReviewCredentialKind;
5888
+ hasCredential: boolean;
5889
+ accessTokenExpiresAt: string | null;
5890
+ webhookAuthKind: PrReviewWebhookAuthKind;
5891
+ hasWebhookSecret: boolean;
5892
+ webhookUsername: string | null;
5893
+ webhookPath: string;
5894
+ status: "active" | "disabled";
5895
+ createdBySubjectId: string;
5896
+ createdAt: string;
5897
+ updatedAt: string;
5898
+ };
5899
+
5900
+ export type CreatePrReviewRepositoryBindingRequest = {
5901
+ registrationId: string;
5902
+ repositoryUri: string;
5903
+ repositoryFullName: string;
5904
+ providerRepositoryId: string | number;
5905
+ installationId?: string | number | undefined;
5906
+ projectId?: string | number | undefined;
5907
+ model?: string | null | undefined;
5908
+ additionalInstructions?: string | null | undefined;
5909
+ status?: "active" | "disabled" | undefined;
5910
+ };
5911
+
5912
+ export type UpdatePrReviewRepositoryBindingRequest = {
5913
+ model?: string | null | undefined;
5914
+ additionalInstructions?: string | null | undefined;
5915
+ status?: "active" | "disabled" | undefined;
5916
+ };
5917
+
5918
+ export type PrReviewRepositoryBinding = {
5919
+ id: string;
5920
+ triggerId: string;
5921
+ accountId: string;
5922
+ workspaceId: string;
5923
+ registrationId: string;
5924
+ provider: PrReviewProvider;
5925
+ repositoryUri: string;
5926
+ repositoryFullName: string;
5927
+ providerRepositoryId: string;
5928
+ installationId: string | null;
5929
+ projectId: string | null;
5930
+ model: string | null;
5931
+ additionalInstructions: string | null;
5932
+ status: "active" | "disabled";
5933
+ createdBySubjectId: string;
5934
+ createdAt: string;
5935
+ updatedAt: string;
5936
+ };
5937
+
5938
+ export type ListPrReviewConfigurationResponse = {
5939
+ registrations: PrReviewAppRegistration[];
5940
+ repositories: PrReviewRepositoryBinding[];
5941
+ };
5942
+
4926
5943
  export type EnablePackRequest = {
4927
5944
  variableSetId?: string | undefined;
4928
5945
  /** @deprecated use variableSetId */
@@ -5326,6 +6343,8 @@ export type IntegrationFacetBindingSummary = {
5326
6343
  lastErrorCode: string | null;
5327
6344
  createdAt: string;
5328
6345
  updatedAt: string;
6346
+ directlyOwned: boolean;
6347
+ owners: CapabilityComponentOwner[];
5329
6348
  };
5330
6349
 
5331
6350
  export type IntegrationInstanceFacetsResponse = {
@@ -5368,6 +6387,20 @@ export type IntegrationFacetRemovalResult = {
5368
6387
  remainingOwners: CapabilityComponentOwner[];
5369
6388
  };
5370
6389
 
6390
+ /**
6391
+ * Presentation-only consent copy served with an integration or connector.
6392
+ * Never grants a scope or replaces server-side authorization; the UI keeps a
6393
+ * generic fallback for any omitted field.
6394
+ */
6395
+ export type IntegrationPresentation = {
6396
+ providerName?: string | undefined;
6397
+ icon?: "calendar" | "cloud" | "contacts" | "files" | "mail" | undefined;
6398
+ introduction?: string | undefined;
6399
+ capabilities?: { title: string; description: string }[] | undefined;
6400
+ permissionSummary?: string | undefined;
6401
+ scopeLabels?: Record<string, { label: string; description: string }> | undefined;
6402
+ };
6403
+
5371
6404
  export type IntegrationDefinitionSummary = {
5372
6405
  id: string;
5373
6406
  name: string;
@@ -5381,6 +6414,7 @@ export type IntegrationDefinitionSummary = {
5381
6414
  kind: "oauth2";
5382
6415
  scopes: string[];
5383
6416
  };
6417
+ presentation?: IntegrationPresentation | undefined;
5384
6418
  facets: IntegrationFacetDefinitionSummary[];
5385
6419
  };
5386
6420
 
@@ -5937,6 +6971,30 @@ export type InsightsModelCallRow = {
5937
6971
  pricingSource: InsightsPricingSource | null;
5938
6972
  };
5939
6973
 
6974
+ export type ModelContextContributionSource =
6975
+ | "workspace_instruction_policy"
6976
+ | "legacy_workspace_instructions"
6977
+ | "preference_registry_descriptor"
6978
+ | "company_profile"
6979
+ | "legacy_memory_v1"
6980
+ | "runtime_skill_catalog";
6981
+
6982
+ export type InsightsPromptContributionRow = {
6983
+ source: ModelContextContributionSource;
6984
+ items: number;
6985
+ utf8Bytes: number;
6986
+ estimatedTokens: number;
6987
+ calls: number;
6988
+ };
6989
+
6990
+ export type InsightsPromptContributions = {
6991
+ estimatedTokens: number;
6992
+ utf8Bytes: number;
6993
+ coveredCalls: number;
6994
+ totalCalls: number;
6995
+ sources: InsightsPromptContributionRow[];
6996
+ };
6997
+
5940
6998
  export type WorkspaceInsightsSnapshot = {
5941
6999
  range: InsightsRange;
5942
7000
  rangeLabel: string;
@@ -5954,6 +7012,7 @@ export type WorkspaceInsightsSnapshot = {
5954
7012
  drivers: InsightsSpendDriver[];
5955
7013
  schedules: InsightsScheduleRow[];
5956
7014
  recentCalls: InsightsModelCallRow[];
7015
+ promptContributions: InsightsPromptContributions;
5957
7016
  warmSeconds: number;
5958
7017
  priorWarmSeconds: number;
5959
7018
  warmGroups: InsightsWarmGroupRow[];
@@ -6012,6 +7071,16 @@ export type CreateCheckoutResponse = {
6012
7071
  url: string;
6013
7072
  };
6014
7073
 
7074
+ export type CreateBillingPortalRequest = {
7075
+ accountId?: string | undefined;
7076
+ returnUrl?: string | undefined;
7077
+ };
7078
+
7079
+ export type CreateBillingPortalResponse = {
7080
+ portalSessionId: string;
7081
+ url: string;
7082
+ };
7083
+
6015
7084
  export type UserMessageEventInput = {
6016
7085
  type: "user.message";
6017
7086
  clientEventId?: string | undefined;
@@ -6023,7 +7092,11 @@ export type UserMessageEventInput = {
6023
7092
  model?: string | undefined;
6024
7093
  reasoningEffort?: ReasoningEffort | undefined;
6025
7094
  latencyMode?: LatencyMode | undefined;
7095
+ controlEtag?: string | undefined;
7096
+ expectedDraftRevision?: number | undefined;
6026
7097
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
7098
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
7099
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
6027
7100
  };
6028
7101
  };
6029
7102
 
@@ -6085,13 +7158,92 @@ export type MachineState =
6085
7158
  | "display_unavailable"
6086
7159
  | "enrolling";
6087
7160
 
6088
- export type MachineKind = "modal" | "selfhosted";
7161
+ export type MachineKind = "modal" | "selfhosted" | "opensandbox";
7162
+
7163
+ export type MachineConnectionAuthority = {
7164
+ state: "not_applicable" | "unclaimed" | "active" | "expired";
7165
+ generation: number;
7166
+ supersededCount: number;
7167
+ leaseExpiresAt: string | null;
7168
+ duplicateRunnerDeniedCount: number;
7169
+ duplicateRunnerDeniedAt: string | null;
7170
+ };
7171
+
7172
+ export type MachineRuntimeCapabilities = {
7173
+ exec: boolean;
7174
+ filesystem: boolean;
7175
+ git: boolean;
7176
+ pty: boolean;
7177
+ desktop: boolean;
7178
+ opStream: boolean;
7179
+ browserBridge: boolean;
7180
+ operationResourcePolicy: boolean;
7181
+ operationCpuQuota: boolean;
7182
+ };
7183
+
7184
+ export type MachineUpdateStatus =
7185
+ | "requested"
7186
+ | "accepted"
7187
+ | "waiting_for_idle"
7188
+ | "downloading"
7189
+ | "verifying"
7190
+ | "applying"
7191
+ | "restarting"
7192
+ | "succeeded"
7193
+ | "failed";
7194
+
7195
+ export type MachineUpdateState = {
7196
+ operationId: string;
7197
+ status: MachineUpdateStatus;
7198
+ targetVersion: string;
7199
+ expectedBinarySha256: string | null;
7200
+ errorCode: string | null;
7201
+ retryable: boolean;
7202
+ rolledBack: boolean;
7203
+ requestedAt: string;
7204
+ updatedAt: string;
7205
+ completedAt: string | null;
7206
+ };
7207
+
7208
+ export type MachineRuntime = {
7209
+ installedVersion: string | null;
7210
+ binarySha256: string | null;
7211
+ updateChannel: "stable" | "beta" | null;
7212
+ desiredVersion: string | null;
7213
+ versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
7214
+ capabilities: MachineRuntimeCapabilities;
7215
+ update: MachineUpdateState | null;
7216
+ };
7217
+
7218
+ export type UpdateMachineAgentResponse = {
7219
+ operationId: string;
7220
+ accepted: boolean;
7221
+ targetVersion: string;
7222
+ };
7223
+
7224
+ export type MachineOperationPolicy = {
7225
+ memoryMaxBytes: number | null;
7226
+ memoryHighBytes: number | null;
7227
+ cpuMaxMillicores: number | null;
7228
+ revision: number;
7229
+ updatedAt: string | null;
7230
+ };
7231
+
7232
+ export type UpdateMachineOperationPolicyRequest = {
7233
+ memoryMaxBytes: number | null;
7234
+ memoryHighBytes: number | null;
7235
+ /** Omitted preserves the current CPU limit for older/partial clients; null clears. */
7236
+ cpuMaxMillicores?: number | null;
7237
+ expectedRevision: number;
7238
+ };
6089
7239
 
6090
7240
  /** A machine as the Machines dashboard renders it (an enrolled selfhosted machine
6091
7241
  * or the session's synthetic Modal group box, `isSessionGroup: true`). */
6092
7242
  export type MachineView = {
6093
7243
  sandboxId: string;
6094
7244
  enrollmentId: string | null;
7245
+ scope: ResourceAuthorityScope;
7246
+ generation: number;
6095
7247
  name: string;
6096
7248
  kind: MachineKind;
6097
7249
  state: MachineState;
@@ -6110,6 +7262,14 @@ export type MachineView = {
6110
7262
  allowScreenControl: boolean;
6111
7263
  sharedSessionCount: number;
6112
7264
  lastSeenAt: string | null;
7265
+ /** Secret-free single-runner authority diagnostics. */
7266
+ connectionAuthority: MachineConnectionAuthority;
7267
+ /** Exact build/update truth. Null means the runner predates runtime Hello
7268
+ * reporting or this is a managed-session group without a connected agent. */
7269
+ runtime: MachineRuntime | null;
7270
+ /** Explicit per-enrollment command memory policy. Null only for managed
7271
+ * session boxes; null limits on a real machine mean unrestricted. */
7272
+ operationPolicy: MachineOperationPolicy | null;
6113
7273
  metrics: MetricSample | null;
6114
7274
  };
6115
7275
 
@@ -6191,6 +7351,7 @@ export type SwapActiveSandboxResponse = {
6191
7351
 
6192
7352
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
6193
7353
  export type EnrollmentOs = "linux" | "macos" | "windows";
7354
+ export type ResourceAuthorityScope = "organization" | "workspace" | "user";
6194
7355
 
6195
7356
  /** POST /v1/enrollments/device/lookup body. */
6196
7357
  export type DeviceEnrollmentLookupRequest = {
@@ -6218,6 +7379,7 @@ export type DeviceEnrollmentLookupResponse = {
6218
7379
  export type DeviceEnrollmentApproveRequest = {
6219
7380
  userCode: string;
6220
7381
  allowScreenControl?: boolean;
7382
+ scope?: ResourceAuthorityScope;
6221
7383
  };
6222
7384
 
6223
7385
  /** POST /v1/workspaces/:ws/enrollments/device/approve response. */