@rivet-dev/agentos-runtime-core 0.0.0-agent-acp-codex-session-benchmark.62b1f46
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/correlation.d.ts +7 -0
- package/dist/correlation.js +52 -0
- package/dist/descriptors.d.ts +81 -0
- package/dist/descriptors.js +57 -0
- package/dist/event-buffer.d.ts +98 -0
- package/dist/event-buffer.js +333 -0
- package/dist/ext.d.ts +7 -0
- package/dist/ext.js +13 -0
- package/dist/filesystem.d.ts +33 -0
- package/dist/filesystem.js +52 -0
- package/dist/frame-payload-codec.d.ts +8 -0
- package/dist/frame-payload-codec.js +14 -0
- package/dist/frame-rpc.d.ts +45 -0
- package/dist/frame-rpc.js +98 -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 +8 -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 +1452 -0
- package/dist/generated-protocol.js +3936 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +26 -0
- package/dist/json.d.ts +2 -0
- package/dist/json.js +20 -0
- package/dist/native-client.d.ts +47 -0
- package/dist/native-client.js +136 -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 +67 -0
- package/dist/protocol-client.js +270 -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 +207 -0
- package/dist/request-payloads.js +357 -0
- package/dist/response-payloads.d.ts +268 -0
- package/dist/response-payloads.js +402 -0
- package/dist/sidecar-client.d.ts +19 -0
- package/dist/sidecar-client.js +1 -0
- package/dist/sidecar-errors.d.ts +44 -0
- package/dist/sidecar-errors.js +62 -0
- package/dist/sidecar-process.d.ts +434 -0
- package/dist/sidecar-process.js +1252 -0
- package/dist/state.d.ts +42 -0
- package/dist/state.js +45 -0
- package/dist/vm-config.d.ts +31 -0
- package/dist/vm-config.js +1 -0
- package/package.json +189 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import * as protocol from "./generated-protocol.js";
|
|
2
|
+
export function toGeneratedPermissionMode(mode) {
|
|
3
|
+
switch (mode) {
|
|
4
|
+
case "allow":
|
|
5
|
+
return protocol.PermissionMode.Allow;
|
|
6
|
+
case "ask":
|
|
7
|
+
return protocol.PermissionMode.Ask;
|
|
8
|
+
case "deny":
|
|
9
|
+
return protocol.PermissionMode.Deny;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function toGeneratedGuestRuntimeKind(runtime) {
|
|
13
|
+
switch (runtime) {
|
|
14
|
+
case "java_script":
|
|
15
|
+
return protocol.GuestRuntimeKind.JavaScript;
|
|
16
|
+
case "python":
|
|
17
|
+
return protocol.GuestRuntimeKind.Python;
|
|
18
|
+
case "web_assembly":
|
|
19
|
+
return protocol.GuestRuntimeKind.WebAssembly;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function toGeneratedDisposeReason(reason) {
|
|
23
|
+
switch (reason) {
|
|
24
|
+
case "requested":
|
|
25
|
+
return protocol.DisposeReason.Requested;
|
|
26
|
+
case "connection_closed":
|
|
27
|
+
return protocol.DisposeReason.ConnectionClosed;
|
|
28
|
+
case "host_shutdown":
|
|
29
|
+
return protocol.DisposeReason.HostShutdown;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function toGeneratedRootFilesystemMode(mode) {
|
|
33
|
+
switch (mode) {
|
|
34
|
+
case "ephemeral":
|
|
35
|
+
return protocol.RootFilesystemMode.Ephemeral;
|
|
36
|
+
case "read_only":
|
|
37
|
+
return protocol.RootFilesystemMode.ReadOnly;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function toGeneratedRootFilesystemEntryKind(kind) {
|
|
41
|
+
switch (kind) {
|
|
42
|
+
case "file":
|
|
43
|
+
return protocol.RootFilesystemEntryKind.File;
|
|
44
|
+
case "directory":
|
|
45
|
+
return protocol.RootFilesystemEntryKind.Directory;
|
|
46
|
+
case "symlink":
|
|
47
|
+
return protocol.RootFilesystemEntryKind.Symlink;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function toGeneratedRootFilesystemEntryEncoding(encoding) {
|
|
51
|
+
switch (encoding) {
|
|
52
|
+
case "utf8":
|
|
53
|
+
return protocol.RootFilesystemEntryEncoding.UtF8;
|
|
54
|
+
case "base64":
|
|
55
|
+
return protocol.RootFilesystemEntryEncoding.BasE64;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function toGeneratedWasmPermissionTier(tier) {
|
|
59
|
+
switch (tier) {
|
|
60
|
+
case "full":
|
|
61
|
+
return protocol.WasmPermissionTier.Full;
|
|
62
|
+
case "read-write":
|
|
63
|
+
return protocol.WasmPermissionTier.ReadWrite;
|
|
64
|
+
case "read-only":
|
|
65
|
+
return protocol.WasmPermissionTier.ReadOnly;
|
|
66
|
+
case "isolated":
|
|
67
|
+
return protocol.WasmPermissionTier.Isolated;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export function toGeneratedGuestFilesystemOperation(operation) {
|
|
71
|
+
switch (operation) {
|
|
72
|
+
case "read_file":
|
|
73
|
+
return protocol.GuestFilesystemOperation.ReadFile;
|
|
74
|
+
case "write_file":
|
|
75
|
+
return protocol.GuestFilesystemOperation.WriteFile;
|
|
76
|
+
case "create_dir":
|
|
77
|
+
return protocol.GuestFilesystemOperation.CreateDir;
|
|
78
|
+
case "mkdir":
|
|
79
|
+
return protocol.GuestFilesystemOperation.Mkdir;
|
|
80
|
+
case "exists":
|
|
81
|
+
return protocol.GuestFilesystemOperation.Exists;
|
|
82
|
+
case "stat":
|
|
83
|
+
return protocol.GuestFilesystemOperation.Stat;
|
|
84
|
+
case "lstat":
|
|
85
|
+
return protocol.GuestFilesystemOperation.Lstat;
|
|
86
|
+
case "read_dir":
|
|
87
|
+
return protocol.GuestFilesystemOperation.ReadDir;
|
|
88
|
+
case "read_dir_recursive":
|
|
89
|
+
return protocol.GuestFilesystemOperation.ReadDirRecursive;
|
|
90
|
+
case "remove_file":
|
|
91
|
+
return protocol.GuestFilesystemOperation.RemoveFile;
|
|
92
|
+
case "remove_dir":
|
|
93
|
+
return protocol.GuestFilesystemOperation.RemoveDir;
|
|
94
|
+
case "remove":
|
|
95
|
+
return protocol.GuestFilesystemOperation.Remove;
|
|
96
|
+
case "copy":
|
|
97
|
+
return protocol.GuestFilesystemOperation.Copy;
|
|
98
|
+
case "move":
|
|
99
|
+
return protocol.GuestFilesystemOperation.Move;
|
|
100
|
+
case "rename":
|
|
101
|
+
return protocol.GuestFilesystemOperation.Rename;
|
|
102
|
+
case "realpath":
|
|
103
|
+
return protocol.GuestFilesystemOperation.Realpath;
|
|
104
|
+
case "symlink":
|
|
105
|
+
return protocol.GuestFilesystemOperation.Symlink;
|
|
106
|
+
case "read_link":
|
|
107
|
+
return protocol.GuestFilesystemOperation.ReadLink;
|
|
108
|
+
case "link":
|
|
109
|
+
return protocol.GuestFilesystemOperation.Link;
|
|
110
|
+
case "chmod":
|
|
111
|
+
return protocol.GuestFilesystemOperation.Chmod;
|
|
112
|
+
case "chown":
|
|
113
|
+
return protocol.GuestFilesystemOperation.Chown;
|
|
114
|
+
case "utimes":
|
|
115
|
+
return protocol.GuestFilesystemOperation.Utimes;
|
|
116
|
+
case "truncate":
|
|
117
|
+
return protocol.GuestFilesystemOperation.Truncate;
|
|
118
|
+
case "pread":
|
|
119
|
+
return protocol.GuestFilesystemOperation.Pread;
|
|
120
|
+
case "pwrite":
|
|
121
|
+
return protocol.GuestFilesystemOperation.Pwrite;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
export function toGeneratedFilesystemOperation(operation) {
|
|
125
|
+
switch (operation) {
|
|
126
|
+
case "read":
|
|
127
|
+
return protocol.FilesystemOperation.Read;
|
|
128
|
+
case "write":
|
|
129
|
+
return protocol.FilesystemOperation.Write;
|
|
130
|
+
case "stat":
|
|
131
|
+
return protocol.FilesystemOperation.Stat;
|
|
132
|
+
case "read_dir":
|
|
133
|
+
return protocol.FilesystemOperation.ReadDir;
|
|
134
|
+
case "mkdir":
|
|
135
|
+
return protocol.FilesystemOperation.Mkdir;
|
|
136
|
+
case "remove":
|
|
137
|
+
return protocol.FilesystemOperation.Remove;
|
|
138
|
+
case "rename":
|
|
139
|
+
return protocol.FilesystemOperation.Rename;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export function fromGeneratedFilesystemOperation(operation) {
|
|
143
|
+
switch (operation) {
|
|
144
|
+
case protocol.FilesystemOperation.Read:
|
|
145
|
+
return "read";
|
|
146
|
+
case protocol.FilesystemOperation.Write:
|
|
147
|
+
return "write";
|
|
148
|
+
case protocol.FilesystemOperation.Stat:
|
|
149
|
+
return "stat";
|
|
150
|
+
case protocol.FilesystemOperation.ReadDir:
|
|
151
|
+
return "read_dir";
|
|
152
|
+
case protocol.FilesystemOperation.Mkdir:
|
|
153
|
+
return "mkdir";
|
|
154
|
+
case protocol.FilesystemOperation.Remove:
|
|
155
|
+
return "remove";
|
|
156
|
+
case protocol.FilesystemOperation.Rename:
|
|
157
|
+
return "rename";
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
export function fromGeneratedVmLifecycleState(state) {
|
|
161
|
+
switch (state) {
|
|
162
|
+
case protocol.VmLifecycleState.Creating:
|
|
163
|
+
return "creating";
|
|
164
|
+
case protocol.VmLifecycleState.Ready:
|
|
165
|
+
return "ready";
|
|
166
|
+
case protocol.VmLifecycleState.Disposing:
|
|
167
|
+
return "disposing";
|
|
168
|
+
case protocol.VmLifecycleState.Disposed:
|
|
169
|
+
return "disposed";
|
|
170
|
+
case protocol.VmLifecycleState.Failed:
|
|
171
|
+
return "failed";
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export function fromGeneratedStreamChannel(channel) {
|
|
175
|
+
switch (channel) {
|
|
176
|
+
case protocol.StreamChannel.Stdout:
|
|
177
|
+
return "stdout";
|
|
178
|
+
case protocol.StreamChannel.Stderr:
|
|
179
|
+
return "stderr";
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
export function fromGeneratedProcessSnapshotStatus(status) {
|
|
183
|
+
switch (status) {
|
|
184
|
+
case protocol.ProcessSnapshotStatus.Running:
|
|
185
|
+
return "running";
|
|
186
|
+
case protocol.ProcessSnapshotStatus.Exited:
|
|
187
|
+
return "exited";
|
|
188
|
+
case protocol.ProcessSnapshotStatus.Stopped:
|
|
189
|
+
return "stopped";
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
export function fromGeneratedSignalDispositionAction(action) {
|
|
193
|
+
switch (action) {
|
|
194
|
+
case protocol.SignalDispositionAction.Default:
|
|
195
|
+
return "default";
|
|
196
|
+
case protocol.SignalDispositionAction.Ignore:
|
|
197
|
+
return "ignore";
|
|
198
|
+
case protocol.SignalDispositionAction.User:
|
|
199
|
+
return "user";
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
export function fromGeneratedRootFilesystemEntryKind(kind) {
|
|
203
|
+
switch (kind) {
|
|
204
|
+
case protocol.RootFilesystemEntryKind.File:
|
|
205
|
+
return "file";
|
|
206
|
+
case protocol.RootFilesystemEntryKind.Directory:
|
|
207
|
+
return "directory";
|
|
208
|
+
case protocol.RootFilesystemEntryKind.Symlink:
|
|
209
|
+
return "symlink";
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export function fromGeneratedRootFilesystemEntryEncoding(encoding) {
|
|
213
|
+
switch (encoding) {
|
|
214
|
+
case protocol.RootFilesystemEntryEncoding.UtF8:
|
|
215
|
+
return "utf8";
|
|
216
|
+
case protocol.RootFilesystemEntryEncoding.BasE64:
|
|
217
|
+
return "base64";
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
export function fromGeneratedGuestFilesystemOperation(operation) {
|
|
221
|
+
switch (operation) {
|
|
222
|
+
case protocol.GuestFilesystemOperation.ReadFile:
|
|
223
|
+
return "read_file";
|
|
224
|
+
case protocol.GuestFilesystemOperation.WriteFile:
|
|
225
|
+
return "write_file";
|
|
226
|
+
case protocol.GuestFilesystemOperation.CreateDir:
|
|
227
|
+
return "create_dir";
|
|
228
|
+
case protocol.GuestFilesystemOperation.Mkdir:
|
|
229
|
+
return "mkdir";
|
|
230
|
+
case protocol.GuestFilesystemOperation.Exists:
|
|
231
|
+
return "exists";
|
|
232
|
+
case protocol.GuestFilesystemOperation.Stat:
|
|
233
|
+
return "stat";
|
|
234
|
+
case protocol.GuestFilesystemOperation.Lstat:
|
|
235
|
+
return "lstat";
|
|
236
|
+
case protocol.GuestFilesystemOperation.ReadDir:
|
|
237
|
+
return "read_dir";
|
|
238
|
+
case protocol.GuestFilesystemOperation.ReadDirRecursive:
|
|
239
|
+
return "read_dir_recursive";
|
|
240
|
+
case protocol.GuestFilesystemOperation.RemoveFile:
|
|
241
|
+
return "remove_file";
|
|
242
|
+
case protocol.GuestFilesystemOperation.RemoveDir:
|
|
243
|
+
return "remove_dir";
|
|
244
|
+
case protocol.GuestFilesystemOperation.Remove:
|
|
245
|
+
return "remove";
|
|
246
|
+
case protocol.GuestFilesystemOperation.Copy:
|
|
247
|
+
return "copy";
|
|
248
|
+
case protocol.GuestFilesystemOperation.Move:
|
|
249
|
+
return "move";
|
|
250
|
+
case protocol.GuestFilesystemOperation.Rename:
|
|
251
|
+
return "rename";
|
|
252
|
+
case protocol.GuestFilesystemOperation.Realpath:
|
|
253
|
+
return "realpath";
|
|
254
|
+
case protocol.GuestFilesystemOperation.Symlink:
|
|
255
|
+
return "symlink";
|
|
256
|
+
case protocol.GuestFilesystemOperation.ReadLink:
|
|
257
|
+
return "read_link";
|
|
258
|
+
case protocol.GuestFilesystemOperation.Link:
|
|
259
|
+
return "link";
|
|
260
|
+
case protocol.GuestFilesystemOperation.Chmod:
|
|
261
|
+
return "chmod";
|
|
262
|
+
case protocol.GuestFilesystemOperation.Chown:
|
|
263
|
+
return "chown";
|
|
264
|
+
case protocol.GuestFilesystemOperation.Utimes:
|
|
265
|
+
return "utimes";
|
|
266
|
+
case protocol.GuestFilesystemOperation.Truncate:
|
|
267
|
+
return "truncate";
|
|
268
|
+
case protocol.GuestFilesystemOperation.Pread:
|
|
269
|
+
return "pread";
|
|
270
|
+
case protocol.GuestFilesystemOperation.Pwrite:
|
|
271
|
+
return "pwrite";
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SIDECAR_PROTOCOL_SCHEMA: {
|
|
2
|
+
readonly name: "agentos-native-sidecar";
|
|
3
|
+
readonly version: 7;
|
|
4
|
+
};
|
|
5
|
+
export type LiveProtocolSchema = typeof SIDECAR_PROTOCOL_SCHEMA;
|
|
6
|
+
export type ProtocolSchemaLike = {
|
|
7
|
+
name: string;
|
|
8
|
+
version: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function validateSidecarProtocolSchema(schema: ProtocolSchemaLike): LiveProtocolSchema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const SIDECAR_PROTOCOL_SCHEMA = {
|
|
2
|
+
name: "agentos-native-sidecar",
|
|
3
|
+
version: 7,
|
|
4
|
+
};
|
|
5
|
+
export function validateSidecarProtocolSchema(schema) {
|
|
6
|
+
if (schema.name !== SIDECAR_PROTOCOL_SCHEMA.name ||
|
|
7
|
+
schema.version !== SIDECAR_PROTOCOL_SCHEMA.version) {
|
|
8
|
+
throw new Error(`unsupported sidecar protocol schema ${schema.name}@${schema.version}`);
|
|
9
|
+
}
|
|
10
|
+
return SIDECAR_PROTOCOL_SCHEMA;
|
|
11
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { type LiveMountDescriptor, type LivePackageDescriptor, type LiveSidecarPlacement } from "./descriptors.js";
|
|
2
|
+
import { type LiveExtEnvelope } from "./ext.js";
|
|
3
|
+
import { type LiveRootFilesystemEntry, type LiveRootFilesystemEntryEncoding } from "./filesystem.js";
|
|
4
|
+
import type { CreateVmConfig } from "./generated/CreateVmConfig.js";
|
|
5
|
+
import * as protocol from "./generated-protocol.js";
|
|
6
|
+
import { type LivePermissionsPolicy } from "./permissions.js";
|
|
7
|
+
import { type LiveDisposeReason, type LiveFilesystemOperation, type LiveGuestFilesystemOperation, type LiveGuestRuntimeKind, type LiveRootFilesystemMode, type LiveWasmPermissionTier } from "./protocol-maps.js";
|
|
8
|
+
export interface LiveRegisteredHostCallbackExample {
|
|
9
|
+
description: string;
|
|
10
|
+
input: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface LiveRegisteredHostCallbackDefinition {
|
|
13
|
+
description: string;
|
|
14
|
+
input_schema: unknown;
|
|
15
|
+
timeout_ms?: number;
|
|
16
|
+
examples?: LiveRegisteredHostCallbackExample[];
|
|
17
|
+
}
|
|
18
|
+
export interface LiveHostCallbackRegistration {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
callbacks: Record<string, LiveRegisteredHostCallbackDefinition>;
|
|
22
|
+
}
|
|
23
|
+
export type LiveCronOverlap = "allow" | "skip" | "queue";
|
|
24
|
+
export type LiveRequestPayload = {
|
|
25
|
+
type: "authenticate";
|
|
26
|
+
client_name: string;
|
|
27
|
+
auth_token: string;
|
|
28
|
+
protocol_version: number;
|
|
29
|
+
bridge_version: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "open_session";
|
|
32
|
+
placement: LiveSidecarPlacement;
|
|
33
|
+
} | {
|
|
34
|
+
type: "close_session";
|
|
35
|
+
session_id: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: "create_vm";
|
|
38
|
+
runtime: LiveGuestRuntimeKind;
|
|
39
|
+
config: CreateVmConfig;
|
|
40
|
+
} | {
|
|
41
|
+
type: "initialize_vm";
|
|
42
|
+
runtime: LiveGuestRuntimeKind;
|
|
43
|
+
config: CreateVmConfig;
|
|
44
|
+
mounts?: LiveMountDescriptor[];
|
|
45
|
+
packages?: LivePackageDescriptor[];
|
|
46
|
+
packages_mount_at?: string;
|
|
47
|
+
host_callbacks?: LiveHostCallbackRegistration[];
|
|
48
|
+
} | {
|
|
49
|
+
type: "configure_vm";
|
|
50
|
+
mounts?: LiveMountDescriptor[];
|
|
51
|
+
permissions?: LivePermissionsPolicy;
|
|
52
|
+
command_permissions?: Record<string, LiveWasmPermissionTier>;
|
|
53
|
+
loopback_exempt_ports?: number[];
|
|
54
|
+
packages?: LivePackageDescriptor[];
|
|
55
|
+
packages_mount_at?: string;
|
|
56
|
+
} | {
|
|
57
|
+
type: "link_package";
|
|
58
|
+
package: LivePackageDescriptor;
|
|
59
|
+
} | {
|
|
60
|
+
type: "provided_commands";
|
|
61
|
+
} | {
|
|
62
|
+
type: "schedule_cron";
|
|
63
|
+
id?: string;
|
|
64
|
+
schedule: string;
|
|
65
|
+
action: unknown;
|
|
66
|
+
overlap?: LiveCronOverlap;
|
|
67
|
+
} | {
|
|
68
|
+
type: "list_cron_jobs";
|
|
69
|
+
} | {
|
|
70
|
+
type: "cancel_cron_job";
|
|
71
|
+
id: string;
|
|
72
|
+
} | {
|
|
73
|
+
type: "wake_cron";
|
|
74
|
+
generation: number;
|
|
75
|
+
} | {
|
|
76
|
+
type: "complete_cron_run";
|
|
77
|
+
run_id: string;
|
|
78
|
+
error?: string;
|
|
79
|
+
} | {
|
|
80
|
+
type: "export_cron_state";
|
|
81
|
+
} | {
|
|
82
|
+
type: "import_cron_state";
|
|
83
|
+
state: string;
|
|
84
|
+
} | ({
|
|
85
|
+
type: "register_host_callbacks";
|
|
86
|
+
} & LiveHostCallbackRegistration) | {
|
|
87
|
+
type: "dispose_vm";
|
|
88
|
+
reason: LiveDisposeReason;
|
|
89
|
+
} | {
|
|
90
|
+
type: "bootstrap_root_filesystem";
|
|
91
|
+
entries: LiveRootFilesystemEntry[];
|
|
92
|
+
} | {
|
|
93
|
+
type: "create_layer";
|
|
94
|
+
} | {
|
|
95
|
+
type: "seal_layer";
|
|
96
|
+
layer_id: string;
|
|
97
|
+
} | {
|
|
98
|
+
type: "import_snapshot";
|
|
99
|
+
entries: LiveRootFilesystemEntry[];
|
|
100
|
+
} | {
|
|
101
|
+
type: "export_snapshot";
|
|
102
|
+
layer_id: string;
|
|
103
|
+
} | {
|
|
104
|
+
type: "create_overlay";
|
|
105
|
+
mode?: LiveRootFilesystemMode;
|
|
106
|
+
upper_layer_id?: string;
|
|
107
|
+
lower_layer_ids: string[];
|
|
108
|
+
} | {
|
|
109
|
+
type: "snapshot_root_filesystem";
|
|
110
|
+
} | {
|
|
111
|
+
type: "guest_kernel_call";
|
|
112
|
+
execution_id: string;
|
|
113
|
+
operation: string;
|
|
114
|
+
payload: ArrayBuffer;
|
|
115
|
+
} | {
|
|
116
|
+
type: "guest_filesystem_call";
|
|
117
|
+
operation: LiveGuestFilesystemOperation;
|
|
118
|
+
path: string;
|
|
119
|
+
destination_path?: string;
|
|
120
|
+
target?: string;
|
|
121
|
+
content?: string;
|
|
122
|
+
encoding?: LiveRootFilesystemEntryEncoding;
|
|
123
|
+
recursive?: boolean;
|
|
124
|
+
max_depth?: number;
|
|
125
|
+
mode?: number;
|
|
126
|
+
uid?: number;
|
|
127
|
+
gid?: number;
|
|
128
|
+
atime_ms?: number;
|
|
129
|
+
mtime_ms?: number;
|
|
130
|
+
len?: number;
|
|
131
|
+
offset?: number;
|
|
132
|
+
} | {
|
|
133
|
+
type: "execute";
|
|
134
|
+
process_id?: string;
|
|
135
|
+
command?: string;
|
|
136
|
+
shell_command?: string;
|
|
137
|
+
runtime?: LiveGuestRuntimeKind;
|
|
138
|
+
entrypoint?: string;
|
|
139
|
+
args: string[];
|
|
140
|
+
env?: Record<string, string>;
|
|
141
|
+
cwd?: string;
|
|
142
|
+
wasm_permission_tier?: LiveWasmPermissionTier;
|
|
143
|
+
pty?: {
|
|
144
|
+
cols?: number;
|
|
145
|
+
rows?: number;
|
|
146
|
+
};
|
|
147
|
+
keep_stdin_open?: boolean;
|
|
148
|
+
timeout_ms?: number;
|
|
149
|
+
capture_output?: boolean;
|
|
150
|
+
} | {
|
|
151
|
+
type: "write_stdin";
|
|
152
|
+
process_id: string;
|
|
153
|
+
chunk: Uint8Array;
|
|
154
|
+
} | {
|
|
155
|
+
type: "resize_pty";
|
|
156
|
+
process_id: string;
|
|
157
|
+
cols: number;
|
|
158
|
+
rows: number;
|
|
159
|
+
} | {
|
|
160
|
+
type: "close_stdin";
|
|
161
|
+
process_id: string;
|
|
162
|
+
} | {
|
|
163
|
+
type: "kill_process";
|
|
164
|
+
process_id: string;
|
|
165
|
+
signal: string;
|
|
166
|
+
} | {
|
|
167
|
+
type: "get_process_snapshot";
|
|
168
|
+
} | {
|
|
169
|
+
type: "get_resource_snapshot";
|
|
170
|
+
} | {
|
|
171
|
+
type: "find_listener";
|
|
172
|
+
host?: string;
|
|
173
|
+
port?: number;
|
|
174
|
+
path?: string;
|
|
175
|
+
} | {
|
|
176
|
+
type: "find_bound_udp";
|
|
177
|
+
host?: string;
|
|
178
|
+
port?: number;
|
|
179
|
+
} | {
|
|
180
|
+
type: "vm_fetch";
|
|
181
|
+
port: number;
|
|
182
|
+
method: string;
|
|
183
|
+
path: string;
|
|
184
|
+
headers_json: string;
|
|
185
|
+
body?: string;
|
|
186
|
+
} | {
|
|
187
|
+
type: "get_signal_state";
|
|
188
|
+
process_id: string;
|
|
189
|
+
} | {
|
|
190
|
+
type: "get_zombie_timer_count";
|
|
191
|
+
} | {
|
|
192
|
+
type: "host_filesystem_call";
|
|
193
|
+
operation: LiveFilesystemOperation;
|
|
194
|
+
path: string;
|
|
195
|
+
payload_size_bytes: number;
|
|
196
|
+
} | {
|
|
197
|
+
type: "persistence_load";
|
|
198
|
+
key: string;
|
|
199
|
+
} | {
|
|
200
|
+
type: "persistence_flush";
|
|
201
|
+
key: string;
|
|
202
|
+
payload_size_bytes: number;
|
|
203
|
+
} | {
|
|
204
|
+
type: "ext";
|
|
205
|
+
envelope: LiveExtEnvelope;
|
|
206
|
+
};
|
|
207
|
+
export declare function toGeneratedRequestPayload(payload: LiveRequestPayload): protocol.RequestPayload;
|