@opengeni/sdk 0.52.1 → 1.0.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 (56) hide show
  1. package/README.md +67 -7
  2. package/dist/artifacts.js +5 -5
  3. package/dist/{chunk-FRJFNDIR.js → chunk-4DV37UUA.js} +6 -2
  4. package/dist/chunk-4DV37UUA.js.map +1 -0
  5. package/dist/{chunk-KIHGPM7H.js → chunk-A5DC5WEM.js} +288 -45
  6. package/dist/chunk-A5DC5WEM.js.map +1 -0
  7. package/dist/{chunk-V5F253OG.js → chunk-GU6JF75T.js} +6 -3
  8. package/dist/chunk-GU6JF75T.js.map +1 -0
  9. package/dist/{chunk-MZWTWOX6.js → chunk-ST5DDKJP.js} +327 -1
  10. package/dist/chunk-ST5DDKJP.js.map +1 -0
  11. package/dist/{chunk-FHI4DFIG.js → chunk-TYZ4JL4J.js} +2 -2
  12. package/dist/{chunk-ILQZR5N6.js → chunk-YGH5P47G.js} +693 -34
  13. package/dist/chunk-YGH5P47G.js.map +1 -0
  14. package/dist/{chunk-DXDL7EEW.js → chunk-YKZME56C.js} +197 -113
  15. package/dist/chunk-YKZME56C.js.map +1 -0
  16. package/dist/client.d.ts +108 -18
  17. package/dist/codex-realtime-controller.d.ts +5 -0
  18. package/dist/codex-realtime-controller.js +2 -2
  19. package/dist/codex-realtime-v3.d.ts +13 -2
  20. package/dist/core.js +7 -7
  21. package/dist/desktop.d.ts +8 -0
  22. package/dist/editable-artifacts.js +4 -4
  23. package/dist/gateway-realtime-transport.d.ts +1 -0
  24. package/dist/gateway-realtime-transport.js +5 -3
  25. package/dist/index.d.ts +6 -2
  26. package/dist/index.js +68 -34
  27. package/dist/index.js.map +1 -1
  28. package/dist/interaction-revision-stream.d.ts +11 -0
  29. package/dist/interaction.d.ts +604 -5
  30. package/dist/interaction.js +27 -1
  31. package/dist/realtime.d.ts +3 -3
  32. package/dist/realtime.js +11 -7
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/types.d.ts +283 -69
  35. package/dist/workspace-live-stream.d.ts +14 -0
  36. package/package.json +2 -2
  37. package/src/client.ts +863 -62
  38. package/src/codex-realtime-controller.ts +239 -12
  39. package/src/codex-realtime-lifecycle.ts +1 -0
  40. package/src/codex-realtime-v3.ts +162 -31
  41. package/src/desktop.ts +11 -1
  42. package/src/errors.ts +16 -2
  43. package/src/gateway-realtime-transport.ts +252 -109
  44. package/src/index.ts +42 -13
  45. package/src/interaction-revision-stream.ts +117 -0
  46. package/src/interaction.ts +1049 -5
  47. package/src/realtime.ts +14 -4
  48. package/src/types.ts +353 -72
  49. package/src/workspace-live-stream.ts +137 -0
  50. package/dist/chunk-DXDL7EEW.js.map +0 -1
  51. package/dist/chunk-FRJFNDIR.js.map +0 -1
  52. package/dist/chunk-ILQZR5N6.js.map +0 -1
  53. package/dist/chunk-KIHGPM7H.js.map +0 -1
  54. package/dist/chunk-MZWTWOX6.js.map +0 -1
  55. package/dist/chunk-V5F253OG.js.map +0 -1
  56. /package/dist/{chunk-FHI4DFIG.js.map → chunk-TYZ4JL4J.js.map} +0 -0
package/dist/types.d.ts CHANGED
@@ -90,6 +90,8 @@ export type SessionRealtimeInboundEntry = {
90
90
  delegationItemId?: string | null | undefined;
91
91
  text?: string | null | undefined;
92
92
  payload?: Record<string, unknown> | undefined;
93
+ /** Model-visible application context attached to this exact realtime message. */
94
+ modelContext?: string | undefined;
93
95
  };
94
96
  export type SyncSessionRealtimeLedgerRequest = {
95
97
  browserInstanceId: string;
@@ -112,11 +114,11 @@ export type SyncSessionRealtimeLedgerResponse = {
112
114
  }>;
113
115
  outbound: SessionRealtimeLedgerEntry[];
114
116
  };
115
- export type SessionRealtimeModel = "gpt-live-1-boulder-alpha" | "opengeni-gateway/openai/gpt-realtime-2.1" | "opengeni-gateway/openai/gpt-realtime-mini" | "opengeni-gateway/xai/grok-voice-think-fast-2.0" | "workspace-gateway/openai/gpt-realtime-2.1" | "workspace-gateway/openai/gpt-realtime-mini" | "workspace-gateway/xai/grok-voice-think-fast-2.0";
117
+ export type SessionRealtimeModel = "gpt-live-1-boulder-alpha" | "supergrok/grok-voice-think-fast-2.0" | "opengeni-gateway/openai/gpt-realtime-2.1" | "opengeni-gateway/openai/gpt-realtime-mini" | "opengeni-gateway/xai/grok-voice-think-fast-2.0" | "workspace-gateway/openai/gpt-realtime-2.1" | "workspace-gateway/openai/gpt-realtime-mini" | "workspace-gateway/xai/grok-voice-think-fast-2.0";
116
118
  export type WorkspaceRealtimeModelCatalogItem = {
117
119
  id: SessionRealtimeModel;
118
120
  label: string;
119
- provider: "OpenGeni" | "Connected Codex" | "Your Gateway";
121
+ provider: "OpenGeni" | "Connected Codex" | "Connected SuperGrok" | "Your Gateway";
120
122
  description: string;
121
123
  available: boolean;
122
124
  unavailableReason: string | null;
@@ -184,7 +186,7 @@ export type SessionCapabilities = {
184
186
  reason: CapabilityUnavailableReason | null;
185
187
  };
186
188
  Terminal: {
187
- transport: "sse-events" | "pty-ws" | null;
189
+ transport: "sse-events" | "pty-ws" | "relay-pty" | null;
188
190
  ptyCapable: boolean;
189
191
  shell: string;
190
192
  url: string | null;
@@ -279,7 +281,7 @@ export type AttachViewerResponse = ViewerHolder & {
279
281
  terminalUrl: string | null;
280
282
  terminalToken: string | null;
281
283
  terminalExpiresAt: string | null;
282
- terminalTransport: "pty-ws" | null;
284
+ terminalTransport: "pty-ws" | "relay-pty" | null;
283
285
  };
284
286
  export type AcknowledgeStreamRequest = {
285
287
  acknowledgeUnredacted?: boolean | undefined;
@@ -375,6 +377,7 @@ export type GoalSpec = {
375
377
  text: string;
376
378
  successCriteria?: string | undefined;
377
379
  maxAutoContinuations?: number | undefined;
380
+ mutationPolicy?: SessionGoalMutationPolicy | undefined;
378
381
  };
379
382
  export type SessionMcpServerInput = {
380
383
  id: string;
@@ -469,6 +472,20 @@ export type OpenGeniSlackBotInstallRequest = {
469
472
  /** Existing OpenGeni Slack bot connection to reinstall in place. */
470
473
  connectionId?: string | undefined;
471
474
  };
475
+ export type FikenInstallRequest = {
476
+ apiToken: string;
477
+ defaultCompanySlug?: string | undefined;
478
+ /** Existing Fiken connection to rewrite in place (reconnect). */
479
+ connectionId?: string | undefined;
480
+ };
481
+ export type FikenOAuthStartRequest = {
482
+ /** Existing Fiken connection to re-authorize in place (reconnect). */
483
+ connectionId?: string | undefined;
484
+ };
485
+ export type FikenOAuthStartResponse = {
486
+ authorizationUrl: string;
487
+ expiresAt: string;
488
+ };
472
489
  export type OpenGeniSlackBotInstallStart = {
473
490
  authorizationUrl: string;
474
491
  expiresAt: string;
@@ -541,16 +558,25 @@ export type GoogleDriveConnectionMetadata = {
541
558
  googleEmail: string;
542
559
  googleDisplayName: string | null;
543
560
  verifiedAt: string;
544
- accessMode: "metadata_readonly" | "readonly";
561
+ accessMode: "file_only" | "metadata_readonly" | "readonly";
545
562
  lifecycle?: GoogleDriveConnectionLifecycle | undefined;
563
+ outputDestination?: GoogleDriveOutputDestination | undefined;
546
564
  documentDestination?: ConnectorDocumentDestination | undefined;
547
565
  selectedSources?: GoogleDriveSelectedSource[] | undefined;
548
566
  /** @deprecated Read selectedSources; retained while existing connections migrate. */
549
567
  selectedSource?: GoogleDriveSelectedSource | null | undefined;
550
568
  [key: string]: unknown;
551
569
  };
570
+ export type GoogleDriveOutputDestination = {
571
+ folderId: string;
572
+ folderName: string;
573
+ driveId: string | null;
574
+ location: "my_drive" | "shared_drive";
575
+ selectedAt: string;
576
+ };
552
577
  export type GoogleDriveOAuthStartRequest = {
553
578
  connectionId?: string | undefined;
579
+ capability?: "source_read" | "publish" | undefined;
554
580
  };
555
581
  export type GoogleDriveOAuthStartResponse = {
556
582
  authorizationUrl: string;
@@ -804,6 +830,8 @@ export type Session = {
804
830
  environmentId: string | null;
805
831
  rigId: string | null;
806
832
  rigVersionId: string | null;
833
+ /** Workspace channel the session is filed under; null = unfiled (inbox). */
834
+ channelId: string | null;
807
835
  firstPartyMcpPermissions: string[] | null;
808
836
  firstPartyMcpTools: FirstPartyMcpToolName[];
809
837
  mcpServers: SessionMcpServerMetadata[];
@@ -1037,7 +1065,7 @@ export type SessionHumanInputRequest = {
1037
1065
  createdAt: string;
1038
1066
  updatedAt: string;
1039
1067
  };
1040
- export declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1068
+ export declare const SESSION_EVENT_TYPES: readonly ["session.created", "session.event.envelope_omitted", "session.status.changed", "session.realtime.started", "session.realtime.ended", "session.requiresAction", "session.humanInput.requested", "session.context.compaction.requested", "session.context.compaction.started", "session.context.compacted", "session.context.compaction.skipped", "session.context.cleared", "user.message", "user.pause", "user.approvalDecision", "user.humanInputResponse", "turn.queued", "turn.started", "turn.completed", "turn.failed", "turn.cancelled", "turn.superseded", "turn.recovery.requested", "turn.capacity_waiting", "agent.message.delta", "agent.message.completed", "agent.reasoning.delta", "agent.toolCall.created", "agent.toolCall.output", "agent.model.request", "agent.model.usage", "tool.auth_needed", "credential.auth_needed", "agent.updated", "rig.setup.started", "rig.setup.completed", "rig.setup.skipped", "rig.setup.failed", "sandbox.operation.started", "sandbox.operation.completed", "sandbox.operation.failed", "sandbox.command.output.delta", "artifact.created", "goal.set", "goal.updated", "goal.progress", "goal.rewrite.proposed", "goal.rewrite.rejected", "goal.completed", "goal.paused", "goal.resumed", "goal.cleared", "goal.continuation", "system.update.pending", "system.update.delivered", "system.update.superseded", "system.update.cancelled", "system.update.settled", "session.control.paused", "session.control.resumed", "session.control.steer_requested", "workspace.inference.paused", "workspace.inference.resumed", "session.queue.changed", "session.queue.prompt.cancelled", "session.queue.history", "turn.event.rejected_late", "memory.saved", "memory.corrected", "stream.url.rotated", "stream.opened", "stream.closed", "stream.revoked", "recording.started", "recording.available", "recording.failed", "fs.changed", "git.changed", "terminal.pty.started", "terminal.pty.output.delta", "terminal.pty.exited", "session.title_set", "session.visibility.changed", "session.mcp.approval_policy.updated", "session.tool_policy.updated", "codex.account.switched", "codex.credential.selected", "codex.fleet.decision", "codex.capacity.waiting", "codex.capacity.resumed", "codex.capacity.superseded", "sandbox.box.created", "sandbox.box.lost", "sandbox.box.terminated", "sandbox.box.snapshot", "sandbox.env.drift", "session.route.reconciled", "workspace.revision.captured", "workspace.revision.degraded", "machine.op.failed", "machine.op.recovered", "machine.link.lost", "machine.link.restored", "machine.runner.restarted"];
1041
1069
  export type KnownSessionEventType = (typeof SESSION_EVENT_TYPES)[number];
1042
1070
  /**
1043
1071
  * Event types the SDK knows about today, kept open so a newer OpenGeni server
@@ -1806,8 +1834,8 @@ export type CreateSessionRequest = {
1806
1834
  initialMessage?: string | undefined;
1807
1835
  /** Create an idle session shell so realtime voice can be the first interaction. */
1808
1836
  startMode?: "realtime" | undefined;
1809
- /** System instructions scoped to the initial turn; never visible timeline text. */
1810
- turnInstructions?: string | undefined;
1837
+ /** Model-visible application context attached to the initial user message; omitted by standard timeline rendering. */
1838
+ modelContext?: string | undefined;
1811
1839
  instructions?: string | undefined;
1812
1840
  /** Immutable normalized prompt-policy role; distinct from membership roles. */
1813
1841
  policyRole?: string | undefined;
@@ -1845,7 +1873,7 @@ export type KnownPermission = (typeof KNOWN_PERMISSIONS)[number];
1845
1873
  * can introduce permissions without breaking older SDK consumers.
1846
1874
  */
1847
1875
  export type Permission = KnownPermission | (string & {});
1848
- export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_debug" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
1876
+ export type FirstPartyMcpToolName = "set_session_title" | "goal_set" | "goal_update" | "goal_progress" | "goal_complete" | "goal_pause" | "memory_search" | "memory_save" | "memory_correct" | "preference_registry_summary" | "preference_registry_get" | "task_notes_list" | "task_note_save" | "task_note_archive" | "sandboxes_list" | "sandbox_attach" | "sandbox_swap" | "run_on" | "sandbox_provision" | "connected_machine_remove" | "rig_list" | "rig_get" | "rig_propose_change" | "rig_verify" | "rig_promote" | "sessions_list" | "session_get" | "session_events" | "session_create" | "session_send_message" | "session_pause" | "session_resume" | "session_steer" | "set_other_session_title" | "interaction_discover" | "browser_open" | "browser_tabs" | "browser_observe" | "browser_act" | "browser_clipboard" | "browser_debug" | "browser_auth" | "interaction_request_human" | "browser_identity" | "browser_publish" | "browser_lifecycle" | "computer_open" | "computer_targets" | "computer_observe" | "computer_clipboard" | "computer_act" | "computer_lifecycle" | "variable_set_list" | "environment_list" | "variable_set_get_variable" | "variable_set_set_variable" | "environment_set_variable" | "capability_catalog_search" | "capability_authorization_request" | "github_connect_link" | "github_repositories_list" | "social_connections_list" | "social_posts_recent" | "social_daily_analysis_context" | "social_search_live" | "social_mentions_live" | "social_thread_fetch" | "social_posts_sync" | "social_post_reply" | "x_accounts_list" | "x_search_live" | "x_mentions_live" | "x_thread_fetch" | "x_posts_sync" | "x_post_reply" | "reddit_accounts_list" | "reddit_search_live" | "reddit_mentions_live" | "reddit_thread_fetch" | "reddit_posts_sync" | "reddit_post_reply" | "scheduled_tasks_list" | "scheduled_tasks_get" | "scheduled_tasks_create" | "scheduled_tasks_update" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_delete" | "scheduled_task_runs_list" | "slack_bot_list_channels" | "slack_bot_channel_history" | "slack_bot_thread_replies" | "slack_bot_list_users" | "slack_bot_list_files" | "slack_bot_file_info" | "slack_bot_file_content" | "slack_bot_post_message" | "slack_bot_delete_message" | "fiken_companies_list" | "fiken_contacts_list" | "fiken_contact_create" | "fiken_products_list" | "fiken_invoices_list" | "fiken_invoice_get" | "fiken_invoice_draft_create" | "fiken_bank_accounts_list" | "fiken_purchases_list" | "fiken_sales_list" | "atlassian_sources_list" | "atlassian_search" | "atlassian_get" | "artifacts_list" | "artifacts_get_source" | "artifacts_create" | "artifacts_publish" | "artifacts_rollback" | "editable_artifact_list" | "editable_artifact_create" | "editable_artifact_import" | "editable_artifact_get" | "editable_artifact_inspect" | "editable_artifact_apply" | "editable_artifact_export" | "editable_artifact_export_status";
1849
1877
  export type ProductAccessMode = "local" | "configured" | "managed";
1850
1878
  export type ModelCapabilitySupportV1 = "supported" | "unsupported" | "unknown";
1851
1879
  export type ModelCapabilityStateV1 = {
@@ -1888,7 +1916,7 @@ export type ModelCredentialSourceV1 = {
1888
1916
  mechanism: "api_key" | "azure_ad_bearer";
1889
1917
  } | {
1890
1918
  kind: "connected_subscription";
1891
- provider: "codex";
1919
+ provider: "codex" | "xai";
1892
1920
  } | {
1893
1921
  kind: "workspace_connection";
1894
1922
  mechanism: "api_key";
@@ -1925,7 +1953,7 @@ export type ClientModel = {
1925
1953
  provider: string;
1926
1954
  providerLabel: string;
1927
1955
  api: "responses" | "chat";
1928
- source?: "opengeni" | "codex" | "workspace_gateway" | undefined;
1956
+ source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | undefined;
1929
1957
  contextWindowTokens?: number | undefined;
1930
1958
  schemaVersion?: 1 | undefined;
1931
1959
  aliases?: string[] | undefined;
@@ -2169,6 +2197,83 @@ export type CodexConnectPoll = {
2169
2197
  accountId?: string;
2170
2198
  isActive?: boolean;
2171
2199
  };
2200
+ /** Explicit authority of one connected SuperGrok/xAI subscription account. */
2201
+ export type SuperGrokAccountScope = "workspace" | "user";
2202
+ /** Metadata-only connected SuperGrok account. Secret OAuth material never crosses the API. */
2203
+ export type SuperGrokAccount = {
2204
+ id: string;
2205
+ scope: SuperGrokAccountScope;
2206
+ subject: string;
2207
+ email?: string | null;
2208
+ label?: string | null;
2209
+ status: "active" | "needs_relogin" | "error";
2210
+ active: boolean;
2211
+ expiresAt?: string | null;
2212
+ lastRefreshAt?: string | null;
2213
+ lastError?: string | null;
2214
+ allocatorEnabled: boolean;
2215
+ allocatorVersion: number;
2216
+ allocatorUpdatedAt?: string | null;
2217
+ exhaustedUntil?: string | null;
2218
+ quota?: {
2219
+ usedPercent: number | null;
2220
+ periodStart: string | null;
2221
+ periodEnd: string | null;
2222
+ subscriptionTier: string | null;
2223
+ checkedAt: string | null;
2224
+ } | null;
2225
+ };
2226
+ export type SuperGrokRotationSettings = {
2227
+ rotationEnabled: boolean;
2228
+ rotationStrategy: "sharded";
2229
+ activeCredentialId: string | null;
2230
+ };
2231
+ /** GET /supergrok/accounts — visible accounts plus the workspace active pointer. */
2232
+ export type SuperGrokAccountsResponse = {
2233
+ accounts: SuperGrokAccount[];
2234
+ activeAccountId: string | null;
2235
+ settings: SuperGrokRotationSettings;
2236
+ };
2237
+ export type SuperGrokConnectionStatus = {
2238
+ connected: boolean;
2239
+ valid?: boolean;
2240
+ accountCount?: number;
2241
+ models?: ClientModel[];
2242
+ activeAccount?: {
2243
+ id: string;
2244
+ label?: string | null;
2245
+ subject?: string | null;
2246
+ scope: SuperGrokAccountScope;
2247
+ } | null;
2248
+ };
2249
+ /** Workspace is the deliberately simple/default connection authority. */
2250
+ export type SuperGrokConnectStart = {
2251
+ userCode: string;
2252
+ verificationUri: string;
2253
+ verificationUriComplete?: string | null;
2254
+ intervalSeconds: number;
2255
+ expiresInSeconds: number;
2256
+ scope: SuperGrokAccountScope;
2257
+ state: string;
2258
+ };
2259
+ export type SuperGrokConnectPoll = {
2260
+ status: "pending" | "slow_down";
2261
+ intervalSeconds?: number;
2262
+ } | {
2263
+ status: "expired" | "denied";
2264
+ } | {
2265
+ status: "connected";
2266
+ accountId: string;
2267
+ scope: SuperGrokAccountScope;
2268
+ isActive: boolean;
2269
+ email?: string | null;
2270
+ };
2271
+ export type SuperGrokAllocatorUpdate = {
2272
+ allocatorEnabled: boolean;
2273
+ allocatorVersion: number;
2274
+ allocatorUpdatedAt: string | null;
2275
+ changed: boolean;
2276
+ };
2172
2277
  /** Remaining usage/limits for one account. `usage` is the normalized P2 payload. */
2173
2278
  export type CodexUsage = {
2174
2279
  status: "ok" | "limit_reached" | "error" | "no-data";
@@ -2194,7 +2299,7 @@ export type ClientAuthConfig = {
2194
2299
  mode: "managedSession";
2195
2300
  session: "cookie";
2196
2301
  };
2197
- export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-social-provider-tools-v1";
2302
+ export declare const OPENGENI_API_CONTRACT_REVISION: "2026-08-model-context-v1";
2198
2303
  export declare const OPENGENI_API_CONTRACT_HEADER: "x-opengeni-api-contract";
2199
2304
  /** Bounded request/response identifier shared by browser, ingress, and API diagnostics. */
2200
2305
  export declare const OPENGENI_CORRELATION_HEADER: "x-opengeni-correlation-id";
@@ -2218,6 +2323,11 @@ export type ClientConfig = {
2218
2323
  id: string;
2219
2324
  name: string;
2220
2325
  }[];
2326
+ /** Deployment defaults and hard maximum for built-in OpenGeni session tools. */
2327
+ firstPartyMcpTools?: {
2328
+ default: FirstPartyMcpToolName[];
2329
+ allowed: FirstPartyMcpToolName[];
2330
+ } | undefined;
2221
2331
  fileUploads: {
2222
2332
  enabled: boolean;
2223
2333
  maxSizeBytes: number;
@@ -2348,6 +2458,15 @@ export type AccessContext = {
2348
2458
  defaultAccountId: string | null;
2349
2459
  defaultWorkspaceId: string | null;
2350
2460
  };
2461
+ export type ManagedOrganizationMembership = {
2462
+ id: string;
2463
+ organizationId: string;
2464
+ status: "active";
2465
+ personalWorkspaceId: string;
2466
+ };
2467
+ export type ListManagedOrganizationMembershipsResponse = {
2468
+ memberships: ManagedOrganizationMembership[];
2469
+ };
2351
2470
  export type Workspace = {
2352
2471
  id: string;
2353
2472
  accountId: string;
@@ -2370,6 +2489,8 @@ export type Workspace = {
2370
2489
  };
2371
2490
  export type WorkspaceSettings = {
2372
2491
  memoryEnabled?: boolean | undefined;
2492
+ /** Reversible Memory V1 prompt composition rollout. */
2493
+ memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
2373
2494
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2374
2495
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2375
2496
  maxNestedAgentDepth?: number | null | undefined;
@@ -2404,6 +2525,7 @@ export type WorkspaceVoiceInputSettings = {
2404
2525
  };
2405
2526
  export type UpdateWorkspaceSettingsRequest = {
2406
2527
  memoryEnabled?: boolean | undefined;
2528
+ memoryPromptMode?: "legacy_standing" | "retrieval_only" | undefined;
2407
2529
  voiceInput?: WorkspaceVoiceInputSettings | undefined;
2408
2530
  transcription?: WorkspaceTranscriptionPolicy | undefined;
2409
2531
  maxNestedAgentDepth?: number | null | undefined;
@@ -2505,6 +2627,32 @@ export type ListSlackUserLinkAccessRequestsResponse = {
2505
2627
  };
2506
2628
  export type SessionGoalStatus = "active" | "paused" | "completed";
2507
2629
  export type SessionGoalCreatedBy = "api" | "agent" | "scheduled_task";
2630
+ export type SessionGoalMutationPolicy = "review_changes" | "preserve_intent" | "autonomous_adaptation";
2631
+ export type SessionGoalChangeKind = "refinement" | "adaptation" | "replacement";
2632
+ export type SessionGoalRevision = {
2633
+ id: string;
2634
+ accountId: string;
2635
+ workspaceId: string;
2636
+ sessionId: string;
2637
+ goalId: string;
2638
+ disposition: "applied" | "proposed" | "rejected";
2639
+ changeKind: SessionGoalChangeKind;
2640
+ baseObjectiveRevision: number;
2641
+ resultObjectiveRevision: number | null;
2642
+ text: string;
2643
+ successCriteria: string | null;
2644
+ mutationPolicy: SessionGoalMutationPolicy;
2645
+ rationale: string;
2646
+ actor: "agent" | "api" | "scheduled_task";
2647
+ actorTurnId: string | null;
2648
+ actorAttemptId: string | null;
2649
+ proposalId: string | null;
2650
+ createdAt: string;
2651
+ };
2652
+ export type ApplySessionGoalRevisionRequest = {
2653
+ expectedObjectiveRevision: number;
2654
+ rationale?: string | undefined;
2655
+ };
2508
2656
  export type SessionGoalContinuationState = "inactive" | "scheduled" | "running" | "blocked" | "invariant_broken";
2509
2657
  export type SessionGoalContinuationReason = "goal_inactive" | "wake_pending" | "continuation_pending" | "human_work_pending" | "goal_turn_running" | "human_turn_running" | "workstream_paused" | "approval_required" | "provider_backpressure" | "session_cancelled" | "system_work_pending" | "missing_obligation";
2510
2658
  export type SessionGoalContinuation = {
@@ -2528,6 +2676,8 @@ export type SessionGoal = {
2528
2676
  pausedReason: string | null;
2529
2677
  createdBy: SessionGoalCreatedBy;
2530
2678
  version: number;
2679
+ objectiveRevision: number;
2680
+ mutationPolicy: SessionGoalMutationPolicy;
2531
2681
  autoContinuations: number;
2532
2682
  noProgressStreak: number;
2533
2683
  maxAutoContinuations: number | null;
@@ -2540,6 +2690,12 @@ export type SessionGoal = {
2540
2690
  export type UpdateSessionGoalRequest = {
2541
2691
  status: "paused" | "active";
2542
2692
  rationale?: string | undefined;
2693
+ } | {
2694
+ text: string;
2695
+ successCriteria?: string | null | undefined;
2696
+ mutationPolicy?: SessionGoalMutationPolicy | undefined;
2697
+ rationale: string;
2698
+ expectedObjectiveRevision: number;
2543
2699
  };
2544
2700
  export type UpdateSessionRequest = {
2545
2701
  title: string;
@@ -2949,6 +3105,32 @@ export type RigVerificationHealth = {
2949
3105
  checkHealth: "passing" | "failing" | "unknown";
2950
3106
  lastVerifiedAt: string | null;
2951
3107
  };
3108
+ /**
3109
+ * Workspace-shared channel organizing root sessions ("workstreams") by work
3110
+ * type in the rail. Pure organizational metadata.
3111
+ */
3112
+ export type Channel = {
3113
+ id: string;
3114
+ accountId: string;
3115
+ workspaceId: string;
3116
+ name: string;
3117
+ description: string | null;
3118
+ createdBy: string | null;
3119
+ createdAt: string;
3120
+ updatedAt: string;
3121
+ };
3122
+ export type CreateChannelRequest = {
3123
+ name: string;
3124
+ description?: string;
3125
+ };
3126
+ export type UpdateChannelRequest = {
3127
+ name?: string;
3128
+ description?: string | null;
3129
+ };
3130
+ /** Re-files one session; null moves it back to the unfiled inbox. */
3131
+ export type UpdateSessionChannelRequest = {
3132
+ channelId: string | null;
3133
+ };
2952
3134
  export type Rig = {
2953
3135
  id: string;
2954
3136
  accountId: string;
@@ -3118,7 +3300,7 @@ export type UpdateVideoGenerationPolicyRequest = {
3118
3300
  enabledModelIds: string[];
3119
3301
  defaultModelId: string | null;
3120
3302
  };
3121
- export type VideoGenerationFundingSource = "opengeni_credits" | "workspace_gateway";
3303
+ export type VideoGenerationFundingSource = "opengeni_credits" | "workspace_gateway" | "supergrok_subscription";
3122
3304
  export type VideoGenerationFundingOption = {
3123
3305
  source: VideoGenerationFundingSource;
3124
3306
  label: string;
@@ -3514,10 +3696,10 @@ export type CapabilityPackComponentReference = {
3514
3696
  required: boolean;
3515
3697
  } | {
3516
3698
  key: string;
3517
- kind: "feature";
3699
+ kind: "facet";
3518
3700
  capabilityId: string;
3519
3701
  instanceKey: string;
3520
- featureKey: string;
3702
+ facetKey: string;
3521
3703
  bindingKey: string;
3522
3704
  configDigest: string;
3523
3705
  required: boolean;
@@ -3593,10 +3775,10 @@ export type RegisterCapabilityPackRequest = {
3593
3775
  required?: boolean | undefined;
3594
3776
  } | {
3595
3777
  key: string;
3596
- kind: "feature";
3778
+ kind: "facet";
3597
3779
  capabilityId: string;
3598
3780
  instanceKey: string;
3599
- featureKey: string;
3781
+ facetKey: string;
3600
3782
  bindingKey: string;
3601
3783
  configDigest: string;
3602
3784
  required?: boolean | undefined;
@@ -3673,7 +3855,7 @@ export type EnablePackRequest = {
3673
3855
  export type PackComponentResolutionStatus = "ready" | "missing" | "mismatch";
3674
3856
  export type PackComponentResolution = {
3675
3857
  key: string;
3676
- kind: "plugin" | "skill" | "integration" | "feature" | "inline_skill";
3858
+ kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
3677
3859
  capabilityId: string;
3678
3860
  required: boolean;
3679
3861
  status: PackComponentResolutionStatus;
@@ -3723,7 +3905,7 @@ export type PackUninstallPreview = {
3723
3905
  installationVersion: number | null;
3724
3906
  components: Array<{
3725
3907
  key: string;
3726
- kind: "plugin" | "skill" | "integration" | "feature" | "inline_skill";
3908
+ kind: "plugin" | "skill" | "integration" | "facet" | "inline_skill";
3727
3909
  capabilityId: string;
3728
3910
  retainedByOtherOwners: boolean;
3729
3911
  }>;
@@ -3833,7 +4015,7 @@ export type CapabilityCatalogResponse = {
3833
4015
  };
3834
4016
  export type CreateCapabilityCatalogItemRequest = {
3835
4017
  id?: string | undefined;
3836
- kind: Exclude<CapabilityKind, "pack">;
4018
+ kind: "mcp";
3837
4019
  source?: CapabilitySource | undefined;
3838
4020
  name: string;
3839
4021
  description?: string | undefined;
@@ -3855,14 +4037,6 @@ export type EnableCapabilityRequest = {
3855
4037
  * API (responses expose header names only).
3856
4038
  */
3857
4039
  headers?: Record<string, string> | undefined;
3858
- /**
3859
- * Initial variableSet attachment for kind=pack capabilities — mirrors the
3860
- * dedicated POST /packs/:id/enable body. Required to enable an
3861
- * variableSet.required pack through this unified path; ignored otherwise.
3862
- */
3863
- variableSetId?: string | undefined;
3864
- /** @deprecated use variableSetId */
3865
- environmentId?: string | undefined;
3866
4040
  };
3867
4041
  export type DiscoverMcpCapabilitiesResponse = {
3868
4042
  items: CapabilityCatalogItem[];
@@ -3870,6 +4044,7 @@ export type DiscoverMcpCapabilitiesResponse = {
3870
4044
  sourceUrl: string;
3871
4045
  };
3872
4046
  export type SkillImportSource = "github" | "skills_sh";
4047
+ export type SkillInstallationSource = "library" | "github" | "skills_sh" | "pack";
3873
4048
  export type PreviewSkillImportRequest = {
3874
4049
  url: string;
3875
4050
  };
@@ -3901,6 +4076,11 @@ export type InstallSkillRequest = {
3901
4076
  expectedContentSha256: string;
3902
4077
  expectedInstallationVersion?: number | undefined;
3903
4078
  };
4079
+ export type InstallLibrarySkillRequest = {
4080
+ expectedVersion: string;
4081
+ expectedContentSha256: string;
4082
+ expectedInstallationVersion?: number | undefined;
4083
+ };
3904
4084
  export type InstalledSkill = {
3905
4085
  capabilityId: string;
3906
4086
  pluginId: string;
@@ -3909,7 +4089,8 @@ export type InstalledSkill = {
3909
4089
  pluginInstallationId: string;
3910
4090
  facetInstallationId: string;
3911
4091
  installationVersion: number;
3912
- source: SkillImportSource;
4092
+ source: SkillInstallationSource;
4093
+ version: string;
3913
4094
  sourceUrl: string;
3914
4095
  sourceCommit: string;
3915
4096
  contentSha256: string;
@@ -3921,6 +4102,32 @@ export type CapabilityComponentOwner = {
3921
4102
  id: string;
3922
4103
  removable: boolean;
3923
4104
  };
4105
+ export type InstalledSkillSummary = {
4106
+ capabilityId: string;
4107
+ pluginKey: string;
4108
+ installationVersion: number;
4109
+ name: string;
4110
+ description: string;
4111
+ category: string;
4112
+ tags: string[];
4113
+ provenance: string;
4114
+ source: SkillInstallationSource;
4115
+ version: string;
4116
+ sourceUrl: string;
4117
+ repositoryUrl: string;
4118
+ sourceCommit: string;
4119
+ sourcePath: string;
4120
+ contentSha256: string;
4121
+ fileCount: number;
4122
+ totalBytes: number;
4123
+ license: string | null;
4124
+ installedAt: string;
4125
+ updatedAt: string;
4126
+ owners: CapabilityComponentOwner[];
4127
+ };
4128
+ export type ListInstalledSkillsResponse = {
4129
+ skills: InstalledSkillSummary[];
4130
+ };
3924
4131
  export type SkillUninstallPreview = {
3925
4132
  capabilityId: string;
3926
4133
  installed: boolean;
@@ -3938,22 +4145,23 @@ export type UninstallSkillResult = {
3938
4145
  remainingOwners: CapabilityComponentOwner[];
3939
4146
  };
3940
4147
  export type ApiIntegrationProtocol = "openapi" | "graphql";
3941
- export type IntegrationFeatureKind = "tools" | "knowledge_source" | "inbound_trigger" | "delivery_destination" | "identity_link";
3942
- export type IntegrationFeatureStatus = "active" | "paused" | "needs_attention" | "disabled";
3943
- export type IntegrationFeatureDefinitionSummary = {
3944
- featureKey: string;
3945
- kind: Exclude<IntegrationFeatureKind, "tools">;
4148
+ export type IntegrationDefinitionProvenance = "curated" | "workspace";
4149
+ export type IntegrationFacetKind = "tools" | "knowledge_source" | "inbound_trigger" | "delivery_destination" | "identity_link";
4150
+ export type IntegrationFacetStatus = "active" | "paused" | "needs_attention" | "disabled";
4151
+ export type IntegrationFacetDefinitionSummary = {
4152
+ facetKey: string;
4153
+ kind: Exclude<IntegrationFacetKind, "tools">;
3946
4154
  configSchema: Record<string, unknown>;
3947
4155
  capabilities: Record<string, unknown>;
3948
4156
  };
3949
- export type IntegrationFeatureBindingSummary = {
4157
+ export type IntegrationFacetBindingSummary = {
3950
4158
  id: string;
3951
- featureKey: string;
3952
- kind: Exclude<IntegrationFeatureKind, "tools">;
4159
+ facetKey: string;
4160
+ kind: Exclude<IntegrationFacetKind, "tools">;
3953
4161
  bindingKey: string;
3954
4162
  displayName: string;
3955
4163
  connectionId: string | null;
3956
- status: IntegrationFeatureStatus;
4164
+ status: IntegrationFacetStatus;
3957
4165
  config: Record<string, unknown>;
3958
4166
  version: number;
3959
4167
  hasCursor: boolean;
@@ -3962,57 +4170,62 @@ export type IntegrationFeatureBindingSummary = {
3962
4170
  createdAt: string;
3963
4171
  updatedAt: string;
3964
4172
  };
3965
- export type IntegrationInstanceFeaturesResponse = {
4173
+ export type IntegrationInstanceFacetsResponse = {
3966
4174
  capabilityId: string;
3967
4175
  instanceKey: string;
3968
4176
  providerDomain: string;
3969
4177
  connectionId: string | null;
3970
- features: {
3971
- definition: IntegrationFeatureDefinitionSummary;
3972
- binding: IntegrationFeatureBindingSummary | null;
4178
+ facets: {
4179
+ definition: IntegrationFacetDefinitionSummary;
4180
+ binding: IntegrationFacetBindingSummary | null;
3973
4181
  }[];
3974
4182
  };
3975
- export type UpsertIntegrationFeatureRequest = {
4183
+ export type UpsertIntegrationFacetRequest = {
3976
4184
  displayName: string;
3977
4185
  config?: Record<string, unknown> | undefined;
3978
4186
  expectedVersion?: number | undefined;
3979
4187
  idempotencyKey: string;
3980
4188
  };
3981
- export type MutateIntegrationFeatureRequest = {
4189
+ export type MutateIntegrationFacetRequest = {
3982
4190
  expectedVersion: number;
3983
4191
  idempotencyKey: string;
3984
4192
  };
3985
- export type IntegrationFeatureMutationResult = {
4193
+ export type IntegrationFacetMutationResult = {
3986
4194
  capabilityId: string;
3987
4195
  instanceKey: string;
3988
- featureKey: string;
4196
+ facetKey: string;
3989
4197
  status: "configured" | "paused" | "active";
3990
- binding: IntegrationFeatureBindingSummary;
4198
+ binding: IntegrationFacetBindingSummary;
3991
4199
  };
3992
- export type IntegrationFeatureRemovalResult = {
4200
+ export type IntegrationFacetRemovalResult = {
3993
4201
  capabilityId: string;
3994
4202
  instanceKey: string;
3995
- featureKey: string;
4203
+ facetKey: string;
3996
4204
  status: "not_configured" | "removed" | "retained_by_other_owners";
3997
- binding: IntegrationFeatureBindingSummary | null;
4205
+ binding: IntegrationFacetBindingSummary | null;
3998
4206
  remainingOwners: CapabilityComponentOwner[];
3999
4207
  };
4000
- export type ApiIntegrationPresetSummary = {
4208
+ export type IntegrationDefinitionSummary = {
4001
4209
  id: string;
4002
4210
  name: string;
4003
4211
  summary: string;
4004
- family: "google" | "microsoft";
4005
4212
  protocol: "openapi";
4006
- providerDomain: string;
4007
- scopes: string[];
4008
- features: IntegrationFeatureDefinitionSummary[];
4213
+ provider: {
4214
+ id: "google" | "microsoft";
4215
+ domain: string;
4216
+ };
4217
+ authentication: {
4218
+ kind: "oauth2";
4219
+ scopes: string[];
4220
+ };
4221
+ facets: IntegrationFacetDefinitionSummary[];
4009
4222
  };
4010
- export type ListApiIntegrationPresetsResponse = {
4011
- presets: ApiIntegrationPresetSummary[];
4223
+ export type ListIntegrationDefinitionsResponse = {
4224
+ definitions: IntegrationDefinitionSummary[];
4012
4225
  };
4013
- export type ApiIntegrationSource = {
4014
- kind: "preset";
4015
- presetId: string;
4226
+ export type IntegrationSource = {
4227
+ kind: "definition";
4228
+ definitionId: string;
4016
4229
  } | {
4017
4230
  kind: "openapi";
4018
4231
  url: string;
@@ -4027,12 +4240,12 @@ export type ApiIntegrationSource = {
4027
4240
  baseUrl?: string | undefined;
4028
4241
  };
4029
4242
  export type PreviewApiIntegrationRequest = {
4030
- source: ApiIntegrationSource;
4243
+ source: IntegrationSource;
4031
4244
  connectionId?: string | undefined;
4032
4245
  ownership?: ConnectionOwnership | undefined;
4033
4246
  };
4034
4247
  export type ApiIntegrationOAuthStartRequest = {
4035
- presetId: string;
4248
+ definitionId: string;
4036
4249
  ownership?: ConnectionOwnership | undefined;
4037
4250
  connectionId?: string | undefined;
4038
4251
  returnPath?: string | undefined;
@@ -4063,10 +4276,10 @@ export type ApiIntegrationToolPreview = {
4063
4276
  deprecated: boolean;
4064
4277
  };
4065
4278
  export type ApiIntegrationPreview = {
4066
- source: ApiIntegrationSource;
4067
- presetId: string | null;
4279
+ source: IntegrationSource;
4280
+ definitionId: string;
4281
+ definitionProvenance: IntegrationDefinitionProvenance;
4068
4282
  protocol: ApiIntegrationProtocol;
4069
- integrationId: string;
4070
4283
  capabilityId: string;
4071
4284
  pluginKey: string;
4072
4285
  serverId: string;
@@ -4085,7 +4298,7 @@ export type ApiIntegrationPreview = {
4085
4298
  warnings: string[];
4086
4299
  };
4087
4300
  export type InstallApiIntegrationRequest = {
4088
- source: ApiIntegrationSource;
4301
+ source: IntegrationSource;
4089
4302
  expectedRevisionId: string;
4090
4303
  expectedContentSha256: string;
4091
4304
  connectionId?: string | undefined;
@@ -4125,7 +4338,8 @@ export type ApiIntegrationInstallationSummary = {
4125
4338
  name: string;
4126
4339
  description: string | null;
4127
4340
  protocol: ApiIntegrationProtocol;
4128
- presetId: string | null;
4341
+ definitionId: string;
4342
+ definitionProvenance: IntegrationDefinitionProvenance;
4129
4343
  providerDomain: string;
4130
4344
  baseUrl: string;
4131
4345
  sourceUrl: string | null;
@@ -4172,7 +4386,7 @@ export type PluginManifestComponent = {
4172
4386
  } | {
4173
4387
  key: string;
4174
4388
  kind: "integration";
4175
- source: ApiIntegrationSource;
4389
+ source: IntegrationSource;
4176
4390
  } | {
4177
4391
  key: string;
4178
4392
  kind: "mcp";
@@ -4581,7 +4795,7 @@ export type UserMessageEventInput = {
4581
4795
  payload: {
4582
4796
  text: string;
4583
4797
  annotations?: SubmittedTimelineAnnotation[] | undefined;
4584
- turnInstructions?: string | undefined;
4798
+ modelContext?: string | undefined;
4585
4799
  resources?: ResourceRef[] | undefined;
4586
4800
  model?: string | undefined;
4587
4801
  reasoningEffort?: ReasoningEffort | undefined;