@opengeni/sdk 3.1.0 → 3.3.2-canary.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 (58) hide show
  1. package/README.md +60 -8
  2. package/dist/accounts.d.ts +5 -1
  3. package/dist/accounts.js +13 -1
  4. package/dist/accounts.js.map +1 -1
  5. package/dist/artifacts.js +6 -6
  6. package/dist/browser.d.ts +2 -1
  7. package/dist/browser.js +6 -4
  8. package/dist/{chunk-C2H7HBNP.js → chunk-6NEPJ7NC.js} +2 -2
  9. package/dist/{chunk-TX3EIENU.js → chunk-BESZFWMU.js} +2 -2
  10. package/dist/{chunk-YTAWBDO2.js → chunk-E5BNEG2D.js} +2 -1
  11. package/dist/chunk-E5BNEG2D.js.map +1 -0
  12. package/dist/{chunk-7ZXBPJZP.js → chunk-GY6RQPCG.js} +282 -43
  13. package/dist/chunk-GY6RQPCG.js.map +1 -0
  14. package/dist/{chunk-C4DJPZRU.js → chunk-OO5LPTO7.js} +14 -1
  15. package/dist/chunk-OO5LPTO7.js.map +1 -0
  16. package/dist/{chunk-GW3EJ2GP.js → chunk-QTBAMHEF.js} +28 -3
  17. package/dist/{chunk-GW3EJ2GP.js.map → chunk-QTBAMHEF.js.map} +1 -1
  18. package/dist/{chunk-VUQZAB3O.js → chunk-TFCLHRZK.js} +2 -2
  19. package/dist/client.d.ts +47 -11
  20. package/dist/codex-realtime-controller.js +2 -2
  21. package/dist/company-profile.d.ts +13 -0
  22. package/dist/core.d.ts +2 -1
  23. package/dist/core.js +7 -5
  24. package/dist/document-authority.js +5 -5
  25. package/dist/editable-artifacts.js +1 -1
  26. package/dist/errors.d.ts +12 -0
  27. package/dist/index.d.ts +6 -3
  28. package/dist/index.js +219 -7
  29. package/dist/index.js.map +1 -1
  30. package/dist/interaction.d.ts +3 -0
  31. package/dist/interaction.js +4 -2
  32. package/dist/model-picker-order.d.ts +1 -0
  33. package/dist/model-picker-order.js +10 -0
  34. package/dist/model-picker-order.js.map +1 -0
  35. package/dist/realtime.d.ts +3 -1
  36. package/dist/realtime.js +2 -2
  37. package/dist/realtime.js.map +1 -1
  38. package/dist/session-titles.d.ts +28 -0
  39. package/dist/types.d.ts +90 -3
  40. package/package.json +6 -2
  41. package/src/accounts.ts +18 -0
  42. package/src/browser.ts +2 -0
  43. package/src/client.ts +407 -35
  44. package/src/company-profile.ts +13 -0
  45. package/src/core.ts +2 -0
  46. package/src/errors.ts +23 -0
  47. package/src/index.ts +29 -0
  48. package/src/interaction.ts +32 -0
  49. package/src/model-picker-order.ts +6 -0
  50. package/src/realtime.ts +1 -0
  51. package/src/session-titles.ts +84 -0
  52. package/src/types.ts +105 -2
  53. package/dist/chunk-7ZXBPJZP.js.map +0 -1
  54. package/dist/chunk-C4DJPZRU.js.map +0 -1
  55. package/dist/chunk-YTAWBDO2.js.map +0 -1
  56. /package/dist/{chunk-C2H7HBNP.js.map → chunk-6NEPJ7NC.js.map} +0 -0
  57. /package/dist/{chunk-TX3EIENU.js.map → chunk-BESZFWMU.js.map} +0 -0
  58. /package/dist/{chunk-VUQZAB3O.js.map → chunk-TFCLHRZK.js.map} +0 -0
@@ -82,6 +82,19 @@ export type CompanyProfileMutationResponse = {
82
82
  head: CompanyProfileHead | null;
83
83
  event: CompanyProfileActivationEvent | null;
84
84
  };
85
+ export type CompanyProfileAgentPolicyMode = "off" | "suggest" | "automatic";
86
+ export type CompanyProfileAgentPolicy = {
87
+ organizationId: string;
88
+ mode: CompanyProfileAgentPolicyMode;
89
+ version: number;
90
+ updatedAt: string;
91
+ changed?: boolean;
92
+ };
93
+ export type UpdateCompanyProfileAgentPolicyRequest = {
94
+ mode: CompanyProfileAgentPolicyMode;
95
+ expectedVersion: number;
96
+ operationId: string;
97
+ };
85
98
  export type CompanyProfileDiffRequest = { fromRevisionId: string; toRevisionId: string };
86
99
  export type CompanyProfileDiffResponse = {
87
100
  from: CompanyProfileRevision;
package/src/core.ts CHANGED
@@ -13,9 +13,11 @@ export type {
13
13
  export {
14
14
  OpenGeniApiContractMismatchError,
15
15
  OpenGeniApiError,
16
+ OpenGeniSecureContextRequiredError,
16
17
  OpenGeniSessionListCursorError,
17
18
  OpenGeniStreamError,
18
19
  isRetryableStreamError,
19
20
  } from "./errors";
21
+ export type { OpenGeniSecureContextRequiredReason } from "./errors";
20
22
  export { resolveWorkspaceVoiceInputEnabled } from "./transcription";
21
23
  export { OPENGENI_API_CONTRACT_HEADER, OPENGENI_API_CONTRACT_REVISION } from "./types";
package/src/errors.ts CHANGED
@@ -49,6 +49,29 @@ export class OpenGeniApiError extends Error {
49
49
  }
50
50
  }
51
51
 
52
+ export type OpenGeniSecureContextRequiredReason = "insecure_context" | "web_crypto_unavailable";
53
+
54
+ /**
55
+ * A browser operation requires secure-context-only platform capabilities.
56
+ * Callers may key UI behavior on the stable `secure_context_required` code;
57
+ * `reason` exists only to keep the human guidance truthful.
58
+ */
59
+ export class OpenGeniSecureContextRequiredError extends Error {
60
+ readonly code = "secure_context_required" as const;
61
+ readonly retryable = false;
62
+ readonly reason: OpenGeniSecureContextRequiredReason;
63
+
64
+ constructor(reason: OpenGeniSecureContextRequiredReason) {
65
+ super(
66
+ reason === "insecure_context"
67
+ ? "Couldn’t attach this file because OpenGeni is open over HTTP. Attachments require a secure HTTPS connection. Open the secure site or configure HTTPS for this deployment."
68
+ : "Couldn’t attach this file because secure browser cryptography is unavailable. Attachments require HTTPS and Web Crypto support. Open a secure site in a supported browser or configure HTTPS for this deployment.",
69
+ );
70
+ this.name = "OpenGeniSecureContextRequiredError";
71
+ this.reason = reason;
72
+ }
73
+ }
74
+
52
75
  function decodeApiErrorBody(body: string): {
53
76
  code: string | undefined;
54
77
  message: string | undefined;
package/src/index.ts CHANGED
@@ -26,10 +26,18 @@ export type {
26
26
  export {
27
27
  OpenGeniApiContractMismatchError,
28
28
  OpenGeniApiError,
29
+ OpenGeniSecureContextRequiredError,
29
30
  OpenGeniSessionListCursorError,
30
31
  OpenGeniStreamError,
31
32
  isRetryableStreamError,
32
33
  } from "./errors";
34
+ export type { OpenGeniSecureContextRequiredReason } from "./errors";
35
+ export {
36
+ AUTOMATIC_SESSION_TITLE_FALLBACK,
37
+ deriveSessionDisplayTitle,
38
+ sessionTitleIsPending,
39
+ } from "./session-titles";
40
+ export type { SessionDisplayTitleInput, SessionDisplayTitleOptions } from "./session-titles";
33
41
  export {
34
42
  formatSseEvent,
35
43
  proxySessionEventStream,
@@ -188,6 +196,8 @@ export {
188
196
  } from "./company-profile";
189
197
  export type {
190
198
  ActivateCompanyProfileRevisionRequest,
199
+ CompanyProfileAgentPolicy,
200
+ CompanyProfileAgentPolicyMode,
191
201
  CompanyProfileActivationEvent,
192
202
  CompanyProfileContent,
193
203
  CompanyProfileDiffRequest,
@@ -201,6 +211,7 @@ export type {
201
211
  CompanyProfileRevisionIdentity,
202
212
  RollbackCompanyProfileRequest,
203
213
  UpdateCompanyProfileRequest,
214
+ UpdateCompanyProfileAgentPolicyRequest,
204
215
  } from "./company-profile";
205
216
  export type {
206
217
  ActivateWorkspaceInstructionPolicyRequest,
@@ -469,6 +480,7 @@ export type {
469
480
  EndSessionRealtimeRequest,
470
481
  ModelAvailabilityV1,
471
482
  ModelBillingAttributionV1,
483
+ ModelCostClassV1,
472
484
  ModelCapabilitiesV1,
473
485
  ModelCapabilityStateV1,
474
486
  ModelCapabilitySupportV1,
@@ -484,12 +496,21 @@ export type {
484
496
  SessionRealtimeState,
485
497
  WorkspaceModelCatalogModel,
486
498
  WorkspaceModelCatalogResponse,
499
+ WorkspaceGatewayCustomModel,
500
+ WorkspaceGatewayCustomModelsResponse,
501
+ CreateWorkspaceGatewayCustomModelRequest,
502
+ DeleteWorkspaceGatewayCustomModelRequest,
503
+ WorkspaceOpenRouterCustomModel,
504
+ WorkspaceOpenRouterCustomModelsResponse,
505
+ CreateWorkspaceOpenRouterCustomModelRequest,
506
+ DeleteWorkspaceOpenRouterCustomModelRequest,
487
507
  WorkspaceModelAccessPolicy,
488
508
  WorkspaceRealtimeModelCatalogItem,
489
509
  WorkspaceRealtimeModelCatalogResponse,
490
510
  CodexAccount,
491
511
  CodexAccountOverview,
492
512
  CodexAccountsResponse,
513
+ OrganizationCodexAccountsResponse,
493
514
  CodexAllocatorUpdate,
494
515
  CodexAccountSwitchedPayload,
495
516
  CodexConnectionStatus,
@@ -514,6 +535,8 @@ export type {
514
535
  CodexRotationSettings,
515
536
  CodexUsage,
516
537
  CodexUsageMap,
538
+ WorkspaceCodexSubscriptionMode,
539
+ WorkspaceCodexSubscriptionSource,
517
540
  CodexUsagePayload,
518
541
  CodexUsageWindow,
519
542
  CompactSessionContextResult,
@@ -521,6 +544,7 @@ export type {
521
544
  CompleteFileUploadResponse,
522
545
  ConnectionKind,
523
546
  ConnectionMetadata,
547
+ McpConnectionAuthoritySelection,
524
548
  ConnectionOwnership,
525
549
  ConnectionResponse,
526
550
  ConnectionStatus,
@@ -549,6 +573,7 @@ export type {
549
573
  AddDocumentRequest,
550
574
  CreateApiKeyRequest,
551
575
  CreateApiKeyResponse,
576
+ CreateOrganizationApiKeyRequest,
552
577
  CreateCapabilityCatalogItemRequest,
553
578
  OpenGeniSlackBotInstallRequest,
554
579
  OpenGeniSlackBotInstallStart,
@@ -577,6 +602,8 @@ export type {
577
602
  CreateVariableSetRequest,
578
603
  CreateWorkspaceEnvironmentRequest,
579
604
  CreateWorkspaceRequest,
605
+ EnsureWorkspaceRequest,
606
+ EnsureWorkspaceResponse,
580
607
  DiscoverMcpCapabilitiesResponse,
581
608
  InstallSkillRequest,
582
609
  InstallLibrarySkillRequest,
@@ -677,6 +704,7 @@ export type {
677
704
  ListConnectionsResponse,
678
705
  ListPacksResponse,
679
706
  ListSlackUserLinkAccessRequestsResponse,
707
+ ListWorkspaceMemberCandidatesResponse,
680
708
  ListWorkspaceMembersResponse,
681
709
  McpServerConnectionRef,
682
710
  McpPersonalConnectionDelegation,
@@ -995,6 +1023,7 @@ export type {
995
1023
  WorkspaceEnvironment,
996
1024
  WorkspaceEnvironmentVariableMetadata,
997
1025
  WorkspaceMember,
1026
+ WorkspaceMemberCandidate,
998
1027
  PreviewSkillImportRequest,
999
1028
  ApiIntegrationAuthPreview,
1000
1029
  ApiIntegrationInstallationSummary,
@@ -1558,6 +1558,12 @@ export interface InteractionTransport {
1558
1558
  targetId: string,
1559
1559
  options?: OpenGeniRequestOptions,
1560
1560
  ): Promise<ComputerObservation>;
1561
+ captureComputerTarget(
1562
+ workspaceId: string,
1563
+ computerSessionId: string,
1564
+ targetId: string,
1565
+ options?: OpenGeniRequestOptions,
1566
+ ): Promise<ComputerFrame>;
1561
1567
  actInComputer(
1562
1568
  workspaceId: string,
1563
1569
  computerSessionId: string,
@@ -2402,6 +2408,10 @@ export class ComputerSessionResource {
2402
2408
  return await this.transport.observeComputerTarget(this.workspaceId, this.id, targetId, options);
2403
2409
  }
2404
2410
 
2411
+ async capture(targetId: string, options: OpenGeniRequestOptions = {}): Promise<ComputerFrame> {
2412
+ return await this.transport.captureComputerTarget(this.workspaceId, this.id, targetId, options);
2413
+ }
2414
+
2405
2415
  async act(
2406
2416
  request: ComputerActionRequest,
2407
2417
  options: OpenGeniRequestOptions = {},
@@ -2791,6 +2801,28 @@ export function parseComputerFrameMetadata(value: unknown): ComputerFrameMetadat
2791
2801
  return metadata;
2792
2802
  }
2793
2803
 
2804
+ export function decodeComputerFrameMetadataHeader(value: string): ComputerFrameMetadata {
2805
+ if (!value || value.length > 32 * 1024 || !/^[A-Za-z0-9_-]+$/u.test(value)) {
2806
+ throw new Error("computer frame metadata header is invalid");
2807
+ }
2808
+ const normalized = value.replace(/-/gu, "+").replace(/_/gu, "/");
2809
+ const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
2810
+ let decoded: string;
2811
+ try {
2812
+ decoded = atob(padded);
2813
+ } catch {
2814
+ throw new Error("computer frame metadata header is invalid");
2815
+ }
2816
+ const bytes = Uint8Array.from(decoded, (character) => character.charCodeAt(0));
2817
+ let metadata: unknown;
2818
+ try {
2819
+ metadata = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
2820
+ } catch {
2821
+ throw new Error("computer frame metadata header is invalid");
2822
+ }
2823
+ return parseComputerFrameMetadata(metadata);
2824
+ }
2825
+
2794
2826
  function newestRelevantBrowser(
2795
2827
  sessions: readonly BrowserSession[],
2796
2828
  associationSessionId: string,
@@ -0,0 +1,6 @@
1
+ export {
2
+ compareModelPickerOrder,
3
+ modelPickerBillingClassFor,
4
+ type ModelPickerBillingCandidate,
5
+ type ModelPickerBillingClass,
6
+ } from "@opengeni/contracts/model-picker-order";
package/src/realtime.ts CHANGED
@@ -30,6 +30,7 @@ import type { SessionRealtimeModel, WorkspaceRealtimeModelCatalogResponse } from
30
30
  export type SessionRealtimeClientLike = CodexRealtimeControllerClient & {
31
31
  getWorkspaceRealtimeModelCatalog(
32
32
  workspaceId: string,
33
+ options?: { signal?: AbortSignal | undefined },
33
34
  ): Promise<WorkspaceRealtimeModelCatalogResponse>;
34
35
  };
35
36
 
@@ -0,0 +1,84 @@
1
+ import {
2
+ AUTOMATIC_SESSION_TITLE_FALLBACK,
3
+ boundAutomaticSessionTitle,
4
+ containsSensitiveAutomaticSessionTitleValue,
5
+ } from "@opengeni/contracts/session-titles";
6
+ import type { Session } from "./types";
7
+
8
+ export { AUTOMATIC_SESSION_TITLE_FALLBACK };
9
+
10
+ // Session creation accepts a body far larger than a navigation label. Bound
11
+ // the source before any replace/split/normalization so a persisted large prompt
12
+ // cannot amplify memory or CPU on every browser render.
13
+ const PROMPT_PREVIEW_SCAN_MAX_CODE_UNITS = 4_096;
14
+
15
+ function deriveOpeningPromptPreview(value: unknown): string | null {
16
+ if (typeof value !== "string") return null;
17
+
18
+ const firstLine = value
19
+ .slice(0, PROMPT_PREVIEW_SCAN_MAX_CODE_UNITS)
20
+ .replace(/[\u0000-\u001f\u007f-\u009f]+/gu, "\n")
21
+ .split(/\n+/u)
22
+ .map((line) => line.trim())
23
+ .find(Boolean);
24
+ if (!firstLine) return null;
25
+ if (containsSensitiveAutomaticSessionTitleValue(firstLine)) return null;
26
+
27
+ const preview = boundAutomaticSessionTitle(firstLine.replace(/\s+/gu, " "))
28
+ .replace(/[\s.!?,;:\-–—]+$/u, "")
29
+ .trim();
30
+ if (!preview) return null;
31
+ return preview;
32
+ }
33
+
34
+ export type SessionDisplayTitleInput = {
35
+ title?: Session["title"] | undefined;
36
+ titleSource?: Session["titleSource"] | undefined;
37
+ initialMessage?: Session["initialMessage"] | null | undefined;
38
+ metadata?: Readonly<Record<string, unknown>> | undefined;
39
+ };
40
+
41
+ export type SessionDisplayTitleOptions = {
42
+ /** Optional metadata fields to try before the opening-prompt preview. */
43
+ metadataKeys?: readonly string[] | undefined;
44
+ };
45
+
46
+ /**
47
+ * Whether the durable title still represents the automatic-title pending state.
48
+ * A user-authored title always wins, even when its literal value is the fallback.
49
+ */
50
+ export function sessionTitleIsPending(input: SessionDisplayTitleInput): boolean {
51
+ const title = input.title?.trim() ?? "";
52
+ return input.titleSource !== "user" && (!title || title === AUTOMATIC_SESSION_TITLE_FALLBACK);
53
+ }
54
+
55
+ /**
56
+ * Derive the title a client should display for a session.
57
+ *
58
+ * A semantic agent title or human rename wins. While automatic naming is still
59
+ * pending, clients show a short, sensitive-safe preview of the opening prompt;
60
+ * the preview is never persisted as title metadata and is replaced naturally
61
+ * when `session.title_set` arrives. Obvious credential-, URL-, or identifier-
62
+ * shaped prompt prefixes retain the generic fallback.
63
+ */
64
+ export function deriveSessionDisplayTitle(
65
+ input: SessionDisplayTitleInput,
66
+ options: SessionDisplayTitleOptions = {},
67
+ ): string {
68
+ const title = input.title?.trim() ?? "";
69
+ if (input.titleSource === "user") {
70
+ return title || AUTOMATIC_SESSION_TITLE_FALLBACK;
71
+ }
72
+ if (title && !sessionTitleIsPending(input)) {
73
+ return title;
74
+ }
75
+
76
+ for (const key of options.metadataKeys ?? []) {
77
+ const value = input.metadata?.[key];
78
+ if (typeof value === "string" && value.trim().length > 0) {
79
+ return value.trim();
80
+ }
81
+ }
82
+
83
+ return deriveOpeningPromptPreview(input.initialMessage) ?? AUTOMATIC_SESSION_TITLE_FALLBACK;
84
+ }
package/src/types.ts CHANGED
@@ -329,6 +329,7 @@ export type SessionCapabilities = {
329
329
  codecs: ("h264-mp4" | "vp9-webm")[];
330
330
  reason: CapabilityUnavailableReason | null;
331
331
  };
332
+ /** @deprecated Use the managed ComputerSession interaction tools. */
332
333
  ComputerUse: {
333
334
  available: boolean;
334
335
  readOnly: boolean;
@@ -345,6 +346,7 @@ export type TerminalCapability = SessionCapabilities["Terminal"];
345
346
  export type GitCapability = SessionCapabilities["Git"];
346
347
  export type DesktopStreamCapability = SessionCapabilities["DesktopStream"];
347
348
  export type RecordingCapability = SessionCapabilities["Recording"];
349
+ /** @deprecated Use the managed ComputerSession interaction tools. */
348
350
  export type ComputerUseCapability = SessionCapabilities["ComputerUse"];
349
351
 
350
352
  // ── Stream-surfacing client surface (Phase 5) ───────────────────────────────
@@ -637,6 +639,7 @@ export type McpPersonalConnectionSummary = Pick<
637
639
 
638
640
  export type ConnectionMetadata = {
639
641
  id: string;
642
+ authorityId?: string | undefined;
640
643
  accountId: string;
641
644
  workspaceId: string;
642
645
  subjectId: string | null;
@@ -668,6 +671,7 @@ export type CreateConnectionRequest = {
668
671
  grantedScopes?: string[] | undefined;
669
672
  expiresAt?: string | null | undefined;
670
673
  metadata?: Record<string, unknown> | undefined;
674
+ operationId?: string | undefined;
671
675
  };
672
676
 
673
677
  export type PersonalGitHubConnectionMetadata = {
@@ -1069,6 +1073,8 @@ export type UpdateConnectionRequest = {
1069
1073
  grantedScopes?: string[] | undefined;
1070
1074
  expiresAt?: string | null | undefined;
1071
1075
  metadata?: Record<string, unknown> | undefined;
1076
+ expectedVersion?: number | undefined;
1077
+ operationId?: string | undefined;
1072
1078
  };
1073
1079
 
1074
1080
  export type ConnectionResponse = {
@@ -1354,6 +1360,7 @@ export type Session = {
1354
1360
  pausedDescendants: number;
1355
1361
  failedDescendants: number;
1356
1362
  unreadDescendants?: number | undefined;
1363
+ unreadFailedDescendants?: number | undefined;
1357
1364
  activelyWorkingDescendants?: number | undefined;
1358
1365
  /**
1359
1366
  * Earliest moment one of the counted `attentionDescendants` entered
@@ -2623,6 +2630,7 @@ export type ScheduledTaskAgentConfig = {
2623
2630
  model?: string | undefined;
2624
2631
  reasoningEffort?: ReasoningEffort | undefined;
2625
2632
  sandboxBackend?: SandboxBackend | undefined;
2633
+ machineTarget?: { targetSandboxId: string; workingDir?: string | undefined } | undefined;
2626
2634
  goal?: GoalSpec | undefined;
2627
2635
  executionClass?: "incident_telemetry" | undefined;
2628
2636
  incidentTelemetryPreflight?: IncidentTelemetryPreflight | undefined;
@@ -2795,6 +2803,7 @@ export const KNOWN_PERMISSIONS = [
2795
2803
  "api_keys:manage",
2796
2804
  "connections:read",
2797
2805
  "connections:write",
2806
+ "capabilities:manage",
2798
2807
  "environments:manage",
2799
2808
  "environments:use",
2800
2809
  "variable-sets:list",
@@ -3024,6 +3033,8 @@ export type ModelBillingAttributionV1 = {
3024
3033
  metering: "opengeni_credits" | "external";
3025
3034
  };
3026
3035
 
3036
+ export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace";
3037
+
3027
3038
  export type ModelPricingV1 = {
3028
3039
  inputMicrosPerMillionTokens: number;
3029
3040
  cachedInputMicrosPerMillionTokens?: number | undefined;
@@ -3056,7 +3067,7 @@ export type ClientModel = {
3056
3067
  provider: string;
3057
3068
  providerLabel: string;
3058
3069
  api: "responses" | "chat";
3059
- source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | undefined;
3070
+ source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | "openrouter" | undefined;
3060
3071
  contextWindowTokens?: number | undefined;
3061
3072
  schemaVersion?: 1 | undefined;
3062
3073
  aliases?: string[] | undefined;
@@ -3076,6 +3087,7 @@ export type ClientModel = {
3076
3087
  | undefined;
3077
3088
  credentialSource?: ModelCredentialSourceV1 | undefined;
3078
3089
  billing?: ModelBillingAttributionV1 | undefined;
3090
+ cost?: ModelCostClassV1 | undefined;
3079
3091
  capabilities?: ModelCapabilitiesV1 | undefined;
3080
3092
  pricing?: ModelPricingScheduleV1 | undefined;
3081
3093
  definitionVersion?: string | undefined;
@@ -3120,6 +3132,40 @@ export type WorkspaceModelCatalogResponse = {
3120
3132
  models: WorkspaceModelCatalogModel[];
3121
3133
  };
3122
3134
 
3135
+ export type WorkspaceGatewayCustomModel = {
3136
+ id: string;
3137
+ upstreamModelId: string;
3138
+ label: string | null;
3139
+ version: number;
3140
+ createdAt: string;
3141
+ updatedAt: string;
3142
+ };
3143
+
3144
+ export type WorkspaceGatewayCustomModelsResponse = {
3145
+ models: WorkspaceGatewayCustomModel[];
3146
+ };
3147
+
3148
+ export type CreateWorkspaceGatewayCustomModelRequest = {
3149
+ operationId: string;
3150
+ upstreamModelId: string;
3151
+ label?: string | undefined;
3152
+ };
3153
+
3154
+ export type DeleteWorkspaceGatewayCustomModelRequest = {
3155
+ expectedVersion: number;
3156
+ operationId: string;
3157
+ };
3158
+
3159
+ export type WorkspaceOpenRouterCustomModel = WorkspaceGatewayCustomModel;
3160
+
3161
+ export type WorkspaceOpenRouterCustomModelsResponse = {
3162
+ models: WorkspaceOpenRouterCustomModel[];
3163
+ };
3164
+
3165
+ export type CreateWorkspaceOpenRouterCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3166
+
3167
+ export type DeleteWorkspaceOpenRouterCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3168
+
3123
3169
  /**
3124
3170
  * The workspace's hard model/provider allowlist. `null` means unrestricted for
3125
3171
  * that dimension; an empty array is an explicit total block.
@@ -3156,6 +3202,23 @@ export type CodexConnectionStatus = {
3156
3202
  } | null;
3157
3203
  /** How many Codex accounts the workspace has connected. */
3158
3204
  accountCount?: number;
3205
+ source?: WorkspaceCodexSubscriptionSource;
3206
+ };
3207
+
3208
+ export type WorkspaceCodexSubscriptionMode =
3209
+ | "automatic"
3210
+ | "workspace"
3211
+ | "organization"
3212
+ | "disabled";
3213
+
3214
+ export type WorkspaceCodexSubscriptionSource = {
3215
+ accountId: string;
3216
+ workspaceId: string;
3217
+ workspaceKind: "personal" | "shared";
3218
+ mode: WorkspaceCodexSubscriptionMode;
3219
+ effectiveSource: "workspace" | "organization" | "disabled";
3220
+ workspaceAvailable: boolean;
3221
+ organizationAvailable: boolean;
3159
3222
  };
3160
3223
 
3161
3224
  /**
@@ -3205,6 +3268,7 @@ export type CodexUsagePayload = {
3205
3268
  /** One connected Codex (ChatGPT) account in a workspace (multi-account P1). Metadata only. */
3206
3269
  export type CodexAccount = {
3207
3270
  id: string;
3271
+ source?: "workspace" | "organization";
3208
3272
  chatgptAccountId?: string | null;
3209
3273
  label?: string | null;
3210
3274
  email?: string | null;
@@ -3317,6 +3381,7 @@ export type CodexRotationSettings = {
3317
3381
  export type CodexAccountsResponse = {
3318
3382
  accounts: CodexAccount[];
3319
3383
  activeAccountId: string | null;
3384
+ source?: WorkspaceCodexSubscriptionSource;
3320
3385
  /** Added by Apps-aware servers; absent on older same-major deployments. */
3321
3386
  apps?: {
3322
3387
  available: boolean;
@@ -3328,6 +3393,8 @@ export type CodexAccountsResponse = {
3328
3393
  settings: CodexRotationSettings;
3329
3394
  };
3330
3395
 
3396
+ export type OrganizationCodexAccountsResponse = Omit<CodexAccountsResponse, "apps" | "source">;
3397
+
3331
3398
  export type CodexAppsUpdate = {
3332
3399
  credentialId: string | null;
3333
3400
  version: number;
@@ -3467,6 +3534,8 @@ export type ClientAuthConfig =
3467
3534
  session: "cookie";
3468
3535
  /** Defaults to true when omitted by an older deployment. */
3469
3536
  emailVerificationRequired?: boolean;
3537
+ /** Configured managed sign-in providers; omitted by older deployments. */
3538
+ socialProviders?: ("google" | "github")[];
3470
3539
  };
3471
3540
 
3472
3541
  // Kept value-identical to @opengeni/contracts and pinned by the SDK contract
@@ -3492,6 +3561,7 @@ export type ClientConfig = {
3492
3561
  models: ClientModel[];
3493
3562
  defaultReasoningEffort: ReasoningEffort;
3494
3563
  allowedReasoningEfforts: ReasoningEffort[];
3564
+ defaultSandboxBackend?: SandboxBackend | undefined;
3495
3565
  mcpServers: { id: string; name: string }[];
3496
3566
  /** Deployment defaults and hard maximum for built-in OpenGeni session tools. */
3497
3567
  firstPartyMcpTools?:
@@ -4217,6 +4287,20 @@ export type CreateWorkspaceRequest = {
4217
4287
  agentInstructions?: string | null | undefined;
4218
4288
  };
4219
4289
 
4290
+ export type EnsureWorkspaceRequest = {
4291
+ accountId: string;
4292
+ externalSource: string;
4293
+ externalId: string;
4294
+ name: string;
4295
+ slug?: string | undefined;
4296
+ agentInstructions?: string | null | undefined;
4297
+ };
4298
+
4299
+ export type EnsureWorkspaceResponse = {
4300
+ workspace: Workspace;
4301
+ created: boolean;
4302
+ };
4303
+
4220
4304
  export type UpdateWorkspaceRequest = {
4221
4305
  name?: string | undefined;
4222
4306
  slug?: string | null | undefined;
@@ -4251,6 +4335,12 @@ export type CreateApiKeyResponse = {
4251
4335
  token: string;
4252
4336
  };
4253
4337
 
4338
+ export type CreateOrganizationApiKeyRequest = {
4339
+ name: string;
4340
+ description?: string | undefined;
4341
+ expiresAt?: string | undefined;
4342
+ };
4343
+
4254
4344
  export type ListApiKeysResponse = {
4255
4345
  apiKeys: ApiKey[];
4256
4346
  };
@@ -4270,8 +4360,20 @@ export type ListWorkspaceMembersResponse = {
4270
4360
  members: WorkspaceMember[];
4271
4361
  };
4272
4362
 
4363
+ export type WorkspaceMemberCandidate = {
4364
+ organizationMembershipId: string;
4365
+ subjectId: string;
4366
+ name: string | null;
4367
+ email: string | null;
4368
+ organizationRole: "owner" | "admin" | "member";
4369
+ };
4370
+
4371
+ export type ListWorkspaceMemberCandidatesResponse = {
4372
+ members: WorkspaceMemberCandidate[];
4373
+ };
4374
+
4273
4375
  export type AddWorkspaceMemberRequest = {
4274
- email: string;
4376
+ organizationMembershipId: string;
4275
4377
  role?: string | undefined;
4276
4378
  permissions: Permission[];
4277
4379
  };
@@ -4781,6 +4883,7 @@ export type ScheduledTaskAgentConfigInput = {
4781
4883
  model?: string | undefined;
4782
4884
  reasoningEffort?: ReasoningEffort | undefined;
4783
4885
  sandboxBackend?: SandboxBackend | undefined;
4886
+ machineTarget?: { targetSandboxId: string; workingDir?: string | undefined } | undefined;
4784
4887
  goal?: GoalSpec | undefined;
4785
4888
  executionClass?: "incident_telemetry" | undefined;
4786
4889
  incidentTelemetryPreflight?: IncidentTelemetryPreflightInput | undefined;