@rivet-dev/agentos-core 0.2.22 → 0.4.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/README.md +9 -9
- package/dist/agent-os.d.ts +71 -198
- package/dist/agent-os.js +480 -1206
- package/dist/agentos-package.d.ts +15 -4
- package/dist/agentos-package.js +1 -22
- package/dist/cron/cron-manager.js +0 -27
- package/dist/cron/types.d.ts +0 -12
- package/dist/default-software/coreutils.aospkg +4 -0
- package/dist/default-software/default-software.json +10 -0
- package/dist/default-software/diffutils.aospkg +0 -0
- package/dist/default-software/findutils.aospkg +0 -0
- package/dist/default-software/gawk.aospkg +0 -0
- package/dist/default-software/grep.aospkg +0 -0
- package/dist/default-software/gzip.aospkg +0 -0
- package/dist/default-software/sed.aospkg +0 -0
- package/dist/default-software/tar.aospkg +0 -0
- package/dist/default-software.d.ts +6 -5
- package/dist/default-software.js +17 -6
- package/dist/generated/VmLimitsConfig.d.ts +0 -2
- package/dist/host-dir-mount.d.ts +1 -1
- package/dist/host-dir-mount.js +1 -1
- package/dist/language-execution.d.ts +6 -2
- package/dist/options-schema.d.ts +10 -48
- package/dist/options-schema.js +10 -47
- package/dist/output-replay.d.ts +18 -0
- package/dist/output-replay.js +75 -0
- package/dist/packages.d.ts +0 -9
- package/dist/packages.js +0 -39
- package/dist/process-forest.d.ts +7 -0
- package/dist/process-forest.js +24 -0
- package/dist/runtime-compat.d.ts +13 -0
- package/dist/runtime-compat.js +3 -9
- package/dist/sidecar/binary.d.ts +1 -1
- package/dist/sidecar/binary.js +4 -4
- package/dist/sidecar/native-process-client.d.ts +1 -1
- package/dist/sidecar/rpc-client.d.ts +12 -18
- package/dist/sidecar/rpc-client.js +385 -188
- package/dist/types.d.ts +3 -11
- package/package.json +9 -45
- package/dist/generated/AcpLimitsConfig.d.ts +0 -20
- package/dist/generated/AcpLimitsConfig.js +0 -2
- package/dist/json-rpc.d.ts +0 -50
- package/dist/json-rpc.js +0 -22
- package/dist/session-api.d.ts +0 -180
- package/dist/session-api.js +0 -1
- package/dist/sidecar/agentos-protocol.d.ts +0 -719
- package/dist/sidecar/agentos-protocol.js +0 -1331
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agentOS embedded Core
|
|
2
2
|
|
|
3
|
-
`@rivet-dev/agentos-core`
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
`@rivet-dev/agentos-core` embeds an agentOS VM in a Node.js application. The
|
|
4
|
+
embedding process owns VM lifecycle and may supply trusted host bindings,
|
|
5
|
+
host-backed mounts, and local `.aospkg` paths.
|
|
6
6
|
|
|
7
|
-
Install
|
|
7
|
+
Install Core directly for embedded use:
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
|
|
11
|
-
pnpm add @rivet-dev/agentos
|
|
10
|
+
pnpm add @rivet-dev/agentos-core
|
|
12
11
|
```
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Managed services can wrap Core with a transport-specific client. Those adapters
|
|
14
|
+
live outside this repository and intentionally expose a smaller trusted-host
|
|
15
|
+
surface.
|
package/dist/agent-os.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { NativeMountPluginDescriptor } from "@rivet-dev/agentos-runtime-core/descriptors";
|
|
2
|
-
import type { VmUserConfig } from "@rivet-dev/agentos-runtime-core/vm-config";
|
|
2
|
+
import type { CreateVmConfig, VmUserConfig } from "@rivet-dev/agentos-runtime-core/vm-config";
|
|
3
3
|
import { type HostFunctionCollections, type HostFunctionSchemas } from "@rivet-dev/agentos-runtime-core/host-functions";
|
|
4
|
-
import type { CodeEvaluationResult, CodeExecutionResult, ContextDescriptor, ExecutionSignal, InlineExecutionOptions, JavaScriptEvaluationOptions, JavaScriptExecutionOptions, LanguageExecutionOptions, LanguageSpawnOptions, NpmPackageInstallOptions, NpmProjectInstallOptions, OutputReplay, ProcessDescriptor, ProcessExit, PythonInstallOptions, SpawnOptions, TypeScriptCheckOptions, TypeScriptCheckResult, TypeScriptEvaluationOptions, TypeScriptExecutionOptions, TypeScriptFileExecutionOptions } from "./language-execution.js";
|
|
4
|
+
import type { CodeEvaluationResult, CodeExecutionResult, ContextDescriptor, ExecutionSignal, InlineExecutionOptions, JavaScriptEvaluationOptions, JavaScriptExecutionOptions, JsonValue, LanguageExecutionOptions, LanguageSpawnOptions, NpmPackageInstallOptions, NpmProjectInstallOptions, OutputReplay, ProcessDescriptor, ProcessExit, PythonInstallOptions, SpawnOptions, TypeScriptCheckOptions, TypeScriptCheckResult, TypeScriptEvaluationOptions, TypeScriptExecutionOptions, TypeScriptFileExecutionOptions } from "./language-execution.js";
|
|
5
5
|
import type { ConnectTerminalOptions, Kernel, KernelExecOptions, KernelExecResult, OpenShellOptions, Permissions, VirtualFileSystem, VirtualStat } from "./runtime-compat.js";
|
|
6
6
|
import { type AgentOsSandboxInput } from "./sandbox.js";
|
|
7
|
-
import
|
|
7
|
+
import { type ReplayReadOptions } from "./output-replay.js";
|
|
8
8
|
export type { MountConfigJsonObject, MountConfigJsonPrimitive, MountConfigJsonValue, NativeMountPluginDescriptor, } from "@rivet-dev/agentos-runtime-core/descriptors";
|
|
9
9
|
export type { ConnectTerminalOptions } from "./runtime-compat.js";
|
|
10
|
-
export type * from "./session-api.js";
|
|
11
10
|
/** Process tree node using the same descriptor shape as process.get/list. */
|
|
12
11
|
export interface ProcessTreeNode extends ProcessDescriptor {
|
|
13
12
|
ppid?: number;
|
|
@@ -45,6 +44,9 @@ export interface ProcessOutput {
|
|
|
45
44
|
pid: number;
|
|
46
45
|
stream: "stdout" | "stderr";
|
|
47
46
|
data: Uint8Array;
|
|
47
|
+
/** Sidecar replay identity, absent when output retention is disabled. */
|
|
48
|
+
sequence?: number;
|
|
49
|
+
timestampMs?: number;
|
|
48
50
|
}
|
|
49
51
|
export interface ShellData {
|
|
50
52
|
shellId: string;
|
|
@@ -96,10 +98,23 @@ export interface BatchReadResult {
|
|
|
96
98
|
content: Uint8Array | null;
|
|
97
99
|
error?: string;
|
|
98
100
|
}
|
|
99
|
-
/**
|
|
100
|
-
export
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
/** The hosted actor accepts only URL sources; embedded Core also accepts trusted paths. */
|
|
102
|
+
export type SoftwarePackageSource = {
|
|
103
|
+
type: "url";
|
|
104
|
+
url: string;
|
|
105
|
+
expectedDigest?: string;
|
|
106
|
+
} | {
|
|
107
|
+
type: "path";
|
|
108
|
+
path: string;
|
|
109
|
+
expectedDigest?: string;
|
|
110
|
+
};
|
|
111
|
+
export interface InstalledSoftware {
|
|
112
|
+
packageId: string;
|
|
113
|
+
digest: string;
|
|
114
|
+
sizeBytes: bigint;
|
|
115
|
+
packageName: string;
|
|
116
|
+
version: string;
|
|
117
|
+
commands: string[];
|
|
103
118
|
}
|
|
104
119
|
import { type PackageDescriptor } from "./agentos-package.js";
|
|
105
120
|
import type { ScheduleDriver } from "./cron/schedule-driver.js";
|
|
@@ -152,11 +167,8 @@ export interface NativeRootFilesystemConfig {
|
|
|
152
167
|
readOnly?: boolean;
|
|
153
168
|
}
|
|
154
169
|
export type RootFilesystemConfig = OverlayRootFilesystemConfig | NativeRootFilesystemConfig;
|
|
155
|
-
/** VM-scoped SQLite storage
|
|
170
|
+
/** Temporary local VM-scoped SQLite storage. */
|
|
156
171
|
export type VmSqliteConfig = {
|
|
157
|
-
type: "actor_uds";
|
|
158
|
-
path: string;
|
|
159
|
-
} | {
|
|
160
172
|
type: "sqlite_file";
|
|
161
173
|
path: string;
|
|
162
174
|
};
|
|
@@ -204,6 +216,10 @@ export type MountConfig = PlainMountConfig | NativeMountConfig | OverlayMountCon
|
|
|
204
216
|
* non-integer values are rejected by the sidecar before VM construction.
|
|
205
217
|
*/
|
|
206
218
|
export interface AgentOsLimits {
|
|
219
|
+
/** Maximum package-owned filesystem leaves projected into one VM. */
|
|
220
|
+
agentosPackages?: {
|
|
221
|
+
maxMounts?: number;
|
|
222
|
+
};
|
|
207
223
|
/** Kernel resource limits (processes, FDs, sockets, filesystem bytes, WASM caps, etc.). */
|
|
208
224
|
resources?: {
|
|
209
225
|
cpuCount?: number;
|
|
@@ -252,21 +268,7 @@ export interface AgentOsLimits {
|
|
|
252
268
|
maxPersistedManifestBytes?: number;
|
|
253
269
|
maxPersistedManifestFileBytes?: number;
|
|
254
270
|
};
|
|
255
|
-
/**
|
|
256
|
-
acp?: {
|
|
257
|
-
maxReadLineBytes?: number;
|
|
258
|
-
stdoutBufferByteLimit?: number;
|
|
259
|
-
maxCompletedMessageBytes?: number;
|
|
260
|
-
maxTurnOutputBytes?: number;
|
|
261
|
-
maxPromptBytes?: number;
|
|
262
|
-
maxPromptBlocks?: number;
|
|
263
|
-
maxFallbackContinuationBytes?: number;
|
|
264
|
-
maxSessionHistoryBytes?: number;
|
|
265
|
-
maxSessionHistoryEvents?: number;
|
|
266
|
-
maxHistoryPageEntries?: number;
|
|
267
|
-
maxSessionListEntries?: number;
|
|
268
|
-
};
|
|
269
|
-
/** Shared local-file/actor-UDS SQLite result materialization limit. */
|
|
271
|
+
/** Local SQLite result materialization limit. */
|
|
270
272
|
sqlite?: {
|
|
271
273
|
maxResultBytes?: number;
|
|
272
274
|
};
|
|
@@ -298,6 +300,12 @@ export interface AgentOsLimits {
|
|
|
298
300
|
runnerHeapLimitMb?: number;
|
|
299
301
|
runnerCpuTimeLimitMs?: number;
|
|
300
302
|
};
|
|
303
|
+
/** Completed language-execution retention and live execution warning threshold. */
|
|
304
|
+
execution?: {
|
|
305
|
+
completedTtlMs?: number;
|
|
306
|
+
maxCompletedExecutions?: number;
|
|
307
|
+
liveExecutionWarningThreshold?: number;
|
|
308
|
+
};
|
|
301
309
|
/** Process spawn, I/O, and lifecycle-event backlog limits. */
|
|
302
310
|
process?: {
|
|
303
311
|
maxSpawnFileActions?: number;
|
|
@@ -307,40 +315,6 @@ export interface AgentOsLimits {
|
|
|
307
315
|
pendingEventBytes?: number;
|
|
308
316
|
};
|
|
309
317
|
}
|
|
310
|
-
export interface AgentStderrEvent {
|
|
311
|
-
sessionId: string;
|
|
312
|
-
agentType: string;
|
|
313
|
-
processId: string;
|
|
314
|
-
pid: number | null;
|
|
315
|
-
chunk: Uint8Array;
|
|
316
|
-
}
|
|
317
|
-
export type AgentStderrHandler = (event: AgentStderrEvent) => void;
|
|
318
|
-
/**
|
|
319
|
-
* Restart disposition reported on an {@link AgentExitEvent}. AgentOS never
|
|
320
|
-
* respawns an adapter or replays an interrupted request implicitly.
|
|
321
|
-
*/
|
|
322
|
-
export type AgentRestartOutcome = "not_attempted";
|
|
323
|
-
/**
|
|
324
|
-
* An unexpected ACP adapter process exit — a crash from the host's
|
|
325
|
-
* perspective (any spontaneous exit before `unloadSession()`, including exit
|
|
326
|
-
* code 0). The live route is evicted and must be restored explicitly.
|
|
327
|
-
*/
|
|
328
|
-
export interface AgentExitEvent {
|
|
329
|
-
sessionId: string;
|
|
330
|
-
agentType: string;
|
|
331
|
-
/** Sidecar process id of the adapter that exited. */
|
|
332
|
-
processId: string;
|
|
333
|
-
pid: number | null;
|
|
334
|
-
/** Adapter exit code; `null` when the exit was observed indirectly. */
|
|
335
|
-
exitCode: number | null;
|
|
336
|
-
/** Always `"not_attempted"`; AgentOS does not restart adapters implicitly. */
|
|
337
|
-
restart: AgentRestartOutcome;
|
|
338
|
-
/** Always zero. */
|
|
339
|
-
restartCount: number;
|
|
340
|
-
/** Always zero. */
|
|
341
|
-
maxRestarts: number;
|
|
342
|
-
}
|
|
343
|
-
export type AgentExitHandler = (event: AgentExitEvent) => void;
|
|
344
318
|
/**
|
|
345
319
|
* A near-capacity warning for one bounded limit (a queue/buffer, a saturating
|
|
346
320
|
* resource cap, or a memory envelope) inside the VM runtime. Delivered the moment
|
|
@@ -370,14 +344,19 @@ export type LimitWarningHandler = (warning: LimitWarning) => void;
|
|
|
370
344
|
export interface AgentOsOptions<HOST_FUNCTIONS extends HostFunctionSchemas = HostFunctionSchemas> {
|
|
371
345
|
/** Initial virtual Linux credentials and account record. Defaults to `1000:1000` (`agentos`). */
|
|
372
346
|
user?: VmUserConfig;
|
|
347
|
+
/**
|
|
348
|
+
* Complete initial VM environment. Omission selects Core's base environment;
|
|
349
|
+
* an explicit empty object starts with an empty environment.
|
|
350
|
+
*/
|
|
351
|
+
environment?: Record<string, string>;
|
|
373
352
|
/**
|
|
374
353
|
* Software to install in the VM. Each entry is a package-dir ref. Arrays are
|
|
375
354
|
* flattened, so meta-packages that export arrays of sub-packages work directly.
|
|
376
355
|
*/
|
|
377
356
|
software?: SoftwareInput[];
|
|
378
357
|
/**
|
|
379
|
-
* Whether to auto-include
|
|
380
|
-
*
|
|
358
|
+
* Whether to auto-include Core's vendored default software bundle (`sh`,
|
|
359
|
+
* coreutils, and the standard CLI tools programs rely on) in addition to
|
|
381
360
|
* any `software` you pass. Defaults to `true`; set `false` for a bare VM with
|
|
382
361
|
* only the software you list explicitly. Entries already present in `software`
|
|
383
362
|
* are not duplicated.
|
|
@@ -398,7 +377,7 @@ export interface AgentOsOptions<HOST_FUNCTIONS extends HostFunctionSchemas = Hos
|
|
|
398
377
|
* profiling workloads.
|
|
399
378
|
*/
|
|
400
379
|
highResolutionTime?: boolean;
|
|
401
|
-
/** Durable SQLite storage for VM-owned filesystem and
|
|
380
|
+
/** Durable SQLite storage for VM-owned filesystem and runtime state. */
|
|
402
381
|
database?: VmSqliteConfig;
|
|
403
382
|
/** Root filesystem configuration. Defaults to an overlay with the bundled base snapshot as its deepest lower. */
|
|
404
383
|
rootFilesystem?: RootFilesystemConfig;
|
|
@@ -408,13 +387,14 @@ export interface AgentOsOptions<HOST_FUNCTIONS extends HostFunctionSchemas = Hos
|
|
|
408
387
|
sandbox?: AgentOsSandboxInput;
|
|
409
388
|
/** Custom schedule driver for cron jobs. Defaults to TimerScheduleDriver. */
|
|
410
389
|
scheduleDriver?: ScheduleDriver;
|
|
411
|
-
/**
|
|
390
|
+
/** Trusted host functions available to programs inside the VM. */
|
|
412
391
|
hostFunctions?: HostFunctionCollections<HOST_FUNCTIONS>;
|
|
413
392
|
/**
|
|
414
393
|
* Permission policy for the kernel. By default the guest behaves like a
|
|
415
394
|
* sandboxed machine: its virtual filesystem, processes, environment, listeners,
|
|
416
|
-
* and loopback networking work
|
|
417
|
-
* policy is merged over that
|
|
395
|
+
* and loopback networking work. External network access is limited to the
|
|
396
|
+
* sidecar-owned agentOS service allowlist. Your policy is merged over that
|
|
397
|
+
* default, so an omitted scope keeps it.
|
|
418
398
|
*/
|
|
419
399
|
permissions?: Permissions;
|
|
420
400
|
/**
|
|
@@ -427,20 +407,6 @@ export interface AgentOsOptions<HOST_FUNCTIONS extends HostFunctionSchemas = Hos
|
|
|
427
407
|
* runtime's historical constants, so omitting this leaves behavior unchanged.
|
|
428
408
|
*/
|
|
429
409
|
limits?: AgentOsLimits;
|
|
430
|
-
/**
|
|
431
|
-
* Called with stderr chunks from the top-level ACP-speaking agent process.
|
|
432
|
-
* The agent process uses stdout for ACP JSON-RPC protocol traffic, so only
|
|
433
|
-
* stderr is forwarded through this hook. Defaults to writing chunks to
|
|
434
|
-
* `process.stderr`.
|
|
435
|
-
*/
|
|
436
|
-
onAgentStderr?: AgentStderrHandler;
|
|
437
|
-
/**
|
|
438
|
-
* Called when the ACP adapter process behind a session exits unexpectedly.
|
|
439
|
-
* The sidecar evicts the live
|
|
440
|
-
* route and never retries the adapter or interrupted request implicitly.
|
|
441
|
-
* Defaults to writing a warning line to `process.stderr`.
|
|
442
|
-
*/
|
|
443
|
-
onAgentExit?: AgentExitHandler;
|
|
444
410
|
/**
|
|
445
411
|
* Called when a bounded limit inside the VM runtime approaches capacity
|
|
446
412
|
* (~80%, edge-triggered with hysteresis so it does not spam). Use it to alert
|
|
@@ -457,20 +423,21 @@ export interface AgentOsRuntimeAdmin {
|
|
|
457
423
|
export declare class AgentOs {
|
|
458
424
|
#private;
|
|
459
425
|
readonly sidecar: AgentOsSidecar;
|
|
460
|
-
private _durableSessionEventHandlers;
|
|
461
|
-
private _agentExitHandlers;
|
|
462
426
|
private _processes;
|
|
463
427
|
private _languageProcesses;
|
|
464
428
|
private _languageProcessIds;
|
|
429
|
+
private _pendingProcessRegistrations;
|
|
465
430
|
private _executionOutputHandlers;
|
|
466
431
|
private _executionCompletedHandlers;
|
|
432
|
+
private _pendingCompletionRejects;
|
|
467
433
|
private _shells;
|
|
468
434
|
private _closedShellIds;
|
|
435
|
+
private _closedShellErrors;
|
|
469
436
|
private _pendingShellExitPromises;
|
|
470
437
|
private _shellCounter;
|
|
471
|
-
private _acpTerminals;
|
|
472
|
-
private _acpTerminalCounter;
|
|
473
438
|
private _softwareRoots;
|
|
439
|
+
private readonly _installedSoftware;
|
|
440
|
+
private _vmMutationActive;
|
|
474
441
|
private _cronManager;
|
|
475
442
|
private _hostFunctions;
|
|
476
443
|
private _hostFunctionReference;
|
|
@@ -482,8 +449,7 @@ export declare class AgentOs {
|
|
|
482
449
|
private readonly _sidecarSession;
|
|
483
450
|
private readonly _sidecarVm;
|
|
484
451
|
private readonly _disposeSidecarEventListener;
|
|
485
|
-
private readonly
|
|
486
|
-
private readonly _agentExitHandler?;
|
|
452
|
+
private readonly _disposeSidecarCloseListener;
|
|
487
453
|
private readonly _limitWarningHandler?;
|
|
488
454
|
private readonly _disposeHooks;
|
|
489
455
|
/**
|
|
@@ -508,9 +474,7 @@ export declare class AgentOs {
|
|
|
508
474
|
cols: number;
|
|
509
475
|
rows: number;
|
|
510
476
|
}) => Promise<void>;
|
|
511
|
-
readOutput: (pid: number, options?:
|
|
512
|
-
after?: number;
|
|
513
|
-
}) => Promise<OutputReplay>;
|
|
477
|
+
readOutput: (pid: number, options?: ReplayReadOptions) => Promise<OutputReplay>;
|
|
514
478
|
};
|
|
515
479
|
readonly javascript: {
|
|
516
480
|
execute: (source: string, options?: JavaScriptExecutionOptions) => Promise<CodeExecutionResult>;
|
|
@@ -597,24 +561,9 @@ export declare class AgentOs {
|
|
|
597
561
|
commands: string[];
|
|
598
562
|
}[]>;
|
|
599
563
|
link: (descriptor: PackageDescriptor) => Promise<void>;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
};
|
|
604
|
-
readonly sessions: {
|
|
605
|
-
open: (input: OpenSessionInput) => Promise<void>;
|
|
606
|
-
get: (input?: SessionTarget) => Promise<DurableSessionInfo>;
|
|
607
|
-
list: (input?: ListSessionsInput) => Promise<SessionPage>;
|
|
608
|
-
delete: (input?: SessionTarget) => Promise<void>;
|
|
609
|
-
unload: (input?: SessionTarget) => Promise<void>;
|
|
610
|
-
prompt: (input: PromptInput) => Promise<DurablePromptResult>;
|
|
611
|
-
cancelPrompt: (input?: SessionTarget) => Promise<CancelPromptResult>;
|
|
612
|
-
respondPermission: (input: PermissionResponse) => Promise<PermissionResponseResult>;
|
|
613
|
-
readHistory: (input?: ReadHistoryInput) => Promise<HistoryPage>;
|
|
614
|
-
getConfig: (input?: SessionTarget) => Promise<SessionConfig>;
|
|
615
|
-
setConfigOption: (input: SetSessionConfigOptionInput) => Promise<SessionConfig>;
|
|
616
|
-
getCapabilities: (input?: SessionTarget) => Promise<SessionCapabilities | null>;
|
|
617
|
-
getAgentInfo: (input?: SessionTarget) => Promise<SessionAgentInfo | null>;
|
|
564
|
+
install: (source: SoftwarePackageSource) => Promise<InstalledSoftware>;
|
|
565
|
+
uninstall: (packageId: string) => Promise<InstalledSoftware>;
|
|
566
|
+
installed: () => InstalledSoftware[];
|
|
618
567
|
};
|
|
619
568
|
readonly cron: {
|
|
620
569
|
schedule: (options: CronJobOptions) => CronJob;
|
|
@@ -624,7 +573,9 @@ export declare class AgentOs {
|
|
|
624
573
|
private constructor();
|
|
625
574
|
static createSidecar(options?: AgentOsCreateSidecarOptions): Promise<AgentOsSidecar>;
|
|
626
575
|
static getSharedSidecar(options?: AgentOsSharedSidecarOptions): Promise<AgentOsSidecar>;
|
|
627
|
-
static create
|
|
576
|
+
static create(options?: AgentOsOptions,
|
|
577
|
+
/** @internal Product wrappers select a sidecar-owned default profile here. */
|
|
578
|
+
defaultsProfile?: NonNullable<CreateVmConfig["defaultsProfile"]>): Promise<AgentOs>;
|
|
628
579
|
createContext(contextId: string): Promise<void>;
|
|
629
580
|
private _executionOperation;
|
|
630
581
|
private _spawnLanguageOperation;
|
|
@@ -671,8 +622,13 @@ export declare class AgentOs {
|
|
|
671
622
|
private _resizeExecutionPty;
|
|
672
623
|
private _readExecutionOutput;
|
|
673
624
|
private _onExecutionOutput;
|
|
625
|
+
/** A completion signal that rejects if the sidecar exits before it resolves. */
|
|
626
|
+
private _pendingCompletion;
|
|
674
627
|
private _onExecutionCompleted;
|
|
675
628
|
private _trackProcess;
|
|
629
|
+
private _recordProcessExit;
|
|
630
|
+
private _reserveProcessRegistrySlot;
|
|
631
|
+
private _pruneExitedProcesses;
|
|
676
632
|
private _spawnProcess;
|
|
677
633
|
spawn(command: string, args?: string[], options?: SpawnOptions): Promise<ProcessDescriptor>;
|
|
678
634
|
/** Write data to a process's stdin. */
|
|
@@ -753,8 +709,8 @@ export declare class AgentOs {
|
|
|
753
709
|
httpRequest(request: HttpRequest): Promise<HttpResponse>;
|
|
754
710
|
/**
|
|
755
711
|
* Fetch an HTTP endpoint inside the VM while preserving duplicate response
|
|
756
|
-
* headers and arbitrary binary bodies.
|
|
757
|
-
*
|
|
712
|
+
* headers and arbitrary binary bodies. This compatibility surface supports
|
|
713
|
+
* fetch-like callers that proxy requests into a guest VM.
|
|
758
714
|
*/
|
|
759
715
|
fetch(port: number, request: Request): Promise<Response>;
|
|
760
716
|
fetchStreamStart(port: number, request: Request): Promise<{
|
|
@@ -818,62 +774,12 @@ export declare class AgentOs {
|
|
|
818
774
|
private _killProcess;
|
|
819
775
|
private _resizeProcessPty;
|
|
820
776
|
private _readProcessOutput;
|
|
821
|
-
private
|
|
822
|
-
private _getSession;
|
|
823
|
-
private _listSessions;
|
|
824
|
-
private _deleteSession;
|
|
825
|
-
private _unloadSession;
|
|
826
|
-
private _prompt;
|
|
827
|
-
private _cancelPrompt;
|
|
828
|
-
private _respondPermission;
|
|
829
|
-
private _readHistory;
|
|
830
|
-
private _getSessionConfig;
|
|
831
|
-
private _setSessionConfigOption;
|
|
832
|
-
private _getSessionCapabilities;
|
|
833
|
-
private _getSessionAgentInfo;
|
|
834
|
-
/** @deprecated Use `sessions.open()`. */
|
|
835
|
-
openSession(input: OpenSessionInput): Promise<void>;
|
|
836
|
-
/** @deprecated Use `sessions.get()`. */
|
|
837
|
-
getSession(input?: SessionTarget): Promise<DurableSessionInfo>;
|
|
838
|
-
/** @deprecated Use `sessions.list()`. */
|
|
839
|
-
listSessions(input?: ListSessionsInput): Promise<SessionPage>;
|
|
840
|
-
/** @deprecated Use `sessions.delete()`. */
|
|
841
|
-
deleteSession(input?: SessionTarget): Promise<void>;
|
|
842
|
-
/** @deprecated Use `sessions.unload()`. */
|
|
843
|
-
unloadSession(input?: SessionTarget): Promise<void>;
|
|
844
|
-
/** @deprecated Use `sessions.prompt()`. */
|
|
845
|
-
prompt(input: PromptInput): Promise<DurablePromptResult>;
|
|
846
|
-
/** @deprecated Use `sessions.cancelPrompt()`. */
|
|
847
|
-
cancelPrompt(input?: SessionTarget): Promise<CancelPromptResult>;
|
|
848
|
-
/** @deprecated Use `sessions.respondPermission()`. */
|
|
849
|
-
respondPermission(input: PermissionResponse): Promise<PermissionResponseResult>;
|
|
850
|
-
/** @deprecated Use `sessions.readHistory()`. */
|
|
851
|
-
readHistory(input?: ReadHistoryInput): Promise<HistoryPage>;
|
|
852
|
-
/** @deprecated Use `sessions.getConfig()`. */
|
|
853
|
-
getSessionConfig(input?: SessionTarget): Promise<SessionConfig>;
|
|
854
|
-
/** @deprecated Use `sessions.setConfigOption()`. */
|
|
855
|
-
setSessionConfigOption(input: SetSessionConfigOptionInput): Promise<SessionConfig>;
|
|
856
|
-
/** @deprecated Use `sessions.getCapabilities()`. */
|
|
857
|
-
getSessionCapabilities(input?: SessionTarget): Promise<SessionCapabilities | null>;
|
|
858
|
-
/** @deprecated Use `sessions.getAgentInfo()`. */
|
|
859
|
-
getSessionAgentInfo(input?: SessionTarget): Promise<SessionAgentInfo | null>;
|
|
860
|
-
/**
|
|
861
|
-
* Dynamically link a software package into the RUNNING VM. The package's
|
|
862
|
-
* `bin/` commands appear under `/opt/agentos/bin` (on `$PATH`) and its `share/man`
|
|
863
|
-
* pages under MANPATH immediately — the `/opt/agentos` mount is host-backed, so
|
|
864
|
-
* writing into its staging dir is reflected live with no reboot. An `agent`
|
|
865
|
-
* block registers the package for `openSession({ agent: name })`. Persists for the VM's
|
|
866
|
-
* lifetime (and across a snapshot iff the volume persists).
|
|
867
|
-
*/
|
|
777
|
+
private _withVmMutation;
|
|
868
778
|
private _linkSoftware;
|
|
779
|
+
private _installSoftware;
|
|
780
|
+
private _uninstallSoftware;
|
|
781
|
+
private _installedSoftwareList;
|
|
869
782
|
private _listSoftware;
|
|
870
|
-
/**
|
|
871
|
-
* Returns all registered agents with their installation status. Thin forwarder:
|
|
872
|
-
* sends `AcpListAgentsRequest` and maps the response. The sidecar enumerates the
|
|
873
|
-
* projected `/opt/agentos` packages (the client parses no manifests). Every such
|
|
874
|
-
* agent is a package materialized into the VM, so `installed` is always `true`.
|
|
875
|
-
*/
|
|
876
|
-
private _listAgents;
|
|
877
783
|
/** @deprecated Use `software.link()`. */
|
|
878
784
|
linkSoftware(descriptor: PackageDescriptor): Promise<void>;
|
|
879
785
|
/** @deprecated Use `software.list()`. */
|
|
@@ -881,42 +787,9 @@ export declare class AgentOs {
|
|
|
881
787
|
packageName: string;
|
|
882
788
|
commands: string[];
|
|
883
789
|
}[]>;
|
|
884
|
-
/** @deprecated Use `agents.list()`. */
|
|
885
|
-
listAgents(): Promise<AgentRegistryEntry[]>;
|
|
886
|
-
private _recordAgentStderr;
|
|
887
|
-
private _recordAgentExit;
|
|
888
790
|
private _handleSidecarEvent;
|
|
889
791
|
private _handleLimitWarning;
|
|
890
|
-
private _handleAcpExtEvent;
|
|
891
|
-
private _emitDurableSessionEvent;
|
|
892
|
-
private _sendAcpRequest;
|
|
893
792
|
private _installSidecarRequestHandler;
|
|
894
|
-
private _handleAcpExtSidecarRequest;
|
|
895
|
-
private _dispatchAcpSidecarRequest;
|
|
896
|
-
private _handleSupportedAcpSidecarRequest;
|
|
897
|
-
private _acpParams;
|
|
898
|
-
private _requireAcpStringParam;
|
|
899
|
-
private _optionalAcpStringParam;
|
|
900
|
-
private _optionalAcpNumberParam;
|
|
901
|
-
private _optionalAcpStringArrayParam;
|
|
902
|
-
private _optionalAcpEnvParam;
|
|
903
|
-
private _requireAcpTerminal;
|
|
904
|
-
private _appendAcpTerminalOutput;
|
|
905
|
-
private _handleAcpReadFile;
|
|
906
|
-
private _handleAcpWriteFile;
|
|
907
|
-
private _handleAcpReadDir;
|
|
908
|
-
private _handleAcpCreateTerminal;
|
|
909
|
-
private _handleAcpWriteTerminal;
|
|
910
|
-
private _handleAcpReadTerminal;
|
|
911
|
-
private _handleAcpWaitForTerminalExit;
|
|
912
|
-
private _handleAcpKillTerminal;
|
|
913
|
-
private _handleAcpReleaseTerminal;
|
|
914
|
-
private _handleAcpResizeTerminal;
|
|
915
|
-
onSessionEvent(handler: (entry: SessionStreamEntry) => void): () => void;
|
|
916
|
-
onSessionEvent(sessionId: string | undefined, handler: (entry: SessionStreamEntry) => void): () => void;
|
|
917
|
-
/** Subscribe to unexpected adapter exits without changing session liveness. */
|
|
918
|
-
onAgentExit(handler: AgentExitHandler): () => void;
|
|
919
|
-
onAgentExit(sessionId: string | undefined, handler: AgentExitHandler): () => void;
|
|
920
793
|
/** Schedule a cron job. Returns a handle with the job ID and a cancel method. */
|
|
921
794
|
private _scheduleCron;
|
|
922
795
|
/** List all registered cron jobs. */
|