@inferencesh/sdk 0.39.3 → 0.40.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 +43 -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 +59 -32
- package/dist/types.js +13 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.40.0] - 2026-11-14
|
|
11
|
+
|
|
12
|
+
**Breaking:** types regenerated from the API (api-v1551 to api-v1565).
|
|
13
|
+
|
|
14
|
+
### Removed
|
|
15
|
+
- `vault_id` on `CreateSandboxRequest` and on agent versions and agent config: a sandbox's and an agent's inference.sh access is `api_scopes` now (INF-1292). The API refuses `vault_id` on `POST /sandboxes` with a 400.
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- `api_scopes` on `CreateSandboxRequest`, `AgentVersionDTO` and `AgentConfigInput`.
|
|
19
|
+
- `CredentialConfigDTO.own_app_scope` and `CredentialAppRequest.scope` (team OAuth apps).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- Chat strictness levels that are unset are left out of replies instead of sent as `""`: `ChatSettingsDTO.strictness`, `ChatStrictnessDTO.chat` and `.minimum` are optional. A request with `""` gets a 400; clear a chat's level with `DELETE /chats/{id}/strictness`.
|
|
23
|
+
|
|
24
|
+
## [0.39.4] - 2026-11-13
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- `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.
|
|
28
|
+
- `elicitParams` drops malformed MCP elicitation params and schema parts instead of passing them on.
|
|
29
|
+
|
|
30
|
+
## [0.39.3] - 2026-11-12
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
- 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`.
|
|
34
|
+
|
|
35
|
+
## [0.39.2] - 2026-11-10
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- 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).
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
- `sandboxes.limits()` follows the entitlement-built DTO: `limits[]` of `ResourceUsage`; `running` and `vcpus` are removed.
|
|
42
|
+
- A problem body under a 200 response throws like a refused response.
|
|
43
|
+
|
|
44
|
+
## [0.39.1] - 2026-11-10
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- 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`.
|
|
48
|
+
|
|
49
|
+
## [0.39.0] - 2026-11-07
|
|
50
|
+
|
|
51
|
+
**Breaking:** task errors are typed.
|
|
52
|
+
|
|
10
53
|
### Changed
|
|
11
54
|
- `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
55
|
|
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
|
@@ -342,11 +342,11 @@ export interface AgentVersionDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
342
342
|
*/
|
|
343
343
|
content_guard?: ContentGuardConfig;
|
|
344
344
|
/**
|
|
345
|
-
*
|
|
346
|
-
* get the
|
|
347
|
-
*
|
|
345
|
+
* APIScopes is the inference.sh access the sandboxes its
|
|
346
|
+
* sandbox_create makes get, cut to what the run can hand on. Absent:
|
|
347
|
+
* none.
|
|
348
348
|
*/
|
|
349
|
-
|
|
349
|
+
api_scopes?: Scope[];
|
|
350
350
|
/**
|
|
351
351
|
* VisitorReads is the scope groups of the team's resources (knowledge,
|
|
352
352
|
* files, artifacts, remotes) a visitor of an embed of this version can
|
|
@@ -403,10 +403,11 @@ export interface AgentConfigInput {
|
|
|
403
403
|
output_schema?: any;
|
|
404
404
|
content_guard?: ContentGuardConfig;
|
|
405
405
|
/**
|
|
406
|
-
*
|
|
407
|
-
*
|
|
406
|
+
* APIScopes is the inference.sh access the sandboxes it makes get:
|
|
407
|
+
* reads, apps:execute, files:write and apps:write, none the writer
|
|
408
|
+
* does not hold.
|
|
408
409
|
*/
|
|
409
|
-
|
|
410
|
+
api_scopes?: Scope[];
|
|
410
411
|
}
|
|
411
412
|
/**
|
|
412
413
|
* CoreAppConfigInput is the API input shape for core app configuration.
|
|
@@ -1428,8 +1429,9 @@ export interface ScopeDefinition {
|
|
|
1428
1429
|
*/
|
|
1429
1430
|
costs_credits?: boolean;
|
|
1430
1431
|
/**
|
|
1431
|
-
* Sandbox: a
|
|
1432
|
-
*
|
|
1432
|
+
* Sandbox: a sandbox may be granted it (its inference.sh access,
|
|
1433
|
+
* AgentVersionDTO.APIScopes, CreateSandboxRequest.APIScopes); the
|
|
1434
|
+
* allowlist is models.SandboxMayHold.
|
|
1433
1435
|
*/
|
|
1434
1436
|
sandbox?: boolean;
|
|
1435
1437
|
}
|
|
@@ -2468,8 +2470,9 @@ export interface ChatSettingsRequest {
|
|
|
2468
2470
|
*/
|
|
2469
2471
|
forget_memory?: string[];
|
|
2470
2472
|
/**
|
|
2471
|
-
* Strictness
|
|
2472
|
-
* guard flags something it read: watch, ask or strict
|
|
2473
|
+
* Strictness sets what the agent does in this chat after the content
|
|
2474
|
+
* guard flags something it read: watch, ask or strict; anything else,
|
|
2475
|
+
* "" included, is refused. DELETE /chats/{id}/strictness clears the
|
|
2473
2476
|
* chat's own level, so the agent's default applies. A team or org
|
|
2474
2477
|
* minimum still raises it (GET /chats/{id}/strictness).
|
|
2475
2478
|
*/
|
|
@@ -2495,32 +2498,35 @@ export interface ChatSettingsDTO {
|
|
|
2495
2498
|
*/
|
|
2496
2499
|
memory: StringEncodedMap;
|
|
2497
2500
|
/**
|
|
2498
|
-
* Strictness is agent_data.strictness: the chat's own level
|
|
2499
|
-
* it follows the agent's default.
|
|
2501
|
+
* Strictness is agent_data.strictness: the chat's own level; absent
|
|
2502
|
+
* when it follows the agent's default.
|
|
2500
2503
|
*/
|
|
2501
|
-
strictness
|
|
2504
|
+
strictness?: ChatStrictness;
|
|
2502
2505
|
}
|
|
2503
2506
|
/**
|
|
2504
2507
|
* ChatStrictnessDTO is GET /chats/{id}/strictness: what the agent does in
|
|
2505
2508
|
* the chat after the content guard flags something it read, and where that
|
|
2506
2509
|
* comes from. Effective is the strictest of the chat's level (Chat, else
|
|
2507
|
-
* AgentDefault
|
|
2510
|
+
* AgentDefault), Minimum and Delegated. A level that is not set is absent.
|
|
2508
2511
|
*/
|
|
2509
2512
|
export interface ChatStrictnessDTO {
|
|
2510
2513
|
chat_id: string;
|
|
2511
2514
|
/**
|
|
2512
|
-
* Chat is the chat's own level
|
|
2515
|
+
* Chat is the chat's own level (for a sub-agent's chat that sets none,
|
|
2516
|
+
* its nearest ancestor's); absent when it follows the agent.
|
|
2513
2517
|
*/
|
|
2514
|
-
chat
|
|
2518
|
+
chat?: ChatStrictness;
|
|
2515
2519
|
/**
|
|
2516
|
-
* AgentDefault is the agent's content_guard.strictness
|
|
2520
|
+
* AgentDefault is the agent's content_guard.strictness, watch when the
|
|
2521
|
+
* agent sets none.
|
|
2517
2522
|
*/
|
|
2518
2523
|
agent_default: ChatStrictness;
|
|
2519
2524
|
/**
|
|
2520
2525
|
* Minimum is the strictest level the chat's team or org governance
|
|
2521
|
-
* policy sets;
|
|
2526
|
+
* policy sets; absent when neither sets one. Levels below it are
|
|
2527
|
+
* locked.
|
|
2522
2528
|
*/
|
|
2523
|
-
minimum
|
|
2529
|
+
minimum?: ChatStrictness;
|
|
2524
2530
|
/**
|
|
2525
2531
|
* MinimumSetBy is the rung that set Minimum: team or org.
|
|
2526
2532
|
*/
|
|
@@ -2528,7 +2534,7 @@ export interface ChatStrictnessDTO {
|
|
|
2528
2534
|
/**
|
|
2529
2535
|
* Delegated is, for a sub-agent's chat, the level the chat that
|
|
2530
2536
|
* delegated to it runs at: a floor, so a sub-agent never runs looser
|
|
2531
|
-
* than its delegating chat.
|
|
2537
|
+
* than its delegating chat. Absent for a chat no agent delegated.
|
|
2532
2538
|
*/
|
|
2533
2539
|
delegated?: ChatStrictness;
|
|
2534
2540
|
/**
|
|
@@ -2899,8 +2905,9 @@ export interface ContentGuardConfig {
|
|
|
2899
2905
|
ignore_rules?: string[];
|
|
2900
2906
|
/**
|
|
2901
2907
|
* Strictness is what the agent's chats do after the guard flags a
|
|
2902
|
-
* result, unless a chat sets its own: watch
|
|
2903
|
-
* (shared.ChatStrictness).
|
|
2908
|
+
* result, unless a chat sets its own: watch, ask or strict
|
|
2909
|
+
* (shared.ChatStrictness). Left out, it is watch; "" is refused. A
|
|
2910
|
+
* team or org minimum still raises it.
|
|
2904
2911
|
*/
|
|
2905
2912
|
strictness?: ChatStrictness;
|
|
2906
2913
|
}
|
|
@@ -3029,6 +3036,13 @@ export interface CredentialConfigDTO {
|
|
|
3029
3036
|
* login itself.
|
|
3030
3037
|
*/
|
|
3031
3038
|
app?: CredentialDTO;
|
|
3039
|
+
/**
|
|
3040
|
+
* OwnAppScope is where an app this caller saves without naming a scope
|
|
3041
|
+
* lands, when that is not the workspace's own: "platform" for the
|
|
3042
|
+
* platform team, whose usual app serves every workspace. The form then
|
|
3043
|
+
* asks which is meant (CredentialAppRequest.Scope). Empty: the team's.
|
|
3044
|
+
*/
|
|
3045
|
+
own_app_scope?: CredentialScope;
|
|
3032
3046
|
/**
|
|
3033
3047
|
* AppNoun is what that app is called ("GitHub App") when it is not an
|
|
3034
3048
|
* OAuth sign-in app: its logins connect something other than a person
|
|
@@ -3717,7 +3731,7 @@ export interface DecideEntitlementRequestRequest {
|
|
|
3717
3731
|
* and APIError.Code on the legacy envelope. Clients branch on these, so a
|
|
3718
3732
|
* code is a named const here, where it generates into models and the SDKs.
|
|
3719
3733
|
*/
|
|
3720
|
-
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" | "access_restricted" | "web_access_restricted" | "requirements_not_met" | "team_role_required" | "in_other_workspace" | "visibility_not_allowed" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "publish_quarantined" | "person_required" | "otp_required" | "requires_sign_in" | "insufficient_scope" | "invalid_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_origin_required" | "admin_authenticator_required" | "last_authenticator" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "purchase_required" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "notifications_disabled" | "already_claimed" | "already_entitled" | "request_open" | "invalid_code" | "already_processed" | "expired" | "code_confirmation_required" | "app_retired" | "app_maintenance" | "invalid_transition" | "maintenance" | "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";
|
|
3734
|
+
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" | "access_restricted" | "web_access_restricted" | "requirements_not_met" | "team_role_required" | "in_other_workspace" | "visibility_not_allowed" | "blocked_by_usage_policy" | "last_owner" | "account_deactivated" | "account_banned" | "publish_quarantined" | "file_in_use" | "person_required" | "otp_required" | "requires_sign_in" | "insufficient_scope" | "invalid_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_origin_required" | "admin_authenticator_required" | "last_authenticator" | "limit_exceeded" | "feature_not_available" | "entitlement_unavailable" | "purchase_required" | "payment_required" | "payment_method_required" | "form_closed" | "already_submitted" | "notifications_disabled" | "already_claimed" | "already_entitled" | "request_open" | "invalid_code" | "already_processed" | "expired" | "code_confirmation_required" | "app_retired" | "listing_not_live" | "app_maintenance" | "invalid_transition" | "maintenance" | "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";
|
|
3721
3735
|
export declare const ErrorCodeInvalidRequest: ErrorCode;
|
|
3722
3736
|
export declare const ErrorCodeValidationError: ErrorCode;
|
|
3723
3737
|
export declare const ErrorCodeUnauthorized: ErrorCode;
|
|
@@ -3792,6 +3806,12 @@ export declare const ErrorCodeAccountBanned: ErrorCode;
|
|
|
3792
3806
|
* PublishQuarantinedMeta; Until says from when a new account can.
|
|
3793
3807
|
*/
|
|
3794
3808
|
export declare const ErrorCodePublishQuarantined: ErrorCode;
|
|
3809
|
+
/**
|
|
3810
|
+
* ErrorCodeFileInUse (409): the file is used by live content (a skill's
|
|
3811
|
+
* files, an artifact's assets) and was not deleted. Meta is FileInUseMeta:
|
|
3812
|
+
* the content using it. Staff may delete it anyway (?force=true).
|
|
3813
|
+
*/
|
|
3814
|
+
export declare const ErrorCodeFileInUse: ErrorCode;
|
|
3795
3815
|
/**
|
|
3796
3816
|
* ErrorCodePersonRequired (403): only a person may do this, and the
|
|
3797
3817
|
* caller is a workspace's service account (a workspace API key), or the
|
|
@@ -3934,6 +3954,13 @@ export declare const ErrorCodeCodeConfirmationRequired: ErrorCode;
|
|
|
3934
3954
|
* theirs. InvalidTransition (409): the task already moved on.
|
|
3935
3955
|
*/
|
|
3936
3956
|
export declare const ErrorCodeAppRetired: ErrorCode;
|
|
3957
|
+
/**
|
|
3958
|
+
* ListingNotLive (410): the app, agent, skill or knowledge entry is
|
|
3959
|
+
* listed in the store and its listing serves no reviewed version now,
|
|
3960
|
+
* so a caller who does not own it is not served it. One answer whatever
|
|
3961
|
+
* took it down.
|
|
3962
|
+
*/
|
|
3963
|
+
export declare const ErrorCodeListingNotLive: ErrorCode;
|
|
3937
3964
|
export declare const ErrorCodeAppMaintenance: ErrorCode;
|
|
3938
3965
|
export declare const ErrorCodeInvalidTransition: ErrorCode;
|
|
3939
3966
|
/**
|
|
@@ -5756,13 +5783,13 @@ export interface CreateSandboxRequest {
|
|
|
5756
5783
|
*/
|
|
5757
5784
|
from_snapshot_id?: string;
|
|
5758
5785
|
/**
|
|
5759
|
-
*
|
|
5760
|
-
*
|
|
5761
|
-
* on. Empty: the
|
|
5762
|
-
*
|
|
5763
|
-
*
|
|
5786
|
+
* APIScopes is the inference.sh access the box gets beyond running
|
|
5787
|
+
* its remote: reads, apps:execute, files:write and apps:write, cut to
|
|
5788
|
+
* what the caller can hand on. Empty: the remote's alone. A sandbox an
|
|
5789
|
+
* agent's sandbox_create makes takes the agent's
|
|
5790
|
+
* (AgentVersionDTO.APIScopes) instead.
|
|
5764
5791
|
*/
|
|
5765
|
-
|
|
5792
|
+
api_scopes?: Scope[];
|
|
5766
5793
|
}
|
|
5767
5794
|
/**
|
|
5768
5795
|
* UpdateSandboxRequest is PATCH /sandboxes/{id}: the fields to change,
|
|
@@ -5892,8 +5919,8 @@ export interface SandboxDTO extends BaseModelDTO, PermissionModelDTO {
|
|
|
5892
5919
|
last_activity_at?: string;
|
|
5893
5920
|
/**
|
|
5894
5921
|
* APIScopes are what the box may do with our API beyond running its
|
|
5895
|
-
* remote: copied
|
|
5896
|
-
* whole life. Absent or empty: nothing beyond the remote.
|
|
5922
|
+
* remote: copied when it was made (CreateSandboxRequest.APIScopes, or
|
|
5923
|
+
* its agent's), for its whole life. Absent or empty: nothing beyond the remote.
|
|
5897
5924
|
*/
|
|
5898
5925
|
api_scopes?: Scope[];
|
|
5899
5926
|
}
|
package/dist/types.js
CHANGED
|
@@ -662,6 +662,12 @@ export const ErrorCodeAccountBanned = "account_banned";
|
|
|
662
662
|
* PublishQuarantinedMeta; Until says from when a new account can.
|
|
663
663
|
*/
|
|
664
664
|
export const ErrorCodePublishQuarantined = "publish_quarantined";
|
|
665
|
+
/**
|
|
666
|
+
* ErrorCodeFileInUse (409): the file is used by live content (a skill's
|
|
667
|
+
* files, an artifact's assets) and was not deleted. Meta is FileInUseMeta:
|
|
668
|
+
* the content using it. Staff may delete it anyway (?force=true).
|
|
669
|
+
*/
|
|
670
|
+
export const ErrorCodeFileInUse = "file_in_use";
|
|
665
671
|
/**
|
|
666
672
|
* ErrorCodePersonRequired (403): only a person may do this, and the
|
|
667
673
|
* caller is a workspace's service account (a workspace API key), or the
|
|
@@ -804,6 +810,13 @@ export const ErrorCodeCodeConfirmationRequired = "code_confirmation_required";
|
|
|
804
810
|
* theirs. InvalidTransition (409): the task already moved on.
|
|
805
811
|
*/
|
|
806
812
|
export const ErrorCodeAppRetired = "app_retired";
|
|
813
|
+
/**
|
|
814
|
+
* ListingNotLive (410): the app, agent, skill or knowledge entry is
|
|
815
|
+
* listed in the store and its listing serves no reviewed version now,
|
|
816
|
+
* so a caller who does not own it is not served it. One answer whatever
|
|
817
|
+
* took it down.
|
|
818
|
+
*/
|
|
819
|
+
export const ErrorCodeListingNotLive = "listing_not_live";
|
|
807
820
|
export const ErrorCodeAppMaintenance = "app_maintenance";
|
|
808
821
|
export const ErrorCodeInvalidTransition = "invalid_transition";
|
|
809
822
|
/**
|