@opengeni/sdk 0.48.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 (99) hide show
  1. package/README.md +93 -1
  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-MBGBLVUV.js → chunk-ILQZR5N6.js} +1088 -577
  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 +150 -16
  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 +1 -1
  65. package/dist/terminal.d.ts +1 -1
  66. package/dist/types.d.ts +1128 -18
  67. package/dist/workspace-control-stream.d.ts +2 -2
  68. package/dist/workspace-state.d.ts +1 -1
  69. package/package.json +29 -3
  70. package/src/artifact-client.ts +129 -0
  71. package/src/artifacts.ts +17 -0
  72. package/src/client.ts +1511 -200
  73. package/src/company-profile.ts +92 -0
  74. package/src/editable-artifact-resources.ts +119 -0
  75. package/src/editable-artifacts/browser-session.ts +176 -0
  76. package/src/editable-artifacts/controller.ts +2632 -0
  77. package/src/editable-artifacts/errors.ts +52 -0
  78. package/src/editable-artifacts/http-live-transport.ts +1449 -0
  79. package/src/editable-artifacts/index.ts +175 -0
  80. package/src/editable-artifacts/pool.ts +81 -0
  81. package/src/editable-artifacts/session.ts +778 -0
  82. package/src/editable-artifacts/storage.ts +1718 -0
  83. package/src/editable-artifacts/types.ts +499 -0
  84. package/src/editable-artifacts/worker/browser-client.ts +1167 -0
  85. package/src/editable-artifacts/worker/browser-entry.ts +57 -0
  86. package/src/editable-artifacts/worker/kernel-adapter.ts +1039 -0
  87. package/src/editable-artifacts/worker/rpc-protocol.ts +622 -0
  88. package/src/editable-artifacts/worker/runtime.ts +1204 -0
  89. package/src/editable-artifacts/worker/wire-codec.ts +852 -0
  90. package/src/editable-artifacts-worker.ts +8 -0
  91. package/src/editable-artifacts.ts +6 -0
  92. package/src/index.ts +185 -0
  93. package/src/interaction.ts +1830 -0
  94. package/src/memory-slack-client.ts +71 -0
  95. package/src/memory-slack-delivery.ts +128 -0
  96. package/src/memory-slack.ts +19 -0
  97. package/src/retained-artifacts.ts +326 -0
  98. package/src/types.ts +1343 -28
  99. package/dist/chunk-MBGBLVUV.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;
748
855
  readPolicy: GoogleDriveReadPolicy;
749
856
  };
750
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;
879
+ readPolicy: GoogleDriveReadPolicy;
880
+ };
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";
@@ -1653,6 +1876,9 @@ export type GitStatusRequest = { path?: string };
1653
1876
  export type GitStatusResponse = {
1654
1877
  isRepo: boolean;
1655
1878
  head: string | null;
1879
+ /** Exact commit object identity. null for unborn/non-repositories; absent on
1880
+ * legacy adapters. */
1881
+ headOid?: string | null | undefined;
1656
1882
  detached: boolean;
1657
1883
  upstream: string | null;
1658
1884
  ahead: number;
@@ -1761,6 +1987,9 @@ export type WorkspaceCaptureFile = {
1761
1987
  export type WorkspaceCaptureRepo = {
1762
1988
  root: string;
1763
1989
  head: string | null;
1990
+ /** Exact HEAD commit object identity. null for unborn repositories; absent
1991
+ * on legacy captures. */
1992
+ headOid?: string | null | undefined;
1764
1993
  detached: boolean;
1765
1994
  upstream: string | null;
1766
1995
  ahead: number;
@@ -1904,6 +2133,7 @@ export type ScheduledTaskDayOfWeek =
1904
2133
  | "SATURDAY";
1905
2134
 
1906
2135
  export type ScheduledTaskScheduleSpec =
2136
+ | { type: "manual" }
1907
2137
  | { type: "once"; runAt: string; timeZone: string }
1908
2138
  | {
1909
2139
  type: "interval";
@@ -1932,6 +2162,44 @@ export type ScheduledTaskAgentConfig = {
1932
2162
  maxNestedAgentDepth?: number | undefined;
1933
2163
  };
1934
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
+
1935
2203
  export type ScheduledTask = {
1936
2204
  id: string;
1937
2205
  accountId: string;
@@ -1942,6 +2210,7 @@ export type ScheduledTask = {
1942
2210
  temporalScheduleId: string;
1943
2211
  runMode: ScheduledTaskRunMode;
1944
2212
  overlapPolicy: ScheduledTaskOverlapPolicy;
2213
+ action: ScheduledTaskAction;
1945
2214
  agentConfig: ScheduledTaskAgentConfig;
1946
2215
  createdBy?: TurnInitiator | undefined;
1947
2216
  createdByContext?: TurnInitiatorContext | undefined;
@@ -2063,7 +2332,7 @@ export const KNOWN_PERMISSIONS = [
2063
2332
  "secrets:read",
2064
2333
  "secrets:write",
2065
2334
  "mcp_servers:attach",
2066
- "toolspace:call",
2335
+ "codemode:call",
2067
2336
  "goals:manage",
2068
2337
  "enrollments:read",
2069
2338
  "enrollments:manage",
@@ -2098,7 +2367,6 @@ export type FirstPartyMcpToolName =
2098
2367
  | "run_on"
2099
2368
  | "sandbox_provision"
2100
2369
  | "connected_machine_remove"
2101
- | "connected_machine_remove"
2102
2370
  | "rig_list"
2103
2371
  | "rig_get"
2104
2372
  | "rig_propose_change"
@@ -2113,11 +2381,27 @@ export type FirstPartyMcpToolName =
2113
2381
  | "session_resume"
2114
2382
  | "session_steer"
2115
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"
2116
2398
  | "variable_set_list"
2117
2399
  | "environment_list"
2118
2400
  | "variable_set_get_variable"
2119
2401
  | "variable_set_set_variable"
2120
2402
  | "environment_set_variable"
2403
+ | "capability_catalog_search"
2404
+ | "capability_authorization_request"
2121
2405
  | "github_connect_link"
2122
2406
  | "github_repositories_list"
2123
2407
  | "social_connections_list"
@@ -2128,6 +2412,18 @@ export type FirstPartyMcpToolName =
2128
2412
  | "social_thread_fetch"
2129
2413
  | "social_posts_sync"
2130
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"
2131
2427
  | "scheduled_tasks_list"
2132
2428
  | "scheduled_tasks_get"
2133
2429
  | "scheduled_tasks_create"
@@ -2146,11 +2442,22 @@ export type FirstPartyMcpToolName =
2146
2442
  | "slack_bot_file_content"
2147
2443
  | "slack_bot_post_message"
2148
2444
  | "slack_bot_delete_message"
2445
+ | "atlassian_sources_list"
2446
+ | "atlassian_search"
2447
+ | "atlassian_get"
2149
2448
  | "artifacts_list"
2150
2449
  | "artifacts_get_source"
2151
2450
  | "artifacts_create"
2152
2451
  | "artifacts_publish"
2153
- | "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";
2154
2461
 
2155
2462
  export type ProductAccessMode = "local" | "configured" | "managed";
2156
2463
 
@@ -2541,7 +2848,7 @@ export type ClientAuthConfig =
2541
2848
 
2542
2849
  // Kept value-identical to @opengeni/contracts and pinned by the SDK contract
2543
2850
  // parity suite. The SDK has no runtime dependency on the Zod contracts package.
2544
- 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;
2545
2852
  export const OPENGENI_API_CONTRACT_HEADER = "x-opengeni-api-contract" as const;
2546
2853
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2547
2854
  export const OPENGENI_CORRELATION_HEADER = "x-opengeni-correlation-id" as const;
@@ -2769,7 +3076,7 @@ export type WorkspaceSettings = {
2769
3076
 
2770
3077
  export type WorkspaceSlackReactionSummonSettings = {
2771
3078
  enabled: boolean;
2772
- emoji: string;
3079
+ emoji: "genie";
2773
3080
  channelPolicy: { mode: "bot_member" } | { mode: "allowlist"; channelIds: string[] };
2774
3081
  };
2775
3082
 
@@ -2874,6 +3181,48 @@ export type UpdateWorkspaceMemberRequest = {
2874
3181
  permissions: Permission[];
2875
3182
  };
2876
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
+
2877
3226
  // --- Goals -------------------------------------------------------------------
2878
3227
 
2879
3228
  export type SessionGoalStatus = "active" | "paused" | "completed";
@@ -3005,6 +3354,7 @@ export type SessionCommandReceipt = {
3005
3354
  export type ComposerDraft = {
3006
3355
  revision: number;
3007
3356
  text: string;
3357
+ annotations?: DraftTimelineAnnotation[] | undefined;
3008
3358
  resources: ResourceRef[];
3009
3359
  model: string;
3010
3360
  reasoningEffort: ReasoningEffort;
@@ -3068,7 +3418,8 @@ export type SessionSystemUpdateKind =
3068
3418
  | "goal_continuation"
3069
3419
  | "agent_message"
3070
3420
  | "agent_steer_instruction"
3071
- | "child_terminal_result";
3421
+ | "child_terminal_result"
3422
+ | "media_generation_result";
3072
3423
 
3073
3424
  export type SessionSystemUpdateState =
3074
3425
  | "pending"
@@ -3203,9 +3554,10 @@ export type ScheduledTaskAgentConfigInput = {
3203
3554
  maxNestedAgentDepth?: number | undefined;
3204
3555
  };
3205
3556
 
3206
- export type CreateScheduledTaskRequest = {
3557
+ export type CreateAgentScheduledTaskRequest = {
3207
3558
  name: string;
3208
3559
  schedule: ScheduledTaskScheduleSpec;
3560
+ action?: { kind: "agent_turn" } | undefined;
3209
3561
  runMode?: ScheduledTaskRunMode | undefined;
3210
3562
  targetSessionId?: string | null | undefined;
3211
3563
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
@@ -3219,12 +3571,26 @@ export type CreateScheduledTaskRequest = {
3219
3571
  metadata?: Record<string, unknown> | undefined;
3220
3572
  };
3221
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
+
3222
3587
  export type UpdateScheduledTaskRequest = {
3223
3588
  name?: string | undefined;
3224
3589
  schedule?: ScheduledTaskScheduleSpec | undefined;
3225
3590
  runMode?: ScheduledTaskRunMode | undefined;
3226
3591
  targetSessionId?: string | null | undefined;
3227
3592
  overlapPolicy?: ScheduledTaskOverlapPolicy | undefined;
3593
+ action?: ScheduledTaskAction | undefined;
3228
3594
  agentConfig?: ScheduledTaskAgentConfigInput | undefined;
3229
3595
  status?: ScheduledTaskStatus | undefined;
3230
3596
  variableSetId?: string | null | undefined;
@@ -3235,9 +3601,50 @@ export type UpdateScheduledTaskRequest = {
3235
3601
  metadata?: Record<string, unknown> | undefined;
3236
3602
  };
3237
3603
 
3238
- 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
+ };
3239
3640
 
3240
- export type ScheduledTaskTriggerType = "scheduled" | "manual";
3641
+ export type ScheduledTaskTriggerType =
3642
+ | "scheduled"
3643
+ | "manual"
3644
+ | "initial"
3645
+ | "provider_event"
3646
+ | "retry"
3647
+ | "repair";
3241
3648
 
3242
3649
  export type ScheduledTaskRun = {
3243
3650
  id: string;
@@ -3250,6 +3657,10 @@ export type ScheduledTaskRun = {
3250
3657
  firedAt: string;
3251
3658
  sessionId: string | null;
3252
3659
  triggerEventId: string | null;
3660
+ actionKind: "agent_turn" | "knowledge_source_sync";
3661
+ knowledgeSyncRunId: string | null;
3662
+ knowledgeSummary: KnowledgeSourceSyncRunSummary | null;
3663
+ completedAt: string | null;
3253
3664
  error: string | null;
3254
3665
  createdAt: string;
3255
3666
  updatedAt: string;
@@ -3324,6 +3735,40 @@ export type RigCheck = {
3324
3735
  command: string;
3325
3736
  };
3326
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
+
3327
3772
  export type RigVersion = {
3328
3773
  id: string;
3329
3774
  rigId: string;
@@ -3334,6 +3779,7 @@ export type RigVersion = {
3334
3779
  credentialHooks: string[];
3335
3780
  defaultVariableSetIds: string[];
3336
3781
  changelog: string | null;
3782
+ providerImages: Partial<Record<SandboxBackend, RigProviderImage>>;
3337
3783
  createdBy: string | null;
3338
3784
  active: boolean;
3339
3785
  createdAt: string;
@@ -3447,6 +3893,8 @@ export type FileAsset = {
3447
3893
  export const RETAINED_OUTPUT_DEFAULT_PAGE_BYTES = 256 * 1024;
3448
3894
  export const RETAINED_OUTPUT_MAX_PAGE_BYTES = 1024 * 1024;
3449
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;
3450
3898
 
3451
3899
  export type RetainedOutputKind =
3452
3900
  | "tool_result"
@@ -3454,6 +3902,8 @@ export type RetainedOutputKind =
3454
3902
  | "internal_update"
3455
3903
  | "event_media"
3456
3904
  | "computer_screenshot"
3905
+ | "generated_image"
3906
+ | "generated_video"
3457
3907
  | "file";
3458
3908
 
3459
3909
  export type RetainedOutputUnavailableReason =
@@ -3497,6 +3947,157 @@ export type RetainedArtifactUnavailable = {
3497
3947
 
3498
3948
  export type RetainedArtifactMetadata = RetainedArtifactReference | RetainedArtifactUnavailable;
3499
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
+
3500
4101
  export type RetainedArtifactContentOptions = {
3501
4102
  /** One RFC-style bytes range, for example `bytes=1048576-2097151`. */
3502
4103
  range?: string | undefined;
@@ -3512,18 +4113,25 @@ export type RetainedArtifactContent = {
3512
4113
  acceptRanges: "bytes";
3513
4114
  };
3514
4115
 
3515
- export type RetainedScreenshotDownloadOptions = {
4116
+ export type RetainedArtifactDownloadOptions = {
3516
4117
  signal?: AbortSignal | undefined;
3517
4118
  /** Retry transient range failures; bounded to 0..3, default 2. */
3518
4119
  maxRetries?: number | undefined;
3519
4120
  };
3520
4121
 
4122
+ export type RetainedScreenshotDownloadOptions = RetainedArtifactDownloadOptions;
4123
+
3521
4124
  export type RetainedScreenshotDownload = {
3522
4125
  metadata: RetainedArtifactMetadata;
3523
4126
  /** Null when metadata truth says the screenshot is unavailable. */
3524
4127
  bytes: Uint8Array | null;
3525
4128
  };
3526
4129
 
4130
+ export type RetainedArtifactDownload = {
4131
+ artifact: RetainedArtifactReference;
4132
+ bytes: Uint8Array;
4133
+ };
4134
+
3527
4135
  export type CreateFileUploadRequest = {
3528
4136
  filename: string;
3529
4137
  contentType: string;
@@ -3867,6 +4475,49 @@ export type CapabilityPackVariableSetSpec = {
3867
4475
  required: boolean;
3868
4476
  };
3869
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
+
3870
4521
  export type CapabilityPack = {
3871
4522
  id: string;
3872
4523
  name: string;
@@ -3881,6 +4532,8 @@ export type CapabilityPack = {
3881
4532
  }
3882
4533
  | undefined;
3883
4534
  skills: CapabilityPackSkill[];
4535
+ components: CapabilityPackComponentReference[];
4536
+ rig?: CapabilityPackRigRequirement | undefined;
3884
4537
  tools: ToolRef[];
3885
4538
  connectors: CapabilityPackConnector[];
3886
4539
  knowledge: CapabilityPackKnowledge[];
@@ -3910,6 +4563,52 @@ export type RegisterCapabilityPackRequest = {
3910
4563
  files: CapabilityPackSkillFile[];
3911
4564
  }[]
3912
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;
3913
4612
  tools?: ToolRef[] | undefined;
3914
4613
  connectors?:
3915
4614
  | {
@@ -3961,7 +4660,7 @@ export type WorkspaceRegisteredPack = {
3961
4660
  updatedAt: string;
3962
4661
  };
3963
4662
 
3964
- export type PackInstallationStatus = "active" | "disabled";
4663
+ export type PackInstallationStatus = "installing" | "active" | "needs_attention" | "disabled";
3965
4664
 
3966
4665
  export type PackInstallation = {
3967
4666
  id: string;
@@ -3969,6 +4668,11 @@ export type PackInstallation = {
3969
4668
  workspaceId: string;
3970
4669
  packId: string;
3971
4670
  status: PackInstallationStatus;
4671
+ version: number;
4672
+ manifestSnapshot: CapabilityPack | null;
4673
+ manifestDigest: string | null;
4674
+ selectedRigId: string | null;
4675
+ installedBySubjectId: string | null;
3972
4676
  metadata: Record<string, unknown>;
3973
4677
  enabledAt: string;
3974
4678
  updatedAt: string;
@@ -3981,6 +4685,82 @@ export type EnablePackRequest = {
3981
4685
  metadata?: Record<string, unknown> | undefined;
3982
4686
  };
3983
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
+
3984
4764
  export type ListPacksResponse = {
3985
4765
  packs: CapabilityPack[];
3986
4766
  installations: PackInstallation[];
@@ -4009,6 +4789,34 @@ export type CapabilityCatalogAuthKind = "oauth2" | "api_key" | "none" | "unknown
4009
4789
 
4010
4790
  export type CapabilityCatalogTier = "verified" | "community";
4011
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
+
4012
4820
  export type CapabilityRuntime = {
4013
4821
  available: boolean;
4014
4822
  mcpServerId?: string | undefined;
@@ -4055,7 +4863,11 @@ export type CapabilityCatalogItem = {
4055
4863
  staleAt: string | null;
4056
4864
  tools: ToolRef[];
4057
4865
  runtime: CapabilityRuntime;
4866
+ lifecycle: CapabilityLifecycle;
4867
+ actions: CapabilityAction[];
4868
+ /** @deprecated Use lifecycle and actions. */
4058
4869
  enabled: boolean;
4870
+ /** @deprecated Use lifecycle.detail. */
4059
4871
  enabledReason: string | null;
4060
4872
  /** The connection backing this enabled installation, or null when none is involved. */
4061
4873
  connectionRef: {
@@ -4128,6 +4940,447 @@ export type DiscoverMcpCapabilitiesResponse = {
4128
4940
  sourceUrl: string;
4129
4941
  };
4130
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
+
4131
5384
  // --- GitHub ---------------------------------------------------------------------
4132
5385
 
4133
5386
  export type GitHubRepository = {
@@ -4224,6 +5477,10 @@ export const KNOWN_USAGE_EVENT_TYPES = [
4224
5477
  "file.deleted",
4225
5478
  "document.indexed",
4226
5479
  "scheduled_task.fired",
5480
+ "knowledge_source_sync.fired",
5481
+ "knowledge_source_sync.completed",
5482
+ "knowledge_source_sync.items",
5483
+ "knowledge_source_sync.bytes",
4227
5484
  "api_key.request",
4228
5485
  // sandbox warm-time metering (P2.1) — mirrors contracts UsageEventType.
4229
5486
  "sandbox.warm_seconds",
@@ -4269,6 +5526,8 @@ export type InsightsRange = "today" | "week" | "month" | "ytd";
4269
5526
 
4270
5527
  export type InsightsBillingPath = "opengeni_credits" | "external";
4271
5528
 
5529
+ export type InsightsPricingSource = "configured_list_price" | "gateway_reported";
5530
+
4272
5531
  export type InsightsModelUsageRow = {
4273
5532
  id: string;
4274
5533
  model: string;
@@ -4278,17 +5537,32 @@ export type InsightsModelUsageRow = {
4278
5537
  inputTokens: number;
4279
5538
  outputTokens: number;
4280
5539
  cachedTokens: number;
5540
+ cacheInputTokens: number;
4281
5541
  cacheWriteTokens: number;
4282
5542
  reasoningTokens: number;
5543
+ totalTokens: number;
5544
+ tokenKnownCalls: number;
5545
+ cacheKnownCalls: number;
4283
5546
  creditUsd: number;
5547
+ estimatedProviderUsd: number;
5548
+ estimatedProviderCostKnownCalls: number;
4284
5549
  };
4285
5550
 
4286
5551
  export type InsightsSeriesPoint = {
4287
5552
  label: string;
4288
5553
  modelCostUsd: number;
5554
+ estimatedProviderUsd: number;
5555
+ estimatedProviderCostKnownCalls: number;
4289
5556
  warmSeconds: number;
4290
5557
  inputTokens: number;
5558
+ outputTokens: number;
4291
5559
  cachedTokens: number;
5560
+ cacheInputTokens: number;
5561
+ cacheWriteTokens: number;
5562
+ reasoningTokens: number;
5563
+ totalTokens: number;
5564
+ tokenKnownCalls: number;
5565
+ cacheKnownCalls: number;
4292
5566
  cacheHitPct: number;
4293
5567
  calls: number;
4294
5568
  };
@@ -4308,9 +5582,12 @@ export type InsightsSpendDriver = {
4308
5582
  groupBy: "root_session" | "schedule";
4309
5583
  label: string;
4310
5584
  creditUsd: number;
5585
+ estimatedProviderUsd: number;
5586
+ estimatedProviderCostKnownCalls: number;
4311
5587
  tokens: number;
4312
5588
  cacheHitPct: number;
4313
5589
  pctOfCreditUsd: number;
5590
+ pctOfTokens: number;
4314
5591
  deltaUsdVsPrior: number;
4315
5592
  };
4316
5593
 
@@ -4350,17 +5627,44 @@ export type InsightsScheduleRow = {
4350
5627
  name: string;
4351
5628
  fires: number;
4352
5629
  creditUsd: number | null;
5630
+ estimatedProviderUsd: number | null;
5631
+ estimatedProviderCostKnownCalls: number | null;
4353
5632
  tokens: number | null;
4354
5633
  cacheHitPct: number | null;
4355
5634
  billing: InsightsBillingPath | null;
4356
5635
  };
4357
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
+
4358
5659
  export type WorkspaceInsightsSnapshot = {
4359
5660
  range: InsightsRange;
4360
5661
  rangeLabel: string;
4361
5662
  priorLabel: string;
4362
5663
  seriesLabel: string;
4363
5664
  cacheSeriesLabel: string;
5665
+ windowStart: string;
5666
+ windowEnd: string;
5667
+ generatedAt: string;
4364
5668
  timezone: "UTC";
4365
5669
  models: InsightsModelUsageRow[];
4366
5670
  facets: InsightsModelFacet[];
@@ -4368,6 +5672,7 @@ export type WorkspaceInsightsSnapshot = {
4368
5672
  depth: InsightsDepthBucket[];
4369
5673
  drivers: InsightsSpendDriver[];
4370
5674
  schedules: InsightsScheduleRow[];
5675
+ recentCalls: InsightsModelCallRow[];
4371
5676
  warmSeconds: number;
4372
5677
  priorWarmSeconds: number;
4373
5678
  warmGroups: InsightsWarmGroupRow[];
@@ -4379,7 +5684,13 @@ export type WorkspaceInsightsSnapshot = {
4379
5684
  priorWorkspaceCreditUsd: number;
4380
5685
  creditUsd: number;
4381
5686
  priorCreditUsd: number;
5687
+ estimatedProviderUsd: number;
5688
+ priorEstimatedProviderUsd: number;
5689
+ estimatedProviderCostKnownCalls: number;
5690
+ priorEstimatedProviderCostKnownCalls: number;
5691
+ modelCalls: number;
4382
5692
  priorInputTokens: number;
5693
+ priorTotalTokens: number;
4383
5694
  priorCacheHitPct: number;
4384
5695
  priorCalls: number;
4385
5696
  goalsActive: number;
@@ -4425,6 +5736,7 @@ export type UserMessageEventInput = {
4425
5736
  clientEventId?: string | undefined;
4426
5737
  payload: {
4427
5738
  text: string;
5739
+ annotations?: SubmittedTimelineAnnotation[] | undefined;
4428
5740
  turnInstructions?: string | undefined;
4429
5741
  resources?: ResourceRef[] | undefined;
4430
5742
  model?: string | undefined;
@@ -4552,12 +5864,14 @@ export type RemoveEnrollmentResponse = {
4552
5864
  code:
4553
5865
  | "active_route"
4554
5866
  | "active_commands"
5867
+ | "machine_home"
4555
5868
  | "active_lease"
4556
5869
  | "recovery_pending"
4557
5870
  | "not_selfhosted"
4558
5871
  | null;
4559
5872
  message: string;
4560
5873
  action: string;
5874
+ dependentSessions: Array<{ id: string; title: string | null }>;
4561
5875
  };
4562
5876
 
4563
5877
  /** POST /v1/workspaces/:ws/sessions/:sessionId/active-sandbox — swap a session's
@@ -4590,8 +5904,9 @@ export type SwapActiveSandboxResponse = {
4590
5904
 
4591
5905
  // ── Self-hosted enrollment UX (design 11) ────────────────────────────────────
4592
5906
  // Hand-written mirrors of the `@opengeni/contracts` enrollment-UX request/response
4593
- // shapes (the SDK keeps zero runtime deps). The click-Grant approve-page
4594
- // 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.
4595
5910
 
4596
5911
  /** Mirror of `@opengeni/contracts` EnrollmentOs. */
4597
5912
  export type EnrollmentOs = "linux" | "macos" | "windows";