@opengeni/sdk 3.3.2 → 3.7.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +80 -6
  2. package/dist/artifact-client.d.ts +4 -2
  3. package/dist/artifacts.d.ts +1 -1
  4. package/dist/artifacts.js +6 -6
  5. package/dist/browser.d.ts +5 -2
  6. package/dist/browser.js +14 -4
  7. package/dist/{chunk-YXQX7RQT.js → chunk-2E2BFEEN.js} +2 -2
  8. package/dist/{chunk-JUS2UYRP.js → chunk-3QDQTYOE.js} +3 -1
  9. package/dist/chunk-3QDQTYOE.js.map +1 -0
  10. package/dist/{chunk-C2H7HBNP.js → chunk-7S2MZ65L.js} +6 -6
  11. package/dist/chunk-FMLDFJ2Q.js +246 -0
  12. package/dist/chunk-FMLDFJ2Q.js.map +1 -0
  13. package/dist/{chunk-TRNI7KEO.js → chunk-IQTEPOI3.js} +228 -26
  14. package/dist/chunk-IQTEPOI3.js.map +1 -0
  15. package/dist/chunk-IRAEPLXG.js +350 -0
  16. package/dist/chunk-IRAEPLXG.js.map +1 -0
  17. package/dist/{chunk-QT3KFVDP.js → chunk-MPGVC7EO.js} +10 -2
  18. package/dist/chunk-MPGVC7EO.js.map +1 -0
  19. package/dist/{chunk-C4DJPZRU.js → chunk-OO5LPTO7.js} +14 -1
  20. package/dist/chunk-OO5LPTO7.js.map +1 -0
  21. package/dist/{chunk-KKRO2VCP.js → chunk-QTBAMHEF.js} +2 -2
  22. package/dist/client.d.ts +51 -11
  23. package/dist/codex-realtime-controller.js +2 -2
  24. package/dist/core.d.ts +5 -2
  25. package/dist/core.js +17 -7
  26. package/dist/document-authority.js +5 -5
  27. package/dist/editable-artifacts.js +4 -4
  28. package/dist/errors.d.ts +12 -0
  29. package/dist/github-repositories.d.ts +10 -0
  30. package/dist/github-repositories.js +36 -0
  31. package/dist/github-repositories.js.map +1 -0
  32. package/dist/index.d.ts +13 -6
  33. package/dist/index.js +99 -52
  34. package/dist/index.js.map +1 -1
  35. package/dist/interaction.js +2 -2
  36. package/dist/model-context.d.ts +49 -0
  37. package/dist/model-picker-order.d.ts +1 -0
  38. package/dist/model-picker-order.js +10 -0
  39. package/dist/model-picker-order.js.map +1 -0
  40. package/dist/proxy.d.ts +7 -5
  41. package/dist/realtime.js +2 -2
  42. package/dist/session-titles.d.ts +2 -28
  43. package/dist/site.d.ts +93 -0
  44. package/dist/site.js +35 -0
  45. package/dist/site.js.map +1 -0
  46. package/dist/stream.d.ts +2 -0
  47. package/dist/tools-FSTY4FAY.js +12 -0
  48. package/dist/tools-FSTY4FAY.js.map +1 -0
  49. package/dist/tools.d.ts +61 -0
  50. package/dist/types.d.ts +231 -9
  51. package/dist/workspace-artifacts.d.ts +26 -1
  52. package/package.json +14 -2
  53. package/src/artifact-client.ts +16 -1
  54. package/src/artifacts.ts +1 -0
  55. package/src/browser.ts +16 -0
  56. package/src/client.ts +332 -22
  57. package/src/core.ts +16 -0
  58. package/src/errors.ts +23 -0
  59. package/src/github-repositories.ts +60 -0
  60. package/src/index.ts +94 -1
  61. package/src/model-context.ts +69 -0
  62. package/src/model-picker-order.ts +6 -0
  63. package/src/proxy.ts +17 -6
  64. package/src/session-titles.ts +8 -82
  65. package/src/site.ts +544 -0
  66. package/src/stream.ts +29 -8
  67. package/src/tools.ts +396 -0
  68. package/src/types.ts +287 -10
  69. package/src/workspace-artifacts.ts +33 -2
  70. package/dist/chunk-C4DJPZRU.js.map +0 -1
  71. package/dist/chunk-JUS2UYRP.js.map +0 -1
  72. package/dist/chunk-QT3KFVDP.js.map +0 -1
  73. package/dist/chunk-TRNI7KEO.js.map +0 -1
  74. /package/dist/{chunk-YXQX7RQT.js.map → chunk-2E2BFEEN.js.map} +0 -0
  75. /package/dist/{chunk-C2H7HBNP.js.map → chunk-7S2MZ65L.js.map} +0 -0
  76. /package/dist/{chunk-KKRO2VCP.js.map → chunk-QTBAMHEF.js.map} +0 -0
package/src/types.ts CHANGED
@@ -72,6 +72,80 @@ export type GatewayRealtimeConnectResponse = {
72
72
  replay: false;
73
73
  };
74
74
 
75
+ export type ToolGatewayIdentity = {
76
+ serverId: string;
77
+ toolName: string;
78
+ };
79
+
80
+ export type ToolGatewayCatalogEntry = {
81
+ identity: ToolGatewayIdentity;
82
+ modelName: string;
83
+ codemodePath: string[];
84
+ title?: string | undefined;
85
+ description?: string | undefined;
86
+ inputSchema: Record<string, unknown>;
87
+ outputSchema?: Record<string, unknown> | undefined;
88
+ annotations?: Record<string, unknown> | undefined;
89
+ icons?: Array<Record<string, unknown>> | undefined;
90
+ source: "opengeni" | "files" | "docs" | "mcp" | "codex_apps" | "interaction";
91
+ approval: "none" | "human" | "policy";
92
+ };
93
+
94
+ export type ToolGatewayCatalog = {
95
+ version: 1;
96
+ accountId: string;
97
+ workspaceId: string;
98
+ generation: number;
99
+ digest: string;
100
+ createdAt: string;
101
+ entries: ToolGatewayCatalogEntry[];
102
+ };
103
+
104
+ export type ToolGatewayResult = {
105
+ content: Array<{ type: string; [key: string]: unknown }>;
106
+ structuredContent?: Record<string, unknown> | undefined;
107
+ isError?: boolean | undefined;
108
+ _meta?: Record<string, unknown> | undefined;
109
+ [key: string]: unknown;
110
+ };
111
+
112
+ export type ToolGatewayCallRequest = {
113
+ operationId?: string | undefined;
114
+ catalogDigest: string;
115
+ identity: ToolGatewayIdentity;
116
+ arguments: Record<string, unknown>;
117
+ siteArtifactId?: string | undefined;
118
+ siteVersionId?: string | undefined;
119
+ approvalToken?: string | undefined;
120
+ };
121
+
122
+ export type ToolGatewayApprovalRequest = {
123
+ operationId: string;
124
+ catalogDigest: string;
125
+ identity: ToolGatewayIdentity;
126
+ arguments: Record<string, unknown>;
127
+ };
128
+
129
+ export type ToolGatewayApprovalResponse = {
130
+ operationId: string;
131
+ catalogDigest: string;
132
+ identity: ToolGatewayIdentity;
133
+ approvalToken: string;
134
+ expiresAt: string;
135
+ };
136
+
137
+ export type ToolGatewayCallResponse = {
138
+ operationId: string;
139
+ catalogDigest: string;
140
+ result: ToolGatewayResult;
141
+ };
142
+
143
+ export type ToolGatewayDeclarationsResponse = {
144
+ catalogDigest: string;
145
+ moduleSpecifier: string;
146
+ source: string;
147
+ };
148
+
75
149
  export type ActivateCodexRealtimeConnectionRequest = {
76
150
  operationId: string;
77
151
  browserInstanceId: string;
@@ -610,6 +684,7 @@ export type McpConnectionAuthoritySelection = {
610
684
 
611
685
  export type McpServerConnectionRef = {
612
686
  connectionId?: string | undefined;
687
+ authoritySource?: "host" | undefined;
613
688
  provider?: string | undefined;
614
689
  providerDomain: string;
615
690
  kind?: ConnectionKind | undefined;
@@ -671,6 +746,7 @@ export type CreateConnectionRequest = {
671
746
  grantedScopes?: string[] | undefined;
672
747
  expiresAt?: string | null | undefined;
673
748
  metadata?: Record<string, unknown> | undefined;
749
+ operationId?: string | undefined;
674
750
  };
675
751
 
676
752
  export type PersonalGitHubConnectionMetadata = {
@@ -1072,6 +1148,8 @@ export type UpdateConnectionRequest = {
1072
1148
  grantedScopes?: string[] | undefined;
1073
1149
  expiresAt?: string | null | undefined;
1074
1150
  metadata?: Record<string, unknown> | undefined;
1151
+ expectedVersion?: number | undefined;
1152
+ operationId?: string | undefined;
1075
1153
  };
1076
1154
 
1077
1155
  export type ConnectionResponse = {
@@ -1749,6 +1827,8 @@ export const SESSION_EVENT_TYPES = [
1749
1827
  "sandbox.operation.failed",
1750
1828
  "session.command.backgrounded",
1751
1829
  "session.command.finished",
1830
+ "session.wait.started",
1831
+ "session.wait.finished",
1752
1832
  "sandbox.command.output.delta",
1753
1833
  "artifact.created",
1754
1834
  "goal.set",
@@ -1850,6 +1930,8 @@ export type SessionEvent = {
1850
1930
  sessionId: string;
1851
1931
  /** Per-session sequence number: positive, contiguous, strictly increasing. */
1852
1932
  sequence: number;
1933
+ /** Server-owned durable high-water mark for a synthetic compact event. */
1934
+ coveredThrough?: number | undefined;
1853
1935
  type: SessionEventType;
1854
1936
  payload: unknown;
1855
1937
  occurredAt: string;
@@ -1983,6 +2065,7 @@ export type ToolAuthNeededPayload = {
1983
2065
  providerDomain: string;
1984
2066
  provider?: string | undefined;
1985
2067
  connectionId?: string | null | undefined;
2068
+ authoritySource?: "host" | undefined;
1986
2069
  reason:
1987
2070
  | "missing_connection"
1988
2071
  | "expired"
@@ -1991,6 +2074,15 @@ export type ToolAuthNeededPayload = {
1991
2074
  | "personal_authority_unavailable"
1992
2075
  | "unsupported_auth"
1993
2076
  | "resource_scope_unavailable";
2077
+ hostReason?:
2078
+ | "missing_connection"
2079
+ | "expired"
2080
+ | "insufficient_scope"
2081
+ | "refresh_failed"
2082
+ | "personal_authority_unavailable"
2083
+ | "unsupported_auth"
2084
+ | "resource_scope_unavailable"
2085
+ | undefined;
1994
2086
  scopes?: string[] | undefined;
1995
2087
  resource?: string | undefined;
1996
2088
  selectedResources?: Array<{ id: string; kind: "repository" }> | undefined;
@@ -2060,7 +2152,14 @@ export type CodexFleetDecisionEventPayload = {
2060
2152
  actual: {
2061
2153
  outcome: "selected" | "waiting" | "none";
2062
2154
  candidateKey: string | null;
2063
- reason: "lease_reused" | "pin" | "rotation" | "active" | "all_capped" | "none";
2155
+ reason:
2156
+ | "lease_reused"
2157
+ | "pin"
2158
+ | "rotation"
2159
+ | "active"
2160
+ | "all_capped"
2161
+ | "allocator_disabled"
2162
+ | "none";
2064
2163
  };
2065
2164
  comparison: CodexFleetShadowComparison;
2066
2165
  replay: {
@@ -2211,11 +2310,16 @@ export type FsTreeNode = {
2211
2310
  truncated: boolean;
2212
2311
  };
2213
2312
  export type FsEncoding = "utf8" | "base64";
2313
+ export type FileSystemRouteIdentity = {
2314
+ epoch: number;
2315
+ root: string;
2316
+ };
2214
2317
  export type FsListRequest = {
2215
2318
  path?: string;
2216
2319
  depth?: number;
2217
2320
  maxEntries?: number;
2218
2321
  includeHidden?: boolean;
2322
+ route?: FileSystemRouteIdentity;
2219
2323
  };
2220
2324
  export type FsListResponse = {
2221
2325
  root: FsTreeNode;
@@ -2228,6 +2332,7 @@ export type FsReadRequest = {
2228
2332
  path: string;
2229
2333
  encoding?: FsEncoding;
2230
2334
  maxBytes?: number;
2335
+ route?: FileSystemRouteIdentity;
2231
2336
  };
2232
2337
  export type FsReadResponse = {
2233
2338
  path: string;
@@ -2252,26 +2357,36 @@ export type FsWriteRequest = {
2252
2357
  content: string;
2253
2358
  overwrite?: boolean;
2254
2359
  createParents?: boolean;
2360
+ route?: FileSystemRouteIdentity;
2255
2361
  };
2256
2362
  export type FsWriteResponse = {
2257
2363
  path: string;
2258
2364
  sizeBytes: number;
2259
2365
  revision: number;
2260
2366
  };
2261
- export type FsDeleteRequest = { path: string; recursive?: boolean };
2367
+ export type FsDeleteRequest = {
2368
+ path: string;
2369
+ recursive?: boolean;
2370
+ route?: FileSystemRouteIdentity;
2371
+ };
2262
2372
  export type FsDeleteResponse = { revision: number };
2263
2373
  export type FsMoveRequest = {
2264
2374
  path: string;
2265
2375
  newPath: string;
2266
2376
  overwrite?: boolean;
2267
2377
  createParents?: boolean;
2378
+ route?: FileSystemRouteIdentity;
2268
2379
  };
2269
2380
  export type FsMoveResponse = {
2270
2381
  path: string;
2271
2382
  newPath: string;
2272
2383
  revision: number;
2273
2384
  };
2274
- export type FsMkdirRequest = { path: string; recursive?: boolean };
2385
+ export type FsMkdirRequest = {
2386
+ path: string;
2387
+ recursive?: boolean;
2388
+ route?: FileSystemRouteIdentity;
2389
+ };
2275
2390
  export type FsMkdirResponse = { path: string; revision: number };
2276
2391
 
2277
2392
  // A2 Git request/response (the Pierre-diff feed).
@@ -2722,6 +2837,8 @@ export type CreateSessionRequest = {
2722
2837
  resources?: ResourceRef[] | undefined;
2723
2838
  /** Inline skills fixed onto this session; omitted children inherit them. */
2724
2839
  skills?: SessionSkill[] | undefined;
2840
+ /** Installed session-selected Skill identities to freeze onto this session at creation. */
2841
+ installedSkillIds?: string[] | undefined;
2725
2842
  tools?: ToolRef[] | undefined;
2726
2843
  metadata?: Record<string, unknown> | undefined;
2727
2844
  model?: string | undefined;
@@ -2836,7 +2953,7 @@ export type FirstPartyMcpToolName =
2836
2953
  | "goal_set"
2837
2954
  | "goal_update"
2838
2955
  | "goal_progress"
2839
- | "goal_wait"
2956
+ | "wait_for_input"
2840
2957
  | "goal_complete"
2841
2958
  | "goal_pause"
2842
2959
  | "memory_search"
@@ -2876,6 +2993,7 @@ export type FirstPartyMcpToolName =
2876
2993
  | "session_get"
2877
2994
  | "session_events"
2878
2995
  | "session_wait"
2996
+ | "command_wait"
2879
2997
  | "session_create"
2880
2998
  | "session_send_message"
2881
2999
  | "session_pause"
@@ -2968,6 +3086,8 @@ export type FirstPartyMcpToolName =
2968
3086
  | "artifacts_create"
2969
3087
  | "artifacts_publish"
2970
3088
  | "artifacts_rollback"
3089
+ | "artifacts_archive"
3090
+ | "artifacts_restore"
2971
3091
  | "editable_artifact_list"
2972
3092
  | "editable_artifact_create"
2973
3093
  | "editable_artifact_import"
@@ -3023,16 +3143,20 @@ export type ModelCapabilitiesV1 = {
3023
3143
  export type ModelCredentialSourceV1 =
3024
3144
  | { kind: "deployment"; mechanism: "api_key" | "azure_ad_bearer" }
3025
3145
  | { kind: "connected_subscription"; provider: "codex" | "xai" }
3026
- | { kind: "workspace_connection"; mechanism: "api_key" };
3146
+ | { kind: "workspace_connection"; mechanism: "api_key" }
3147
+ | { kind: "organization_connection"; mechanism: "api_key" };
3027
3148
 
3028
3149
  export type ModelBillingAttributionV1 = {
3029
- upstreamPayer: "deployment" | "workspace" | "connected_subscription";
3150
+ upstreamPayer: "deployment" | "workspace" | "organization" | "connected_subscription";
3030
3151
  metering: "opengeni_credits" | "external";
3031
3152
  };
3032
3153
 
3154
+ export type ModelCostClassV1 = "free" | "credits" | "subscription" | "workspace" | "organization";
3155
+
3033
3156
  export type ModelPricingV1 = {
3034
3157
  inputMicrosPerMillionTokens: number;
3035
3158
  cachedInputMicrosPerMillionTokens?: number | undefined;
3159
+ cacheWriteMicrosPerMillionTokens?: number | undefined;
3036
3160
  outputMicrosPerMillionTokens: number;
3037
3161
  marginBps?: number | undefined;
3038
3162
  };
@@ -3062,7 +3186,7 @@ export type ClientModel = {
3062
3186
  provider: string;
3063
3187
  providerLabel: string;
3064
3188
  api: "responses" | "chat";
3065
- source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | undefined;
3189
+ source?: "opengeni" | "codex" | "supergrok" | "workspace_gateway" | "openrouter" | undefined;
3066
3190
  contextWindowTokens?: number | undefined;
3067
3191
  schemaVersion?: 1 | undefined;
3068
3192
  aliases?: string[] | undefined;
@@ -3082,6 +3206,7 @@ export type ClientModel = {
3082
3206
  | undefined;
3083
3207
  credentialSource?: ModelCredentialSourceV1 | undefined;
3084
3208
  billing?: ModelBillingAttributionV1 | undefined;
3209
+ cost?: ModelCostClassV1 | undefined;
3085
3210
  capabilities?: ModelCapabilitiesV1 | undefined;
3086
3211
  pricing?: ModelPricingScheduleV1 | undefined;
3087
3212
  definitionVersion?: string | undefined;
@@ -3126,6 +3251,68 @@ export type WorkspaceModelCatalogResponse = {
3126
3251
  models: WorkspaceModelCatalogModel[];
3127
3252
  };
3128
3253
 
3254
+ export type WorkspaceGatewayCustomModel = {
3255
+ id: string;
3256
+ upstreamModelId: string;
3257
+ label: string | null;
3258
+ version: number;
3259
+ createdAt: string;
3260
+ updatedAt: string;
3261
+ };
3262
+
3263
+ export type WorkspaceGatewayCustomModelsResponse = {
3264
+ models: WorkspaceGatewayCustomModel[];
3265
+ };
3266
+
3267
+ export type CreateWorkspaceGatewayCustomModelRequest = {
3268
+ operationId: string;
3269
+ upstreamModelId: string;
3270
+ label?: string | undefined;
3271
+ };
3272
+
3273
+ export type DeleteWorkspaceGatewayCustomModelRequest = {
3274
+ expectedVersion: number;
3275
+ operationId: string;
3276
+ };
3277
+
3278
+ export type WorkspaceOpenRouterCustomModel = WorkspaceGatewayCustomModel;
3279
+
3280
+ export type WorkspaceOpenRouterCustomModelsResponse = {
3281
+ models: WorkspaceOpenRouterCustomModel[];
3282
+ };
3283
+
3284
+ export type CreateWorkspaceOpenRouterCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3285
+
3286
+ export type DeleteWorkspaceOpenRouterCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3287
+
3288
+ export type OrganizationModelProviderKind = "vercel_gateway" | "openrouter";
3289
+
3290
+ export type OrganizationModelProviderConnection = {
3291
+ providerKind: OrganizationModelProviderKind;
3292
+ status: "active" | "revoked";
3293
+ version: number;
3294
+ createdAt: string;
3295
+ updatedAt: string;
3296
+ };
3297
+
3298
+ export type UpsertOrganizationModelProviderConnectionRequest = {
3299
+ operationId: string;
3300
+ expectedVersion?: number | undefined;
3301
+ apiKey: string;
3302
+ };
3303
+
3304
+ export type RevokeOrganizationModelProviderConnectionRequest = {
3305
+ operationId: string;
3306
+ expectedVersion: number;
3307
+ };
3308
+
3309
+ export type OrganizationProviderCustomModel = WorkspaceGatewayCustomModel;
3310
+ export type OrganizationProviderCustomModelsResponse = {
3311
+ models: OrganizationProviderCustomModel[];
3312
+ };
3313
+ export type CreateOrganizationProviderCustomModelRequest = CreateWorkspaceGatewayCustomModelRequest;
3314
+ export type DeleteOrganizationProviderCustomModelRequest = DeleteWorkspaceGatewayCustomModelRequest;
3315
+
3129
3316
  /**
3130
3317
  * The workspace's hard model/provider allowlist. `null` means unrestricted for
3131
3318
  * that dimension; an empty array is an explicit total block.
@@ -3160,6 +3347,12 @@ export type CodexConnectionStatus = {
3160
3347
  label?: string | null;
3161
3348
  chatgptAccountId?: string | null;
3162
3349
  } | null;
3350
+ /** Live model-catalog probe result for the active account only. */
3351
+ activeAccountValid?: boolean;
3352
+ /** Cached readiness of any account in the effective worker pool. */
3353
+ poolReady?: boolean;
3354
+ /** Cached unpinned worker routability; rotation-off remains active-pointer-only. */
3355
+ workerRoutable?: boolean;
3163
3356
  /** How many Codex accounts the workspace has connected. */
3164
3357
  accountCount?: number;
3165
3358
  source?: WorkspaceCodexSubscriptionSource;
@@ -3938,6 +4131,16 @@ export type CreateOrganizationResponse = {
3938
4131
  organization: OrganizationSummary;
3939
4132
  workspaceId: string;
3940
4133
  };
4134
+ export type CreateAdditionalOrganizationRequest = {
4135
+ name: string;
4136
+ workspaceName: string;
4137
+ operationId: string;
4138
+ };
4139
+ export type CreateAdditionalOrganizationResponse = {
4140
+ organization: OrganizationSummary;
4141
+ workspaceId: string;
4142
+ personalWorkspaceId: string;
4143
+ };
3941
4144
  export type UpdateOrganizationNameRequest = {
3942
4145
  name: string;
3943
4146
  expectedUpdatedAt: string;
@@ -4482,7 +4685,7 @@ export type SessionGoalContinuation = {
4482
4685
  observedRevision: number;
4483
4686
  nextAttemptAt: string | null;
4484
4687
  lastError: string | null;
4485
- /** Agent-stated reason for a `held_for_input` hold; null otherwise. */
4688
+ /** Agent-stated reason for a `wait_for_input` hold; null otherwise. */
4486
4689
  holdReason?: string | null | undefined;
4487
4690
  };
4488
4691
 
@@ -4682,6 +4885,8 @@ export type SessionSystemUpdateKind =
4682
4885
  | "goal_continuation"
4683
4886
  | "agent_message"
4684
4887
  | "agent_steer_instruction"
4888
+ | "session_wait_timeout"
4889
+ | "background_command_result"
4685
4890
  | "child_terminal_result"
4686
4891
  | "media_generation_result"
4687
4892
  | "child_requires_action"
@@ -4697,6 +4902,30 @@ export type SessionSystemUpdateState =
4697
4902
  | "superseded"
4698
4903
  | "failed";
4699
4904
 
4905
+ export type SessionSystemUpdatePayload =
4906
+ | {
4907
+ type: "session_wait_timeout";
4908
+ waitTurnId: string;
4909
+ deadlineAt: string;
4910
+ reason: string;
4911
+ [key: string]: unknown;
4912
+ }
4913
+ | {
4914
+ type: "background_command_result";
4915
+ commandId: string;
4916
+ state: "exited" | "lost";
4917
+ exitCode: number | null;
4918
+ reason: string;
4919
+ outputLocator: {
4920
+ eventType: "sandbox.command.output.delta";
4921
+ commandId: string;
4922
+ };
4923
+ [key: string]: unknown;
4924
+ }
4925
+ | ({
4926
+ type: Exclude<SessionSystemUpdateKind, "session_wait_timeout" | "background_command_result">;
4927
+ } & Record<string, unknown>);
4928
+
4700
4929
  export type SessionSystemUpdate = {
4701
4930
  id: string;
4702
4931
  sessionId: string;
@@ -4705,7 +4934,7 @@ export type SessionSystemUpdate = {
4705
4934
  sourceId: string;
4706
4935
  dedupeKey: string;
4707
4936
  summary: string;
4708
- payload: Record<string, unknown>;
4937
+ payload: SessionSystemUpdatePayload;
4709
4938
  lineage: Record<string, unknown>;
4710
4939
  state: SessionSystemUpdateState;
4711
4940
  deliveredTurnId: string | null;
@@ -5959,10 +6188,12 @@ export type CapabilityPackSkillFile = {
5959
6188
  export type CapabilityPackSkill = {
5960
6189
  name: string;
5961
6190
  description?: string | undefined;
6191
+ /** Omitted means workspace-wide; session_selected requires explicit session attachment. */
6192
+ activationMode?: "workspace_managed" | "session_selected" | undefined;
5962
6193
  files: CapabilityPackSkillFile[];
5963
6194
  };
5964
6195
 
5965
- export type SessionSkill = CapabilityPackSkill;
6196
+ export type SessionSkill = Omit<CapabilityPackSkill, "activationMode">;
5966
6197
 
5967
6198
  export type CapabilityPackVariableSetSpec = {
5968
6199
  description: string;
@@ -6056,6 +6287,7 @@ export type RegisterCapabilityPackRequest = {
6056
6287
  | {
6057
6288
  name: string;
6058
6289
  description?: string | undefined;
6290
+ activationMode?: "workspace_managed" | "session_selected" | undefined;
6059
6291
  files: CapabilityPackSkillFile[];
6060
6292
  }[]
6061
6293
  | undefined;
@@ -6507,6 +6739,7 @@ export type CapabilityCatalogItem = {
6507
6739
  /** The connection backing this enabled installation, or null when none is involved. */
6508
6740
  connectionRef: {
6509
6741
  connectionId?: string | undefined;
6742
+ authoritySource?: "host" | undefined;
6510
6743
  providerDomain: string;
6511
6744
  kind: string;
6512
6745
  subjectScope?: "subject" | "workspace" | undefined;
@@ -7129,6 +7362,37 @@ export type GitHubRepositoriesResponse = {
7129
7362
  repositories: GitHubRepository[];
7130
7363
  };
7131
7364
 
7365
+ export type VerifyPublicGitHubRepositoryRefRequest = {
7366
+ url: string;
7367
+ ref: string;
7368
+ };
7369
+
7370
+ export type VerifyPublicGitHubRepositoryRefResponse = {
7371
+ owner: string;
7372
+ name: string;
7373
+ fullName: string;
7374
+ canonicalUrl: string;
7375
+ cloneUrl: string;
7376
+ defaultBranch: string;
7377
+ ref: string;
7378
+ commitSha: string;
7379
+ };
7380
+
7381
+ export type GitHubRepositoryBranch = {
7382
+ name: string;
7383
+ isDefault: boolean;
7384
+ };
7385
+
7386
+ export type ListGitHubRepositoryBranchesOptions = {
7387
+ cursor?: number | undefined;
7388
+ limit?: number | undefined;
7389
+ };
7390
+
7391
+ export type GitHubRepositoryBranchesResponse = {
7392
+ branches: GitHubRepositoryBranch[];
7393
+ nextCursor: number | null;
7394
+ };
7395
+
7132
7396
  export type CreateGitHubAppManifestRequest = {
7133
7397
  appName?: string | undefined;
7134
7398
  organization?: string | undefined;
@@ -7234,6 +7498,8 @@ export type InsightsModelUsageRow = {
7234
7498
  creditUsd: number;
7235
7499
  estimatedProviderUsd: number;
7236
7500
  estimatedProviderCostKnownCalls: number;
7501
+ equivalentCreditUsd: number;
7502
+ equivalentCreditCostKnownCalls: number;
7237
7503
  };
7238
7504
 
7239
7505
  export type InsightsSeriesPoint = {
@@ -7241,6 +7507,8 @@ export type InsightsSeriesPoint = {
7241
7507
  modelCostUsd: number;
7242
7508
  estimatedProviderUsd: number;
7243
7509
  estimatedProviderCostKnownCalls: number;
7510
+ equivalentCreditUsd: number;
7511
+ equivalentCreditCostKnownCalls: number;
7244
7512
  warmSeconds: number;
7245
7513
  inputTokens: number;
7246
7514
  outputTokens: number;
@@ -7272,6 +7540,8 @@ export type InsightsSpendDriver = {
7272
7540
  creditUsd: number;
7273
7541
  estimatedProviderUsd: number;
7274
7542
  estimatedProviderCostKnownCalls: number;
7543
+ equivalentCreditUsd: number;
7544
+ equivalentCreditCostKnownCalls: number;
7275
7545
  tokens: number;
7276
7546
  cacheHitPct: number;
7277
7547
  pctOfCreditUsd: number;
@@ -7317,6 +7587,8 @@ export type InsightsScheduleRow = {
7317
7587
  creditUsd: number | null;
7318
7588
  estimatedProviderUsd: number | null;
7319
7589
  estimatedProviderCostKnownCalls: number | null;
7590
+ equivalentCreditUsd: number | null;
7591
+ equivalentCreditCostKnownCalls: number | null;
7320
7592
  tokens: number | null;
7321
7593
  cacheHitPct: number | null;
7322
7594
  billing: InsightsBillingPath | null;
@@ -7341,6 +7613,7 @@ export type InsightsModelCallRow = {
7341
7613
  totalTokens: number | null;
7342
7614
  creditUsd: number;
7343
7615
  estimatedProviderUsd: number | null;
7616
+ equivalentCreditUsd: number | null;
7344
7617
  pricingSource: InsightsPricingSource | null;
7345
7618
  };
7346
7619
 
@@ -7401,6 +7674,10 @@ export type WorkspaceInsightsSnapshot = {
7401
7674
  priorEstimatedProviderUsd: number;
7402
7675
  estimatedProviderCostKnownCalls: number;
7403
7676
  priorEstimatedProviderCostKnownCalls: number;
7677
+ equivalentCreditUsd: number;
7678
+ priorEquivalentCreditUsd: number;
7679
+ equivalentCreditCostKnownCalls: number;
7680
+ priorEquivalentCreditCostKnownCalls: number;
7404
7681
  modelCalls: number;
7405
7682
  priorInputTokens: number;
7406
7683
  priorTotalTokens: number;
@@ -1,3 +1,15 @@
1
+ import type { ToolGatewayIdentity } from "./types";
2
+
3
+ export type WorkspaceArtifactSourceFile = {
4
+ path: string;
5
+ content: string;
6
+ };
7
+
8
+ export type WorkspaceArtifactSourceBundle = {
9
+ entrypoint: string;
10
+ files: WorkspaceArtifactSourceFile[];
11
+ };
12
+
1
13
  export type WorkspaceArtifactVersion = {
2
14
  id: string;
3
15
  accountId: string;
@@ -7,6 +19,9 @@ export type WorkspaceArtifactVersion = {
7
19
  contentType: "text/html";
8
20
  contentSha256: string;
9
21
  sizeBytes: number;
22
+ sourceSha256: string | null;
23
+ sourceSizeBytes: number | null;
24
+ requestedTools: ToolGatewayIdentity[];
10
25
  sourceSessionId: string | null;
11
26
  sourceTurnId: string | null;
12
27
  sourceAttemptId: string | null;
@@ -34,7 +49,7 @@ export type WorkspaceArtifactEvent = {
34
49
  accountId: string;
35
50
  workspaceId: string;
36
51
  artifactId: string;
37
- type: "published" | "rolled_back";
52
+ type: "published" | "rolled_back" | "archived" | "restored";
38
53
  fromVersionId: string | null;
39
54
  toVersionId: string;
40
55
  sourceSessionId: string | null;
@@ -46,7 +61,11 @@ export type WorkspaceArtifactEvent = {
46
61
  createdAt: string;
47
62
  };
48
63
 
49
- export type WorkspaceArtifactListOptions = { limit?: number; cursor?: string };
64
+ export type WorkspaceArtifactListOptions = {
65
+ limit?: number;
66
+ cursor?: string;
67
+ status?: WorkspaceArtifact["status"];
68
+ };
50
69
  export type WorkspaceArtifactListResponse = {
51
70
  artifacts: WorkspaceArtifact[];
52
71
  nextCursor: string | null;
@@ -65,6 +84,8 @@ export type WorkspaceArtifactContentResponse = {
65
84
  contentType: "text/html";
66
85
  contentSha256: string;
67
86
  html: string;
87
+ source: WorkspaceArtifactSourceBundle;
88
+ requestedTools: ToolGatewayIdentity[];
68
89
  };
69
90
  export type WorkspaceArtifactMutationResponse = {
70
91
  artifact: WorkspaceArtifact;
@@ -77,12 +98,16 @@ export type CreateWorkspaceArtifactRequest = {
77
98
  title: string;
78
99
  description?: string | null;
79
100
  html: string;
101
+ source?: WorkspaceArtifactSourceBundle;
102
+ requestedTools?: ToolGatewayIdentity[];
80
103
  idempotencyKey: string;
81
104
  };
82
105
  export type PublishWorkspaceArtifactVersionRequest = {
83
106
  title?: string;
84
107
  description?: string | null;
85
108
  html: string;
109
+ source?: WorkspaceArtifactSourceBundle;
110
+ requestedTools?: ToolGatewayIdentity[];
86
111
  expectedCurrentVersionId: string;
87
112
  idempotencyKey: string;
88
113
  };
@@ -92,3 +117,9 @@ export type RollbackWorkspaceArtifactRequest = {
92
117
  reason: string;
93
118
  idempotencyKey: string;
94
119
  };
120
+ export type SetWorkspaceArtifactStatusRequest = {
121
+ status: "active" | "archived";
122
+ expectedCurrentVersionId: string;
123
+ reason: string;
124
+ idempotencyKey: string;
125
+ };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/errors.ts"],"sourcesContent":["/** Error for a non-2xx OpenGeni API response. */\nexport class OpenGeniApiError extends Error {\n readonly status: number;\n readonly code: string | undefined;\n readonly retryable: boolean;\n readonly correlationId: string | undefined;\n /** True only when an uncontrolled transport failed after a mutation may have been accepted. */\n readonly outcomeUnknown: boolean;\n readonly body: string;\n readonly details: Record<string, unknown> | undefined;\n\n constructor(\n status: number,\n body: string,\n options: {\n code?: string | undefined;\n retryable?: boolean | undefined;\n correlationId?: string | undefined;\n outcomeUnknown?: boolean | undefined;\n displayMessage?: string | undefined;\n mutation?: boolean | undefined;\n } = {},\n ) {\n const decoded = decodeApiErrorBody(body);\n const correlationId = decoded?.requestId ?? boundedCorrelationId(options.correlationId);\n const gatewayFailure = status >= 502 && status <= 504;\n const fromResponse = options.mutation !== undefined;\n const message = decoded?.message ?? (fromResponse ? \"Request failed.\" : body || \"(empty body)\");\n const displayMessage =\n options.displayMessage ??\n (gatewayFailure && fromResponse\n ? (decoded?.message ?? \"OpenGeni is temporarily unavailable — retry.\")\n : `OpenGeni API ${status}: ${message}`);\n super(correlationId ? `${displayMessage} Reference: ${correlationId}.` : displayMessage);\n this.name = \"OpenGeniApiError\";\n this.status = status;\n this.code =\n options.code ??\n decoded?.code ??\n (gatewayFailure && fromResponse ? \"upstream_unavailable\" : undefined);\n this.retryable = options.retryable ?? decoded?.retryable ?? retryableApiStatus(status);\n this.correlationId = correlationId;\n this.outcomeUnknown =\n options.outcomeUnknown ??\n decoded?.outcomeUnknown ??\n (gatewayFailure && !!options.mutation && !decoded);\n this.body = !fromResponse || decoded ? body : \"\";\n this.details = decoded?.details;\n }\n}\n\nfunction decodeApiErrorBody(body: string): {\n code: string | undefined;\n message: string | undefined;\n requestId: string | undefined;\n retryable: boolean | undefined;\n outcomeUnknown: boolean | undefined;\n details: Record<string, unknown> | undefined;\n} | null {\n if (!body) return null;\n try {\n const decoded: unknown = JSON.parse(body);\n if (!decoded || typeof decoded !== \"object\" || Array.isArray(decoded)) return null;\n const record = decoded as Record<string, unknown>;\n const nested =\n record.error && typeof record.error === \"object\" && !Array.isArray(record.error)\n ? (record.error as Record<string, unknown>)\n : record;\n const code = boundedApiField(nested.code);\n const message = boundedApiField(nested.message);\n const requestId = boundedCorrelationId(nested.requestId);\n const retryable = typeof nested.retryable === \"boolean\" ? nested.retryable : undefined;\n const outcomeUnknown =\n typeof nested.outcomeUnknown === \"boolean\" ? nested.outcomeUnknown : undefined;\n const details = boundedApiDetails(nested.details);\n if (\n !code &&\n !message &&\n !requestId &&\n retryable === undefined &&\n outcomeUnknown === undefined &&\n !details\n )\n return null;\n return {\n code,\n message,\n requestId,\n retryable,\n outcomeUnknown,\n details,\n };\n } catch {\n return null;\n }\n}\n\nfunction boundedApiDetails(value: unknown): Record<string, unknown> | undefined {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return;\n const entries = Object.entries(value as Record<string, unknown>).slice(0, 16);\n const details: Record<string, unknown> = {};\n for (const [key, entry] of entries) {\n if (!/^[a-zA-Z][\\w.-]{0,63}$/.test(key)) continue;\n if (typeof entry === \"string\") {\n const bounded = boundedApiField(entry);\n if (bounded !== undefined) details[key] = bounded;\n } else if (typeof entry === \"number\" || typeof entry === \"boolean\" || entry === null) {\n details[key] = entry;\n }\n }\n return Object.keys(details).length > 0 ? details : undefined;\n}\n\nfunction boundedApiField(value: unknown): string | undefined {\n if (typeof value !== \"string\") return;\n const bytes = new TextEncoder().encode(value);\n return bytes.byteLength <= 512 ? value : new TextDecoder().decode(bytes.slice(0, 512));\n}\n\nfunction retryableApiStatus(status: number): boolean {\n return status === 408 || status === 409 || status === 425 || status === 429 || status >= 500;\n}\n\nfunction boundedCorrelationId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length > 128 || !/^[\\w.:-]+$/.test(value)) {\n return;\n }\n return value;\n}\n\n/** A legacy short-lived session-list snapshot cursor can no longer be continued. */\nexport class OpenGeniSessionListCursorError extends OpenGeniApiError {}\n\n/** The browser bundle and API disagree about their state-changing wire contract. */\nexport class OpenGeniApiContractMismatchError extends Error {\n readonly expected: string;\n readonly actual: string;\n\n constructor(expected: string, actual: string) {\n super(`OpenGeni API contract mismatch: client expects ${expected}, API serves ${actual}`);\n this.name = \"OpenGeniApiContractMismatchError\";\n this.expected = expected;\n this.actual = actual;\n }\n}\n\n/** Error for an unrecoverable event-stream condition (not a transient drop). */\nexport class OpenGeniStreamError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"OpenGeniStreamError\";\n }\n}\n\nexport function isAbortError(error: unknown): boolean {\n return (\n (error instanceof DOMException && error.name === \"AbortError\") ||\n (error instanceof Error && error.name === \"AbortError\")\n );\n}\n\n/**\n * Transient conditions worth a reconnect: network-level failures (`fetch`\n * rejects with `TypeError`) and HTTP statuses that signal a temporary server\n * or contention condition. Auth/validation failures (401/403/404/...) are\n * permanent and surface to the caller instead.\n */\nexport function isRetryableStreamError(error: unknown): boolean {\n if (error instanceof OpenGeniApiError) return error.retryable;\n return error instanceof TypeError;\n}\n"],"mappings":";AACO,IAAM,mBAAN,cAA+B,MAAM;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,QACA,MACA,UAOI,CAAC,GACL;AACA,UAAM,UAAU,mBAAmB,IAAI;AACvC,UAAM,gBAAgB,SAAS,aAAa,qBAAqB,QAAQ,aAAa;AACtF,UAAM,iBAAiB,UAAU,OAAO,UAAU;AAClD,UAAM,eAAe,QAAQ,aAAa;AAC1C,UAAM,UAAU,SAAS,YAAY,eAAe,oBAAoB,QAAQ;AAChF,UAAM,iBACJ,QAAQ,mBACP,kBAAkB,eACd,SAAS,WAAW,sDACrB,gBAAgB,MAAM,KAAK,OAAO;AACxC,UAAM,gBAAgB,GAAG,cAAc,eAAe,aAAa,MAAM,cAAc;AACvF,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OACH,QAAQ,QACR,SAAS,SACR,kBA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