@inferencesh/sdk 0.40.0 → 0.41.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.41.0] - 2026-11-14
11
+
12
+ Types regenerated from the API (api-v1567, api-v1568).
13
+
14
+ ### Added
15
+ - Team variables (INF-1345): `VariableDTO`, `VariableSetRequest`, `VariableListResponse`, `VarRequirement`; `required_vars` on app versions; requirement type `variable` and setup action `add_variable`.
16
+ - `infra` on `CreateSandboxRequest` and `SandboxDTO` (`cloud`, `private`, `private_first`: whose engines a sandbox runs on; `SandboxDTO.infra` is always set).
17
+ - `infra` on `ApiAgentRunRequest`, `ChatSettingsRequest` and chat data: where an agent run's app tools run. Empty is cloud.
18
+
10
19
  ## [0.40.0] - 2026-11-14
11
20
 
12
21
  **Breaking:** types regenerated from the API (api-v1551 to api-v1565).
package/dist/types.d.ts CHANGED
@@ -542,6 +542,15 @@ export interface ApiAgentRunRequest {
542
542
  context?: {
543
543
  [key: string]: string;
544
544
  };
545
+ /**
546
+ * Infra is where the tasks the agent's app tools run go, for the
547
+ * caller's workspace: cloud, private (its own engines only) or
548
+ * private_first (its own when one can take the task, cloud
549
+ * otherwise). It is kept on the chat, so it holds for the turns that
550
+ * follow until a later request or the chat's settings change it.
551
+ * Absent: the chat's, which starts as cloud.
552
+ */
553
+ infra?: Infra;
545
554
  stream?: boolean;
546
555
  /**
547
556
  * ProjectID files the chat this message starts in a project. Ignored
@@ -608,6 +617,7 @@ export interface AppVersionInput {
608
617
  kernel?: string;
609
618
  required_secrets?: SecretRequirement[];
610
619
  required_credentials?: CredentialRequirements;
620
+ required_vars?: VarRequirement[];
611
621
  resources?: AppResources;
612
622
  }
613
623
  /**
@@ -1836,6 +1846,11 @@ export interface AppVersionDTO extends BaseModelDTO {
1836
1846
  kernel: string;
1837
1847
  required_secrets?: SecretRequirement[];
1838
1848
  required_credentials?: CredentialRequirements;
1849
+ /**
1850
+ * RequiredVars are the environment variables the version reads from
1851
+ * the running team (vars: in inf.yml): plain configuration.
1852
+ */
1853
+ required_vars?: VarRequirement[];
1839
1854
  resources: AppResources;
1840
1855
  /**
1841
1856
  * Sandbox is the version's declared sandbox exceptions. Absent on a
@@ -2477,6 +2492,11 @@ export interface ChatSettingsRequest {
2477
2492
  * minimum still raises it (GET /chats/{id}/strictness).
2478
2493
  */
2479
2494
  strictness?: ChatStrictness;
2495
+ /**
2496
+ * Infra is where the tasks the agent's app tools run in this chat go:
2497
+ * cloud, private or private_first.
2498
+ */
2499
+ infra?: Infra;
2480
2500
  }
2481
2501
  /**
2482
2502
  * ChatSettingsDTO is what POST /chats/{id}/settings answers with: the chat's
@@ -3441,7 +3461,7 @@ export interface WorkerRAM {
3441
3461
  * a task lists the ones it needs (Task.Requires); the scheduler only sends
3442
3462
  * a task to an engine that has every one it needs.
3443
3463
  */
3444
- export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots" | "sandbox_snapshot_store";
3464
+ export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots" | "sandbox_snapshot_store" | "task_env";
3445
3465
  /**
3446
3466
  * EngineCapabilityEgressGateway: the engine runs its sandboxes behind
3447
3467
  * the egress gateway, so it can take bound secrets (the v2 secrets
@@ -3519,6 +3539,16 @@ export declare const EngineCapabilitySandboxSnapshots: EngineCapability;
3519
3539
  * each against the manifest, and rebuilds the disk.
3520
3540
  */
3521
3541
  export declare const EngineCapabilitySandboxSnapshotStore: EngineCapability;
3542
+ /**
3543
+ * EngineCapabilityTaskEnv: the engine gives each task the app
3544
+ * environment that task was dispatched with (TaskDispatchPayload.AppEnv):
3545
+ * a worker whose visor was started with another environment is restarted
3546
+ * before the task runs, as it is when its secrets change. Without it a
3547
+ * warm worker keeps the environment of the first task it ran, so a task
3548
+ * whose environment carries its team's variables (INF-1345) is sent
3549
+ * only to an engine that has it.
3550
+ */
3551
+ export declare const EngineCapabilityTaskEnv: EngineCapability;
3522
3552
  /**
3523
3553
  * EngineCapabilities is a set of capabilities, kept as a list. Nil and
3524
3554
  * empty are the same: nothing beyond the base contract.
@@ -5614,7 +5644,7 @@ export interface SuggestResult {
5614
5644
  /**
5615
5645
  * RequirementType identifies the kind of missing requirement.
5616
5646
  */
5617
- export type RequirementType = "secret" | "credential" | "scope";
5647
+ export type RequirementType = "secret" | "credential" | "scope" | "variable";
5618
5648
  /**
5619
5649
  * Requirement error types
5620
5650
  */
@@ -5627,6 +5657,11 @@ export declare const RequirementTypeCredential: RequirementType;
5627
5657
  * Requirement error types
5628
5658
  */
5629
5659
  export declare const RequirementTypeScope: RequirementType;
5660
+ /**
5661
+ * RequirementTypeVariable: an environment variable the app declares
5662
+ * under vars: that the team has not set and the app gives no default.
5663
+ */
5664
+ export declare const RequirementTypeVariable: RequirementType;
5630
5665
  /**
5631
5666
  * RequirementError represents a single missing requirement with actionable info
5632
5667
  */
@@ -5639,10 +5674,15 @@ export interface RequirementError {
5639
5674
  /**
5640
5675
  * SetupActionType identifies the kind of action needed to resolve a requirement.
5641
5676
  */
5642
- export type SetupActionType = "add_secret" | "connect" | "add_scopes";
5677
+ export type SetupActionType = "add_secret" | "connect" | "add_scopes" | "add_variable";
5643
5678
  export declare const SetupActionAddSecret: SetupActionType;
5644
5679
  export declare const SetupActionConnect: SetupActionType;
5645
5680
  export declare const SetupActionAddScopes: SetupActionType;
5681
+ /**
5682
+ * SetupActionAddVariable: set the team's variable RequirementError.Key
5683
+ * (PUT /variables/{key}).
5684
+ */
5685
+ export declare const SetupActionAddVariable: SetupActionType;
5646
5686
  /**
5647
5687
  * SetupAction provides actionable info for resolving a missing requirement
5648
5688
  */
@@ -5759,6 +5799,15 @@ export interface CreateSandboxRequest {
5759
5799
  vcpus?: number;
5760
5800
  memory_mib?: number;
5761
5801
  disk_mib?: number;
5802
+ /**
5803
+ * Infra is whose engines the sandbox runs on: cloud (the default),
5804
+ * private (the workspace's own engines that host sandboxes, where it
5805
+ * costs nothing and needs no credit) or private_first (the
5806
+ * workspace's when one has room, the cloud otherwise). One made from
5807
+ * a snapshot kept on an engine of the workspace alone is private
5808
+ * when this is left out.
5809
+ */
5810
+ infra?: Infra;
5762
5811
  /**
5763
5812
  * Credentials are the logins the box gets, by provider (slug), as a
5764
5813
  * run of its owner resolves them (e.g. [{"slug":"github-app"}]). Only
@@ -5880,6 +5929,11 @@ export interface SandboxDTO extends BaseModelDTO, PermissionModelDTO {
5880
5929
  vcpus: number;
5881
5930
  memory_mib: number;
5882
5931
  disk_mib: number;
5932
+ /**
5933
+ * Infra is whose engines the sandbox runs on: cloud, private or
5934
+ * private_first.
5935
+ */
5936
+ infra: Infra;
5883
5937
  desired_state: SandboxDesiredState;
5884
5938
  status: SandboxStatus;
5885
5939
  status_reason?: string;
@@ -6978,6 +7032,49 @@ export interface UserMetadataDTO {
6978
7032
  terms_accepted_at?: string;
6979
7033
  terms_version: string;
6980
7034
  }
7035
+ /**
7036
+ * VarRequirement is an entry under vars: in inf.yml: a variable the app
7037
+ * reads from the running team. At run time the app gets the team's value
7038
+ * for Key, else Default; a variable with neither that is not Optional
7039
+ * fails the run as a missing requirement.
7040
+ */
7041
+ export interface VarRequirement {
7042
+ key: string;
7043
+ description?: string;
7044
+ optional?: boolean;
7045
+ default?: string;
7046
+ }
7047
+ /**
7048
+ * VariableDTO is a team's variable. The value is plain by definition.
7049
+ */
7050
+ export interface VariableDTO {
7051
+ id: string;
7052
+ created_at: string;
7053
+ updated_at: string;
7054
+ team_id: string;
7055
+ user_id: string;
7056
+ key: string;
7057
+ value: string;
7058
+ description?: string;
7059
+ }
7060
+ /**
7061
+ * VariableSetRequest is the body of PUT /variables/{key}: it creates the
7062
+ * variable or replaces its value. Description, when sent, replaces the
7063
+ * stored one.
7064
+ */
7065
+ export interface VariableSetRequest {
7066
+ value: string;
7067
+ description?: string;
7068
+ }
7069
+ /**
7070
+ * VariableListResponse is one page of a team's variables, by key.
7071
+ */
7072
+ export interface VariableListResponse {
7073
+ items: VariableDTO[];
7074
+ next_cursor: string;
7075
+ has_next: boolean;
7076
+ items_per_page: number;
7077
+ }
6981
7078
  /**
6982
7079
  * Widget is an A2UI surface stored on a ToolInvocation.
6983
7080
  * Alias of shared.A2UISurface so the type generation pipeline picks it up.
@@ -7943,6 +8040,15 @@ export interface ChatData {
7943
8040
  * trusted or filtered on: Chat.Origin is what a chat list filters.
7944
8041
  */
7945
8042
  client?: string;
8043
+ /**
8044
+ * Infra is where the tasks the agent's app tools run in this chat go,
8045
+ * for the chat's team: its own engines (private), the cloud, or its
8046
+ * engines when one can take the task and the cloud otherwise
8047
+ * (private_first). Empty is the cloud. Whoever runs the agent sets it
8048
+ * (ApiAgentRunRequest.Infra, ChatSettingsRequest.Infra); a sub-agent's
8049
+ * chat takes its parent's.
8050
+ */
8051
+ infra?: Infra;
7946
8052
  }
7947
8053
  /**
7948
8054
  * ChatOrigin is how a chat came to be. A chat list shows a person's own
package/dist/types.js CHANGED
@@ -580,6 +580,16 @@ export const EngineCapabilitySandboxSnapshots = "sandbox_snapshots";
580
580
  * each against the manifest, and rebuilds the disk.
581
581
  */
582
582
  export const EngineCapabilitySandboxSnapshotStore = "sandbox_snapshot_store";
583
+ /**
584
+ * EngineCapabilityTaskEnv: the engine gives each task the app
585
+ * environment that task was dispatched with (TaskDispatchPayload.AppEnv):
586
+ * a worker whose visor was started with another environment is restarted
587
+ * before the task runs, as it is when its secrets change. Without it a
588
+ * warm worker keeps the environment of the first task it ran, so a task
589
+ * whose environment carries its team's variables (INF-1345) is sent
590
+ * only to an engine that has it.
591
+ */
592
+ export const EngineCapabilityTaskEnv = "task_env";
583
593
  /**
584
594
  * MaxOvercommit and MaxCPUSlots bound what EngineCapacityPolicy may say.
585
595
  */
@@ -978,9 +988,19 @@ export const RequirementTypeCredential = "credential";
978
988
  * Requirement error types
979
989
  */
980
990
  export const RequirementTypeScope = "scope";
991
+ /**
992
+ * RequirementTypeVariable: an environment variable the app declares
993
+ * under vars: that the team has not set and the app gives no default.
994
+ */
995
+ export const RequirementTypeVariable = "variable";
981
996
  export const SetupActionAddSecret = "add_secret";
982
997
  export const SetupActionConnect = "connect";
983
998
  export const SetupActionAddScopes = "add_scopes";
999
+ /**
1000
+ * SetupActionAddVariable: set the team's variable RequirementError.Key
1001
+ * (PUT /variables/{key}).
1002
+ */
1003
+ export const SetupActionAddVariable = "add_variable";
984
1004
  export const SandboxStatusPending = "pending";
985
1005
  export const SandboxStatusStarting = "starting";
986
1006
  export const SandboxStatusRunning = "running";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for inference.sh - Run AI models with a simple API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",