@inferencesh/sdk 0.41.5 → 0.41.6

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/dist/types.d.ts CHANGED
@@ -1026,7 +1026,7 @@ export interface EstimateCostResponse {
1026
1026
  /**
1027
1027
  * Scope represents an API key permission scope string.
1028
1028
  */
1029
- export type Scope = "*" | "agents" | "apps" | "conversations" | "files" | "datastores" | "templates" | "flows" | "projects" | "teams" | "billing" | "artifacts" | "forms" | "bounties" | "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" | "sandboxes:read" | "sandboxes:write" | "apikeys:read" | "apikeys:write" | "knowledge:read" | "knowledge:write" | "artifacts:read" | "artifacts:write" | "forms:read" | "forms:write" | "forms:execute" | "bounties:read" | "bounties:execute" | "user:read" | "user:write" | "settings:read" | "settings:write" | "approvals:write" | "admin:read" | "admin:write" | "store:pricing" | "store:submit" | "content:write";
1029
+ export type Scope = "*" | "agents" | "apps" | "conversations" | "files" | "datastores" | "templates" | "flows" | "projects" | "teams" | "billing" | "artifacts" | "forms" | "bounties" | "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" | "mcp:execute" | "engines:read" | "engines:write" | "remotes:read" | "remotes:write" | "sandboxes:read" | "sandboxes:write" | "apikeys:read" | "apikeys:write" | "knowledge:read" | "knowledge:write" | "artifacts:read" | "artifacts:write" | "forms:read" | "forms:write" | "forms:execute" | "bounties:read" | "bounties:execute" | "user:read" | "user:write" | "settings:read" | "settings:write" | "approvals:write" | "admin:read" | "admin:write" | "store:pricing" | "store:submit" | "content:write";
1030
1030
  /**
1031
1031
  * API Key Scopes - hierarchical permission system.
1032
1032
  * Resource-level scopes (e.g., "agents") imply all action-level scopes (e.g., "agents:read").
@@ -1244,6 +1244,14 @@ export declare const ScopeCredentialsRead: Scope;
1244
1244
  * Empty scopes = full access (for backwards compatibility with existing keys).
1245
1245
  */
1246
1246
  export declare const ScopeCredentialsWrite: Scope;
1247
+ /**
1248
+ * ScopeMCPExecute calls a tool on a connected MCP server with the
1249
+ * caller's stored login (REST CallTool, the mcp_run tool, an agent's MCP
1250
+ * tools). Finding the server and its connection takes credentials:read
1251
+ * beside it; credentials:write (connecting and disconnecting) does not
1252
+ * call tools.
1253
+ */
1254
+ export declare const ScopeMCPExecute: Scope;
1247
1255
  /**
1248
1256
  * Action-level scopes for Engines
1249
1257
  */
@@ -1394,7 +1402,7 @@ export declare const ScopeContentWrite: Scope;
1394
1402
  /**
1395
1403
  * ScopeGroup identifies a category of scopes for UI grouping
1396
1404
  */
1397
- export type ScopeGroup = "agents" | "apps" | "conversations" | "files" | "datastores" | "flows" | "projects" | "teams" | "billing" | "secrets" | "credentials" | "engines" | "remotes" | "sandboxes" | "apikeys" | "knowledge" | "artifacts" | "forms" | "bounties" | "user" | "settings" | "approvals" | "admin" | "store" | "content";
1405
+ export type ScopeGroup = "agents" | "apps" | "conversations" | "files" | "datastores" | "flows" | "projects" | "teams" | "billing" | "secrets" | "credentials" | "mcp" | "engines" | "remotes" | "sandboxes" | "apikeys" | "knowledge" | "artifacts" | "forms" | "bounties" | "user" | "settings" | "approvals" | "admin" | "store" | "content";
1398
1406
  export declare const ScopeGroupAgents: ScopeGroup;
1399
1407
  export declare const ScopeGroupApps: ScopeGroup;
1400
1408
  export declare const ScopeGroupConversations: ScopeGroup;
@@ -1406,6 +1414,7 @@ export declare const ScopeGroupTeams: ScopeGroup;
1406
1414
  export declare const ScopeGroupBilling: ScopeGroup;
1407
1415
  export declare const ScopeGroupSecrets: ScopeGroup;
1408
1416
  export declare const ScopeGroupCredentials: ScopeGroup;
1417
+ export declare const ScopeGroupMCP: ScopeGroup;
1409
1418
  export declare const ScopeGroupEngines: ScopeGroup;
1410
1419
  export declare const ScopeGroupRemotes: ScopeGroup;
1411
1420
  export declare const ScopeGroupSandboxes: ScopeGroup;
@@ -3498,7 +3507,7 @@ export interface WorkerRAM {
3498
3507
  * a task lists the ones it needs (Task.Requires); the scheduler only sends
3499
3508
  * a task to an engine that has every one it needs.
3500
3509
  */
3501
- export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots" | "sandbox_snapshot_store" | "task_env";
3510
+ export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots" | "sandbox_snapshot_store" | "task_env" | "egress_forms" | "egress_h2" | "egress_host_suffix";
3502
3511
  /**
3503
3512
  * EngineCapabilityEgressGateway: the engine runs its sandboxes behind
3504
3513
  * the egress gateway, so it can take bound secrets (the v2 secrets
@@ -3586,6 +3595,31 @@ export declare const EngineCapabilitySandboxSnapshotStore: EngineCapability;
3586
3595
  * only to an engine that has it.
3587
3596
  */
3588
3597
  export declare const EngineCapabilityTaskEnv: EngineCapability;
3598
+ /**
3599
+ * EngineCapabilityEgressForms: the engine's gateway takes the forms a
3600
+ * bound value goes by beyond a header or a query parameter: in a
3601
+ * request body (BoundForm.Body) and as a token it signs with the value
3602
+ * (BoundForm.JWT, HS256). A binding in such a form is sent to no other
3603
+ * engine (EngineCapabilities.Takes), and a task that may get one
3604
+ * requires it (Task.Requires).
3605
+ */
3606
+ export declare const EngineCapabilityEgressForms: EngineCapability;
3607
+ /**
3608
+ * EngineCapabilityEgressH2: the engine's gateway speaks HTTP/2 with a
3609
+ * sandbox whose TLS it terminates and with the bound host, so a client
3610
+ * that speaks nothing else (gRPC) gets its bound value placed. A task
3611
+ * given a key of a provider used over HTTP/2 (BoundKey.H2) requires it
3612
+ * (Task.Requires): on any other engine the client could not connect.
3613
+ */
3614
+ export declare const EngineCapabilityEgressH2: EngineCapability;
3615
+ /**
3616
+ * EngineCapabilityEgressHostSuffix: the engine's gateway reads a bound
3617
+ * host that begins with a dot (".example.com") as every host under
3618
+ * that domain (models.HostBoundAt). Any other engine would read the
3619
+ * entry as a name no host has: it is sent none
3620
+ * (EngineCapabilities.Takes), and a task that may get one requires it.
3621
+ */
3622
+ export declare const EngineCapabilityEgressHostSuffix: EngineCapability;
3589
3623
  /**
3590
3624
  * EngineCapabilities is a set of capabilities, kept as a list. Nil and
3591
3625
  * empty are the same: nothing beyond the base contract.
@@ -6413,6 +6447,38 @@ export interface SystemInfo {
6413
6447
  * and from engines that predate it.
6414
6448
  */
6415
6449
  host_cpu?: HostCPU;
6450
+ /**
6451
+ * Sandbox is the OS sandbox a remote's daemon confines commands with
6452
+ * (Landlock on Linux, Seatbelt on macOS), as it found it at startup;
6453
+ * nil from engines and from daemons that predate it.
6454
+ */
6455
+ sandbox?: RemoteSandbox;
6456
+ }
6457
+ /**
6458
+ * RemoteSandbox is what a remote's daemon can enforce of a run's file rules
6459
+ * (WsRemoteExecStart.FileRules) in the kernel.
6460
+ */
6461
+ export interface RemoteSandbox {
6462
+ /**
6463
+ * Mechanism is "landlock" (Linux), "seatbelt" (macOS) or "none".
6464
+ */
6465
+ mechanism: string;
6466
+ /**
6467
+ * Version is the mechanism's version when it has one: the Landlock ABI
6468
+ * ("abi 6").
6469
+ */
6470
+ version?: string;
6471
+ /**
6472
+ * Available says commands with file rules run confined. When false,
6473
+ * Reason says why, and they run unconfined unless Required.
6474
+ */
6475
+ available: boolean;
6476
+ reason?: string;
6477
+ /**
6478
+ * Required is the owner's choice (belt remote start --require-sandbox):
6479
+ * a run with file rules the daemon cannot enforce is refused.
6480
+ */
6481
+ required?: boolean;
6416
6482
  }
6417
6483
  /**
6418
6484
  * HostCPU is how a host runs its CPUs: the settings that make the same
@@ -7517,6 +7583,16 @@ export declare const AuthMethodFlowClientCredentials: AuthMethodFlow;
7517
7583
  export type AuthMethodAPIKeyIn = "header" | "query";
7518
7584
  export declare const AuthMethodAPIKeyInHeader: AuthMethodAPIKeyIn;
7519
7585
  export declare const AuthMethodAPIKeyInQuery: AuthMethodAPIKeyIn;
7586
+ /**
7587
+ * AuthMethodTransport is the protocol a provider's API is spoken in, when
7588
+ * it matters to where a run may go (AuthMethod.Transport).
7589
+ */
7590
+ export type AuthMethodTransport = "h2";
7591
+ /**
7592
+ * AuthMethodTransportH2 is HTTP/2: gRPC, or an API that takes nothing
7593
+ * else.
7594
+ */
7595
+ export declare const AuthMethodTransportH2: AuthMethodTransport;
7520
7596
  /**
7521
7597
  * AuthMethodHTTPScheme is the Authorization scheme of an http scheme.
7522
7598
  */
@@ -7541,6 +7617,101 @@ export interface SecretField {
7541
7617
  */
7542
7618
  pattern?: string;
7543
7619
  }
7620
+ /**
7621
+ * AuthMethodSign is one key pair a scheme signs requests with
7622
+ * (AuthMethod.Sign), and how: which of the scheme's fields is the access
7623
+ * key id (sent in the clear, in the request's Authorization) and which
7624
+ * the secret key, the hosts the pair signs toward, and the signature
7625
+ * itself as data. Preset names a vendor's parameter set (SignPresets); a
7626
+ * parameter written out overrides the preset's, and with no preset the
7627
+ * recipe writes them all. The engines' egress gateway implements the
7628
+ * algorithm; the vendor is these parameters.
7629
+ */
7630
+ export interface AuthMethodSign {
7631
+ /**
7632
+ * Preset is a built-in parameter set: "volc-v4" (Volcengine, BytePlus)
7633
+ * or "tc3" (Tencent Cloud). Empty: the parameters below say it all.
7634
+ */
7635
+ preset?: string;
7636
+ /**
7637
+ * KeyID and Secret are the keys of the two fields: the access key id
7638
+ * and the secret key.
7639
+ */
7640
+ key_id: string;
7641
+ secret: string;
7642
+ /**
7643
+ * Region and Service fill the scope's {region} and {service} terms, as
7644
+ * the vendor names them for Hosts ("ap-southeast-1", "ark"). Each is
7645
+ * required when the scope has its term and refused when it does not.
7646
+ */
7647
+ region?: string;
7648
+ service?: string;
7649
+ /**
7650
+ * Hosts are the hosts this pair signs toward, each exact; empty is
7651
+ * the scheme's Hosts. One of the two is required.
7652
+ */
7653
+ hosts?: string[];
7654
+ /**
7655
+ * The parameters (SignParams says what each does). The four that may
7656
+ * be empty on purpose are pointers: "" overrides a preset's value,
7657
+ * absent keeps it.
7658
+ */
7659
+ algorithm?: string;
7660
+ label?: string;
7661
+ key_prefix?: string;
7662
+ scope?: string[];
7663
+ date_format?: string;
7664
+ time_header?: string;
7665
+ time_format?: string;
7666
+ hash_header?: string;
7667
+ unsigned_header?: string;
7668
+ signed_headers?: string[];
7669
+ header_values?: string;
7670
+ uri?: string;
7671
+ host?: string;
7672
+ token_header?: string;
7673
+ }
7674
+ /**
7675
+ * AuthMethodJWTAlg is a token's signature (AuthMethodJWT.Alg).
7676
+ */
7677
+ export type AuthMethodJWTAlg = "HS256";
7678
+ /**
7679
+ * AuthMethodJWTHS256 is HMAC-SHA256 keyed by the signing field's value.
7680
+ */
7681
+ export declare const AuthMethodJWTHS256: AuthMethodJWTAlg;
7682
+ /**
7683
+ * AuthMethodJWT is the token a scheme's key is made as (AuthMethod.JWT): a
7684
+ * JWT with the header {"alg": Alg, "typ": "JWT"} and the claims iss
7685
+ * (Issuer's value, when named), exp (now + TTL), nbf (now - NotBefore,
7686
+ * when set) and Claims, signed with Secret's value.
7687
+ */
7688
+ export interface AuthMethodJWT {
7689
+ /**
7690
+ * Key is the name a run presents as its bearer: the one placeholder it
7691
+ * holds. A login holding a value under Key itself sends that value
7692
+ * instead (a static API key); it need not be one of Fields.
7693
+ */
7694
+ key: string;
7695
+ alg: AuthMethodJWTAlg;
7696
+ /**
7697
+ * Secret is the field whose value signs; Issuer the field whose value
7698
+ * is the iss claim, "" for none. Neither is ever given to a run.
7699
+ */
7700
+ secret: string;
7701
+ issuer?: string;
7702
+ /**
7703
+ * TTL is the token's lifetime in seconds, at most a day; NotBefore is
7704
+ * how many seconds before now nbf is set, 0 for no nbf.
7705
+ */
7706
+ ttl: number;
7707
+ nbf?: number;
7708
+ /**
7709
+ * Claims are claims added as they are; iss, exp and nbf win.
7710
+ */
7711
+ claims?: {
7712
+ [key: string]: string;
7713
+ };
7714
+ }
7544
7715
  /**
7545
7716
  * AuthMethodClientAuth is how client_id/client_secret reach the token
7546
7717
  * endpoint. Most providers accept either; a few insist on one.
@@ -7627,6 +7798,13 @@ export interface AuthMethodAppKey {
7627
7798
  * Optional is implied for every name but client_id and client_secret.
7628
7799
  */
7629
7800
  optional?: boolean;
7801
+ /**
7802
+ * Token marks a key that is a token of its own, sent as
7803
+ * Authorization: Bearer to the method's hosts (Slack's bot token): a
7804
+ * run given it holds a placeholder, bound to Hosts like the login's
7805
+ * access token. A key that never travels (a signing secret) is not one.
7806
+ */
7807
+ token?: boolean;
7630
7808
  }
7631
7809
  /**
7632
7810
  * AuthMethodLookup is a call made after the token exchange, with the new
@@ -7743,6 +7921,14 @@ export interface AuthMethod {
7743
7921
  in?: AuthMethodAPIKeyIn;
7744
7922
  param_name?: string;
7745
7923
  value_prefix?: string;
7924
+ /**
7925
+ * InBody says an api_key key also travels in the body of a request to
7926
+ * Hosts (a field of a JSON or form body): the egress gateway replaces
7927
+ * the key's placeholder there too, toward Hosts only. With no In, the
7928
+ * key goes in the body alone. It needs Hosts, the row's or the
7929
+ * catalog's; without them the key is an environment variable as before.
7930
+ */
7931
+ in_body?: boolean;
7746
7932
  /**
7747
7933
  * Scheme and BearerFormat describe an http kind's Authorization header.
7748
7934
  */
@@ -7750,7 +7936,12 @@ export interface AuthMethod {
7750
7936
  bearer_format?: string;
7751
7937
  /**
7752
7938
  * Hosts are the hosts the credential's value is sent to, each exact
7753
- * ("api.anthropic.com", "db.example.com:5432"): the key a person
7939
+ * ("api.anthropic.com", "db.example.com:5432"), or, beginning with a
7940
+ * dot, every host under a domain (".example.com": api.example.com and
7941
+ * api.eu1.example.com, never example.com itself; the domain is never
7942
+ * a top-level domain or a registry's suffix such as ".co.uk", and may
7943
+ * be a company's shared domain such as ".googleapis.com", a broad
7944
+ * destination; models.ValidHostSuffix): the key a person
7754
7945
  * pastes, or an oauth2 scheme's access token. A scheme with hosts
7755
7946
  * binds its secrets: a run behind the egress gateway holds a
7756
7947
  * placeholder for each, and the gateway puts the value in only on the
@@ -7759,6 +7950,34 @@ export interface AuthMethod {
7759
7950
  * come from the catalog when the row names none.
7760
7951
  */
7761
7952
  hosts?: string[];
7953
+ /**
7954
+ * Sign says the provider takes no key: each request is signed with a
7955
+ * key pair of Fields (Volcengine and BytePlus, Tencent Cloud). Each
7956
+ * entry binds one pair for signing and says how the signature is made
7957
+ * (a preset, or its parameters): a run behind the egress gateway holds
7958
+ * a placeholder for both halves, its client signs with them, and the
7959
+ * gateway signs the request again with the real pair toward the
7960
+ * entry's hosts only. The secret key is never an environment variable.
7961
+ * api_key kind. A catalogued provider's come from the catalog when the
7962
+ * row has none.
7963
+ */
7964
+ sign?: AuthMethodSign[];
7965
+ /**
7966
+ * JWT says the provider takes a short-lived token the client signs
7967
+ * with a key of Fields (Kling): the egress gateway signs it, and a run
7968
+ * holds one placeholder, JWT.Key's, which leaves as the token toward
7969
+ * Hosts. The signing fields are never given to a run. api_key kind. A
7970
+ * catalogued provider's comes from the catalog when the row has none.
7971
+ */
7972
+ jwt?: AuthMethodJWT;
7973
+ /**
7974
+ * Transport says the provider's API is spoken over HTTP/2
7975
+ * (AuthMethodTransportH2: gRPC), so a run given one of the scheme's
7976
+ * bound secrets goes only to an engine whose egress gateway speaks it
7977
+ * (egress_h2). Empty: HTTP/1.1 serves, and any gateway does. It needs
7978
+ * Hosts, as InBody does.
7979
+ */
7980
+ transport?: AuthMethodTransport;
7762
7981
  authorization_endpoint?: string;
7763
7982
  scopes?: string[];
7764
7983
  /**
package/dist/types.js CHANGED
@@ -232,6 +232,14 @@ export const ScopeCredentialsRead = "credentials:read";
232
232
  * Empty scopes = full access (for backwards compatibility with existing keys).
233
233
  */
234
234
  export const ScopeCredentialsWrite = "credentials:write";
235
+ /**
236
+ * ScopeMCPExecute calls a tool on a connected MCP server with the
237
+ * caller's stored login (REST CallTool, the mcp_run tool, an agent's MCP
238
+ * tools). Finding the server and its connection takes credentials:read
239
+ * beside it; credentials:write (connecting and disconnecting) does not
240
+ * call tools.
241
+ */
242
+ export const ScopeMCPExecute = "mcp:execute";
235
243
  /**
236
244
  * Action-level scopes for Engines
237
245
  */
@@ -390,6 +398,7 @@ export const ScopeGroupTeams = "teams";
390
398
  export const ScopeGroupBilling = "billing";
391
399
  export const ScopeGroupSecrets = "secrets";
392
400
  export const ScopeGroupCredentials = "credentials";
401
+ export const ScopeGroupMCP = "mcp";
393
402
  export const ScopeGroupEngines = "engines";
394
403
  export const ScopeGroupRemotes = "remotes";
395
404
  export const ScopeGroupSandboxes = "sandboxes";
@@ -590,6 +599,31 @@ export const EngineCapabilitySandboxSnapshotStore = "sandbox_snapshot_store";
590
599
  * only to an engine that has it.
591
600
  */
592
601
  export const EngineCapabilityTaskEnv = "task_env";
602
+ /**
603
+ * EngineCapabilityEgressForms: the engine's gateway takes the forms a
604
+ * bound value goes by beyond a header or a query parameter: in a
605
+ * request body (BoundForm.Body) and as a token it signs with the value
606
+ * (BoundForm.JWT, HS256). A binding in such a form is sent to no other
607
+ * engine (EngineCapabilities.Takes), and a task that may get one
608
+ * requires it (Task.Requires).
609
+ */
610
+ export const EngineCapabilityEgressForms = "egress_forms";
611
+ /**
612
+ * EngineCapabilityEgressH2: the engine's gateway speaks HTTP/2 with a
613
+ * sandbox whose TLS it terminates and with the bound host, so a client
614
+ * that speaks nothing else (gRPC) gets its bound value placed. A task
615
+ * given a key of a provider used over HTTP/2 (BoundKey.H2) requires it
616
+ * (Task.Requires): on any other engine the client could not connect.
617
+ */
618
+ export const EngineCapabilityEgressH2 = "egress_h2";
619
+ /**
620
+ * EngineCapabilityEgressHostSuffix: the engine's gateway reads a bound
621
+ * host that begins with a dot (".example.com") as every host under
622
+ * that domain (models.HostBoundAt). Any other engine would read the
623
+ * entry as a name no host has: it is sent none
624
+ * (EngineCapabilities.Takes), and a task that may get one requires it.
625
+ */
626
+ export const EngineCapabilityEgressHostSuffix = "egress_host_suffix";
593
627
  /**
594
628
  * MaxOvercommit and MaxCPUSlots bound what EngineCapacityPolicy may say.
595
629
  */
@@ -1250,8 +1284,17 @@ export const AuthMethodFlowAuthorizationCode = "authorization_code";
1250
1284
  export const AuthMethodFlowClientCredentials = "client_credentials";
1251
1285
  export const AuthMethodAPIKeyInHeader = "header";
1252
1286
  export const AuthMethodAPIKeyInQuery = "query";
1287
+ /**
1288
+ * AuthMethodTransportH2 is HTTP/2: gRPC, or an API that takes nothing
1289
+ * else.
1290
+ */
1291
+ export const AuthMethodTransportH2 = "h2";
1253
1292
  export const AuthMethodHTTPBearer = "bearer";
1254
1293
  export const AuthMethodHTTPBasic = "basic";
1294
+ /**
1295
+ * AuthMethodJWTHS256 is HMAC-SHA256 keyed by the signing field's value.
1296
+ */
1297
+ export const AuthMethodJWTHS256 = "HS256";
1255
1298
  /**
1256
1299
  * AuthMethodClientAuthBasic sends them as an HTTP Basic Authorization
1257
1300
  * header (RFC 6749 §2.3.1, the default).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.41.5",
3
+ "version": "0.41.6",
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",