@opengeni/sdk 0.46.0 → 0.52.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +94 -2
  2. package/dist/artifact-client.d.ts +20 -2
  3. package/dist/artifacts.d.ts +4 -0
  4. package/dist/artifacts.js +11 -0
  5. package/dist/artifacts.js.map +1 -0
  6. package/dist/chunk-FHI4DFIG.js +128 -0
  7. package/dist/chunk-FHI4DFIG.js.map +1 -0
  8. package/dist/chunk-FRJFNDIR.js +218 -0
  9. package/dist/chunk-FRJFNDIR.js.map +1 -0
  10. package/dist/{chunk-QKV5OCLJ.js → chunk-ILQZR5N6.js} +1380 -595
  11. package/dist/chunk-ILQZR5N6.js.map +1 -0
  12. package/dist/chunk-MZWTWOX6.js +661 -0
  13. package/dist/chunk-MZWTWOX6.js.map +1 -0
  14. package/dist/chunk-VWE2QIVO.js +1162 -0
  15. package/dist/chunk-VWE2QIVO.js.map +1 -0
  16. package/dist/chunk-VYCTL62C.js +230 -0
  17. package/dist/chunk-VYCTL62C.js.map +1 -0
  18. package/dist/client.d.ts +176 -20
  19. package/dist/codex-realtime-controller.d.ts +6 -6
  20. package/dist/codex-realtime-lifecycle.d.ts +1 -1
  21. package/dist/codex-realtime-v3.d.ts +3 -3
  22. package/dist/codex-realtime.d.ts +1 -1
  23. package/dist/company-profile.d.ts +100 -0
  24. package/dist/core.d.ts +5 -5
  25. package/dist/core.js +9 -4
  26. package/dist/desktop.d.ts +1 -1
  27. package/dist/editable-artifact-resources.d.ts +96 -0
  28. package/dist/editable-artifacts/browser-session.d.ts +35 -0
  29. package/dist/editable-artifacts/controller.d.ts +60 -0
  30. package/dist/editable-artifacts/errors.d.ts +23 -0
  31. package/dist/editable-artifacts/http-live-transport.d.ts +46 -0
  32. package/dist/editable-artifacts/index.d.ts +19 -0
  33. package/dist/editable-artifacts/pool.d.ts +15 -0
  34. package/dist/editable-artifacts/session.d.ts +96 -0
  35. package/dist/editable-artifacts/storage.d.ts +72 -0
  36. package/dist/editable-artifacts/types.d.ts +416 -0
  37. package/dist/editable-artifacts/worker/browser-client.d.ts +80 -0
  38. package/dist/editable-artifacts/worker/browser-entry.d.ts +6 -0
  39. package/dist/editable-artifacts/worker/kernel-adapter.d.ts +45 -0
  40. package/dist/editable-artifacts/worker/rpc-protocol.d.ts +92 -0
  41. package/dist/editable-artifacts/worker/runtime.d.ts +66 -0
  42. package/dist/editable-artifacts/worker/wire-codec.d.ts +52 -0
  43. package/dist/editable-artifacts-worker.d.ts +8 -0
  44. package/dist/editable-artifacts-worker.js +1708 -0
  45. package/dist/editable-artifacts-worker.js.map +1 -0
  46. package/dist/editable-artifacts.d.ts +6 -0
  47. package/dist/editable-artifacts.js +5954 -0
  48. package/dist/editable-artifacts.js.map +1 -0
  49. package/dist/gateway-realtime-transport.d.ts +1 -1
  50. package/dist/index.d.ts +41 -35
  51. package/dist/index.js +104 -68
  52. package/dist/index.js.map +1 -1
  53. package/dist/interaction.d.ts +885 -0
  54. package/dist/interaction.js +55 -0
  55. package/dist/interaction.js.map +1 -0
  56. package/dist/memory-slack-client.d.ts +13 -0
  57. package/dist/memory-slack-delivery.d.ts +99 -0
  58. package/dist/memory-slack.d.ts +4 -0
  59. package/dist/memory-slack.js +44 -0
  60. package/dist/memory-slack.js.map +1 -0
  61. package/dist/proxy.d.ts +3 -3
  62. package/dist/realtime.d.ts +12 -12
  63. package/dist/retained-artifacts.d.ts +12 -0
  64. package/dist/stream.d.ts +16 -1
  65. package/dist/terminal.d.ts +1 -1
  66. package/dist/transcription.d.ts +2 -2
  67. package/dist/types.d.ts +1203 -23
  68. package/dist/workspace-control-stream.d.ts +2 -2
  69. package/dist/workspace-state.d.ts +1 -1
  70. package/package.json +29 -3
  71. package/src/artifact-client.ts +129 -0
  72. package/src/artifacts.ts +17 -0
  73. package/src/client.ts +1801 -206
  74. package/src/company-profile.ts +92 -0
  75. package/src/editable-artifact-resources.ts +119 -0
  76. package/src/editable-artifacts/browser-session.ts +176 -0
  77. package/src/editable-artifacts/controller.ts +2632 -0
  78. package/src/editable-artifacts/errors.ts +52 -0
  79. package/src/editable-artifacts/http-live-transport.ts +1449 -0
  80. package/src/editable-artifacts/index.ts +175 -0
  81. package/src/editable-artifacts/pool.ts +81 -0
  82. package/src/editable-artifacts/session.ts +778 -0
  83. package/src/editable-artifacts/storage.ts +1718 -0
  84. package/src/editable-artifacts/types.ts +499 -0
  85. package/src/editable-artifacts/worker/browser-client.ts +1167 -0
  86. package/src/editable-artifacts/worker/browser-entry.ts +57 -0
  87. package/src/editable-artifacts/worker/kernel-adapter.ts +1039 -0
  88. package/src/editable-artifacts/worker/rpc-protocol.ts +622 -0
  89. package/src/editable-artifacts/worker/runtime.ts +1204 -0
  90. package/src/editable-artifacts/worker/wire-codec.ts +852 -0
  91. package/src/editable-artifacts-worker.ts +8 -0
  92. package/src/editable-artifacts.ts +6 -0
  93. package/src/index.ts +194 -0
  94. package/src/interaction.ts +1830 -0
  95. package/src/memory-slack-client.ts +71 -0
  96. package/src/memory-slack-delivery.ts +128 -0
  97. package/src/memory-slack.ts +19 -0
  98. package/src/retained-artifacts.ts +326 -0
  99. package/src/stream.ts +102 -4
  100. package/src/transcription.ts +2 -2
  101. package/src/types.ts +1430 -33
  102. package/src/workspace-control-stream.ts +15 -5
  103. package/dist/chunk-QKV5OCLJ.js.map +0 -1
package/src/types.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { WorkspaceTranscriptionPolicy } from "./transcription";
2
2
 
3
3
  // Hand-written mirrors of the public wire shapes in `@opengeni/contracts`.
4
- // The SDK keeps zero runtime dependencies so it stays framework-agnostic and
5
- // publishable on its own; `test/contract-parity.test.ts` pins these types to
6
- // the contracts package so drift fails the gate instead of shipping.
4
+ // Ordinary SDK entries stay framework-agnostic and do not import the contracts
5
+ // runtime; `test/contract-parity.test.ts` pins these types to the contracts
6
+ // package so drift fails the gate instead of shipping.
7
7
 
8
8
  export type CodexRealtimeWebrtcVersion = "v3";
9
9
  export type CodexRealtimeVoice =
@@ -287,6 +287,7 @@ export type SessionCapabilities = {
287
287
  shell: string;
288
288
  url: string | null;
289
289
  token: string | null;
290
+ expiresAt: string | null;
290
291
  reason: CapabilityUnavailableReason | null;
291
292
  };
292
293
  Git: {
@@ -343,8 +344,8 @@ export type ComputerUseCapability = SessionCapabilities["ComputerUse"];
343
344
  // the capability-gated client (`@opengeni/react`) drives. The desktop pixel
344
345
  // plane rides Channel B (direct-to-provider noVNC); the structured terminal/
345
346
  // files/git surfaces ride Channel A (the existing event spine + the synchronous
346
- // fs/git/terminal point queries above). These are TYPES only (the SDK keeps zero
347
- // runtime deps); the contract-parity test pins them.
347
+ // fs/git/terminal point queries above). These are TYPES only, so ordinary SDK
348
+ // entries do not reach the contracts runtime; the contract-parity test pins them.
348
349
 
349
350
  // Mirror of `@opengeni/contracts` StreamUrlRotatedPayload — the Channel-A event
350
351
  // the client folds in to hot-swap its noVNC socket on a box rollover, fenced on
@@ -374,12 +375,14 @@ export type StreamRevokedPayload = {
374
375
 
375
376
  // Mirror of `@opengeni/contracts` AttachViewerRequest. Omitting `viewerId` mints
376
377
  // a fresh holder id (returned on the response, carried through heartbeat/detach).
377
- // `desktop:true` opts into the un-redacted pixel plane (the consent-gated noVNC
378
- // stream); a terminal/files-only warm attach omits it (defaults false) so it
379
- // warms the box + mints the pty-ws terminal cell WITHOUT tripping the consent 409.
378
+ // Plane flags are exact: credentials are minted only for the requested live
379
+ // surfaces and each surface enforces its own permission. An omitted plane set is
380
+ // retained as the legacy terminal-only request; current clients send all flags.
380
381
  export type AttachViewerRequest = {
381
382
  viewerId?: string | undefined;
382
383
  desktop?: boolean | undefined;
384
+ terminal?: boolean | undefined;
385
+ files?: boolean | undefined;
383
386
  };
384
387
 
385
388
  // Mirror of `@opengeni/contracts` ViewerHolder + the P4.2 desktop-stream fields
@@ -402,8 +405,8 @@ export type AttachViewerResponse = ViewerHolder & {
402
405
  streamToken: string | null;
403
406
  streamExpiresAt: string | null;
404
407
  resolution: [number, number] | null;
405
- transport: "vnc-ws" | null;
406
- client: "novnc" | null;
408
+ transport: "vnc-ws" | "relay-frames" | null;
409
+ client: "novnc" | "frames" | null;
407
410
  // The scoped ttyd PTY-over-websocket address minted for THIS holder — the REAL
408
411
  // interactive terminal, symmetric with the desktop pixel plane (same Modal
409
412
  // tunnel, same scoped stream token). Populated on a warm box; null when the
@@ -412,6 +415,7 @@ export type AttachViewerResponse = ViewerHolder & {
412
415
  // `terminalTransport` is "pty-ws" iff a live `terminalUrl` was minted.
413
416
  terminalUrl: string | null;
414
417
  terminalToken: string | null;
418
+ terminalExpiresAt: string | null;
415
419
  terminalTransport: "pty-ws" | null;
416
420
  };
417
421
 
@@ -461,7 +465,7 @@ export type RepositoryResourceRef = {
461
465
  githubRepositoryId?: number | undefined;
462
466
  };
463
467
 
464
- /** Value mirror of `@opengeni/contracts`; parity-tested without adding an SDK runtime dependency. */
468
+ /** Value mirror of `@opengeni/contracts`; parity-tested without importing it from ordinary SDK entries. */
465
469
  export const DEFAULT_FILE_RESOURCE_MOUNT_ROOT = ".opengeni/files" as const;
466
470
 
467
471
  export type FileResourceRef = {
@@ -641,6 +645,33 @@ export type OpenGeniSlackBotInstallStart = {
641
645
  expiresAt: string;
642
646
  };
643
647
 
648
+ export type SlackInstallationBindingState = "active" | "quarantined";
649
+
650
+ export type SlackInstallationBinding = {
651
+ id: string;
652
+ accountId: string;
653
+ accountName: string;
654
+ workspaceId: string;
655
+ workspaceName: string;
656
+ connectionId: string;
657
+ connectionStatus: ConnectionStatus;
658
+ connectionVersion: number;
659
+ slackTeamId: string;
660
+ slackTeamName: string;
661
+ botId: string;
662
+ botUserId: string;
663
+ botDisplayName: "OpenGeni";
664
+ state: SlackInstallationBindingState;
665
+ quarantineReason: string | null;
666
+ version: number;
667
+ createdAt: string;
668
+ updatedAt: string;
669
+ };
670
+
671
+ export type ListSlackInstallationBindingsResponse = {
672
+ bindings: SlackInstallationBinding[];
673
+ };
674
+
644
675
  export type GoogleDriveTargetScope = "user" | "workspace" | "organization";
645
676
  export type ConnectorDocumentDestinationAuthority = "organization" | "workspace" | "personal";
646
677
  export type ConnectorDocumentDestinationSelection = {
@@ -680,13 +711,15 @@ export type GoogleDriveSelectedSource = {
680
711
  /** @deprecated Missing destinations resolve to the current workspace boundary. */
681
712
  targetScope?: GoogleDriveTargetScope | undefined;
682
713
  syncCadence: GoogleDriveSyncCadence;
714
+ syncEnabled: boolean;
715
+ configGeneration: number;
683
716
  readPolicy: GoogleDriveReadPolicy;
684
717
  selectedAt: string;
685
718
  };
686
719
 
687
720
  export type GoogleDriveConnectionMetadata = {
688
721
  credentialRole: "google_drive_metadata";
689
- credentialLabel: "Google Drive metadata browser";
722
+ credentialLabel: "Google Drive read-only source sync" | "Google Drive metadata browser";
690
723
  googlePermissionId: string;
691
724
  googleEmail: string;
692
725
  googleDisplayName: string | null;
@@ -739,15 +772,118 @@ export type GoogleDriveBrowseResponse = {
739
772
  incompleteSearch: boolean;
740
773
  };
741
774
 
775
+ export type AtlassianSourceKind = "jira_project" | "confluence_space";
776
+ export type AtlassianSyncCadence = "manual" | "hourly" | "daily";
777
+ export type AtlassianReadPolicy = "allow" | "ask" | "block";
778
+ export type AtlassianConnectionLifecycle = {
779
+ state:
780
+ | "active"
781
+ | "paused"
782
+ | "token_revoked"
783
+ | "app_removed"
784
+ | "disconnected"
785
+ | "reconnect_required"
786
+ | "reconsent_required";
787
+ recoverable: boolean;
788
+ observedAt: string;
789
+ };
790
+ export type AtlassianSelectedSource = {
791
+ id: string;
792
+ cloudId: string;
793
+ siteName: string;
794
+ siteUrl: string;
795
+ resourceId: string;
796
+ key: string;
797
+ name: string;
798
+ kind: AtlassianSourceKind;
799
+ destination?: ConnectorDocumentDestination | undefined;
800
+ syncCadence: AtlassianSyncCadence;
801
+ syncEnabled: boolean;
802
+ configGeneration: number;
803
+ readPolicy: AtlassianReadPolicy;
804
+ selectedAt: string;
805
+ };
806
+ export type AtlassianConnectionMetadata = {
807
+ credentialRole: "atlassian_knowledge";
808
+ credentialLabel: "Atlassian read-only knowledge sync";
809
+ atlassianAccountId: string;
810
+ displayName: string;
811
+ email?: string | null | undefined;
812
+ sites: Array<{
813
+ cloudId: string;
814
+ name: string;
815
+ url: string;
816
+ products: Array<"jira" | "confluence">;
817
+ }>;
818
+ verifiedAt: string;
819
+ accessMode: "readonly";
820
+ lifecycle?: AtlassianConnectionLifecycle | undefined;
821
+ documentDestination?: ConnectorDocumentDestination | undefined;
822
+ selectedSources: AtlassianSelectedSource[];
823
+ [key: string]: unknown;
824
+ };
825
+ export type AtlassianOAuthStartResponse = { authorizationUrl: string; expiresAt: string };
826
+ export type AtlassianLifecycleActionRequest = {
827
+ action: "pause" | "resume";
828
+ expectedVersion: number;
829
+ };
830
+ export type AtlassianDisconnectRequest = { expectedVersion: number; idempotencyKey: string };
831
+ export type AtlassianBrowseItem = {
832
+ id: string;
833
+ cloudId: string;
834
+ siteName: string;
835
+ siteUrl: string;
836
+ resourceId: string;
837
+ key: string;
838
+ name: string;
839
+ kind: AtlassianSourceKind;
840
+ description: string | null;
841
+ webUrl: string;
842
+ };
843
+ export type AtlassianBrowseResponse = {
844
+ connection: ConnectionMetadata;
845
+ items: AtlassianBrowseItem[];
846
+ };
847
+
742
848
  export type SaveGoogleDriveSourceRequest = {
743
849
  sources: Array<Pick<GoogleDriveBrowseItem, "id" | "name" | "mimeType" | "driveId">>;
744
850
  destination?: ConnectorDocumentDestinationSelection | undefined;
745
851
  /** @deprecated Legacy requests resolve to workspace authority. */
746
852
  targetScope?: GoogleDriveTargetScope | undefined;
747
853
  syncCadence: GoogleDriveSyncCadence;
854
+ syncEnabled: boolean;
855
+ readPolicy: GoogleDriveReadPolicy;
856
+ };
857
+
858
+ export type GoogleDriveKnowledgeSourceItem = {
859
+ id: string;
860
+ name: string;
861
+ mimeType: string;
862
+ driveId?: string | undefined;
863
+ sourceKind: "my_drive" | "shared_drive" | "folder";
864
+ includeDescendants: boolean;
865
+ };
866
+
867
+ export type GoogleDriveKnowledgeSourceDestination = {
868
+ authorityKind: ConnectorDocumentDestinationAuthority;
869
+ authorityAccountId: string;
870
+ authorityWorkspaceId?: string | undefined;
871
+ authoritySubjectId?: string | undefined;
872
+ collectionId?: string | undefined;
873
+ };
874
+
875
+ export type GoogleDriveKnowledgeSourceConfig = {
876
+ sources: GoogleDriveKnowledgeSourceItem[];
877
+ destination: GoogleDriveKnowledgeSourceDestination;
878
+ syncCadence: GoogleDriveSyncCadence;
748
879
  readPolicy: GoogleDriveReadPolicy;
749
880
  };
750
881
 
882
+ export type SaveGoogleDriveIntegrationSourceRequest = SaveGoogleDriveSourceRequest & {
883
+ expectedVersion?: number | undefined;
884
+ idempotencyKey: string;
885
+ };
886
+
751
887
  export type UpdateConnectionRequest = {
752
888
  providerDomain?: string | undefined;
753
889
  subjectId?: string | null | undefined;
@@ -960,6 +1096,47 @@ export type SessionListResponse = {
960
1096
  nextCursor: string | null;
961
1097
  };
962
1098
 
1099
+ /** Compact, bounded session projection for workspace agent-topology browsers. */
1100
+ export type AgentTopologySession = {
1101
+ id: string;
1102
+ title: string | null;
1103
+ titleTruncated: boolean;
1104
+ parentSessionId: string | null;
1105
+ rootSessionId: string;
1106
+ nestedAgentDepth: number;
1107
+ ancestorPath: Array<{ id: string; title: string | null; titleTruncated: boolean }>;
1108
+ status: SessionStatus;
1109
+ pause: {
1110
+ state: "active" | "paused";
1111
+ additionalBlockerCount: number;
1112
+ source: {
1113
+ kind: "session" | "workspace";
1114
+ sessionId?: string | undefined;
1115
+ displayName: string;
1116
+ displayNameTruncated: boolean;
1117
+ } | null;
1118
+ };
1119
+ children: {
1120
+ directChildren: number;
1121
+ totalDescendants: number;
1122
+ runningDescendants: number;
1123
+ queuedDescendants: number;
1124
+ attentionDescendants: number;
1125
+ pausedDescendants: number;
1126
+ failedDescendants: number;
1127
+ truncated: boolean;
1128
+ };
1129
+ createdAt: string;
1130
+ updatedAt: string;
1131
+ };
1132
+
1133
+ export type AgentTopologyPageResponse = {
1134
+ sessions: AgentTopologySession[];
1135
+ total: number;
1136
+ hasMore: boolean;
1137
+ nextCursor: string | null;
1138
+ };
1139
+
963
1140
  export type UpdateSessionPinRequest = {
964
1141
  pinned: boolean;
965
1142
  expectedVersion?: number;
@@ -996,6 +1173,39 @@ export type SessionTurnSource =
996
1173
  | "system"
997
1174
  | "compaction";
998
1175
 
1176
+ export type TimelineAnnotationSourceKind = "user_message" | "assistant_message" | "tool_output";
1177
+
1178
+ export type TimelineAnnotationSourceEventType =
1179
+ | "user.message"
1180
+ | "agent.message.completed"
1181
+ | "agent.toolCall.output";
1182
+
1183
+ export type TimelineAnnotationSource = {
1184
+ kind: TimelineAnnotationSourceKind;
1185
+ eventId: string;
1186
+ eventType: TimelineAnnotationSourceEventType;
1187
+ sequence: number;
1188
+ turnId: string | null;
1189
+ startOffset: number;
1190
+ endOffset: number;
1191
+ contextBefore: string;
1192
+ contextAfter: string;
1193
+ label?: string | undefined;
1194
+ };
1195
+
1196
+ export type DraftTimelineAnnotation = {
1197
+ id: string;
1198
+ source: TimelineAnnotationSource;
1199
+ quote: string;
1200
+ note: string;
1201
+ };
1202
+
1203
+ export type SubmittedTimelineAnnotation = DraftTimelineAnnotation;
1204
+
1205
+ export type TimelineAnnotation = DraftTimelineAnnotation & {
1206
+ ordinal: number;
1207
+ };
1208
+
999
1209
  export type SessionTurn = {
1000
1210
  id: string;
1001
1211
  workspaceId: string;
@@ -1006,6 +1216,7 @@ export type SessionTurn = {
1006
1216
  source: SessionTurnSource;
1007
1217
  position: number;
1008
1218
  prompt: string;
1219
+ annotations?: TimelineAnnotation[] | undefined;
1009
1220
  resources: ResourceRef[];
1010
1221
  tools: ToolRef[];
1011
1222
  toolsProvided?: boolean | undefined;
@@ -1373,6 +1584,17 @@ export type ToolAuthNeededPayload = {
1373
1584
  selectedResources?: Array<{ id: string; kind: "repository" }> | undefined;
1374
1585
  authorizationUrl?: string | undefined;
1375
1586
  subjectId?: string | null | undefined;
1587
+ capability?:
1588
+ | {
1589
+ id: string;
1590
+ name: string;
1591
+ kind: CapabilityKind;
1592
+ source: CapabilitySource;
1593
+ action: "connect" | "add_credentials" | "enable";
1594
+ rationale: string;
1595
+ requiredVariables: string[];
1596
+ }
1597
+ | undefined;
1376
1598
  };
1377
1599
 
1378
1600
  // Payload shapes for the high-traffic event types. `SessionEvent.payload` is
@@ -1471,9 +1693,10 @@ export type CodexFleetDecisionEventPayload = {
1471
1693
  } & Record<string, unknown>;
1472
1694
  };
1473
1695
 
1474
- // Recording payloads (P4.3 — plain TS mirror of the contracts Zod schemas; the
1475
- // SDK is zero-runtime-dep so these are TYPES, not Zod, F15). The contract-parity
1476
- // test asserts the event-type literals; these shapes document the wire payloads.
1696
+ // Recording payloads (P4.3 — plain TS mirror of the contracts Zod schemas).
1697
+ // These are TYPES, not Zod (F15), so ordinary SDK entries remain runtime-clean.
1698
+ // The contract-parity test asserts the event-type literals; these shapes
1699
+ // document the wire payloads.
1477
1700
  export type RecordingMode = "manual" | "on-turn" | "on-verify";
1478
1701
  export type RecordingCodec = "h264-mp4" | "vp9-webm";
1479
1702
  export type RecordingContentType = "video/mp4" | "video/webm";
@@ -1587,6 +1810,8 @@ export type FsListResponse = {
1587
1810
  revision: number;
1588
1811
  truncated: boolean;
1589
1812
  };
1813
+ export type FsListBatchRequest = { requests: FsListRequest[] };
1814
+ export type FsListBatchResponse = { results: FsListResponse[] };
1590
1815
  export type FsReadRequest = {
1591
1816
  path: string;
1592
1817
  encoding?: FsEncoding;
@@ -1651,6 +1876,9 @@ export type GitStatusRequest = { path?: string };
1651
1876
  export type GitStatusResponse = {
1652
1877
  isRepo: boolean;
1653
1878
  head: string | null;
1879
+ /** Exact commit object identity. null for unborn/non-repositories; absent on
1880
+ * legacy adapters. */
1881
+ headOid?: string | null | undefined;
1654
1882
  detached: boolean;
1655
1883
  upstream: string | null;
1656
1884
  ahead: number;
@@ -1695,6 +1923,16 @@ export type GitDiffRequest = {
1695
1923
  maxBytesPerFile?: number;
1696
1924
  };
1697
1925
  export type GitDiffResponse = { files: GitFileDiff[]; revision: number };
1926
+ export type GitReadBatchItemRequest = {
1927
+ status: GitStatusRequest;
1928
+ diff?: GitDiffRequest;
1929
+ };
1930
+ export type GitReadBatchRequest = { requests: GitReadBatchItemRequest[] };
1931
+ export type GitReadBatchItemResponse = {
1932
+ status: GitStatusResponse;
1933
+ diff?: GitDiffResponse;
1934
+ };
1935
+ export type GitReadBatchResponse = { results: GitReadBatchItemResponse[] };
1698
1936
  export type GitLogRequest = {
1699
1937
  path?: string;
1700
1938
  ref?: string;
@@ -1749,12 +1987,18 @@ export type WorkspaceCaptureFile = {
1749
1987
  export type WorkspaceCaptureRepo = {
1750
1988
  root: string;
1751
1989
  head: string | null;
1990
+ /** Exact HEAD commit object identity. null for unborn repositories; absent
1991
+ * on legacy captures. */
1992
+ headOid?: string | null | undefined;
1752
1993
  detached: boolean;
1753
1994
  upstream: string | null;
1754
1995
  ahead: number;
1755
1996
  behind: number;
1756
1997
  status: GitFileStatus[];
1757
1998
  diff: GitFileDiff[];
1999
+ /** Current branch vs the remote default branch. Absent on legacy captures or
2000
+ * repositories whose remote default ref could not be resolved. */
2001
+ branchDiff?: GitFileDiff[] | undefined;
1758
2002
  };
1759
2003
  export type WorkspaceCaptureDegradedReason =
1760
2004
  | "repository_discovery_command_failed"
@@ -1875,7 +2119,7 @@ export type SessionStructuredCapabilities = {
1875
2119
 
1876
2120
  export type ScheduledTaskStatus = "active" | "paused";
1877
2121
 
1878
- export type ScheduledTaskRunMode = "new_session_per_run" | "reusable_session";
2122
+ export type ScheduledTaskRunMode = "new_session_per_run" | "reusable_session" | "existing_session";
1879
2123
 
1880
2124
  export type ScheduledTaskOverlapPolicy = "allow_concurrent" | "skip" | "buffer_one";
1881
2125
 
@@ -1889,6 +2133,7 @@ export type ScheduledTaskDayOfWeek =
1889
2133
  | "SATURDAY";
1890
2134
 
1891
2135
  export type ScheduledTaskScheduleSpec =
2136
+ | { type: "manual" }
1892
2137
  | { type: "once"; runAt: string; timeZone: string }
1893
2138
  | {
1894
2139
  type: "interval";
@@ -1917,6 +2162,44 @@ export type ScheduledTaskAgentConfig = {
1917
2162
  maxNestedAgentDepth?: number | undefined;
1918
2163
  };
1919
2164
 
2165
+ export type ScopedKnowledgeScope =
2166
+ | { kind: "organization"; workspaceId: null; subjectId: null }
2167
+ | { kind: "workspace"; workspaceId: string; subjectId: null }
2168
+ | { kind: "personal"; workspaceId: string | null; subjectId: string };
2169
+
2170
+ export type KnowledgeSourceSyncLimits = {
2171
+ maxItems: number;
2172
+ maxBytes: number;
2173
+ maxFileBytes: number;
2174
+ maxProviderRequests: number;
2175
+ maxElapsedSeconds: number;
2176
+ maxConcurrency: number;
2177
+ maxFailureDetails: number;
2178
+ };
2179
+
2180
+ export type ScheduledTaskAction =
2181
+ | { kind: "agent_turn" }
2182
+ | {
2183
+ kind: "knowledge_source_sync";
2184
+ sourceId: string;
2185
+ sourceGeneration: number;
2186
+ sourceLifecycleGeneration: number;
2187
+ sourceConfigGeneration: number;
2188
+ controlWorkspaceId: string;
2189
+ providerCoordinationKey: string;
2190
+ connection: {
2191
+ connectionId: string;
2192
+ connectionVersion: number;
2193
+ providerDomain: string;
2194
+ kind: ConnectionKind;
2195
+ ownerSubjectId: string;
2196
+ };
2197
+ destination: ScopedKnowledgeScope;
2198
+ initiatingSubjectId: string;
2199
+ allDescendants: boolean;
2200
+ limits: KnowledgeSourceSyncLimits;
2201
+ };
2202
+
1920
2203
  export type ScheduledTask = {
1921
2204
  id: string;
1922
2205
  accountId: string;
@@ -1927,10 +2210,12 @@ export type ScheduledTask = {
1927
2210
  temporalScheduleId: string;
1928
2211
  runMode: ScheduledTaskRunMode;
1929
2212
  overlapPolicy: ScheduledTaskOverlapPolicy;
2213
+ action: ScheduledTaskAction;
1930
2214
  agentConfig: ScheduledTaskAgentConfig;
1931
2215
  createdBy?: TurnInitiator | undefined;
1932
2216
  createdByContext?: TurnInitiatorContext | undefined;
1933
2217
  personalConnections?: McpPersonalConnectionSummary[] | undefined;
2218
+ targetSessionId: string | null;
1934
2219
  reusableSessionId: string | null;
1935
2220
  variableSetId: string | null;
1936
2221
  /** @deprecated use variableSetId */
@@ -2038,10 +2323,16 @@ export const KNOWN_PERMISSIONS = [
2038
2323
  "connections:write",
2039
2324
  "environments:manage",
2040
2325
  "environments:use",
2326
+ "variable-sets:list",
2327
+ "variable-sets:read",
2328
+ "variable-sets:write",
2041
2329
  "variable-sets:manage",
2042
2330
  "variable-sets:use",
2331
+ "secrets:list",
2332
+ "secrets:read",
2333
+ "secrets:write",
2043
2334
  "mcp_servers:attach",
2044
- "toolspace:call",
2335
+ "codemode:call",
2045
2336
  "goals:manage",
2046
2337
  "enrollments:read",
2047
2338
  "enrollments:manage",
@@ -2075,6 +2366,7 @@ export type FirstPartyMcpToolName =
2075
2366
  | "sandbox_swap"
2076
2367
  | "run_on"
2077
2368
  | "sandbox_provision"
2369
+ | "connected_machine_remove"
2078
2370
  | "rig_list"
2079
2371
  | "rig_get"
2080
2372
  | "rig_propose_change"
@@ -2089,10 +2381,27 @@ export type FirstPartyMcpToolName =
2089
2381
  | "session_resume"
2090
2382
  | "session_steer"
2091
2383
  | "set_other_session_title"
2384
+ | "interaction_discover"
2385
+ | "browser_open"
2386
+ | "browser_tabs"
2387
+ | "browser_observe"
2388
+ | "browser_act"
2389
+ | "browser_debug"
2390
+ | "browser_identity"
2391
+ | "browser_publish"
2392
+ | "browser_lifecycle"
2393
+ | "computer_open"
2394
+ | "computer_targets"
2395
+ | "computer_observe"
2396
+ | "computer_act"
2397
+ | "computer_lifecycle"
2092
2398
  | "variable_set_list"
2093
2399
  | "environment_list"
2400
+ | "variable_set_get_variable"
2094
2401
  | "variable_set_set_variable"
2095
2402
  | "environment_set_variable"
2403
+ | "capability_catalog_search"
2404
+ | "capability_authorization_request"
2096
2405
  | "github_connect_link"
2097
2406
  | "github_repositories_list"
2098
2407
  | "social_connections_list"
@@ -2103,6 +2412,18 @@ export type FirstPartyMcpToolName =
2103
2412
  | "social_thread_fetch"
2104
2413
  | "social_posts_sync"
2105
2414
  | "social_post_reply"
2415
+ | "x_accounts_list"
2416
+ | "x_search_live"
2417
+ | "x_mentions_live"
2418
+ | "x_thread_fetch"
2419
+ | "x_posts_sync"
2420
+ | "x_post_reply"
2421
+ | "reddit_accounts_list"
2422
+ | "reddit_search_live"
2423
+ | "reddit_mentions_live"
2424
+ | "reddit_thread_fetch"
2425
+ | "reddit_posts_sync"
2426
+ | "reddit_post_reply"
2106
2427
  | "scheduled_tasks_list"
2107
2428
  | "scheduled_tasks_get"
2108
2429
  | "scheduled_tasks_create"
@@ -2121,11 +2442,22 @@ export type FirstPartyMcpToolName =
2121
2442
  | "slack_bot_file_content"
2122
2443
  | "slack_bot_post_message"
2123
2444
  | "slack_bot_delete_message"
2445
+ | "atlassian_sources_list"
2446
+ | "atlassian_search"
2447
+ | "atlassian_get"
2124
2448
  | "artifacts_list"
2125
2449
  | "artifacts_get_source"
2126
2450
  | "artifacts_create"
2127
2451
  | "artifacts_publish"
2128
- | "artifacts_rollback";
2452
+ | "artifacts_rollback"
2453
+ | "editable_artifact_list"
2454
+ | "editable_artifact_create"
2455
+ | "editable_artifact_import"
2456
+ | "editable_artifact_get"
2457
+ | "editable_artifact_inspect"
2458
+ | "editable_artifact_apply"
2459
+ | "editable_artifact_export"
2460
+ | "editable_artifact_export_status";
2129
2461
 
2130
2462
  export type ProductAccessMode = "local" | "configured" | "managed";
2131
2463
 
@@ -2516,7 +2848,7 @@ export type ClientAuthConfig =
2516
2848
 
2517
2849
  // Kept value-identical to @opengeni/contracts and pinned by the SDK contract
2518
2850
  // parity suite. The SDK has no runtime dependency on the Zod contracts package.
2519
- export const OPENGENI_API_CONTRACT_REVISION = "2026-07-workspace-artifacts-v1" as const;
2851
+ export const OPENGENI_API_CONTRACT_REVISION = "2026-08-social-provider-tools-v1" as const;
2520
2852
  export const OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract" as const;
2521
2853
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2522
2854
  export const OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id" as const;
@@ -2736,13 +3068,15 @@ export type WorkspaceSettings = {
2736
3068
  maxNestedAgentDepth?: number | null | undefined;
2737
3069
  /** Default for new Codex sessions; absent ⇒ remote_v2. */
2738
3070
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3071
+ /** Whether agents may invoke the built-in structured human-input tool. */
3072
+ agentHumanInputEnabled?: boolean | undefined;
2739
3073
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
2740
3074
  [key: string]: unknown;
2741
3075
  };
2742
3076
 
2743
3077
  export type WorkspaceSlackReactionSummonSettings = {
2744
3078
  enabled: boolean;
2745
- emoji: string;
3079
+ emoji: "genie";
2746
3080
  channelPolicy: { mode: "bot_member" } | { mode: "allowlist"; channelIds: string[] };
2747
3081
  };
2748
3082
 
@@ -2767,6 +3101,7 @@ export type UpdateWorkspaceSettingsRequest = {
2767
3101
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2768
3102
  maxNestedAgentDepth?: number | null | undefined;
2769
3103
  codexCompactionDefault?: "remote_v2" | "portable" | undefined;
3104
+ agentHumanInputEnabled?: boolean | undefined;
2770
3105
  slackReactionSummon?: WorkspaceSlackReactionSummonSettings | undefined;
2771
3106
  [key: string]: unknown;
2772
3107
  };
@@ -2846,6 +3181,48 @@ export type UpdateWorkspaceMemberRequest = {
2846
3181
  permissions: Permission[];
2847
3182
  };
2848
3183
 
3184
+ export type SlackUserLinkAccessRequestStatus =
3185
+ | "prepared"
3186
+ | "pending"
3187
+ | "completed"
3188
+ | "denied"
3189
+ | "cancelled"
3190
+ | "expired";
3191
+
3192
+ /** Token-free durable projection of one signed Slack identity-link intent. */
3193
+ export type SlackUserLinkAccessRequest = {
3194
+ id: string;
3195
+ workspaceId: string;
3196
+ workspaceDisplayName: string | null;
3197
+ subjectLabel: string | null;
3198
+ status: SlackUserLinkAccessRequestStatus;
3199
+ version: number;
3200
+ expiresAt: string;
3201
+ requestedAt: string | null;
3202
+ decidedAt: string | null;
3203
+ completedAt: string | null;
3204
+ createdAt: string;
3205
+ updatedAt: string;
3206
+ };
3207
+
3208
+ export type PrepareSlackUserLinkAccessRequest = {
3209
+ linkToken: string;
3210
+ };
3211
+
3212
+ export type SlackUserLinkAccessMutationRequest = {
3213
+ expectedVersion: number;
3214
+ idempotencyKey: string;
3215
+ };
3216
+
3217
+ export type ApproveSlackUserLinkAccessRequest = SlackUserLinkAccessMutationRequest & {
3218
+ role?: string | undefined;
3219
+ permissions: Permission[];
3220
+ };
3221
+
3222
+ export type ListSlackUserLinkAccessRequestsResponse = {
3223
+ requests: SlackUserLinkAccessRequest[];
3224
+ };
3225
+
2849
3226
  // --- Goals -------------------------------------------------------------------
2850
3227
 
2851
3228
  export type SessionGoalStatus = "active" | "paused" | "completed";
@@ -2977,6 +3354,7 @@ export type SessionCommandReceipt = {
2977
3354
  export type ComposerDraft = {
2978
3355
  revision: number;
2979
3356
  text: string;
3357
+ annotations?: DraftTimelineAnnotation[] | undefined;
2980
3358
  resources: ResourceRef[];
2981
3359
  model: string;
2982
3360
  reasoningEffort: ReasoningEffort;
@@ -3040,7 +3418,8 @@ export type SessionSystemUpdateKind =
3040
3418
  | "goal_continuation"
3041
3419
  | "agent_message"
3042
3420
  | "agent_steer_instruction"
3043
- | "child_terminal_result";
3421
+ | "child_terminal_result"
3422
+ | "media_generation_result";
3044
3423
 
3045
3424
  export type SessionSystemUpdateState =
3046
3425
  | "pending"
@@ -3175,10 +3554,12 @@ export type ScheduledTaskAgentConfigInput = {
3175
3554
  maxNestedAgentDepth?: number | undefined;
3176
3555
  };
3177
3556
 
3178
- export type CreateScheduledTaskRequest = {
3557
+ export type CreateAgentScheduledTaskRequest = {
3179
3558
  name: string;
3180
3559
  schedule: ScheduledTaskScheduleSpec;
3560
+ action?: { kind: "agent_turn" } | undefined;
3181
3561
  runMode?: ScheduledTaskRunMode | undefined;
3562
+ targetSessionId?: string | null | undefined;
3182
3563
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3183
3564
  agentConfig: ScheduledTaskAgentConfigInput;
3184
3565
  status?: ScheduledTaskStatus | undefined;
@@ -3190,11 +3571,26 @@ export type CreateScheduledTaskRequest = {
3190
3571
  metadata?: Record<string, unknown> | undefined;
3191
3572
  };
3192
3573
 
3574
+ export type CreateKnowledgeSourceSyncScheduledTaskRequest = {
3575
+ name: string;
3576
+ schedule: ScheduledTaskScheduleSpec;
3577
+ action: Extract<ScheduledTaskAction, { kind: "knowledge_source_sync" }>;
3578
+ overlapPolicy?: "skip" | "buffer_one" | undefined;
3579
+ status?: ScheduledTaskStatus | undefined;
3580
+ metadata?: Record<string, unknown> | undefined;
3581
+ };
3582
+
3583
+ export type CreateScheduledTaskRequest =
3584
+ | CreateAgentScheduledTaskRequest
3585
+ | CreateKnowledgeSourceSyncScheduledTaskRequest;
3586
+
3193
3587
  export type UpdateScheduledTaskRequest = {
3194
3588
  name?: string | undefined;
3195
3589
  schedule?: ScheduledTaskScheduleSpec | undefined;
3196
3590
  runMode?: ScheduledTaskRunMode | undefined;
3591
+ targetSessionId?: string | null | undefined;
3197
3592
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3593
+ action?: ScheduledTaskAction | undefined;
3198
3594
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
3199
3595
  status?: ScheduledTaskStatus | undefined;
3200
3596
  variableSetId?: string | null | undefined;
@@ -3205,9 +3601,50 @@ export type UpdateScheduledTaskRequest = {
3205
3601
  metadata?: Record<string, unknown> | undefined;
3206
3602
  };
3207
3603
 
3208
- export type ScheduledTaskRunStatus = "queued" | "dispatched" | "failed";
3604
+ export type ScheduledTaskRunStatus = "queued" | "dispatched" | "succeeded" | "skipped" | "failed";
3605
+
3606
+ export type KnowledgeSourceSyncRunSummary = {
3607
+ phase: "queued" | "inventory" | "transfer" | "index" | "checkpoint" | "completed" | "failed";
3608
+ scanned: number;
3609
+ imported: number;
3610
+ unchanged: number;
3611
+ skipped: number;
3612
+ failed: number;
3613
+ bytes: number;
3614
+ providerRequests: number;
3615
+ elapsedMs: number;
3616
+ indexed: number;
3617
+ aclPending: number;
3618
+ retryable: boolean;
3619
+ limitReached: "items" | "bytes" | "file_bytes" | "provider_requests" | "elapsed_time" | null;
3620
+ checkpointed: boolean;
3621
+ reconnectRequired: boolean;
3622
+ failures: Array<{
3623
+ externalObjectId: string;
3624
+ code:
3625
+ | "authority_changed"
3626
+ | "connection_reconnect_required"
3627
+ | "provider_unavailable"
3628
+ | "provider_rejected"
3629
+ | "provider_payload_invalid"
3630
+ | "content_unsupported"
3631
+ | "content_too_large"
3632
+ | "resource_limit"
3633
+ | "item_processing_failed"
3634
+ | "indexing_failed"
3635
+ | "internal_failure";
3636
+ retryable: boolean;
3637
+ message: string;
3638
+ }>;
3639
+ };
3209
3640
 
3210
- export type ScheduledTaskTriggerType = "scheduled" | "manual";
3641
+ export type ScheduledTaskTriggerType =
3642
+ | "scheduled"
3643
+ | "manual"
3644
+ | "initial"
3645
+ | "provider_event"
3646
+ | "retry"
3647
+ | "repair";
3211
3648
 
3212
3649
  export type ScheduledTaskRun = {
3213
3650
  id: string;
@@ -3220,6 +3657,10 @@ export type ScheduledTaskRun = {
3220
3657
  firedAt: string;
3221
3658
  sessionId: string | null;
3222
3659
  triggerEventId: string | null;
3660
+ actionKind: "agent_turn" | "knowledge_source_sync";
3661
+ knowledgeSyncRunId: string | null;
3662
+ knowledgeSummary: KnowledgeSourceSyncRunSummary | null;
3663
+ completedAt: string | null;
3223
3664
  error: string | null;
3224
3665
  createdAt: string;
3225
3666
  updatedAt: string;
@@ -3227,11 +3668,7 @@ export type ScheduledTaskRun = {
3227
3668
 
3228
3669
  // --- VariableSets -------------------------------------------------------------
3229
3670
 
3230
- /**
3231
- * Variable values are write-only by design: the API never returns a value, so
3232
- * reads expose name + version metadata only. Values are decrypted exclusively
3233
- * inside the worker at sandbox materialization time.
3234
- */
3671
+ /** Generic variable-set reads expose name + version metadata only. */
3235
3672
  export type VariableSetVariableMetadata = {
3236
3673
  name: string;
3237
3674
  version: number;
@@ -3239,6 +3676,14 @@ export type VariableSetVariableMetadata = {
3239
3676
  updatedAt: string;
3240
3677
  };
3241
3678
 
3679
+ /** Dedicated permissioned plaintext response; never embedded in metadata reads. */
3680
+ export type VariableSetSecret = {
3681
+ variableSetId: string;
3682
+ name: string;
3683
+ version: number;
3684
+ value: string;
3685
+ };
3686
+
3242
3687
  export type VariableSet = {
3243
3688
  id: string;
3244
3689
  accountId: string;
@@ -3290,6 +3735,40 @@ export type RigCheck = {
3290
3735
  command: string;
3291
3736
  };
3292
3737
 
3738
+ export type RigProviderImageBuildStatus = "building" | "ready" | "failed" | "unsupported";
3739
+
3740
+ export type RigProviderImage = {
3741
+ backend: SandboxBackend;
3742
+ provider: string;
3743
+ status: RigProviderImageBuildStatus;
3744
+ contentHash: string;
3745
+ setupHash: string;
3746
+ sourceImage: string | null;
3747
+ buildRequestId: string;
3748
+ imageId: string | null;
3749
+ imageDigest: string | null;
3750
+ artifactId: string | null;
3751
+ providerBindingKeyHash: string | null;
3752
+ coldBootValidation?:
3753
+ | {
3754
+ version: 1;
3755
+ checkedAt: string;
3756
+ }
3757
+ | undefined;
3758
+ provenance: {
3759
+ kind: "rig_verification";
3760
+ targetKind: "change" | "version";
3761
+ targetId: string;
3762
+ };
3763
+ startedAt: string;
3764
+ finishedAt: string | null;
3765
+ error: {
3766
+ code: string;
3767
+ message: string;
3768
+ retryable: boolean;
3769
+ } | null;
3770
+ };
3771
+
3293
3772
  export type RigVersion = {
3294
3773
  id: string;
3295
3774
  rigId: string;
@@ -3300,6 +3779,7 @@ export type RigVersion = {
3300
3779
  credentialHooks: string[];
3301
3780
  defaultVariableSetIds: string[];
3302
3781
  changelog: string | null;
3782
+ providerImages: Partial<Record<SandboxBackend, RigProviderImage>>;
3303
3783
  createdBy: string | null;
3304
3784
  active: boolean;
3305
3785
  createdAt: string;
@@ -3412,12 +3892,18 @@ export type FileAsset = {
3412
3892
  /** Mirrors the closed, provider-neutral retained-output contract. */
3413
3893
  export const RETAINED_OUTPUT_DEFAULT_PAGE_BYTES = 256 * 1024;
3414
3894
  export const RETAINED_OUTPUT_MAX_PAGE_BYTES = 1024 * 1024;
3895
+ export const COMPUTER_SCREENSHOT_MAX_BYTES = 32 * 1024 * 1024;
3896
+ export const GENERATED_IMAGE_MAX_BYTES = 64 * 1024 * 1024;
3897
+ export const GENERATED_VIDEO_MAX_BYTES = 512 * 1024 * 1024;
3415
3898
 
3416
3899
  export type RetainedOutputKind =
3417
3900
  | "tool_result"
3418
3901
  | "assistant_completion"
3419
3902
  | "internal_update"
3420
3903
  | "event_media"
3904
+ | "computer_screenshot"
3905
+ | "generated_image"
3906
+ | "generated_video"
3421
3907
  | "file";
3422
3908
 
3423
3909
  export type RetainedOutputUnavailableReason =
@@ -3428,6 +3914,9 @@ export type RetainedOutputUnavailableReason =
3428
3914
  | "deleted"
3429
3915
  | "missing_storage"
3430
3916
  | "storage_write_failed"
3917
+ | "quota_exceeded"
3918
+ | "invalid_content"
3919
+ | "oversized"
3431
3920
  | "unsupported";
3432
3921
 
3433
3922
  export type RetainedArtifactReference = {
@@ -3438,7 +3927,10 @@ export type RetainedArtifactReference = {
3438
3927
  originalBytes: number;
3439
3928
  sha256: string;
3440
3929
  retainedAt: string;
3441
- retention: { policy: "workspace_file"; expiresAt: null };
3930
+ dimensions?: { width: number; height: number } | undefined;
3931
+ retention:
3932
+ | { policy: "workspace_file"; expiresAt: null }
3933
+ | { policy: "session_screenshot"; expiresAt: string };
3442
3934
  retrieval: {
3443
3935
  method: "GET";
3444
3936
  path: string;
@@ -3455,6 +3947,157 @@ export type RetainedArtifactUnavailable = {
3455
3947
 
3456
3948
  export type RetainedArtifactMetadata = RetainedArtifactReference | RetainedArtifactUnavailable;
3457
3949
 
3950
+ export type GeneratedImageReceipt = {
3951
+ type: "generated_image";
3952
+ artifact: RetainedArtifactReference;
3953
+ sandboxPath: string;
3954
+ };
3955
+
3956
+ export type VideoGenerationSourceMode =
3957
+ | "text"
3958
+ | "first_frame"
3959
+ | "first_and_last_frames"
3960
+ | "image_reference"
3961
+ | "video_reference";
3962
+
3963
+ export type VideoGenerationResolution = "480p" | "720p";
3964
+
3965
+ export type VideoGenerationAspectRatio =
3966
+ | "16:9"
3967
+ | "4:3"
3968
+ | "1:1"
3969
+ | "3:4"
3970
+ | "9:16"
3971
+ | "21:9"
3972
+ | "adaptive";
3973
+
3974
+ export type VideoGenerationModelCapability = {
3975
+ modelId: string;
3976
+ label: string;
3977
+ providerLabel: string;
3978
+ sourceModes: VideoGenerationSourceMode[];
3979
+ resolutions: VideoGenerationResolution[];
3980
+ aspectRatios: VideoGenerationAspectRatio[];
3981
+ duration: {
3982
+ minSeconds: number;
3983
+ maxSeconds: number;
3984
+ stepSeconds: number;
3985
+ };
3986
+ supportsAudio: boolean;
3987
+ };
3988
+
3989
+ export type VideoGenerationCapabilities = {
3990
+ schemaVersion: 1;
3991
+ capabilityRevision: string;
3992
+ defaultModelId: string;
3993
+ models: VideoGenerationModelCapability[];
3994
+ };
3995
+
3996
+ export type VideoGenerationPolicy = {
3997
+ schemaVersion: 1;
3998
+ revision: number;
3999
+ fundingSource: VideoGenerationFundingSource;
4000
+ enabledModelIds: string[];
4001
+ defaultModelId: string | null;
4002
+ };
4003
+
4004
+ export type UpdateVideoGenerationPolicyRequest = {
4005
+ expectedRevision: number;
4006
+ fundingSource: VideoGenerationFundingSource;
4007
+ enabledModelIds: string[];
4008
+ defaultModelId: string | null;
4009
+ };
4010
+
4011
+ export type VideoGenerationFundingSource = "opengeni_credits" | "workspace_gateway";
4012
+
4013
+ export type VideoGenerationFundingOption = {
4014
+ source: VideoGenerationFundingSource;
4015
+ label: string;
4016
+ description: string;
4017
+ available: boolean;
4018
+ unavailableReason: string | null;
4019
+ };
4020
+
4021
+ export type WorkspaceVideoGenerationSettings = {
4022
+ schemaVersion: 1;
4023
+ policy: VideoGenerationPolicy;
4024
+ fundingOptions: VideoGenerationFundingOption[];
4025
+ availableModels: VideoGenerationModelCapability[];
4026
+ capabilities: VideoGenerationCapabilities | null;
4027
+ };
4028
+
4029
+ export type GeneratedVideoFacts = {
4030
+ durationSeconds: number;
4031
+ width: number;
4032
+ height: number;
4033
+ fps: number;
4034
+ hasAudio: boolean;
4035
+ videoCodec: "h264";
4036
+ audioCodec: "aac" | null;
4037
+ };
4038
+
4039
+ export type GeneratedVideoReceipt = {
4040
+ type: "generated_video";
4041
+ schemaVersion: 1;
4042
+ operationId: string;
4043
+ artifact: RetainedArtifactReference;
4044
+ video: GeneratedVideoFacts;
4045
+ sandboxPath: string;
4046
+ };
4047
+
4048
+ export type VideoGenerationTerminalFailureStatus =
4049
+ | "provider_failed"
4050
+ | "retention_failed"
4051
+ | "cancelled_before_submit"
4052
+ | "outcome_unknown";
4053
+
4054
+ export type MediaGenerationResult =
4055
+ | {
4056
+ type: "media_generation_result";
4057
+ schemaVersion: 1;
4058
+ status: "ready";
4059
+ operationId: string;
4060
+ receipt: GeneratedVideoReceipt;
4061
+ }
4062
+ | {
4063
+ type: "media_generation_result";
4064
+ schemaVersion: 1;
4065
+ status: VideoGenerationTerminalFailureStatus;
4066
+ operationId: string;
4067
+ boundedPublicReason: string;
4068
+ };
4069
+
4070
+ export type VideoGenerationPublicStatus =
4071
+ | "preparing"
4072
+ | "prepared"
4073
+ | "accepted"
4074
+ | "provider_started"
4075
+ | "retaining"
4076
+ | "completed"
4077
+ | VideoGenerationTerminalFailureStatus;
4078
+
4079
+ export type VideoGenerationOperationSummary = {
4080
+ schemaVersion: 1;
4081
+ operationId: string;
4082
+ modelId: string;
4083
+ status: VideoGenerationPublicStatus;
4084
+ createdAt: string;
4085
+ updatedAt: string;
4086
+ terminal: MediaGenerationResult | null;
4087
+ };
4088
+
4089
+ /** Ephemeral source minted for native browser playback; never persist the URL. */
4090
+ export type VideoArtifactPlaybackSource = {
4091
+ schemaVersion: 1;
4092
+ artifactId: string;
4093
+ url: string;
4094
+ expiresAt: string;
4095
+ contentType: "video/mp4";
4096
+ sizeBytes: number;
4097
+ sha256: string;
4098
+ acceptRanges: "bytes";
4099
+ };
4100
+
3458
4101
  export type RetainedArtifactContentOptions = {
3459
4102
  /** One RFC-style bytes range, for example `bytes=1048576-2097151`. */
3460
4103
  range?: string | undefined;
@@ -3470,6 +4113,25 @@ export type RetainedArtifactContent = {
3470
4113
  acceptRanges: "bytes";
3471
4114
  };
3472
4115
 
4116
+ export type RetainedArtifactDownloadOptions = {
4117
+ signal?: AbortSignal | undefined;
4118
+ /** Retry transient range failures; bounded to 0..3, default 2. */
4119
+ maxRetries?: number | undefined;
4120
+ };
4121
+
4122
+ export type RetainedScreenshotDownloadOptions = RetainedArtifactDownloadOptions;
4123
+
4124
+ export type RetainedScreenshotDownload = {
4125
+ metadata: RetainedArtifactMetadata;
4126
+ /** Null when metadata truth says the screenshot is unavailable. */
4127
+ bytes: Uint8Array | null;
4128
+ };
4129
+
4130
+ export type RetainedArtifactDownload = {
4131
+ artifact: RetainedArtifactReference;
4132
+ bytes: Uint8Array;
4133
+ };
4134
+
3473
4135
  export type CreateFileUploadRequest = {
3474
4136
  filename: string;
3475
4137
  contentType: string;
@@ -3505,6 +4167,8 @@ export type UploadFileInput = {
3505
4167
  contentType: string;
3506
4168
  data: FileUploadData;
3507
4169
  sha256?: string | undefined;
4170
+ /** Optional deadline for the signed object-storage PUT. */
4171
+ timeoutMs?: number | undefined;
3508
4172
  };
3509
4173
 
3510
4174
  // --- Documents -------------------------------------------------------------------
@@ -3811,6 +4475,49 @@ export type CapabilityPackVariableSetSpec = {
3811
4475
  required: boolean;
3812
4476
  };
3813
4477
 
4478
+ export type CapabilityPackComponentReference =
4479
+ | {
4480
+ key: string;
4481
+ kind: "plugin";
4482
+ pluginKey: string;
4483
+ version: string;
4484
+ manifestDigest: string;
4485
+ required: boolean;
4486
+ }
4487
+ | {
4488
+ key: string;
4489
+ kind: "skill";
4490
+ capabilityId: string;
4491
+ contentSha256: string;
4492
+ required: boolean;
4493
+ }
4494
+ | {
4495
+ key: string;
4496
+ kind: "integration";
4497
+ capabilityId: string;
4498
+ instanceKey: string;
4499
+ revisionId: string;
4500
+ contentSha256: string;
4501
+ required: boolean;
4502
+ }
4503
+ | {
4504
+ key: string;
4505
+ kind: "feature";
4506
+ capabilityId: string;
4507
+ instanceKey: string;
4508
+ featureKey: string;
4509
+ bindingKey: string;
4510
+ configDigest: string;
4511
+ required: boolean;
4512
+ };
4513
+
4514
+ export type CapabilityPackRigRequirement = {
4515
+ description?: string | undefined;
4516
+ required: boolean;
4517
+ rigId?: string | undefined;
4518
+ requireVerified: boolean;
4519
+ };
4520
+
3814
4521
  export type CapabilityPack = {
3815
4522
  id: string;
3816
4523
  name: string;
@@ -3825,6 +4532,8 @@ export type CapabilityPack = {
3825
4532
  }
3826
4533
  | undefined;
3827
4534
  skills: CapabilityPackSkill[];
4535
+ components: CapabilityPackComponentReference[];
4536
+ rig?: CapabilityPackRigRequirement | undefined;
3828
4537
  tools: ToolRef[];
3829
4538
  connectors: CapabilityPackConnector[];
3830
4539
  knowledge: CapabilityPackKnowledge[];
@@ -3854,6 +4563,52 @@ export type RegisterCapabilityPackRequest = {
3854
4563
  files: CapabilityPackSkillFile[];
3855
4564
  }[]
3856
4565
  | undefined;
4566
+ components?:
4567
+ | (
4568
+ | {
4569
+ key: string;
4570
+ kind: "plugin";
4571
+ pluginKey: string;
4572
+ version: string;
4573
+ manifestDigest: string;
4574
+ required?: boolean | undefined;
4575
+ }
4576
+ | {
4577
+ key: string;
4578
+ kind: "skill";
4579
+ capabilityId: string;
4580
+ contentSha256: string;
4581
+ required?: boolean | undefined;
4582
+ }
4583
+ | {
4584
+ key: string;
4585
+ kind: "integration";
4586
+ capabilityId: string;
4587
+ instanceKey: string;
4588
+ revisionId: string;
4589
+ contentSha256: string;
4590
+ required?: boolean | undefined;
4591
+ }
4592
+ | {
4593
+ key: string;
4594
+ kind: "feature";
4595
+ capabilityId: string;
4596
+ instanceKey: string;
4597
+ featureKey: string;
4598
+ bindingKey: string;
4599
+ configDigest: string;
4600
+ required?: boolean | undefined;
4601
+ }
4602
+ )[]
4603
+ | undefined;
4604
+ rig?:
4605
+ | {
4606
+ description?: string | undefined;
4607
+ required?: boolean | undefined;
4608
+ rigId?: string | undefined;
4609
+ requireVerified?: boolean | undefined;
4610
+ }
4611
+ | undefined;
3857
4612
  tools?: ToolRef[] | undefined;
3858
4613
  connectors?:
3859
4614
  | {
@@ -3905,7 +4660,7 @@ export type WorkspaceRegisteredPack = {
3905
4660
  updatedAt: string;
3906
4661
  };
3907
4662
 
3908
- export type PackInstallationStatus = "active" | "disabled";
4663
+ export type PackInstallationStatus = "installing" | "active" | "needs_attention" | "disabled";
3909
4664
 
3910
4665
  export type PackInstallation = {
3911
4666
  id: string;
@@ -3913,6 +4668,11 @@ export type PackInstallation = {
3913
4668
  workspaceId: string;
3914
4669
  packId: string;
3915
4670
  status: PackInstallationStatus;
4671
+ version: number;
4672
+ manifestSnapshot: CapabilityPack | null;
4673
+ manifestDigest: string | null;
4674
+ selectedRigId: string | null;
4675
+ installedBySubjectId: string | null;
3916
4676
  metadata: Record<string, unknown>;
3917
4677
  enabledAt: string;
3918
4678
  updatedAt: string;
@@ -3925,6 +4685,82 @@ export type EnablePackRequest = {
3925
4685
  metadata?: Record<string, unknown> | undefined;
3926
4686
  };
3927
4687
 
4688
+ export type PackComponentResolutionStatus = "ready" | "missing" | "mismatch";
4689
+
4690
+ export type PackComponentResolution = {
4691
+ key: string;
4692
+ kind: "plugin" | "skill" | "integration" | "feature" | "inline_skill";
4693
+ capabilityId: string;
4694
+ required: boolean;
4695
+ status: PackComponentResolutionStatus;
4696
+ expectedDigest: string;
4697
+ actualDigest: string | null;
4698
+ resolvedId: string | null;
4699
+ label: string;
4700
+ };
4701
+
4702
+ export type PackRigResolution = {
4703
+ required: boolean;
4704
+ status: "not_required" | "ready" | "missing" | "mismatch" | "unverified";
4705
+ requestedRigId: string | null;
4706
+ rigId: string | null;
4707
+ rigVersionId: string | null;
4708
+ name: string | null;
4709
+ image: string | null;
4710
+ };
4711
+
4712
+ export type PreviewPackInstallationRequest = {
4713
+ rigId?: string | undefined;
4714
+ variableSetId?: string | undefined;
4715
+ };
4716
+
4717
+ export type PackInstallationPreview = {
4718
+ packId: string;
4719
+ packVersion: string;
4720
+ manifestDigest: string;
4721
+ installationVersion: number | null;
4722
+ action: "install" | "update" | "repair";
4723
+ ready: boolean;
4724
+ blockers: string[];
4725
+ components: PackComponentResolution[];
4726
+ rig: PackRigResolution;
4727
+ variableSetId: string | null;
4728
+ legacyInlineSkillCount: number;
4729
+ legacySandboxImage: string | null;
4730
+ };
4731
+
4732
+ export type InstallPackRequest = {
4733
+ expectedManifestDigest: string;
4734
+ expectedInstallationVersion?: number | undefined;
4735
+ rigId?: string | undefined;
4736
+ variableSetId?: string | undefined;
4737
+ idempotencyKey: string;
4738
+ metadata?: Record<string, unknown> | undefined;
4739
+ };
4740
+
4741
+ export type PackUninstallPreview = {
4742
+ packId: string;
4743
+ installed: boolean;
4744
+ installationVersion: number | null;
4745
+ components: Array<{
4746
+ key: string;
4747
+ kind: "plugin" | "skill" | "integration" | "feature" | "inline_skill";
4748
+ capabilityId: string;
4749
+ retainedByOtherOwners: boolean;
4750
+ }>;
4751
+ };
4752
+
4753
+ export type UninstallPackRequest = {
4754
+ expectedInstallationVersion: number;
4755
+ idempotencyKey: string;
4756
+ };
4757
+
4758
+ export type UninstallPackResult = {
4759
+ packId: string;
4760
+ status: "not_installed" | "uninstalled";
4761
+ retainedComponents: string[];
4762
+ };
4763
+
3928
4764
  export type ListPacksResponse = {
3929
4765
  packs: CapabilityPack[];
3930
4766
  installations: PackInstallation[];
@@ -3953,6 +4789,34 @@ export type CapabilityCatalogAuthKind = "oauth2" | "api_key" | "none" | "unknown
3953
4789
 
3954
4790
  export type CapabilityCatalogTier = "verified" | "community";
3955
4791
 
4792
+ export type CapabilityLifecycleStatus =
4793
+ | "available"
4794
+ | "installed"
4795
+ | "connected"
4796
+ | "ready"
4797
+ | "needs_attention"
4798
+ | "unavailable"
4799
+ | "managed";
4800
+
4801
+ export type CapabilityReadiness = "ready" | "setup_required" | "attention" | "unavailable";
4802
+
4803
+ export type CapabilityAction =
4804
+ | "install"
4805
+ | "connect"
4806
+ | "configure"
4807
+ | "update"
4808
+ | "repair"
4809
+ | "disconnect"
4810
+ | "uninstall"
4811
+ | "inspect";
4812
+
4813
+ export type CapabilityLifecycle = {
4814
+ status: CapabilityLifecycleStatus;
4815
+ readiness: CapabilityReadiness;
4816
+ detail: string | null;
4817
+ managedBy: "deployment" | "platform" | "workspace" | null;
4818
+ };
4819
+
3956
4820
  export type CapabilityRuntime = {
3957
4821
  available: boolean;
3958
4822
  mcpServerId?: string | undefined;
@@ -3999,7 +4863,11 @@ export type CapabilityCatalogItem = {
3999
4863
  staleAt: string | null;
4000
4864
  tools: ToolRef[];
4001
4865
  runtime: CapabilityRuntime;
4866
+ lifecycle: CapabilityLifecycle;
4867
+ actions: CapabilityAction[];
4868
+ /** @deprecated Use lifecycle and actions. */
4002
4869
  enabled: boolean;
4870
+ /** @deprecated Use lifecycle.detail. */
4003
4871
  enabledReason: string | null;
4004
4872
  /** The connection backing this enabled installation, or null when none is involved. */
4005
4873
  connectionRef: {
@@ -4072,6 +4940,447 @@ export type DiscoverMcpCapabilitiesResponse = {
4072
4940
  sourceUrl: string;
4073
4941
  };
4074
4942
 
4943
+ export type SkillImportSource = "github" | "skills_sh";
4944
+
4945
+ export type PreviewSkillImportRequest = {
4946
+ url: string;
4947
+ };
4948
+
4949
+ export type SkillImportFileSummary = {
4950
+ path: string;
4951
+ byteSize: number;
4952
+ contentSha256: string;
4953
+ };
4954
+
4955
+ export type SkillImportPreview = {
4956
+ source: SkillImportSource;
4957
+ sourceUrl: string;
4958
+ repositoryUrl: string;
4959
+ owner: string;
4960
+ repository: string;
4961
+ sourcePath: string;
4962
+ sourceCommit: string;
4963
+ name: string;
4964
+ description: string;
4965
+ contentSha256: string;
4966
+ totalBytes: number;
4967
+ files: SkillImportFileSummary[];
4968
+ warnings: string[];
4969
+ installed: boolean;
4970
+ installationVersion: number | null;
4971
+ };
4972
+
4973
+ export type InstallSkillRequest = {
4974
+ url: string;
4975
+ expectedSourceCommit: string;
4976
+ expectedContentSha256: string;
4977
+ expectedInstallationVersion?: number | undefined;
4978
+ };
4979
+
4980
+ export type InstalledSkill = {
4981
+ capabilityId: string;
4982
+ pluginId: string;
4983
+ pluginVersionId: string;
4984
+ facetId: string;
4985
+ pluginInstallationId: string;
4986
+ facetInstallationId: string;
4987
+ installationVersion: number;
4988
+ source: SkillImportSource;
4989
+ sourceUrl: string;
4990
+ sourceCommit: string;
4991
+ contentSha256: string;
4992
+ name: string;
4993
+ status: "installed";
4994
+ };
4995
+
4996
+ export type CapabilityComponentOwner = {
4997
+ kind: "direct" | "plugin" | "pack" | "migration";
4998
+ id: string;
4999
+ removable: boolean;
5000
+ };
5001
+
5002
+ export type SkillUninstallPreview = {
5003
+ capabilityId: string;
5004
+ installed: boolean;
5005
+ installationVersion: number | null;
5006
+ directOwner: CapabilityComponentOwner | null;
5007
+ remainingOwners: CapabilityComponentOwner[];
5008
+ removesRuntimeSkill: boolean;
5009
+ };
5010
+
5011
+ export type UninstallSkillRequest = {
5012
+ expectedInstallationVersion: number;
5013
+ };
5014
+
5015
+ export type UninstallSkillResult = {
5016
+ capabilityId: string;
5017
+ status: "not_installed" | "uninstalled" | "retained_by_other_owners";
5018
+ remainingOwners: CapabilityComponentOwner[];
5019
+ };
5020
+
5021
+ export type ApiIntegrationProtocol = "openapi" | "graphql";
5022
+
5023
+ export type IntegrationFeatureKind =
5024
+ | "tools"
5025
+ | "knowledge_source"
5026
+ | "inbound_trigger"
5027
+ | "delivery_destination"
5028
+ | "identity_link";
5029
+
5030
+ export type IntegrationFeatureStatus = "active" | "paused" | "needs_attention" | "disabled";
5031
+
5032
+ export type IntegrationFeatureDefinitionSummary = {
5033
+ featureKey: string;
5034
+ kind: Exclude<IntegrationFeatureKind, "tools">;
5035
+ configSchema: Record<string, unknown>;
5036
+ capabilities: Record<string, unknown>;
5037
+ };
5038
+
5039
+ export type IntegrationFeatureBindingSummary = {
5040
+ id: string;
5041
+ featureKey: string;
5042
+ kind: Exclude<IntegrationFeatureKind, "tools">;
5043
+ bindingKey: string;
5044
+ displayName: string;
5045
+ connectionId: string | null;
5046
+ status: IntegrationFeatureStatus;
5047
+ config: Record<string, unknown>;
5048
+ version: number;
5049
+ hasCursor: boolean;
5050
+ lastSuccessAt: string | null;
5051
+ lastErrorCode: string | null;
5052
+ createdAt: string;
5053
+ updatedAt: string;
5054
+ };
5055
+
5056
+ export type IntegrationInstanceFeaturesResponse = {
5057
+ capabilityId: string;
5058
+ instanceKey: string;
5059
+ providerDomain: string;
5060
+ connectionId: string | null;
5061
+ features: {
5062
+ definition: IntegrationFeatureDefinitionSummary;
5063
+ binding: IntegrationFeatureBindingSummary | null;
5064
+ }[];
5065
+ };
5066
+
5067
+ export type UpsertIntegrationFeatureRequest = {
5068
+ displayName: string;
5069
+ config?: Record<string, unknown> | undefined;
5070
+ expectedVersion?: number | undefined;
5071
+ idempotencyKey: string;
5072
+ };
5073
+
5074
+ export type MutateIntegrationFeatureRequest = {
5075
+ expectedVersion: number;
5076
+ idempotencyKey: string;
5077
+ };
5078
+
5079
+ export type IntegrationFeatureMutationResult = {
5080
+ capabilityId: string;
5081
+ instanceKey: string;
5082
+ featureKey: string;
5083
+ status: "configured" | "paused" | "active";
5084
+ binding: IntegrationFeatureBindingSummary;
5085
+ };
5086
+
5087
+ export type IntegrationFeatureRemovalResult = {
5088
+ capabilityId: string;
5089
+ instanceKey: string;
5090
+ featureKey: string;
5091
+ status: "not_configured" | "removed" | "retained_by_other_owners";
5092
+ binding: IntegrationFeatureBindingSummary | null;
5093
+ remainingOwners: CapabilityComponentOwner[];
5094
+ };
5095
+
5096
+ export type ApiIntegrationPresetSummary = {
5097
+ id: string;
5098
+ name: string;
5099
+ summary: string;
5100
+ family: "google" | "microsoft";
5101
+ protocol: "openapi";
5102
+ providerDomain: string;
5103
+ scopes: string[];
5104
+ features: IntegrationFeatureDefinitionSummary[];
5105
+ };
5106
+
5107
+ export type ListApiIntegrationPresetsResponse = {
5108
+ presets: ApiIntegrationPresetSummary[];
5109
+ };
5110
+
5111
+ export type ApiIntegrationSource =
5112
+ | { kind: "preset"; presetId: string }
5113
+ | { kind: "openapi"; url: string; baseUrl?: string | undefined }
5114
+ | { kind: "graphql"; endpoint: string; name?: string | undefined }
5115
+ | { kind: "auto"; url: string; baseUrl?: string | undefined };
5116
+
5117
+ export type PreviewApiIntegrationRequest = {
5118
+ source: ApiIntegrationSource;
5119
+ connectionId?: string | undefined;
5120
+ ownership?: ConnectionOwnership | undefined;
5121
+ };
5122
+
5123
+ export type ApiIntegrationOAuthStartRequest = {
5124
+ presetId: string;
5125
+ ownership?: ConnectionOwnership | undefined;
5126
+ connectionId?: string | undefined;
5127
+ returnPath?: string | undefined;
5128
+ };
5129
+
5130
+ export type ApiIntegrationAuthPreview =
5131
+ | { kind: "none" }
5132
+ | { kind: "oauth2"; providerDomain: string; scopes: string[] }
5133
+ | {
5134
+ kind: "api_key";
5135
+ providerDomain: string;
5136
+ carrier: "header" | "query" | "cookie";
5137
+ name: string;
5138
+ }
5139
+ | { kind: "http"; providerDomain: string; scheme: string };
5140
+
5141
+ export type ApiIntegrationToolPreview = {
5142
+ id: string;
5143
+ operationKey: string;
5144
+ name: string;
5145
+ description: string;
5146
+ safety: "read" | "write" | "destructive";
5147
+ approvalMode: "never" | "ask";
5148
+ deprecated: boolean;
5149
+ };
5150
+
5151
+ export type ApiIntegrationPreview = {
5152
+ source: ApiIntegrationSource;
5153
+ presetId: string | null;
5154
+ protocol: ApiIntegrationProtocol;
5155
+ integrationId: string;
5156
+ capabilityId: string;
5157
+ pluginKey: string;
5158
+ serverId: string;
5159
+ name: string;
5160
+ description: string | null;
5161
+ provider: string | null;
5162
+ providerDomain: string;
5163
+ baseUrl: string;
5164
+ sourceUrl: string | null;
5165
+ revisionId: string;
5166
+ contentSha256: string;
5167
+ auth: ApiIntegrationAuthPreview;
5168
+ connectionId: string | null;
5169
+ connectionOwnership: ConnectionOwnership | null;
5170
+ tools: ApiIntegrationToolPreview[];
5171
+ warnings: string[];
5172
+ };
5173
+
5174
+ export type InstallApiIntegrationRequest = {
5175
+ source: ApiIntegrationSource;
5176
+ expectedRevisionId: string;
5177
+ expectedContentSha256: string;
5178
+ connectionId?: string | undefined;
5179
+ ownership?: ConnectionOwnership | undefined;
5180
+ instanceKey?: string | undefined;
5181
+ displayName?: string | undefined;
5182
+ expectedInstanceVersion?: number | undefined;
5183
+ allowedTools?: string[] | undefined;
5184
+ };
5185
+
5186
+ export type InstalledApiIntegration = {
5187
+ capabilityId: string;
5188
+ pluginId: string;
5189
+ pluginVersionId: string;
5190
+ integrationFacetId: string;
5191
+ apiFacetId: string;
5192
+ pluginInstallationId: string;
5193
+ integrationFacetInstallationId: string;
5194
+ apiFacetInstallationId: string;
5195
+ installationVersion: number;
5196
+ instanceId: string;
5197
+ instanceKey: string;
5198
+ displayName: string;
5199
+ instanceVersion: number;
5200
+ revisionId: string;
5201
+ serverId: string;
5202
+ status: "installed";
5203
+ };
5204
+
5205
+ export type ApiIntegrationInstallationSummary = {
5206
+ capabilityId: string;
5207
+ pluginKey: string;
5208
+ installationVersion: number;
5209
+ instanceId: string;
5210
+ instanceKey: string;
5211
+ displayName: string;
5212
+ instanceVersion: number;
5213
+ serverId: string;
5214
+ name: string;
5215
+ description: string | null;
5216
+ protocol: ApiIntegrationProtocol;
5217
+ presetId: string | null;
5218
+ providerDomain: string;
5219
+ baseUrl: string;
5220
+ sourceUrl: string | null;
5221
+ connected: boolean;
5222
+ requiresConnection: boolean;
5223
+ connectionId: string | null;
5224
+ ownership: "workspace" | "personal" | "none";
5225
+ allowedTools: string[];
5226
+ toolCount: number;
5227
+ approvalRequiredToolCount: number;
5228
+ revisionId: string;
5229
+ contentSha256: string;
5230
+ };
5231
+
5232
+ export type ListApiIntegrationsResponse = {
5233
+ integrations: ApiIntegrationInstallationSummary[];
5234
+ };
5235
+
5236
+ export type ApiIntegrationUninstallPreview = {
5237
+ capabilityId: string;
5238
+ instanceKey: string;
5239
+ displayName: string | null;
5240
+ installed: boolean;
5241
+ installationVersion: number | null;
5242
+ instanceVersion: number | null;
5243
+ directOwner: CapabilityComponentOwner | null;
5244
+ remainingOwners: CapabilityComponentOwner[];
5245
+ removesRuntimeIntegration: boolean;
5246
+ removesDefinition: boolean;
5247
+ };
5248
+
5249
+ export type UninstallApiIntegrationRequest = {
5250
+ expectedInstallationVersion: number;
5251
+ expectedInstanceVersion: number;
5252
+ };
5253
+
5254
+ export type UninstallApiIntegrationResult = {
5255
+ capabilityId: string;
5256
+ instanceKey: string;
5257
+ status: "not_installed" | "uninstalled" | "retained_by_other_owners";
5258
+ remainingOwners: CapabilityComponentOwner[];
5259
+ definitionStatus: "retained" | "disabled";
5260
+ };
5261
+
5262
+ export type PluginManifestComponent =
5263
+ | { key: string; kind: "skill"; url: string }
5264
+ | { key: string; kind: "integration"; source: ApiIntegrationSource }
5265
+ | { key: string; kind: "mcp"; serverId: string };
5266
+
5267
+ export type PluginManifest = {
5268
+ schemaVersion: 1;
5269
+ pluginKey: string;
5270
+ version: string;
5271
+ name: string;
5272
+ description: string;
5273
+ category: string;
5274
+ tags: string[];
5275
+ components: PluginManifestComponent[];
5276
+ };
5277
+
5278
+ export type PluginComponentBinding = {
5279
+ connectionId?: string | undefined;
5280
+ instanceKey?: string | undefined;
5281
+ displayName?: string | undefined;
5282
+ };
5283
+
5284
+ export type PreviewPluginRequest = {
5285
+ url: string;
5286
+ bindings?: Record<string, PluginComponentBinding> | undefined;
5287
+ };
5288
+
5289
+ export type PluginComponentPreview = {
5290
+ key: string;
5291
+ kind: "skill" | "integration" | "mcp";
5292
+ name: string;
5293
+ capabilityId: string;
5294
+ digest: string;
5295
+ connectionRequired: boolean;
5296
+ connectionId: string | null;
5297
+ instanceKey: string | null;
5298
+ displayName: string | null;
5299
+ facts: Record<string, unknown>;
5300
+ };
5301
+
5302
+ export type PluginUpdateDiff = {
5303
+ fromVersion: string | null;
5304
+ toVersion: string;
5305
+ added: string[];
5306
+ removed: string[];
5307
+ changed: string[];
5308
+ unchanged: string[];
5309
+ };
5310
+
5311
+ export type PluginPreview = {
5312
+ sourceUrl: string;
5313
+ manifest: PluginManifest;
5314
+ manifestDigest: string;
5315
+ installed: boolean;
5316
+ installationVersion: number | null;
5317
+ components: PluginComponentPreview[];
5318
+ diff: PluginUpdateDiff;
5319
+ };
5320
+
5321
+ export type InstallPluginRequest = {
5322
+ url: string;
5323
+ expectedManifestDigest: string;
5324
+ expectedComponents: Array<{ key: string; digest: string }>;
5325
+ bindings?: Record<string, PluginComponentBinding> | undefined;
5326
+ idempotencyKey: string;
5327
+ expectedInstallationVersion?: number | undefined;
5328
+ };
5329
+
5330
+ export type InstalledPlugin = {
5331
+ pluginKey: string;
5332
+ version: string;
5333
+ pluginId: string;
5334
+ pluginVersionId: string;
5335
+ pluginInstallationId: string;
5336
+ installationVersion: number;
5337
+ componentCount: number;
5338
+ status: "installed";
5339
+ };
5340
+
5341
+ export type PluginInstallationSummary = {
5342
+ pluginKey: string;
5343
+ version: string;
5344
+ name: string;
5345
+ description: string;
5346
+ category: string;
5347
+ tags: string[];
5348
+ sourceUrl: string | null;
5349
+ manifestDigest: string;
5350
+ installationVersion: number;
5351
+ componentCount: number;
5352
+ status: "active" | "needs_attention";
5353
+ installedAt: string;
5354
+ updatedAt: string;
5355
+ };
5356
+
5357
+ export type ListInstalledPluginsResponse = {
5358
+ plugins: PluginInstallationSummary[];
5359
+ };
5360
+
5361
+ export type PluginUninstallPreview = {
5362
+ pluginKey: string;
5363
+ installed: boolean;
5364
+ version: string | null;
5365
+ installationVersion: number | null;
5366
+ components: Array<{
5367
+ capabilityId: string;
5368
+ kind: "skill" | "integration" | "mcp";
5369
+ retainedByOtherOwners: boolean;
5370
+ }>;
5371
+ };
5372
+
5373
+ export type UninstallPluginRequest = {
5374
+ expectedInstallationVersion: number;
5375
+ idempotencyKey: string;
5376
+ };
5377
+
5378
+ export type UninstallPluginResult = {
5379
+ pluginKey: string;
5380
+ status: "not_installed" | "uninstalled";
5381
+ retainedComponents: string[];
5382
+ };
5383
+
4075
5384
  // --- GitHub ---------------------------------------------------------------------
4076
5385
 
4077
5386
  export type GitHubRepository = {
@@ -4168,6 +5477,10 @@ export const KNOWN_USAGE_EVENT_TYPES = [
4168
5477
  "file.deleted",
4169
5478
  "document.indexed",
4170
5479
  "scheduled_task.fired",
5480
+ "knowledge_source_sync.fired",
5481
+ "knowledge_source_sync.completed",
5482
+ "knowledge_source_sync.items",
5483
+ "knowledge_source_sync.bytes",
4171
5484
  "api_key.request",
4172
5485
  // sandbox warm-time metering (P2.1) — mirrors contracts UsageEventType.
4173
5486
  "sandbox.warm_seconds",
@@ -4213,6 +5526,8 @@ export type InsightsRange = "today" | "week" | "month" | "ytd";
4213
5526
 
4214
5527
  export type InsightsBillingPath = "opengeni_credits" | "external";
4215
5528
 
5529
+ export type InsightsPricingSource = "configured_list_price" | "gateway_reported";
5530
+
4216
5531
  export type InsightsModelUsageRow = {
4217
5532
  id: string;
4218
5533
  model: string;
@@ -4222,17 +5537,32 @@ export type InsightsModelUsageRow = {
4222
5537
  inputTokens: number;
4223
5538
  outputTokens: number;
4224
5539
  cachedTokens: number;
5540
+ cacheInputTokens: number;
4225
5541
  cacheWriteTokens: number;
4226
5542
  reasoningTokens: number;
5543
+ totalTokens: number;
5544
+ tokenKnownCalls: number;
5545
+ cacheKnownCalls: number;
4227
5546
  creditUsd: number;
5547
+ estimatedProviderUsd: number;
5548
+ estimatedProviderCostKnownCalls: number;
4228
5549
  };
4229
5550
 
4230
5551
  export type InsightsSeriesPoint = {
4231
5552
  label: string;
4232
5553
  modelCostUsd: number;
5554
+ estimatedProviderUsd: number;
5555
+ estimatedProviderCostKnownCalls: number;
4233
5556
  warmSeconds: number;
4234
5557
  inputTokens: number;
5558
+ outputTokens: number;
4235
5559
  cachedTokens: number;
5560
+ cacheInputTokens: number;
5561
+ cacheWriteTokens: number;
5562
+ reasoningTokens: number;
5563
+ totalTokens: number;
5564
+ tokenKnownCalls: number;
5565
+ cacheKnownCalls: number;
4236
5566
  cacheHitPct: number;
4237
5567
  calls: number;
4238
5568
  };
@@ -4252,9 +5582,12 @@ export type InsightsSpendDriver = {
4252
5582
  groupBy: "root_session" | "schedule";
4253
5583
  label: string;
4254
5584
  creditUsd: number;
5585
+ estimatedProviderUsd: number;
5586
+ estimatedProviderCostKnownCalls: number;
4255
5587
  tokens: number;
4256
5588
  cacheHitPct: number;
4257
5589
  pctOfCreditUsd: number;
5590
+ pctOfTokens: number;
4258
5591
  deltaUsdVsPrior: number;
4259
5592
  };
4260
5593
 
@@ -4294,17 +5627,44 @@ export type InsightsScheduleRow = {
4294
5627
  name: string;
4295
5628
  fires: number;
4296
5629
  creditUsd: number | null;
5630
+ estimatedProviderUsd: number | null;
5631
+ estimatedProviderCostKnownCalls: number | null;
4297
5632
  tokens: number | null;
4298
5633
  cacheHitPct: number | null;
4299
5634
  billing: InsightsBillingPath | null;
4300
5635
  };
4301
5636
 
5637
+ export type InsightsModelCallRow = {
5638
+ id: string;
5639
+ occurredAt: string;
5640
+ recordedAt: string;
5641
+ sessionId: string;
5642
+ sessionTitle: string;
5643
+ turnId: string;
5644
+ provider: string;
5645
+ providerApi: string;
5646
+ model: string;
5647
+ billing: InsightsBillingPath;
5648
+ inputTokens: number | null;
5649
+ outputTokens: number | null;
5650
+ cachedTokens: number | null;
5651
+ cacheWriteTokens: number | null;
5652
+ reasoningTokens: number | null;
5653
+ totalTokens: number | null;
5654
+ creditUsd: number;
5655
+ estimatedProviderUsd: number | null;
5656
+ pricingSource: InsightsPricingSource | null;
5657
+ };
5658
+
4302
5659
  export type WorkspaceInsightsSnapshot = {
4303
5660
  range: InsightsRange;
4304
5661
  rangeLabel: string;
4305
5662
  priorLabel: string;
4306
5663
  seriesLabel: string;
4307
5664
  cacheSeriesLabel: string;
5665
+ windowStart: string;
5666
+ windowEnd: string;
5667
+ generatedAt: string;
4308
5668
  timezone: "UTC";
4309
5669
  models: InsightsModelUsageRow[];
4310
5670
  facets: InsightsModelFacet[];
@@ -4312,6 +5672,7 @@ export type WorkspaceInsightsSnapshot = {
4312
5672
  depth: InsightsDepthBucket[];
4313
5673
  drivers: InsightsSpendDriver[];
4314
5674
  schedules: InsightsScheduleRow[];
5675
+ recentCalls: InsightsModelCallRow[];
4315
5676
  warmSeconds: number;
4316
5677
  priorWarmSeconds: number;
4317
5678
  warmGroups: InsightsWarmGroupRow[];
@@ -4323,7 +5684,13 @@ export type WorkspaceInsightsSnapshot = {
4323
5684
  priorWorkspaceCreditUsd: number;
4324
5685
  creditUsd: number;
4325
5686
  priorCreditUsd: number;
5687
+ estimatedProviderUsd: number;
5688
+ priorEstimatedProviderUsd: number;
5689
+ estimatedProviderCostKnownCalls: number;
5690
+ priorEstimatedProviderCostKnownCalls: number;
5691
+ modelCalls: number;
4326
5692
  priorInputTokens: number;
5693
+ priorTotalTokens: number;
4327
5694
  priorCacheHitPct: number;
4328
5695
  priorCalls: number;
4329
5696
  goalsActive: number;
@@ -4369,6 +5736,7 @@ export type UserMessageEventInput = {
4369
5736
  clientEventId?: string | undefined;
4370
5737
  payload: {
4371
5738
  text: string;
5739
+ annotations?: SubmittedTimelineAnnotation[] | undefined;
4372
5740
  turnInstructions?: string | undefined;
4373
5741
  resources?: ResourceRef[] | undefined;
4374
5742
  model?: string | undefined;
@@ -4478,6 +5846,34 @@ export type MachineMetricsSeriesResponse = {
4478
5846
  samples: MetricSample[];
4479
5847
  };
4480
5848
 
5849
+ /** POST /v1/workspaces/:ws/enrollments/:id/revoke body. */
5850
+ export type RemoveEnrollmentRequest = {
5851
+ expectedUpdatedAt?: string;
5852
+ idempotencyKey?: string;
5853
+ };
5854
+
5855
+ /** Typed removal/revocation outcome. Blocked outcomes preserve the exact
5856
+ * dependency and the action needed to make removal safe. */
5857
+ export type RemoveEnrollmentResponse = {
5858
+ revoked: boolean;
5859
+ outcome: "removed" | "already_removed" | "blocked";
5860
+ enrollmentId: string;
5861
+ machineName: string | null;
5862
+ lastSeenAt: string | null;
5863
+ revokedAt: string | null;
5864
+ code:
5865
+ | "active_route"
5866
+ | "active_commands"
5867
+ | "machine_home"
5868
+ | "active_lease"
5869
+ | "recovery_pending"
5870
+ | "not_selfhosted"
5871
+ | null;
5872
+ message: string;
5873
+ action: string;
5874
+ dependentSessions: Array<{ id: string; title: string | null }>;
5875
+ };
5876
+
4481
5877
  /** POST /v1/workspaces/:ws/sessions/:sessionId/active-sandbox — swap a session's
4482
5878
  * active sandbox. `target` is a `MachineView.sandboxId`, or "session"/"default"
4483
5879
  * to swap back to the session's own group box. */
@@ -4508,8 +5904,9 @@ export type SwapActiveSandboxResponse = {
4508
5904
 
4509
5905
  // ── Self-hosted enrollment UX (design 11) ────────────────────────────────────
4510
5906
  // Hand-written mirrors of the `@opengeni/contracts` enrollment-UX request/response
4511
- // shapes (the SDK keeps zero runtime deps). The click-Grant approve-page
4512
- // lookup/deny + the headless enroll-token mint/exchange.
5907
+ // shapes. They remain type-only so ordinary SDK entries do not reach the contracts
5908
+ // runtime. The click-Grant approve-page lookup/deny + the headless enroll-token
5909
+ // mint/exchange.
4513
5910
 
4514
5911
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
4515
5912
  export type EnrollmentOs = "linux" | "macos" | "windows";