@inferencesh/sdk 0.39.2 → 0.39.3

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
@@ -341,6 +341,12 @@ export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
341
341
  * platform's mode.
342
342
  */
343
343
  content_guard?: ContentGuardConfig;
344
+ /**
345
+ * VaultID is the agent's vault: the sandboxes its sandbox_create makes
346
+ * get the vault's inference.sh access (VaultDTO.APIScopes). Absent: no
347
+ * vault.
348
+ */
349
+ vault_id?: string;
344
350
  /**
345
351
  * VisitorReads is the scope groups of the team's resources (knowledge,
346
352
  * files, artifacts, remotes) a visitor of an embed of this version can
@@ -396,6 +402,11 @@ export interface AgentConfigInput {
396
402
  hooks?: LifecycleHookConfig[];
397
403
  output_schema?: any;
398
404
  content_guard?: ContentGuardConfig;
405
+ /**
406
+ * VaultID picks the agent's vault, whose inference.sh access the
407
+ * sandboxes it makes get. Empty: no vault.
408
+ */
409
+ vault_id?: string;
399
410
  }
400
411
  /**
401
412
  * CoreAppConfigInput is the API input shape for core app configuration.
@@ -478,6 +489,12 @@ export interface ApiAppRunRequest {
478
489
  session?: string;
479
490
  session_timeout?: number;
480
491
  run_at?: string;
492
+ /**
493
+ * StartTimeout, in seconds (1-86400): if no worker has started the task
494
+ * within it (counted from run_at when set), it is cancelled, not
495
+ * billed, and leaves the queue. Unset, it waits as any task does.
496
+ */
497
+ start_timeout?: number;
481
498
  }
482
499
  /**
483
500
  * MessageInput is a message a caller sends to an agent: its text and the
@@ -1410,6 +1427,11 @@ export interface ScopeDefinition {
1410
1427
  * apps, agents, flows).
1411
1428
  */
1412
1429
  costs_credits?: boolean;
1430
+ /**
1431
+ * Sandbox: a vault may grant it to a sandbox (its inference.sh access,
1432
+ * VaultDTO.APIScopes); the allowlist is models.SandboxMayHold.
1433
+ */
1434
+ sandbox?: boolean;
1413
1435
  }
1414
1436
  /**
1415
1437
  * ScopeCategory is the section of a permission list a scope group falls
@@ -2445,6 +2467,13 @@ export interface ChatSettingsRequest {
2445
2467
  * agent keeps for this conversation. A key that is not there is ignored.
2446
2468
  */
2447
2469
  forget_memory?: string[];
2470
+ /**
2471
+ * Strictness is what the agent does in this chat after the content
2472
+ * guard flags something it read: watch, ask or strict. "" clears the
2473
+ * chat's own level, so the agent's default applies. A team or org
2474
+ * minimum still raises it (GET /chats/{id}/strictness).
2475
+ */
2476
+ strictness?: ChatStrictness;
2448
2477
  }
2449
2478
  /**
2450
2479
  * ChatSettingsDTO is what POST /chats/{id}/settings answers with: the chat's
@@ -2465,6 +2494,56 @@ export interface ChatSettingsDTO {
2465
2494
  * Memory is agent_data.memory after forget_memory removed its keys.
2466
2495
  */
2467
2496
  memory: StringEncodedMap;
2497
+ /**
2498
+ * Strictness is agent_data.strictness: the chat's own level, "" when
2499
+ * it follows the agent's default.
2500
+ */
2501
+ strictness: ChatStrictness;
2502
+ }
2503
+ /**
2504
+ * ChatStrictnessDTO is GET /chats/{id}/strictness: what the agent does in
2505
+ * the chat after the content guard flags something it read, and where that
2506
+ * comes from. Effective is the strictest of the chat's level (Chat, else
2507
+ * AgentDefault, else watch), Minimum and Delegated.
2508
+ */
2509
+ export interface ChatStrictnessDTO {
2510
+ chat_id: string;
2511
+ /**
2512
+ * Chat is the chat's own level; "" when it follows the agent.
2513
+ */
2514
+ chat: ChatStrictness;
2515
+ /**
2516
+ * AgentDefault is the agent's content_guard.strictness; "" for watch.
2517
+ */
2518
+ agent_default: ChatStrictness;
2519
+ /**
2520
+ * Minimum is the strictest level the chat's team or org governance
2521
+ * policy sets; "" when neither sets one. Levels below it are locked.
2522
+ */
2523
+ minimum: ChatStrictness;
2524
+ /**
2525
+ * MinimumSetBy is the rung that set Minimum: team or org.
2526
+ */
2527
+ minimum_set_by?: PolicySubject;
2528
+ /**
2529
+ * Delegated is, for a sub-agent's chat, the level the chat that
2530
+ * delegated to it runs at: a floor, so a sub-agent never runs looser
2531
+ * than its delegating chat. "" for a chat no agent delegated.
2532
+ */
2533
+ delegated?: ChatStrictness;
2534
+ /**
2535
+ * Flagged reports that the content guard has flagged something an
2536
+ * agent read in this chat, or in the chat that delegated to it. It
2537
+ * lasts for the life of the chat: what was flagged stays in its
2538
+ * history, so ask and strict apply to every later run of the chat.
2539
+ * Lowering the chat's level (the person's sign-in) is how runs go on
2540
+ * unasked again.
2541
+ */
2542
+ flagged: boolean;
2543
+ /**
2544
+ * Effective is the level the chat runs at.
2545
+ */
2546
+ effective: ChatStrictness;
2468
2547
  }
2469
2548
  /**
2470
2549
  * ChatAgentDTO is what POST /chats/{id}/agent answers with: the agent the
@@ -2818,6 +2897,12 @@ export interface ContentGuardConfig {
2818
2897
  * job is reading Slack mentions).
2819
2898
  */
2820
2899
  ignore_rules?: string[];
2900
+ /**
2901
+ * Strictness is what the agent's chats do after the guard flags a
2902
+ * result, unless a chat sets its own: watch (default), ask or strict
2903
+ * (shared.ChatStrictness). A team or org minimum still raises it.
2904
+ */
2905
+ strictness?: ChatStrictness;
2821
2906
  }
2822
2907
  /**
2823
2908
  * ContentTier is how far a tool's output is from the agent's operator:
@@ -3342,7 +3427,7 @@ export interface WorkerRAM {
3342
3427
  * a task lists the ones it needs (Task.Requires); the scheduler only sends
3343
3428
  * a task to an engine that has every one it needs.
3344
3429
  */
3345
- export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots";
3430
+ export type EngineCapability = "egress_gateway" | "sandboxes" | "capacity" | "egress_pending" | "egress_grants" | "egress_decide" | "sized_sandboxes" | "sized_workers" | "sandbox_snapshots" | "sandbox_snapshot_store";
3346
3431
  /**
3347
3432
  * EngineCapabilityEgressGateway: the engine runs its sandboxes behind
3348
3433
  * the egress gateway, so it can take bound secrets (the v2 secrets
@@ -3410,6 +3495,16 @@ export declare const EngineCapabilitySizedWorkers: EngineCapability;
3410
3495
  * WsSandboxStartPayload.FromSnapshotID; INF-1251).
3411
3496
  */
3412
3497
  export declare const EngineCapabilitySandboxSnapshots: EngineCapability;
3498
+ /**
3499
+ * EngineCapabilitySandboxSnapshotStore: the engine also keeps a
3500
+ * snapshot in object storage when asked (WsSandboxSnapshotPayload.Store):
3501
+ * it exports the copy's used blocks, compressed, and uploads them in
3502
+ * parts through URLs the API presigns (it holds no storage credential).
3503
+ * It starts a sandbox from a stored snapshot it has no copy of
3504
+ * (WsSandboxStartPayload.FromSnapshot): it downloads the parts, checks
3505
+ * each against the manifest, and rebuilds the disk.
3506
+ */
3507
+ export declare const EngineCapabilitySandboxSnapshotStore: EngineCapability;
3413
3508
  /**
3414
3509
  * EngineCapabilities is a set of capabilities, kept as a list. Nil and
3415
3510
  * empty are the same: nothing beyond the base contract.
@@ -5660,6 +5755,14 @@ export interface CreateSandboxRequest {
5660
5755
  * smaller than the snapshot's.
5661
5756
  */
5662
5757
  from_snapshot_id?: string;
5758
+ /**
5759
+ * VaultID is the vault whose inference.sh access (VaultDTO.APIScopes)
5760
+ * the box gets, copied once now and cut to what the caller can hand
5761
+ * on. Empty: the box holds what it needs to run its remote and
5762
+ * nothing more. A sandbox an agent's sandbox_create makes takes the
5763
+ * agent's vault (AgentVersionDTO.VaultID) instead.
5764
+ */
5765
+ vault_id?: string;
5663
5766
  }
5664
5767
  /**
5665
5768
  * UpdateSandboxRequest is PATCH /sandboxes/{id}: the fields to change,
@@ -5787,6 +5890,12 @@ export interface SandboxDTO extends BaseModelDTO, PermissionModelDTO {
5787
5890
  * its box started, whichever is later.
5788
5891
  */
5789
5892
  last_activity_at?: string;
5893
+ /**
5894
+ * APIScopes are what the box may do with our API beyond running its
5895
+ * remote: copied from its vault when it was made (VaultID), for its
5896
+ * whole life. Absent or empty: nothing beyond the remote.
5897
+ */
5898
+ api_scopes?: Scope[];
5790
5899
  }
5791
5900
  /**
5792
5901
  * SandboxFileKind is what a path on a sandbox is.
@@ -5944,6 +6053,14 @@ export interface SandboxSnapshotDTO extends BaseModelDTO {
5944
6053
  status: SandboxSnapshotStatus;
5945
6054
  status_reason?: string;
5946
6055
  ready_at?: string;
6056
+ /**
6057
+ * StoreStatus is where keeping it in object storage stands: empty when
6058
+ * it is kept on its engine alone. Stored, a sandbox starts from it on
6059
+ * any engine, and it outlives the engine that took it. StoredBytes is
6060
+ * what the stored copy holds (compressed).
6061
+ */
6062
+ store_status?: SandboxSnapshotStoreStatus;
6063
+ stored_bytes?: number;
5947
6064
  /**
5948
6065
  * ForFork: taken by a fork for its sandboxes to start from, and
5949
6066
  * deleted once they have all started or failed. Not listed.
@@ -5989,6 +6106,28 @@ export interface ForkSandboxResponse {
5989
6106
  snapshot_id?: string;
5990
6107
  error?: string;
5991
6108
  }
6109
+ /**
6110
+ * SandboxSnapshotStoreStatus is where keeping a snapshot in object storage
6111
+ * stands (EngineCapabilitySandboxSnapshotStore).
6112
+ */
6113
+ export type SandboxSnapshotStoreStatus = "pending" | "uploading" | "stored" | "failed";
6114
+ /**
6115
+ * SandboxSnapshotStorePending: asked of the engine, not begun.
6116
+ */
6117
+ export declare const SandboxSnapshotStorePending: SandboxSnapshotStoreStatus;
6118
+ /**
6119
+ * SandboxSnapshotStoreUploading: the engine is uploading it.
6120
+ */
6121
+ export declare const SandboxSnapshotStoreUploading: SandboxSnapshotStoreStatus;
6122
+ /**
6123
+ * SandboxSnapshotStoreStored: it is in object storage, whole.
6124
+ */
6125
+ export declare const SandboxSnapshotStoreStored: SandboxSnapshotStoreStatus;
6126
+ /**
6127
+ * SandboxSnapshotStoreFailed: the upload did not finish; the snapshot
6128
+ * is still kept on its engine.
6129
+ */
6130
+ export declare const SandboxSnapshotStoreFailed: SandboxSnapshotStoreStatus;
5992
6131
  /**
5993
6132
  * SDKTypes is a phantom type for gotypegen dependency tracing.
5994
6133
  * Types listed here (and their transitive dependencies) are included
@@ -7731,6 +7870,22 @@ export declare const ChannelTypeSlack: ChannelType;
7731
7870
  export declare const ChannelTypeDiscord: ChannelType;
7732
7871
  export declare const ChannelTypeTeams: ChannelType;
7733
7872
  export declare const ChannelTypeTelegram: ChannelType;
7873
+ /**
7874
+ * ChatStrictness is what an agent does in a chat after the content guard
7875
+ * flags a tool result it read (a web page, an app's output, an MCP reply):
7876
+ * - watch: the flag is recorded and the run goes on. The default.
7877
+ * - ask: every later tool call of the run that has side effects waits
7878
+ * for a person's approval (the tool-approval prompt).
7879
+ * - strict: the run is stopped.
7880
+ * The agent's config sets the default (content_guard.strictness), a person
7881
+ * changes it per chat (agent_data.strictness), and a team or org governance
7882
+ * policy can set a minimum: the chat runs at the stricter of its own level
7883
+ * and the minimum (EffectiveChatStrictness).
7884
+ */
7885
+ export type ChatStrictness = "watch" | "ask" | "strict";
7886
+ export declare const ChatStrictnessWatch: ChatStrictness;
7887
+ export declare const ChatStrictnessAsk: ChatStrictness;
7888
+ export declare const ChatStrictnessStrict: ChatStrictness;
7734
7889
  /**
7735
7890
  * ChatData contains agent-specific data for a chat session
7736
7891
  */
@@ -7748,6 +7903,13 @@ export interface ChatData {
7748
7903
  * that reviews it.
7749
7904
  */
7750
7905
  disable_hooks?: boolean;
7906
+ /**
7907
+ * Strictness is what the agent does in this chat after the content
7908
+ * guard flags something it read: watch, ask or strict. Empty is the
7909
+ * agent's default (content_guard.strictness), itself watch when unset.
7910
+ * A team or org minimum can raise it (ChatStrictnessDTO.Effective).
7911
+ */
7912
+ strictness?: ChatStrictness;
7751
7913
  /**
7752
7914
  * Client is the app the chat was started from (web, mac, ios, cli,
7753
7915
  * sdk-js), as the request named itself (X-Client-Source). Shown, never
@@ -7859,7 +8021,7 @@ export interface ChatBackgroundEvent {
7859
8021
  * RunEndReason is why a run that completed ended the way it did, when its
7860
8022
  * last turn did not end with a reply.
7861
8023
  */
7862
- export type RunEndReason = "output_limit" | "no_reply" | "refusal";
8024
+ export type RunEndReason = "output_limit" | "no_reply" | "refusal" | "content_flagged";
7863
8025
  /**
7864
8026
  * RunEndReasonOutputLimit: the model's last turn hit its output limit
7865
8027
  * (max_tokens) before it replied or called a tool.
@@ -7877,6 +8039,12 @@ export declare const RunEndReasonNoReply: RunEndReason;
7877
8039
  * message is not refused for what this run held.
7878
8040
  */
7879
8041
  export declare const RunEndReasonRefusal: RunEndReason;
8042
+ /**
8043
+ * RunEndReasonContentFlagged: the content guard flagged a tool result
8044
+ * the run read and the chat's strictness is strict, so the run was
8045
+ * stopped there.
8046
+ */
8047
+ export declare const RunEndReasonContentFlagged: RunEndReason;
7880
8048
  /**
7881
8049
  * ChatRunEvent is how a run ended, on a run_ended event.
7882
8050
  */
@@ -9180,6 +9348,24 @@ export declare const PolicyKindWebFetch: PolicyKind;
9180
9348
  * secrets to a host.
9181
9349
  */
9182
9350
  export declare const PolicyKindSecretSend: PolicyKind;
9351
+ /**
9352
+ * PolicySubject is a rung of the subject ladder: what a policy is attached
9353
+ * to and what a decision names as its layer. Most specific first: remote,
9354
+ * chat, agent, user, team, org, platform. The values match CredentialScope
9355
+ * where both exist.
9356
+ */
9357
+ export type PolicySubject = "remote" | "chat" | "agent" | "user" | "team" | "org" | "platform";
9358
+ /**
9359
+ * PolicySubjectRemote is the machine a call runs on. Its policy is the
9360
+ * machine owner's, and only narrows.
9361
+ */
9362
+ export declare const PolicySubjectRemote: PolicySubject;
9363
+ export declare const PolicySubjectChat: PolicySubject;
9364
+ export declare const PolicySubjectAgent: PolicySubject;
9365
+ export declare const PolicySubjectUser: PolicySubject;
9366
+ export declare const PolicySubjectTeam: PolicySubject;
9367
+ export declare const PolicySubjectOrg: PolicySubject;
9368
+ export declare const PolicySubjectPlatform: PolicySubject;
9183
9369
  /**
9184
9370
  * FunctionKind is how an app function talks to its caller.
9185
9371
  */
package/dist/types.js CHANGED
@@ -570,6 +570,16 @@ export const EngineCapabilitySizedWorkers = "sized_workers";
570
570
  * WsSandboxStartPayload.FromSnapshotID; INF-1251).
571
571
  */
572
572
  export const EngineCapabilitySandboxSnapshots = "sandbox_snapshots";
573
+ /**
574
+ * EngineCapabilitySandboxSnapshotStore: the engine also keeps a
575
+ * snapshot in object storage when asked (WsSandboxSnapshotPayload.Store):
576
+ * it exports the copy's used blocks, compressed, and uploads them in
577
+ * parts through URLs the API presigns (it holds no storage credential).
578
+ * It starts a sandbox from a stored snapshot it has no copy of
579
+ * (WsSandboxStartPayload.FromSnapshot): it downloads the parts, checks
580
+ * each against the manifest, and rebuilds the disk.
581
+ */
582
+ export const EngineCapabilitySandboxSnapshotStore = "sandbox_snapshot_store";
573
583
  /**
574
584
  * MaxOvercommit and MaxCPUSlots bound what EngineCapacityPolicy may say.
575
585
  */
@@ -997,6 +1007,23 @@ export const SandboxSnapshotReady = "ready";
997
1007
  * says why), or the engine no longer has it.
998
1008
  */
999
1009
  export const SandboxSnapshotFailed = "failed";
1010
+ /**
1011
+ * SandboxSnapshotStorePending: asked of the engine, not begun.
1012
+ */
1013
+ export const SandboxSnapshotStorePending = "pending";
1014
+ /**
1015
+ * SandboxSnapshotStoreUploading: the engine is uploading it.
1016
+ */
1017
+ export const SandboxSnapshotStoreUploading = "uploading";
1018
+ /**
1019
+ * SandboxSnapshotStoreStored: it is in object storage, whole.
1020
+ */
1021
+ export const SandboxSnapshotStoreStored = "stored";
1022
+ /**
1023
+ * SandboxSnapshotStoreFailed: the upload did not finish; the snapshot
1024
+ * is still kept on its engine.
1025
+ */
1026
+ export const SandboxSnapshotStoreFailed = "failed";
1000
1027
  /**
1001
1028
  * UpdateRequested: the request was sent and nothing has answered it yet.
1002
1029
  * An engine older than engine_update_result never answers, so its update stays here.
@@ -1335,6 +1362,9 @@ export const ChannelTypeSlack = "slack";
1335
1362
  export const ChannelTypeDiscord = "discord";
1336
1363
  export const ChannelTypeTeams = "teams";
1337
1364
  export const ChannelTypeTelegram = "telegram";
1365
+ export const ChatStrictnessWatch = "watch";
1366
+ export const ChatStrictnessAsk = "ask";
1367
+ export const ChatStrictnessStrict = "strict";
1338
1368
  /**
1339
1369
  * ChatOriginUI is a person in one of our apps: web, mac, ios, watch or
1340
1370
  * the CLI.
@@ -1409,6 +1439,12 @@ export const RunEndReasonNoReply = "no_reply";
1409
1439
  * message is not refused for what this run held.
1410
1440
  */
1411
1441
  export const RunEndReasonRefusal = "refusal";
1442
+ /**
1443
+ * RunEndReasonContentFlagged: the content guard flagged a tool result
1444
+ * the run read and the chat's strictness is strict, so the run was
1445
+ * stopped there.
1446
+ */
1447
+ export const RunEndReasonContentFlagged = "content_flagged";
1412
1448
  /**
1413
1449
  * DescriptionLimitListing bounds the description of an app, agent, flow,
1414
1450
  * MCP server or knowledge entry. A description is shown in listings and
@@ -2069,6 +2105,17 @@ export const PolicyKindWebFetch = "WebFetch";
2069
2105
  * secrets to a host.
2070
2106
  */
2071
2107
  export const PolicyKindSecretSend = "SecretSend";
2108
+ /**
2109
+ * PolicySubjectRemote is the machine a call runs on. Its policy is the
2110
+ * machine owner's, and only narrows.
2111
+ */
2112
+ export const PolicySubjectRemote = "remote";
2113
+ export const PolicySubjectChat = "chat";
2114
+ export const PolicySubjectAgent = "agent";
2115
+ export const PolicySubjectUser = "user";
2116
+ export const PolicySubjectTeam = "team";
2117
+ export const PolicySubjectOrg = "org";
2118
+ export const PolicySubjectPlatform = "platform";
2072
2119
  /**
2073
2120
  * FunctionKindRun takes an input and returns an output (optionally
2074
2121
  * yielding progress on the way). The zero value means this.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inferencesh/sdk",
3
- "version": "0.39.2",
3
+ "version": "0.39.3",
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",