@inferencesh/sdk 0.39.2 → 0.39.4
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 +29 -0
- package/dist/agent/actions.d.ts +12 -0
- package/dist/agent/actions.js +11 -0
- package/dist/agent/mcp-input.d.ts +6 -1
- package/dist/agent/mcp-input.js +81 -4
- package/dist/agent/provider.js +17 -6
- package/dist/types.d.ts +188 -2
- package/dist/types.js +47 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.39.4] - 2026-11-13
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- `AgentChatProvider` uses a replaced `client` prop. The chat actions were created once with the first client, so after the client changed (a new API key, another account) sending, uploading, approvals and the stream kept calling the API as the old one. The actions are now rebuilt for the new client, the old client's stream is stopped and the open chat is reopened with the new one. Pass a stable client (`useMemo`): a client created on every render restarts the stream on every render.
|
|
14
|
+
- `elicitParams` drops malformed MCP elicitation params and schema parts instead of passing them on.
|
|
15
|
+
|
|
16
|
+
## [0.39.3] - 2026-11-12
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- Types regenerated from the API: chat strictness (`ChatStrictness`, `ChatStrictnessDTO`, `ChatSettingsDTO.strictness`, run end reason `content_flagged`), sandbox snapshots kept in object storage, task `start_timeout`.
|
|
20
|
+
|
|
21
|
+
## [0.39.2] - 2026-11-10
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Sandboxes: `exec` (waits for the result), `listFiles`, `readFile`, `readTextFile`, `writeFile`, `deleteFile`, `limits`. Files move through file storage (`writeFile` uploads then imports, `readFile` exports then downloads; the storage copy is deleted).
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- `sandboxes.limits()` follows the entitlement-built DTO: `limits[]` of `ResourceUsage`; `running` and `vcpus` are removed.
|
|
28
|
+
- A problem body under a 200 response throws like a refused response.
|
|
29
|
+
|
|
30
|
+
## [0.39.1] - 2026-11-10
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- Types regenerated from the API: sandbox limits, image upgrade, snapshots, ports, exec wait, sandbox files, plan limits, engine capacity policy, credential scheme hosts, sandbox idle default (15 minutes); proxy endpoints carry `remotes:write`.
|
|
34
|
+
|
|
35
|
+
## [0.39.0] - 2026-11-07
|
|
36
|
+
|
|
37
|
+
**Breaking:** task errors are typed.
|
|
38
|
+
|
|
10
39
|
### Changed
|
|
11
40
|
- `tasks.run()` and `tasks.watch().done` reject with `TaskCancelledError` when the task is cancelled and `TaskFailedError` when it fails, instead of a plain `Error`. Both carry the task as `error.task`. A task cancelled after its app returned a result now ends cancelled with that result as its `output`, so a caller that cancels reads the partial result from `error.task.output`. Messages are unchanged (`task cancelled`, the task's error). `isTaskCancelledError` and `isTaskFailedError` are the type guards.
|
|
12
41
|
|
package/dist/agent/actions.d.ts
CHANGED
|
@@ -6,4 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ActionsContext, ActionsResult } from './types.js';
|
|
8
8
|
export declare function createActions(ctx: ActionsContext): ActionsResult;
|
|
9
|
+
/** Actions and the context they were created with. */
|
|
10
|
+
export interface BoundActions {
|
|
11
|
+
ctx: ActionsContext;
|
|
12
|
+
result: ActionsResult;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The actions for ctx: the bound ones while ctx is the same object, new ones
|
|
16
|
+
* once it is replaced. Actions keep the client of the context they were
|
|
17
|
+
* created with, so reusing them after the client changed would keep calling
|
|
18
|
+
* the API as the old client.
|
|
19
|
+
*/
|
|
20
|
+
export declare function actionsFor(bound: BoundActions | null, ctx: ActionsContext): BoundActions;
|
|
9
21
|
export declare function getClientToolHandlers(config: import('./types.js').AgentOptions | null): Map<string, import('./types.js').ClientToolHandlerFn>;
|
package/dist/agent/actions.js
CHANGED
|
@@ -631,6 +631,17 @@ export function createActions(ctx) {
|
|
|
631
631
|
};
|
|
632
632
|
return { publicActions, internalActions };
|
|
633
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* The actions for ctx: the bound ones while ctx is the same object, new ones
|
|
636
|
+
* once it is replaced. Actions keep the client of the context they were
|
|
637
|
+
* created with, so reusing them after the client changed would keep calling
|
|
638
|
+
* the API as the old client.
|
|
639
|
+
*/
|
|
640
|
+
export function actionsFor(bound, ctx) {
|
|
641
|
+
if (bound && bound.ctx === ctx)
|
|
642
|
+
return bound;
|
|
643
|
+
return { ctx, result: createActions(ctx) };
|
|
644
|
+
}
|
|
634
645
|
// =============================================================================
|
|
635
646
|
// Helper: Extract client tool handlers from config
|
|
636
647
|
// =============================================================================
|
|
@@ -65,7 +65,12 @@ export interface ElicitRequestParams {
|
|
|
65
65
|
}
|
|
66
66
|
/** Parses an invocation's data into MCPInputState, or null when it isn't one. */
|
|
67
67
|
export declare function parseMCPInputState(data: unknown): MCPInputState | null;
|
|
68
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Returns the elicitation params of an input request, or null for other
|
|
70
|
+
* methods and for params that are not an object. The fields are the server's:
|
|
71
|
+
* a message or url that is not a string, and the parts of requestedSchema that
|
|
72
|
+
* do not have the declared shape, are dropped.
|
|
73
|
+
*/
|
|
69
74
|
export declare function elicitParams(request: InputRequest): ElicitRequestParams | null;
|
|
70
75
|
/** URL mode sends the user to a page; form mode asks for fields. Mode defaults to form. */
|
|
71
76
|
export declare function isURLElicitation(params: ElicitRequestParams): boolean;
|
package/dist/agent/mcp-input.js
CHANGED
|
@@ -35,12 +35,89 @@ export function parseMCPInputState(data) {
|
|
|
35
35
|
round: typeof state.round === 'number' ? state.round : 1,
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
function isRecord(value) {
|
|
39
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
40
|
+
}
|
|
41
|
+
function stringArray(value) {
|
|
42
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === 'string') : undefined;
|
|
43
|
+
}
|
|
44
|
+
function choiceArray(value) {
|
|
45
|
+
if (!Array.isArray(value))
|
|
46
|
+
return undefined;
|
|
47
|
+
return value.filter((c) => isRecord(c) && typeof c.const === 'string');
|
|
48
|
+
}
|
|
49
|
+
/** Sets key to value, or removes it when value is undefined. */
|
|
50
|
+
function setOrDrop(target, key, value) {
|
|
51
|
+
if (value === undefined)
|
|
52
|
+
Reflect.deleteProperty(target, key);
|
|
53
|
+
else
|
|
54
|
+
target[key] = value;
|
|
55
|
+
}
|
|
56
|
+
function cleanProperty(raw) {
|
|
57
|
+
const property = { ...raw };
|
|
58
|
+
if ('enum' in property)
|
|
59
|
+
setOrDrop(property, 'enum', stringArray(property.enum));
|
|
60
|
+
if ('enumNames' in property)
|
|
61
|
+
setOrDrop(property, 'enumNames', stringArray(property.enumNames));
|
|
62
|
+
if ('oneOf' in property)
|
|
63
|
+
setOrDrop(property, 'oneOf', choiceArray(property.oneOf));
|
|
64
|
+
if ('items' in property) {
|
|
65
|
+
if (isRecord(property.items)) {
|
|
66
|
+
const items = { ...property.items };
|
|
67
|
+
if ('enum' in items)
|
|
68
|
+
setOrDrop(items, 'enum', stringArray(items.enum));
|
|
69
|
+
if ('anyOf' in items)
|
|
70
|
+
setOrDrop(items, 'anyOf', choiceArray(items.anyOf));
|
|
71
|
+
property.items = items;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
delete property.items;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return property;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The schema comes from the MCP server as it sent it. Whatever does not have
|
|
81
|
+
* the shape ElicitRequestedSchema declares is dropped, so a consumer can
|
|
82
|
+
* iterate properties, required and each property's choices without checking.
|
|
83
|
+
*/
|
|
84
|
+
function cleanRequestedSchema(raw) {
|
|
85
|
+
if (!isRecord(raw))
|
|
86
|
+
return undefined;
|
|
87
|
+
const schema = { ...raw };
|
|
88
|
+
if ('properties' in schema) {
|
|
89
|
+
if (isRecord(schema.properties)) {
|
|
90
|
+
const properties = {};
|
|
91
|
+
for (const [name, property] of Object.entries(schema.properties)) {
|
|
92
|
+
if (isRecord(property))
|
|
93
|
+
properties[name] = cleanProperty(property);
|
|
94
|
+
}
|
|
95
|
+
schema.properties = properties;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
delete schema.properties;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if ('required' in schema)
|
|
102
|
+
setOrDrop(schema, 'required', stringArray(schema.required));
|
|
103
|
+
return schema;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Returns the elicitation params of an input request, or null for other
|
|
107
|
+
* methods and for params that are not an object. The fields are the server's:
|
|
108
|
+
* a message or url that is not a string, and the parts of requestedSchema that
|
|
109
|
+
* do not have the declared shape, are dropped.
|
|
110
|
+
*/
|
|
39
111
|
export function elicitParams(request) {
|
|
40
|
-
if (request.method !== MCPMethodElicitationCreate || !request.params)
|
|
112
|
+
if (request.method !== MCPMethodElicitationCreate || !isRecord(request.params))
|
|
41
113
|
return null;
|
|
42
|
-
const params = request.params;
|
|
43
|
-
|
|
114
|
+
const params = { ...request.params };
|
|
115
|
+
params.message = typeof params.message === 'string' ? params.message : '';
|
|
116
|
+
if ('url' in params && typeof params.url !== 'string')
|
|
117
|
+
delete params.url;
|
|
118
|
+
if ('requestedSchema' in params)
|
|
119
|
+
setOrDrop(params, 'requestedSchema', cleanRequestedSchema(params.requestedSchema));
|
|
120
|
+
return params;
|
|
44
121
|
}
|
|
45
122
|
/** URL mode sends the user to a page; form mode asks for fields. Mode defaults to form. */
|
|
46
123
|
export function isURLElicitation(params) {
|
package/dist/agent/provider.js
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
import { useReducer, useRef, useEffect, useMemo } from 'react';
|
|
9
9
|
import { AgentChatContext } from './context.js';
|
|
10
10
|
import { chatReducer, initialState } from './reducer.js';
|
|
11
|
-
import {
|
|
11
|
+
import { actionsFor, getClientToolHandlers } from './actions.js';
|
|
12
12
|
import { fetchAgentInfo } from './api.js';
|
|
13
13
|
import { isTemplateConfig } from './types.js';
|
|
14
14
|
function mergeHandlers(base, extra) {
|
|
@@ -88,11 +88,12 @@ export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandl
|
|
|
88
88
|
useEffect(() => {
|
|
89
89
|
actionsContext.callbacks = callbacksRef.current;
|
|
90
90
|
}, [actionsContext, onChatCreated, onStatusChange, onError, onTurnEnd]);
|
|
91
|
+
// One set of actions per client: actions call the API with the client they
|
|
92
|
+
// were created with, so a replaced client (another key, another account)
|
|
93
|
+
// gets new ones and the old client is not used again.
|
|
91
94
|
const actionsResultRef = useRef(null);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
const { publicActions, internalActions } = actionsResultRef.current;
|
|
95
|
+
actionsResultRef.current = actionsFor(actionsResultRef.current, actionsContext);
|
|
96
|
+
const { publicActions, internalActions } = actionsResultRef.current.result;
|
|
96
97
|
// Fetch agent info for template configs (example_prompts, description)
|
|
97
98
|
const agentRef = isTemplateConfig(agentConfig) ? agentConfig.agent : null;
|
|
98
99
|
useEffect(() => {
|
|
@@ -111,12 +112,22 @@ export function AgentChatProvider({ client, agentConfig, chatId, clientToolHandl
|
|
|
111
112
|
internalActions.setChatId(chatId);
|
|
112
113
|
}
|
|
113
114
|
}, [chatId, state.chatId, internalActions]);
|
|
114
|
-
// Cleanup on unmount
|
|
115
|
+
// Cleanup on unmount, and when the client is replaced: the stream was
|
|
116
|
+
// opened with the old client's credentials.
|
|
115
117
|
useEffect(() => {
|
|
116
118
|
return () => {
|
|
117
119
|
internalActions.stopStream();
|
|
118
120
|
};
|
|
119
121
|
}, [internalActions]);
|
|
122
|
+
// A replaced client reopens the open chat with its own credentials.
|
|
123
|
+
const streamingActionsRef = useRef(internalActions);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (streamingActionsRef.current === internalActions)
|
|
126
|
+
return;
|
|
127
|
+
streamingActionsRef.current = internalActions;
|
|
128
|
+
if (chatIdRef.current)
|
|
129
|
+
internalActions.streamChat(chatIdRef.current);
|
|
130
|
+
}, [internalActions]);
|
|
120
131
|
const contextValue = useMemo(() => ({
|
|
121
132
|
state,
|
|
122
133
|
actions: publicActions,
|
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.
|