@inferencesh/sdk 0.21.0 → 0.22.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 (57) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/agent/api.d.ts +35 -1
  3. package/dist/agent/api.js +35 -1
  4. package/dist/agent/reducer.js +23 -7
  5. package/dist/agent/types.d.ts +29 -4
  6. package/dist/api/agents.d.ts +9 -3
  7. package/dist/api/agents.js +87 -63
  8. package/dist/api/api-keys.d.ts +2 -5
  9. package/dist/api/apps.d.ts +9 -2
  10. package/dist/api/apps.js +9 -1
  11. package/dist/api/chats.d.ts +13 -3
  12. package/dist/api/chats.js +13 -2
  13. package/dist/api/engines.d.ts +4 -2
  14. package/dist/api/engines.js +3 -2
  15. package/dist/api/flow-runs.d.ts +7 -2
  16. package/dist/api/flow-runs.js +7 -2
  17. package/dist/api/flows.d.ts +13 -2
  18. package/dist/api/flows.js +15 -1
  19. package/dist/api/knowledge.d.ts +7 -4
  20. package/dist/api/knowledge.js +6 -4
  21. package/dist/api/mcp-servers.d.ts +2 -1
  22. package/dist/api/projects.d.ts +5 -3
  23. package/dist/api/projects.js +3 -2
  24. package/dist/api/secrets.d.ts +2 -2
  25. package/dist/api/tasks.js +38 -56
  26. package/dist/api/teams.d.ts +4 -2
  27. package/dist/api/teams.js +3 -2
  28. package/dist/api/write-bodies.d.ts +110 -0
  29. package/dist/api/write-bodies.js +1 -0
  30. package/dist/http/client.d.ts +1 -1
  31. package/dist/http/client.js +2 -1
  32. package/dist/http/loopback.d.ts +8 -0
  33. package/dist/http/loopback.js +18 -0
  34. package/dist/http/stream-until-terminal.d.ts +55 -0
  35. package/dist/http/stream-until-terminal.js +88 -0
  36. package/dist/http/stream.d.ts +1 -0
  37. package/dist/http/stream.js +7 -3
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +1 -0
  40. package/dist/proxy/endpoints.json +156 -0
  41. package/dist/proxy/express.d.ts +5 -6
  42. package/dist/proxy/express.js +18 -2
  43. package/dist/proxy/hono.d.ts +5 -3
  44. package/dist/proxy/hono.js +4 -3
  45. package/dist/proxy/index.d.ts +165 -6
  46. package/dist/proxy/index.js +409 -25
  47. package/dist/proxy/nextjs.d.ts +29 -17
  48. package/dist/proxy/nextjs.js +72 -62
  49. package/dist/proxy/remix.d.ts +5 -3
  50. package/dist/proxy/remix.js +4 -3
  51. package/dist/proxy/svelte.d.ts +5 -4
  52. package/dist/proxy/svelte.js +4 -4
  53. package/dist/types.d.ts +423 -6
  54. package/dist/types.js +111 -0
  55. package/dist/version.d.ts +1 -0
  56. package/dist/version.js +7 -0
  57. package/package.json +2 -1
package/dist/types.d.ts CHANGED
@@ -120,7 +120,17 @@ export interface AgentToolConfig {
120
120
  }
121
121
  export interface HookToolConfig {
122
122
  url: string;
123
+ /**
124
+ * Secret is write-only: a new value for the X-Hook-Secret header. On
125
+ * save it moves into the team's encrypted secret store and SecretRef
126
+ * names it; a stored config, and every read, has it empty.
127
+ */
123
128
  secret?: string;
129
+ /**
130
+ * SecretRef names the stored hook secret. Sending it back unchanged
131
+ * (with Secret empty) keeps it; leaving both empty removes it.
132
+ */
133
+ secret_ref?: string;
124
134
  input_schema?: any;
125
135
  output_schema?: any;
126
136
  }
@@ -162,9 +172,23 @@ export interface HTTPToolConfig {
162
172
  url: string;
163
173
  method?: string;
164
174
  auth?: ToolAuthConfig;
175
+ /**
176
+ * Headers are sent with every call. A value is either a reference to a
177
+ * team secret ("${{secrets.NAME}}"), kept as written, or a literal: on
178
+ * save a literal moves into the team's encrypted secret store and
179
+ * HeaderSecretRefs names it, so a stored config and every read carry
180
+ * the header with an empty value. An empty value whose header has a
181
+ * ref keeps the stored one.
182
+ */
165
183
  headers?: {
166
184
  [key: string]: string;
167
185
  };
186
+ /**
187
+ * HeaderSecretRefs maps a header name to its stored value.
188
+ */
189
+ header_secret_refs?: {
190
+ [key: string]: string;
191
+ };
168
192
  input_schema?: any;
169
193
  output_schema?: any;
170
194
  }
@@ -191,7 +215,11 @@ export interface AgentToolConfigDTO {
191
215
  }
192
216
  export interface HookToolConfigDTO {
193
217
  url: string;
218
+ /**
219
+ * Secret is always empty on a read; SecretRef says one is stored.
220
+ */
194
221
  secret?: string;
222
+ secret_ref?: string;
195
223
  input_schema?: any;
196
224
  output_schema?: any;
197
225
  }
@@ -203,9 +231,16 @@ export interface HTTPToolConfigDTO {
203
231
  url: string;
204
232
  method?: string;
205
233
  auth?: ToolAuthConfig;
234
+ /**
235
+ * Headers lists every header; a stored (secret) value reads as empty,
236
+ * and HeaderSecretRefs names it.
237
+ */
206
238
  headers?: {
207
239
  [key: string]: string;
208
240
  };
241
+ header_secret_refs?: {
242
+ [key: string]: string;
243
+ };
209
244
  input_schema?: any;
210
245
  output_schema?: any;
211
246
  }
@@ -273,18 +308,38 @@ export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
273
308
  permissions?: AgentPermissions;
274
309
  hooks?: LifecycleHookConfig[];
275
310
  output_schema?: any;
311
+ /**
312
+ * VisitorReads is the scope groups of the team's resources (knowledge,
313
+ * files, artifacts, remotes) a visitor of an embed of this version can
314
+ * have it read by id, beyond what it configures by name. Set when the
315
+ * agent is read (get, version get); the value a publication of it
316
+ * answers. Absent elsewhere (lists, chats).
317
+ */
318
+ visitor_reads?: ScopeGroup[];
276
319
  }
277
320
  /**
278
321
  * CreateAgentRequest is the request body for POST /agents
279
322
  * For new agents: omit ID, backend generates it
280
323
  * For new version of existing agent: include ID
324
+ * A new agent's namespace is its team's; the body cannot name one.
281
325
  */
282
326
  export interface CreateAgentRequest {
283
327
  id?: string;
284
328
  name: string;
285
329
  title?: string;
286
- namespace?: string;
287
330
  images?: AgentImages;
331
+ visibility?: Visibility;
332
+ /**
333
+ * Harness runs the agent: "inference" (ours) or an external harness.
334
+ */
335
+ harness?: string;
336
+ /**
337
+ * ProfileID and RemoteID place the agent on one of the caller's
338
+ * machines; ProjectID files it in a project.
339
+ */
340
+ profile_id?: string;
341
+ remote_id?: string;
342
+ project_id?: string;
288
343
  /**
289
344
  * Version config (embedded - backend generates version ID, timestamps, etc)
290
345
  */
@@ -557,6 +612,49 @@ export interface DeviceAuthPollResponse {
557
612
  */
558
613
  session_token?: string;
559
614
  team_id?: string;
615
+ /**
616
+ * AdminUntil is set when an admin elevation request was approved: the
617
+ * CLI login that asked now carries admin power until then. No
618
+ * credential comes with it.
619
+ */
620
+ admin_until?: string;
621
+ }
622
+ /**
623
+ * AdminElevateRequest is the body of POST /device/auth/elevate: a platform
624
+ * admin's CLI login asking to carry admin power for TTLSeconds (default one
625
+ * hour, at most eight).
626
+ */
627
+ export interface AdminElevateRequest {
628
+ ttl_seconds?: number;
629
+ }
630
+ /**
631
+ * AdminElevateResponse is a pending elevation request: the admin approves
632
+ * UserCode at ApproveURL in their browser and the CLI polls PollURL.
633
+ */
634
+ export interface AdminElevateResponse {
635
+ user_code: string;
636
+ device_code: string;
637
+ poll_url: string;
638
+ approve_url: string;
639
+ expires_in: number;
640
+ interval: number;
641
+ ttl_seconds: number;
642
+ }
643
+ /**
644
+ * AdminElevationStatus is GET /device/auth/elevate: whether the calling
645
+ * session carries an admin elevation, and until when.
646
+ */
647
+ export interface AdminElevationStatus {
648
+ elevated: boolean;
649
+ admin_until?: string;
650
+ }
651
+ /**
652
+ * AdminElevationDropResponse is DELETE /device/auth/elevate. Dropped is
653
+ * false when the session held no elevation.
654
+ */
655
+ export interface AdminElevationDropResponse {
656
+ elevated: boolean;
657
+ dropped: boolean;
560
658
  }
561
659
  export interface MeResponse {
562
660
  user?: UserDTO;
@@ -585,6 +683,19 @@ export interface MeResponse {
585
683
  * POST /teams/{personal_team_id}/complete-setup.
586
684
  */
587
685
  needs_username: boolean;
686
+ /**
687
+ * PlatformPower: the credential carries platform administration
688
+ * (admin:read): an admin's own browser sign-in that proved their
689
+ * authenticator, or an elevated CLI login. The admin role alone is not
690
+ * it.
691
+ */
692
+ platform_power: boolean;
693
+ /**
694
+ * Scopes is every scope the request's credential holds
695
+ * (AuthContext.HeldScopes): what a client asks before it calls a route
696
+ * it may not reach (an API key holds no sign-in-only scope).
697
+ */
698
+ scopes: Scope[];
588
699
  }
589
700
  export interface TeamCreateRequest {
590
701
  name: string;
@@ -650,6 +761,12 @@ export interface CredentialConnectRequest {
650
761
  * are OAuth permission scopes.
651
762
  */
652
763
  connection_scope?: CredentialScope;
764
+ /**
765
+ * AnotherAccount connects an account next to the ones already
766
+ * connected: the provider is asked to let the user choose the account
767
+ * rather than reuse the one it remembers.
768
+ */
769
+ another_account?: boolean;
653
770
  }
654
771
  /**
655
772
  * CredentialCompleteOAuthRequest is what the provider's redirect delivered:
@@ -746,7 +863,7 @@ export interface EstimateCostResponse {
746
863
  /**
747
864
  * Scope represents an API key permission scope string.
748
865
  */
749
- export type Scope = "*" | "agents" | "apps" | "conversations" | "files" | "datastores" | "templates" | "flows" | "projects" | "teams" | "billing" | "artifacts" | "agents:read" | "agents:write" | "agents:execute" | "apps:read" | "apps:write" | "apps:execute" | "conversations:read" | "conversations:write" | "files:read" | "files:write" | "datastores:read" | "datastores:write" | "flows:read" | "flows:write" | "flows:execute" | "projects:read" | "projects:write" | "teams:read" | "teams:write" | "billing:read" | "billing:write" | "secrets:read" | "secrets:write" | "credentials:read" | "credentials:write" | "engines:read" | "engines:write" | "remotes:read" | "remotes:write" | "apikeys:read" | "apikeys:write" | "knowledge:read" | "knowledge:write" | "artifacts:read" | "artifacts:write" | "user:read" | "user:write" | "settings:read" | "settings:write";
866
+ export type Scope = "*" | "agents" | "apps" | "conversations" | "files" | "datastores" | "templates" | "flows" | "projects" | "teams" | "billing" | "artifacts" | "agents:read" | "agents:write" | "agents:execute" | "apps:read" | "apps:write" | "apps:execute" | "conversations:read" | "conversations:write" | "files:read" | "files:write" | "datastores:read" | "datastores:write" | "flows:read" | "flows:write" | "flows:execute" | "projects:read" | "projects:write" | "teams:read" | "teams:write" | "billing:read" | "billing:write" | "secrets:read" | "secrets:write" | "secrets:reveal" | "credentials:read" | "credentials:write" | "engines:read" | "engines:write" | "remotes:read" | "remotes:write" | "apikeys:read" | "apikeys:write" | "knowledge:read" | "knowledge:write" | "artifacts:read" | "artifacts:write" | "user:read" | "user:write" | "settings:read" | "settings:write" | "approvals:write" | "admin:read" | "admin:write" | "admin:pricing";
750
867
  /**
751
868
  * API Key Scopes - hierarchical permission system.
752
869
  * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
@@ -935,6 +1052,12 @@ export declare const ScopeSecretsRead: Scope;
935
1052
  * Empty scopes = full access (for backwards compatibility with existing keys).
936
1053
  */
937
1054
  export declare const ScopeSecretsWrite: Scope;
1055
+ /**
1056
+ * ScopeSecretsReveal reads a secret's plaintext value. A key holding
1057
+ * secrets:read holds it too (keys revealed with secrets:read before it
1058
+ * existed); an app's OAuth token or a bound session never does.
1059
+ */
1060
+ export declare const ScopeSecretsReveal: Scope;
938
1061
  /**
939
1062
  * Action-level scopes for credentials (connected accounts, vaults,
940
1063
  * auth schemes, MCP servers).
@@ -1016,10 +1139,36 @@ export declare const ScopeSettingsRead: Scope;
1016
1139
  * Empty scopes = full access (for backwards compatibility with existing keys).
1017
1140
  */
1018
1141
  export declare const ScopeSettingsWrite: Scope;
1142
+ /**
1143
+ * Approvals: answering a human-in-the-loop question (a tool approval, a
1144
+ * gate, a widget or MCP input request, always-allow) and widening a
1145
+ * chat's approval policy (allow every tool, skip hooks, allow rules).
1146
+ * Held only by the account holder's own sign-in.
1147
+ */
1148
+ export declare const ScopeApprovalsWrite: Scope;
1149
+ /**
1150
+ * ScopeAdminRead views platform administration (/admin GET). Held
1151
+ * only by an admin's own sign-in; the route's admin gate decides
1152
+ * whether it carries power.
1153
+ */
1154
+ export declare const ScopeAdminRead: Scope;
1155
+ /**
1156
+ * ScopeAdminWrite changes platform administration (/admin). Held only
1157
+ * by an admin's own sign-in.
1158
+ */
1159
+ export declare const ScopeAdminWrite: Scope;
1160
+ /**
1161
+ * ScopeAdminPricing reads and changes store pricing: a version's
1162
+ * terms, its draft pricing (edit, evaluate, discard, publish, apply to
1163
+ * the listing) and the sample tasks drafts are evaluated against. Held
1164
+ * by an admin's own sign-in with platform power, and by a key of the
1165
+ * platform's automation account (ScopeDefinition.Automation).
1166
+ */
1167
+ export declare const ScopeAdminPricing: Scope;
1019
1168
  /**
1020
1169
  * ScopeGroup identifies a category of scopes for UI grouping
1021
1170
  */
1022
- export type ScopeGroup = "agents" | "apps" | "conversations" | "files" | "datastores" | "flows" | "projects" | "teams" | "billing" | "secrets" | "credentials" | "engines" | "remotes" | "apikeys" | "knowledge" | "artifacts" | "user" | "settings";
1171
+ export type ScopeGroup = "agents" | "apps" | "conversations" | "files" | "datastores" | "flows" | "projects" | "teams" | "billing" | "secrets" | "credentials" | "engines" | "remotes" | "apikeys" | "knowledge" | "artifacts" | "user" | "settings" | "approvals" | "admin";
1023
1172
  export declare const ScopeGroupAgents: ScopeGroup;
1024
1173
  export declare const ScopeGroupApps: ScopeGroup;
1025
1174
  export declare const ScopeGroupConversations: ScopeGroup;
@@ -1038,6 +1187,8 @@ export declare const ScopeGroupKnowledge: ScopeGroup;
1038
1187
  export declare const ScopeGroupArtifacts: ScopeGroup;
1039
1188
  export declare const ScopeGroupUser: ScopeGroup;
1040
1189
  export declare const ScopeGroupSettings: ScopeGroup;
1190
+ export declare const ScopeGroupApprovals: ScopeGroup;
1191
+ export declare const ScopeGroupAdmin: ScopeGroup;
1041
1192
  /**
1042
1193
  * ScopeDefinition describes a single scope for UI rendering
1043
1194
  */
@@ -1046,6 +1197,30 @@ export interface ScopeDefinition {
1046
1197
  label: string;
1047
1198
  description: string;
1048
1199
  group: ScopeGroup;
1200
+ /**
1201
+ * SignInOnly: only the account holder's own sign-in (browser session,
1202
+ * CLI login) holds it. No API key, workspace key, OAuth token, bound or
1203
+ * grant session can be granted it or pass a check for it.
1204
+ */
1205
+ sign_in_only?: boolean;
1206
+ /**
1207
+ * NotForApps: an app's OAuth token, a bound session or a grant never
1208
+ * holds it, whatever it was granted; the person's sign-in and API keys
1209
+ * may.
1210
+ */
1211
+ not_for_apps?: boolean;
1212
+ /**
1213
+ * CostsCredits: using the scope spends the account's credits (running
1214
+ * apps, agents, flows).
1215
+ */
1216
+ costs_credits?: boolean;
1217
+ /**
1218
+ * Automation: a narrow platform-administration scope that a workspace
1219
+ * key of the platform's automation account (the system team's service
1220
+ * account) may hold, minted by an admin with platform power and always
1221
+ * expiring. Every other key, token and app holds no admin scope.
1222
+ */
1223
+ automation?: boolean;
1049
1224
  }
1050
1225
  /**
1051
1226
  * ScopeGroupDefinition describes a group of scopes for UI rendering
@@ -1054,6 +1229,17 @@ export interface ScopeGroupDefinition {
1054
1229
  id: ScopeGroup;
1055
1230
  label: string;
1056
1231
  description: string;
1232
+ /**
1233
+ * PublicRows: the resource's rows can be public, so a credential
1234
+ * without its read scope still reads what a signed-out caller reads
1235
+ * (its public rows) instead of being refused.
1236
+ */
1237
+ public_rows?: boolean;
1238
+ /**
1239
+ * StaffOnly: the group's scopes are offered (GET /scopes) only to staff
1240
+ * holding platform power: the platform's own engines.
1241
+ */
1242
+ staff_only?: boolean;
1057
1243
  }
1058
1244
  /**
1059
1245
  * ScopesResponse is the API response for GET /scopes
@@ -1062,6 +1248,20 @@ export interface ScopesResponse {
1062
1248
  scopes: ScopeDefinition[];
1063
1249
  groups: ScopeGroupDefinition[];
1064
1250
  presets: ScopePreset[];
1251
+ /**
1252
+ * AccountScopes are the account holder's own scopes (approvals,
1253
+ * profile and sessions, keys, billing writes) a sign-in may be approved
1254
+ * for: the device approval page offers them as their own section. No
1255
+ * key or app is ever granted one.
1256
+ */
1257
+ account_scopes: ScopeDefinition[];
1258
+ /**
1259
+ * LoginPreset is what the device approval page preselects for
1260
+ * `belt login`: the standard preset plus approvals:write (answering
1261
+ * the person's own approvals from the CLI). Its Grants is what such a
1262
+ * login holds (LoginGrants).
1263
+ */
1264
+ login_preset: ScopePreset;
1065
1265
  }
1066
1266
  /**
1067
1267
  * ScopePreset represents a predefined bundle of scopes for common use cases
@@ -1073,6 +1273,17 @@ export interface ScopePreset {
1073
1273
  scopes: Scope[];
1074
1274
  summary?: string[];
1075
1275
  hidden?: boolean;
1276
+ /**
1277
+ * Default: the preset a new key or app grant starts from.
1278
+ */
1279
+ default?: boolean;
1280
+ /**
1281
+ * Grants is every action scope the preset's key holds (Scopes expanded:
1282
+ * a resource scope's actions, the read a write implies, secrets:reveal
1283
+ * with secrets:read; never a sign-in-only scope), so a client compares a
1284
+ * key against it without re-deriving the rule (ApiKeyDTO.Grants).
1285
+ */
1286
+ grants?: Scope[];
1076
1287
  }
1077
1288
  /**
1078
1289
  * ApiKeyDTO for API responses
@@ -1086,6 +1297,12 @@ export interface ApiKeyDTO extends BaseModelDTO, PermissionModelDTO {
1086
1297
  last_used_at?: string;
1087
1298
  expires_at?: string;
1088
1299
  scopes: Scope[];
1300
+ /**
1301
+ * Grants is every action scope the key holds: Scopes expanded the way a
1302
+ * request with the key is checked (models.KeyGrants), every key scope
1303
+ * for a key created without any.
1304
+ */
1305
+ grants: Scope[];
1089
1306
  source?: string;
1090
1307
  /**
1091
1308
  * Scope is who the key acts as: its creator (user) or the workspace.
@@ -1255,6 +1472,30 @@ export interface AppDTO extends BaseModelDTO, PermissionModelDTO {
1255
1472
  export interface AppUIRef {
1256
1473
  artifact: string;
1257
1474
  }
1475
+ /**
1476
+ * AppSandbox is what an app version's container may do beyond the engine's
1477
+ * default hardening, as its package's inf.yml declares it:
1478
+ * sandbox:
1479
+ * host_network: true # share the host's network namespace
1480
+ * capabilities: [SYS_PTRACE] # Linux capabilities the app's processes keep
1481
+ * The API reads it from the package when the version is deployed and stores
1482
+ * it on the version (server-owned: no caller writes it). Engines enforce the
1483
+ * copy the task dispatch carries, and store review shows it. The empty value
1484
+ * declares no exception.
1485
+ */
1486
+ export interface AppSandbox {
1487
+ /**
1488
+ * HostNetwork runs the container on the host's network: it reaches the
1489
+ * host's services and the cloud metadata service.
1490
+ */
1491
+ host_network?: boolean;
1492
+ /**
1493
+ * Capabilities are Linux capability names without the CAP_ prefix, in
1494
+ * upper case. The container is given them and the app's processes keep
1495
+ * them.
1496
+ */
1497
+ capabilities?: string[];
1498
+ }
1258
1499
  /**
1259
1500
  * AppVersionDTO is the API response for an app version.
1260
1501
  */
@@ -1283,6 +1524,12 @@ export interface AppVersionDTO extends BaseModelDTO {
1283
1524
  required_secrets?: SecretRequirement[];
1284
1525
  required_credentials?: CredentialRequirement[];
1285
1526
  resources: AppResources;
1527
+ /**
1528
+ * Sandbox is the version's declared sandbox exceptions. Absent on a
1529
+ * version deployed before the API recorded them (engines then read the
1530
+ * package's inf.yml) and on a version with no package (a flow app).
1531
+ */
1532
+ sandbox?: AppSandbox;
1286
1533
  checksum?: string;
1287
1534
  }
1288
1535
  /**
@@ -2029,6 +2276,40 @@ export interface AlwaysAllowOptionsDTO {
2029
2276
  * own rules, or no chat rule could allow this call.
2030
2277
  */
2031
2278
  unavailable?: string;
2279
+ /**
2280
+ * SecretSend is set when the call is an agent of another team sending
2281
+ * the runner's own secrets: what it sends and where. Approving the call
2282
+ * sends them; the prompt names them.
2283
+ */
2284
+ secret_send?: SecretSendDTO;
2285
+ }
2286
+ /**
2287
+ * SecretSendDTO is an agent of another team asking to send the runner's
2288
+ * secrets with a call: "alice/helper wants to send OPENAI_API_KEY to
2289
+ * alice.example". It rides on the call's approval interrupt (meta
2290
+ * secret_send) and on its always-allow options.
2291
+ */
2292
+ export interface SecretSendDTO {
2293
+ /**
2294
+ * Agent is the agent as people know it (namespace/name); AgentID is
2295
+ * its id.
2296
+ */
2297
+ agent: string;
2298
+ agent_id: string;
2299
+ /**
2300
+ * AgentVersionID is the agent version making the call: approving the
2301
+ * prompt approves this version's send only.
2302
+ */
2303
+ agent_version_id: string;
2304
+ /**
2305
+ * Host is where the call sends them.
2306
+ */
2307
+ host: string;
2308
+ /**
2309
+ * Secrets are the runner's secrets the call sends, by name: secret
2310
+ * keys (OPENAI_API_KEY) and logins (credential:github).
2311
+ */
2312
+ secrets: string[];
2032
2313
  }
2033
2314
  /**
2034
2315
  * AlwaysAllowRequest is POST /chats/{id}/tools/{toolId}/always-allow. The
@@ -2109,6 +2390,12 @@ export interface CredentialDTO extends BaseModelDTO, PermissionModelDTO {
2109
2390
  status: CredentialStatus;
2110
2391
  display_name: string;
2111
2392
  icon_url?: string;
2393
+ /**
2394
+ * AccountID is the provider's own, unchanging id for the account; what
2395
+ * an account is named by when choosing one. AccountIdentifier is its
2396
+ * label (an email, an @handle).
2397
+ */
2398
+ account_id?: string;
2112
2399
  account_identifier?: string;
2113
2400
  account_name?: string;
2114
2401
  scopes: StringSlice;
@@ -2155,7 +2442,17 @@ export interface CredentialConfigDTO {
2155
2442
  * itself (models.AuthScheme), so the UI can offer edit and remove.
2156
2443
  */
2157
2444
  auth_scheme_id?: string;
2445
+ /**
2446
+ * Credential is the login used where no account is named: the caller's
2447
+ * own, else the workspace's default account.
2448
+ */
2158
2449
  credential?: CredentialDTO;
2450
+ /**
2451
+ * Accounts is every login to this provider the caller can use, in that
2452
+ * order (Credential first). More than one when several accounts are
2453
+ * connected.
2454
+ */
2455
+ accounts?: (CredentialDTO | undefined)[];
2159
2456
  }
2160
2457
  /**
2161
2458
  * SecretFieldConfig defines a secret field for the UI
@@ -2439,7 +2736,7 @@ export interface DecideEntitlementRequestRequest {
2439
2736
  * and APIError.Code on the legacy envelope. Clients branch on these, so a
2440
2737
  * code is a named const here, where it generates into models and the SDKs.
2441
2738
  */
2442
- export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "impersonation_reason_required" | "mcp_auth_expired" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2739
+ export type ErrorCode = "invalid_request" | "validation_error" | "unauthorized" | "forbidden" | "not_found" | "conflict" | "name_conflict" | "already_exists" | "not_configured" | "method_not_allowed" | "rate_limited" | "internal_error" | "team_role_required" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "person_required" | "otp_required" | "requires_sign_in" | "insufficient_scope" | "impersonation_reason_required" | "mcp_auth_expired" | "admin_session_required" | "admin_scopes_not_approved" | "cli_session_required" | "admin_required" | "same_admin_required" | "browser_session_required" | "invalid_ttl" | "admin_authenticator_required" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "already_claimed" | "already_entitled" | "request_open" | "invalid_code" | "already_processed" | "expired" | "app_retired" | "app_maintenance" | "invalid_transition" | "SESSION_NOT_FOUND" | "SESSION_EXPIRED" | "SESSION_ENDED" | "WORKER_LEASED" | "APP_MISMATCH" | "VERSION_MISMATCH" | "agents_disabled" | "remote_offline" | "remote_timeout" | "harness_not_drivable" | "harness_too_old";
2443
2740
  export declare const ErrorCodeInvalidRequest: ErrorCode;
2444
2741
  export declare const ErrorCodeValidationError: ErrorCode;
2445
2742
  export declare const ErrorCodeUnauthorized: ErrorCode;
@@ -2483,6 +2780,21 @@ export declare const ErrorCodeAccountBanned: ErrorCode;
2483
2780
  */
2484
2781
  export declare const ErrorCodePersonRequired: ErrorCode;
2485
2782
  export declare const ErrorCodeOTPRequired: ErrorCode;
2783
+ /**
2784
+ * ErrorCodeRequiresSignIn (403): the action needs a scope only the
2785
+ * account holder's own sign-in holds (answering an approval, widening a
2786
+ * chat's approval policy, the account, API keys, billing changes,
2787
+ * admin), and the request carried an API key, an app's OAuth token or
2788
+ * another delegated credential. Sign in on the web app or with `belt
2789
+ * login` to do it.
2790
+ */
2791
+ export declare const ErrorCodeRequiresSignIn: ErrorCode;
2792
+ /**
2793
+ * ErrorCodeInsufficientScope (403): the credential does not hold the
2794
+ * scope the operation takes (an API key, an app's OAuth token or a
2795
+ * narrowed login granted less). The detail names the scope.
2796
+ */
2797
+ export declare const ErrorCodeInsufficientScope: ErrorCode;
2486
2798
  /**
2487
2799
  * ErrorCodeImpersonationReasonRequired (403): a platform admin named a
2488
2800
  * team they are not a member of without a live impersonation grant.
@@ -2490,6 +2802,37 @@ export declare const ErrorCodeOTPRequired: ErrorCode;
2490
2802
  */
2491
2803
  export declare const ErrorCodeImpersonationReasonRequired: ErrorCode;
2492
2804
  export declare const ErrorCodeMCPAuthExpired: ErrorCode;
2805
+ /**
2806
+ * Admin elevation ("belt admin elevate"). AdminSessionRequired (403): a
2807
+ * platform admin's credential that carries no admin power reached an
2808
+ * admin route; a CLI login gets it by elevating. CLISessionRequired
2809
+ * (403): only a CLI login may ask to be elevated. AdminRequired (403):
2810
+ * only a platform admin may ask for or grant one. SameAdminRequired
2811
+ * (403): the elevation was asked for by another account.
2812
+ * BrowserSessionRequired (403): only the admin's own browser sign-in
2813
+ * grants one, and only the person's own browser sign-in changes how the
2814
+ * account is signed into (authenticator enrollment, RequireBrowserSession).
2815
+ * InvalidTTL (400): the elevation asked for a window outside
2816
+ * models.AdminElevationMinTTL..AdminElevationMaxTTL.
2817
+ * AdminScopesNotApproved (403): a platform admin's CLI login was approved
2818
+ * with a scope list that does not name the admin scopes, so it can't be
2819
+ * elevated: log in again approving them, then elevate.
2820
+ */
2821
+ export declare const ErrorCodeAdminSessionRequired: ErrorCode;
2822
+ export declare const ErrorCodeAdminScopesNotApproved: ErrorCode;
2823
+ export declare const ErrorCodeCLISessionRequired: ErrorCode;
2824
+ export declare const ErrorCodeAdminRequired: ErrorCode;
2825
+ export declare const ErrorCodeSameAdminRequired: ErrorCode;
2826
+ export declare const ErrorCodeBrowserSessionRequired: ErrorCode;
2827
+ export declare const ErrorCodeInvalidTTL: ErrorCode;
2828
+ /**
2829
+ * AdminAuthenticatorRequired (403): a platform admin without an
2830
+ * authenticator app (TOTP) enrolled. Admin power needs one; until it is
2831
+ * enrolled (POST /auth/totp/enroll, then /auth/totp/confirm) the admin
2832
+ * works as an ordinary member. An admin who has one but whose session
2833
+ * has not proved it gets otp_required instead: re-authenticate with it.
2834
+ */
2835
+ export declare const ErrorCodeAdminAuthenticatorRequired: ErrorCode;
2493
2836
  /**
2494
2837
  * Entitlements. LimitExceeded (402) and FeatureNotAvailable (403) carry
2495
2838
  * EntitlementErrorMeta. EntitlementUnavailable (500) means the plan could
@@ -2522,6 +2865,32 @@ export declare const ErrorCodeAlreadyClaimed: ErrorCode;
2522
2865
  */
2523
2866
  export declare const ErrorCodeAlreadyEntitled: ErrorCode;
2524
2867
  export declare const ErrorCodeRequestOpen: ErrorCode;
2868
+ /**
2869
+ * Authorization codes (device sign-in, admin elevation) (400): the code
2870
+ * is unknown, already approved or denied, or past its expiry.
2871
+ */
2872
+ export declare const ErrorCodeInvalidCode: ErrorCode;
2873
+ export declare const ErrorCodeAlreadyProcessed: ErrorCode;
2874
+ export declare const ErrorCodeExpired: ErrorCode;
2875
+ /**
2876
+ * Run-time refusals. AppRetired (410): the app no longer runs.
2877
+ * AppMaintenance (503, Retry-After): the owner paused it; the message is
2878
+ * theirs. InvalidTransition (409): the task already moved on.
2879
+ */
2880
+ export declare const ErrorCodeAppRetired: ErrorCode;
2881
+ export declare const ErrorCodeAppMaintenance: ErrorCode;
2882
+ export declare const ErrorCodeInvalidTransition: ErrorCode;
2883
+ /**
2884
+ * Session-bound runs. SessionNotFound (404), SessionExpired and
2885
+ * SessionEnded (410), WorkerLeased, AppMismatch and VersionMismatch
2886
+ * (409). The SDKs match these upper-case strings.
2887
+ */
2888
+ export declare const ErrorCodeSessionNotFound: ErrorCode;
2889
+ export declare const ErrorCodeSessionExpired: ErrorCode;
2890
+ export declare const ErrorCodeSessionEnded: ErrorCode;
2891
+ export declare const ErrorCodeWorkerLeased: ErrorCode;
2892
+ export declare const ErrorCodeAppMismatch: ErrorCode;
2893
+ export declare const ErrorCodeVersionMismatch: ErrorCode;
2525
2894
  /**
2526
2895
  * Remote harness refusals.
2527
2896
  */
@@ -2542,6 +2911,14 @@ export interface TeamRoleRequiredMeta {
2542
2911
  required_role?: TeamRole;
2543
2912
  requires_org_admin?: boolean;
2544
2913
  }
2914
+ /**
2915
+ * ScopeRefusedMeta is the meta of an insufficient_scope or
2916
+ * requires_sign_in error: the scope the operation declares and the
2917
+ * credential does not hold. The detail says what would hold it.
2918
+ */
2919
+ export interface ScopeRefusedMeta {
2920
+ required_scope: Scope;
2921
+ }
2545
2922
  /**
2546
2923
  * PaymentMethodRequiredMeta is the meta of a payment_method_required error.
2547
2924
  */
@@ -4017,12 +4394,23 @@ export interface CheckRequirementsResponse {
4017
4394
  export interface ResourceShareDTO extends BaseModelDTO {
4018
4395
  resource_id: string;
4019
4396
  resource_type: string;
4397
+ /**
4398
+ * UserID names the person a share is to; TeamID, with UserID empty,
4399
+ * the resource's whole team.
4400
+ */
4020
4401
  user_id: string;
4402
+ team_id?: string;
4021
4403
  user?: UserRelationDTO;
4022
4404
  permission: Permission;
4023
4405
  }
4406
+ /**
4407
+ * ShareRequest is POST /{resource}/{id}/share: a share to one person
4408
+ * (user_id) or to the resource's whole team (team: true), at a permission
4409
+ * (read when empty).
4410
+ */
4024
4411
  export interface ShareRequest {
4025
- user_id: string;
4412
+ user_id?: string;
4413
+ team?: boolean;
4026
4414
  permission: Permission;
4027
4415
  }
4028
4416
  /**
@@ -4495,10 +4883,34 @@ export interface TelemetryReportDTO extends BaseModelDTO, PermissionModelDTO {
4495
4883
  [key: string]: any;
4496
4884
  };
4497
4885
  }
4886
+ /**
4887
+ * SubmitTelemetryRequest is the CLI's diagnostics report for an account the
4888
+ * abuse redlist flags. Payload is the host report (platform, locale,
4889
+ * network); Device carries the identifiers that recognise the same machine
4890
+ * across accounts. The API stores Device's hashes for matching and its
4891
+ * readable names encrypted, apart from the payload.
4892
+ */
4498
4893
  export interface SubmitTelemetryRequest {
4499
4894
  payload: {
4500
4895
  [key: string]: any;
4501
4896
  };
4897
+ device?: DeviceEvidence;
4898
+ }
4899
+ /**
4900
+ * DeviceEvidence is what a flagged account's CLI sends about its machine:
4901
+ * salted hashes of the hostname, OS user, git user.name, MAC addresses and
4902
+ * SSH key fingerprints, and the hostname, OS user and git user.name readable.
4903
+ */
4904
+ export interface DeviceEvidence {
4905
+ scheme: string;
4906
+ hostname_hash?: string;
4907
+ username_hash?: string;
4908
+ git_user_name_hash?: string;
4909
+ mac_hashes?: string[];
4910
+ ssh_key_fingerprint_hashes?: string[];
4911
+ hostname?: string;
4912
+ username?: string;
4913
+ git_user_name?: string;
4502
4914
  }
4503
4915
  /**
4504
4916
  * ToolInvocationFunction contains the function details for a tool invocation
@@ -6073,7 +6485,7 @@ export declare const PolicyEnforcementDisabled: PolicyEnforcement;
6073
6485
  /**
6074
6486
  * PolicyKind names what a rule governs; each kind has one matcher.
6075
6487
  */
6076
- export type PolicyKind = "RemoteExec" | "Workspace" | "Harness" | "Tool" | "App" | "Agent" | "Knowledge" | "Mcp" | "Flow" | "WebFetch";
6488
+ export type PolicyKind = "RemoteExec" | "Workspace" | "Harness" | "Tool" | "App" | "Agent" | "Knowledge" | "Mcp" | "Flow" | "WebFetch" | "SecretSend";
6077
6489
  /**
6078
6490
  * PolicyKindRemoteExec: shell commands run on a remote.
6079
6491
  */
@@ -6103,6 +6515,11 @@ export declare const PolicyKindFlow: PolicyKind;
6103
6515
  * PolicyKindWebFetch: fetched domains.
6104
6516
  */
6105
6517
  export declare const PolicyKindWebFetch: PolicyKind;
6518
+ /**
6519
+ * PolicyKindSecretSend: an agent of another team sending the runner's
6520
+ * secrets to a host.
6521
+ */
6522
+ export declare const PolicyKindSecretSend: PolicyKind;
6106
6523
  /**
6107
6524
  * FunctionKind is how an app function talks to its caller.
6108
6525
  */