@rivet-dev/agentos-runtime-core 0.0.0-main.ab2ce7c
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 +7 -0
- package/commands/[ +0 -0
- package/commands/_stubs +0 -0
- package/commands/arch +0 -0
- package/commands/awk +0 -0
- package/commands/b2sum +0 -0
- package/commands/base32 +0 -0
- package/commands/base64 +0 -0
- package/commands/basename +0 -0
- package/commands/basenc +0 -0
- package/commands/bash +0 -0
- package/commands/cat +0 -0
- package/commands/chcon +0 -0
- package/commands/chgrp +0 -0
- package/commands/chmod +0 -0
- package/commands/chown +0 -0
- package/commands/chroot +0 -0
- package/commands/cksum +0 -0
- package/commands/codex +0 -0
- package/commands/codex-exec +0 -0
- package/commands/column +0 -0
- package/commands/comm +0 -0
- package/commands/cp +0 -0
- package/commands/curl +0 -0
- package/commands/cut +0 -0
- package/commands/date +0 -0
- package/commands/dd +0 -0
- package/commands/df +0 -0
- package/commands/diff +0 -0
- package/commands/dir +0 -0
- package/commands/dircolors +0 -0
- package/commands/dirname +0 -0
- package/commands/du +0 -0
- package/commands/echo +0 -0
- package/commands/egrep +0 -0
- package/commands/env +0 -0
- package/commands/envsubst +0 -0
- package/commands/expand +0 -0
- package/commands/expr +0 -0
- package/commands/factor +0 -0
- package/commands/false +0 -0
- package/commands/fd +0 -0
- package/commands/fgrep +0 -0
- package/commands/file +0 -0
- package/commands/find +0 -0
- package/commands/fmt +0 -0
- package/commands/fold +0 -0
- package/commands/git +0 -0
- package/commands/git-remote-http +0 -0
- package/commands/git-remote-https +0 -0
- package/commands/grep +0 -0
- package/commands/groups +0 -0
- package/commands/gunzip +0 -0
- package/commands/gzip +0 -0
- package/commands/head +0 -0
- package/commands/hostid +0 -0
- package/commands/hostname +0 -0
- package/commands/http-test +0 -0
- package/commands/http_get +0 -0
- package/commands/id +0 -0
- package/commands/install +0 -0
- package/commands/join +0 -0
- package/commands/jq +0 -0
- package/commands/kill +0 -0
- package/commands/link +0 -0
- package/commands/ln +0 -0
- package/commands/logname +0 -0
- package/commands/ls +0 -0
- package/commands/md5sum +0 -0
- package/commands/mkdir +0 -0
- package/commands/mkfifo +0 -0
- package/commands/mknod +0 -0
- package/commands/mktemp +0 -0
- package/commands/more +0 -0
- package/commands/mv +0 -0
- package/commands/nice +0 -0
- package/commands/nl +0 -0
- package/commands/nohup +0 -0
- package/commands/nproc +0 -0
- package/commands/numfmt +0 -0
- package/commands/od +0 -0
- package/commands/paste +0 -0
- package/commands/pathchk +0 -0
- package/commands/pinky +0 -0
- package/commands/printenv +0 -0
- package/commands/printf +0 -0
- package/commands/ptx +0 -0
- package/commands/pwd +0 -0
- package/commands/readlink +0 -0
- package/commands/realpath +0 -0
- package/commands/rev +0 -0
- package/commands/rg +0 -0
- package/commands/rm +0 -0
- package/commands/rmdir +0 -0
- package/commands/runcon +0 -0
- package/commands/sed +0 -0
- package/commands/seq +0 -0
- package/commands/sh +0 -0
- package/commands/sha1sum +0 -0
- package/commands/sha224sum +0 -0
- package/commands/sha256sum +0 -0
- package/commands/sha384sum +0 -0
- package/commands/sha512sum +0 -0
- package/commands/shred +0 -0
- package/commands/shuf +0 -0
- package/commands/sleep +0 -0
- package/commands/sort +0 -0
- package/commands/spawn-test-host +0 -0
- package/commands/split +0 -0
- package/commands/sqlite3 +0 -0
- package/commands/stat +0 -0
- package/commands/stdbuf +0 -0
- package/commands/strings +0 -0
- package/commands/stty +0 -0
- package/commands/sum +0 -0
- package/commands/sync +0 -0
- package/commands/tac +0 -0
- package/commands/tail +0 -0
- package/commands/tar +0 -0
- package/commands/tee +0 -0
- package/commands/test +0 -0
- package/commands/timeout +0 -0
- package/commands/touch +0 -0
- package/commands/tr +0 -0
- package/commands/tree +0 -0
- package/commands/true +0 -0
- package/commands/truncate +0 -0
- package/commands/tsort +0 -0
- package/commands/tty +0 -0
- package/commands/uname +0 -0
- package/commands/unexpand +0 -0
- package/commands/uniq +0 -0
- package/commands/unlink +0 -0
- package/commands/unzip +0 -0
- package/commands/uptime +0 -0
- package/commands/users +0 -0
- package/commands/vdir +0 -0
- package/commands/wc +0 -0
- package/commands/which +0 -0
- package/commands/who +0 -0
- package/commands/whoami +0 -0
- package/commands/xargs +0 -0
- package/commands/xu +0 -0
- package/commands/yes +0 -0
- package/commands/yq +0 -0
- package/commands/zcat +0 -0
- package/commands/zip +0 -0
- package/dist/binary.d.ts +4 -0
- package/dist/binary.js +25 -0
- package/dist/bytes.d.ts +2 -0
- package/dist/bytes.js +6 -0
- package/dist/callbacks.d.ts +41 -0
- package/dist/callbacks.js +94 -0
- package/dist/cargo.d.ts +2 -0
- package/dist/cargo.js +142 -0
- package/dist/correlation.d.ts +10 -0
- package/dist/correlation.js +49 -0
- package/dist/descriptors.d.ts +84 -0
- package/dist/descriptors.js +60 -0
- package/dist/event-buffer.d.ts +90 -0
- package/dist/event-buffer.js +313 -0
- package/dist/ext.d.ts +7 -0
- package/dist/ext.js +13 -0
- package/dist/filesystem.d.ts +41 -0
- package/dist/filesystem.js +70 -0
- package/dist/frame-payload-codec.d.ts +8 -0
- package/dist/frame-payload-codec.js +14 -0
- package/dist/frame-rpc.d.ts +40 -0
- package/dist/frame-rpc.js +81 -0
- package/dist/frame-stream.d.ts +34 -0
- package/dist/frame-stream.js +109 -0
- package/dist/framing.d.ts +8 -0
- package/dist/framing.js +23 -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/generated-protocol.d.ts +1196 -0
- package/dist/generated-protocol.js +3286 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +28 -0
- package/dist/json.d.ts +2 -0
- package/dist/json.js +20 -0
- package/dist/kernel-proxy.d.ts +166 -0
- package/dist/kernel-proxy.js +1777 -0
- package/dist/native-client.d.ts +42 -0
- package/dist/native-client.js +126 -0
- package/dist/node-runtime-options-schema.d.ts +117 -0
- package/dist/node-runtime-options-schema.js +121 -0
- package/dist/node-runtime.d.ts +593 -0
- package/dist/node-runtime.js +914 -0
- package/dist/numbers.d.ts +1 -0
- package/dist/numbers.js +8 -0
- package/dist/ownership.d.ts +18 -0
- package/dist/ownership.js +77 -0
- package/dist/permissions.d.ts +29 -0
- package/dist/permissions.js +68 -0
- package/dist/process.d.ts +22 -0
- package/dist/process.js +97 -0
- package/dist/protocol-client.d.ts +48 -0
- package/dist/protocol-client.js +181 -0
- package/dist/protocol-frames.d.ts +68 -0
- package/dist/protocol-frames.js +139 -0
- package/dist/protocol-maps.d.ts +31 -0
- package/dist/protocol-maps.js +273 -0
- package/dist/protocol-schema.d.ts +10 -0
- package/dist/protocol-schema.js +11 -0
- package/dist/request-payloads.d.ts +171 -0
- package/dist/request-payloads.js +269 -0
- package/dist/response-payloads.d.ts +186 -0
- package/dist/response-payloads.js +250 -0
- package/dist/sidecar-client.d.ts +17 -0
- package/dist/sidecar-client.js +1 -0
- package/dist/sidecar-errors.d.ts +15 -0
- package/dist/sidecar-errors.js +30 -0
- package/dist/sidecar-process.d.ts +356 -0
- package/dist/sidecar-process.js +1008 -0
- package/dist/state.d.ts +40 -0
- package/dist/state.js +44 -0
- package/dist/test-runtime.d.ts +563 -0
- package/dist/test-runtime.js +2171 -0
- package/dist/vm-config.d.ts +31 -0
- package/dist/vm-config.js +1 -0
- package/package.json +204 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { fromGeneratedRootFilesystemEntry, } from "./filesystem.js";
|
|
2
|
+
import { fromGeneratedExtEnvelope } from "./ext.js";
|
|
3
|
+
import { bigIntToSafeNumber } from "./numbers.js";
|
|
4
|
+
import { fromGeneratedFilesystemOperation, fromGeneratedGuestFilesystemOperation, fromGeneratedRootFilesystemEntryEncoding, fromGeneratedSignalDispositionAction, } from "./protocol-maps.js";
|
|
5
|
+
import { fromGeneratedGuestFilesystemStat, fromGeneratedProcessSnapshotEntry, fromGeneratedSocketStateEntry, } from "./state.js";
|
|
6
|
+
export function fromGeneratedResponsePayload(payload) {
|
|
7
|
+
switch (payload.tag) {
|
|
8
|
+
case "AuthenticatedResponse":
|
|
9
|
+
return {
|
|
10
|
+
type: "authenticated",
|
|
11
|
+
sidecar_id: payload.val.sidecarId,
|
|
12
|
+
connection_id: payload.val.connectionId,
|
|
13
|
+
max_frame_bytes: payload.val.maxFrameBytes,
|
|
14
|
+
};
|
|
15
|
+
case "SessionOpenedResponse":
|
|
16
|
+
return {
|
|
17
|
+
type: "session_opened",
|
|
18
|
+
session_id: payload.val.sessionId,
|
|
19
|
+
owner_connection_id: payload.val.ownerConnectionId,
|
|
20
|
+
};
|
|
21
|
+
case "VmCreatedResponse":
|
|
22
|
+
return { type: "vm_created", vm_id: payload.val.vmId };
|
|
23
|
+
case "VmDisposedResponse":
|
|
24
|
+
return { type: "vm_disposed", vm_id: payload.val.vmId };
|
|
25
|
+
case "RootFilesystemBootstrappedResponse":
|
|
26
|
+
return {
|
|
27
|
+
type: "root_filesystem_bootstrapped",
|
|
28
|
+
entry_count: payload.val.entryCount,
|
|
29
|
+
};
|
|
30
|
+
case "VmConfiguredResponse":
|
|
31
|
+
return {
|
|
32
|
+
type: "vm_configured",
|
|
33
|
+
applied_mounts: payload.val.appliedMounts,
|
|
34
|
+
applied_software: payload.val.appliedSoftware,
|
|
35
|
+
projected_commands: payload.val.projectedCommands.map((command) => ({
|
|
36
|
+
name: command.name,
|
|
37
|
+
guest_path: command.guestPath,
|
|
38
|
+
})),
|
|
39
|
+
agents: payload.val.agents.map(fromGeneratedAgentosProjectedAgent),
|
|
40
|
+
};
|
|
41
|
+
case "PackageLinkedResponse":
|
|
42
|
+
return {
|
|
43
|
+
type: "package_linked",
|
|
44
|
+
projected_commands: payload.val.projectedCommands.map((command) => ({
|
|
45
|
+
name: command.name,
|
|
46
|
+
guest_path: command.guestPath,
|
|
47
|
+
})),
|
|
48
|
+
agents: payload.val.agents.map(fromGeneratedAgentosProjectedAgent),
|
|
49
|
+
};
|
|
50
|
+
case "ProvidedCommandsResponse":
|
|
51
|
+
return {
|
|
52
|
+
type: "provided_commands_response",
|
|
53
|
+
packages: payload.val.packages.map((pkg) => ({
|
|
54
|
+
package_name: pkg.packageName,
|
|
55
|
+
commands: [...pkg.commands],
|
|
56
|
+
})),
|
|
57
|
+
};
|
|
58
|
+
case "HostCallbacksRegisteredResponse":
|
|
59
|
+
return {
|
|
60
|
+
type: "host_callbacks_registered",
|
|
61
|
+
registration: payload.val.registration,
|
|
62
|
+
command_count: payload.val.commandCount,
|
|
63
|
+
};
|
|
64
|
+
case "LayerCreatedResponse":
|
|
65
|
+
return { type: "layer_created", layer_id: payload.val.layerId };
|
|
66
|
+
case "LayerSealedResponse":
|
|
67
|
+
return { type: "layer_sealed", layer_id: payload.val.layerId };
|
|
68
|
+
case "SnapshotImportedResponse":
|
|
69
|
+
return { type: "snapshot_imported", layer_id: payload.val.layerId };
|
|
70
|
+
case "SnapshotExportedResponse":
|
|
71
|
+
return {
|
|
72
|
+
type: "snapshot_exported",
|
|
73
|
+
layer_id: payload.val.layerId,
|
|
74
|
+
entries: payload.val.entries.map(fromGeneratedRootFilesystemEntry),
|
|
75
|
+
};
|
|
76
|
+
case "OverlayCreatedResponse":
|
|
77
|
+
return { type: "overlay_created", layer_id: payload.val.layerId };
|
|
78
|
+
case "GuestFilesystemResultResponse":
|
|
79
|
+
return {
|
|
80
|
+
type: "guest_filesystem_result",
|
|
81
|
+
operation: fromGeneratedGuestFilesystemOperation(payload.val.operation),
|
|
82
|
+
path: payload.val.path,
|
|
83
|
+
...(payload.val.content !== null
|
|
84
|
+
? { content: payload.val.content }
|
|
85
|
+
: {}),
|
|
86
|
+
...(payload.val.encoding !== null
|
|
87
|
+
? {
|
|
88
|
+
encoding: fromGeneratedRootFilesystemEntryEncoding(payload.val.encoding),
|
|
89
|
+
}
|
|
90
|
+
: {}),
|
|
91
|
+
...(payload.val.entries !== null
|
|
92
|
+
? {
|
|
93
|
+
entries: payload.val.entries.map((entry) => ({
|
|
94
|
+
name: entry.name,
|
|
95
|
+
path: entry.path,
|
|
96
|
+
isDirectory: entry.isDirectory,
|
|
97
|
+
isSymbolicLink: entry.isSymbolicLink,
|
|
98
|
+
size: bigIntToSafeNumber(entry.size, "guest dir entry size"),
|
|
99
|
+
})),
|
|
100
|
+
}
|
|
101
|
+
: {}),
|
|
102
|
+
...(payload.val.stat !== null
|
|
103
|
+
? { stat: fromGeneratedGuestFilesystemStat(payload.val.stat) }
|
|
104
|
+
: {}),
|
|
105
|
+
...(payload.val.exists !== null ? { exists: payload.val.exists } : {}),
|
|
106
|
+
...(payload.val.target !== null ? { target: payload.val.target } : {}),
|
|
107
|
+
};
|
|
108
|
+
case "GuestKernelResultResponse":
|
|
109
|
+
return {
|
|
110
|
+
type: "guest_kernel_result",
|
|
111
|
+
payload: payload.val.payload,
|
|
112
|
+
};
|
|
113
|
+
case "RootFilesystemSnapshotResponse":
|
|
114
|
+
return {
|
|
115
|
+
type: "root_filesystem_snapshot",
|
|
116
|
+
entries: payload.val.entries.map(fromGeneratedRootFilesystemEntry),
|
|
117
|
+
};
|
|
118
|
+
case "ProcessStartedResponse":
|
|
119
|
+
return {
|
|
120
|
+
type: "process_started",
|
|
121
|
+
process_id: payload.val.processId,
|
|
122
|
+
...(payload.val.pid !== null ? { pid: payload.val.pid } : {}),
|
|
123
|
+
};
|
|
124
|
+
case "StdinWrittenResponse":
|
|
125
|
+
return {
|
|
126
|
+
type: "stdin_written",
|
|
127
|
+
process_id: payload.val.processId,
|
|
128
|
+
accepted_bytes: bigIntToSafeNumber(payload.val.acceptedBytes, "stdin_written.accepted_bytes"),
|
|
129
|
+
};
|
|
130
|
+
case "PtyResizedResponse":
|
|
131
|
+
return {
|
|
132
|
+
type: "pty_resized",
|
|
133
|
+
process_id: payload.val.processId,
|
|
134
|
+
cols: payload.val.cols,
|
|
135
|
+
rows: payload.val.rows,
|
|
136
|
+
};
|
|
137
|
+
case "StdinClosedResponse":
|
|
138
|
+
return { type: "stdin_closed", process_id: payload.val.processId };
|
|
139
|
+
case "ProcessKilledResponse":
|
|
140
|
+
return { type: "process_killed", process_id: payload.val.processId };
|
|
141
|
+
case "ProcessSnapshotResponse":
|
|
142
|
+
return {
|
|
143
|
+
type: "process_snapshot",
|
|
144
|
+
processes: payload.val.processes.map(fromGeneratedProcessSnapshotEntry),
|
|
145
|
+
};
|
|
146
|
+
case "ResourceSnapshotResponse":
|
|
147
|
+
return {
|
|
148
|
+
type: "resource_snapshot",
|
|
149
|
+
running_processes: bigIntToSafeNumber(payload.val.runningProcesses, "resource_snapshot.running_processes"),
|
|
150
|
+
exited_processes: bigIntToSafeNumber(payload.val.exitedProcesses, "resource_snapshot.exited_processes"),
|
|
151
|
+
fd_tables: bigIntToSafeNumber(payload.val.fdTables, "resource_snapshot.fd_tables"),
|
|
152
|
+
open_fds: bigIntToSafeNumber(payload.val.openFds, "resource_snapshot.open_fds"),
|
|
153
|
+
pipes: bigIntToSafeNumber(payload.val.pipes, "resource_snapshot.pipes"),
|
|
154
|
+
pipe_buffered_bytes: bigIntToSafeNumber(payload.val.pipeBufferedBytes, "resource_snapshot.pipe_buffered_bytes"),
|
|
155
|
+
ptys: bigIntToSafeNumber(payload.val.ptys, "resource_snapshot.ptys"),
|
|
156
|
+
pty_buffered_input_bytes: bigIntToSafeNumber(payload.val.ptyBufferedInputBytes, "resource_snapshot.pty_buffered_input_bytes"),
|
|
157
|
+
pty_buffered_output_bytes: bigIntToSafeNumber(payload.val.ptyBufferedOutputBytes, "resource_snapshot.pty_buffered_output_bytes"),
|
|
158
|
+
sockets: bigIntToSafeNumber(payload.val.sockets, "resource_snapshot.sockets"),
|
|
159
|
+
socket_listeners: bigIntToSafeNumber(payload.val.socketListeners, "resource_snapshot.socket_listeners"),
|
|
160
|
+
socket_connections: bigIntToSafeNumber(payload.val.socketConnections, "resource_snapshot.socket_connections"),
|
|
161
|
+
socket_buffered_bytes: bigIntToSafeNumber(payload.val.socketBufferedBytes, "resource_snapshot.socket_buffered_bytes"),
|
|
162
|
+
socket_datagram_queue_len: bigIntToSafeNumber(payload.val.socketDatagramQueueLen, "resource_snapshot.socket_datagram_queue_len"),
|
|
163
|
+
queue_snapshots: payload.val.queueSnapshots.map((queue) => ({
|
|
164
|
+
name: queue.name,
|
|
165
|
+
category: queue.category,
|
|
166
|
+
depth: bigIntToSafeNumber(queue.depth, "resource_snapshot.queue.depth"),
|
|
167
|
+
high_water: bigIntToSafeNumber(queue.highWater, "resource_snapshot.queue.high_water"),
|
|
168
|
+
capacity: bigIntToSafeNumber(queue.capacity, "resource_snapshot.queue.capacity"),
|
|
169
|
+
fill_percent: bigIntToSafeNumber(queue.fillPercent, "resource_snapshot.queue.fill_percent"),
|
|
170
|
+
})),
|
|
171
|
+
};
|
|
172
|
+
case "ListenerSnapshotResponse":
|
|
173
|
+
return {
|
|
174
|
+
type: "listener_snapshot",
|
|
175
|
+
...(payload.val.listener !== null
|
|
176
|
+
? { listener: fromGeneratedSocketStateEntry(payload.val.listener) }
|
|
177
|
+
: {}),
|
|
178
|
+
};
|
|
179
|
+
case "BoundUdpSnapshotResponse":
|
|
180
|
+
return {
|
|
181
|
+
type: "bound_udp_snapshot",
|
|
182
|
+
...(payload.val.socket !== null
|
|
183
|
+
? { socket: fromGeneratedSocketStateEntry(payload.val.socket) }
|
|
184
|
+
: {}),
|
|
185
|
+
};
|
|
186
|
+
case "SignalStateResponse":
|
|
187
|
+
return {
|
|
188
|
+
type: "signal_state",
|
|
189
|
+
process_id: payload.val.processId,
|
|
190
|
+
handlers: Object.fromEntries([...payload.val.handlers].map(([signal, registration]) => [
|
|
191
|
+
String(signal),
|
|
192
|
+
{
|
|
193
|
+
action: fromGeneratedSignalDispositionAction(registration.action),
|
|
194
|
+
mask: Array.from(registration.mask),
|
|
195
|
+
flags: registration.flags,
|
|
196
|
+
},
|
|
197
|
+
])),
|
|
198
|
+
};
|
|
199
|
+
case "ZombieTimerCountResponse":
|
|
200
|
+
return {
|
|
201
|
+
type: "zombie_timer_count",
|
|
202
|
+
count: bigIntToSafeNumber(payload.val.count, "zombie_timer_count.count"),
|
|
203
|
+
};
|
|
204
|
+
case "FilesystemResultResponse":
|
|
205
|
+
return {
|
|
206
|
+
type: "filesystem_result",
|
|
207
|
+
operation: fromGeneratedFilesystemOperation(payload.val.operation),
|
|
208
|
+
status: payload.val.status,
|
|
209
|
+
payload_size_bytes: bigIntToSafeNumber(payload.val.payloadSizeBytes, "filesystem_result.payload_size_bytes"),
|
|
210
|
+
};
|
|
211
|
+
case "PermissionDecisionResponse":
|
|
212
|
+
throw new Error("unsupported bare response payload tag: permission_decision");
|
|
213
|
+
case "PersistenceStateResponse":
|
|
214
|
+
return {
|
|
215
|
+
type: "persistence_state",
|
|
216
|
+
key: payload.val.key,
|
|
217
|
+
found: payload.val.found,
|
|
218
|
+
payload_size_bytes: bigIntToSafeNumber(payload.val.payloadSizeBytes, "persistence_state.payload_size_bytes"),
|
|
219
|
+
};
|
|
220
|
+
case "PersistenceFlushedResponse":
|
|
221
|
+
return {
|
|
222
|
+
type: "persistence_flushed",
|
|
223
|
+
key: payload.val.key,
|
|
224
|
+
committed_bytes: bigIntToSafeNumber(payload.val.committedBytes, "persistence_flushed.committed_bytes"),
|
|
225
|
+
};
|
|
226
|
+
case "RejectedResponse":
|
|
227
|
+
return {
|
|
228
|
+
type: "rejected",
|
|
229
|
+
code: payload.val.code,
|
|
230
|
+
message: payload.val.message,
|
|
231
|
+
};
|
|
232
|
+
case "VmFetchResponse":
|
|
233
|
+
return {
|
|
234
|
+
type: "vm_fetch_result",
|
|
235
|
+
response_json: payload.val.responseJson,
|
|
236
|
+
};
|
|
237
|
+
case "ExtEnvelope":
|
|
238
|
+
return {
|
|
239
|
+
type: "ext_result",
|
|
240
|
+
envelope: fromGeneratedExtEnvelope(payload.val),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function fromGeneratedAgentosProjectedAgent(agent) {
|
|
245
|
+
return {
|
|
246
|
+
id: agent.id,
|
|
247
|
+
acp_entrypoint: agent.acpEntrypoint,
|
|
248
|
+
adapter_entrypoint: agent.adapterEntrypoint,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { LiveSidecarEventSelector } from "./event-buffer.js";
|
|
2
|
+
import type { LiveOwnershipScope } from "./ownership.js";
|
|
3
|
+
import type { LiveEventFrame, LiveResponseFrame, LiveSidecarRequestHandler } from "./protocol-frames.js";
|
|
4
|
+
import type { LiveRequestPayload } from "./request-payloads.js";
|
|
5
|
+
export interface SidecarProcessTransport {
|
|
6
|
+
setSidecarRequestHandler(handler: LiveSidecarRequestHandler | null): void;
|
|
7
|
+
onEvent(handler: (event: LiveEventFrame) => void): () => void;
|
|
8
|
+
sendRequest(input: {
|
|
9
|
+
ownership: LiveOwnershipScope;
|
|
10
|
+
payload: LiveRequestPayload;
|
|
11
|
+
}): Promise<LiveResponseFrame>;
|
|
12
|
+
waitForEvent(matcher: LiveSidecarEventSelector | ((event: LiveEventFrame) => boolean), timeoutMs?: number, options?: {
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}): Promise<LiveEventFrame>;
|
|
15
|
+
failPermanently(error: Error): void;
|
|
16
|
+
dispose(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class SidecarProcessExited extends Error {
|
|
2
|
+
readonly exitCode: number | null;
|
|
3
|
+
readonly signal: string | null;
|
|
4
|
+
readonly stderr: string;
|
|
5
|
+
constructor(options: {
|
|
6
|
+
exitCode: number | null;
|
|
7
|
+
signal: string | null;
|
|
8
|
+
stderr: string;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export declare class SidecarProcessError extends Error {
|
|
12
|
+
readonly childError: Error;
|
|
13
|
+
readonly stderr: string;
|
|
14
|
+
constructor(error: Error, stderr: string);
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function formatSidecarStderrSuffix(stderr) {
|
|
2
|
+
return stderr ? `\nstderr:\n${stderr}` : "";
|
|
3
|
+
}
|
|
4
|
+
export class SidecarProcessExited extends Error {
|
|
5
|
+
exitCode;
|
|
6
|
+
signal;
|
|
7
|
+
stderr;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
const reason = options.signal !== null
|
|
10
|
+
? `signal ${options.signal}`
|
|
11
|
+
: options.exitCode !== null
|
|
12
|
+
? `code ${options.exitCode}`
|
|
13
|
+
: "disconnect";
|
|
14
|
+
super(`sidecar process exited with ${reason}${formatSidecarStderrSuffix(options.stderr)}`);
|
|
15
|
+
this.name = "SidecarProcessExited";
|
|
16
|
+
this.exitCode = options.exitCode;
|
|
17
|
+
this.signal = options.signal;
|
|
18
|
+
this.stderr = options.stderr;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class SidecarProcessError extends Error {
|
|
22
|
+
childError;
|
|
23
|
+
stderr;
|
|
24
|
+
constructor(error, stderr) {
|
|
25
|
+
super(`sidecar process error: ${error.message}${formatSidecarStderrSuffix(stderr)}`);
|
|
26
|
+
this.name = "SidecarProcessError";
|
|
27
|
+
this.childError = error;
|
|
28
|
+
this.stderr = stderr;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { type LiveSidecarRequestPayload, type LiveSidecarResponsePayload } from "./callbacks.js";
|
|
2
|
+
import type { MountConfigJsonObject } from "./descriptors.js";
|
|
3
|
+
import { type LiveSidecarEventSelector } from "./event-buffer.js";
|
|
4
|
+
import { type LiveRootFilesystemEntry } from "./filesystem.js";
|
|
5
|
+
import type { CreateVmConfig } from "./generated/CreateVmConfig.js";
|
|
6
|
+
import type { SidecarProcessTransport } from "./sidecar-client.js";
|
|
7
|
+
import { type LiveFsPermissionRule, type LivePatternPermissionRule, type LivePermissionMode, type LivePermissionScope, type LiveRulePermissions } from "./permissions.js";
|
|
8
|
+
import type { LiveFilesystemOperation, LiveGuestRuntimeKind, LiveWasmPermissionTier } from "./protocol-maps.js";
|
|
9
|
+
import { type LiveEventFrame, type LiveSidecarRequestHandler, type LiveSidecarRequestFrame, type LiveSidecarResponseFrame, type ProtocolFramePayloadCodec } from "./protocol-frames.js";
|
|
10
|
+
import type { LiveGuestDirEntry } from "./response-payloads.js";
|
|
11
|
+
import { type LiveGuestFilesystemStat } from "./state.js";
|
|
12
|
+
export { SidecarProcessError, SidecarProcessExited, } from "./sidecar-errors.js";
|
|
13
|
+
export { SidecarEventBufferOverflow } from "./event-buffer.js";
|
|
14
|
+
export { SidecarProcess as Sidecar };
|
|
15
|
+
export declare const NATIVE_SIDECAR_FRAME_TIMEOUT_MS = 120000;
|
|
16
|
+
type GuestRuntimeKind = Extract<LiveGuestRuntimeKind, "java_script" | "python" | "web_assembly">;
|
|
17
|
+
type WasmPermissionTier = LiveWasmPermissionTier;
|
|
18
|
+
export interface RootFilesystemEntry extends LiveRootFilesystemEntry {
|
|
19
|
+
}
|
|
20
|
+
export interface RootFilesystemLowerDescriptor {
|
|
21
|
+
kind: "snapshot" | "bundled_base_filesystem";
|
|
22
|
+
entries?: RootFilesystemEntry[];
|
|
23
|
+
}
|
|
24
|
+
export interface GuestFilesystemStat extends LiveGuestFilesystemStat {
|
|
25
|
+
}
|
|
26
|
+
export interface SidecarSocketStateEntry {
|
|
27
|
+
processId: string;
|
|
28
|
+
host?: string;
|
|
29
|
+
port?: number;
|
|
30
|
+
path?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface SidecarSignalHandlerRegistration {
|
|
33
|
+
action: "default" | "ignore" | "user";
|
|
34
|
+
mask: number[];
|
|
35
|
+
flags: number;
|
|
36
|
+
}
|
|
37
|
+
export interface SidecarSignalState {
|
|
38
|
+
processId: string;
|
|
39
|
+
handlers: Map<number, SidecarSignalHandlerRegistration>;
|
|
40
|
+
}
|
|
41
|
+
export interface SidecarProcessSnapshotEntry {
|
|
42
|
+
processId: string;
|
|
43
|
+
pid: number;
|
|
44
|
+
ppid: number;
|
|
45
|
+
pgid: number;
|
|
46
|
+
sid: number;
|
|
47
|
+
driver: string;
|
|
48
|
+
command: string;
|
|
49
|
+
args: string[];
|
|
50
|
+
cwd: string;
|
|
51
|
+
status: "running" | "exited" | "stopped";
|
|
52
|
+
exitCode: number | null;
|
|
53
|
+
}
|
|
54
|
+
export interface SidecarQueueSnapshotEntry {
|
|
55
|
+
name: string;
|
|
56
|
+
category: string;
|
|
57
|
+
depth: number;
|
|
58
|
+
highWater: number;
|
|
59
|
+
capacity: number;
|
|
60
|
+
fillPercent: number;
|
|
61
|
+
}
|
|
62
|
+
export interface SidecarResourceSnapshot {
|
|
63
|
+
runningProcesses: number;
|
|
64
|
+
exitedProcesses: number;
|
|
65
|
+
fdTables: number;
|
|
66
|
+
openFds: number;
|
|
67
|
+
pipes: number;
|
|
68
|
+
pipeBufferedBytes: number;
|
|
69
|
+
ptys: number;
|
|
70
|
+
ptyBufferedInputBytes: number;
|
|
71
|
+
ptyBufferedOutputBytes: number;
|
|
72
|
+
sockets: number;
|
|
73
|
+
socketListeners: number;
|
|
74
|
+
socketConnections: number;
|
|
75
|
+
socketBufferedBytes: number;
|
|
76
|
+
socketDatagramQueueLen: number;
|
|
77
|
+
queueSnapshots: SidecarQueueSnapshotEntry[];
|
|
78
|
+
}
|
|
79
|
+
export interface SidecarZombieTimerCount {
|
|
80
|
+
count: number;
|
|
81
|
+
}
|
|
82
|
+
export interface SidecarRegisteredHostCallbackExample {
|
|
83
|
+
description: string;
|
|
84
|
+
input: unknown;
|
|
85
|
+
}
|
|
86
|
+
export interface SidecarRegisteredHostCallbackDefinition {
|
|
87
|
+
description: string;
|
|
88
|
+
inputSchema: unknown;
|
|
89
|
+
timeoutMs?: number;
|
|
90
|
+
examples?: SidecarRegisteredHostCallbackExample[];
|
|
91
|
+
}
|
|
92
|
+
export interface ExtEnvelope {
|
|
93
|
+
namespace: string;
|
|
94
|
+
payload: Uint8Array;
|
|
95
|
+
}
|
|
96
|
+
export type SidecarRequestPayload = LiveSidecarRequestPayload;
|
|
97
|
+
export type SidecarResponsePayload = LiveSidecarResponsePayload;
|
|
98
|
+
type EventFrame = LiveEventFrame;
|
|
99
|
+
export type SidecarEventSelector = LiveSidecarEventSelector;
|
|
100
|
+
export type SidecarRequestFrame = LiveSidecarRequestFrame;
|
|
101
|
+
export type SidecarResponseFrame = LiveSidecarResponseFrame;
|
|
102
|
+
type NativeTransportPayloadCodec = ProtocolFramePayloadCodec;
|
|
103
|
+
export type SidecarRequestHandler = LiveSidecarRequestHandler;
|
|
104
|
+
export interface SidecarSpawnOptions {
|
|
105
|
+
cwd?: string;
|
|
106
|
+
command?: string;
|
|
107
|
+
args?: string[];
|
|
108
|
+
frameTimeoutMs?: number;
|
|
109
|
+
eventBufferCapacity?: number;
|
|
110
|
+
payloadCodec?: NativeTransportPayloadCodec;
|
|
111
|
+
}
|
|
112
|
+
export interface ResolvedSidecarSpawnOptions {
|
|
113
|
+
cwd?: string;
|
|
114
|
+
command?: string;
|
|
115
|
+
args: string[];
|
|
116
|
+
frameTimeoutMs: number;
|
|
117
|
+
eventBufferCapacity: number;
|
|
118
|
+
gracefulExitMs: number;
|
|
119
|
+
forceExitMs: number;
|
|
120
|
+
disposedErrorMessage: string;
|
|
121
|
+
payloadCodec: NativeTransportPayloadCodec;
|
|
122
|
+
}
|
|
123
|
+
type SidecarProcessSpawnFactory = (options: ResolvedSidecarSpawnOptions) => SidecarProcessTransport;
|
|
124
|
+
export declare function registerSidecarProcessSpawnFactory(factory: SidecarProcessSpawnFactory): void;
|
|
125
|
+
export interface AuthenticatedSession {
|
|
126
|
+
connectionId: string;
|
|
127
|
+
sessionId: string;
|
|
128
|
+
}
|
|
129
|
+
export interface CreatedVm {
|
|
130
|
+
vmId: string;
|
|
131
|
+
}
|
|
132
|
+
export interface SidecarSessionState {
|
|
133
|
+
sessionId: string;
|
|
134
|
+
agentType: string;
|
|
135
|
+
processId: string;
|
|
136
|
+
pid?: number;
|
|
137
|
+
closed: boolean;
|
|
138
|
+
modes?: unknown;
|
|
139
|
+
configOptions: unknown[];
|
|
140
|
+
agentCapabilities?: unknown;
|
|
141
|
+
agentInfo?: unknown;
|
|
142
|
+
}
|
|
143
|
+
export interface SidecarMountPluginDescriptor {
|
|
144
|
+
id: string;
|
|
145
|
+
config?: MountConfigJsonObject;
|
|
146
|
+
}
|
|
147
|
+
export interface SidecarMountDescriptor {
|
|
148
|
+
guestPath: string;
|
|
149
|
+
readOnly: boolean;
|
|
150
|
+
plugin: SidecarMountPluginDescriptor;
|
|
151
|
+
}
|
|
152
|
+
export interface SidecarSoftwareDescriptor {
|
|
153
|
+
packageName: string;
|
|
154
|
+
root: string;
|
|
155
|
+
}
|
|
156
|
+
export type SidecarPermissionMode = LivePermissionMode;
|
|
157
|
+
export interface SidecarFsPermissionRule extends LiveFsPermissionRule {
|
|
158
|
+
}
|
|
159
|
+
export interface SidecarPatternPermissionRule extends LivePatternPermissionRule {
|
|
160
|
+
}
|
|
161
|
+
export interface SidecarRulePermissions<TRule> extends LiveRulePermissions<TRule> {
|
|
162
|
+
}
|
|
163
|
+
export type SidecarPermissionScope<TRule> = LivePermissionScope<TRule>;
|
|
164
|
+
export interface SidecarPermissionsPolicy {
|
|
165
|
+
fs?: SidecarPermissionScope<SidecarFsPermissionRule>;
|
|
166
|
+
network?: SidecarPermissionScope<SidecarPatternPermissionRule>;
|
|
167
|
+
childProcess?: SidecarPermissionScope<SidecarPatternPermissionRule>;
|
|
168
|
+
process?: SidecarPermissionScope<SidecarPatternPermissionRule>;
|
|
169
|
+
env?: SidecarPermissionScope<SidecarPatternPermissionRule>;
|
|
170
|
+
binding?: SidecarPermissionScope<SidecarPatternPermissionRule>;
|
|
171
|
+
}
|
|
172
|
+
export interface SidecarProjectedModuleDescriptor {
|
|
173
|
+
packageName: string;
|
|
174
|
+
entrypoint: string;
|
|
175
|
+
}
|
|
176
|
+
export interface SidecarPackageDescriptor {
|
|
177
|
+
path: string;
|
|
178
|
+
}
|
|
179
|
+
export interface SidecarProjectedAgent {
|
|
180
|
+
id: string;
|
|
181
|
+
acpEntrypoint: string;
|
|
182
|
+
adapterEntrypoint: string;
|
|
183
|
+
}
|
|
184
|
+
export interface SidecarLinkPackageResult {
|
|
185
|
+
projectedCommands: SidecarProjectedCommand[];
|
|
186
|
+
agents: SidecarProjectedAgent[];
|
|
187
|
+
}
|
|
188
|
+
export interface SidecarProjectedCommand {
|
|
189
|
+
name: string;
|
|
190
|
+
guestPath: string;
|
|
191
|
+
}
|
|
192
|
+
export interface SidecarPackageCommands {
|
|
193
|
+
packageName: string;
|
|
194
|
+
commands: string[];
|
|
195
|
+
}
|
|
196
|
+
export interface SidecarVmConfiguredResponse {
|
|
197
|
+
appliedMounts: number;
|
|
198
|
+
appliedSoftware: number;
|
|
199
|
+
projectedCommands: SidecarProjectedCommand[];
|
|
200
|
+
agents: SidecarProjectedAgent[];
|
|
201
|
+
}
|
|
202
|
+
export interface SidecarFilesystemResult {
|
|
203
|
+
operation: LiveFilesystemOperation;
|
|
204
|
+
status: string;
|
|
205
|
+
payloadSizeBytes: number;
|
|
206
|
+
}
|
|
207
|
+
export interface SidecarPersistenceState {
|
|
208
|
+
key: string;
|
|
209
|
+
found: boolean;
|
|
210
|
+
payloadSizeBytes: number;
|
|
211
|
+
}
|
|
212
|
+
export interface SidecarPersistenceFlushed {
|
|
213
|
+
key: string;
|
|
214
|
+
committedBytes: number;
|
|
215
|
+
}
|
|
216
|
+
export declare class SidecarProcess {
|
|
217
|
+
private readonly protocolClient;
|
|
218
|
+
private constructor();
|
|
219
|
+
static fromClient(protocolClient: SidecarProcessTransport): SidecarProcess;
|
|
220
|
+
static spawn(options?: SidecarSpawnOptions): SidecarProcess;
|
|
221
|
+
setSidecarRequestHandler(handler: SidecarRequestHandler | null): void;
|
|
222
|
+
onEvent(handler: (event: EventFrame) => void): () => void;
|
|
223
|
+
authenticateAndOpenSession(sessionMetadata?: Record<string, string>): Promise<AuthenticatedSession>;
|
|
224
|
+
createVm(session: AuthenticatedSession, options: {
|
|
225
|
+
runtime: GuestRuntimeKind;
|
|
226
|
+
config: CreateVmConfig;
|
|
227
|
+
}): Promise<CreatedVm>;
|
|
228
|
+
extensionRequest(session: AuthenticatedSession, vm: CreatedVm, envelope: ExtEnvelope): Promise<ExtEnvelope>;
|
|
229
|
+
configureVm(session: AuthenticatedSession, vm: CreatedVm, options: {
|
|
230
|
+
mounts?: SidecarMountDescriptor[];
|
|
231
|
+
software?: SidecarSoftwareDescriptor[];
|
|
232
|
+
permissions?: SidecarPermissionsPolicy;
|
|
233
|
+
moduleAccessCwd?: string;
|
|
234
|
+
instructions?: string[];
|
|
235
|
+
projectedModules?: SidecarProjectedModuleDescriptor[];
|
|
236
|
+
commandPermissions?: Record<string, WasmPermissionTier>;
|
|
237
|
+
loopbackExemptPorts?: number[];
|
|
238
|
+
packages?: SidecarPackageDescriptor[];
|
|
239
|
+
packagesMountAt?: string;
|
|
240
|
+
bootstrapCommands?: string[];
|
|
241
|
+
toolShimCommands?: string[];
|
|
242
|
+
}): Promise<SidecarVmConfiguredResponse>;
|
|
243
|
+
/**
|
|
244
|
+
* Runtime dynamic `linkSoftware`: project one package into the live
|
|
245
|
+
* `/opt/agentos` tree. Returns projected command entrypoints and agents.
|
|
246
|
+
*/
|
|
247
|
+
linkPackage(session: AuthenticatedSession, vm: CreatedVm, descriptor: SidecarPackageDescriptor): Promise<SidecarLinkPackageResult>;
|
|
248
|
+
providedCommands(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarPackageCommands[]>;
|
|
249
|
+
registerHostCallbacks(session: AuthenticatedSession, vm: CreatedVm, registration: {
|
|
250
|
+
name: string;
|
|
251
|
+
description: string;
|
|
252
|
+
commandAliases?: string[];
|
|
253
|
+
registryCommandAliases?: string[];
|
|
254
|
+
callbacks: Record<string, SidecarRegisteredHostCallbackDefinition>;
|
|
255
|
+
}): Promise<{
|
|
256
|
+
registration: string;
|
|
257
|
+
commandCount: number;
|
|
258
|
+
}>;
|
|
259
|
+
createLayer(session: AuthenticatedSession, vm: CreatedVm): Promise<string>;
|
|
260
|
+
sealLayer(session: AuthenticatedSession, vm: CreatedVm, layerId: string): Promise<string>;
|
|
261
|
+
importSnapshot(session: AuthenticatedSession, vm: CreatedVm, entries: RootFilesystemEntry[]): Promise<string>;
|
|
262
|
+
exportSnapshot(session: AuthenticatedSession, vm: CreatedVm, layerId: string): Promise<RootFilesystemEntry[]>;
|
|
263
|
+
createOverlay(session: AuthenticatedSession, vm: CreatedVm, options: {
|
|
264
|
+
mode?: "ephemeral" | "read_only";
|
|
265
|
+
upperLayerId?: string;
|
|
266
|
+
lowerLayerIds: string[];
|
|
267
|
+
}): Promise<string>;
|
|
268
|
+
bootstrapRootFilesystem(session: AuthenticatedSession, vm: CreatedVm, entries: RootFilesystemEntry[]): Promise<void>;
|
|
269
|
+
snapshotRootFilesystem(session: AuthenticatedSession, vm: CreatedVm): Promise<RootFilesystemEntry[]>;
|
|
270
|
+
readFile(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<Uint8Array>;
|
|
271
|
+
pread(session: AuthenticatedSession, vm: CreatedVm, path: string, offset: number, length: number): Promise<Uint8Array>;
|
|
272
|
+
writeFile(session: AuthenticatedSession, vm: CreatedVm, path: string, content: string | Uint8Array): Promise<void>;
|
|
273
|
+
mkdir(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
|
|
274
|
+
recursive?: boolean;
|
|
275
|
+
}): Promise<void>;
|
|
276
|
+
readdir(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string[]>;
|
|
277
|
+
readdirRecursive(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
|
|
278
|
+
maxDepth?: number;
|
|
279
|
+
}): Promise<LiveGuestDirEntry[]>;
|
|
280
|
+
exists(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<boolean>;
|
|
281
|
+
stat(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
|
|
282
|
+
dereference?: boolean;
|
|
283
|
+
}): Promise<GuestFilesystemStat>;
|
|
284
|
+
lstat(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<GuestFilesystemStat>;
|
|
285
|
+
rename(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
|
|
286
|
+
realpath(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string>;
|
|
287
|
+
removeFile(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<void>;
|
|
288
|
+
removeDir(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<void>;
|
|
289
|
+
removePath(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
|
|
290
|
+
recursive?: boolean;
|
|
291
|
+
}): Promise<void>;
|
|
292
|
+
copyPath(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string, options?: {
|
|
293
|
+
recursive?: boolean;
|
|
294
|
+
}): Promise<void>;
|
|
295
|
+
movePath(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
|
|
296
|
+
symlink(session: AuthenticatedSession, vm: CreatedVm, target: string, linkPath: string): Promise<void>;
|
|
297
|
+
readLink(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string>;
|
|
298
|
+
link(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
|
|
299
|
+
chmod(session: AuthenticatedSession, vm: CreatedVm, path: string, mode: number): Promise<void>;
|
|
300
|
+
chown(session: AuthenticatedSession, vm: CreatedVm, path: string, uid: number, gid: number): Promise<void>;
|
|
301
|
+
utimes(session: AuthenticatedSession, vm: CreatedVm, path: string, atimeMs: number, mtimeMs: number): Promise<void>;
|
|
302
|
+
truncate(session: AuthenticatedSession, vm: CreatedVm, path: string, length: number): Promise<void>;
|
|
303
|
+
disposeVm(session: AuthenticatedSession, vm: CreatedVm): Promise<void>;
|
|
304
|
+
execute(session: AuthenticatedSession, vm: CreatedVm, options: {
|
|
305
|
+
processId: string;
|
|
306
|
+
command?: string;
|
|
307
|
+
runtime?: GuestRuntimeKind;
|
|
308
|
+
entrypoint?: string;
|
|
309
|
+
args?: string[];
|
|
310
|
+
env?: Record<string, string>;
|
|
311
|
+
cwd?: string;
|
|
312
|
+
wasmPermissionTier?: WasmPermissionTier;
|
|
313
|
+
}): Promise<{
|
|
314
|
+
pid: number | null;
|
|
315
|
+
}>;
|
|
316
|
+
writeStdin(session: AuthenticatedSession, vm: CreatedVm, processId: string, chunk: string | Uint8Array): Promise<void>;
|
|
317
|
+
resizePty(session: AuthenticatedSession, vm: CreatedVm, processId: string, cols: number, rows: number): Promise<void>;
|
|
318
|
+
closeStdin(session: AuthenticatedSession, vm: CreatedVm, processId: string): Promise<void>;
|
|
319
|
+
killProcess(session: AuthenticatedSession, vm: CreatedVm, processId: string, signal?: string): Promise<void>;
|
|
320
|
+
findListener(session: AuthenticatedSession, vm: CreatedVm, request: {
|
|
321
|
+
host?: string;
|
|
322
|
+
port?: number;
|
|
323
|
+
path?: string;
|
|
324
|
+
}): Promise<SidecarSocketStateEntry | null>;
|
|
325
|
+
getProcessSnapshot(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarProcessSnapshotEntry[]>;
|
|
326
|
+
getResourceSnapshot(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarResourceSnapshot>;
|
|
327
|
+
findBoundUdp(session: AuthenticatedSession, vm: CreatedVm, request: {
|
|
328
|
+
host?: string;
|
|
329
|
+
port?: number;
|
|
330
|
+
}): Promise<SidecarSocketStateEntry | null>;
|
|
331
|
+
vmFetch(session: AuthenticatedSession, vm: CreatedVm, request: {
|
|
332
|
+
port: number;
|
|
333
|
+
method: string;
|
|
334
|
+
path: string;
|
|
335
|
+
headersJson: string;
|
|
336
|
+
body?: string;
|
|
337
|
+
}): Promise<string>;
|
|
338
|
+
getSignalState(session: AuthenticatedSession, vm: CreatedVm, processId: string): Promise<SidecarSignalState>;
|
|
339
|
+
getZombieTimerCount(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarZombieTimerCount>;
|
|
340
|
+
hostFilesystemCall(session: AuthenticatedSession, vm: CreatedVm, request: {
|
|
341
|
+
operation: LiveFilesystemOperation;
|
|
342
|
+
path: string;
|
|
343
|
+
payloadSizeBytes: number;
|
|
344
|
+
}): Promise<SidecarFilesystemResult>;
|
|
345
|
+
persistenceLoad(session: AuthenticatedSession, key: string): Promise<SidecarPersistenceState>;
|
|
346
|
+
persistenceFlush(session: AuthenticatedSession, request: {
|
|
347
|
+
key: string;
|
|
348
|
+
payloadSizeBytes: number;
|
|
349
|
+
}): Promise<SidecarPersistenceFlushed>;
|
|
350
|
+
waitForEvent(matcher: SidecarEventSelector | ((event: EventFrame) => boolean), timeoutMs?: number, options?: {
|
|
351
|
+
signal?: AbortSignal;
|
|
352
|
+
}): Promise<EventFrame>;
|
|
353
|
+
dispose(): Promise<void>;
|
|
354
|
+
private sendRequest;
|
|
355
|
+
private guestFilesystemCall;
|
|
356
|
+
}
|