@opengeni/sdk 1.0.1 → 2.3.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +117 -2
  2. package/dist/artifacts.js +5 -5
  3. package/dist/automations-client.d.ts +17 -0
  4. package/dist/automations.d.ts +3 -0
  5. package/dist/automations.js +78 -0
  6. package/dist/automations.js.map +1 -0
  7. package/dist/{chunk-YGH5P47G.js → chunk-6IPZY27S.js} +744 -57
  8. package/dist/chunk-6IPZY27S.js.map +1 -0
  9. package/dist/{chunk-TYZ4JL4J.js → chunk-AGUKZAXR.js} +2 -2
  10. package/dist/{chunk-A5DC5WEM.js → chunk-C2H7HBNP.js} +22 -2
  11. package/dist/chunk-C2H7HBNP.js.map +1 -0
  12. package/dist/{chunk-GU6JF75T.js → chunk-C4DJPZRU.js} +1 -1
  13. package/dist/{chunk-GU6JF75T.js.map → chunk-C4DJPZRU.js.map} +1 -1
  14. package/dist/{chunk-ST5DDKJP.js → chunk-GW3EJ2GP.js} +52 -1
  15. package/dist/chunk-GW3EJ2GP.js.map +1 -0
  16. package/dist/{chunk-4DV37UUA.js → chunk-TW5MNHUX.js} +16 -2
  17. package/dist/chunk-TW5MNHUX.js.map +1 -0
  18. package/dist/{chunk-VWE2QIVO.js → chunk-XNG7YGR3.js} +23 -6
  19. package/dist/chunk-XNG7YGR3.js.map +1 -0
  20. package/dist/client.d.ts +159 -26
  21. package/dist/codex-realtime-controller.d.ts +1 -0
  22. package/dist/codex-realtime-controller.js +2 -2
  23. package/dist/company-brain.d.ts +32 -0
  24. package/dist/company-profile.d.ts +1 -1
  25. package/dist/core.js +4 -4
  26. package/dist/editable-artifacts/browser-session.d.ts +7 -3
  27. package/dist/editable-artifacts/controller.d.ts +4 -1
  28. package/dist/editable-artifacts/errors.d.ts +1 -1
  29. package/dist/editable-artifacts/http-live-transport.d.ts +6 -2
  30. package/dist/editable-artifacts/index.d.ts +2 -0
  31. package/dist/editable-artifacts/open-failure.d.ts +9 -0
  32. package/dist/editable-artifacts/types.d.ts +4 -3
  33. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +1 -1
  34. package/dist/editable-artifacts-worker.js +44 -17
  35. package/dist/editable-artifacts-worker.js.map +1 -1
  36. package/dist/editable-artifacts.js +222 -119
  37. package/dist/editable-artifacts.js.map +1 -1
  38. package/dist/errors.d.ts +1 -1
  39. package/dist/index.d.ts +7 -4
  40. package/dist/index.js +61 -12
  41. package/dist/index.js.map +1 -1
  42. package/dist/interaction.d.ts +23 -0
  43. package/dist/interaction.js +4 -1
  44. package/dist/organization-private-session-settings.d.ts +6 -0
  45. package/dist/organization-private-session-settings.js +22 -0
  46. package/dist/organization-private-session-settings.js.map +1 -0
  47. package/dist/pr-review-client.d.ts +15 -0
  48. package/dist/pr-review.d.ts +4 -0
  49. package/dist/pr-review.js +56 -0
  50. package/dist/pr-review.js.map +1 -0
  51. package/dist/preference-registry.d.ts +8 -0
  52. package/dist/realtime.js +2 -2
  53. package/dist/retained-artifacts.d.ts +5 -1
  54. package/dist/types.d.ts +1023 -13
  55. package/dist/workspace-instruction-policies.d.ts +22 -0
  56. package/dist/workspace-learning.d.ts +124 -0
  57. package/package.json +14 -2
  58. package/src/automations-client.ts +118 -0
  59. package/src/automations.ts +15 -0
  60. package/src/client.ts +1049 -71
  61. package/src/codex-realtime-controller.ts +21 -0
  62. package/src/company-brain.ts +99 -0
  63. package/src/company-profile.ts +4 -1
  64. package/src/editable-artifacts/browser-session.ts +36 -22
  65. package/src/editable-artifacts/controller.ts +66 -45
  66. package/src/editable-artifacts/errors.ts +2 -0
  67. package/src/editable-artifacts/http-live-transport.ts +62 -37
  68. package/src/editable-artifacts/index.ts +6 -0
  69. package/src/editable-artifacts/open-failure.ts +79 -0
  70. package/src/editable-artifacts/storage.ts +31 -40
  71. package/src/editable-artifacts/types.ts +4 -3
  72. package/src/editable-artifacts/worker/kernel-adapter.ts +23 -7
  73. package/src/editable-artifacts/worker/runtime.ts +26 -13
  74. package/src/editable-artifacts/worker/wire-codec.ts +23 -5
  75. package/src/errors.ts +1 -1
  76. package/src/index.ts +134 -0
  77. package/src/interaction.ts +95 -0
  78. package/src/organization-private-session-settings.ts +33 -0
  79. package/src/pr-review-client.ts +84 -0
  80. package/src/pr-review.ts +15 -0
  81. package/src/preference-registry.ts +9 -0
  82. package/src/retained-artifacts.ts +101 -0
  83. package/src/stream.ts +13 -2
  84. package/src/types.ts +1174 -12
  85. package/src/workspace-instruction-policies.ts +24 -0
  86. package/src/workspace-learning.ts +138 -0
  87. package/dist/chunk-4DV37UUA.js.map +0 -1
  88. package/dist/chunk-A5DC5WEM.js.map +0 -1
  89. package/dist/chunk-ST5DDKJP.js.map +0 -1
  90. package/dist/chunk-VWE2QIVO.js.map +0 -1
  91. package/dist/chunk-YGH5P47G.js.map +0 -1
  92. /package/dist/{chunk-TYZ4JL4J.js.map → chunk-AGUKZAXR.js.map} +0 -0
package/dist/types.d.ts CHANGED
@@ -128,7 +128,7 @@ export type WorkspaceRealtimeModelCatalogResponse = {
128
128
  models: WorkspaceRealtimeModelCatalogItem[];
129
129
  };
130
130
  export type SessionRealtimeState = "active" | "ended";
131
- export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired";
131
+ export type SessionRealtimeEndReason = "user_stop" | "browser_unload" | "lease_expired" | "authority_revoked";
132
132
  export type SessionRealtimeMode = {
133
133
  id: string;
134
134
  sessionId: string;
@@ -163,7 +163,7 @@ export type SessionRealtimeMutationResponse = {
163
163
  replay: boolean;
164
164
  };
165
165
  export type SessionStatus = "queued" | "running" | "idle" | "requires_action" | "recovering" | "waiting_capacity" | "failed" | "cancelled";
166
- 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";
167
167
  export type SandboxOs = "linux" | "macos" | "windows";
168
168
  export type SandboxCapabilityName = "FileSystem" | "Terminal" | "Git" | "DesktopStream" | "Recording";
169
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";
@@ -306,6 +306,8 @@ export type RepositoryResourceRef = {
306
306
  kind: "repository";
307
307
  uri: string;
308
308
  ref: string;
309
+ /** Exact immutable commit that repository materialization must produce. */
310
+ expectedCommitSha?: string | undefined;
309
311
  /**
310
312
  * Optional workspace-relative override. When omitted, OpenGeni persists
311
313
  * `repos/<encoded-host>/<owner>/<repo>` so equal names on different Git
@@ -315,6 +317,7 @@ export type RepositoryResourceRef = {
315
317
  mountPath?: string | undefined;
316
318
  subpath?: string | undefined;
317
319
  provider?: GitCredentialProvider | undefined;
320
+ connectionType?: "github_personal" | undefined;
318
321
  credentialBindingId?: GitCredentialBindingId | undefined;
319
322
  access?: GitRepositoryAccess | undefined;
320
323
  repositoryId?: number | string | undefined;
@@ -337,6 +340,7 @@ export type ToolRef = {
337
340
  kind: "mcp";
338
341
  id: string;
339
342
  optional?: boolean | undefined;
343
+ eager?: boolean | undefined;
340
344
  };
341
345
  export type SessionToolPolicy = {
342
346
  mode: "workspace_default" | "explicit" | "inherited";
@@ -376,6 +380,7 @@ export type SessionEffectiveToolPolicy = {
376
380
  export type GoalSpec = {
377
381
  text: string;
378
382
  successCriteria?: string | undefined;
383
+ rootConstraints?: string[] | undefined;
379
384
  maxAutoContinuations?: number | undefined;
380
385
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
381
386
  };
@@ -414,6 +419,25 @@ export type UpdateSessionMcpApprovalPolicyResponse = {
414
419
  };
415
420
  export type ConnectionKind = "oauth2" | "api_key" | "app_install" | "delegated";
416
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
+ };
417
441
  export type McpServerConnectionRef = {
418
442
  connectionId?: string | undefined;
419
443
  provider?: string | undefined;
@@ -468,6 +492,98 @@ export type CreateConnectionRequest = {
468
492
  expiresAt?: string | null | undefined;
469
493
  metadata?: Record<string, unknown> | undefined;
470
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
+ };
471
587
  export type OpenGeniSlackBotInstallRequest = {
472
588
  /** Existing OpenGeni Slack bot connection to reinstall in place. */
473
589
  connectionId?: string | undefined;
@@ -504,7 +620,7 @@ export type SlackInstallationBinding = {
504
620
  slackTeamName: string;
505
621
  botId: string;
506
622
  botUserId: string;
507
- botDisplayName: "OpenGeni";
623
+ botDisplayName: "OpenGeni" | "OpenGeni Staging";
508
624
  state: SlackInstallationBindingState;
509
625
  quarantineReason: string | null;
510
626
  version: number;
@@ -796,11 +912,84 @@ export type IntegrationClientMetadata = {
796
912
  grant_types: Array<"authorization_code" | "refresh_token">;
797
913
  response_types: ["code"];
798
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
+ };
799
987
  export type Session = {
800
988
  id: string;
801
989
  workspaceId: string;
802
990
  accountId: string;
803
991
  status: SessionStatus;
992
+ backgroundCommandActivity?: SessionBackgroundCommandActivity | undefined;
804
993
  initialMessage: string;
805
994
  title: string | null;
806
995
  titleSource: "user" | "agent" | null;
@@ -814,10 +1003,14 @@ export type Session = {
814
1003
  toolPolicyVersion: number;
815
1004
  effectiveToolPolicy?: SessionEffectiveToolPolicy | undefined;
816
1005
  metadata: Record<string, unknown>;
1006
+ /** Present only when session-tenancy product activation is enabled for the organization. */
1007
+ tenancy?: SessionTenancyPublicProjection | undefined;
817
1008
  /** Frozen creator fact; later turns carry their own independent initiator. */
818
1009
  createdBy: TurnInitiator;
819
1010
  createdByContext: Record<string, unknown>;
820
1011
  model: string;
1012
+ reasoningEffort: ReasoningEffort;
1013
+ latencyMode: LatencyMode;
821
1014
  sandboxBackend: SandboxBackend;
822
1015
  sandboxOs: SandboxOs;
823
1016
  sandboxGroupId: string;
@@ -866,6 +1059,17 @@ export type Session = {
866
1059
  pinnedAt?: string | null;
867
1060
  /** Optimistic pin-state revision; zero represents an absent pin relation. */
868
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;
869
1073
  /** Server-authoritative descendant counts populated by session-list reads. */
870
1074
  treeStats?: {
871
1075
  directChildren: number;
@@ -875,9 +1079,21 @@ export type Session = {
875
1079
  attentionDescendants: number;
876
1080
  pausedDescendants: number;
877
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;
878
1089
  /** Counts are lower bounds rather than exact totals when true. */
879
1090
  truncated: boolean;
880
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;
881
1097
  createdAt: string;
882
1098
  updatedAt: string;
883
1099
  };
@@ -941,6 +1157,16 @@ export type UpdateSessionPinRequest = {
941
1157
  pinned: boolean;
942
1158
  expectedVersion?: number;
943
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
+ };
944
1170
  export type LineageNode = {
945
1171
  session: SessionSummary;
946
1172
  children: LineageNode[];
@@ -976,6 +1202,21 @@ export type SubmittedTimelineAnnotation = DraftTimelineAnnotation;
976
1202
  export type TimelineAnnotation = DraftTimelineAnnotation & {
977
1203
  ordinal: number;
978
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
+ };
979
1220
  export type SessionTurn = {
980
1221
  id: string;
981
1222
  workspaceId: string;
@@ -1003,6 +1244,7 @@ export type SessionTurn = {
1003
1244
  initiator: TurnInitiator;
1004
1245
  initiatorContext: Record<string, unknown>;
1005
1246
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
1247
+ personalResources?: PersonalResourceAttachmentSummary | null | undefined;
1006
1248
  cancelledBy?: string | null;
1007
1249
  cancelReason?: string | null;
1008
1250
  startedAt: string | null;
@@ -1065,7 +1307,7 @@ export type SessionHumanInputRequest = {
1065
1307
  createdAt: string;
1066
1308
  updatedAt: string;
1067
1309
  };
1068
- 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"];
1069
1311
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1070
1312
  /**
1071
1313
  * Event types the SDK knows about today, kept open so a newer OpenGeni server
@@ -1407,6 +1649,16 @@ export type FsReadResponse = {
1407
1649
  isBinary: boolean;
1408
1650
  revision: number;
1409
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
+ };
1410
1662
  export type FsWriteRequest = {
1411
1663
  path: string;
1412
1664
  encoding?: FsEncoding;
@@ -1748,6 +2000,57 @@ export type ScheduledTaskScheduleSpec = {
1748
2000
  minute: number;
1749
2001
  daysOfWeek?: ScheduledTaskDayOfWeek[] | undefined;
1750
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
+ };
1751
2054
  export type ScheduledTaskAgentConfig = {
1752
2055
  prompt: string;
1753
2056
  resources: ResourceRef[];
@@ -1758,6 +2061,8 @@ export type ScheduledTaskAgentConfig = {
1758
2061
  reasoningEffort?: ReasoningEffort | undefined;
1759
2062
  sandboxBackend?: SandboxBackend | undefined;
1760
2063
  goal?: GoalSpec | undefined;
2064
+ executionClass?: "incident_telemetry" | undefined;
2065
+ incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
1761
2066
  maxNestedAgentDepth?: number | undefined;
1762
2067
  };
1763
2068
  export type ScopedKnowledgeScope = {
@@ -1819,6 +2124,8 @@ export type ScheduledTask = {
1819
2124
  createdBy?: TurnInitiator | undefined;
1820
2125
  createdByContext?: TurnInitiatorContext | undefined;
1821
2126
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
2127
+ authorityRevision: number;
2128
+ executionDigest: string;
1822
2129
  targetSessionId: string | null;
1823
2130
  reusableSessionId: string | null;
1824
2131
  variableSetId: string | null;
@@ -1831,6 +2138,7 @@ export type ScheduledTask = {
1831
2138
  };
1832
2139
  export type CreateSessionRequest = {
1833
2140
  requestedSessionId?: string | undefined;
2141
+ visibility?: SessionVisibility | undefined;
1834
2142
  initialMessage?: string | undefined;
1835
2143
  /** Create an idle session shell so realtime voice can be the first interaction. */
1836
2144
  startMode?: "realtime" | undefined;
@@ -1862,18 +2170,20 @@ export type CreateSessionRequest = {
1862
2170
  firstPartyMcpPermissions?: string[] | undefined;
1863
2171
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
1864
2172
  mcpServers?: SessionMcpServerInput[] | undefined;
2173
+ /** Atomically attach the server-derived personal Variable Set/Rig closure to the initial turn. */
2174
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
1865
2175
  sandbox?: "shared" | "new" | {
1866
2176
  groupId: string;
1867
2177
  } | undefined;
1868
2178
  };
1869
- 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"];
1870
2180
  export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
1871
2181
  /**
1872
2182
  * Permissions the SDK knows about today, kept open so a newer OpenGeni server
1873
2183
  * can introduce permissions without breaking older SDK consumers.
1874
2184
  */
1875
2185
  export type Permission = KnownPermission | (string & {});
1876
- 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";
1877
2187
  export type ProductAccessMode = "local" | "configured" | "managed";
1878
2188
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
1879
2189
  export type ModelCapabilityStateV1 = {
@@ -1987,11 +2297,26 @@ export type ModelCredentialReadinessV1 = {
1987
2297
  };
1988
2298
  export type WorkspaceModelCatalogModel = ClientModel & {
1989
2299
  credentialReadiness: ModelCredentialReadinessV1;
2300
+ /** Exact workspace-policy verdict without exposing provider identity. */
2301
+ policyAllowed?: boolean | undefined;
1990
2302
  availability: ModelAvailabilityV1;
1991
2303
  };
1992
2304
  export type WorkspaceModelCatalogResponse = {
1993
2305
  models: WorkspaceModelCatalogModel[];
1994
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
+ };
1995
2320
  /**
1996
2321
  * Connection state of a workspace's Codex (ChatGPT) subscription, returned by
1997
2322
  * `GET /v1/workspaces/:id/codex/status`. `models` are the codex models the
@@ -2132,6 +2457,12 @@ export type CodexAccountOverview = {
2132
2457
  credits: CodexResetCredit[];
2133
2458
  };
2134
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
+ };
2135
2466
  /** Owning managed-cookie human may replay durable completion without a healthy provider token. */
2136
2467
  canResumeRedemption: boolean;
2137
2468
  /** Durable owner-scoped ambiguity/completion discovery; never redemption authority for agents. */
@@ -2298,8 +2629,10 @@ export type ClientAuthConfig = {
2298
2629
  } | {
2299
2630
  mode: "managedSession";
2300
2631
  session: "cookie";
2632
+ /** Defaults to true when omitted by an older deployment. */
2633
+ emailVerificationRequired?: boolean;
2301
2634
  };
2302
- export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-model-context-v1";
2635
+ export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-atomic-session-fork-visibility-v1";
2303
2636
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2304
2637
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2305
2638
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2467,6 +2800,208 @@ export type ManagedOrganizationMembership = {
2467
2800
  export type ListManagedOrganizationMembershipsResponse = {
2468
2801
  memberships: ManagedOrganizationMembership[];
2469
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
+ };
2470
3005
  export type Workspace = {
2471
3006
  id: string;
2472
3007
  accountId: string;
@@ -2491,6 +3026,10 @@ export type WorkspaceSettings = {
2491
3026
  memoryEnabled?: boolean | undefined;
2492
3027
  /** Reversible Memory V1 prompt composition rollout. */
2493
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;
2494
3033
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2495
3034
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2496
3035
  maxNestedAgentDepth?: number | null | undefined;
@@ -2499,8 +3038,18 @@ export type WorkspaceSettings = {
2499
3038
  /** Whether agents may invoke the built-in structured human-input tool. */
2500
3039
  agentHumanInputEnabled?: boolean | undefined;
2501
3040
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3041
+ /** Slack orchestration notices; both default off when absent or invalid. */
3042
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
2502
3043
  [key: string]: unknown;
2503
3044
  };
3045
+ export type WorkspaceSessionDefaults = {
3046
+ model: string;
3047
+ reasoningEffort: ReasoningEffort;
3048
+ };
3049
+ export type WorkspaceSessionToolDefaults = {
3050
+ mcpServerIds: string[];
3051
+ firstPartyMcpTools: FirstPartyMcpToolName[];
3052
+ };
2504
3053
  export type WorkspaceSlackReactionSummonSettings = {
2505
3054
  enabled: boolean;
2506
3055
  emoji: "genie";
@@ -2511,6 +3060,16 @@ export type WorkspaceSlackReactionSummonSettings = {
2511
3060
  channelIds: string[];
2512
3061
  };
2513
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
+ };
2514
3073
  export type SlackReactionChannel = {
2515
3074
  id: string;
2516
3075
  name: string | null;
@@ -2520,18 +3079,39 @@ export type SlackReactionChannelListResponse = {
2520
3079
  channels: SlackReactionChannel[];
2521
3080
  nextCursor: string | null;
2522
3081
  };
3082
+ export type SlackChannelRoute = {
3083
+ slackChannelId: string;
3084
+ targetWorkspaceId: string;
3085
+ targetWorkspaceName: string | null;
3086
+ source: "picker" | "admin";
3087
+ updatedAt: string;
3088
+ };
3089
+ export type SlackChannelRouteListResponse = {
3090
+ routes: SlackChannelRoute[];
3091
+ routingEnabled: boolean;
3092
+ };
3093
+ export type UpdateSlackChannelRoutesRequest = {
3094
+ connectionId: string;
3095
+ routes: Array<{
3096
+ slackChannelId: string;
3097
+ targetWorkspaceId: string | null;
3098
+ }>;
3099
+ };
2523
3100
  export type WorkspaceVoiceInputSettings = {
2524
3101
  enabled: boolean;
2525
3102
  };
2526
3103
  export type UpdateWorkspaceSettingsRequest = {
2527
3104
  memoryEnabled?: boolean | undefined;
2528
3105
  memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
3106
+ sessionDefaults?: WorkspaceSessionDefaults | undefined;
3107
+ sessionToolDefaults?: WorkspaceSessionToolDefaults | undefined;
2529
3108
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2530
3109
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2531
3110
  maxNestedAgentDepth?: number | null | undefined;
2532
3111
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
2533
3112
  agentHumanInputEnabled?: boolean | undefined;
2534
3113
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
3114
+ slackOrchestrationNotices?: WorkspaceSlackOrchestrationNoticeSettings | undefined;
2535
3115
  [key: string]: unknown;
2536
3116
  };
2537
3117
  export type SetWorkspaceDefaultRigRequest = {
@@ -2555,6 +3135,7 @@ export type ApiKey = {
2555
3135
  accountId: string;
2556
3136
  workspaceId: string | null;
2557
3137
  name: string;
3138
+ description: string | null;
2558
3139
  prefix: string;
2559
3140
  permissions: Permission[];
2560
3141
  expiresAt: string | null;
@@ -2565,6 +3146,7 @@ export type ApiKey = {
2565
3146
  };
2566
3147
  export type CreateApiKeyRequest = {
2567
3148
  name: string;
3149
+ description?: string | undefined;
2568
3150
  permissions: Permission[];
2569
3151
  expiresAt?: string | undefined;
2570
3152
  };
@@ -2641,20 +3223,43 @@ export type SessionGoalRevision = {
2641
3223
  resultObjectiveRevision: number | null;
2642
3224
  text: string;
2643
3225
  successCriteria: string | null;
3226
+ rootConstraints: string[];
2644
3227
  mutationPolicy: SessionGoalMutationPolicy;
2645
3228
  rationale: string;
2646
3229
  actor: "agent" | "api" | "scheduled_task";
2647
3230
  actorTurnId: string | null;
2648
3231
  actorAttemptId: string | null;
2649
3232
  proposalId: string | null;
3233
+ rollbackOfRevisionId: string | null;
2650
3234
  createdAt: string;
2651
3235
  };
2652
3236
  export type ApplySessionGoalRevisionRequest = {
2653
3237
  expectedObjectiveRevision: number;
2654
3238
  rationale?: string | undefined;
2655
3239
  };
3240
+ export type ListSessionGoalRevisionsOptions = {
3241
+ limit?: number | undefined;
3242
+ before?: string | undefined;
3243
+ };
3244
+ export type ListSessionGoalRevisionsResponse = {
3245
+ revisions: SessionGoalRevision[];
3246
+ hasMore: boolean;
3247
+ nextCursor: string | null;
3248
+ };
3249
+ export type RejectSessionGoalRevisionRequest = {
3250
+ expectedObjectiveRevision: number;
3251
+ rationale: string;
3252
+ };
3253
+ export type RejectSessionGoalRevisionResponse = {
3254
+ revision: SessionGoalRevision;
3255
+ replay: boolean;
3256
+ };
3257
+ export type RollbackSessionGoalRevisionRequest = {
3258
+ expectedObjectiveRevision: number;
3259
+ rationale: string;
3260
+ };
2656
3261
  export type SessionGoalContinuationState = "inactive" | "scheduled" | "running" | "blocked" | "invariant_broken";
2657
- 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";
3262
+ 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";
2658
3263
  export type SessionGoalContinuation = {
2659
3264
  state: SessionGoalContinuationState;
2660
3265
  reason: SessionGoalContinuationReason;
@@ -2662,6 +3267,8 @@ export type SessionGoalContinuation = {
2662
3267
  observedRevision: number;
2663
3268
  nextAttemptAt: string | null;
2664
3269
  lastError: string | null;
3270
+ /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
3271
+ holdReason?: string | null | undefined;
2665
3272
  };
2666
3273
  export type SessionGoal = {
2667
3274
  id: string;
@@ -2671,6 +3278,7 @@ export type SessionGoal = {
2671
3278
  status: SessionGoalStatus;
2672
3279
  text: string;
2673
3280
  successCriteria: string | null;
3281
+ rootConstraints: string[];
2674
3282
  evidence: string | null;
2675
3283
  rationale: string | null;
2676
3284
  pausedReason: string | null;
@@ -2693,6 +3301,7 @@ export type UpdateSessionGoalRequest = {
2693
3301
  } | {
2694
3302
  text: string;
2695
3303
  successCriteria?: string | null | undefined;
3304
+ rootConstraints?: string[] | undefined;
2696
3305
  mutationPolicy?: SessionGoalMutationPolicy | undefined;
2697
3306
  rationale: string;
2698
3307
  expectedObjectiveRevision: number;
@@ -2741,6 +3350,10 @@ export type EffectiveSessionControl = {
2741
3350
  interruptionPendingCount: number;
2742
3351
  quiescencePendingCount: number;
2743
3352
  } | null;
3353
+ backgroundCommandSettlement?: {
3354
+ state: "stopping";
3355
+ commandCount: number;
3356
+ } | null | undefined;
2744
3357
  };
2745
3358
  export type SessionCommandReceipt = {
2746
3359
  id: string;
@@ -2754,6 +3367,7 @@ export type SessionCommandReceipt = {
2754
3367
  appliedDraftRevision: number | null;
2755
3368
  createdAt: string;
2756
3369
  };
3370
+ export type SessionPromptRouting = "accepted_for_execution" | "queued_for_execution" | "accepted_for_steering";
2757
3371
  export type ComposerDraft = {
2758
3372
  revision: number;
2759
3373
  text: string;
@@ -2761,12 +3375,13 @@ export type ComposerDraft = {
2761
3375
  resources: ResourceRef[];
2762
3376
  model: string;
2763
3377
  reasoningEffort: ReasoningEffort;
2764
- latencyMode?: LatencyMode | undefined;
3378
+ latencyMode: LatencyMode;
2765
3379
  sourceTurnId: string | null;
2766
3380
  sourceTurnVersion: number | null;
2767
3381
  updatedAt: string | null;
2768
3382
  };
2769
3383
  export type NewSessionDraftOptions = {
3384
+ visibility?: SessionVisibility | undefined;
2770
3385
  sandboxBackend?: SandboxBackend | undefined;
2771
3386
  targetSandboxId?: string | undefined;
2772
3387
  workingDir?: string | undefined;
@@ -2776,6 +3391,19 @@ export type NewSessionDraftOptions = {
2776
3391
  firstPartyMcpPermissions?: Permission[] | undefined;
2777
3392
  firstPartyMcpTools?: FirstPartyMcpToolName[] | undefined;
2778
3393
  };
3394
+ export type NewSessionSelectionHistory = {
3395
+ /** Most-recently used project first. Null channelId is the Default project. */
3396
+ projects: Array<{
3397
+ channelId: string | null;
3398
+ /** Null means the managed sandbox was used most recently in this project. */
3399
+ targetSandboxId: string | null;
3400
+ /** Most-recently used machine in this project first. */
3401
+ machines: Array<{
3402
+ sandboxId: string;
3403
+ workingDir: string | null;
3404
+ }>;
3405
+ }>;
3406
+ };
2779
3407
  export type NewSessionDraft = {
2780
3408
  revision: number;
2781
3409
  text: string;
@@ -2785,8 +3413,9 @@ export type NewSessionDraft = {
2785
3413
  toolsProvided: boolean;
2786
3414
  model: string;
2787
3415
  reasoningEffort: ReasoningEffort;
2788
- latencyMode?: LatencyMode | undefined;
3416
+ latencyMode: LatencyMode;
2789
3417
  options: NewSessionDraftOptions;
3418
+ selectionHistory: NewSessionSelectionHistory;
2790
3419
  updatedAt: string | null;
2791
3420
  };
2792
3421
  export type SessionQueueSnapshot = {
@@ -2807,7 +3436,7 @@ export type SessionQueueSnapshot = {
2807
3436
  };
2808
3437
  export type SessionPendingInputPreview = Pick<SessionSystemUpdate, "id" | "sessionId" | "kind" | "classification" | "sourceId" | "summary" | "createdAt">;
2809
3438
  export type SystemUpdateClassification = "success" | "failure" | "action_required" | "info";
2810
- export type SessionSystemUpdateKind = "scheduled_occurrence" | "goal_continuation" | "agent_message" | "agent_steer_instruction" | "child_terminal_result" | "media_generation_result";
3439
+ 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";
2811
3440
  export type SessionSystemUpdateState = "pending" | "delivered" | "cancelled" | "superseded" | "failed";
2812
3441
  export type SessionSystemUpdate = {
2813
3442
  id: string;
@@ -2899,7 +3528,26 @@ export type DeleteSessionQueueItemRequest = {
2899
3528
  export type SaveComposerDraftRequest = Omit<ComposerDraft, "revision" | "sourceTurnId" | "sourceTurnVersion" | "updatedAt"> & {
2900
3529
  expectedRevision: number;
2901
3530
  };
2902
- export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "updatedAt"> & {
3531
+ export type SubmitComposerDraftRequest = Omit<SaveComposerDraftRequest, "expectedRevision"> & {
3532
+ expectedDraftRevision: number;
3533
+ clientEventId: string;
3534
+ delivery: "send" | "steer";
3535
+ controlEtag?: string;
3536
+ modelContext?: string;
3537
+ mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
3538
+ connectionAuthorities?: McpConnectionAuthoritySelection[];
3539
+ personalResourceAttachment?: PersonalResourceAttachmentIntent;
3540
+ };
3541
+ export type SubmitComposerDraftResponse = {
3542
+ accepted: SessionEvent;
3543
+ turn: SessionTurn;
3544
+ draft: ComposerDraft;
3545
+ receipt: SessionCommandReceipt;
3546
+ routing: SessionPromptRouting;
3547
+ interruptionCount: number;
3548
+ replay: boolean;
3549
+ };
3550
+ export type SaveNewSessionDraftRequest = Omit<NewSessionDraft, "revision" | "selectionHistory" | "updatedAt"> & {
2903
3551
  expectedRevision: number;
2904
3552
  };
2905
3553
  /** Input shape for agent config on create/update (server applies defaults). */
@@ -2913,6 +3561,8 @@ export type ScheduledTaskAgentConfigInput = {
2913
3561
  reasoningEffort?: ReasoningEffort | undefined;
2914
3562
  sandboxBackend?: SandboxBackend | undefined;
2915
3563
  goal?: GoalSpec | undefined;
3564
+ executionClass?: "incident_telemetry" | undefined;
3565
+ incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;
2916
3566
  maxNestedAgentDepth?: number | undefined;
2917
3567
  };
2918
3568
  export type CreateAgentScheduledTaskRequest = {
@@ -2923,6 +3573,7 @@ export type CreateAgentScheduledTaskRequest = {
2923
3573
  } | undefined;
2924
3574
  runMode?: ScheduledTaskRunMode | undefined;
2925
3575
  targetSessionId?: string | null | undefined;
3576
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
2926
3577
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2927
3578
  agentConfig: ScheduledTaskAgentConfigInput;
2928
3579
  status?: ScheduledTaskStatus | undefined;
@@ -2948,6 +3599,7 @@ export type UpdateScheduledTaskRequest = {
2948
3599
  schedule?: ScheduledTaskScheduleSpec | undefined;
2949
3600
  runMode?: ScheduledTaskRunMode | undefined;
2950
3601
  targetSessionId?: string | null | undefined;
3602
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
2951
3603
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
2952
3604
  action?: ScheduledTaskAction | undefined;
2953
3605
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
@@ -2988,6 +3640,8 @@ export type ScheduledTaskRun = {
2988
3640
  accountId: string;
2989
3641
  workspaceId: string;
2990
3642
  taskId: string;
3643
+ taskAuthorityRevision: number | null;
3644
+ taskExecutionDigest: string | null;
2991
3645
  status: ScheduledTaskRunStatus;
2992
3646
  triggerType: ScheduledTaskTriggerType;
2993
3647
  scheduledAt: string | null;
@@ -3020,6 +3674,9 @@ export type VariableSet = {
3020
3674
  id: string;
3021
3675
  accountId: string;
3022
3676
  workspaceId: string;
3677
+ scope: "organization" | "workspace" | "user";
3678
+ generation: number;
3679
+ status: "active" | "revoked";
3023
3680
  name: string;
3024
3681
  description: string | null;
3025
3682
  variables: VariableSetVariableMetadata[];
@@ -3031,6 +3688,8 @@ export type WorkspaceEnvironmentVariableMetadata = VariableSetVariableMetadata;
3031
3688
  /** @deprecated use VariableSet */
3032
3689
  export type WorkspaceEnvironment = VariableSet;
3033
3690
  export type CreateVariableSetRequest = {
3691
+ /** Omitted remains the legacy workspace-owned path. */
3692
+ scope?: "organization" | "workspace" | "user" | undefined;
3034
3693
  name: string;
3035
3694
  description?: string | undefined;
3036
3695
  /** Initial variables. Values are write-only: they never come back on reads. */
@@ -3115,6 +3774,8 @@ export type Channel = {
3115
3774
  workspaceId: string;
3116
3775
  name: string;
3117
3776
  description: string | null;
3777
+ pinned: boolean;
3778
+ sortOrder: number;
3118
3779
  createdBy: string | null;
3119
3780
  createdAt: string;
3120
3781
  updatedAt: string;
@@ -3126,6 +3787,11 @@ export type CreateChannelRequest = {
3126
3787
  export type UpdateChannelRequest = {
3127
3788
  name?: string;
3128
3789
  description?: string | null;
3790
+ pinned?: boolean;
3791
+ };
3792
+ /** Complete workspace project order. It is replaced atomically after a drag. */
3793
+ export type ReorderChannelsRequest = {
3794
+ channelIds: string[];
3129
3795
  };
3130
3796
  /** Re-files one session; null moves it back to the unfiled inbox. */
3131
3797
  export type UpdateSessionChannelRequest = {
@@ -3135,6 +3801,9 @@ export type Rig = {
3135
3801
  id: string;
3136
3802
  accountId: string;
3137
3803
  workspaceId: string;
3804
+ scope: ResourceAuthorityScope;
3805
+ generation: number;
3806
+ status: "active" | "revoked";
3138
3807
  name: string;
3139
3808
  description: string | null;
3140
3809
  createdBy: string | null;
@@ -3173,6 +3842,7 @@ export type RigChange = {
3173
3842
  updatedAt: string;
3174
3843
  };
3175
3844
  export type CreateRigRequest = {
3845
+ scope?: ResourceAuthorityScope;
3176
3846
  name: string;
3177
3847
  description?: string | undefined;
3178
3848
  image?: string | undefined;
@@ -3472,6 +4142,7 @@ export type Document = {
3472
4142
  authorityKind: DocumentAuthorityKind;
3473
4143
  authorityWorkspaceId: string | null;
3474
4144
  authoritySubjectId: string | null;
4145
+ authorityId?: string | null | undefined;
3475
4146
  visibility: DocumentVisibility;
3476
4147
  createdBy: string | null;
3477
4148
  agentAccess: boolean;
@@ -3541,6 +4212,92 @@ export type CreateKnowledgeDropRequest = {
3541
4212
  export type MoveDocumentRequest = {
3542
4213
  targetBaseId?: string | undefined;
3543
4214
  };
4215
+ export type DocumentAuthorityTuple = {
4216
+ kind: DocumentAuthorityKind;
4217
+ workspaceId: string | null;
4218
+ subjectId: string | null;
4219
+ authorityId: string | null;
4220
+ };
4221
+ export type ReclassifyDocumentAuthorityRequest = {
4222
+ operationId: string;
4223
+ expectedAuthority: DocumentAuthorityTuple;
4224
+ targetAuthorityKind: DocumentAuthorityKind;
4225
+ };
4226
+ export type DocumentAuthorityReclassification = {
4227
+ operationId: string;
4228
+ documentId: string;
4229
+ previousAuthority: DocumentAuthorityTuple;
4230
+ authority: DocumentAuthorityTuple;
4231
+ createdAt: string;
4232
+ };
4233
+ export type ListDocumentAuthorityReclassificationsOptions = {
4234
+ limit?: number | undefined;
4235
+ cursor?: string | undefined;
4236
+ };
4237
+ export type ListDocumentAuthorityReclassificationsResponse = {
4238
+ receipts: DocumentAuthorityReclassification[];
4239
+ hasMore: boolean;
4240
+ nextCursor: string | null;
4241
+ };
4242
+ export type RunDocumentDefaultCollectionBackfillRequest = {
4243
+ runId: string;
4244
+ operationId: string;
4245
+ batchSize?: number | undefined;
4246
+ };
4247
+ export type DocumentDefaultCollectionBackfill = {
4248
+ runId: string;
4249
+ operationId: string;
4250
+ status: "running" | "completed";
4251
+ lastWorkspaceId: string | null;
4252
+ processedCount: number;
4253
+ createdCount: number;
4254
+ adoptedCount: number;
4255
+ completedAt: string | null;
4256
+ };
4257
+ export type DocumentDefaultCollectionBackfillRunAudit = Omit<DocumentDefaultCollectionBackfill, "operationId"> & {
4258
+ actorSubjectId: string;
4259
+ startedAt: string;
4260
+ updatedAt: string;
4261
+ };
4262
+ export type DocumentDefaultCollectionBackfillOperationAudit = {
4263
+ operationId: string;
4264
+ result: DocumentDefaultCollectionBackfill;
4265
+ createdAt: string;
4266
+ };
4267
+ export type DocumentDefaultCollectionBackfillReceiptAudit = {
4268
+ workspaceId: string;
4269
+ baseId: string;
4270
+ outcome: "created" | "adopted";
4271
+ createdAt: string;
4272
+ };
4273
+ export type ListDocumentDefaultCollectionBackfillRunsResponse = {
4274
+ runs: DocumentDefaultCollectionBackfillRunAudit[];
4275
+ hasMore: boolean;
4276
+ nextCursor: string | null;
4277
+ };
4278
+ export type DocumentDefaultCollectionBackfillAudit = {
4279
+ run: DocumentDefaultCollectionBackfillRunAudit;
4280
+ operations: DocumentDefaultCollectionBackfillOperationAudit[];
4281
+ receipts: DocumentDefaultCollectionBackfillReceiptAudit[];
4282
+ operationsHasMore: boolean;
4283
+ operationsNextCursor: string | null;
4284
+ receiptsHasMore: boolean;
4285
+ receiptsNextCursor: string | null;
4286
+ };
4287
+ export type GetDocumentDefaultCollectionBackfillAuditOptions = {
4288
+ limit?: number | undefined;
4289
+ operationCursor?: string | undefined;
4290
+ receiptCursor?: string | undefined;
4291
+ };
4292
+ export type OrganizationDocumentAuthorityReclassification = DocumentAuthorityReclassification & {
4293
+ actorSubjectId: string;
4294
+ requestWorkspaceId: string;
4295
+ };
4296
+ export type ListOrganizationDocumentAuthorityReclassificationsResponse = {
4297
+ receipts: OrganizationDocumentAuthorityReclassification[];
4298
+ hasMore: boolean;
4299
+ nextCursor: string | null;
4300
+ };
3544
4301
  export type DocumentSearchRequest = {
3545
4302
  query: string;
3546
4303
  baseIds?: string[] | undefined;
@@ -3658,6 +4415,29 @@ export type CapabilityPackScheduledTaskTemplate = {
3658
4415
  defaultOverlapPolicy: ScheduledTaskOverlapPolicy;
3659
4416
  prompt?: string | undefined;
3660
4417
  };
4418
+ export type CapabilityPackAutomationTemplate = {
4419
+ id: string;
4420
+ name: string;
4421
+ description: string;
4422
+ adapterId: string;
4423
+ eventTypes: string[];
4424
+ sessionTemplate: {
4425
+ prompt: string;
4426
+ instructions: string | null;
4427
+ resources: ResourceRef[];
4428
+ skills: CapabilityPackSkill[];
4429
+ tools: ToolRef[];
4430
+ firstPartyMcpTools: string[];
4431
+ firstPartyMcpPermissions: Permission[];
4432
+ model: string | null;
4433
+ reasoningEffort: ReasoningEffort | null;
4434
+ sandboxBackend: SandboxBackend | null;
4435
+ policyRole: string | null;
4436
+ metadata: Record<string, unknown>;
4437
+ };
4438
+ configuration: Record<string, unknown>;
4439
+ connectionRequirement: string | null;
4440
+ };
3661
4441
  export type CapabilityPackSkillFile = {
3662
4442
  path: string;
3663
4443
  content: string;
@@ -3730,6 +4510,7 @@ export type CapabilityPack = {
3730
4510
  connectors: CapabilityPackConnector[];
3731
4511
  knowledge: CapabilityPackKnowledge[];
3732
4512
  scheduledTaskTemplates: CapabilityPackScheduledTaskTemplate[];
4513
+ automationTemplates?: CapabilityPackAutomationTemplate[] | undefined;
3733
4514
  variableSet?: CapabilityPackVariableSetSpec | undefined;
3734
4515
  metadata: Record<string, unknown>;
3735
4516
  };
@@ -3816,6 +4597,29 @@ export type RegisterCapabilityPackRequest = {
3816
4597
  defaultOverlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3817
4598
  prompt?: string | undefined;
3818
4599
  }[] | undefined;
4600
+ automationTemplates?: {
4601
+ id: string;
4602
+ name: string;
4603
+ description: string;
4604
+ adapterId: string;
4605
+ eventTypes: string[];
4606
+ sessionTemplate: {
4607
+ prompt: string;
4608
+ instructions?: string | null | undefined;
4609
+ resources?: ResourceRef[] | undefined;
4610
+ skills?: CapabilityPackSkill[] | undefined;
4611
+ tools?: ToolRef[] | undefined;
4612
+ firstPartyMcpTools?: string[] | undefined;
4613
+ firstPartyMcpPermissions?: Permission[] | undefined;
4614
+ model?: string | null | undefined;
4615
+ reasoningEffort?: ReasoningEffort | null | undefined;
4616
+ sandboxBackend?: SandboxBackend | null | undefined;
4617
+ policyRole?: string | null | undefined;
4618
+ metadata?: Record<string, unknown> | undefined;
4619
+ };
4620
+ configuration?: Record<string, unknown> | undefined;
4621
+ connectionRequirement?: string | null | undefined;
4622
+ }[] | undefined;
3819
4623
  variableSet?: {
3820
4624
  description: string;
3821
4625
  requiredVariables?: string[] | undefined;
@@ -3846,6 +4650,90 @@ export type PackInstallation = {
3846
4650
  enabledAt: string;
3847
4651
  updatedAt: string;
3848
4652
  };
4653
+ export type PrReviewProvider = GitCredentialProvider;
4654
+ export type PrReviewCredentialKind = "github_app" | "provider_token";
4655
+ export type PrReviewWebhookAuthKind = "hmac_sha256" | "shared_token" | "basic";
4656
+ export type CreatePrReviewAppRegistrationRequest = {
4657
+ name: string;
4658
+ provider: PrReviewProvider;
4659
+ providerBaseUrl?: string | undefined;
4660
+ appId?: string | undefined;
4661
+ credentialKind: PrReviewCredentialKind;
4662
+ privateKey?: string | undefined;
4663
+ accessToken?: string | undefined;
4664
+ accessTokenExpiresAt?: string | null | undefined;
4665
+ webhookSecret: string;
4666
+ webhookUsername?: string | undefined;
4667
+ };
4668
+ export type UpdatePrReviewAppRegistrationRequest = {
4669
+ name?: string | undefined;
4670
+ privateKey?: string | undefined;
4671
+ accessToken?: string | undefined;
4672
+ accessTokenExpiresAt?: string | null | undefined;
4673
+ webhookSecret?: string | undefined;
4674
+ webhookUsername?: string | undefined;
4675
+ status?: "active" | "disabled" | undefined;
4676
+ };
4677
+ export type PrReviewAppRegistration = {
4678
+ id: string;
4679
+ sourceId: string;
4680
+ accountId: string;
4681
+ workspaceId: string;
4682
+ name: string;
4683
+ provider: PrReviewProvider;
4684
+ providerBaseUrl: string;
4685
+ appId: string | null;
4686
+ credentialKind: PrReviewCredentialKind;
4687
+ hasCredential: boolean;
4688
+ accessTokenExpiresAt: string | null;
4689
+ webhookAuthKind: PrReviewWebhookAuthKind;
4690
+ hasWebhookSecret: boolean;
4691
+ webhookUsername: string | null;
4692
+ webhookPath: string;
4693
+ status: "active" | "disabled";
4694
+ createdBySubjectId: string;
4695
+ createdAt: string;
4696
+ updatedAt: string;
4697
+ };
4698
+ export type CreatePrReviewRepositoryBindingRequest = {
4699
+ registrationId: string;
4700
+ repositoryUri: string;
4701
+ repositoryFullName: string;
4702
+ providerRepositoryId: string | number;
4703
+ installationId?: string | number | undefined;
4704
+ projectId?: string | number | undefined;
4705
+ model?: string | null | undefined;
4706
+ additionalInstructions?: string | null | undefined;
4707
+ status?: "active" | "disabled" | undefined;
4708
+ };
4709
+ export type UpdatePrReviewRepositoryBindingRequest = {
4710
+ model?: string | null | undefined;
4711
+ additionalInstructions?: string | null | undefined;
4712
+ status?: "active" | "disabled" | undefined;
4713
+ };
4714
+ export type PrReviewRepositoryBinding = {
4715
+ id: string;
4716
+ triggerId: string;
4717
+ accountId: string;
4718
+ workspaceId: string;
4719
+ registrationId: string;
4720
+ provider: PrReviewProvider;
4721
+ repositoryUri: string;
4722
+ repositoryFullName: string;
4723
+ providerRepositoryId: string;
4724
+ installationId: string | null;
4725
+ projectId: string | null;
4726
+ model: string | null;
4727
+ additionalInstructions: string | null;
4728
+ status: "active" | "disabled";
4729
+ createdBySubjectId: string;
4730
+ createdAt: string;
4731
+ updatedAt: string;
4732
+ };
4733
+ export type ListPrReviewConfigurationResponse = {
4734
+ registrations: PrReviewAppRegistration[];
4735
+ repositories: PrReviewRepositoryBinding[];
4736
+ };
3849
4737
  export type EnablePackRequest = {
3850
4738
  variableSetId?: string | undefined;
3851
4739
  /** @deprecated use variableSetId */
@@ -4169,6 +5057,8 @@ export type IntegrationFacetBindingSummary = {
4169
5057
  lastErrorCode: string | null;
4170
5058
  createdAt: string;
4171
5059
  updatedAt: string;
5060
+ directlyOwned: boolean;
5061
+ owners: CapabilityComponentOwner[];
4172
5062
  };
4173
5063
  export type IntegrationInstanceFacetsResponse = {
4174
5064
  capabilityId: string;
@@ -4205,6 +5095,25 @@ export type IntegrationFacetRemovalResult = {
4205
5095
  binding: IntegrationFacetBindingSummary | null;
4206
5096
  remainingOwners: CapabilityComponentOwner[];
4207
5097
  };
5098
+ /**
5099
+ * Presentation-only consent copy served with an integration or connector.
5100
+ * Never grants a scope or replaces server-side authorization; the UI keeps a
5101
+ * generic fallback for any omitted field.
5102
+ */
5103
+ export type IntegrationPresentation = {
5104
+ providerName?: string | undefined;
5105
+ icon?: "calendar" | "cloud" | "contacts" | "files" | "mail" | undefined;
5106
+ introduction?: string | undefined;
5107
+ capabilities?: {
5108
+ title: string;
5109
+ description: string;
5110
+ }[] | undefined;
5111
+ permissionSummary?: string | undefined;
5112
+ scopeLabels?: Record<string, {
5113
+ label: string;
5114
+ description: string;
5115
+ }> | undefined;
5116
+ };
4208
5117
  export type IntegrationDefinitionSummary = {
4209
5118
  id: string;
4210
5119
  name: string;
@@ -4218,6 +5127,7 @@ export type IntegrationDefinitionSummary = {
4218
5127
  kind: "oauth2";
4219
5128
  scopes: string[];
4220
5129
  };
5130
+ presentation?: IntegrationPresentation | undefined;
4221
5131
  facets: IntegrationFacetDefinitionSummary[];
4222
5132
  };
4223
5133
  export type ListIntegrationDefinitionsResponse = {
@@ -4719,6 +5629,21 @@ export type InsightsModelCallRow = {
4719
5629
  estimatedProviderUsd: number | null;
4720
5630
  pricingSource: InsightsPricingSource | null;
4721
5631
  };
5632
+ export type ModelContextContributionSource = "workspace_instruction_policy" | "legacy_workspace_instructions" | "preference_registry_descriptor" | "company_profile" | "legacy_memory_v1" | "runtime_skill_catalog";
5633
+ export type InsightsPromptContributionRow = {
5634
+ source: ModelContextContributionSource;
5635
+ items: number;
5636
+ utf8Bytes: number;
5637
+ estimatedTokens: number;
5638
+ calls: number;
5639
+ };
5640
+ export type InsightsPromptContributions = {
5641
+ estimatedTokens: number;
5642
+ utf8Bytes: number;
5643
+ coveredCalls: number;
5644
+ totalCalls: number;
5645
+ sources: InsightsPromptContributionRow[];
5646
+ };
4722
5647
  export type WorkspaceInsightsSnapshot = {
4723
5648
  range: InsightsRange;
4724
5649
  rangeLabel: string;
@@ -4736,6 +5661,7 @@ export type WorkspaceInsightsSnapshot = {
4736
5661
  drivers: InsightsSpendDriver[];
4737
5662
  schedules: InsightsScheduleRow[];
4738
5663
  recentCalls: InsightsModelCallRow[];
5664
+ promptContributions: InsightsPromptContributions;
4739
5665
  warmSeconds: number;
4740
5666
  priorWarmSeconds: number;
4741
5667
  warmGroups: InsightsWarmGroupRow[];
@@ -4789,6 +5715,14 @@ export type CreateCheckoutResponse = {
4789
5715
  checkoutSessionId: string;
4790
5716
  url: string;
4791
5717
  };
5718
+ export type CreateBillingPortalRequest = {
5719
+ accountId?: string | undefined;
5720
+ returnUrl?: string | undefined;
5721
+ };
5722
+ export type CreateBillingPortalResponse = {
5723
+ portalSessionId: string;
5724
+ url: string;
5725
+ };
4792
5726
  export type UserMessageEventInput = {
4793
5727
  type: "user.message";
4794
5728
  clientEventId?: string | undefined;
@@ -4800,7 +5734,11 @@ export type UserMessageEventInput = {
4800
5734
  model?: string | undefined;
4801
5735
  reasoningEffort?: ReasoningEffort | undefined;
4802
5736
  latencyMode?: LatencyMode | undefined;
5737
+ controlEtag?: string | undefined;
5738
+ expectedDraftRevision?: number | undefined;
4803
5739
  mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[] | undefined;
5740
+ connectionAuthorities?: McpConnectionAuthoritySelection[] | undefined;
5741
+ personalResourceAttachment?: PersonalResourceAttachmentIntent | undefined;
4804
5742
  };
4805
5743
  };
4806
5744
  export type UserApprovalDecisionEventInput = {
@@ -4842,12 +5780,74 @@ export type MetricSample = {
4842
5780
  /** The derived dashboard state of a machine (M3 liveness + consent/display
4843
5781
  * reasons + the in-flight device-flow). */
4844
5782
  export type MachineState = "online" | "reconnecting" | "offline" | "consent_required" | "display_unavailable" | "enrolling";
4845
- export type MachineKind = "modal" | "selfhosted";
5783
+ export type MachineKind = "modal" | "selfhosted" | "opensandbox";
5784
+ export type MachineConnectionAuthority = {
5785
+ state: "not_applicable" | "unclaimed" | "active" | "expired";
5786
+ generation: number;
5787
+ supersededCount: number;
5788
+ leaseExpiresAt: string | null;
5789
+ duplicateRunnerDeniedCount: number;
5790
+ duplicateRunnerDeniedAt: string | null;
5791
+ };
5792
+ export type MachineRuntimeCapabilities = {
5793
+ exec: boolean;
5794
+ filesystem: boolean;
5795
+ git: boolean;
5796
+ pty: boolean;
5797
+ desktop: boolean;
5798
+ opStream: boolean;
5799
+ browserBridge: boolean;
5800
+ operationResourcePolicy: boolean;
5801
+ operationCpuQuota: boolean;
5802
+ };
5803
+ export type MachineUpdateStatus = "requested" | "accepted" | "waiting_for_idle" | "downloading" | "verifying" | "applying" | "restarting" | "succeeded" | "failed";
5804
+ export type MachineUpdateState = {
5805
+ operationId: string;
5806
+ status: MachineUpdateStatus;
5807
+ targetVersion: string;
5808
+ expectedBinarySha256: string | null;
5809
+ errorCode: string | null;
5810
+ retryable: boolean;
5811
+ rolledBack: boolean;
5812
+ requestedAt: string;
5813
+ updatedAt: string;
5814
+ completedAt: string | null;
5815
+ };
5816
+ export type MachineRuntime = {
5817
+ installedVersion: string | null;
5818
+ binarySha256: string | null;
5819
+ updateChannel: "stable" | "beta" | null;
5820
+ desiredVersion: string | null;
5821
+ versionState: "unknown" | "current" | "outdated" | "ahead" | "updating" | "update_failed";
5822
+ capabilities: MachineRuntimeCapabilities;
5823
+ update: MachineUpdateState | null;
5824
+ };
5825
+ export type UpdateMachineAgentResponse = {
5826
+ operationId: string;
5827
+ accepted: boolean;
5828
+ targetVersion: string;
5829
+ };
5830
+ export type MachineOperationPolicy = {
5831
+ memoryMaxBytes: number | null;
5832
+ memoryHighBytes: number | null;
5833
+ cpuMaxMillicores: number | null;
5834
+ revision: number;
5835
+ updatedAt: string | null;
5836
+ };
5837
+ export type UpdateMachineOperationPolicyRequest = {
5838
+ memoryMaxBytes: number | null;
5839
+ memoryHighBytes: number | null;
5840
+ /** Omitted preserves the current CPU limit for older/partial clients; null clears. */
5841
+ cpuMaxMillicores?: number | null;
5842
+ expectedRevision: number;
5843
+ };
4846
5844
  /** A machine as the Machines dashboard renders it (an enrolled selfhosted machine
4847
5845
  * or the session's synthetic Modal group box, `isSessionGroup: true`). */
4848
5846
  export type MachineView = {
4849
5847
  sandboxId: string;
4850
5848
  enrollmentId: string | null;
5849
+ scope: ResourceAuthorityScope;
5850
+ generation: number;
4851
5851
  name: string;
4852
5852
  kind: MachineKind;
4853
5853
  state: MachineState;
@@ -4866,6 +5866,14 @@ export type MachineView = {
4866
5866
  allowScreenControl: boolean;
4867
5867
  sharedSessionCount: number;
4868
5868
  lastSeenAt: string | null;
5869
+ /** Secret-free single-runner authority diagnostics. */
5870
+ connectionAuthority: MachineConnectionAuthority;
5871
+ /** Exact build/update truth. Null means the runner predates runtime Hello
5872
+ * reporting or this is a managed-session group without a connected agent. */
5873
+ runtime: MachineRuntime | null;
5874
+ /** Explicit per-enrollment command memory policy. Null only for managed
5875
+ * session boxes; null limits on a real machine mean unrestricted. */
5876
+ operationPolicy: MachineOperationPolicy | null;
4869
5877
  metrics: MetricSample | null;
4870
5878
  };
4871
5879
  /** GET /v1/workspaces/:ws/machines — the dashboard list + the active-sandbox
@@ -4920,6 +5928,7 @@ export type SwapActiveSandboxResponse = {
4920
5928
  };
4921
5929
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
4922
5930
  export type EnrollmentOs = "linux" | "macos" | "windows";
5931
+ export type ResourceAuthorityScope = "organization" | "workspace" | "user";
4923
5932
  /** POST /v1/enrollments/device/lookup body. */
4924
5933
  export type DeviceEnrollmentLookupRequest = {
4925
5934
  userCode: string;
@@ -4943,6 +5952,7 @@ export type DeviceEnrollmentLookupResponse = {
4943
5952
  export type DeviceEnrollmentApproveRequest = {
4944
5953
  userCode: string;
4945
5954
  allowScreenControl?: boolean;
5955
+ scope?: ResourceAuthorityScope;
4946
5956
  };
4947
5957
  /** POST /v1/workspaces/:ws/enrollments/device/approve response. */
4948
5958
  export type DeviceEnrollmentApproveResponse = {