@capybara-hq/kernel 0.1.0-rc.75 → 0.1.0-rc.77
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/bootstrap.json +5 -5
- package/dist/agents/readiness.controller.d.ts +4 -3
- package/dist/agents/readiness.controller.js +4 -3
- package/dist/agents/readiness.service.d.ts +44 -11
- package/dist/agents/readiness.service.js +59 -16
- package/dist/catalog/catalog-import.module.d.ts +1 -1
- package/dist/catalog/catalog-import.module.js +1 -1
- package/dist/catalog/cli.d.ts +9 -2
- package/dist/catalog/cli.js +10 -4
- package/dist/catalog/marketplaces.service.d.ts +1 -1
- package/dist/catalog/plugin-upgrade.d.ts +4 -2
- package/dist/catalog/plugin-upgrade.js +9 -3
- package/dist/db/kernel-schema.d.ts +5 -0
- package/dist/devices/device-projects.service.d.ts +3 -12
- package/dist/devices/device-projects.service.js +16 -59
- package/dist/extensions/bootstrap.d.ts +34 -3
- package/dist/extensions/bootstrap.js +111 -14
- package/dist/lifecycle/kernel-lifecycle.d.ts +3 -1
- package/dist/lifecycle/kernel-lifecycle.js +16 -11
- package/dist/overrides.d.ts +0 -5
- package/dist/overrides.js +0 -2
- package/dist/platform/file-ref.d.ts +6 -5
- package/dist/platform/ops/agent-skills.ops.js +1 -1
- package/dist/platform/ops/agents.ops.js +1 -1
- package/dist/runtime/model-call.d.ts +2 -2
- package/dist/runtime/project/knowledge.d.ts +1 -1
- package/dist/runtime/project/knowledge.js +1 -1
- package/dist/runtime/project/knowledge.service.d.ts +5 -11
- package/dist/runtime/project/knowledge.service.js +12 -23
- package/dist/runtime/providers.d.ts +34 -1
- package/dist/runtime/providers.js +56 -7
- package/dist/runtime/run-steps.d.ts +4 -6
- package/dist/runtime/run-steps.js +7 -15
- package/dist/runtime/runtime.module.js +1 -1
- package/dist/sandbox/held-operations.d.ts +2 -5
- package/dist/sandbox/held-operations.js +0 -14
- package/dist/sandbox/managed-device-context.d.ts +1 -1
- package/dist/sandbox/managed-device-context.js +1 -1
- package/dist/sandbox/permission-context-types.d.ts +0 -11
- package/dist/sandbox/permission-context-types.js +0 -13
- package/dist/sandbox/providers.d.ts +5 -0
- package/dist/sandbox/providers.js +1 -1
- package/dist/sandbox/sandbox-file-reader.d.ts +7 -12
- package/dist/sandbox/sandbox-file-reader.js +12 -29
- package/dist/sandbox/sandbox.service.d.ts +53 -32
- package/dist/sandbox/sandbox.service.js +217 -141
- package/dist/sandbox/use-context.d.ts +4 -1
- package/dist/skills/invoke.d.ts +13 -35
- package/dist/skills/invoke.js +23 -162
- package/dist/tools/builtins/builtin-tools.d.ts +2 -11
- package/dist/tools/builtins/builtin-tools.js +5 -23
- package/dist/tools/builtins/image/generate.js +2 -2
- package/dist/tools/builtins/sandbox/common.d.ts +32 -80
- package/dist/tools/builtins/sandbox/common.js +61 -173
- package/dist/tools/builtins/sandbox/deliver.js +2 -2
- package/dist/tools/builtins/sandbox/device-owner.d.ts +4 -5
- package/dist/tools/builtins/sandbox/device-owner.js +5 -6
- package/dist/tools/builtins/sandbox/fetch-attachment.js +2 -2
- package/dist/tools/builtins/sandbox/glob.js +1 -1
- package/dist/tools/builtins/sandbox/grep.js +1 -1
- package/dist/tools/builtins/sandbox/index.d.ts +2 -2
- package/dist/tools/builtins/sandbox/index.js +2 -2
- package/dist/tools/builtins/sandbox/read.js +1 -1
- package/dist/tools/builtins/sandbox/task-output.d.ts +3 -3
- package/dist/tools/builtins/sandbox/task-output.js +4 -4
- package/dist/tools/builtins/sandbox/task-stop.js +1 -1
- package/dist/tools/builtins/skill-load.d.ts +10 -9
- package/dist/tools/builtins/skill-load.js +15 -19
- package/dist/tools/connectors.service.d.ts +4 -2
- package/dist/tools/connectors.service.js +15 -3
- package/dist/tools/pipeline.d.ts +0 -2
- package/dist/tools/pipeline.js +7 -14
- package/dist/tools/tools.module.js +1 -1
- package/package.json +2 -2
- package/src/migrations/0179_device_report_limit_text.sql +28 -0
- package/src/migrations/0180_device_instance_abandoned.sql +6 -0
|
@@ -6,11 +6,10 @@ import type { KernelConfig } from "../../../config/schema.js";
|
|
|
6
6
|
import type { ChildAgent } from "../../../conversations/agent-tree.js";
|
|
7
7
|
import type { AttachmentsService } from "../../../conversations/attachments.service.js";
|
|
8
8
|
import type { EventLog } from "../../../conversations/event-log.js";
|
|
9
|
-
import { type ConversationDevices, type DeviceUnusableReason
|
|
9
|
+
import { type ConversationDevices, type DeviceUnusableReason } from "../../../devices/conversation-devices.js";
|
|
10
10
|
import type { KernelConfigService } from "../../../infra/config/kernel-config.service.js";
|
|
11
11
|
import { ATTACHMENTS_ROOT, attachmentsDir, attachmentsRoot } from "../../../sandbox/attachments-path.js";
|
|
12
12
|
import { type ManagedDeviceContextPort } from "../../../sandbox/managed-device-context.js";
|
|
13
|
-
import type { SandboxMode } from "../../../sandbox/modes.js";
|
|
14
13
|
import { PermissionAdmissionUnavailable, type PermissionAvailabilityCause } from "../../../sandbox/permission-availability.js";
|
|
15
14
|
import type { HeldDeviceContextEvidence } from "../../../sandbox/permission-context-types.js";
|
|
16
15
|
import { type HeldProvider, type SandboxService } from "../../../sandbox/sandbox.service.js";
|
|
@@ -20,19 +19,18 @@ import type { ReadFileDeps } from "./read.js";
|
|
|
20
19
|
/** 沙箱工具的依赖(都按调用时取,多副本下无进程内状态)。 */
|
|
21
20
|
export interface SandboxToolDeps {
|
|
22
21
|
/**
|
|
23
|
-
* `pathLease` may be absent (test
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Every device call is a managed operation (`withOperations`). `pathLease` may be absent (test
|
|
23
|
+
* stubs): the kernel's own file writes then take no path lease. `currentInstance` too: a
|
|
24
|
+
* background `Bash` launch records the instance it started in; and `ifRunning`, which
|
|
25
|
+
* `TaskOutput` reads a task through.
|
|
26
26
|
*/
|
|
27
|
-
sandbox: Pick<SandboxService, "
|
|
27
|
+
sandbox: Pick<SandboxService, "withOperations"> & Partial<Pick<SandboxService, "pathLease" | "currentInstance" | "ifRunning">>;
|
|
28
28
|
/**
|
|
29
29
|
* The device a call enters: the root conversation's, checked for its owner every call.
|
|
30
30
|
* `usableNow` (absent in test stubs: the device's provider serves the org) tells a listing
|
|
31
|
-
* whether a conversation's device has its provider on in the org (ruling R8).
|
|
32
|
-
* (absent in test stubs: free mode) gives what decides the working root, read as the review
|
|
33
|
-
* reads it.
|
|
31
|
+
* whether a conversation's device has its provider on in the org (ruling R8).
|
|
34
32
|
*/
|
|
35
|
-
devices: Pick<ConversationDevices, "forTool"> & Partial<Pick<ConversationDevices, "usableNow" | "unusableReason"
|
|
33
|
+
devices: Pick<ConversationDevices, "forTool"> & Partial<Pick<ConversationDevices, "usableNow" | "unusableReason">>;
|
|
36
34
|
/** Background `Bash` tasks; absent in test stubs, where `run_in_background` is refused. */
|
|
37
35
|
background?: Pick<BackgroundTaskStore, "releaseStop" | "get" | "advanceOffset" | "runningOwnedBy" | "finishedOwnedBy"> & Partial<Pick<BackgroundTaskStore, "reserveManaged" | "failManagedPreEffect">>;
|
|
38
36
|
/**
|
|
@@ -56,24 +54,17 @@ export interface SandboxToolDeps {
|
|
|
56
54
|
storage: Pick<StorageService, "kernel" | "deployment" | "available">;
|
|
57
55
|
/**
|
|
58
56
|
* `readDeliveryScope`: `Deliver`'s delivery scope (truthful delivery spec §2). `publishChanged`:
|
|
59
|
-
* `Deliver` announces `changed: files` (UI refresh B).
|
|
60
|
-
* conversation's latest `device_paths` (absent in test stubs, which record none).
|
|
57
|
+
* `Deliver` announces `changed: files` (UI refresh B).
|
|
61
58
|
*/
|
|
62
|
-
eventLog: Pick<EventLog, "append" | "latestFileState" | "readDeliveryScope"> & Partial<Pick<EventLog, "publishChanged" | "
|
|
59
|
+
eventLog: Pick<EventLog, "append" | "latestFileState" | "readDeliveryScope"> & Partial<Pick<EventLog, "publishChanged" | "findByIdem">>;
|
|
63
60
|
config: Pick<KernelConfigService, "get">;
|
|
64
61
|
/** Where a mapped provider failure keeps its raw error (warn); absent in test stubs. */
|
|
65
62
|
log?: Pick<Logger, "warn">;
|
|
66
63
|
/**
|
|
67
|
-
* The managed device context writer (permission context replay spec B3):
|
|
68
|
-
*
|
|
69
|
-
* `device_paths` writer. Absent while dormant (the legacy writer stays on unactivated routes).
|
|
64
|
+
* The managed device context writer (permission context replay spec B3): it records the marked
|
|
65
|
+
* device paths before any preparation or user callback of every device call.
|
|
70
66
|
*/
|
|
71
|
-
managedDeviceContext
|
|
72
|
-
/**
|
|
73
|
-
* The paired activation (`PERMISSION_CONTEXT_ACTIVATION`): the managed route then requires
|
|
74
|
-
* {@link managedDeviceContext} and refuses before entering without it.
|
|
75
|
-
*/
|
|
76
|
-
managedDeviceContextRequired?: boolean;
|
|
67
|
+
managedDeviceContext: ManagedDeviceContextPort;
|
|
77
68
|
/**
|
|
78
69
|
* `Read` beyond the device (vision-read design §1): reads by `file_id`, images shown or read by
|
|
79
70
|
* the vision purpose, their stored copies. Absent in test stubs: `Read` then reads the device
|
|
@@ -82,22 +73,16 @@ export interface SandboxToolDeps {
|
|
|
82
73
|
read?: ReadFileDeps;
|
|
83
74
|
}
|
|
84
75
|
/**
|
|
85
|
-
* The sandbox a callback gets: the instance handle, the provider (every
|
|
86
|
-
*
|
|
87
|
-
*
|
|
76
|
+
* The sandbox a callback gets: the instance handle, the provider (every call a managed operation
|
|
77
|
+
* under the admitted scope) and the call's signal combined with the lease's (pass it to every
|
|
78
|
+
* provider call). The file tools' paths are bounded by each operation's admitted scope (project
|
|
79
|
+
* roots plus directory grants, protected paths excluded), which the device enforces, as for
|
|
80
|
+
* `Bash`, never by the device's tier or its outside-sandbox setting; the kernel checks only a
|
|
81
|
+
* path's shape ({@link checkToolPath}).
|
|
88
82
|
*/
|
|
89
83
|
export interface SandboxSession {
|
|
90
84
|
/** The device the call runs in (path leases are taken on it). */
|
|
91
85
|
deviceId: string;
|
|
92
|
-
/**
|
|
93
|
-
* What bounds the file tools' paths ({@link checkToolPath}), never the device's tier or its
|
|
94
|
-
* outside-sandbox setting (approval-only profiles: the sandbox is the same under every profile):
|
|
95
|
-
* - `scope`: the operation's admitted scope. On the managed route every native request carries
|
|
96
|
-
* it (project roots plus directory grants, protected paths excluded) and the device enforces
|
|
97
|
-
* it, as for `Bash`, so the kernel checks only a path's shape; legacy auto mode too.
|
|
98
|
-
* - `roots`: the instance's fixed roots (the legacy route in sandbox mode only).
|
|
99
|
-
*/
|
|
100
|
-
pathBound: "scope" | "roots";
|
|
101
86
|
h: SandboxHandle;
|
|
102
87
|
/** The instance's roots: every path the call builds or checks is under one of them. */
|
|
103
88
|
roots: SandboxRoots;
|
|
@@ -216,13 +201,11 @@ export declare function checkPathShape(path: string, field?: string): void;
|
|
|
216
201
|
*/
|
|
217
202
|
export declare function checkPath(path: string, roots: SandboxRoots, field?: string): string;
|
|
218
203
|
/**
|
|
219
|
-
* A file tool's path
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
* scope does not cover, protected paths included); bounded by the fixed roots, a path must lie
|
|
223
|
-
* under one of them ({@link checkPath}).
|
|
204
|
+
* A file tool's path, bounded by the operation's admitted scope: any clean absolute path passes
|
|
205
|
+
* here (shape checks only; the review proposes a directory crossing for a path outside the scope,
|
|
206
|
+
* and the device refuses one the scope does not cover, protected paths included).
|
|
224
207
|
*/
|
|
225
|
-
export declare function checkToolPath(path: string,
|
|
208
|
+
export declare function checkToolPath(path: string, field?: string): string;
|
|
226
209
|
/**
|
|
227
210
|
* The shape checks of a file tool's path before the call enters its device: an absolute path gets
|
|
228
211
|
* {@link checkPathShape}; a relative one (resolved against the working root inside,
|
|
@@ -237,7 +220,7 @@ export declare function checkFilePathShape(path: string, field?: string): void;
|
|
|
237
220
|
*/
|
|
238
221
|
export declare function resolveToolPath(path: string, s: Pick<SandboxSession, "workingRoot">): string;
|
|
239
222
|
/** {@link checkToolPath} for a writing tool: the skills directory stays read-only either way. */
|
|
240
|
-
export declare function checkToolWritable(path: string, s: Pick<SandboxSession, "roots" | "
|
|
223
|
+
export declare function checkToolWritable(path: string, s: Pick<SandboxSession, "roots" | "workingRoot">): string;
|
|
241
224
|
/** POSIX shell 单引号转义。 */
|
|
242
225
|
export declare function shellQuote(s: string): string;
|
|
243
226
|
/**
|
|
@@ -311,25 +294,13 @@ export declare const OUTCOME_UNKNOWN_TOOL_TEXT = "The device may or may not have
|
|
|
311
294
|
export { DEVICE_OF_ANOTHER_ACCOUNT_TEXT } from "./device-owner.js";
|
|
312
295
|
export declare function mapSandboxError(e: unknown, log: Pick<Logger, "warn"> | undefined): unknown;
|
|
313
296
|
/**
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
297
|
+
* The device entry of every builtin tool (B-17): runs `fn` in the device of the call's
|
|
298
|
+
* conversation (a sub-agent: its root's) on the managed operation route
|
|
299
|
+
* ({@link inSandboxOperations}): the device resolved and checked for the conversation's owner
|
|
300
|
+
* (binding an unbound conversation to the owner's default first), the marked device paths
|
|
301
|
+
* recorded before the callback, every provider call a managed operation. It never touches
|
|
318
302
|
* attachments: `FetchAttachment` is the only way one enters the device. Returns the value and the
|
|
319
|
-
* notices to put before the result (first use, a new instance).
|
|
320
|
-
* instance and calls `fn` again, the notices are the last call's. The instance's roots are recorded
|
|
321
|
-
* for the model on the conversation's first call and whenever they change
|
|
322
|
-
* ({@link recordDevicePaths}).
|
|
323
|
-
*/
|
|
324
|
-
export declare function inSandbox<T>(deps: SandboxToolDeps, ctx: BuiltinCallContext, fn: (s: SandboxSession) => Promise<T>): Promise<{
|
|
325
|
-
value: T;
|
|
326
|
-
notices: string[];
|
|
327
|
-
}>;
|
|
328
|
-
/**
|
|
329
|
-
* The device entry of every builtin tool (B-17): once the one activation gate is on (the managed
|
|
330
|
-
* writer required, {@link SandboxToolDeps.managedDeviceContextRequired}) the managed operation
|
|
331
|
-
* route ({@link inSandboxOperations}: the marked device paths recorded before the callback, every
|
|
332
|
-
* provider call a managed operation); otherwise the legacy route ({@link inSandbox}), unchanged.
|
|
303
|
+
* notices to put before the result (first use, a new instance).
|
|
333
304
|
*/
|
|
334
305
|
export declare function inToolSandbox<T>(deps: SandboxToolDeps, ctx: BuiltinCallContext, fn: (s: SandboxSession) => Promise<T>): Promise<{
|
|
335
306
|
value: T;
|
|
@@ -344,19 +315,13 @@ export declare function inSandboxOperations<T>(deps: SandboxToolDeps, ctx: Built
|
|
|
344
315
|
notices: string[];
|
|
345
316
|
}>;
|
|
346
317
|
/**
|
|
347
|
-
* Trusted copy callbacks only receive preparation's three methods
|
|
348
|
-
* the
|
|
349
|
-
* scoped to `roots`, after the marked device paths); otherwise the protocol-2 binding.
|
|
318
|
+
* Trusted copy callbacks only receive preparation's three methods: the copy is a trusted
|
|
319
|
+
* preparation on the managed route, scoped to `roots`, after the marked device paths.
|
|
350
320
|
*/
|
|
351
321
|
export declare function inSandboxPreparation<T>(deps: SandboxToolDeps, ctx: BuiltinCallContext, purpose: SandboxPreparationScope["purpose"], roots: (roots: SandboxRoots) => readonly string[], fn: (s: PreparationSession) => Promise<T>): Promise<{
|
|
352
322
|
value: T;
|
|
353
323
|
notices: string[];
|
|
354
324
|
}>;
|
|
355
|
-
/** The trusted-copy entry on the managed route ({@link inSandboxPreparation} once activated). */
|
|
356
|
-
export declare function inSandboxOperationPreparation<T>(deps: SandboxToolDeps, ctx: BuiltinCallContext, purpose: SandboxPreparationScope["purpose"], roots: (roots: SandboxRoots) => readonly string[], fn: (s: PreparationSession) => Promise<T>): Promise<{
|
|
357
|
-
value: T;
|
|
358
|
-
notices: string[];
|
|
359
|
-
}>;
|
|
360
325
|
/**
|
|
361
326
|
* Records the managed device paths of the held instance `held` into the calling conversation (a
|
|
362
327
|
* sub-agent: its own log) for this call's run and actor: a thin delegator to the managed writer,
|
|
@@ -365,19 +330,6 @@ export declare function inSandboxOperationPreparation<T>(deps: SandboxToolDeps,
|
|
|
365
330
|
export declare function recordManagedDevicePaths(deps: {
|
|
366
331
|
managedDeviceContext: ManagedDeviceContextPort;
|
|
367
332
|
}, ctx: BuiltinCallContext, held: Readonly<HeldDeviceContextEvidence>, signal: AbortSignal): Promise<void>;
|
|
368
|
-
/**
|
|
369
|
-
* The working root of a call: the project root exactly as the review decides it (from the same
|
|
370
|
-
* {@link WorkingFacts}); when that falls back to the device's workspace, the held instance's own
|
|
371
|
-
* workspace (`workspace`), where the call really runs. Every session built outside `inSandbox` (a
|
|
372
|
-
* person's project skill invocation) takes its working root from here too.
|
|
373
|
-
*/
|
|
374
|
-
export declare function sessionWorkingRoot(working: WorkingFacts | null, workspace: string): string;
|
|
375
|
-
/**
|
|
376
|
-
* What bounds a session's file-tool paths ({@link SandboxSession.pathBound}): the admitted scope
|
|
377
|
-
* on the managed operation route, under every tier; on the legacy route, the fixed roots unless
|
|
378
|
-
* the device runs in auto mode.
|
|
379
|
-
*/
|
|
380
|
-
export declare const sessionPathBound: (operations: boolean, mode: SandboxMode) => SandboxSession["pathBound"];
|
|
381
333
|
/** The conversation whose device a call uses (the root conversation's for a sub-agent). */
|
|
382
334
|
export declare const sandboxConversationOf: (ctx: BuiltinCallContext) => string;
|
|
383
335
|
/**
|
|
@@ -3,7 +3,6 @@ import { DeviceProtocolError } from "@capybara-hq/plugin-sdk/device-protocol";
|
|
|
3
3
|
import { ANONYMOUS_NO_DEVICE, NO_DEVICE, } from "../../../devices/conversation-devices.js";
|
|
4
4
|
import { canonicalRoot, workingRootOf } from "../../../devices/working-root.js";
|
|
5
5
|
import { ApiError } from "../../../errors.js";
|
|
6
|
-
import { devicePathsChange } from "../../../runtime/context/device-paths.js";
|
|
7
6
|
import { ATTACHMENTS_ROOT, attachmentsDir, attachmentsRoot, } from "../../../sandbox/attachments-path.js";
|
|
8
7
|
import { SandboxPathBusyError } from "../../../sandbox/leases.js";
|
|
9
8
|
import { MANAGED_DEVICE_CONTEXT_FAILED_TEXT, MANAGED_DEVICE_CONTEXT_STALE_TEXT, MANAGED_DEVICE_CONTEXT_UNAVAILABLE_TEXT, ManagedDeviceContextFailed, ManagedDeviceContextStale, ManagedDeviceContextUnavailable, } from "../../../sandbox/managed-device-context.js";
|
|
@@ -153,15 +152,11 @@ export function checkPath(path, roots, field = "path") {
|
|
|
153
152
|
return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
154
153
|
}
|
|
155
154
|
/**
|
|
156
|
-
* A file tool's path
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* scope does not cover, protected paths included); bounded by the fixed roots, a path must lie
|
|
160
|
-
* under one of them ({@link checkPath}).
|
|
155
|
+
* A file tool's path, bounded by the operation's admitted scope: any clean absolute path passes
|
|
156
|
+
* here (shape checks only; the review proposes a directory crossing for a path outside the scope,
|
|
157
|
+
* and the device refuses one the scope does not cover, protected paths included).
|
|
161
158
|
*/
|
|
162
|
-
export function checkToolPath(path,
|
|
163
|
-
if (s.pathBound === "roots")
|
|
164
|
-
return checkPath(path, s.roots, field);
|
|
159
|
+
export function checkToolPath(path, field = "path") {
|
|
165
160
|
checkPathShape(path, field);
|
|
166
161
|
return path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
167
162
|
}
|
|
@@ -200,12 +195,9 @@ export function resolveToolPath(path, s) {
|
|
|
200
195
|
}
|
|
201
196
|
/** {@link checkToolPath} for a writing tool: the skills directory stays read-only either way. */
|
|
202
197
|
export function checkToolWritable(path, s) {
|
|
203
|
-
const p = checkToolPath(resolveToolPath(path, s),
|
|
198
|
+
const p = checkToolPath(resolveToolPath(path, s), "file_path");
|
|
204
199
|
if (p === s.roots.skills || p.startsWith(`${s.roots.skills}/`)) {
|
|
205
|
-
|
|
206
|
-
? "pass another path instead"
|
|
207
|
-
: `pass a path under ${s.roots.workspace} or ${s.roots.tmp} instead`;
|
|
208
|
-
throw new ToolError(`Path ${clip(p, 200)} is read-only (${s.roots.skills} holds skill files); ${where}.`);
|
|
200
|
+
throw new ToolError(`Path ${clip(p, 200)} is read-only (${s.roots.skills} holds skill files); pass another path instead.`);
|
|
209
201
|
}
|
|
210
202
|
return p;
|
|
211
203
|
}
|
|
@@ -268,19 +260,6 @@ export function assignAttachmentNames(items, used) {
|
|
|
268
260
|
}
|
|
269
261
|
return out;
|
|
270
262
|
}
|
|
271
|
-
/** Temporary protocol-2 binding; removed with the active caller cutover in Task8. */
|
|
272
|
-
function legacyPreparationSession(s) {
|
|
273
|
-
return {
|
|
274
|
-
deviceId: s.deviceId,
|
|
275
|
-
roots: s.roots,
|
|
276
|
-
signal: s.signal,
|
|
277
|
-
p: {
|
|
278
|
-
readFile: (path, opts) => s.p.readFile(s.h, path, opts),
|
|
279
|
-
writeFile: (path, data, signal) => s.p.writeFile(s.h, path, data, signal),
|
|
280
|
-
stat: (path, signal) => s.p.stat(s.h, path, signal),
|
|
281
|
-
},
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
263
|
/**
|
|
285
264
|
* Running outside the sandbox refused by policy (B-13): the organization
|
|
286
265
|
* (`org.outside_sandbox_not_allowed`) or the platform (`deployment.*`) has its outside-sandbox
|
|
@@ -473,7 +452,7 @@ export function mapSandboxError(e, log) {
|
|
|
473
452
|
if (e.code === "sandbox.create_failed")
|
|
474
453
|
return new ToolError(SANDBOX_CREATE_FAILED_TEXT);
|
|
475
454
|
}
|
|
476
|
-
// an operation outside
|
|
455
|
+
// an operation outside the sandbox service's own mapping (it records lost files itself)
|
|
477
456
|
if (isFileSystemGoneError(e))
|
|
478
457
|
return new ToolError(ENV_FILES_LOST_TEXT);
|
|
479
458
|
if (e instanceof DeviceProtocolError)
|
|
@@ -485,45 +464,25 @@ export function mapSandboxError(e, log) {
|
|
|
485
464
|
return e;
|
|
486
465
|
}
|
|
487
466
|
/**
|
|
488
|
-
*
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
467
|
+
* The device entry of every builtin tool (B-17): runs `fn` in the device of the call's
|
|
468
|
+
* conversation (a sub-agent: its root's) on the managed operation route
|
|
469
|
+
* ({@link inSandboxOperations}): the device resolved and checked for the conversation's owner
|
|
470
|
+
* (binding an unbound conversation to the owner's default first), the marked device paths
|
|
471
|
+
* recorded before the callback, every provider call a managed operation. It never touches
|
|
492
472
|
* attachments: `FetchAttachment` is the only way one enters the device. Returns the value and the
|
|
493
|
-
* notices to put before the result (first use, a new instance).
|
|
494
|
-
* instance and calls `fn` again, the notices are the last call's. The instance's roots are recorded
|
|
495
|
-
* for the model on the conversation's first call and whenever they change
|
|
496
|
-
* ({@link recordDevicePaths}).
|
|
497
|
-
*/
|
|
498
|
-
export async function inSandbox(deps, ctx, fn) {
|
|
499
|
-
return inSandboxWith(deps, ctx, fn, false);
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* The device entry of every builtin tool (B-17): once the one activation gate is on (the managed
|
|
503
|
-
* writer required, {@link SandboxToolDeps.managedDeviceContextRequired}) the managed operation
|
|
504
|
-
* route ({@link inSandboxOperations}: the marked device paths recorded before the callback, every
|
|
505
|
-
* provider call a managed operation); otherwise the legacy route ({@link inSandbox}), unchanged.
|
|
473
|
+
* notices to put before the result (first use, a new instance).
|
|
506
474
|
*/
|
|
507
475
|
export async function inToolSandbox(deps, ctx, fn) {
|
|
508
|
-
return deps
|
|
509
|
-
? inSandboxOperations(deps, ctx, fn)
|
|
510
|
-
: inSandbox(deps, ctx, fn);
|
|
476
|
+
return inSandboxOperations(deps, ctx, fn);
|
|
511
477
|
}
|
|
512
478
|
export async function inSandboxOperations(deps, ctx, fn, stage) {
|
|
513
|
-
return inSandboxWith(deps, ctx, fn,
|
|
479
|
+
return inSandboxWith(deps, ctx, fn, stage);
|
|
514
480
|
}
|
|
515
481
|
/**
|
|
516
|
-
* Trusted copy callbacks only receive preparation's three methods
|
|
517
|
-
* the
|
|
518
|
-
* scoped to `roots`, after the marked device paths); otherwise the protocol-2 binding.
|
|
482
|
+
* Trusted copy callbacks only receive preparation's three methods: the copy is a trusted
|
|
483
|
+
* preparation on the managed route, scoped to `roots`, after the marked device paths.
|
|
519
484
|
*/
|
|
520
485
|
export async function inSandboxPreparation(deps, ctx, purpose, roots, fn) {
|
|
521
|
-
if (deps.managedDeviceContextRequired)
|
|
522
|
-
return inSandboxOperationPreparation(deps, ctx, purpose, roots, fn);
|
|
523
|
-
return inSandbox(deps, ctx, (s) => fn(legacyPreparationSession(s)));
|
|
524
|
-
}
|
|
525
|
-
/** The trusted-copy entry on the managed route ({@link inSandboxPreparation} once activated). */
|
|
526
|
-
export async function inSandboxOperationPreparation(deps, ctx, purpose, roots, fn) {
|
|
527
486
|
let value;
|
|
528
487
|
return inSandboxOperations(deps, ctx, async () => value, {
|
|
529
488
|
purpose,
|
|
@@ -533,68 +492,18 @@ export async function inSandboxOperationPreparation(deps, ctx, purpose, roots, f
|
|
|
533
492
|
},
|
|
534
493
|
});
|
|
535
494
|
}
|
|
536
|
-
async function inSandboxWith(deps, ctx, fn,
|
|
537
|
-
// a run another account triggered never uses the owner's device
|
|
538
|
-
assertDeviceOfRunAccount(
|
|
495
|
+
async function inSandboxWith(deps, ctx, fn, stage) {
|
|
496
|
+
// a run another account triggered never uses the owner's device: refused first
|
|
497
|
+
assertDeviceOfRunAccount(ctx);
|
|
539
498
|
try {
|
|
540
|
-
|
|
541
|
-
// permission context never sits next to old-mode device_paths; a managed route never runs
|
|
542
|
-
// without its writer, so no preparation or user callback can run unrecorded
|
|
543
|
-
if (!operations && deps.managedDeviceContextRequired)
|
|
544
|
-
throw new ManagedDeviceContextFailed("refused");
|
|
545
|
-
const managed = operations ? managedWriter(deps) : undefined;
|
|
499
|
+
const managed = deps.managedDeviceContext;
|
|
546
500
|
const deviceId = await deps.devices.forTool(ctx.orgId, sandboxConversationOf(ctx));
|
|
547
|
-
// the
|
|
548
|
-
// the working facts (workspace, home, project snapshot) are read as the review reads them
|
|
549
|
-
// a call the review covered runs in the working root it was reviewed against: never read again
|
|
501
|
+
// a call the review covered runs in the working root it was reviewed against
|
|
550
502
|
const reviewed = ctx.reviewedWorkingRoot;
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
: (deps.devices.workingFacts?.(ctx.orgId, sandboxConversationOf(ctx), ctx.conversationId, deviceId) ?? null),
|
|
556
|
-
]);
|
|
557
|
-
const enter = operations
|
|
558
|
-
? (use, call, signal) => {
|
|
559
|
-
const claim = ctx.executionClaim;
|
|
560
|
-
if (!claim || !ctx.runId || claim.runId !== ctx.runId || !deps.sandbox.withOperations)
|
|
561
|
-
throw new SandboxScopeDeniedError("The tool has no current server execution claim");
|
|
562
|
-
return deps.sandbox.withOperations(use, {
|
|
563
|
-
claim,
|
|
564
|
-
callId: ctx.callId,
|
|
565
|
-
deadlineMs: Math.min(ctx.runDeadline ?? Infinity, Date.now() + 30000),
|
|
566
|
-
...(managed && { contextEvidence: true }),
|
|
567
|
-
beforeUser: async (staging, info, sig) => {
|
|
568
|
-
// the held instance's device paths, recorded before any preparation or user callback
|
|
569
|
-
if (managed) {
|
|
570
|
-
// no installed evidence to describe the held instance: unavailable, not stale
|
|
571
|
-
// (a device or machine that is gone for good says so instead)
|
|
572
|
-
if (!info.contextEvidence)
|
|
573
|
-
throw ((ctx.runId !== undefined &&
|
|
574
|
-
(await managed.goneFor?.({
|
|
575
|
-
orgId: ctx.orgId,
|
|
576
|
-
conversationId: ctx.conversationId,
|
|
577
|
-
runId: ctx.runId,
|
|
578
|
-
accountId: ctx.accountId,
|
|
579
|
-
}, deviceId))) ||
|
|
580
|
-
new ManagedDeviceContextUnavailable());
|
|
581
|
-
// B-18: the review judged the call against a root (the workspace included);
|
|
582
|
-
// held evidence of another root is stale, refused before anything is recorded
|
|
583
|
-
// or run
|
|
584
|
-
const against = ctx.reviewedAgainstRoot ?? reviewed;
|
|
585
|
-
if (against !== undefined &&
|
|
586
|
-
canonicalRoot(against) !== canonicalRoot(info.contextEvidence.workingRoot))
|
|
587
|
-
throw new ManagedDeviceContextStale();
|
|
588
|
-
await recordManagedDevicePaths({ managedDeviceContext: managed }, ctx, info.contextEvidence, sig);
|
|
589
|
-
}
|
|
590
|
-
if (stage)
|
|
591
|
-
await staging.prepare(stage.purpose, stage.roots(info.roots), (p, signal) => stage.run({ deviceId, roots: info.roots, p, signal }));
|
|
592
|
-
sig.throwIfAborted();
|
|
593
|
-
},
|
|
594
|
-
}, call, signal);
|
|
595
|
-
}
|
|
596
|
-
: deps.sandbox.withSandbox.bind(deps.sandbox);
|
|
597
|
-
return await enter({
|
|
503
|
+
const claim = ctx.executionClaim;
|
|
504
|
+
if (!claim || !ctx.runId || claim.runId !== ctx.runId)
|
|
505
|
+
throw new SandboxScopeDeniedError("The tool has no current server execution claim");
|
|
506
|
+
return await deps.sandbox.withOperations({
|
|
598
507
|
orgId: ctx.orgId,
|
|
599
508
|
deviceId,
|
|
600
509
|
// a sub-agent is told when another holder rebuilt the shared instance (final review m5)
|
|
@@ -605,27 +514,51 @@ async function inSandboxWith(deps, ctx, fn, operations, stage) {
|
|
|
605
514
|
conversationId: ctx.conversationId,
|
|
606
515
|
...(ctx.runId !== undefined && { runId: ctx.runId }),
|
|
607
516
|
},
|
|
517
|
+
}, {
|
|
518
|
+
claim,
|
|
519
|
+
callId: ctx.callId,
|
|
520
|
+
deadlineMs: Math.min(ctx.runDeadline ?? Infinity, Date.now() + 30000),
|
|
521
|
+
contextEvidence: true,
|
|
522
|
+
beforeUser: async (staging, info, sig) => {
|
|
523
|
+
// the held instance's device paths, recorded before any preparation or user callback
|
|
524
|
+
// no installed evidence to describe the held instance: unavailable, not stale
|
|
525
|
+
// (a device or machine that is gone for good says so instead)
|
|
526
|
+
if (!info.contextEvidence)
|
|
527
|
+
throw ((ctx.runId !== undefined &&
|
|
528
|
+
(await managed.goneFor?.({
|
|
529
|
+
orgId: ctx.orgId,
|
|
530
|
+
conversationId: ctx.conversationId,
|
|
531
|
+
runId: ctx.runId,
|
|
532
|
+
accountId: ctx.accountId,
|
|
533
|
+
}, deviceId))) ||
|
|
534
|
+
new ManagedDeviceContextUnavailable());
|
|
535
|
+
// B-18: the review judged the call against a root (the workspace included);
|
|
536
|
+
// held evidence of another root is stale, refused before anything is recorded
|
|
537
|
+
// or run
|
|
538
|
+
const against = ctx.reviewedAgainstRoot ?? reviewed;
|
|
539
|
+
if (against !== undefined &&
|
|
540
|
+
canonicalRoot(against) !== canonicalRoot(info.contextEvidence.workingRoot))
|
|
541
|
+
throw new ManagedDeviceContextStale();
|
|
542
|
+
await recordManagedDevicePaths({ managedDeviceContext: managed }, ctx, info.contextEvidence, sig);
|
|
543
|
+
if (stage)
|
|
544
|
+
await staging.prepare(stage.purpose, stage.roots(info.roots), (p, signal) => stage.run({ deviceId, roots: info.roots, p, signal }));
|
|
545
|
+
sig.throwIfAborted();
|
|
546
|
+
},
|
|
608
547
|
}, async (h, p, info, signal) => {
|
|
609
|
-
//
|
|
610
|
-
const
|
|
548
|
+
// the held evidence the callback was admitted with (beforeUser refuses without it)
|
|
549
|
+
const evidence = info.contextEvidence;
|
|
550
|
+
if (!evidence)
|
|
551
|
+
throw new ManagedDeviceContextUnavailable();
|
|
611
552
|
const s = {
|
|
612
553
|
deviceId,
|
|
613
|
-
// the managed route: the admitted scope of each operation bounds the paths, whatever
|
|
614
|
-
// the device's tier (its outside-sandbox setting decides only escalations)
|
|
615
|
-
pathBound: sessionPathBound(operations, mode),
|
|
616
554
|
h,
|
|
617
555
|
roots: info.roots,
|
|
618
556
|
// a managed call runs in the working root its device context recorded (admission's),
|
|
619
557
|
// which a reviewed call's root equals (checked before the callback, B-18)
|
|
620
|
-
workingRoot:
|
|
621
|
-
reviewed ??
|
|
622
|
-
sessionWorkingRoot(working, info.roots.workspace),
|
|
558
|
+
workingRoot: evidence.workingRoot,
|
|
623
559
|
p,
|
|
624
560
|
signal,
|
|
625
561
|
};
|
|
626
|
-
// the legacy writer only on unactivated routes: a managed call recorded before preparation
|
|
627
|
-
if (!managed)
|
|
628
|
-
await recordDevicePaths(deps, ctx, info.roots, level ?? null);
|
|
629
562
|
const notices = [];
|
|
630
563
|
if (info.filesReset)
|
|
631
564
|
notices.push(sandboxFilesResetNotice(info.roots));
|
|
@@ -640,17 +573,6 @@ async function inSandboxWith(deps, ctx, fn, operations, stage) {
|
|
|
640
573
|
throw mapSandboxError(e, deps.log);
|
|
641
574
|
}
|
|
642
575
|
}
|
|
643
|
-
/**
|
|
644
|
-
* The managed writer of an operations route: the injected one, or none while dormant. Once the
|
|
645
|
-
* paired activation requires it, a missing writer refuses the call before anything is entered.
|
|
646
|
-
*/
|
|
647
|
-
function managedWriter(deps) {
|
|
648
|
-
if (deps.managedDeviceContext)
|
|
649
|
-
return deps.managedDeviceContext;
|
|
650
|
-
if (deps.managedDeviceContextRequired)
|
|
651
|
-
throw new ManagedDeviceContextFailed("refused");
|
|
652
|
-
return undefined;
|
|
653
|
-
}
|
|
654
576
|
/**
|
|
655
577
|
* Records the managed device paths of the held instance `held` into the calling conversation (a
|
|
656
578
|
* sub-agent: its own log) for this call's run and actor: a thin delegator to the managed writer,
|
|
@@ -666,40 +588,6 @@ export async function recordManagedDevicePaths(deps, ctx, held, signal) {
|
|
|
666
588
|
accountId: ctx.accountId,
|
|
667
589
|
}, held, signal);
|
|
668
590
|
}
|
|
669
|
-
/**
|
|
670
|
-
* Environments spec §13.1, ruling R22; auto mode spec §4.2: the calling conversation's log (the
|
|
671
|
-
* log its model reads; a sub-agent's own too) gets a `device_paths` event on its first sandbox
|
|
672
|
-
* call, the default roots included, and again whenever the held instance's roots or the device's
|
|
673
|
-
* mode and network differ from the latest recorded ones; always before the call's result. Two
|
|
674
|
-
* indexed reads per call (migration 0094, the device's row); parallel calls that saw the same
|
|
675
|
-
* latest event write one event (its idempotency key).
|
|
676
|
-
*/
|
|
677
|
-
async function recordDevicePaths(deps, ctx, roots, level) {
|
|
678
|
-
if (!deps.eventLog.latestOfType)
|
|
679
|
-
return;
|
|
680
|
-
const latest = await deps.eventLog.latestOfType(ctx.conversationId, "device_paths");
|
|
681
|
-
const change = devicePathsChange(latest, roots, ctx.runId, level ?? undefined);
|
|
682
|
-
if (change)
|
|
683
|
-
await deps.eventLog.append(ctx.conversationId, [change]);
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* The working root of a call: the project root exactly as the review decides it (from the same
|
|
687
|
-
* {@link WorkingFacts}); when that falls back to the device's workspace, the held instance's own
|
|
688
|
-
* workspace (`workspace`), where the call really runs. Every session built outside `inSandbox` (a
|
|
689
|
-
* person's project skill invocation) takes its working root from here too.
|
|
690
|
-
*/
|
|
691
|
-
export function sessionWorkingRoot(working, workspace) {
|
|
692
|
-
if (working === null)
|
|
693
|
-
return workspace;
|
|
694
|
-
const root = workingRootOf(working.project, working);
|
|
695
|
-
return root === working.workspace ? workspace : root;
|
|
696
|
-
}
|
|
697
|
-
/**
|
|
698
|
-
* What bounds a session's file-tool paths ({@link SandboxSession.pathBound}): the admitted scope
|
|
699
|
-
* on the managed operation route, under every tier; on the legacy route, the fixed roots unless
|
|
700
|
-
* the device runs in auto mode.
|
|
701
|
-
*/
|
|
702
|
-
export const sessionPathBound = (operations, mode) => (operations || mode === "auto" ? "scope" : "roots");
|
|
703
591
|
/** The conversation whose device a call uses (the root conversation's for a sub-agent). */
|
|
704
592
|
export const sandboxConversationOf = (ctx) => ctx.sandboxConversationId ?? ctx.conversationId;
|
|
705
593
|
/**
|
|
@@ -112,8 +112,8 @@ export function sandboxDeliverTool(deps) {
|
|
|
112
112
|
const { value: data, notices } = await inToolSandbox(deps, ctx, async (s) => {
|
|
113
113
|
const { h, p, signal } = s;
|
|
114
114
|
// bounded as the other file tools are: the admitted scope (a project file outside the
|
|
115
|
-
// workspace too)
|
|
116
|
-
path = checkToolPath(input.file_path,
|
|
115
|
+
// workspace too)
|
|
116
|
+
path = checkToolPath(input.file_path, "file_path");
|
|
117
117
|
const st = await p.stat(h, path, signal);
|
|
118
118
|
if (st === null)
|
|
119
119
|
throw new ToolError(notFound(path));
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
export declare const DEVICE_OF_ANOTHER_ACCOUNT_TEXT = "This conversation's device belongs to its owner, and this run was started by another member, so nothing ran on the device. Continue without the device, or ask the conversation's owner to run this.";
|
|
3
3
|
/**
|
|
4
4
|
* The one run-account guard of every device entry (the sandbox tools' `inSandboxWith`, the task
|
|
5
|
-
* tools, a background launch before its reservation is written):
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* changes (the earlier behaviour).
|
|
5
|
+
* tools, a background launch before its reservation is written): a run whose account is not the
|
|
6
|
+
* conversation's owner (a wake attributed to another member) never uses the owner's device,
|
|
7
|
+
* refused before any device or database effect.
|
|
9
8
|
*/
|
|
10
|
-
export declare function assertDeviceOfRunAccount(
|
|
9
|
+
export declare function assertDeviceOfRunAccount(ctx: {
|
|
11
10
|
accountId: string;
|
|
12
11
|
ownerAccountId?: string | undefined;
|
|
13
12
|
}): void;
|
|
@@ -3,12 +3,11 @@ import { ToolError } from "@capybara-hq/plugin-sdk";
|
|
|
3
3
|
export const DEVICE_OF_ANOTHER_ACCOUNT_TEXT = "This conversation's device belongs to its owner, and this run was started by another member, so nothing ran on the device. Continue without the device, or ask the conversation's owner to run this.";
|
|
4
4
|
/**
|
|
5
5
|
* The one run-account guard of every device entry (the sandbox tools' `inSandboxWith`, the task
|
|
6
|
-
* tools, a background launch before its reservation is written):
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* changes (the earlier behaviour).
|
|
6
|
+
* tools, a background launch before its reservation is written): a run whose account is not the
|
|
7
|
+
* conversation's owner (a wake attributed to another member) never uses the owner's device,
|
|
8
|
+
* refused before any device or database effect.
|
|
10
9
|
*/
|
|
11
|
-
export function assertDeviceOfRunAccount(
|
|
12
|
-
if (
|
|
10
|
+
export function assertDeviceOfRunAccount(ctx) {
|
|
11
|
+
if (ctx.ownerAccountId !== undefined && ctx.ownerAccountId !== ctx.accountId)
|
|
13
12
|
throw new ToolError(DEVICE_OF_ANOTHER_ACCOUNT_TEXT);
|
|
14
13
|
}
|
|
@@ -98,8 +98,8 @@ export function sandboxFetchAttachmentTool(deps) {
|
|
|
98
98
|
}
|
|
99
99
|
catch (e) {
|
|
100
100
|
// an abort (timeout / lost lock / stopped run) and a gone device or instance go to
|
|
101
|
-
//
|
|
102
|
-
// internal address)
|
|
101
|
+
// the sandbox service and mapSandboxError; never the provider's own words (they may
|
|
102
|
+
// name its internal address)
|
|
103
103
|
if (signal.aborted || isSandboxGoneError(e) || isFileSystemGoneError(e))
|
|
104
104
|
throw e;
|
|
105
105
|
// a managed route's typed refusal too: mapSandboxError gives its fixed text
|
|
@@ -65,7 +65,7 @@ export function sandboxGlobTool(deps) {
|
|
|
65
65
|
const { value: files, notices } = await inToolSandbox(deps, ctx, async (s) => {
|
|
66
66
|
const { h, p, signal } = s;
|
|
67
67
|
// default: the working root (a bound project's root, else the workspace)
|
|
68
|
-
dir = checkToolPath(input.path ?? s.workingRoot
|
|
68
|
+
dir = checkToolPath(input.path ?? s.workingRoot);
|
|
69
69
|
const st = await p.stat(h, dir, signal);
|
|
70
70
|
if (!st?.isDir)
|
|
71
71
|
throw new ToolError(notDirectory(dir, s.workingRoot));
|
|
@@ -166,7 +166,7 @@ export function sandboxGrepTool(deps) {
|
|
|
166
166
|
const { value, notices } = await inToolSandbox(deps, ctx, async (s) => {
|
|
167
167
|
const { h, p, signal } = s;
|
|
168
168
|
// default: the working root (a bound project's root, else the workspace)
|
|
169
|
-
path = checkToolPath(g.path ?? s.workingRoot
|
|
169
|
+
path = checkToolPath(g.path ?? s.workingRoot);
|
|
170
170
|
const st = await p.stat(h, path, signal);
|
|
171
171
|
if (st === null)
|
|
172
172
|
throw new ToolError(notFound(path));
|
|
@@ -7,8 +7,8 @@ export { sandboxFetchAttachmentTool } from "./fetch-attachment.js";
|
|
|
7
7
|
export { compileGlob, GlobPatternError, MAX_GLOB_STARS } from "./glob-match.js";
|
|
8
8
|
/**
|
|
9
9
|
* The sandbox builtins (M5 T8): Bash / Read / Write / Edit / Glob / Grep / Deliver / FetchAttachment,
|
|
10
|
-
* all run in the conversation's device (`SandboxService.
|
|
11
|
-
* into it by a sandbox call: `FetchAttachment` is the only way in, writing one file under
|
|
10
|
+
* all run in the conversation's device (`SandboxService.withOperations`). Attachments are not
|
|
11
|
+
* copied into it by a sandbox call: `FetchAttachment` is the only way in, writing one file under
|
|
12
12
|
* `<workspace>/attachments/<conversation>` (the instance's roots, environments spec §13.1).
|
|
13
13
|
* Unavailable without a provider for it. Allowed by default; with the org setting
|
|
14
14
|
* `sandboxToolPolicy` set to ask, every one but Read / Glob / Grep / FetchAttachment needs approval
|