@rivet-dev/agentos-runtime-core 0.0.0-chdir-fix.3d9feab

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.
Files changed (282) hide show
  1. package/README.md +7 -0
  2. package/commands/[ +0 -0
  3. package/commands/_stubs +0 -0
  4. package/commands/arch +0 -0
  5. package/commands/awk +0 -0
  6. package/commands/b2sum +0 -0
  7. package/commands/base32 +0 -0
  8. package/commands/base64 +0 -0
  9. package/commands/basename +0 -0
  10. package/commands/basenc +0 -0
  11. package/commands/bash +0 -0
  12. package/commands/cat +0 -0
  13. package/commands/chcon +0 -0
  14. package/commands/chgrp +0 -0
  15. package/commands/chmod +0 -0
  16. package/commands/chown +0 -0
  17. package/commands/chroot +0 -0
  18. package/commands/cksum +0 -0
  19. package/commands/codex +0 -0
  20. package/commands/codex-exec +0 -0
  21. package/commands/column +0 -0
  22. package/commands/comm +0 -0
  23. package/commands/cp +0 -0
  24. package/commands/curl +0 -0
  25. package/commands/cut +0 -0
  26. package/commands/date +0 -0
  27. package/commands/dd +0 -0
  28. package/commands/df +0 -0
  29. package/commands/diff +0 -0
  30. package/commands/dir +0 -0
  31. package/commands/dircolors +0 -0
  32. package/commands/dirname +0 -0
  33. package/commands/du +0 -0
  34. package/commands/echo +0 -0
  35. package/commands/egrep +0 -0
  36. package/commands/env +0 -0
  37. package/commands/envsubst +0 -0
  38. package/commands/expand +0 -0
  39. package/commands/expr +0 -0
  40. package/commands/factor +0 -0
  41. package/commands/false +0 -0
  42. package/commands/fd +0 -0
  43. package/commands/fgrep +0 -0
  44. package/commands/file +0 -0
  45. package/commands/find +0 -0
  46. package/commands/fmt +0 -0
  47. package/commands/fold +0 -0
  48. package/commands/git +0 -0
  49. package/commands/git-remote-http +0 -0
  50. package/commands/git-remote-https +0 -0
  51. package/commands/grep +0 -0
  52. package/commands/groups +0 -0
  53. package/commands/gunzip +0 -0
  54. package/commands/gzip +0 -0
  55. package/commands/head +0 -0
  56. package/commands/hostid +0 -0
  57. package/commands/hostname +0 -0
  58. package/commands/http-test +0 -0
  59. package/commands/http_get +0 -0
  60. package/commands/id +0 -0
  61. package/commands/install +0 -0
  62. package/commands/join +0 -0
  63. package/commands/jq +0 -0
  64. package/commands/kill +0 -0
  65. package/commands/link +0 -0
  66. package/commands/ln +0 -0
  67. package/commands/logname +0 -0
  68. package/commands/ls +0 -0
  69. package/commands/md5sum +0 -0
  70. package/commands/mkdir +0 -0
  71. package/commands/mkfifo +0 -0
  72. package/commands/mknod +0 -0
  73. package/commands/mktemp +0 -0
  74. package/commands/more +0 -0
  75. package/commands/mv +0 -0
  76. package/commands/nice +0 -0
  77. package/commands/nl +0 -0
  78. package/commands/nohup +0 -0
  79. package/commands/nproc +0 -0
  80. package/commands/numfmt +0 -0
  81. package/commands/od +0 -0
  82. package/commands/paste +0 -0
  83. package/commands/pathchk +0 -0
  84. package/commands/pinky +0 -0
  85. package/commands/printenv +0 -0
  86. package/commands/printf +0 -0
  87. package/commands/ptx +0 -0
  88. package/commands/pwd +0 -0
  89. package/commands/readlink +0 -0
  90. package/commands/realpath +0 -0
  91. package/commands/rev +0 -0
  92. package/commands/rg +0 -0
  93. package/commands/rm +0 -0
  94. package/commands/rmdir +0 -0
  95. package/commands/runcon +0 -0
  96. package/commands/sed +0 -0
  97. package/commands/seq +0 -0
  98. package/commands/sh +0 -0
  99. package/commands/sha1sum +0 -0
  100. package/commands/sha224sum +0 -0
  101. package/commands/sha256sum +0 -0
  102. package/commands/sha384sum +0 -0
  103. package/commands/sha512sum +0 -0
  104. package/commands/shred +0 -0
  105. package/commands/shuf +0 -0
  106. package/commands/sleep +0 -0
  107. package/commands/sort +0 -0
  108. package/commands/spawn-test-host +0 -0
  109. package/commands/split +0 -0
  110. package/commands/sqlite3 +0 -0
  111. package/commands/stat +0 -0
  112. package/commands/stdbuf +0 -0
  113. package/commands/strings +0 -0
  114. package/commands/stty +0 -0
  115. package/commands/sum +0 -0
  116. package/commands/sync +0 -0
  117. package/commands/tac +0 -0
  118. package/commands/tail +0 -0
  119. package/commands/tar +0 -0
  120. package/commands/tee +0 -0
  121. package/commands/test +0 -0
  122. package/commands/timeout +0 -0
  123. package/commands/touch +0 -0
  124. package/commands/tr +0 -0
  125. package/commands/tree +0 -0
  126. package/commands/true +0 -0
  127. package/commands/truncate +0 -0
  128. package/commands/tsort +0 -0
  129. package/commands/tty +0 -0
  130. package/commands/uname +0 -0
  131. package/commands/unexpand +0 -0
  132. package/commands/uniq +0 -0
  133. package/commands/unlink +0 -0
  134. package/commands/unzip +0 -0
  135. package/commands/uptime +0 -0
  136. package/commands/users +0 -0
  137. package/commands/vdir +0 -0
  138. package/commands/wc +0 -0
  139. package/commands/which +0 -0
  140. package/commands/who +0 -0
  141. package/commands/whoami +0 -0
  142. package/commands/xargs +0 -0
  143. package/commands/xu +0 -0
  144. package/commands/yes +0 -0
  145. package/commands/yq +0 -0
  146. package/commands/zcat +0 -0
  147. package/commands/zip +0 -0
  148. package/dist/binary.d.ts +4 -0
  149. package/dist/binary.js +25 -0
  150. package/dist/bytes.d.ts +2 -0
  151. package/dist/bytes.js +6 -0
  152. package/dist/callbacks.d.ts +41 -0
  153. package/dist/callbacks.js +94 -0
  154. package/dist/cargo.d.ts +2 -0
  155. package/dist/cargo.js +142 -0
  156. package/dist/correlation.d.ts +7 -0
  157. package/dist/correlation.js +46 -0
  158. package/dist/descriptors.d.ts +84 -0
  159. package/dist/descriptors.js +60 -0
  160. package/dist/event-buffer.d.ts +90 -0
  161. package/dist/event-buffer.js +313 -0
  162. package/dist/ext.d.ts +7 -0
  163. package/dist/ext.js +13 -0
  164. package/dist/filesystem.d.ts +41 -0
  165. package/dist/filesystem.js +70 -0
  166. package/dist/frame-payload-codec.d.ts +8 -0
  167. package/dist/frame-payload-codec.js +14 -0
  168. package/dist/frame-rpc.d.ts +45 -0
  169. package/dist/frame-rpc.js +98 -0
  170. package/dist/frame-stream.d.ts +34 -0
  171. package/dist/frame-stream.js +109 -0
  172. package/dist/framing.d.ts +8 -0
  173. package/dist/framing.js +23 -0
  174. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  175. package/dist/generated/AcpLimitsConfig.js +2 -0
  176. package/dist/generated/CreateVmConfig.d.ts +26 -0
  177. package/dist/generated/CreateVmConfig.js +1 -0
  178. package/dist/generated/FsPermissionRule.d.ts +6 -0
  179. package/dist/generated/FsPermissionRule.js +1 -0
  180. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  181. package/dist/generated/FsPermissionRuleSet.js +1 -0
  182. package/dist/generated/FsPermissionScope.d.ts +3 -0
  183. package/dist/generated/FsPermissionScope.js +1 -0
  184. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  185. package/dist/generated/HttpLimitsConfig.js +2 -0
  186. package/dist/generated/JsModuleResolution.d.ts +1 -0
  187. package/dist/generated/JsModuleResolution.js +2 -0
  188. package/dist/generated/JsRuntimeConfig.d.ts +31 -0
  189. package/dist/generated/JsRuntimeConfig.js +1 -0
  190. package/dist/generated/JsRuntimeLimitsConfig.d.ts +11 -0
  191. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  192. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  193. package/dist/generated/JsRuntimePlatform.js +2 -0
  194. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  195. package/dist/generated/MountPluginDescriptor.js +2 -0
  196. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  197. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  198. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  199. package/dist/generated/PatternPermissionRule.js +1 -0
  200. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  201. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  202. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  203. package/dist/generated/PatternPermissionScope.js +1 -0
  204. package/dist/generated/PermissionMode.d.ts +1 -0
  205. package/dist/generated/PermissionMode.js +2 -0
  206. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  207. package/dist/generated/PermissionsPolicy.js +1 -0
  208. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  209. package/dist/generated/PluginLimitsConfig.js +2 -0
  210. package/dist/generated/PythonLimitsConfig.d.ts +6 -0
  211. package/dist/generated/PythonLimitsConfig.js +2 -0
  212. package/dist/generated/ResourceLimitsConfig.d.ts +24 -0
  213. package/dist/generated/ResourceLimitsConfig.js +2 -0
  214. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  215. package/dist/generated/RootFilesystemConfig.js +1 -0
  216. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  217. package/dist/generated/RootFilesystemEntry.js +1 -0
  218. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  219. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  220. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  221. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  222. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  223. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  224. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  225. package/dist/generated/RootFilesystemMode.js +2 -0
  226. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  227. package/dist/generated/ToolLimitsConfig.js +2 -0
  228. package/dist/generated/VmDnsConfig.d.ts +6 -0
  229. package/dist/generated/VmDnsConfig.js +2 -0
  230. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  231. package/dist/generated/VmLimitsConfig.js +1 -0
  232. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  233. package/dist/generated/VmListenPolicyConfig.js +2 -0
  234. package/dist/generated/WasmLimitsConfig.d.ts +7 -0
  235. package/dist/generated/WasmLimitsConfig.js +2 -0
  236. package/dist/generated-protocol.d.ts +1196 -0
  237. package/dist/generated-protocol.js +3286 -0
  238. package/dist/index.d.ts +29 -0
  239. package/dist/index.js +28 -0
  240. package/dist/json.d.ts +2 -0
  241. package/dist/json.js +20 -0
  242. package/dist/kernel-proxy.d.ts +166 -0
  243. package/dist/kernel-proxy.js +1787 -0
  244. package/dist/native-client.d.ts +46 -0
  245. package/dist/native-client.js +136 -0
  246. package/dist/node-runtime-options-schema.d.ts +117 -0
  247. package/dist/node-runtime-options-schema.js +121 -0
  248. package/dist/node-runtime.d.ts +593 -0
  249. package/dist/node-runtime.js +914 -0
  250. package/dist/numbers.d.ts +1 -0
  251. package/dist/numbers.js +8 -0
  252. package/dist/ownership.d.ts +18 -0
  253. package/dist/ownership.js +77 -0
  254. package/dist/permissions.d.ts +29 -0
  255. package/dist/permissions.js +68 -0
  256. package/dist/process.d.ts +22 -0
  257. package/dist/process.js +97 -0
  258. package/dist/protocol-client.d.ts +65 -0
  259. package/dist/protocol-client.js +242 -0
  260. package/dist/protocol-frames.d.ts +68 -0
  261. package/dist/protocol-frames.js +139 -0
  262. package/dist/protocol-maps.d.ts +31 -0
  263. package/dist/protocol-maps.js +273 -0
  264. package/dist/protocol-schema.d.ts +10 -0
  265. package/dist/protocol-schema.js +11 -0
  266. package/dist/request-payloads.d.ts +171 -0
  267. package/dist/request-payloads.js +269 -0
  268. package/dist/response-payloads.d.ts +186 -0
  269. package/dist/response-payloads.js +250 -0
  270. package/dist/sidecar-client.d.ts +17 -0
  271. package/dist/sidecar-client.js +1 -0
  272. package/dist/sidecar-errors.d.ts +30 -0
  273. package/dist/sidecar-errors.js +47 -0
  274. package/dist/sidecar-process.d.ts +360 -0
  275. package/dist/sidecar-process.js +1007 -0
  276. package/dist/state.d.ts +40 -0
  277. package/dist/state.js +43 -0
  278. package/dist/test-runtime.d.ts +566 -0
  279. package/dist/test-runtime.js +2170 -0
  280. package/dist/vm-config.d.ts +31 -0
  281. package/dist/vm-config.js +1 -0
  282. package/package.json +204 -0
@@ -0,0 +1,360 @@
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, SidecarSilenceTimeout, } from "./sidecar-errors.js";
13
+ export { SidecarEventBufferOverflow } from "./event-buffer.js";
14
+ export { SidecarProcess as Sidecar };
15
+ type GuestRuntimeKind = Extract<LiveGuestRuntimeKind, "java_script" | "python" | "web_assembly">;
16
+ type WasmPermissionTier = LiveWasmPermissionTier;
17
+ export interface RootFilesystemEntry extends LiveRootFilesystemEntry {
18
+ }
19
+ export interface RootFilesystemLowerDescriptor {
20
+ kind: "snapshot" | "bundled_base_filesystem";
21
+ entries?: RootFilesystemEntry[];
22
+ }
23
+ export interface GuestFilesystemStat extends LiveGuestFilesystemStat {
24
+ }
25
+ export interface SidecarSocketStateEntry {
26
+ processId: string;
27
+ host?: string;
28
+ port?: number;
29
+ path?: string;
30
+ }
31
+ export interface SidecarSignalHandlerRegistration {
32
+ action: "default" | "ignore" | "user";
33
+ mask: number[];
34
+ flags: number;
35
+ }
36
+ export interface SidecarSignalState {
37
+ processId: string;
38
+ handlers: Map<number, SidecarSignalHandlerRegistration>;
39
+ }
40
+ export interface SidecarProcessSnapshotEntry {
41
+ processId: string;
42
+ pid: number;
43
+ ppid: number;
44
+ pgid: number;
45
+ sid: number;
46
+ driver: string;
47
+ command: string;
48
+ args: string[];
49
+ cwd: string;
50
+ status: "running" | "exited" | "stopped";
51
+ exitCode: number | null;
52
+ }
53
+ export interface SidecarQueueSnapshotEntry {
54
+ name: string;
55
+ category: string;
56
+ depth: number;
57
+ highWater: number;
58
+ capacity: number;
59
+ fillPercent: number;
60
+ }
61
+ export interface SidecarResourceSnapshot {
62
+ runningProcesses: number;
63
+ exitedProcesses: number;
64
+ fdTables: number;
65
+ openFds: number;
66
+ pipes: number;
67
+ pipeBufferedBytes: number;
68
+ ptys: number;
69
+ ptyBufferedInputBytes: number;
70
+ ptyBufferedOutputBytes: number;
71
+ sockets: number;
72
+ socketListeners: number;
73
+ socketConnections: number;
74
+ socketBufferedBytes: number;
75
+ socketDatagramQueueLen: number;
76
+ queueSnapshots: SidecarQueueSnapshotEntry[];
77
+ }
78
+ export interface SidecarZombieTimerCount {
79
+ count: number;
80
+ }
81
+ export interface SidecarRegisteredHostCallbackExample {
82
+ description: string;
83
+ input: unknown;
84
+ }
85
+ export interface SidecarRegisteredHostCallbackDefinition {
86
+ description: string;
87
+ inputSchema: unknown;
88
+ timeoutMs?: number;
89
+ examples?: SidecarRegisteredHostCallbackExample[];
90
+ }
91
+ export interface ExtEnvelope {
92
+ namespace: string;
93
+ payload: Uint8Array;
94
+ }
95
+ export type SidecarRequestPayload = LiveSidecarRequestPayload;
96
+ export type SidecarResponsePayload = LiveSidecarResponsePayload;
97
+ type EventFrame = LiveEventFrame;
98
+ export type SidecarEventSelector = LiveSidecarEventSelector;
99
+ export type SidecarRequestFrame = LiveSidecarRequestFrame;
100
+ export type SidecarResponseFrame = LiveSidecarResponseFrame;
101
+ type NativeTransportPayloadCodec = ProtocolFramePayloadCodec;
102
+ export type SidecarRequestHandler = LiveSidecarRequestHandler;
103
+ export interface SidecarSpawnOptions {
104
+ cwd?: string;
105
+ command?: string;
106
+ args?: string[];
107
+ eventBufferCapacity?: number;
108
+ payloadCodec?: NativeTransportPayloadCodec;
109
+ /**
110
+ * Override the sidecar silence watchdog window (default 30s). Tests only —
111
+ * it is a fixed protocol constant paired with the sidecar's 10s heartbeat
112
+ * cadence, not an operator tunable.
113
+ */
114
+ silenceTimeoutMs?: number;
115
+ }
116
+ export interface ResolvedSidecarSpawnOptions {
117
+ cwd?: string;
118
+ command?: string;
119
+ args: string[];
120
+ eventBufferCapacity: number;
121
+ gracefulExitMs: number;
122
+ forceExitMs: number;
123
+ disposedErrorMessage: string;
124
+ payloadCodec: NativeTransportPayloadCodec;
125
+ silenceTimeoutMs?: number;
126
+ }
127
+ type SidecarProcessSpawnFactory = (options: ResolvedSidecarSpawnOptions) => SidecarProcessTransport;
128
+ export declare function registerSidecarProcessSpawnFactory(factory: SidecarProcessSpawnFactory): void;
129
+ export interface AuthenticatedSession {
130
+ connectionId: string;
131
+ sessionId: string;
132
+ }
133
+ export interface CreatedVm {
134
+ vmId: string;
135
+ }
136
+ export interface SidecarSessionState {
137
+ sessionId: string;
138
+ agentType: string;
139
+ processId: string;
140
+ pid?: number;
141
+ closed: boolean;
142
+ modes?: unknown;
143
+ configOptions: unknown[];
144
+ agentCapabilities?: unknown;
145
+ agentInfo?: unknown;
146
+ }
147
+ export interface SidecarMountPluginDescriptor {
148
+ id: string;
149
+ config?: MountConfigJsonObject;
150
+ }
151
+ export interface SidecarMountDescriptor {
152
+ guestPath: string;
153
+ readOnly: boolean;
154
+ plugin: SidecarMountPluginDescriptor;
155
+ }
156
+ export interface SidecarSoftwareDescriptor {
157
+ packageName: string;
158
+ root: string;
159
+ }
160
+ export type SidecarPermissionMode = LivePermissionMode;
161
+ export interface SidecarFsPermissionRule extends LiveFsPermissionRule {
162
+ }
163
+ export interface SidecarPatternPermissionRule extends LivePatternPermissionRule {
164
+ }
165
+ export interface SidecarRulePermissions<TRule> extends LiveRulePermissions<TRule> {
166
+ }
167
+ export type SidecarPermissionScope<TRule> = LivePermissionScope<TRule>;
168
+ export interface SidecarPermissionsPolicy {
169
+ fs?: SidecarPermissionScope<SidecarFsPermissionRule>;
170
+ network?: SidecarPermissionScope<SidecarPatternPermissionRule>;
171
+ childProcess?: SidecarPermissionScope<SidecarPatternPermissionRule>;
172
+ process?: SidecarPermissionScope<SidecarPatternPermissionRule>;
173
+ env?: SidecarPermissionScope<SidecarPatternPermissionRule>;
174
+ binding?: SidecarPermissionScope<SidecarPatternPermissionRule>;
175
+ }
176
+ export interface SidecarProjectedModuleDescriptor {
177
+ packageName: string;
178
+ entrypoint: string;
179
+ }
180
+ export interface SidecarPackageDescriptor {
181
+ path: string;
182
+ }
183
+ export interface SidecarProjectedAgent {
184
+ id: string;
185
+ acpEntrypoint: string;
186
+ adapterEntrypoint: string;
187
+ }
188
+ export interface SidecarLinkPackageResult {
189
+ projectedCommands: SidecarProjectedCommand[];
190
+ agents: SidecarProjectedAgent[];
191
+ }
192
+ export interface SidecarProjectedCommand {
193
+ name: string;
194
+ guestPath: string;
195
+ }
196
+ export interface SidecarPackageCommands {
197
+ packageName: string;
198
+ commands: string[];
199
+ }
200
+ export interface SidecarVmConfiguredResponse {
201
+ appliedMounts: number;
202
+ appliedSoftware: number;
203
+ projectedCommands: SidecarProjectedCommand[];
204
+ agents: SidecarProjectedAgent[];
205
+ }
206
+ export interface SidecarFilesystemResult {
207
+ operation: LiveFilesystemOperation;
208
+ status: string;
209
+ payloadSizeBytes: number;
210
+ }
211
+ export interface SidecarPersistenceState {
212
+ key: string;
213
+ found: boolean;
214
+ payloadSizeBytes: number;
215
+ }
216
+ export interface SidecarPersistenceFlushed {
217
+ key: string;
218
+ committedBytes: number;
219
+ }
220
+ export declare class SidecarProcess {
221
+ private readonly protocolClient;
222
+ private constructor();
223
+ static fromClient(protocolClient: SidecarProcessTransport): SidecarProcess;
224
+ static spawn(options?: SidecarSpawnOptions): SidecarProcess;
225
+ setSidecarRequestHandler(handler: SidecarRequestHandler | null): void;
226
+ onEvent(handler: (event: EventFrame) => void): () => void;
227
+ authenticateAndOpenSession(sessionMetadata?: Record<string, string>): Promise<AuthenticatedSession>;
228
+ createVm(session: AuthenticatedSession, options: {
229
+ runtime: GuestRuntimeKind;
230
+ config: CreateVmConfig;
231
+ }): Promise<CreatedVm>;
232
+ extensionRequest(session: AuthenticatedSession, vm: CreatedVm, envelope: ExtEnvelope): Promise<ExtEnvelope>;
233
+ configureVm(session: AuthenticatedSession, vm: CreatedVm, options: {
234
+ mounts?: SidecarMountDescriptor[];
235
+ software?: SidecarSoftwareDescriptor[];
236
+ permissions?: SidecarPermissionsPolicy;
237
+ moduleAccessCwd?: string;
238
+ instructions?: string[];
239
+ projectedModules?: SidecarProjectedModuleDescriptor[];
240
+ commandPermissions?: Record<string, WasmPermissionTier>;
241
+ loopbackExemptPorts?: number[];
242
+ packages?: SidecarPackageDescriptor[];
243
+ packagesMountAt?: string;
244
+ bootstrapCommands?: string[];
245
+ toolShimCommands?: string[];
246
+ }): Promise<SidecarVmConfiguredResponse>;
247
+ /**
248
+ * Runtime dynamic `linkSoftware`: project one package into the live
249
+ * `/opt/agentos` tree. Returns projected command entrypoints and agents.
250
+ */
251
+ linkPackage(session: AuthenticatedSession, vm: CreatedVm, descriptor: SidecarPackageDescriptor): Promise<SidecarLinkPackageResult>;
252
+ providedCommands(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarPackageCommands[]>;
253
+ registerHostCallbacks(session: AuthenticatedSession, vm: CreatedVm, registration: {
254
+ name: string;
255
+ description: string;
256
+ commandAliases?: string[];
257
+ registryCommandAliases?: string[];
258
+ callbacks: Record<string, SidecarRegisteredHostCallbackDefinition>;
259
+ }): Promise<{
260
+ registration: string;
261
+ commandCount: number;
262
+ }>;
263
+ createLayer(session: AuthenticatedSession, vm: CreatedVm): Promise<string>;
264
+ sealLayer(session: AuthenticatedSession, vm: CreatedVm, layerId: string): Promise<string>;
265
+ importSnapshot(session: AuthenticatedSession, vm: CreatedVm, entries: RootFilesystemEntry[]): Promise<string>;
266
+ exportSnapshot(session: AuthenticatedSession, vm: CreatedVm, layerId: string): Promise<RootFilesystemEntry[]>;
267
+ createOverlay(session: AuthenticatedSession, vm: CreatedVm, options: {
268
+ mode?: "ephemeral" | "read_only";
269
+ upperLayerId?: string;
270
+ lowerLayerIds: string[];
271
+ }): Promise<string>;
272
+ bootstrapRootFilesystem(session: AuthenticatedSession, vm: CreatedVm, entries: RootFilesystemEntry[]): Promise<void>;
273
+ snapshotRootFilesystem(session: AuthenticatedSession, vm: CreatedVm): Promise<RootFilesystemEntry[]>;
274
+ readFile(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<Uint8Array>;
275
+ pread(session: AuthenticatedSession, vm: CreatedVm, path: string, offset: number, length: number): Promise<Uint8Array>;
276
+ writeFile(session: AuthenticatedSession, vm: CreatedVm, path: string, content: string | Uint8Array): Promise<void>;
277
+ mkdir(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
278
+ recursive?: boolean;
279
+ }): Promise<void>;
280
+ readdir(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string[]>;
281
+ readdirRecursive(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
282
+ maxDepth?: number;
283
+ }): Promise<LiveGuestDirEntry[]>;
284
+ exists(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<boolean>;
285
+ stat(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
286
+ dereference?: boolean;
287
+ }): Promise<GuestFilesystemStat>;
288
+ lstat(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<GuestFilesystemStat>;
289
+ rename(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
290
+ realpath(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string>;
291
+ removeFile(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<void>;
292
+ removeDir(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<void>;
293
+ removePath(session: AuthenticatedSession, vm: CreatedVm, path: string, options?: {
294
+ recursive?: boolean;
295
+ }): Promise<void>;
296
+ copyPath(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string, options?: {
297
+ recursive?: boolean;
298
+ }): Promise<void>;
299
+ movePath(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
300
+ symlink(session: AuthenticatedSession, vm: CreatedVm, target: string, linkPath: string): Promise<void>;
301
+ readLink(session: AuthenticatedSession, vm: CreatedVm, path: string): Promise<string>;
302
+ link(session: AuthenticatedSession, vm: CreatedVm, fromPath: string, toPath: string): Promise<void>;
303
+ chmod(session: AuthenticatedSession, vm: CreatedVm, path: string, mode: number): Promise<void>;
304
+ chown(session: AuthenticatedSession, vm: CreatedVm, path: string, uid: number, gid: number): Promise<void>;
305
+ utimes(session: AuthenticatedSession, vm: CreatedVm, path: string, atimeMs: number, mtimeMs: number): Promise<void>;
306
+ truncate(session: AuthenticatedSession, vm: CreatedVm, path: string, length: number): Promise<void>;
307
+ disposeVm(session: AuthenticatedSession, vm: CreatedVm): Promise<void>;
308
+ execute(session: AuthenticatedSession, vm: CreatedVm, options: {
309
+ processId: string;
310
+ command?: string;
311
+ runtime?: GuestRuntimeKind;
312
+ entrypoint?: string;
313
+ args?: string[];
314
+ env?: Record<string, string>;
315
+ cwd?: string;
316
+ wasmPermissionTier?: WasmPermissionTier;
317
+ }): Promise<{
318
+ pid: number | null;
319
+ }>;
320
+ writeStdin(session: AuthenticatedSession, vm: CreatedVm, processId: string, chunk: string | Uint8Array): Promise<void>;
321
+ resizePty(session: AuthenticatedSession, vm: CreatedVm, processId: string, cols: number, rows: number): Promise<void>;
322
+ closeStdin(session: AuthenticatedSession, vm: CreatedVm, processId: string): Promise<void>;
323
+ killProcess(session: AuthenticatedSession, vm: CreatedVm, processId: string, signal?: string): Promise<void>;
324
+ findListener(session: AuthenticatedSession, vm: CreatedVm, request: {
325
+ host?: string;
326
+ port?: number;
327
+ path?: string;
328
+ }): Promise<SidecarSocketStateEntry | null>;
329
+ getProcessSnapshot(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarProcessSnapshotEntry[]>;
330
+ getResourceSnapshot(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarResourceSnapshot>;
331
+ findBoundUdp(session: AuthenticatedSession, vm: CreatedVm, request: {
332
+ host?: string;
333
+ port?: number;
334
+ }): Promise<SidecarSocketStateEntry | null>;
335
+ vmFetch(session: AuthenticatedSession, vm: CreatedVm, request: {
336
+ port: number;
337
+ method: string;
338
+ path: string;
339
+ headersJson: string;
340
+ body?: string;
341
+ }): Promise<string>;
342
+ getSignalState(session: AuthenticatedSession, vm: CreatedVm, processId: string): Promise<SidecarSignalState>;
343
+ getZombieTimerCount(session: AuthenticatedSession, vm: CreatedVm): Promise<SidecarZombieTimerCount>;
344
+ hostFilesystemCall(session: AuthenticatedSession, vm: CreatedVm, request: {
345
+ operation: LiveFilesystemOperation;
346
+ path: string;
347
+ payloadSizeBytes: number;
348
+ }): Promise<SidecarFilesystemResult>;
349
+ persistenceLoad(session: AuthenticatedSession, key: string): Promise<SidecarPersistenceState>;
350
+ persistenceFlush(session: AuthenticatedSession, request: {
351
+ key: string;
352
+ payloadSizeBytes: number;
353
+ }): Promise<SidecarPersistenceFlushed>;
354
+ waitForEvent(matcher: SidecarEventSelector | ((event: EventFrame) => boolean), timeoutMs?: number, options?: {
355
+ signal?: AbortSignal;
356
+ }): Promise<EventFrame>;
357
+ dispose(): Promise<void>;
358
+ private sendRequest;
359
+ private guestFilesystemCall;
360
+ }