@opengeni/sdk 1.0.1 → 2.2.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-A5DC5WEM.js → chunk-C2H7HBNP.js} +22 -2
  8. package/dist/chunk-C2H7HBNP.js.map +1 -0
  9. package/dist/{chunk-GU6JF75T.js → chunk-C4DJPZRU.js} +1 -1
  10. package/dist/{chunk-GU6JF75T.js.map → chunk-C4DJPZRU.js.map} +1 -1
  11. package/dist/{chunk-TYZ4JL4J.js → chunk-G6LBVWKT.js} +2 -2
  12. package/dist/{chunk-4DV37UUA.js → chunk-GLDV5QY7.js} +16 -2
  13. package/dist/chunk-GLDV5QY7.js.map +1 -0
  14. package/dist/{chunk-ST5DDKJP.js → chunk-GW3EJ2GP.js} +52 -1
  15. package/dist/chunk-GW3EJ2GP.js.map +1 -0
  16. package/dist/{chunk-VWE2QIVO.js → chunk-XNG7YGR3.js} +23 -6
  17. package/dist/chunk-XNG7YGR3.js.map +1 -0
  18. package/dist/{chunk-YGH5P47G.js → chunk-YBQTKNTL.js} +696 -57
  19. package/dist/chunk-YBQTKNTL.js.map +1 -0
  20. package/dist/client.d.ts +151 -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 +961 -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 +974 -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 +131 -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 +1101 -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-G6LBVWKT.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;
@@ -3266,12 +3906,15 @@ export type WorkspaceVoiceInputSettings = {
3266
3906
  export type UpdateWorkspaceSettingsRequest = {
3267
3907
  memoryEnabled?: boolean | undefined;
3268
3908
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3909
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3910
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
3269
3911
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
3270
3912
  transcription?: WorkspaceTranscriptionPolicy | undefined;
3271
3913
  maxNestedAgentDepth?: number | null | undefined;
3272
3914
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3273
3915
  agentHumanInputEnabled?: boolean | undefined;
3274
3916
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3917
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
3275
3918
  [key: string]: unknown;
3276
3919
  };
3277
3920
 
@@ -3299,6 +3942,7 @@ export type ApiKey = {
3299
3942
  accountId: string;
3300
3943
  workspaceId: string | null;
3301
3944
  name: string;
3945
+ description: string | null;
3302
3946
  prefix: string;
3303
3947
  permissions: Permission[];
3304
3948
  expiresAt: string | null;
@@ -3310,6 +3954,7 @@ export type ApiKey = {
3310
3954
 
3311
3955
  export type CreateApiKeyRequest = {
3312
3956
  name: string;
3957
+ description?: string | undefined;
3313
3958
  permissions: Permission[];
3314
3959
  expiresAt?: string | undefined;
3315
3960
  };
@@ -3417,12 +4062,14 @@ export type SessionGoalRevision = {
3417
4062
  resultObjectiveRevision: number | null;
3418
4063
  text: string;
3419
4064
  successCriteria: string | null;
4065
+ rootConstraints: string[];
3420
4066
  mutationPolicy: SessionGoalMutationPolicy;
3421
4067
  rationale: string;
3422
4068
  actor: "agent" | "api" | "scheduled_task";
3423
4069
  actorTurnId: string | null;
3424
4070
  actorAttemptId: string | null;
3425
4071
  proposalId: string | null;
4072
+ rollbackOfRevisionId: string | null;
3426
4073
  createdAt: string;
3427
4074
  };
3428
4075
 
@@ -3431,6 +4078,32 @@ export type ApplySessionGoalRevisionRequest = {
3431
4078
  rationale?: string | undefined;
3432
4079
  };
3433
4080
 
4081
+ export type ListSessionGoalRevisionsOptions = {
4082
+ limit?: number | undefined;
4083
+ before?: string | undefined;
4084
+ };
4085
+
4086
+ export type ListSessionGoalRevisionsResponse = {
4087
+ revisions: SessionGoalRevision[];
4088
+ hasMore: boolean;
4089
+ nextCursor: string | null;
4090
+ };
4091
+
4092
+ export type RejectSessionGoalRevisionRequest = {
4093
+ expectedObjectiveRevision: number;
4094
+ rationale: string;
4095
+ };
4096
+
4097
+ export type RejectSessionGoalRevisionResponse = {
4098
+ revision: SessionGoalRevision;
4099
+ replay: boolean;
4100
+ };
4101
+
4102
+ export type RollbackSessionGoalRevisionRequest = {
4103
+ expectedObjectiveRevision: number;
4104
+ rationale: string;
4105
+ };
4106
+
3434
4107
  export type SessionGoalContinuationState =
3435
4108
  | "inactive"
3436
4109
  | "scheduled"
@@ -3450,6 +4123,8 @@ export type SessionGoalContinuationReason =
3450
4123
  | "provider_backpressure"
3451
4124
  | "session_cancelled"
3452
4125
  | "system_work_pending"
4126
+ | "held_for_input"
4127
+ | "backoff_pending"
3453
4128
  | "missing_obligation";
3454
4129
 
3455
4130
  export type SessionGoalContinuation = {
@@ -3459,6 +4134,8 @@ export type SessionGoalContinuation = {
3459
4134
  observedRevision: number;
3460
4135
  nextAttemptAt: string | null;
3461
4136
  lastError: string | null;
4137
+ /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
4138
+ holdReason?: string | null | undefined;
3462
4139
  };
3463
4140
 
3464
4141
  export type SessionGoal = {
@@ -3469,6 +4146,7 @@ export type SessionGoal = {
3469
4146
  status: SessionGoalStatus;
3470
4147
  text: string;
3471
4148
  successCriteria: string | null;
4149
+ rootConstraints: string[];
3472
4150
  evidence: string | null;
3473
4151
  rationale: string | null;
3474
4152
  pausedReason: string | null;
@@ -3494,6 +4172,7 @@ export type UpdateSessionGoalRequest =
3494
4172
  | {
3495
4173
  text: string;
3496
4174
  successCriteria?: string | null | undefined;
4175
+ rootConstraints?: string[] | undefined;
3497
4176
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
3498
4177
  rationale: string;
3499
4178
  expectedObjectiveRevision: number;
@@ -3548,6 +4227,7 @@ export type EffectiveSessionControl = {
3548
4227
  interruptionPendingCount: number;
3549
4228
  quiescencePendingCount: number;
3550
4229
  } | null;
4230
+ backgroundCommandSettlement?: { state: "stopping"; commandCount: number } | null | undefined;
3551
4231
  };
3552
4232
 
3553
4233
  export type SessionCommandReceipt = {
@@ -3563,6 +4243,11 @@ export type SessionCommandReceipt = {
3563
4243
  createdAt: string;
3564
4244
  };
3565
4245
 
4246
+ export type SessionPromptRouting =
4247
+ | "accepted_for_execution"
4248
+ | "queued_for_execution"
4249
+ | "accepted_for_steering";
4250
+
3566
4251
  export type ComposerDraft = {
3567
4252
  revision: number;
3568
4253
  text: string;
@@ -3570,13 +4255,14 @@ export type ComposerDraft = {
3570
4255
  resources: ResourceRef[];
3571
4256
  model: string;
3572
4257
  reasoningEffort: ReasoningEffort;
3573
- latencyMode?: LatencyMode | undefined;
4258
+ latencyMode: LatencyMode;
3574
4259
  sourceTurnId: string | null;
3575
4260
  sourceTurnVersion: number | null;
3576
4261
  updatedAt: string | null;
3577
4262
  };
3578
4263
 
3579
4264
  export type NewSessionDraftOptions = {
4265
+ visibility?: SessionVisibility | undefined;
3580
4266
  sandboxBackend?: SandboxBackend | undefined;
3581
4267
  targetSandboxId?: string | undefined;
3582
4268
  workingDir?: string | undefined;
@@ -3587,6 +4273,17 @@ export type NewSessionDraftOptions = {
3587
4273
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
3588
4274
  };
3589
4275
 
4276
+ export type NewSessionSelectionHistory = {
4277
+ /** Most-recently used project first. Null channelId is the Default project. */
4278
+ projects: Array<{
4279
+ channelId: string | null;
4280
+ /** Null means the managed sandbox was used most recently in this project. */
4281
+ targetSandboxId: string | null;
4282
+ /** Most-recently used machine in this project first. */
4283
+ machines: Array<{ sandboxId: string; workingDir: string | null }>;
4284
+ }>;
4285
+ };
4286
+
3590
4287
  export type NewSessionDraft = {
3591
4288
  revision: number;
3592
4289
  text: string;
@@ -3596,8 +4293,9 @@ export type NewSessionDraft = {
3596
4293
  toolsProvided: boolean;
3597
4294
  model: string;
3598
4295
  reasoningEffort: ReasoningEffort;
3599
- latencyMode?: LatencyMode | undefined;
4296
+ latencyMode: LatencyMode;
3600
4297
  options: NewSessionDraftOptions;
4298
+ selectionHistory: NewSessionSelectionHistory;
3601
4299
  updatedAt: string | null;
3602
4300
  };
3603
4301
 
@@ -3631,7 +4329,12 @@ export type SessionSystemUpdateKind =
3631
4329
  | "agent_message"
3632
4330
  | "agent_steer_instruction"
3633
4331
  | "child_terminal_result"
3634
- | "media_generation_result";
4332
+ | "media_generation_result"
4333
+ | "child_requires_action"
4334
+ | "child_requires_action_resolved"
4335
+ | "child_paused"
4336
+ | "child_waiting_capacity"
4337
+ | "child_progress";
3635
4338
 
3636
4339
  export type SessionSystemUpdateState =
3637
4340
  | "pending"
@@ -3746,7 +4449,31 @@ export type SaveComposerDraftRequest = Omit<
3746
4449
  "revision" | "sourceTurnId" | "sourceTurnVersion" | "updatedAt"
3747
4450
  > & { expectedRevision: number };
3748
4451
 
3749
- export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "updatedAt"> & {
4452
+ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expectedRevision"> & {
4453
+ expectedDraftRevision: number;
4454
+ clientEventId: string;
4455
+ delivery: "send" | "steer";
4456
+ controlEtag?: string;
4457
+ modelContext?: string;
4458
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
4459
+ connectionAuthorities?: McpConnectionAuthoritySelection[];
4460
+ personalResourceAttachment?: PersonalResourceAttachmentIntent;
4461
+ };
4462
+
4463
+ export type SubmitComposerDraftResponse = {
4464
+ accepted: SessionEvent;
4465
+ turn: SessionTurn;
4466
+ draft: ComposerDraft;
4467
+ receipt: SessionCommandReceipt;
4468
+ routing: SessionPromptRouting;
4469
+ interruptionCount: number;
4470
+ replay: boolean;
4471
+ };
4472
+
4473
+ export type SaveNewSessionDraftRequest = Omit<
4474
+ NewSessionDraft,
4475
+ "revision" | "selectionHistory" | "updatedAt"
4476
+ > & {
3750
4477
  expectedRevision: number;
3751
4478
  };
3752
4479
 
@@ -3763,6 +4490,8 @@ export type ScheduledTaskAgentConfigInput = {
3763
4490
  reasoningEffort?: ReasoningEffort | undefined;
3764
4491
  sandboxBackend?: SandboxBackend | undefined;
3765
4492
  goal?: GoalSpec | undefined;
4493
+ executionClass?: "incident_telemetry" | undefined;
4494
+ incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
3766
4495
  maxNestedAgentDepth?: number | undefined;
3767
4496
  };
3768
4497
 
@@ -3772,6 +4501,7 @@ export type CreateAgentScheduledTaskRequest = {
3772
4501
  action?: { kind: "agent_turn" } | undefined;
3773
4502
  runMode?: ScheduledTaskRunMode | undefined;
3774
4503
  targetSessionId?: string | null | undefined;
4504
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
3775
4505
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3776
4506
  agentConfig: ScheduledTaskAgentConfigInput;
3777
4507
  status?: ScheduledTaskStatus | undefined;
@@ -3801,6 +4531,7 @@ export type UpdateScheduledTaskRequest = {
3801
4531
  schedule?: ScheduledTaskScheduleSpec | undefined;
3802
4532
  runMode?: ScheduledTaskRunMode | undefined;
3803
4533
  targetSessionId?: string | null | undefined;
4534
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
3804
4535
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3805
4536
  action?: ScheduledTaskAction | undefined;
3806
4537
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
@@ -3863,6 +4594,8 @@ export type ScheduledTaskRun = {
3863
4594
  accountId: string;
3864
4595
  workspaceId: string;
3865
4596
  taskId: string;
4597
+ taskAuthorityRevision: number | null;
4598
+ taskExecutionDigest: string | null;
3866
4599
  status: ScheduledTaskRunStatus;
3867
4600
  triggerType: ScheduledTaskTriggerType;
3868
4601
  scheduledAt: string | null;
@@ -3900,6 +4633,9 @@ export type VariableSet = {
3900
4633
  id: string;
3901
4634
  accountId: string;
3902
4635
  workspaceId: string;
4636
+ scope: "organization" | "workspace" | "user";
4637
+ generation: number;
4638
+ status: "active" | "revoked";
3903
4639
  name: string;
3904
4640
  description: string | null;
3905
4641
  variables: VariableSetVariableMetadata[];
@@ -3914,6 +4650,8 @@ export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3914
4650
  export type WorkspaceEnvironment = VariableSet;
3915
4651
 
3916
4652
  export type CreateVariableSetRequest = {
4653
+ /** Omitted remains the legacy workspace-owned path. */
4654
+ scope?: "organization" | "workspace" | "user" | undefined;
3917
4655
  name: string;
3918
4656
  description?: string | undefined;
3919
4657
  /** Initial variables. Values are write-only: they never come back on reads. */
@@ -4012,6 +4750,8 @@ export type Channel = {
4012
4750
  workspaceId: string;
4013
4751
  name: string;
4014
4752
  description: string | null;
4753
+ pinned: boolean;
4754
+ sortOrder: number;
4015
4755
  createdBy: string | null;
4016
4756
  createdAt: string;
4017
4757
  updatedAt: string;
@@ -4025,6 +4765,12 @@ export type CreateChannelRequest = {
4025
4765
  export type UpdateChannelRequest = {
4026
4766
  name?: string;
4027
4767
  description?: string | null;
4768
+ pinned?: boolean;
4769
+ };
4770
+
4771
+ /** Complete workspace project order. It is replaced atomically after a drag. */
4772
+ export type ReorderChannelsRequest = {
4773
+ channelIds: string[];
4028
4774
  };
4029
4775
 
4030
4776
  /** Re-files one session; null moves it back to the unfiled inbox. */
@@ -4036,6 +4782,9 @@ export type Rig = {
4036
4782
  id: string;
4037
4783
  accountId: string;
4038
4784
  workspaceId: string;
4785
+ scope: ResourceAuthorityScope;
4786
+ generation: number;
4787
+ status: "active" | "revoked";
4039
4788
  name: string;
4040
4789
  description: string | null;
4041
4790
  createdBy: string | null;
@@ -4080,6 +4829,7 @@ export type RigChange = {
4080
4829
  };
4081
4830
 
4082
4831
  export type CreateRigRequest = {
4832
+ scope?: ResourceAuthorityScope;
4083
4833
  name: string;
4084
4834
  description?: string | undefined;
4085
4835
  image?: string | undefined;
@@ -4476,6 +5226,7 @@ export type Document = {
4476
5226
  authorityKind: DocumentAuthorityKind;
4477
5227
  authorityWorkspaceId: string | null;
4478
5228
  authoritySubjectId: string | null;
5229
+ authorityId?: string | null | undefined;
4479
5230
  visibility: DocumentVisibility;
4480
5231
  createdBy: string | null;
4481
5232
  agentAccess: boolean;
@@ -4551,6 +5302,55 @@ export type MoveDocumentRequest = {
4551
5302
  targetBaseId?: string | undefined;
4552
5303
  };
4553
5304
 
5305
+ export type DocumentAuthorityTuple = {
5306
+ kind: DocumentAuthorityKind;
5307
+ workspaceId: string | null;
5308
+ subjectId: string | null;
5309
+ authorityId: string | null;
5310
+ };
5311
+
5312
+ export type ReclassifyDocumentAuthorityRequest = {
5313
+ operationId: string;
5314
+ expectedAuthority: DocumentAuthorityTuple;
5315
+ targetAuthorityKind: DocumentAuthorityKind;
5316
+ };
5317
+
5318
+ export type DocumentAuthorityReclassification = {
5319
+ operationId: string;
5320
+ documentId: string;
5321
+ previousAuthority: DocumentAuthorityTuple;
5322
+ authority: DocumentAuthorityTuple;
5323
+ createdAt: string;
5324
+ };
5325
+
5326
+ export type ListDocumentAuthorityReclassificationsOptions = {
5327
+ limit?: number | undefined;
5328
+ cursor?: string | undefined;
5329
+ };
5330
+
5331
+ export type ListDocumentAuthorityReclassificationsResponse = {
5332
+ receipts: DocumentAuthorityReclassification[];
5333
+ hasMore: boolean;
5334
+ nextCursor: string | null;
5335
+ };
5336
+
5337
+ export type RunDocumentDefaultCollectionBackfillRequest = {
5338
+ runId: string;
5339
+ operationId: string;
5340
+ batchSize?: number | undefined;
5341
+ };
5342
+
5343
+ export type DocumentDefaultCollectionBackfill = {
5344
+ runId: string;
5345
+ operationId: string;
5346
+ status: "running" | "completed";
5347
+ lastWorkspaceId: string | null;
5348
+ processedCount: number;
5349
+ createdCount: number;
5350
+ adoptedCount: number;
5351
+ completedAt: string | null;
5352
+ };
5353
+
4554
5354
  export type DocumentSearchRequest = {
4555
5355
  query: string;
4556
5356
  baseIds?: string[] | undefined;
@@ -4701,6 +5501,30 @@ export type CapabilityPackScheduledTaskTemplate = {
4701
5501
  prompt?: string | undefined;
4702
5502
  };
4703
5503
 
5504
+ export type CapabilityPackAutomationTemplate = {
5505
+ id: string;
5506
+ name: string;
5507
+ description: string;
5508
+ adapterId: string;
5509
+ eventTypes: string[];
5510
+ sessionTemplate: {
5511
+ prompt: string;
5512
+ instructions: string | null;
5513
+ resources: ResourceRef[];
5514
+ skills: CapabilityPackSkill[];
5515
+ tools: ToolRef[];
5516
+ firstPartyMcpTools: string[];
5517
+ firstPartyMcpPermissions: Permission[];
5518
+ model: string | null;
5519
+ reasoningEffort: ReasoningEffort | null;
5520
+ sandboxBackend: SandboxBackend | null;
5521
+ policyRole: string | null;
5522
+ metadata: Record<string, unknown>;
5523
+ };
5524
+ configuration: Record<string, unknown>;
5525
+ connectionRequirement: string | null;
5526
+ };
5527
+
4704
5528
  export type CapabilityPackSkillFile = {
4705
5529
  path: string;
4706
5530
  content: string;
@@ -4783,6 +5607,7 @@ export type CapabilityPack = {
4783
5607
  connectors: CapabilityPackConnector[];
4784
5608
  knowledge: CapabilityPackKnowledge[];
4785
5609
  scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
5610
+ automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
4786
5611
  variableSet?: CapabilityPackVariableSetSpec | undefined;
4787
5612
  metadata: Record<string, unknown>;
4788
5613
  };
@@ -4887,6 +5712,31 @@ export type RegisterCapabilityPackRequest = {
4887
5712
  prompt?: string | undefined;
4888
5713
  }[]
4889
5714
  | undefined;
5715
+ automationTemplates?:
5716
+ | {
5717
+ id: string;
5718
+ name: string;
5719
+ description: string;
5720
+ adapterId: string;
5721
+ eventTypes: string[];
5722
+ sessionTemplate: {
5723
+ prompt: string;
5724
+ instructions?: string | null | undefined;
5725
+ resources?: ResourceRef[] | undefined;
5726
+ skills?: CapabilityPackSkill[] | undefined;
5727
+ tools?: ToolRef[] | undefined;
5728
+ firstPartyMcpTools?: string[] | undefined;
5729
+ firstPartyMcpPermissions?: Permission[] | undefined;
5730
+ model?: string | null | undefined;
5731
+ reasoningEffort?: ReasoningEffort | null | undefined;
5732
+ sandboxBackend?: SandboxBackend | null | undefined;
5733
+ policyRole?: string | null | undefined;
5734
+ metadata?: Record<string, unknown> | undefined;
5735
+ };
5736
+ configuration?: Record<string, unknown> | undefined;
5737
+ connectionRequirement?: string | null | undefined;
5738
+ }[]
5739
+ | undefined;
4890
5740
  variableSet?:
4891
5741
  | {
4892
5742
  description: string;
@@ -4923,6 +5773,100 @@ export type PackInstallation = {
4923
5773
  updatedAt: string;
4924
5774
  };
4925
5775
 
5776
+ // --- OpenGeni Review Bot ------------------------------------------------------------
5777
+
5778
+ export type PrReviewProvider = GitCredentialProvider;
5779
+ export type PrReviewCredentialKind = "github_app" | "provider_token";
5780
+ export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
5781
+
5782
+ export type CreatePrReviewAppRegistrationRequest = {
5783
+ name: string;
5784
+ provider: PrReviewProvider;
5785
+ providerBaseUrl?: string | undefined;
5786
+ appId?: string | undefined;
5787
+ credentialKind: PrReviewCredentialKind;
5788
+ privateKey?: string | undefined;
5789
+ accessToken?: string | undefined;
5790
+ accessTokenExpiresAt?: string | null | undefined;
5791
+ webhookSecret: string;
5792
+ webhookUsername?: string | undefined;
5793
+ };
5794
+
5795
+ export type UpdatePrReviewAppRegistrationRequest = {
5796
+ name?: string | undefined;
5797
+ privateKey?: string | undefined;
5798
+ accessToken?: string | undefined;
5799
+ accessTokenExpiresAt?: string | null | undefined;
5800
+ webhookSecret?: string | undefined;
5801
+ webhookUsername?: string | undefined;
5802
+ status?: "active" | "disabled" | undefined;
5803
+ };
5804
+
5805
+ export type PrReviewAppRegistration = {
5806
+ id: string;
5807
+ sourceId: string;
5808
+ accountId: string;
5809
+ workspaceId: string;
5810
+ name: string;
5811
+ provider: PrReviewProvider;
5812
+ providerBaseUrl: string;
5813
+ appId: string | null;
5814
+ credentialKind: PrReviewCredentialKind;
5815
+ hasCredential: boolean;
5816
+ accessTokenExpiresAt: string | null;
5817
+ webhookAuthKind: PrReviewWebhookAuthKind;
5818
+ hasWebhookSecret: boolean;
5819
+ webhookUsername: string | null;
5820
+ webhookPath: string;
5821
+ status: "active" | "disabled";
5822
+ createdBySubjectId: string;
5823
+ createdAt: string;
5824
+ updatedAt: string;
5825
+ };
5826
+
5827
+ export type CreatePrReviewRepositoryBindingRequest = {
5828
+ registrationId: string;
5829
+ repositoryUri: string;
5830
+ repositoryFullName: string;
5831
+ providerRepositoryId: string | number;
5832
+ installationId?: string | number | undefined;
5833
+ projectId?: string | number | undefined;
5834
+ model?: string | null | undefined;
5835
+ additionalInstructions?: string | null | undefined;
5836
+ status?: "active" | "disabled" | undefined;
5837
+ };
5838
+
5839
+ export type UpdatePrReviewRepositoryBindingRequest = {
5840
+ model?: string | null | undefined;
5841
+ additionalInstructions?: string | null | undefined;
5842
+ status?: "active" | "disabled" | undefined;
5843
+ };
5844
+
5845
+ export type PrReviewRepositoryBinding = {
5846
+ id: string;
5847
+ triggerId: string;
5848
+ accountId: string;
5849
+ workspaceId: string;
5850
+ registrationId: string;
5851
+ provider: PrReviewProvider;
5852
+ repositoryUri: string;
5853
+ repositoryFullName: string;
5854
+ providerRepositoryId: string;
5855
+ installationId: string | null;
5856
+ projectId: string | null;
5857
+ model: string | null;
5858
+ additionalInstructions: string | null;
5859
+ status: "active" | "disabled";
5860
+ createdBySubjectId: string;
5861
+ createdAt: string;
5862
+ updatedAt: string;
5863
+ };
5864
+
5865
+ export type ListPrReviewConfigurationResponse = {
5866
+ registrations: PrReviewAppRegistration[];
5867
+ repositories: PrReviewRepositoryBinding[];
5868
+ };
5869
+
4926
5870
  export type EnablePackRequest = {
4927
5871
  variableSetId?: string | undefined;
4928
5872
  /** @deprecated use variableSetId */
@@ -5326,6 +6270,8 @@ export type IntegrationFacetBindingSummary = {
5326
6270
  lastErrorCode: string | null;
5327
6271
  createdAt: string;
5328
6272
  updatedAt: string;
6273
+ directlyOwned: boolean;
6274
+ owners: CapabilityComponentOwner[];
5329
6275
  };
5330
6276
 
5331
6277
  export type IntegrationInstanceFacetsResponse = {
@@ -5368,6 +6314,20 @@ export type IntegrationFacetRemovalResult = {
5368
6314
  remainingOwners: CapabilityComponentOwner[];
5369
6315
  };
5370
6316
 
6317
+ /**
6318
+ * Presentation-only consent copy served with an integration or connector.
6319
+ * Never grants a scope or replaces server-side authorization; the UI keeps a
6320
+ * generic fallback for any omitted field.
6321
+ */
6322
+ export type IntegrationPresentation = {
6323
+ providerName?: string | undefined;
6324
+ icon?: "calendar" | "cloud" | "contacts" | "files" | "mail" | undefined;
6325
+ introduction?: string | undefined;
6326
+ capabilities?: { title: string; description: string }[] | undefined;
6327
+ permissionSummary?: string | undefined;
6328
+ scopeLabels?: Record<string, { label: string; description: string }> | undefined;
6329
+ };
6330
+
5371
6331
  export type IntegrationDefinitionSummary = {
5372
6332
  id: string;
5373
6333
  name: string;
@@ -5381,6 +6341,7 @@ export type IntegrationDefinitionSummary = {
5381
6341
  kind: "oauth2";
5382
6342
  scopes: string[];
5383
6343
  };
6344
+ presentation?: IntegrationPresentation | undefined;
5384
6345
  facets: IntegrationFacetDefinitionSummary[];
5385
6346
  };
5386
6347
 
@@ -5937,6 +6898,30 @@ export type InsightsModelCallRow = {
5937
6898
  pricingSource: InsightsPricingSource | null;
5938
6899
  };
5939
6900
 
6901
+ export type ModelContextContributionSource =
6902
+ | "workspace_instruction_policy"
6903
+ | "legacy_workspace_instructions"
6904
+ | "preference_registry_descriptor"
6905
+ | "company_profile"
6906
+ | "legacy_memory_v1"
6907
+ | "runtime_skill_catalog";
6908
+
6909
+ export type InsightsPromptContributionRow = {
6910
+ source: ModelContextContributionSource;
6911
+ items: number;
6912
+ utf8Bytes: number;
6913
+ estimatedTokens: number;
6914
+ calls: number;
6915
+ };
6916
+
6917
+ export type InsightsPromptContributions = {
6918
+ estimatedTokens: number;
6919
+ utf8Bytes: number;
6920
+ coveredCalls: number;
6921
+ totalCalls: number;
6922
+ sources: InsightsPromptContributionRow[];
6923
+ };
6924
+
5940
6925
  export type WorkspaceInsightsSnapshot = {
5941
6926
  range: InsightsRange;
5942
6927
  rangeLabel: string;
@@ -5954,6 +6939,7 @@ export type WorkspaceInsightsSnapshot = {
5954
6939
  drivers: InsightsSpendDriver[];
5955
6940
  schedules: InsightsScheduleRow[];
5956
6941
  recentCalls: InsightsModelCallRow[];
6942
+ promptContributions: InsightsPromptContributions;
5957
6943
  warmSeconds: number;
5958
6944
  priorWarmSeconds: number;
5959
6945
  warmGroups: InsightsWarmGroupRow[];
@@ -6012,6 +6998,16 @@ export type CreateCheckoutResponse = {
6012
6998
  url: string;
6013
6999
  };
6014
7000
 
7001
+ export type CreateBillingPortalRequest = {
7002
+ accountId?: string | undefined;
7003
+ returnUrl?: string | undefined;
7004
+ };
7005
+
7006
+ export type CreateBillingPortalResponse = {
7007
+ portalSessionId: string;
7008
+ url: string;
7009
+ };
7010
+
6015
7011
  export type UserMessageEventInput = {
6016
7012
  type: "user.message";
6017
7013
  clientEventId?: string | undefined;
@@ -6023,7 +7019,11 @@ export type UserMessageEventInput = {
6023
7019
  model?: string | undefined;
6024
7020
  reasoningEffort?: ReasoningEffort | undefined;
6025
7021
  latencyMode?: LatencyMode | undefined;
7022
+ controlEtag?: string | undefined;
7023
+ expectedDraftRevision?: number | undefined;
6026
7024
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
7025
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
7026
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
6027
7027
  };
6028
7028
  };
6029
7029
 
@@ -6085,13 +7085,92 @@ export type MachineState =
6085
7085
  | "display_unavailable"
6086
7086
  | "enrolling";
6087
7087
 
6088
- export type MachineKind = "modal" | "selfhosted";
7088
+ export type MachineKind = "modal" | "selfhosted" | "opensandbox";
7089
+
7090
+ export type MachineConnectionAuthority = {
7091
+ state: "not_applicable" | "unclaimed" | "active" | "expired";
7092
+ generation: number;
7093
+ supersededCount: number;
7094
+ leaseExpiresAt: string | null;
7095
+ duplicateRunnerDeniedCount: number;
7096
+ duplicateRunnerDeniedAt: string | null;
7097
+ };
7098
+
7099
+ export type MachineRuntimeCapabilities = {
7100
+ exec: boolean;
7101
+ filesystem: boolean;
7102
+ git: boolean;
7103
+ pty: boolean;
7104
+ desktop: boolean;
7105
+ opStream: boolean;
7106
+ browserBridge: boolean;
7107
+ operationResourcePolicy: boolean;
7108
+ operationCpuQuota: boolean;
7109
+ };
7110
+
7111
+ export type MachineUpdateStatus =
7112
+ | "requested"
7113
+ | "accepted"
7114
+ | "waiting_for_idle"
7115
+ | "downloading"
7116
+ | "verifying"
7117
+ | "applying"
7118
+ | "restarting"
7119
+ | "succeeded"
7120
+ | "failed";
7121
+
7122
+ export type MachineUpdateState = {
7123
+ operationId: string;
7124
+ status: MachineUpdateStatus;
7125
+ targetVersion: string;
7126
+ expectedBinarySha256: string | null;
7127
+ errorCode: string | null;
7128
+ retryable: boolean;
7129
+ rolledBack: boolean;
7130
+ requestedAt: string;
7131
+ updatedAt: string;
7132
+ completedAt: string | null;
7133
+ };
7134
+
7135
+ export type MachineRuntime = {
7136
+ installedVersion: string | null;
7137
+ binarySha256: string | null;
7138
+ updateChannel: "stable" | "beta" | null;
7139
+ desiredVersion: string | null;
7140
+ versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
7141
+ capabilities: MachineRuntimeCapabilities;
7142
+ update: MachineUpdateState | null;
7143
+ };
7144
+
7145
+ export type UpdateMachineAgentResponse = {
7146
+ operationId: string;
7147
+ accepted: boolean;
7148
+ targetVersion: string;
7149
+ };
7150
+
7151
+ export type MachineOperationPolicy = {
7152
+ memoryMaxBytes: number | null;
7153
+ memoryHighBytes: number | null;
7154
+ cpuMaxMillicores: number | null;
7155
+ revision: number;
7156
+ updatedAt: string | null;
7157
+ };
7158
+
7159
+ export type UpdateMachineOperationPolicyRequest = {
7160
+ memoryMaxBytes: number | null;
7161
+ memoryHighBytes: number | null;
7162
+ /** Omitted preserves the current CPU limit for older/partial clients; null clears. */
7163
+ cpuMaxMillicores?: number | null;
7164
+ expectedRevision: number;
7165
+ };
6089
7166
 
6090
7167
  /** A machine as the Machines dashboard renders it (an enrolled selfhosted machine
6091
7168
  * or the session's synthetic Modal group box, `isSessionGroup: true`). */
6092
7169
  export type MachineView = {
6093
7170
  sandboxId: string;
6094
7171
  enrollmentId: string | null;
7172
+ scope: ResourceAuthorityScope;
7173
+ generation: number;
6095
7174
  name: string;
6096
7175
  kind: MachineKind;
6097
7176
  state: MachineState;
@@ -6110,6 +7189,14 @@ export type MachineView = {
6110
7189
  allowScreenControl: boolean;
6111
7190
  sharedSessionCount: number;
6112
7191
  lastSeenAt: string | null;
7192
+ /** Secret-free single-runner authority diagnostics. */
7193
+ connectionAuthority: MachineConnectionAuthority;
7194
+ /** Exact build/update truth. Null means the runner predates runtime Hello
7195
+ * reporting or this is a managed-session group without a connected agent. */
7196
+ runtime: MachineRuntime | null;
7197
+ /** Explicit per-enrollment command memory policy. Null only for managed
7198
+ * session boxes; null limits on a real machine mean unrestricted. */
7199
+ operationPolicy: MachineOperationPolicy | null;
6113
7200
  metrics: MetricSample | null;
6114
7201
  };
6115
7202
 
@@ -6191,6 +7278,7 @@ export type SwapActiveSandboxResponse = {
6191
7278
 
6192
7279
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
6193
7280
  export type EnrollmentOs = "linux" | "macos" | "windows";
7281
+ export type ResourceAuthorityScope = "organization" | "workspace" | "user";
6194
7282
 
6195
7283
  /** POST /v1/enrollments/device/lookup body. */
6196
7284
  export type DeviceEnrollmentLookupRequest = {
@@ -6218,6 +7306,7 @@ export type DeviceEnrollmentLookupResponse = {
6218
7306
  export type DeviceEnrollmentApproveRequest = {
6219
7307
  userCode: string;
6220
7308
  allowScreenControl?: boolean;
7309
+ scope?: ResourceAuthorityScope;
6221
7310
  };
6222
7311
 
6223
7312
  /** POST /v1/workspaces/:ws/enrollments/device/approve response. */