@rivet-dev/agentos-core 0.0.0-codex-agentos-native-platform-e2e.3f8b27c → 0.0.0-codex-actor-plugin-contract-coverage.115ca8a
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/README.md +4 -7
- package/dist/agent-os.d.ts +150 -45
- package/dist/agent-os.js +769 -541
- package/dist/agentos-package.d.ts +29 -0
- package/dist/agentos-package.js +88 -0
- package/dist/base-filesystem.d.ts +2 -15
- package/dist/base-filesystem.js +23 -171
- package/dist/cron/types.d.ts +1 -1
- package/dist/default-software.d.ts +8 -0
- package/dist/default-software.js +10 -0
- package/dist/generated/AcpLimitsConfig.d.ts +4 -0
- package/dist/generated/AcpLimitsConfig.js +2 -0
- package/dist/generated/CreateVmConfig.d.ts +26 -0
- package/dist/generated/CreateVmConfig.js +1 -0
- package/dist/generated/FsPermissionRule.d.ts +6 -0
- package/dist/generated/FsPermissionRule.js +1 -0
- package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
- package/dist/generated/FsPermissionRuleSet.js +1 -0
- package/dist/generated/FsPermissionScope.d.ts +3 -0
- package/dist/generated/FsPermissionScope.js +1 -0
- package/dist/generated/HttpLimitsConfig.d.ts +3 -0
- package/dist/generated/HttpLimitsConfig.js +2 -0
- package/dist/generated/JsModuleResolution.d.ts +1 -0
- package/dist/generated/JsModuleResolution.js +2 -0
- package/dist/generated/JsRuntimeConfig.d.ts +31 -0
- package/dist/generated/JsRuntimeConfig.js +1 -0
- package/dist/generated/JsRuntimeLimitsConfig.d.ts +11 -0
- package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
- package/dist/generated/JsRuntimePlatform.d.ts +1 -0
- package/dist/generated/JsRuntimePlatform.js +2 -0
- package/dist/generated/MountPluginDescriptor.d.ts +4 -0
- package/dist/generated/MountPluginDescriptor.js +2 -0
- package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
- package/dist/generated/NativeRootFilesystemConfig.js +1 -0
- package/dist/generated/PatternPermissionRule.d.ts +6 -0
- package/dist/generated/PatternPermissionRule.js +1 -0
- package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
- package/dist/generated/PatternPermissionRuleSet.js +1 -0
- package/dist/generated/PatternPermissionScope.d.ts +3 -0
- package/dist/generated/PatternPermissionScope.js +1 -0
- package/dist/generated/PermissionMode.d.ts +1 -0
- package/dist/generated/PermissionMode.js +2 -0
- package/dist/generated/PermissionsPolicy.d.ts +10 -0
- package/dist/generated/PermissionsPolicy.js +1 -0
- package/dist/generated/PluginLimitsConfig.d.ts +4 -0
- package/dist/generated/PluginLimitsConfig.js +2 -0
- package/dist/generated/PythonLimitsConfig.d.ts +6 -0
- package/dist/generated/PythonLimitsConfig.js +2 -0
- package/dist/generated/ResourceLimitsConfig.d.ts +24 -0
- package/dist/generated/ResourceLimitsConfig.js +2 -0
- package/dist/generated/RootFilesystemConfig.d.ts +9 -0
- package/dist/generated/RootFilesystemConfig.js +1 -0
- package/dist/generated/RootFilesystemEntry.d.ts +13 -0
- package/dist/generated/RootFilesystemEntry.js +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
- package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
- package/dist/generated/RootFilesystemEntryKind.js +2 -0
- package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
- package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
- package/dist/generated/RootFilesystemMode.d.ts +1 -0
- package/dist/generated/RootFilesystemMode.js +2 -0
- package/dist/generated/ToolLimitsConfig.d.ts +10 -0
- package/dist/generated/ToolLimitsConfig.js +2 -0
- package/dist/generated/VmDnsConfig.d.ts +6 -0
- package/dist/generated/VmDnsConfig.js +2 -0
- package/dist/generated/VmLimitsConfig.d.ts +18 -0
- package/dist/generated/VmLimitsConfig.js +1 -0
- package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
- package/dist/generated/VmListenPolicyConfig.js +2 -0
- package/dist/generated/WasmLimitsConfig.d.ts +7 -0
- package/dist/generated/WasmLimitsConfig.js +2 -0
- package/dist/host-dir-mount.d.ts +1 -1
- package/dist/host-tools-zod.js +27 -7
- package/dist/host-tools.js +9 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/layers.d.ts +2 -2
- package/dist/layers.js +19 -10
- package/dist/options-schema.d.ts +453 -0
- package/dist/options-schema.js +268 -0
- package/dist/packages.d.ts +17 -116
- package/dist/packages.js +35 -322
- package/dist/runtime-compat.d.ts +22 -9
- package/dist/runtime-compat.js +126 -141
- package/dist/runtime.d.ts +32 -5
- package/dist/sandbox.d.ts +112 -0
- package/dist/sandbox.js +264 -0
- package/dist/sidecar/agentos-protocol.d.ts +88 -1
- package/dist/sidecar/agentos-protocol.js +134 -18
- package/dist/sidecar/native-process-client.d.ts +6 -3
- package/dist/sidecar/native-process-client.js +5 -3
- package/dist/sidecar/permissions.d.ts +1 -1
- package/dist/sidecar/permissions.js +3 -3
- package/dist/sidecar/rpc-client.d.ts +62 -4
- package/dist/sidecar/rpc-client.js +339 -85
- package/dist/types.d.ts +10 -3
- package/package.json +40 -34
- package/dist/agents.d.ts +0 -63
- package/dist/agents.js +0 -42
- package/fixtures/AGENTOS_SYSTEM_PROMPT.md +0 -21
package/README.md
CHANGED
|
@@ -112,7 +112,7 @@ await vm.dispose();
|
|
|
112
112
|
|
|
113
113
|
| Method | Signature | Description |
|
|
114
114
|
|--------|-----------|-------------|
|
|
115
|
-
| `createSession` | `createSession(agentType: AgentType
|
|
115
|
+
| `createSession` | `createSession(agentType: AgentType, options?: CreateSessionOptions): Promise<{ sessionId: string }>` | Launch an agent and return a session ID |
|
|
116
116
|
| `listSessions` | `listSessions(): SessionInfo[]` | List active sessions |
|
|
117
117
|
| `destroySession` | `destroySession(sessionId: string): Promise<void>` | Gracefully cancel and close a session |
|
|
118
118
|
|
|
@@ -157,10 +157,7 @@ await vm.dispose();
|
|
|
157
157
|
- `MountConfigCustom` — Caller-provided VirtualFileSystem
|
|
158
158
|
- `NativeMountConfig` — Declarative sidecar mount plugin configuration
|
|
159
159
|
- `MountConfigOverlay` — Copy-on-write overlay (lower + upper layers)
|
|
160
|
-
|
|
161
|
-
**Companion Filesystem Packages**
|
|
162
|
-
- `createGoogleDriveBackend()` — Declarative Google Drive native mount helper from `@secure-exec/google-drive`
|
|
163
|
-
- `createS3Backend()` — Declarative S3-compatible native mount helper from `@secure-exec/s3`
|
|
160
|
+
- `chunkedS3MountPlugin()` — Declarative S3-compatible native mount plugin descriptor (from `@rivet-dev/agentos-runtime-core/descriptors`)
|
|
164
161
|
|
|
165
162
|
**MCP Servers**
|
|
166
163
|
- `McpServerConfig` — Union of local and remote MCP configs
|
|
@@ -180,8 +177,8 @@ await vm.dispose();
|
|
|
180
177
|
- `BatchReadResult` — Result of a batch read (path, content, error?)
|
|
181
178
|
|
|
182
179
|
**Agent**
|
|
183
|
-
- `AgentType` — `
|
|
184
|
-
- `AgentConfig` — Agent configuration (
|
|
180
|
+
- `AgentType` — `string` (a package manifest `name`, e.g. `"pi"`, `"claude"`); agents are resolved dynamically from the configured `/opt/agentos` package manifests, so any manifest `name` is valid
|
|
181
|
+
- `AgentConfig` — Agent configuration (adapterEntrypoint, launchArgs, defaultEnv)
|
|
185
182
|
- `AgentRegistryEntry` — Registry entry (id, acpAdapter, agentPackage, installed)
|
|
186
183
|
|
|
187
184
|
**Session**
|
package/dist/agent-os.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { NativeMountPluginDescriptor } from "@
|
|
1
|
+
import type { NativeMountPluginDescriptor } from "@rivet-dev/agentos-runtime-core/descriptors";
|
|
2
2
|
import type { AgentCapabilities, AgentInfo, PermissionReply, PermissionRequestHandler, SessionConfigOption, SessionEventHandler, SessionModeState } from "./agent-session-types.js";
|
|
3
3
|
import { type ToolKit } from "./host-tools.js";
|
|
4
4
|
import type { JsonRpcResponse } from "./json-rpc.js";
|
|
5
5
|
import type { ConnectTerminalOptions, Kernel, KernelExecOptions, KernelExecResult, ProcessInfo as KernelProcessInfo, KernelSpawnOptions, OpenShellOptions, Permissions, VirtualFileSystem, VirtualStat } from "./runtime-compat.js";
|
|
6
|
-
export type { MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountPluginDescriptor, } from "@
|
|
6
|
+
export type { MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountPluginDescriptor, } from "@rivet-dev/agentos-runtime-core/descriptors";
|
|
7
7
|
export type { AgentCapabilities, AgentInfo, PermissionReply, PermissionRequest, PermissionRequestHandler, SessionConfigOption, SessionEventHandler, SessionInitData, SessionMode, SessionModeState, } from "./agent-session-types.js";
|
|
8
8
|
export type { AcpTimeoutErrorData, JsonRpcError, JsonRpcErrorData, JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, } from "./json-rpc.js";
|
|
9
9
|
export { isAcpTimeoutErrorData } from "./json-rpc.js";
|
|
@@ -46,15 +46,16 @@ export interface BatchReadResult {
|
|
|
46
46
|
/** Entry in the agent registry, describing an available agent type. */
|
|
47
47
|
export interface AgentRegistryEntry {
|
|
48
48
|
id: string;
|
|
49
|
-
acpAdapter: string;
|
|
50
|
-
agentPackage: string;
|
|
51
49
|
installed: boolean;
|
|
50
|
+
/** Guest entrypoint the sidecar launches for this agent (`/opt/agentos/bin/<acpEntrypoint>`). */
|
|
51
|
+
adapterEntrypoint: string;
|
|
52
52
|
}
|
|
53
|
-
import {
|
|
53
|
+
import type { AgentType } from "./types.js";
|
|
54
54
|
import type { ScheduleDriver } from "./cron/schedule-driver.js";
|
|
55
55
|
import type { CronEventHandler, CronJob, CronJobInfo, CronJobOptions } from "./cron/types.js";
|
|
56
56
|
import { type LayerStore, type OverlayFilesystemMode, type RootSnapshotExport, type SnapshotLayerHandle } from "./layers.js";
|
|
57
57
|
import { type SoftwareInput } from "./packages.js";
|
|
58
|
+
import { type PackageRef, type SoftwarePackageRef } from "./agentos-package.js";
|
|
58
59
|
import { type AgentOsSidecarPlacement } from "./sidecar/rpc-client.js";
|
|
59
60
|
export interface AgentOsSharedSidecarOptions {
|
|
60
61
|
pool?: string;
|
|
@@ -172,6 +173,10 @@ export interface AgentOsLimits {
|
|
|
172
173
|
/** Guest JavaScript runtime buffering limits. */
|
|
173
174
|
jsRuntime?: {
|
|
174
175
|
v8HeapLimitMb?: number;
|
|
176
|
+
syncRpcWaitTimeoutMs?: number;
|
|
177
|
+
cpuTimeLimitMs?: number;
|
|
178
|
+
wallClockLimitMs?: number;
|
|
179
|
+
importCacheMaterializeTimeoutMs?: number;
|
|
175
180
|
capturedOutputLimitBytes?: number;
|
|
176
181
|
stdinBufferLimitBytes?: number;
|
|
177
182
|
eventPayloadLimitBytes?: number;
|
|
@@ -181,6 +186,7 @@ export interface AgentOsLimits {
|
|
|
181
186
|
python?: {
|
|
182
187
|
outputBufferMaxBytes?: number;
|
|
183
188
|
executionTimeoutMs?: number;
|
|
189
|
+
maxOldSpaceMb?: number;
|
|
184
190
|
vfsRpcTimeoutMs?: number;
|
|
185
191
|
};
|
|
186
192
|
/** Guest WASM runtime limits. */
|
|
@@ -188,6 +194,8 @@ export interface AgentOsLimits {
|
|
|
188
194
|
maxModuleFileBytes?: number;
|
|
189
195
|
capturedOutputLimitBytes?: number;
|
|
190
196
|
syncReadLimitBytes?: number;
|
|
197
|
+
prewarmTimeoutMs?: number;
|
|
198
|
+
runnerHeapLimitMb?: number;
|
|
191
199
|
};
|
|
192
200
|
}
|
|
193
201
|
export interface AgentStderrEvent {
|
|
@@ -198,13 +206,69 @@ export interface AgentStderrEvent {
|
|
|
198
206
|
chunk: Uint8Array;
|
|
199
207
|
}
|
|
200
208
|
export type AgentStderrHandler = (event: AgentStderrEvent) => void;
|
|
209
|
+
/**
|
|
210
|
+
* Auto-restart outcome reported on an {@link AgentExitEvent}. Mirrors the
|
|
211
|
+
* sidecar's `AcpAgentExitedEvent.restart` strings:
|
|
212
|
+
* - `"restarted"` — the adapter was respawned and the session was natively
|
|
213
|
+
* re-attached under the same session id; the session stays usable.
|
|
214
|
+
* - `"unsupported"` — the adapter does not advertise a native resume
|
|
215
|
+
* capability (`loadSession`/`resume`); the session was evicted.
|
|
216
|
+
* - `"failed"` — the respawn or re-attach errored; the session was evicted.
|
|
217
|
+
* - `"exhausted"` — the per-session restart budget was already spent; evicted.
|
|
218
|
+
*/
|
|
219
|
+
export type AgentRestartOutcome = "restarted" | "unsupported" | "failed" | "exhausted";
|
|
220
|
+
/**
|
|
221
|
+
* An unexpected ACP adapter process exit — a crash from the host's
|
|
222
|
+
* perspective (any spontaneous exit without `closeSession()`, including exit
|
|
223
|
+
* code 0) — plus the sidecar's bounded auto-restart outcome.
|
|
224
|
+
*/
|
|
225
|
+
export interface AgentExitEvent {
|
|
226
|
+
sessionId: string;
|
|
227
|
+
agentType: string;
|
|
228
|
+
/** Sidecar process id of the adapter that exited. */
|
|
229
|
+
processId: string;
|
|
230
|
+
pid: number | null;
|
|
231
|
+
/** Adapter exit code; `null` when the exit was observed indirectly. */
|
|
232
|
+
exitCode: number | null;
|
|
233
|
+
/** Auto-restart outcome; only `"restarted"` leaves the session usable. */
|
|
234
|
+
restart: AgentRestartOutcome;
|
|
235
|
+
/** Restarts consumed for this session so far. */
|
|
236
|
+
restartCount: number;
|
|
237
|
+
/** Per-session restart budget. */
|
|
238
|
+
maxRestarts: number;
|
|
239
|
+
}
|
|
240
|
+
export type AgentExitHandler = (event: AgentExitEvent) => void;
|
|
241
|
+
/**
|
|
242
|
+
* A near-capacity warning for one bounded limit (a queue/buffer, a saturating
|
|
243
|
+
* resource cap, or a memory envelope) inside the VM runtime. Delivered the moment
|
|
244
|
+
* usage crosses the runtime's warning threshold (~80%), once per crossing — the
|
|
245
|
+
* runtime applies edge-triggering + hysteresis, so this never spams.
|
|
246
|
+
*/
|
|
247
|
+
export interface LimitWarning {
|
|
248
|
+
/** Stable limit name, e.g. `"javascript_event_channel"` or `"vm_open_fds"`. */
|
|
249
|
+
limit: string;
|
|
250
|
+
/** Limit class: `"queue"`, `"resource"`, or `"memory"`. */
|
|
251
|
+
category: string;
|
|
252
|
+
/** Current observed usage. */
|
|
253
|
+
observed: number;
|
|
254
|
+
/** Configured capacity. */
|
|
255
|
+
capacity: number;
|
|
256
|
+
/** Observed fill as a percentage of capacity (0–100). */
|
|
257
|
+
fillPercent: number;
|
|
258
|
+
}
|
|
259
|
+
export type LimitWarningHandler = (warning: LimitWarning) => void;
|
|
260
|
+
/**
|
|
261
|
+
* Public core VM options.
|
|
262
|
+
*
|
|
263
|
+
* Keep this interface in sync with
|
|
264
|
+
* `packages/core/src/options-schema.ts::agentOsOptionsSchema`. The Rivet
|
|
265
|
+
* native actor intentionally accepts only a subset via
|
|
266
|
+
* `packages/agentos/src/config.ts::nativeAgentOsOptionsSchema`.
|
|
267
|
+
*/
|
|
201
268
|
export interface AgentOsOptions {
|
|
202
269
|
/**
|
|
203
|
-
* Software to install in the VM. Each entry
|
|
204
|
-
*
|
|
205
|
-
* registry packages like @agentos-software/coreutils) is treated
|
|
206
|
-
* as a WASM command source automatically. Arrays are flattened, so
|
|
207
|
-
* meta-packages that export arrays of sub-packages work directly.
|
|
270
|
+
* Software to install in the VM. Each entry is a package-dir ref. Arrays are
|
|
271
|
+
* flattened, so meta-packages that export arrays of sub-packages work directly.
|
|
208
272
|
*/
|
|
209
273
|
software?: SoftwareInput[];
|
|
210
274
|
/**
|
|
@@ -222,15 +286,18 @@ export interface AgentOsOptions {
|
|
|
222
286
|
* Defaults to the hardened builtin set used by the native sidecar bridge.
|
|
223
287
|
*/
|
|
224
288
|
allowedNodeBuiltins?: string[];
|
|
289
|
+
/**
|
|
290
|
+
* Opt in to a high-resolution monotonic guest clock (microsecond class)
|
|
291
|
+
* for guest Node processes. Default `false` keeps the security-oriented
|
|
292
|
+
* 1ms timer resolution — untrusted guest code should not get a precise
|
|
293
|
+
* timer (timing side channels). Enable only for trusted benchmarking or
|
|
294
|
+
* profiling workloads.
|
|
295
|
+
*/
|
|
296
|
+
highResolutionTime?: boolean;
|
|
225
297
|
/** Root filesystem configuration. Defaults to an overlay with the bundled base snapshot as its deepest lower. */
|
|
226
298
|
rootFilesystem?: RootFilesystemConfig;
|
|
227
299
|
/** Filesystems to mount at boot time. */
|
|
228
300
|
mounts?: MountConfig[];
|
|
229
|
-
/**
|
|
230
|
-
* @deprecated Use `mounts: [nodeModulesMount(path)]` instead.
|
|
231
|
-
* Compatibility alias for mounting `<moduleAccessCwd>/node_modules` at `/root/node_modules`.
|
|
232
|
-
*/
|
|
233
|
-
moduleAccessCwd?: string;
|
|
234
301
|
/** Additional instructions appended to the base OS system prompt injected at session start. */
|
|
235
302
|
additionalInstructions?: string;
|
|
236
303
|
/** Custom schedule driver for cron jobs. Defaults to TimerScheduleDriver. */
|
|
@@ -259,6 +326,21 @@ export interface AgentOsOptions {
|
|
|
259
326
|
* `process.stderr`.
|
|
260
327
|
*/
|
|
261
328
|
onAgentStderr?: AgentStderrHandler;
|
|
329
|
+
/**
|
|
330
|
+
* Called when the ACP adapter process behind a session exits without
|
|
331
|
+
* `closeSession()` — i.e. an adapter crash. The sidecar auto-restarts the
|
|
332
|
+
* adapter (bounded per session, natively re-attaching the same session id)
|
|
333
|
+
* and reports the outcome on the event; only `restart === "restarted"`
|
|
334
|
+
* leaves the session usable. Defaults to writing a warning line to
|
|
335
|
+
* `process.stderr`.
|
|
336
|
+
*/
|
|
337
|
+
onAgentExit?: AgentExitHandler;
|
|
338
|
+
/**
|
|
339
|
+
* Called when a bounded limit inside the VM runtime approaches capacity
|
|
340
|
+
* (~80%, edge-triggered with hysteresis so it does not spam). Use it to alert
|
|
341
|
+
* on a slow consumer or a runaway guest before the limit is actually hit.
|
|
342
|
+
*/
|
|
343
|
+
onLimitWarning?: LimitWarningHandler;
|
|
262
344
|
}
|
|
263
345
|
/** Configuration for a local MCP server (spawned as a child process). */
|
|
264
346
|
export interface McpServerConfigLocal {
|
|
@@ -362,7 +444,6 @@ export declare class AgentOs {
|
|
|
362
444
|
private _acpTerminals;
|
|
363
445
|
private _acpTerminalCounter;
|
|
364
446
|
private _softwareRoots;
|
|
365
|
-
private _softwareAgentConfigs;
|
|
366
447
|
private _cronManager;
|
|
367
448
|
private _toolKits;
|
|
368
449
|
private _toolReference;
|
|
@@ -370,12 +451,15 @@ export declare class AgentOs {
|
|
|
370
451
|
private _hostMounts;
|
|
371
452
|
private _env;
|
|
372
453
|
private _rootFilesystem;
|
|
454
|
+
private readonly _additionalInstructions;
|
|
373
455
|
private _sidecarLease;
|
|
374
456
|
private readonly _sidecarClient;
|
|
375
457
|
private readonly _sidecarSession;
|
|
376
458
|
private readonly _sidecarVm;
|
|
377
459
|
private readonly _disposeSidecarEventListener;
|
|
378
460
|
private readonly _agentStderrHandler?;
|
|
461
|
+
private readonly _agentExitHandler?;
|
|
462
|
+
private readonly _limitWarningHandler?;
|
|
379
463
|
private constructor();
|
|
380
464
|
static createSidecar(options?: AgentOsCreateSidecarOptions): Promise<AgentOsSidecar>;
|
|
381
465
|
static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>;
|
|
@@ -387,9 +471,9 @@ export declare class AgentOs {
|
|
|
387
471
|
pid: number;
|
|
388
472
|
};
|
|
389
473
|
/** Write data to a process's stdin. */
|
|
390
|
-
writeProcessStdin(pid: number, data: string | Uint8Array): void
|
|
474
|
+
writeProcessStdin(pid: number, data: string | Uint8Array): Promise<void>;
|
|
391
475
|
/** Close a process's stdin stream. */
|
|
392
|
-
closeProcessStdin(pid: number): void
|
|
476
|
+
closeProcessStdin(pid: number): Promise<void>;
|
|
393
477
|
/** Subscribe to stdout data from a process. Returns an unsubscribe function. */
|
|
394
478
|
onProcessStdout(pid: number, handler: (data: Uint8Array) => void): () => void;
|
|
395
479
|
/** Subscribe to stderr data from a process. Returns an unsubscribe function. */
|
|
@@ -401,7 +485,6 @@ export declare class AgentOs {
|
|
|
401
485
|
private _assertSafeAbsolutePath;
|
|
402
486
|
private _assertWritableAbsolutePath;
|
|
403
487
|
private _vfs;
|
|
404
|
-
private _copyPath;
|
|
405
488
|
readFile(path: string): Promise<Uint8Array>;
|
|
406
489
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
407
490
|
writeFiles(entries: BatchWriteEntry[]): Promise<BatchWriteResult[]>;
|
|
@@ -430,11 +513,17 @@ export declare class AgentOs {
|
|
|
430
513
|
};
|
|
431
514
|
connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
|
|
432
515
|
/** Write data to a shell's PTY input. */
|
|
433
|
-
writeShell(shellId: string, data: string | Uint8Array): void
|
|
516
|
+
writeShell(shellId: string, data: string | Uint8Array): Promise<void>;
|
|
434
517
|
/** Subscribe to data output from a shell. Returns an unsubscribe function. */
|
|
435
518
|
onShellData(shellId: string, handler: (data: Uint8Array) => void): () => void;
|
|
436
519
|
/** Notify a shell of terminal resize. */
|
|
437
520
|
resizeShell(shellId: string, cols: number, rows: number): void;
|
|
521
|
+
/**
|
|
522
|
+
* Wait for a shell to exit and return its process exit code. Resolves
|
|
523
|
+
* immediately for a shell that has already exited (within the closed-shell
|
|
524
|
+
* retention window).
|
|
525
|
+
*/
|
|
526
|
+
waitShell(shellId: string): Promise<number>;
|
|
438
527
|
/** Kill a shell process and remove it from tracking. */
|
|
439
528
|
closeShell(shellId: string): void;
|
|
440
529
|
private _resolveVmPathToHostPath;
|
|
@@ -454,16 +543,53 @@ export declare class AgentOs {
|
|
|
454
543
|
listSessions(): SessionInfo[];
|
|
455
544
|
/** Internal helper: retrieve a session or throw. */
|
|
456
545
|
private _requireSession;
|
|
457
|
-
/**
|
|
458
|
-
|
|
546
|
+
/**
|
|
547
|
+
* Dynamically link a software package into the RUNNING VM. The package's
|
|
548
|
+
* `bin/` commands appear under `/opt/agentos/bin` (on `$PATH`) and its `share/man`
|
|
549
|
+
* pages under MANPATH immediately — the `/opt/agentos` mount is host-backed, so
|
|
550
|
+
* writing into its staging dir is reflected live with no reboot. An `agent`
|
|
551
|
+
* block registers the package for `createSession(name)`. Persists for the VM's
|
|
552
|
+
* lifetime (and across a snapshot iff the volume persists).
|
|
553
|
+
*/
|
|
554
|
+
linkSoftware(descriptor: PackageRef | SoftwarePackageRef): Promise<void>;
|
|
555
|
+
providedCommands(): Promise<{
|
|
556
|
+
packageName: string;
|
|
557
|
+
commands: string[];
|
|
558
|
+
}[]>;
|
|
559
|
+
/**
|
|
560
|
+
* Returns all registered agents with their installation status. Thin forwarder:
|
|
561
|
+
* sends `AcpListAgentsRequest` and maps the response. The sidecar enumerates the
|
|
562
|
+
* projected `/opt/agentos` packages (the client parses no manifests). Every such
|
|
563
|
+
* agent is a package materialized into the VM, so `installed` is always `true`.
|
|
564
|
+
*/
|
|
565
|
+
listAgents(): Promise<AgentRegistryEntry[]>;
|
|
459
566
|
private _syncSessionState;
|
|
460
567
|
private _applySessionUpdate;
|
|
461
568
|
private _recordSessionNotification;
|
|
462
569
|
private _dispatchSessionEvent;
|
|
463
570
|
private _subscribeSessionEvents;
|
|
571
|
+
/**
|
|
572
|
+
* Warn once per session (host-visible) that a tool-permission request was
|
|
573
|
+
* auto-denied because no `onPermissionRequest` handler is registered. Shared
|
|
574
|
+
* by both the bare-callback and JSON-RPC permission paths so the message and
|
|
575
|
+
* the once-per-session guard cannot drift between them.
|
|
576
|
+
*/
|
|
577
|
+
private _warnNoPermissionHandlerOnce;
|
|
578
|
+
/** Best-effort human label for the tool named in a permission request. */
|
|
579
|
+
private _permissionToolLabel;
|
|
580
|
+
/**
|
|
581
|
+
* Emit a host-visible warning for a session through the same agent-process log
|
|
582
|
+
* channel that surfaces adapter stderr (`onAgentStderr`, default: process
|
|
583
|
+
* stderr). Used for agent-os-owned diagnostics — e.g. a permission request
|
|
584
|
+
* that was auto-denied because no host hook is registered — so they never fire
|
|
585
|
+
* silently inside the sidecar.
|
|
586
|
+
*/
|
|
587
|
+
private _emitSessionWarning;
|
|
464
588
|
private _recordAgentStderr;
|
|
589
|
+
private _recordAgentExit;
|
|
465
590
|
private _applySyntheticConfigOverrides;
|
|
466
591
|
private _handleSidecarEvent;
|
|
592
|
+
private _handleLimitWarning;
|
|
467
593
|
private _handleAcpExtEvent;
|
|
468
594
|
private _unsupportedConfigResponse;
|
|
469
595
|
private _sendAcpRequest;
|
|
@@ -476,7 +602,7 @@ export declare class AgentOs {
|
|
|
476
602
|
private _rejectPendingPermissionRepliesFromSession;
|
|
477
603
|
private _closeSessionInternal;
|
|
478
604
|
private _hydrateSessionState;
|
|
479
|
-
createSession(agentType: AgentType
|
|
605
|
+
createSession(agentType: AgentType, options?: CreateSessionOptions): Promise<{
|
|
480
606
|
sessionId: string;
|
|
481
607
|
}>;
|
|
482
608
|
/**
|
|
@@ -494,23 +620,7 @@ export declare class AgentOs {
|
|
|
494
620
|
* Resume depends on a durable root; on a non-durable (default in-memory) root
|
|
495
621
|
* there is no surviving store and the fallback tier always runs.
|
|
496
622
|
*/
|
|
497
|
-
resumeSession(sessionId: string, agentType: AgentType
|
|
498
|
-
/**
|
|
499
|
-
* Resolve the VM bin entry point of an ACP adapter package.
|
|
500
|
-
* Reads from the host filesystem since kernel.readFile() resolves through
|
|
501
|
-
* mounts; adapter package.json is read directly off the host dir backing
|
|
502
|
-
* the relevant mount.
|
|
503
|
-
*/
|
|
504
|
-
private _resolveAdapterBin;
|
|
505
|
-
/**
|
|
506
|
-
* Parent of the host directory backing the `/root/node_modules` mount, if
|
|
507
|
-
* the caller supplied one (e.g. via `nodeModulesMount(...)`). Used as the
|
|
508
|
-
* `resolvePackageDir` start dir for adapter/agent package resolution when no
|
|
509
|
-
* software root matches. `nodeModulesMount` mounts `<dir>/node_modules`, so
|
|
510
|
-
* the start dir is `<dir>` (one level above the node_modules tree).
|
|
511
|
-
*/
|
|
512
|
-
private _nodeModulesHostRoot;
|
|
513
|
-
private _resolvePackageBin;
|
|
623
|
+
resumeSession(sessionId: string, agentType: AgentType, options?: ResumeSessionOptions): Promise<ResumeSessionResult>;
|
|
514
624
|
private _installSidecarRequestHandler;
|
|
515
625
|
private _handleAcpExtSidecarRequest;
|
|
516
626
|
private _dispatchAcpSidecarRequest;
|
|
@@ -537,11 +647,6 @@ export declare class AgentOs {
|
|
|
537
647
|
private _handleAcpReleaseTerminal;
|
|
538
648
|
private _handleAcpResizeTerminal;
|
|
539
649
|
private _handleAcpPermissionCallback;
|
|
540
|
-
/**
|
|
541
|
-
* Resolve an agent config by ID. Package-provided configs take
|
|
542
|
-
* precedence over the hardcoded AGENT_CONFIGS.
|
|
543
|
-
*/
|
|
544
|
-
private _resolveAgentConfig;
|
|
545
650
|
/**
|
|
546
651
|
* Gracefully destroy a session: cancel any pending work, close the client,
|
|
547
652
|
* and remove from tracking. Unlike close() which is abrupt, this attempts
|