@opengeni/sdk 0.57.0 → 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 (94) hide show
  1. package/README.md +123 -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-JDLDDRNE.js → chunk-C2H7HBNP.js} +290 -33
  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-JRPFWI6T.js → chunk-G6LBVWKT.js} +2 -2
  12. package/dist/{chunk-HJ3HHUT5.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-PKQ377ED.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 +3 -0
  22. package/dist/codex-realtime-controller.js +2 -2
  23. package/dist/codex-realtime-v3.d.ts +13 -2
  24. package/dist/company-brain.d.ts +32 -0
  25. package/dist/company-profile.d.ts +1 -1
  26. package/dist/core.js +4 -4
  27. package/dist/editable-artifacts/browser-session.d.ts +7 -3
  28. package/dist/editable-artifacts/controller.d.ts +4 -1
  29. package/dist/editable-artifacts/errors.d.ts +1 -1
  30. package/dist/editable-artifacts/http-live-transport.d.ts +6 -2
  31. package/dist/editable-artifacts/index.d.ts +2 -0
  32. package/dist/editable-artifacts/open-failure.d.ts +9 -0
  33. package/dist/editable-artifacts/types.d.ts +4 -3
  34. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +1 -1
  35. package/dist/editable-artifacts-worker.js +44 -17
  36. package/dist/editable-artifacts-worker.js.map +1 -1
  37. package/dist/editable-artifacts.js +222 -119
  38. package/dist/editable-artifacts.js.map +1 -1
  39. package/dist/errors.d.ts +1 -1
  40. package/dist/index.d.ts +7 -4
  41. package/dist/index.js +61 -12
  42. package/dist/index.js.map +1 -1
  43. package/dist/interaction.d.ts +23 -0
  44. package/dist/interaction.js +4 -1
  45. package/dist/organization-private-session-settings.d.ts +6 -0
  46. package/dist/organization-private-session-settings.js +22 -0
  47. package/dist/organization-private-session-settings.js.map +1 -0
  48. package/dist/pr-review-client.d.ts +15 -0
  49. package/dist/pr-review.d.ts +4 -0
  50. package/dist/pr-review.js +56 -0
  51. package/dist/pr-review.js.map +1 -0
  52. package/dist/preference-registry.d.ts +8 -0
  53. package/dist/realtime.js +2 -2
  54. package/dist/retained-artifacts.d.ts +5 -1
  55. package/dist/types.d.ts +976 -17
  56. package/dist/workspace-instruction-policies.d.ts +22 -0
  57. package/dist/workspace-learning.d.ts +124 -0
  58. package/package.json +14 -2
  59. package/src/automations-client.ts +118 -0
  60. package/src/automations.ts +15 -0
  61. package/src/client.ts +974 -71
  62. package/src/codex-realtime-controller.ts +235 -5
  63. package/src/codex-realtime-v3.ts +162 -31
  64. package/src/company-brain.ts +99 -0
  65. package/src/company-profile.ts +4 -1
  66. package/src/editable-artifacts/browser-session.ts +36 -22
  67. package/src/editable-artifacts/controller.ts +66 -45
  68. package/src/editable-artifacts/errors.ts +2 -0
  69. package/src/editable-artifacts/http-live-transport.ts +62 -37
  70. package/src/editable-artifacts/index.ts +6 -0
  71. package/src/editable-artifacts/open-failure.ts +79 -0
  72. package/src/editable-artifacts/storage.ts +31 -40
  73. package/src/editable-artifacts/types.ts +4 -3
  74. package/src/editable-artifacts/worker/kernel-adapter.ts +23 -7
  75. package/src/editable-artifacts/worker/runtime.ts +26 -13
  76. package/src/editable-artifacts/worker/wire-codec.ts +23 -5
  77. package/src/errors.ts +1 -1
  78. package/src/index.ts +131 -0
  79. package/src/interaction.ts +95 -0
  80. package/src/organization-private-session-settings.ts +33 -0
  81. package/src/pr-review-client.ts +84 -0
  82. package/src/pr-review.ts +15 -0
  83. package/src/preference-registry.ts +9 -0
  84. package/src/retained-artifacts.ts +101 -0
  85. package/src/stream.ts +13 -2
  86. package/src/types.ts +1117 -16
  87. package/src/workspace-instruction-policies.ts +24 -0
  88. package/src/workspace-learning.ts +138 -0
  89. package/dist/chunk-HJ3HHUT5.js.map +0 -1
  90. package/dist/chunk-JDLDDRNE.js.map +0 -1
  91. package/dist/chunk-PKQ377ED.js.map +0 -1
  92. package/dist/chunk-ST5DDKJP.js.map +0 -1
  93. package/dist/chunk-VWE2QIVO.js.map +0 -1
  94. /package/dist/{chunk-JRPFWI6T.js.map → chunk-G6LBVWKT.js.map} +0 -0
package/dist/types.d.ts CHANGED
@@ -90,6 +90,8 @@ export type SessionRealtimeInboundEntry = {
90
90
  delegationItemId?: string | null | undefined;
91
91
  text?: string | null | undefined;
92
92
  payload?: Record<string, unknown> | undefined;
93
+ /** Model-visible application context attached to this exact realtime message. */
94
+ modelContext?: string | undefined;
93
95
  };
94
96
  export type SyncSessionRealtimeLedgerRequest = {
95
97
  browserInstanceId: string;
@@ -126,7 +128,7 @@ export type WorkspaceRealtimeModelCatalogResponse = {
126
128
  models: WorkspaceRealtimeModelCatalogItem[];
127
129
  };
128
130
  export type SessionRealtimeState = "active" | "ended";
129
- export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired";
131
+ export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired" | "authority_revoked";
130
132
  export type SessionRealtimeMode = {
131
133
  id: string;
132
134
  sessionId: string;
@@ -161,7 +163,7 @@ export type SessionRealtimeMutationResponse = {
161
163
  replay: boolean;
162
164
  };
163
165
  export type SessionStatus = "queued" | "running" | "idle" | "requires_action" | "recovering" | "waiting_capacity" | "failed" | "cancelled";
164
- export type SandboxBackend = "docker" | "modal" | "local" | "none" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted";
166
+ export type SandboxBackend = "docker" | "modal" | "local" | "none" | "daytona" | "runloop" | "e2b" | "blaxel" | "cloudflare" | "vercel" | "selfhosted" | "opensandbox";
165
167
  export type SandboxOs = "linux" | "macos" | "windows";
166
168
  export type SandboxCapabilityName = "FileSystem" | "Terminal" | "Git" | "DesktopStream" | "Recording";
167
169
  export type CapabilityUnavailableReason = "backend_unsupported" | "os_unsupported" | "not_provisioned" | "disabled_by_policy" | "lease_cold" | "tier_headless" | "agent_offline" | "agent_reconnecting" | "consent_required" | "display_unavailable";
@@ -304,6 +306,8 @@ export type RepositoryResourceRef = {
304
306
  kind: "repository";
305
307
  uri: string;
306
308
  ref: string;
309
+ /** Exact immutable commit that repository materialization must produce. */
310
+ expectedCommitSha?: string | undefined;
307
311
  /**
308
312
  * Optional workspace-relative override. When omitted, OpenGeni persists
309
313
  * `repos/<encoded-host>/<owner>/<repo>` so equal names on different Git
@@ -313,6 +317,7 @@ export type RepositoryResourceRef = {
313
317
  mountPath?: string | undefined;
314
318
  subpath?: string | undefined;
315
319
  provider?: GitCredentialProvider | undefined;
320
+ connectionType?: "github_personal" | undefined;
316
321
  credentialBindingId?: GitCredentialBindingId | undefined;
317
322
  access?: GitRepositoryAccess | undefined;
318
323
  repositoryId?: number | string | undefined;
@@ -335,6 +340,7 @@ export type ToolRef = {
335
340
  kind: "mcp";
336
341
  id: string;
337
342
  optional?: boolean | undefined;
343
+ eager?: boolean | undefined;
338
344
  };
339
345
  export type SessionToolPolicy = {
340
346
  mode: "workspace_default" | "explicit" | "inherited";
@@ -374,6 +380,7 @@ export type SessionEffectiveToolPolicy = {
374
380
  export type GoalSpec = {
375
381
  text: string;
376
382
  successCriteria?: string | undefined;
383
+ rootConstraints?: string[] | undefined;
377
384
  maxAutoContinuations?: number | undefined;
378
385
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
379
386
  };
@@ -412,6 +419,25 @@ export type UpdateSessionMcpApprovalPolicyResponse = {
412
419
  };
413
420
  export type ConnectionKind = "oauth2" | "api_key" | "app_install" | "delegated";
414
421
  export type ConnectionStatus = "active" | "needs_reauth" | "revoked" | "error";
422
+ export type UserResourceDelegation = {
423
+ authorityId: string;
424
+ grantId: string;
425
+ organizationId: string;
426
+ workspaceId: string;
427
+ sessionId: string | null;
428
+ action: string;
429
+ mode: "once" | "session" | "always";
430
+ context: "user_private" | "workspace_shared";
431
+ authorityEpoch: number | null;
432
+ authorityGeneration: number;
433
+ grantGeneration: number;
434
+ resourceVersionId?: string | null | undefined;
435
+ };
436
+ export type McpConnectionAuthoritySelection = {
437
+ serverId: string;
438
+ connectionId: string;
439
+ userDelegation: UserResourceDelegation;
440
+ };
415
441
  export type McpServerConnectionRef = {
416
442
  connectionId?: string | undefined;
417
443
  provider?: string | undefined;
@@ -466,6 +492,98 @@ export type CreateConnectionRequest = {
466
492
  expiresAt?: string | null | undefined;
467
493
  metadata?: Record<string, unknown> | undefined;
468
494
  };
495
+ export type PersonalGitHubConnectionMetadata = {
496
+ credentialRole: "opengeni_github_personal";
497
+ providerFamily: "github";
498
+ providerPrincipalId: string;
499
+ githubUserId: string;
500
+ githubLogin: string;
501
+ oauthEnvironment: string;
502
+ oauthClientMarker: string;
503
+ credentialBindingId: string;
504
+ connectedAt: string;
505
+ lastVerifiedAt: string;
506
+ refreshTokenExpiresAt?: string | null | undefined;
507
+ disconnectedAt?: string | null | undefined;
508
+ [key: string]: unknown;
509
+ };
510
+ export type PersonalGitHubOAuthStartRequest = {
511
+ connectionId?: string | undefined;
512
+ returnPath?: string | undefined;
513
+ };
514
+ export type PersonalGitHubOAuthStartResponse = {
515
+ authorizationUrl: string;
516
+ expiresAt: string;
517
+ };
518
+ export type PersonalGitHubConnectionStatusResponse = {
519
+ enabled: boolean;
520
+ connection: ConnectionMetadata | null;
521
+ reviewUrl: string | null;
522
+ };
523
+ export type PersonalGitHubDisconnectRequest = {
524
+ expectedVersion: number;
525
+ idempotencyKey: string;
526
+ };
527
+ export type PersonalGitHubRepositoryAccess = "read" | "write";
528
+ export type PersonalGitHubRepositoryPermissions = {
529
+ pull: boolean;
530
+ push: boolean;
531
+ admin: boolean;
532
+ maintain: boolean;
533
+ triage: boolean;
534
+ };
535
+ export type PersonalGitHubRepository = {
536
+ repositoryId: string;
537
+ fullName: string;
538
+ canonicalUrl: string;
539
+ defaultBranch: string;
540
+ visibility: "public" | "private" | "internal";
541
+ private: boolean;
542
+ archived: boolean;
543
+ disabled: boolean;
544
+ permissions: PersonalGitHubRepositoryPermissions;
545
+ };
546
+ export type PersonalGitHubSelectedRepository = PersonalGitHubRepository & {
547
+ selectedAccess: PersonalGitHubRepositoryAccess;
548
+ selectionGeneration: number;
549
+ selectedAt: string;
550
+ lastVerifiedAt: string;
551
+ };
552
+ export type PersonalGitHubRepositorySelectionState = {
553
+ connectionAuthorityGeneration: number;
554
+ credentialBindingId: string;
555
+ providerPrincipalId: string;
556
+ selectionGeneration: number;
557
+ repositories: PersonalGitHubSelectedRepository[];
558
+ };
559
+ export type PersonalGitHubRepositoryCatalogItem = PersonalGitHubRepository & {
560
+ selectedAccess: PersonalGitHubRepositoryAccess | null;
561
+ };
562
+ export type ListPersonalGitHubRepositoriesOptions = {
563
+ cursor?: number | undefined;
564
+ limit?: number | undefined;
565
+ };
566
+ export type ListPersonalGitHubRepositoriesResponse = {
567
+ repositories: PersonalGitHubRepositoryCatalogItem[];
568
+ nextCursor: number | null;
569
+ selection: PersonalGitHubRepositorySelectionState;
570
+ };
571
+ export type PersonalGitHubRepositorySelectionInput = {
572
+ repositoryId: string;
573
+ fullName: string;
574
+ access: PersonalGitHubRepositoryAccess;
575
+ };
576
+ export type ReplacePersonalGitHubRepositorySelectionsRequest = {
577
+ expectedConnectionAuthorityGeneration: number;
578
+ expectedSelectionGeneration: number;
579
+ idempotencyKey: string;
580
+ repositories: PersonalGitHubRepositorySelectionInput[];
581
+ };
582
+ export type VerifyPersonalGitHubRepositorySelectionsRequest = {
583
+ expectedConnectionAuthorityGeneration: number;
584
+ expectedSelectionGeneration: number;
585
+ idempotencyKey: string;
586
+ };
469
587
  export type OpenGeniSlackBotInstallRequest = {
470
588
  /** Existing OpenGeni Slack bot connection to reinstall in place. */
471
589
  connectionId?: string | undefined;
@@ -502,7 +620,7 @@ export type SlackInstallationBinding = {
502
620
  slackTeamName: string;
503
621
  botId: string;
504
622
  botUserId: string;
505
- botDisplayName: "OpenGeni";
623
+ botDisplayName: "OpenGeni" | "OpenGeni Staging";
506
624
  state: SlackInstallationBindingState;
507
625
  quarantineReason: string | null;
508
626
  version: number;
@@ -556,16 +674,25 @@ export type GoogleDriveConnectionMetadata = {
556
674
  googleEmail: string;
557
675
  googleDisplayName: string | null;
558
676
  verifiedAt: string;
559
- accessMode: "metadata_readonly" | "readonly";
677
+ accessMode: "file_only" | "metadata_readonly" | "readonly";
560
678
  lifecycle?: GoogleDriveConnectionLifecycle | undefined;
679
+ outputDestination?: GoogleDriveOutputDestination | undefined;
561
680
  documentDestination?: ConnectorDocumentDestination | undefined;
562
681
  selectedSources?: GoogleDriveSelectedSource[] | undefined;
563
682
  /** @deprecated Read selectedSources; retained while existing connections migrate. */
564
683
  selectedSource?: GoogleDriveSelectedSource | null | undefined;
565
684
  [key: string]: unknown;
566
685
  };
686
+ export type GoogleDriveOutputDestination = {
687
+ folderId: string;
688
+ folderName: string;
689
+ driveId: string | null;
690
+ location: "my_drive" | "shared_drive";
691
+ selectedAt: string;
692
+ };
567
693
  export type GoogleDriveOAuthStartRequest = {
568
694
  connectionId?: string | undefined;
695
+ capability?: "source_read" | "publish" | undefined;
569
696
  };
570
697
  export type GoogleDriveOAuthStartResponse = {
571
698
  authorizationUrl: string;
@@ -785,11 +912,84 @@ export type IntegrationClientMetadata = {
785
912
  grant_types: Array<"authorization_code" | "refresh_token">;
786
913
  response_types: ["code"];
787
914
  };
915
+ export type SessionVisibility = "private" | "workspace";
916
+ export type SessionTenancyCreateCapabilities = {
917
+ activated: boolean;
918
+ canCreatePrivate: boolean;
919
+ reason: "available" | "not_activated" | "managed_session_required" | "unavailable";
920
+ };
921
+ export type SessionTenancyPublicProjection = {
922
+ visibility: SessionVisibility;
923
+ authorityEpoch: number;
924
+ ownedByCurrentUser: boolean;
925
+ fork: {
926
+ sourceVisibility: SessionVisibility;
927
+ sourceAuthorityEpoch: number;
928
+ forkedAt: string;
929
+ } | null;
930
+ };
931
+ export type UpdateSessionVisibilityRequest = {
932
+ visibility: SessionVisibility;
933
+ expectedAuthorityEpoch: number;
934
+ idempotencyKey: string;
935
+ };
936
+ export type UpdateSessionVisibilityResponse = {
937
+ operationId: string;
938
+ eventId: string | null;
939
+ eventSequence: number | null;
940
+ visibility: SessionVisibility;
941
+ authorityEpoch: number;
942
+ changed: boolean;
943
+ replay: boolean;
944
+ revokedGrantCount: number;
945
+ };
946
+ export type ForkSessionRequest = {
947
+ idempotencyKey: string;
948
+ visibility: SessionVisibility;
949
+ workspaceSharedAcknowledged: boolean;
950
+ };
951
+ export type ForkSessionResponse = {
952
+ operationId: string;
953
+ eventId: string;
954
+ eventSequence: number;
955
+ sessionId: string;
956
+ workspaceId: string;
957
+ visibility: SessionVisibility;
958
+ authorityEpoch: 1;
959
+ copiedHistoryItemCount: number;
960
+ replay: boolean;
961
+ };
962
+ export type SessionBackgroundCommandActivity = {
963
+ state: "running" | "stopping";
964
+ count: number;
965
+ };
966
+ export type SessionBackgroundCommand = {
967
+ id: string;
968
+ workspaceId: string;
969
+ sessionId: string;
970
+ provider: "managed" | "connected_machine";
971
+ state: "running" | "stopping" | "exited" | "lost";
972
+ commandPreview: string;
973
+ cancelRequestedAt: string | null;
974
+ exitCode: number | null;
975
+ settlementReason: string | null;
976
+ startedAt: string;
977
+ settledAt: string | null;
978
+ updatedAt: string;
979
+ };
980
+ export type SessionBackgroundCommandListResponse = {
981
+ commands: SessionBackgroundCommand[];
982
+ };
983
+ export type CancelSessionBackgroundCommandResult = {
984
+ command: SessionBackgroundCommand;
985
+ accepted: boolean;
986
+ };
788
987
  export type Session = {
789
988
  id: string;
790
989
  workspaceId: string;
791
990
  accountId: string;
792
991
  status: SessionStatus;
992
+ backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
793
993
  initialMessage: string;
794
994
  title: string | null;
795
995
  titleSource: "user" | "agent" | null;
@@ -803,10 +1003,14 @@ export type Session = {
803
1003
  toolPolicyVersion: number;
804
1004
  effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
805
1005
  metadata: Record<string, unknown>;
1006
+ /** Present only when session-tenancy product activation is enabled for the organization. */
1007
+ tenancy?: SessionTenancyPublicProjection | undefined;
806
1008
  /** Frozen creator fact; later turns carry their own independent initiator. */
807
1009
  createdBy: TurnInitiator;
808
1010
  createdByContext: Record<string, unknown>;
809
1011
  model: string;
1012
+ reasoningEffort: ReasoningEffort;
1013
+ latencyMode: LatencyMode;
810
1014
  sandboxBackend: SandboxBackend;
811
1015
  sandboxOs: SandboxOs;
812
1016
  sandboxGroupId: string;
@@ -855,6 +1059,17 @@ export type Session = {
855
1059
  pinnedAt?: string | null;
856
1060
  /** Optimistic pin-state revision; zero represents an absent pin relation. */
857
1061
  pinVersion?: number;
1062
+ /** Personal explicit acknowledgment state. */
1063
+ unread?: boolean;
1064
+ /** Personal actively-working label. */
1065
+ activelyWorking?: boolean;
1066
+ /** Optimistic unread/actively-working revision. */
1067
+ attentionVersion?: number;
1068
+ /** Personal archive state. */
1069
+ archived?: boolean;
1070
+ archivedAt?: string | null;
1071
+ /** Optimistic archive-state revision. */
1072
+ archiveVersion?: number;
858
1073
  /** Server-authoritative descendant counts populated by session-list reads. */
859
1074
  treeStats?: {
860
1075
  directChildren: number;
@@ -864,9 +1079,21 @@ export type Session = {
864
1079
  attentionDescendants: number;
865
1080
  pausedDescendants: number;
866
1081
  failedDescendants: number;
1082
+ unreadDescendants?: number | undefined;
1083
+ activelyWorkingDescendants?: number | undefined;
1084
+ /**
1085
+ * Earliest moment one of the counted `attentionDescendants` entered
1086
+ * `requires_action`; null when none is waiting, absent on older servers.
1087
+ */
1088
+ attentionSince?: string | null | undefined;
867
1089
  /** Counts are lower bounds rather than exact totals when true. */
868
1090
  truncated: boolean;
869
1091
  } | undefined;
1092
+ /**
1093
+ * When this session's own open turn entered `requires_action`. Populated by
1094
+ * list and lineage reads for `requires_action` sessions; null otherwise.
1095
+ */
1096
+ requiresActionSince?: string | null | undefined;
870
1097
  createdAt: string;
871
1098
  updatedAt: string;
872
1099
  };
@@ -930,6 +1157,16 @@ export type UpdateSessionPinRequest = {
930
1157
  pinned: boolean;
931
1158
  expectedVersion?: number;
932
1159
  };
1160
+ export type UpdateSessionAttentionRequest = {
1161
+ unread?: boolean;
1162
+ acknowledgedThroughSequence?: number;
1163
+ activelyWorking?: boolean;
1164
+ expectedVersion?: number;
1165
+ };
1166
+ export type UpdateSessionArchiveRequest = {
1167
+ archived: boolean;
1168
+ expectedVersion?: number;
1169
+ };
933
1170
  export type LineageNode = {
934
1171
  session: SessionSummary;
935
1172
  children: LineageNode[];
@@ -965,6 +1202,21 @@ export type SubmittedTimelineAnnotation = DraftTimelineAnnotation;
965
1202
  export type TimelineAnnotation = DraftTimelineAnnotation & {
966
1203
  ordinal: number;
967
1204
  };
1205
+ export declare const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING_VERSION: 1;
1206
+ export declare const PERSONAL_RESOURCE_SHARED_OUTPUT_WARNING = "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.";
1207
+ export type PersonalResourceAttachmentIntent = {
1208
+ mode: "once" | "session" | "always";
1209
+ expectedAuthorityEpoch?: number | undefined;
1210
+ workspaceSharedAcknowledged?: boolean | undefined;
1211
+ sharedOutputWarningVersion: 1;
1212
+ };
1213
+ export type PersonalResourceAttachmentSummary = {
1214
+ mode: "once" | "session" | "always";
1215
+ context: "user_private" | "workspace_shared";
1216
+ resourceCount: number;
1217
+ resourceKinds: Array<"variable_set" | "rig" | "connected_machine">;
1218
+ sharedOutputWarningVersion: 1;
1219
+ };
968
1220
  export type SessionTurn = {
969
1221
  id: string;
970
1222
  workspaceId: string;
@@ -992,6 +1244,7 @@ export type SessionTurn = {
992
1244
  initiator: TurnInitiator;
993
1245
  initiatorContext: Record<string, unknown>;
994
1246
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
1247
+ personalResources?: PersonalResourceAttachmentSummary | null | undefined;
995
1248
  cancelledBy?: string | null;
996
1249
  cancelReason?: string | null;
997
1250
  startedAt: string | null;
@@ -1054,7 +1307,7 @@ export type SessionHumanInputRequest = {
1054
1307
  createdAt: string;
1055
1308
  updatedAt: string;
1056
1309
  };
1057
- export declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.progress", "goal.rewrite.proposed", "goal.rewrite.rejected", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.visibility.changed", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1310
+ export declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "turn.startup.phase.started", "turn.startup.phase.completed", "turn.startup.phase.failed", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "session.command.backgrounded", "session.command.finished", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.progress", "goal.rewrite.proposed", "goal.rewrite.rejected", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.held", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.visibility.changed", "session.personal_resources.attached", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1058
1311
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1059
1312
  /**
1060
1313
  * Event types the SDK knows about today, kept open so a newer OpenGeni server
@@ -1396,6 +1649,16 @@ export type FsReadResponse = {
1396
1649
  isBinary: boolean;
1397
1650
  revision: number;
1398
1651
  };
1652
+ export declare const SANDBOX_FILE_ARTIFACT_MAX_BYTES: number;
1653
+ export type PublishSandboxFileArtifactRequest = {
1654
+ path: string;
1655
+ };
1656
+ export type SandboxFileArtifactReceipt = {
1657
+ type: "sandbox_file";
1658
+ sandboxPath: string;
1659
+ filename: string;
1660
+ artifact: RetainedArtifactReference;
1661
+ };
1399
1662
  export type FsWriteRequest = {
1400
1663
  path: string;
1401
1664
  encoding?: FsEncoding;
@@ -1737,6 +2000,57 @@ export type ScheduledTaskScheduleSpec = {
1737
2000
  minute: number;
1738
2001
  daysOfWeek?: ScheduledTaskDayOfWeek[] | undefined;
1739
2002
  };
2003
+ export type IncidentTelemetrySeriesMetadata = {
2004
+ metric: string;
2005
+ labels: string[];
2006
+ };
2007
+ export type IncidentTelemetryDataRoute = {
2008
+ kind: "mcp";
2009
+ serverId: string;
2010
+ } | {
2011
+ kind: "first_party";
2012
+ tool: FirstPartyMcpToolName;
2013
+ } | {
2014
+ kind: "variable_set";
2015
+ variableSetName: string;
2016
+ variableNames: string[];
2017
+ } | {
2018
+ kind: "rig_credential_hook";
2019
+ credentialHookId: string;
2020
+ };
2021
+ export type IncidentTelemetryPreflight = {
2022
+ requiredResources: ResourceRef[];
2023
+ requiredMcpServerIds: string[];
2024
+ requiredFirstPartyMcpTools: FirstPartyMcpToolName[];
2025
+ requiredFirstPartyMcpPermissions: Permission[];
2026
+ requiredRig: {
2027
+ name: string;
2028
+ credentialHookIds: string[];
2029
+ } | null;
2030
+ requiredVariableSetNames: string[];
2031
+ requiredVariableNames: string[];
2032
+ dataSource: {
2033
+ kind: "prometheus";
2034
+ queryPath: "/api/v1/query" | "/api/v1/query_range";
2035
+ workspaceLabel: string;
2036
+ alertSelectorLabels: string[];
2037
+ route: IncidentTelemetryDataRoute;
2038
+ requiredSeries: IncidentTelemetrySeriesMetadata[];
2039
+ availableSeries: IncidentTelemetrySeriesMetadata[];
2040
+ };
2041
+ };
2042
+ export type IncidentTelemetryPreflightInput = Omit<IncidentTelemetryPreflight, "requiredResources" | "requiredMcpServerIds" | "requiredFirstPartyMcpTools" | "requiredFirstPartyMcpPermissions" | "requiredRig" | "requiredVariableSetNames" | "requiredVariableNames"> & {
2043
+ requiredResources?: ResourceRef[] | undefined;
2044
+ requiredMcpServerIds?: string[] | undefined;
2045
+ requiredFirstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2046
+ requiredFirstPartyMcpPermissions?: Permission[] | undefined;
2047
+ requiredRig?: {
2048
+ name: string;
2049
+ credentialHookIds?: string[] | undefined;
2050
+ } | null | undefined;
2051
+ requiredVariableSetNames?: string[] | undefined;
2052
+ requiredVariableNames?: string[] | undefined;
2053
+ };
1740
2054
  export type ScheduledTaskAgentConfig = {
1741
2055
  prompt: string;
1742
2056
  resources: ResourceRef[];
@@ -1747,6 +2061,8 @@ export type ScheduledTaskAgentConfig = {
1747
2061
  reasoningEffort?: ReasoningEffort | undefined;
1748
2062
  sandboxBackend?: SandboxBackend | undefined;
1749
2063
  goal?: GoalSpec | undefined;
2064
+ executionClass?: "incident_telemetry" | undefined;
2065
+ incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
1750
2066
  maxNestedAgentDepth?: number | undefined;
1751
2067
  };
1752
2068
  export type ScopedKnowledgeScope = {
@@ -1808,6 +2124,8 @@ export type ScheduledTask = {
1808
2124
  createdBy?: TurnInitiator | undefined;
1809
2125
  createdByContext?: TurnInitiatorContext | undefined;
1810
2126
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
2127
+ authorityRevision: number;
2128
+ executionDigest: string;
1811
2129
  targetSessionId: string | null;
1812
2130
  reusableSessionId: string | null;
1813
2131
  variableSetId: string | null;
@@ -1820,11 +2138,12 @@ export type ScheduledTask = {
1820
2138
  };
1821
2139
  export type CreateSessionRequest = {
1822
2140
  requestedSessionId?: string | undefined;
2141
+ visibility?: SessionVisibility | undefined;
1823
2142
  initialMessage?: string | undefined;
1824
2143
  /** Create an idle session shell so realtime voice can be the first interaction. */
1825
2144
  startMode?: "realtime" | undefined;
1826
- /** System instructions scoped to the initial turn; never visible timeline text. */
1827
- turnInstructions?: string | undefined;
2145
+ /** Model-visible application context attached to the initial user message; omitted by standard timeline rendering. */
2146
+ modelContext?: string | undefined;
1828
2147
  instructions?: string | undefined;
1829
2148
  /** Immutable normalized prompt-policy role; distinct from membership roles. */
1830
2149
  policyRole?: string | undefined;
@@ -1851,18 +2170,20 @@ export type CreateSessionRequest = {
1851
2170
  firstPartyMcpPermissions?: string[] | undefined;
1852
2171
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
1853
2172
  mcpServers?: SessionMcpServerInput[] | undefined;
2173
+ /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2174
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
1854
2175
  sandbox?: "shared" | "new" | {
1855
2176
  groupId: string;
1856
2177
  } | undefined;
1857
2178
  };
1858
- export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
2179
+ export declare const KNOWN_PERMISSIONS: readonly ["account:read", "account:admin", "members:manage", "workspace:create", "billing:read", "billing:manage", "workspace:read", "workspace:admin", "sessions:create", "sessions:read", "sessions:control", "stream:view", "stream:control", "stream:acknowledge", "files:upload", "files:read", "files:write", "terminal:attach", "documents:manage", "documents:search", "scheduled_tasks:manage", "scheduled_tasks:run", "github:manage", "github:use", "api_keys:manage", "connections:read", "connections:write", "environments:manage", "environments:use", "variable-sets:list", "variable-sets:read", "variable-sets:write", "variable-sets:manage", "variable-sets:attach", "variable-sets:use", "secrets:list", "secrets:read", "secrets:write", "mcp_servers:attach", "codemode:call", "goals:manage", "enrollments:read", "enrollments:manage", "rigs:use", "rigs:manage", "artifacts:read", "artifacts:publish"];
1859
2180
  export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
1860
2181
  /**
1861
2182
  * Permissions the SDK knows about today, kept open so a newer OpenGeni server
1862
2183
  * can introduce permissions without breaking older SDK consumers.
1863
2184
  */
1864
2185
  export type Permission = KnownPermission | (string & {});
1865
- export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "task_notes_list" | "task_note_save" | "task_note_archive" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_clipboard" | "browser_debug" | "browser_auth" | "interaction_request_human" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_clipboard" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "fiken_companies_list" | "fiken_contacts_list" | "fiken_contact_create" | "fiken_products_list" | "fiken_invoices_list" | "fiken_invoice_get" | "fiken_invoice_draft_create" | "fiken_bank_accounts_list" | "fiken_purchases_list" | "fiken_sales_list" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
2186
+ export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "goal_wait" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "task_notes_list" | "task_note_save" | "task_note_archive" | "task_note_replace" | "knowledge_propose" | "knowledge_correct" | "task_note_promote_knowledge" | "task_note_promote_instruction_policy" | "task_note_promote_preference" | "instruction_policy_propose" | "preference_propose" | "remember" | "remember_confirm" | "company_profile_propose" | "company_profile_confirm" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_wait" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "session_human_input_respond" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_clipboard" | "browser_debug" | "browser_auth" | "interaction_request_human" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_clipboard" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_search" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "fiken_companies_list" | "fiken_contacts_list" | "fiken_contact_create" | "fiken_products_list" | "fiken_invoices_list" | "fiken_invoice_get" | "fiken_invoice_draft_create" | "fiken_bank_accounts_list" | "fiken_purchases_list" | "fiken_sales_list" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "sandbox_file_publish" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
1866
2187
  export type ProductAccessMode = "local" | "configured" | "managed";
1867
2188
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
1868
2189
  export type ModelCapabilityStateV1 = {
@@ -1976,11 +2297,26 @@ export type ModelCredentialReadinessV1 = {
1976
2297
  };
1977
2298
  export type WorkspaceModelCatalogModel = ClientModel & {
1978
2299
  credentialReadiness: ModelCredentialReadinessV1;
2300
+ /** Exact workspace-policy verdict without exposing provider identity. */
2301
+ policyAllowed?: boolean | undefined;
1979
2302
  availability: ModelAvailabilityV1;
1980
2303
  };
1981
2304
  export type WorkspaceModelCatalogResponse = {
1982
2305
  models: WorkspaceModelCatalogModel[];
1983
2306
  };
2307
+ /**
2308
+ * The workspace's hard model/provider allowlist. `null` means unrestricted for
2309
+ * that dimension; an empty array is an explicit total block.
2310
+ */
2311
+ export type WorkspaceModelAccessPolicy = {
2312
+ allowedProviders: string[] | null;
2313
+ allowedModels: string[] | null;
2314
+ };
2315
+ /** Full replacement body for `PUT /v1/workspaces/:id/model-policy`. */
2316
+ export type UpdateWorkspaceModelAccessPolicyRequest = {
2317
+ allowedProviders?: string[] | null | undefined;
2318
+ allowedModels?: string[] | null | undefined;
2319
+ };
1984
2320
  /**
1985
2321
  * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
1986
2322
  * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
@@ -2121,6 +2457,12 @@ export type CodexAccountOverview = {
2121
2457
  credits: CodexResetCredit[];
2122
2458
  };
2123
2459
  canRedeem: boolean;
2460
+ /** Secret-free reason redemption is owner-actionable or view-only. */
2461
+ redemptionAccess: {
2462
+ ownership: "current_human" | "unowned" | "different_human" | "managed_human_unavailable";
2463
+ /** A direct managed-cookie admin may claim only an unowned same-provider row by reconnecting. */
2464
+ canClaimUnownedViaReconnect: boolean;
2465
+ };
2124
2466
  /** Owning managed-cookie human may replay durable completion without a healthy provider token. */
2125
2467
  canResumeRedemption: boolean;
2126
2468
  /** Durable owner-scoped ambiguity/completion discovery; never redemption authority for agents. */
@@ -2287,8 +2629,10 @@ export type ClientAuthConfig = {
2287
2629
  } | {
2288
2630
  mode: "managedSession";
2289
2631
  session: "cookie";
2632
+ /** Defaults to true when omitted by an older deployment. */
2633
+ emailVerificationRequired?: boolean;
2290
2634
  };
2291
- export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-social-provider-tools-v1";
2635
+ export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-atomic-session-fork-visibility-v1";
2292
2636
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2293
2637
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2294
2638
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2456,6 +2800,208 @@ export type ManagedOrganizationMembership = {
2456
2800
  export type ListManagedOrganizationMembershipsResponse = {
2457
2801
  memberships: ManagedOrganizationMembership[];
2458
2802
  };
2803
+ export type UserResourceKind = "connection" | "document" | "variable_set" | "rig" | "connected_machine";
2804
+ export type UserResourceGrantAction = "connection.use" | "document.read" | "variable_set.use" | "rig.use" | "connected_machine.use";
2805
+ export type UserResourceAuthorityGrant = {
2806
+ grantId: string;
2807
+ targetWorkspaceId: string;
2808
+ targetSessionId: string | null;
2809
+ action: UserResourceGrantAction;
2810
+ mode: "once" | "session" | "always";
2811
+ context: "user_private" | "workspace_shared";
2812
+ authorityEpoch: number | null;
2813
+ generation: number;
2814
+ status: "active" | "consumed" | "revoked" | "expired";
2815
+ expiresAt: string | null;
2816
+ delegation: UserResourceDelegation;
2817
+ };
2818
+ export type UserResourceAuthoritySummary = {
2819
+ authorityId: string;
2820
+ resourceKind: UserResourceKind;
2821
+ resourceId: string;
2822
+ originWorkspaceId: string | null;
2823
+ generation: number;
2824
+ status: "active" | "retained" | "revoked";
2825
+ grants: UserResourceAuthorityGrant[];
2826
+ };
2827
+ export type ListUserResourceAuthoritiesOptions = {
2828
+ resourceKind: UserResourceKind;
2829
+ cursor?: string | undefined;
2830
+ limit?: number | undefined;
2831
+ };
2832
+ export type ListUserResourceAuthoritiesResponse = {
2833
+ scope: "user";
2834
+ authorities: UserResourceAuthoritySummary[];
2835
+ nextCursor: string | null;
2836
+ };
2837
+ export type IssueUserResourceGrantRequest = {
2838
+ scope: "user";
2839
+ resourceKind: UserResourceKind;
2840
+ mode: "session";
2841
+ context: "user_private" | "workspace_shared";
2842
+ sessionId: string;
2843
+ expectedAuthorityEpoch: number;
2844
+ workspaceSharedAcknowledged?: boolean | undefined;
2845
+ } | {
2846
+ scope: "user";
2847
+ resourceKind: UserResourceKind;
2848
+ mode: "always";
2849
+ context: "user_private" | "workspace_shared";
2850
+ sessionId?: null | undefined;
2851
+ expectedAuthorityEpoch?: null | undefined;
2852
+ workspaceSharedAcknowledged?: boolean | undefined;
2853
+ };
2854
+ export type UserResourceGrantMutationResponse = {
2855
+ scope: "user";
2856
+ grant: UserResourceAuthorityGrant;
2857
+ };
2858
+ export type RevokeUserResourceGrantResponse = {
2859
+ scope: "user";
2860
+ grant: {
2861
+ grantId: string;
2862
+ generation: number;
2863
+ status: "revoked";
2864
+ revokedAt: string;
2865
+ };
2866
+ };
2867
+ export type OrganizationMembershipRole = "owner" | "admin" | "member";
2868
+ export type OrganizationInvitation = {
2869
+ id: string;
2870
+ organizationId: string;
2871
+ targetEmail: string;
2872
+ targetName: string | null;
2873
+ initialWorkspaceIds: string[];
2874
+ role: OrganizationMembershipRole;
2875
+ status: "pending" | "accepted" | "revoked" | "expired";
2876
+ revision: number;
2877
+ expiresAt: string;
2878
+ acceptedMembershipId: string | null;
2879
+ createdAt: string;
2880
+ updatedAt: string;
2881
+ };
2882
+ export type OrganizationMember = {
2883
+ id: string;
2884
+ organizationId: string;
2885
+ subjectId: string;
2886
+ name: string | null;
2887
+ email: string | null;
2888
+ role: OrganizationMembershipRole;
2889
+ status: "provisioning" | "active" | "suspended" | "revoked";
2890
+ authorizationRevision: number;
2891
+ personalWorkspaceId: string | null;
2892
+ revokedAt: string | null;
2893
+ personalRetentionUntil: string | null;
2894
+ createdAt: string;
2895
+ updatedAt: string;
2896
+ };
2897
+ export type OrganizationSummary = {
2898
+ id: string;
2899
+ name: string;
2900
+ createdAt: string;
2901
+ updatedAt: string;
2902
+ };
2903
+ export type OrganizationWorkspaceAccessMember = {
2904
+ membershipId: string;
2905
+ subjectId: string;
2906
+ subjectLabel: string | null;
2907
+ principalKind: "human" | "service";
2908
+ role: string;
2909
+ permissions: string[];
2910
+ createdAt: string;
2911
+ };
2912
+ export type OrganizationWorkspaceAccess = {
2913
+ id: string;
2914
+ name: string;
2915
+ slug: string | null;
2916
+ createdAt: string;
2917
+ updatedAt: string;
2918
+ members: OrganizationWorkspaceAccessMember[];
2919
+ };
2920
+ export type OrganizationAdministrationOverview = {
2921
+ organization: OrganizationSummary;
2922
+ workspaces: OrganizationWorkspaceAccess[];
2923
+ };
2924
+ export type OrganizationPrivateSessionSettings = {
2925
+ organizationId: string;
2926
+ enabled: boolean;
2927
+ available: boolean;
2928
+ version: number;
2929
+ updatedAt: string;
2930
+ changed?: boolean;
2931
+ };
2932
+ export type AddOrganizationWorkspaceMemberRequest = {
2933
+ organizationMembershipId: string;
2934
+ role?: string | undefined;
2935
+ permissions: Permission[];
2936
+ };
2937
+ export type CreateOrganizationWorkspaceRequest = {
2938
+ name: string;
2939
+ slug?: string | null;
2940
+ agentInstructions?: string | null;
2941
+ operationId: string;
2942
+ };
2943
+ export type CreateOrganizationRequest = {
2944
+ name: string;
2945
+ operationId: string;
2946
+ };
2947
+ export type CreateOrganizationResponse = {
2948
+ organization: OrganizationSummary;
2949
+ workspaceId: string;
2950
+ };
2951
+ export type UpdateOrganizationNameRequest = {
2952
+ name: string;
2953
+ expectedUpdatedAt: string;
2954
+ operationId: string;
2955
+ };
2956
+ export type UpdateOrganizationPrivateSessionSettingsRequest = {
2957
+ enabled: boolean;
2958
+ expectedVersion: number;
2959
+ operationId: string;
2960
+ };
2961
+ export type OrganizationRetentionPolicy = {
2962
+ organizationId: string;
2963
+ mode: "retain" | "delete_after";
2964
+ retentionDays: number | null;
2965
+ version: number;
2966
+ updatedAt: string;
2967
+ };
2968
+ export type CreateOrganizationInvitationRequest = {
2969
+ email: string;
2970
+ name?: string;
2971
+ initialWorkspaceIds?: string[];
2972
+ role?: OrganizationMembershipRole;
2973
+ expiresAt: string;
2974
+ operationId: string;
2975
+ };
2976
+ export type AcceptOrganizationInvitationRequest = {
2977
+ expectedRevision: number;
2978
+ operationId: string;
2979
+ };
2980
+ export type RevokeOrganizationInvitationRequest = AcceptOrganizationInvitationRequest;
2981
+ export type UpdateOrganizationMemberRequest = {
2982
+ kind: "change_role" | "suspend" | "reactivate" | "offboard";
2983
+ role?: OrganizationMembershipRole;
2984
+ expectedAuthorizationRevision: number;
2985
+ operationId: string;
2986
+ reason?: string;
2987
+ };
2988
+ export type UpdateOrganizationRetentionPolicyRequest = {
2989
+ mode: "retain" | "delete_after";
2990
+ retentionDays: number | null;
2991
+ expectedVersion: number;
2992
+ operationId: string;
2993
+ };
2994
+ export type ListOrganizationInvitationsPageResponse = {
2995
+ invitations: OrganizationInvitation[];
2996
+ nextCursor: string | null;
2997
+ };
2998
+ export type ListOrganizationMembersResponse = {
2999
+ members: OrganizationMember[];
3000
+ };
3001
+ export type AcceptOrganizationInvitationResponse = {
3002
+ invitation: OrganizationInvitation;
3003
+ membership: OrganizationMember;
3004
+ };
2459
3005
  export type Workspace = {
2460
3006
  id: string;
2461
3007
  accountId: string;
@@ -2480,6 +3026,10 @@ export type WorkspaceSettings = {
2480
3026
  memoryEnabled?: boolean | undefined;
2481
3027
  /** Reversible Memory V1 prompt composition rollout. */
2482
3028
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3029
+ /** Model policy inherited by new chats and scheduled tasks. */
3030
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3031
+ /** Exact capability selection inherited by new top-level sessions. */
3032
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
2483
3033
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2484
3034
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2485
3035
  maxNestedAgentDepth?: number | null | undefined;
@@ -2488,8 +3038,18 @@ export type WorkspaceSettings = {
2488
3038
  /** Whether agents may invoke the built-in structured human-input tool. */
2489
3039
  agentHumanInputEnabled?: boolean | undefined;
2490
3040
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3041
+ /** Slack orchestration notices; both default off when absent or invalid. */
3042
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
2491
3043
  [key: string]: unknown;
2492
3044
  };
3045
+ export type WorkspaceSessionDefaults = {
3046
+ model: string;
3047
+ reasoningEffort: ReasoningEffort;
3048
+ };
3049
+ export type WorkspaceSessionToolDefaults = {
3050
+ mcpServerIds: string[];
3051
+ firstPartyMcpTools: FirstPartyMcpToolName[];
3052
+ };
2493
3053
  export type WorkspaceSlackReactionSummonSettings = {
2494
3054
  enabled: boolean;
2495
3055
  emoji: "genie";
@@ -2500,6 +3060,16 @@ export type WorkspaceSlackReactionSummonSettings = {
2500
3060
  channelIds: string[];
2501
3061
  };
2502
3062
  };
3063
+ /**
3064
+ * Per-workspace switches for the two Slack orchestration notices. Both are off
3065
+ * unless the workspace explicitly turned them on.
3066
+ */
3067
+ export type WorkspaceSlackOrchestrationNoticeSettings = {
3068
+ /** Post a pointer card when a child worker blocks on input or an approval. */
3069
+ childRequiresAction?: boolean | undefined;
3070
+ /** Post one line when a goal pauses for budget or the continuation cap. */
3071
+ goalPaused?: boolean | undefined;
3072
+ };
2503
3073
  export type SlackReactionChannel = {
2504
3074
  id: string;
2505
3075
  name: string | null;
@@ -2515,12 +3085,15 @@ export type WorkspaceVoiceInputSettings = {
2515
3085
  export type UpdateWorkspaceSettingsRequest = {
2516
3086
  memoryEnabled?: boolean | undefined;
2517
3087
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3088
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3089
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
2518
3090
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2519
3091
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2520
3092
  maxNestedAgentDepth?: number | null | undefined;
2521
3093
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2522
3094
  agentHumanInputEnabled?: boolean | undefined;
2523
3095
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3096
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
2524
3097
  [key: string]: unknown;
2525
3098
  };
2526
3099
  export type SetWorkspaceDefaultRigRequest = {
@@ -2544,6 +3117,7 @@ export type ApiKey = {
2544
3117
  accountId: string;
2545
3118
  workspaceId: string | null;
2546
3119
  name: string;
3120
+ description: string | null;
2547
3121
  prefix: string;
2548
3122
  permissions: Permission[];
2549
3123
  expiresAt: string | null;
@@ -2554,6 +3128,7 @@ export type ApiKey = {
2554
3128
  };
2555
3129
  export type CreateApiKeyRequest = {
2556
3130
  name: string;
3131
+ description?: string | undefined;
2557
3132
  permissions: Permission[];
2558
3133
  expiresAt?: string | undefined;
2559
3134
  };
@@ -2630,20 +3205,43 @@ export type SessionGoalRevision = {
2630
3205
  resultObjectiveRevision: number | null;
2631
3206
  text: string;
2632
3207
  successCriteria: string | null;
3208
+ rootConstraints: string[];
2633
3209
  mutationPolicy: SessionGoalMutationPolicy;
2634
3210
  rationale: string;
2635
3211
  actor: "agent" | "api" | "scheduled_task";
2636
3212
  actorTurnId: string | null;
2637
3213
  actorAttemptId: string | null;
2638
3214
  proposalId: string | null;
3215
+ rollbackOfRevisionId: string | null;
2639
3216
  createdAt: string;
2640
3217
  };
2641
3218
  export type ApplySessionGoalRevisionRequest = {
2642
3219
  expectedObjectiveRevision: number;
2643
3220
  rationale?: string | undefined;
2644
3221
  };
3222
+ export type ListSessionGoalRevisionsOptions = {
3223
+ limit?: number | undefined;
3224
+ before?: string | undefined;
3225
+ };
3226
+ export type ListSessionGoalRevisionsResponse = {
3227
+ revisions: SessionGoalRevision[];
3228
+ hasMore: boolean;
3229
+ nextCursor: string | null;
3230
+ };
3231
+ export type RejectSessionGoalRevisionRequest = {
3232
+ expectedObjectiveRevision: number;
3233
+ rationale: string;
3234
+ };
3235
+ export type RejectSessionGoalRevisionResponse = {
3236
+ revision: SessionGoalRevision;
3237
+ replay: boolean;
3238
+ };
3239
+ export type RollbackSessionGoalRevisionRequest = {
3240
+ expectedObjectiveRevision: number;
3241
+ rationale: string;
3242
+ };
2645
3243
  export type SessionGoalContinuationState = "inactive" | "scheduled" | "running" | "blocked" | "invariant_broken";
2646
- export type SessionGoalContinuationReason = "goal_inactive" | "wake_pending" | "continuation_pending" | "human_work_pending" | "goal_turn_running" | "human_turn_running" | "workstream_paused" | "approval_required" | "provider_backpressure" | "session_cancelled" | "system_work_pending" | "missing_obligation";
3244
+ export type SessionGoalContinuationReason = "goal_inactive" | "wake_pending" | "continuation_pending" | "human_work_pending" | "goal_turn_running" | "human_turn_running" | "workstream_paused" | "approval_required" | "provider_backpressure" | "session_cancelled" | "system_work_pending" | "held_for_input" | "backoff_pending" | "missing_obligation";
2647
3245
  export type SessionGoalContinuation = {
2648
3246
  state: SessionGoalContinuationState;
2649
3247
  reason: SessionGoalContinuationReason;
@@ -2651,6 +3249,8 @@ export type SessionGoalContinuation = {
2651
3249
  observedRevision: number;
2652
3250
  nextAttemptAt: string | null;
2653
3251
  lastError: string | null;
3252
+ /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
3253
+ holdReason?: string | null | undefined;
2654
3254
  };
2655
3255
  export type SessionGoal = {
2656
3256
  id: string;
@@ -2660,6 +3260,7 @@ export type SessionGoal = {
2660
3260
  status: SessionGoalStatus;
2661
3261
  text: string;
2662
3262
  successCriteria: string | null;
3263
+ rootConstraints: string[];
2663
3264
  evidence: string | null;
2664
3265
  rationale: string | null;
2665
3266
  pausedReason: string | null;
@@ -2682,6 +3283,7 @@ export type UpdateSessionGoalRequest = {
2682
3283
  } | {
2683
3284
  text: string;
2684
3285
  successCriteria?: string | null | undefined;
3286
+ rootConstraints?: string[] | undefined;
2685
3287
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
2686
3288
  rationale: string;
2687
3289
  expectedObjectiveRevision: number;
@@ -2730,6 +3332,10 @@ export type EffectiveSessionControl = {
2730
3332
  interruptionPendingCount: number;
2731
3333
  quiescencePendingCount: number;
2732
3334
  } | null;
3335
+ backgroundCommandSettlement?: {
3336
+ state: "stopping";
3337
+ commandCount: number;
3338
+ } | null | undefined;
2733
3339
  };
2734
3340
  export type SessionCommandReceipt = {
2735
3341
  id: string;
@@ -2743,6 +3349,7 @@ export type SessionCommandReceipt = {
2743
3349
  appliedDraftRevision: number | null;
2744
3350
  createdAt: string;
2745
3351
  };
3352
+ export type SessionPromptRouting = "accepted_for_execution" | "queued_for_execution" | "accepted_for_steering";
2746
3353
  export type ComposerDraft = {
2747
3354
  revision: number;
2748
3355
  text: string;
@@ -2750,12 +3357,13 @@ export type ComposerDraft = {
2750
3357
  resources: ResourceRef[];
2751
3358
  model: string;
2752
3359
  reasoningEffort: ReasoningEffort;
2753
- latencyMode?: LatencyMode | undefined;
3360
+ latencyMode: LatencyMode;
2754
3361
  sourceTurnId: string | null;
2755
3362
  sourceTurnVersion: number | null;
2756
3363
  updatedAt: string | null;
2757
3364
  };
2758
3365
  export type NewSessionDraftOptions = {
3366
+ visibility?: SessionVisibility | undefined;
2759
3367
  sandboxBackend?: SandboxBackend | undefined;
2760
3368
  targetSandboxId?: string | undefined;
2761
3369
  workingDir?: string | undefined;
@@ -2765,6 +3373,19 @@ export type NewSessionDraftOptions = {
2765
3373
  firstPartyMcpPermissions?: Permission[] | undefined;
2766
3374
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2767
3375
  };
3376
+ export type NewSessionSelectionHistory = {
3377
+ /** Most-recently used project first. Null channelId is the Default project. */
3378
+ projects: Array<{
3379
+ channelId: string | null;
3380
+ /** Null means the managed sandbox was used most recently in this project. */
3381
+ targetSandboxId: string | null;
3382
+ /** Most-recently used machine in this project first. */
3383
+ machines: Array<{
3384
+ sandboxId: string;
3385
+ workingDir: string | null;
3386
+ }>;
3387
+ }>;
3388
+ };
2768
3389
  export type NewSessionDraft = {
2769
3390
  revision: number;
2770
3391
  text: string;
@@ -2774,8 +3395,9 @@ export type NewSessionDraft = {
2774
3395
  toolsProvided: boolean;
2775
3396
  model: string;
2776
3397
  reasoningEffort: ReasoningEffort;
2777
- latencyMode?: LatencyMode | undefined;
3398
+ latencyMode: LatencyMode;
2778
3399
  options: NewSessionDraftOptions;
3400
+ selectionHistory: NewSessionSelectionHistory;
2779
3401
  updatedAt: string | null;
2780
3402
  };
2781
3403
  export type SessionQueueSnapshot = {
@@ -2796,7 +3418,7 @@ export type SessionQueueSnapshot = {
2796
3418
  };
2797
3419
  export type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
2798
3420
  export type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
2799
- export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result";
3421
+ export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result" | "child_requires_action" | "child_requires_action_resolved" | "child_paused" | "child_waiting_capacity" | "child_progress";
2800
3422
  export type SessionSystemUpdateState = "pending" | "delivered" | "cancelled" | "superseded" | "failed";
2801
3423
  export type SessionSystemUpdate = {
2802
3424
  id: string;
@@ -2888,7 +3510,26 @@ export type DeleteSessionQueueItemRequest = {
2888
3510
  export type SaveComposerDraftRequest = Omit<ComposerDraft, "revision" | "sourceTurnId" | "sourceTurnVersion" | "updatedAt"> & {
2889
3511
  expectedRevision: number;
2890
3512
  };
2891
- export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "updatedAt"> & {
3513
+ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expectedRevision"> & {
3514
+ expectedDraftRevision: number;
3515
+ clientEventId: string;
3516
+ delivery: "send" | "steer";
3517
+ controlEtag?: string;
3518
+ modelContext?: string;
3519
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
3520
+ connectionAuthorities?: McpConnectionAuthoritySelection[];
3521
+ personalResourceAttachment?: PersonalResourceAttachmentIntent;
3522
+ };
3523
+ export type SubmitComposerDraftResponse = {
3524
+ accepted: SessionEvent;
3525
+ turn: SessionTurn;
3526
+ draft: ComposerDraft;
3527
+ receipt: SessionCommandReceipt;
3528
+ routing: SessionPromptRouting;
3529
+ interruptionCount: number;
3530
+ replay: boolean;
3531
+ };
3532
+ export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "selectionHistory" | "updatedAt"> & {
2892
3533
  expectedRevision: number;
2893
3534
  };
2894
3535
  /** Input shape for agent config on create/update (server applies defaults). */
@@ -2902,6 +3543,8 @@ export type ScheduledTaskAgentConfigInput = {
2902
3543
  reasoningEffort?: ReasoningEffort | undefined;
2903
3544
  sandboxBackend?: SandboxBackend | undefined;
2904
3545
  goal?: GoalSpec | undefined;
3546
+ executionClass?: "incident_telemetry" | undefined;
3547
+ incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
2905
3548
  maxNestedAgentDepth?: number | undefined;
2906
3549
  };
2907
3550
  export type CreateAgentScheduledTaskRequest = {
@@ -2912,6 +3555,7 @@ export type CreateAgentScheduledTaskRequest = {
2912
3555
  } | undefined;
2913
3556
  runMode?: ScheduledTaskRunMode | undefined;
2914
3557
  targetSessionId?: string | null | undefined;
3558
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
2915
3559
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2916
3560
  agentConfig: ScheduledTaskAgentConfigInput;
2917
3561
  status?: ScheduledTaskStatus | undefined;
@@ -2937,6 +3581,7 @@ export type UpdateScheduledTaskRequest = {
2937
3581
  schedule?: ScheduledTaskScheduleSpec | undefined;
2938
3582
  runMode?: ScheduledTaskRunMode | undefined;
2939
3583
  targetSessionId?: string | null | undefined;
3584
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
2940
3585
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2941
3586
  action?: ScheduledTaskAction | undefined;
2942
3587
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
@@ -2977,6 +3622,8 @@ export type ScheduledTaskRun = {
2977
3622
  accountId: string;
2978
3623
  workspaceId: string;
2979
3624
  taskId: string;
3625
+ taskAuthorityRevision: number | null;
3626
+ taskExecutionDigest: string | null;
2980
3627
  status: ScheduledTaskRunStatus;
2981
3628
  triggerType: ScheduledTaskTriggerType;
2982
3629
  scheduledAt: string | null;
@@ -3009,6 +3656,9 @@ export type VariableSet = {
3009
3656
  id: string;
3010
3657
  accountId: string;
3011
3658
  workspaceId: string;
3659
+ scope: "organization" | "workspace" | "user";
3660
+ generation: number;
3661
+ status: "active" | "revoked";
3012
3662
  name: string;
3013
3663
  description: string | null;
3014
3664
  variables: VariableSetVariableMetadata[];
@@ -3020,6 +3670,8 @@ export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3020
3670
  /** @deprecated use VariableSet */
3021
3671
  export type WorkspaceEnvironment = VariableSet;
3022
3672
  export type CreateVariableSetRequest = {
3673
+ /** Omitted remains the legacy workspace-owned path. */
3674
+ scope?: "organization" | "workspace" | "user" | undefined;
3023
3675
  name: string;
3024
3676
  description?: string | undefined;
3025
3677
  /** Initial variables. Values are write-only: they never come back on reads. */
@@ -3104,6 +3756,8 @@ export type Channel = {
3104
3756
  workspaceId: string;
3105
3757
  name: string;
3106
3758
  description: string | null;
3759
+ pinned: boolean;
3760
+ sortOrder: number;
3107
3761
  createdBy: string | null;
3108
3762
  createdAt: string;
3109
3763
  updatedAt: string;
@@ -3115,6 +3769,11 @@ export type CreateChannelRequest = {
3115
3769
  export type UpdateChannelRequest = {
3116
3770
  name?: string;
3117
3771
  description?: string | null;
3772
+ pinned?: boolean;
3773
+ };
3774
+ /** Complete workspace project order. It is replaced atomically after a drag. */
3775
+ export type ReorderChannelsRequest = {
3776
+ channelIds: string[];
3118
3777
  };
3119
3778
  /** Re-files one session; null moves it back to the unfiled inbox. */
3120
3779
  export type UpdateSessionChannelRequest = {
@@ -3124,6 +3783,9 @@ export type Rig = {
3124
3783
  id: string;
3125
3784
  accountId: string;
3126
3785
  workspaceId: string;
3786
+ scope: ResourceAuthorityScope;
3787
+ generation: number;
3788
+ status: "active" | "revoked";
3127
3789
  name: string;
3128
3790
  description: string | null;
3129
3791
  createdBy: string | null;
@@ -3162,6 +3824,7 @@ export type RigChange = {
3162
3824
  updatedAt: string;
3163
3825
  };
3164
3826
  export type CreateRigRequest = {
3827
+ scope?: ResourceAuthorityScope;
3165
3828
  name: string;
3166
3829
  description?: string | undefined;
3167
3830
  image?: string | undefined;
@@ -3461,6 +4124,7 @@ export type Document = {
3461
4124
  authorityKind: DocumentAuthorityKind;
3462
4125
  authorityWorkspaceId: string | null;
3463
4126
  authoritySubjectId: string | null;
4127
+ authorityId?: string | null | undefined;
3464
4128
  visibility: DocumentVisibility;
3465
4129
  createdBy: string | null;
3466
4130
  agentAccess: boolean;
@@ -3530,6 +4194,48 @@ export type CreateKnowledgeDropRequest = {
3530
4194
  export type MoveDocumentRequest = {
3531
4195
  targetBaseId?: string | undefined;
3532
4196
  };
4197
+ export type DocumentAuthorityTuple = {
4198
+ kind: DocumentAuthorityKind;
4199
+ workspaceId: string | null;
4200
+ subjectId: string | null;
4201
+ authorityId: string | null;
4202
+ };
4203
+ export type ReclassifyDocumentAuthorityRequest = {
4204
+ operationId: string;
4205
+ expectedAuthority: DocumentAuthorityTuple;
4206
+ targetAuthorityKind: DocumentAuthorityKind;
4207
+ };
4208
+ export type DocumentAuthorityReclassification = {
4209
+ operationId: string;
4210
+ documentId: string;
4211
+ previousAuthority: DocumentAuthorityTuple;
4212
+ authority: DocumentAuthorityTuple;
4213
+ createdAt: string;
4214
+ };
4215
+ export type ListDocumentAuthorityReclassificationsOptions = {
4216
+ limit?: number | undefined;
4217
+ cursor?: string | undefined;
4218
+ };
4219
+ export type ListDocumentAuthorityReclassificationsResponse = {
4220
+ receipts: DocumentAuthorityReclassification[];
4221
+ hasMore: boolean;
4222
+ nextCursor: string | null;
4223
+ };
4224
+ export type RunDocumentDefaultCollectionBackfillRequest = {
4225
+ runId: string;
4226
+ operationId: string;
4227
+ batchSize?: number | undefined;
4228
+ };
4229
+ export type DocumentDefaultCollectionBackfill = {
4230
+ runId: string;
4231
+ operationId: string;
4232
+ status: "running" | "completed";
4233
+ lastWorkspaceId: string | null;
4234
+ processedCount: number;
4235
+ createdCount: number;
4236
+ adoptedCount: number;
4237
+ completedAt: string | null;
4238
+ };
3533
4239
  export type DocumentSearchRequest = {
3534
4240
  query: string;
3535
4241
  baseIds?: string[] | undefined;
@@ -3647,6 +4353,29 @@ export type CapabilityPackScheduledTaskTemplate = {
3647
4353
  defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
3648
4354
  prompt?: string | undefined;
3649
4355
  };
4356
+ export type CapabilityPackAutomationTemplate = {
4357
+ id: string;
4358
+ name: string;
4359
+ description: string;
4360
+ adapterId: string;
4361
+ eventTypes: string[];
4362
+ sessionTemplate: {
4363
+ prompt: string;
4364
+ instructions: string | null;
4365
+ resources: ResourceRef[];
4366
+ skills: CapabilityPackSkill[];
4367
+ tools: ToolRef[];
4368
+ firstPartyMcpTools: string[];
4369
+ firstPartyMcpPermissions: Permission[];
4370
+ model: string | null;
4371
+ reasoningEffort: ReasoningEffort | null;
4372
+ sandboxBackend: SandboxBackend | null;
4373
+ policyRole: string | null;
4374
+ metadata: Record<string, unknown>;
4375
+ };
4376
+ configuration: Record<string, unknown>;
4377
+ connectionRequirement: string | null;
4378
+ };
3650
4379
  export type CapabilityPackSkillFile = {
3651
4380
  path: string;
3652
4381
  content: string;
@@ -3719,6 +4448,7 @@ export type CapabilityPack = {
3719
4448
  connectors: CapabilityPackConnector[];
3720
4449
  knowledge: CapabilityPackKnowledge[];
3721
4450
  scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
4451
+ automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
3722
4452
  variableSet?: CapabilityPackVariableSetSpec | undefined;
3723
4453
  metadata: Record<string, unknown>;
3724
4454
  };
@@ -3805,6 +4535,29 @@ export type RegisterCapabilityPackRequest = {
3805
4535
  defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3806
4536
  prompt?: string | undefined;
3807
4537
  }[] | undefined;
4538
+ automationTemplates?: {
4539
+ id: string;
4540
+ name: string;
4541
+ description: string;
4542
+ adapterId: string;
4543
+ eventTypes: string[];
4544
+ sessionTemplate: {
4545
+ prompt: string;
4546
+ instructions?: string | null | undefined;
4547
+ resources?: ResourceRef[] | undefined;
4548
+ skills?: CapabilityPackSkill[] | undefined;
4549
+ tools?: ToolRef[] | undefined;
4550
+ firstPartyMcpTools?: string[] | undefined;
4551
+ firstPartyMcpPermissions?: Permission[] | undefined;
4552
+ model?: string | null | undefined;
4553
+ reasoningEffort?: ReasoningEffort | null | undefined;
4554
+ sandboxBackend?: SandboxBackend | null | undefined;
4555
+ policyRole?: string | null | undefined;
4556
+ metadata?: Record<string, unknown> | undefined;
4557
+ };
4558
+ configuration?: Record<string, unknown> | undefined;
4559
+ connectionRequirement?: string | null | undefined;
4560
+ }[] | undefined;
3808
4561
  variableSet?: {
3809
4562
  description: string;
3810
4563
  requiredVariables?: string[] | undefined;
@@ -3835,6 +4588,90 @@ export type PackInstallation = {
3835
4588
  enabledAt: string;
3836
4589
  updatedAt: string;
3837
4590
  };
4591
+ export type PrReviewProvider = GitCredentialProvider;
4592
+ export type PrReviewCredentialKind = "github_app" | "provider_token";
4593
+ export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
4594
+ export type CreatePrReviewAppRegistrationRequest = {
4595
+ name: string;
4596
+ provider: PrReviewProvider;
4597
+ providerBaseUrl?: string | undefined;
4598
+ appId?: string | undefined;
4599
+ credentialKind: PrReviewCredentialKind;
4600
+ privateKey?: string | undefined;
4601
+ accessToken?: string | undefined;
4602
+ accessTokenExpiresAt?: string | null | undefined;
4603
+ webhookSecret: string;
4604
+ webhookUsername?: string | undefined;
4605
+ };
4606
+ export type UpdatePrReviewAppRegistrationRequest = {
4607
+ name?: string | undefined;
4608
+ privateKey?: string | undefined;
4609
+ accessToken?: string | undefined;
4610
+ accessTokenExpiresAt?: string | null | undefined;
4611
+ webhookSecret?: string | undefined;
4612
+ webhookUsername?: string | undefined;
4613
+ status?: "active" | "disabled" | undefined;
4614
+ };
4615
+ export type PrReviewAppRegistration = {
4616
+ id: string;
4617
+ sourceId: string;
4618
+ accountId: string;
4619
+ workspaceId: string;
4620
+ name: string;
4621
+ provider: PrReviewProvider;
4622
+ providerBaseUrl: string;
4623
+ appId: string | null;
4624
+ credentialKind: PrReviewCredentialKind;
4625
+ hasCredential: boolean;
4626
+ accessTokenExpiresAt: string | null;
4627
+ webhookAuthKind: PrReviewWebhookAuthKind;
4628
+ hasWebhookSecret: boolean;
4629
+ webhookUsername: string | null;
4630
+ webhookPath: string;
4631
+ status: "active" | "disabled";
4632
+ createdBySubjectId: string;
4633
+ createdAt: string;
4634
+ updatedAt: string;
4635
+ };
4636
+ export type CreatePrReviewRepositoryBindingRequest = {
4637
+ registrationId: string;
4638
+ repositoryUri: string;
4639
+ repositoryFullName: string;
4640
+ providerRepositoryId: string | number;
4641
+ installationId?: string | number | undefined;
4642
+ projectId?: string | number | undefined;
4643
+ model?: string | null | undefined;
4644
+ additionalInstructions?: string | null | undefined;
4645
+ status?: "active" | "disabled" | undefined;
4646
+ };
4647
+ export type UpdatePrReviewRepositoryBindingRequest = {
4648
+ model?: string | null | undefined;
4649
+ additionalInstructions?: string | null | undefined;
4650
+ status?: "active" | "disabled" | undefined;
4651
+ };
4652
+ export type PrReviewRepositoryBinding = {
4653
+ id: string;
4654
+ triggerId: string;
4655
+ accountId: string;
4656
+ workspaceId: string;
4657
+ registrationId: string;
4658
+ provider: PrReviewProvider;
4659
+ repositoryUri: string;
4660
+ repositoryFullName: string;
4661
+ providerRepositoryId: string;
4662
+ installationId: string | null;
4663
+ projectId: string | null;
4664
+ model: string | null;
4665
+ additionalInstructions: string | null;
4666
+ status: "active" | "disabled";
4667
+ createdBySubjectId: string;
4668
+ createdAt: string;
4669
+ updatedAt: string;
4670
+ };
4671
+ export type ListPrReviewConfigurationResponse = {
4672
+ registrations: PrReviewAppRegistration[];
4673
+ repositories: PrReviewRepositoryBinding[];
4674
+ };
3838
4675
  export type EnablePackRequest = {
3839
4676
  variableSetId?: string | undefined;
3840
4677
  /** @deprecated use variableSetId */
@@ -4158,6 +4995,8 @@ export type IntegrationFacetBindingSummary = {
4158
4995
  lastErrorCode: string | null;
4159
4996
  createdAt: string;
4160
4997
  updatedAt: string;
4998
+ directlyOwned: boolean;
4999
+ owners: CapabilityComponentOwner[];
4161
5000
  };
4162
5001
  export type IntegrationInstanceFacetsResponse = {
4163
5002
  capabilityId: string;
@@ -4194,6 +5033,25 @@ export type IntegrationFacetRemovalResult = {
4194
5033
  binding: IntegrationFacetBindingSummary | null;
4195
5034
  remainingOwners: CapabilityComponentOwner[];
4196
5035
  };
5036
+ /**
5037
+ * Presentation-only consent copy served with an integration or connector.
5038
+ * Never grants a scope or replaces server-side authorization; the UI keeps a
5039
+ * generic fallback for any omitted field.
5040
+ */
5041
+ export type IntegrationPresentation = {
5042
+ providerName?: string | undefined;
5043
+ icon?: "calendar" | "cloud" | "contacts" | "files" | "mail" | undefined;
5044
+ introduction?: string | undefined;
5045
+ capabilities?: {
5046
+ title: string;
5047
+ description: string;
5048
+ }[] | undefined;
5049
+ permissionSummary?: string | undefined;
5050
+ scopeLabels?: Record<string, {
5051
+ label: string;
5052
+ description: string;
5053
+ }> | undefined;
5054
+ };
4197
5055
  export type IntegrationDefinitionSummary = {
4198
5056
  id: string;
4199
5057
  name: string;
@@ -4207,6 +5065,7 @@ export type IntegrationDefinitionSummary = {
4207
5065
  kind: "oauth2";
4208
5066
  scopes: string[];
4209
5067
  };
5068
+ presentation?: IntegrationPresentation | undefined;
4210
5069
  facets: IntegrationFacetDefinitionSummary[];
4211
5070
  };
4212
5071
  export type ListIntegrationDefinitionsResponse = {
@@ -4708,6 +5567,21 @@ export type InsightsModelCallRow = {
4708
5567
  estimatedProviderUsd: number | null;
4709
5568
  pricingSource: InsightsPricingSource | null;
4710
5569
  };
5570
+ export type ModelContextContributionSource = "workspace_instruction_policy" | "legacy_workspace_instructions" | "preference_registry_descriptor" | "company_profile" | "legacy_memory_v1" | "runtime_skill_catalog";
5571
+ export type InsightsPromptContributionRow = {
5572
+ source: ModelContextContributionSource;
5573
+ items: number;
5574
+ utf8Bytes: number;
5575
+ estimatedTokens: number;
5576
+ calls: number;
5577
+ };
5578
+ export type InsightsPromptContributions = {
5579
+ estimatedTokens: number;
5580
+ utf8Bytes: number;
5581
+ coveredCalls: number;
5582
+ totalCalls: number;
5583
+ sources: InsightsPromptContributionRow[];
5584
+ };
4711
5585
  export type WorkspaceInsightsSnapshot = {
4712
5586
  range: InsightsRange;
4713
5587
  rangeLabel: string;
@@ -4725,6 +5599,7 @@ export type WorkspaceInsightsSnapshot = {
4725
5599
  drivers: InsightsSpendDriver[];
4726
5600
  schedules: InsightsScheduleRow[];
4727
5601
  recentCalls: InsightsModelCallRow[];
5602
+ promptContributions: InsightsPromptContributions;
4728
5603
  warmSeconds: number;
4729
5604
  priorWarmSeconds: number;
4730
5605
  warmGroups: InsightsWarmGroupRow[];
@@ -4778,18 +5653,30 @@ export type CreateCheckoutResponse = {
4778
5653
  checkoutSessionId: string;
4779
5654
  url: string;
4780
5655
  };
5656
+ export type CreateBillingPortalRequest = {
5657
+ accountId?: string | undefined;
5658
+ returnUrl?: string | undefined;
5659
+ };
5660
+ export type CreateBillingPortalResponse = {
5661
+ portalSessionId: string;
5662
+ url: string;
5663
+ };
4781
5664
  export type UserMessageEventInput = {
4782
5665
  type: "user.message";
4783
5666
  clientEventId?: string | undefined;
4784
5667
  payload: {
4785
5668
  text: string;
4786
5669
  annotations?: SubmittedTimelineAnnotation[] | undefined;
4787
- turnInstructions?: string | undefined;
5670
+ modelContext?: string | undefined;
4788
5671
  resources?: ResourceRef[] | undefined;
4789
5672
  model?: string | undefined;
4790
5673
  reasoningEffort?: ReasoningEffort | undefined;
4791
5674
  latencyMode?: LatencyMode | undefined;
5675
+ controlEtag?: string | undefined;
5676
+ expectedDraftRevision?: number | undefined;
4792
5677
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
5678
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
5679
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
4793
5680
  };
4794
5681
  };
4795
5682
  export type UserApprovalDecisionEventInput = {
@@ -4831,12 +5718,74 @@ export type MetricSample = {
4831
5718
  /** The derived dashboard state of a machine (M3 liveness + consent/display
4832
5719
  * reasons + the in-flight device-flow). */
4833
5720
  export type MachineState = "online" | "reconnecting" | "offline" | "consent_required" | "display_unavailable" | "enrolling";
4834
- export type MachineKind = "modal" | "selfhosted";
5721
+ export type MachineKind = "modal" | "selfhosted" | "opensandbox";
5722
+ export type MachineConnectionAuthority = {
5723
+ state: "not_applicable" | "unclaimed" | "active" | "expired";
5724
+ generation: number;
5725
+ supersededCount: number;
5726
+ leaseExpiresAt: string | null;
5727
+ duplicateRunnerDeniedCount: number;
5728
+ duplicateRunnerDeniedAt: string | null;
5729
+ };
5730
+ export type MachineRuntimeCapabilities = {
5731
+ exec: boolean;
5732
+ filesystem: boolean;
5733
+ git: boolean;
5734
+ pty: boolean;
5735
+ desktop: boolean;
5736
+ opStream: boolean;
5737
+ browserBridge: boolean;
5738
+ operationResourcePolicy: boolean;
5739
+ operationCpuQuota: boolean;
5740
+ };
5741
+ export type MachineUpdateStatus = "requested" | "accepted" | "waiting_for_idle" | "downloading" | "verifying" | "applying" | "restarting" | "succeeded" | "failed";
5742
+ export type MachineUpdateState = {
5743
+ operationId: string;
5744
+ status: MachineUpdateStatus;
5745
+ targetVersion: string;
5746
+ expectedBinarySha256: string | null;
5747
+ errorCode: string | null;
5748
+ retryable: boolean;
5749
+ rolledBack: boolean;
5750
+ requestedAt: string;
5751
+ updatedAt: string;
5752
+ completedAt: string | null;
5753
+ };
5754
+ export type MachineRuntime = {
5755
+ installedVersion: string | null;
5756
+ binarySha256: string | null;
5757
+ updateChannel: "stable" | "beta" | null;
5758
+ desiredVersion: string | null;
5759
+ versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
5760
+ capabilities: MachineRuntimeCapabilities;
5761
+ update: MachineUpdateState | null;
5762
+ };
5763
+ export type UpdateMachineAgentResponse = {
5764
+ operationId: string;
5765
+ accepted: boolean;
5766
+ targetVersion: string;
5767
+ };
5768
+ export type MachineOperationPolicy = {
5769
+ memoryMaxBytes: number | null;
5770
+ memoryHighBytes: number | null;
5771
+ cpuMaxMillicores: number | null;
5772
+ revision: number;
5773
+ updatedAt: string | null;
5774
+ };
5775
+ export type UpdateMachineOperationPolicyRequest = {
5776
+ memoryMaxBytes: number | null;
5777
+ memoryHighBytes: number | null;
5778
+ /** Omitted preserves the current CPU limit for older/partial clients; null clears. */
5779
+ cpuMaxMillicores?: number | null;
5780
+ expectedRevision: number;
5781
+ };
4835
5782
  /** A machine as the Machines dashboard renders it (an enrolled selfhosted machine
4836
5783
  * or the session's synthetic Modal group box, `isSessionGroup: true`). */
4837
5784
  export type MachineView = {
4838
5785
  sandboxId: string;
4839
5786
  enrollmentId: string | null;
5787
+ scope: ResourceAuthorityScope;
5788
+ generation: number;
4840
5789
  name: string;
4841
5790
  kind: MachineKind;
4842
5791
  state: MachineState;
@@ -4855,6 +5804,14 @@ export type MachineView = {
4855
5804
  allowScreenControl: boolean;
4856
5805
  sharedSessionCount: number;
4857
5806
  lastSeenAt: string | null;
5807
+ /** Secret-free single-runner authority diagnostics. */
5808
+ connectionAuthority: MachineConnectionAuthority;
5809
+ /** Exact build/update truth. Null means the runner predates runtime Hello
5810
+ * reporting or this is a managed-session group without a connected agent. */
5811
+ runtime: MachineRuntime | null;
5812
+ /** Explicit per-enrollment command memory policy. Null only for managed
5813
+ * session boxes; null limits on a real machine mean unrestricted. */
5814
+ operationPolicy: MachineOperationPolicy | null;
4858
5815
  metrics: MetricSample | null;
4859
5816
  };
4860
5817
  /** GET /v1/workspaces/:ws/machines — the dashboard list + the active-sandbox
@@ -4909,6 +5866,7 @@ export type SwapActiveSandboxResponse = {
4909
5866
  };
4910
5867
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
4911
5868
  export type EnrollmentOs = "linux" | "macos" | "windows";
5869
+ export type ResourceAuthorityScope = "organization" | "workspace" | "user";
4912
5870
  /** POST /v1/enrollments/device/lookup body. */
4913
5871
  export type DeviceEnrollmentLookupRequest = {
4914
5872
  userCode: string;
@@ -4932,6 +5890,7 @@ export type DeviceEnrollmentLookupResponse = {
4932
5890
  export type DeviceEnrollmentApproveRequest = {
4933
5891
  userCode: string;
4934
5892
  allowScreenControl?: boolean;
5893
+ scope?: ResourceAuthorityScope;
4935
5894
  };
4936
5895
  /** POST /v1/workspaces/:ws/enrollments/device/approve response. */
4937
5896
  export type DeviceEnrollmentApproveResponse = {