@rivet-dev/agentos-core 0.0.0-abc-fixes-1.d8c4d95 → 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.
Files changed (128) hide show
  1. package/README.md +48 -48
  2. package/dist/agent-os.d.ts +215 -161
  3. package/dist/agent-os.js +1300 -2576
  4. package/dist/agentos-package.d.ts +27 -0
  5. package/dist/agentos-package.js +21 -0
  6. package/dist/base-filesystem.d.ts +1 -16
  7. package/dist/base-filesystem.js +1 -173
  8. package/dist/cron/cron-manager.d.ts +39 -14
  9. package/dist/cron/cron-manager.js +289 -128
  10. package/dist/cron/errors.d.ts +8 -0
  11. package/dist/cron/errors.js +16 -0
  12. package/dist/cron/index.d.ts +1 -3
  13. package/dist/cron/index.js +1 -2
  14. package/dist/cron/types.d.ts +2 -2
  15. package/dist/default-software.d.ts +8 -0
  16. package/dist/default-software.js +10 -0
  17. package/dist/filesystem-snapshot.d.ts +1 -1
  18. package/dist/filesystem-snapshot.js +1 -1
  19. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  20. package/dist/generated/AcpLimitsConfig.js +2 -0
  21. package/dist/generated/CreateVmConfig.d.ts +29 -0
  22. package/dist/generated/FsPermissionRule.d.ts +6 -0
  23. package/dist/generated/FsPermissionRule.js +1 -0
  24. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  25. package/dist/generated/FsPermissionRuleSet.js +1 -0
  26. package/dist/generated/FsPermissionScope.d.ts +3 -0
  27. package/dist/generated/FsPermissionScope.js +1 -0
  28. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  29. package/dist/generated/HttpLimitsConfig.js +2 -0
  30. package/dist/generated/JsModuleResolution.d.ts +1 -0
  31. package/dist/generated/JsModuleResolution.js +2 -0
  32. package/dist/generated/JsRuntimeConfig.d.ts +31 -0
  33. package/dist/generated/JsRuntimeConfig.js +1 -0
  34. package/dist/generated/JsRuntimeLimitsConfig.d.ts +8 -0
  35. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  36. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  37. package/dist/generated/JsRuntimePlatform.js +2 -0
  38. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  39. package/dist/generated/MountPluginDescriptor.js +2 -0
  40. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  41. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  42. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  43. package/dist/generated/PatternPermissionRule.js +1 -0
  44. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  45. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  46. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  47. package/dist/generated/PatternPermissionScope.js +1 -0
  48. package/dist/generated/PermissionMode.d.ts +1 -0
  49. package/dist/generated/PermissionMode.js +2 -0
  50. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  51. package/dist/generated/PermissionsPolicy.js +1 -0
  52. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  53. package/dist/generated/PluginLimitsConfig.js +2 -0
  54. package/dist/generated/PythonLimitsConfig.d.ts +6 -0
  55. package/dist/generated/PythonLimitsConfig.js +2 -0
  56. package/dist/generated/ResourceLimitsConfig.d.ts +25 -0
  57. package/dist/generated/ResourceLimitsConfig.js +2 -0
  58. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  59. package/dist/generated/RootFilesystemConfig.js +1 -0
  60. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  61. package/dist/generated/RootFilesystemEntry.js +1 -0
  62. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  63. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  64. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  65. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  66. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  67. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  68. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  69. package/dist/generated/RootFilesystemMode.js +2 -0
  70. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  71. package/dist/generated/ToolLimitsConfig.js +2 -0
  72. package/dist/generated/VmDnsConfig.d.ts +6 -0
  73. package/dist/generated/VmDnsConfig.js +2 -0
  74. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  75. package/dist/generated/VmLimitsConfig.js +1 -0
  76. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  77. package/dist/generated/VmListenPolicyConfig.js +2 -0
  78. package/dist/generated/WasmLimitsConfig.d.ts +7 -0
  79. package/dist/generated/WasmLimitsConfig.js +2 -0
  80. package/dist/host-dir-mount.d.ts +5 -5
  81. package/dist/host-dir-mount.js +4 -4
  82. package/dist/host-tools-zod.js +27 -7
  83. package/dist/host-tools.d.ts +2 -9
  84. package/dist/host-tools.js +0 -18
  85. package/dist/index.d.ts +7 -4
  86. package/dist/index.js +6 -4
  87. package/dist/layers.d.ts +3 -3
  88. package/dist/layers.js +19 -10
  89. package/dist/memory-filesystem.d.ts +39 -0
  90. package/dist/memory-filesystem.js +375 -0
  91. package/dist/options-schema.d.ts +452 -0
  92. package/dist/options-schema.js +269 -0
  93. package/dist/overlay-filesystem.d.ts +1 -1
  94. package/dist/overlay-filesystem.js +3 -3
  95. package/dist/packages.d.ts +10 -123
  96. package/dist/packages.js +3 -329
  97. package/dist/runtime.d.ts +41 -184
  98. package/dist/sidecar/agentos-protocol.d.ts +232 -29
  99. package/dist/sidecar/agentos-protocol.js +456 -120
  100. package/dist/sidecar/binary.d.ts +2 -2
  101. package/dist/sidecar/binary.js +2 -2
  102. package/dist/sidecar/native-process-client.d.ts +5 -3
  103. package/dist/sidecar/native-process-client.js +5 -3
  104. package/dist/sidecar/permissions.d.ts +4 -3
  105. package/dist/sidecar/permissions.js +6 -23
  106. package/dist/sidecar/rpc-client.d.ts +74 -86
  107. package/dist/sidecar/rpc-client.js +422 -1418
  108. package/dist/test/file-system.d.ts +1 -1
  109. package/dist/test/file-system.js +3 -1
  110. package/dist/test/runtime.d.ts +2 -3
  111. package/dist/test/runtime.js +1 -1
  112. package/dist/test/terminal-harness.d.ts +5 -4
  113. package/dist/test/terminal-harness.js +12 -7
  114. package/dist/types.d.ts +12 -5
  115. package/package.json +37 -41
  116. package/dist/agents.d.ts +0 -63
  117. package/dist/agents.js +0 -42
  118. package/dist/cron/parse-schedule.d.ts +0 -25
  119. package/dist/cron/parse-schedule.js +0 -66
  120. package/dist/cron/schedule-driver.d.ts +0 -19
  121. package/dist/cron/timer-driver.d.ts +0 -17
  122. package/dist/cron/timer-driver.js +0 -61
  123. package/dist/runtime-compat.d.ts +0 -475
  124. package/dist/runtime-compat.js +0 -2010
  125. package/dist/sidecar/cargo.d.ts +0 -2
  126. package/dist/sidecar/cargo.js +0 -142
  127. package/fixtures/AGENTOS_SYSTEM_PROMPT.md +0 -21
  128. /package/dist/{cron/schedule-driver.js → generated/CreateVmConfig.js} +0 -0
@@ -1,157 +1,318 @@
1
- import { randomUUID } from "node:crypto";
2
- import { resolveSchedule, validateScheduleForRegistration, } from "./parse-schedule.js";
3
- /**
4
- * Compute the next fire time for a schedule string. Returns undefined if
5
- * the schedule is a one-shot ISO timestamp in the past or if croner
6
- * cannot determine a next run.
7
- */
8
- function computeNextTime(schedule) {
9
- return resolveSchedule(schedule).nextRun;
1
+ import { InvalidScheduleError, PastScheduleError } from "./errors.js";
2
+ const MAX_TIMER_DELAY_MS = 2_147_483_647;
3
+ class TimerCronAlarmDriver {
4
+ timer = null;
5
+ set(alarm, wake) {
6
+ this.clear();
7
+ if (alarm.nextAlarmMs === undefined)
8
+ return;
9
+ const delay = Math.min(MAX_TIMER_DELAY_MS, Math.max(0, alarm.nextAlarmMs - Date.now()));
10
+ this.timer = setTimeout(() => {
11
+ this.timer = null;
12
+ if (delay === MAX_TIMER_DELAY_MS) {
13
+ this.set(alarm, wake);
14
+ return;
15
+ }
16
+ void wake(alarm.generation).catch((error) => {
17
+ console.error("[agent-os] cron wake failed", error);
18
+ });
19
+ }, delay);
20
+ this.timer.unref?.();
21
+ }
22
+ dispose() {
23
+ this.clear();
24
+ }
25
+ clear() {
26
+ if (this.timer !== null) {
27
+ clearTimeout(this.timer);
28
+ this.timer = null;
29
+ }
30
+ }
10
31
  }
11
32
  /**
12
- * Internal class that bridges ScheduleDriver and AgentOs. Owns the job
13
- * registry, executes actions, and emits lifecycle events.
33
+ * Thin cron host adapter. The sidecar owns grammar, defaults, job/run state,
34
+ * overlap policy, counts, missed-fire coalescing, and alarm generations. This
35
+ * class only arms the host clock and routes actions containing host resources.
14
36
  */
15
37
  export class CronManager {
16
- jobs = new Map();
17
- driver;
18
- vm;
19
- listeners = [];
20
- constructor(vm, driver) {
21
- this.vm = vm;
22
- this.driver = driver;
23
- }
24
- schedule(options) {
25
- const id = options.id ?? randomUUID();
26
- const overlap = options.overlap ?? "allow";
27
- const resolved = validateScheduleForRegistration(options.schedule);
28
- const handle = this.driver.schedule({
29
- id,
30
- schedule: options.schedule,
31
- callback: () => this.executeJob(id),
32
- });
33
- const state = {
34
- id,
35
- schedule: options.schedule,
36
- action: options.action,
37
- overlap,
38
- handle,
39
- lastRun: undefined,
40
- nextRun: resolved.nextRun,
41
- runCount: 0,
42
- running: false,
43
- queued: false,
44
- };
45
- this.jobs.set(id, state);
46
- return { id, cancel: () => this.cancel(id) };
38
+ transport;
39
+ session;
40
+ sidecarVm;
41
+ alarmDriver;
42
+ listeners = new Set();
43
+ callbacks = new Map();
44
+ callbackByJob = new Map();
45
+ callbackSequence = 0;
46
+ alarmGeneration = 0;
47
+ disposed = false;
48
+ constructor(transport, session, sidecarVm, alarmDriver = new TimerCronAlarmDriver()) {
49
+ this.transport = transport;
50
+ this.session = session;
51
+ this.sidecarVm = sidecarVm;
52
+ this.alarmDriver = alarmDriver;
47
53
  }
48
- cancel(id) {
49
- const state = this.jobs.get(id);
50
- if (!state)
51
- return;
52
- this.driver.cancel(state.handle);
53
- this.jobs.delete(id);
54
- }
55
- list() {
56
- const result = [];
57
- for (const state of this.jobs.values()) {
58
- result.push({
59
- id: state.id,
60
- schedule: state.schedule,
61
- action: state.action,
62
- overlap: state.overlap,
63
- lastRun: state.lastRun,
64
- nextRun: state.nextRun,
65
- runCount: state.runCount,
66
- running: state.running,
54
+ async schedule(options) {
55
+ this.ensureActive();
56
+ let callbackId;
57
+ const action = (() => {
58
+ if (options.action.type !== "callback")
59
+ return options.action;
60
+ callbackId = this.allocateCallbackId();
61
+ this.callbacks.set(callbackId, {
62
+ fn: options.action.fn,
63
+ scheduled: false,
64
+ activeRuns: 0,
65
+ });
66
+ return { type: "callback", callbackId };
67
+ })();
68
+ try {
69
+ const response = await this.transport.scheduleCron(this.session, this.sidecarVm, {
70
+ ...(options.id === undefined ? {} : { id: options.id }),
71
+ schedule: options.schedule,
72
+ action,
73
+ ...(options.overlap === undefined
74
+ ? {}
75
+ : { overlap: options.overlap }),
67
76
  });
77
+ this.replaceJobCallback(response.id, callbackId);
78
+ this.applyAlarm(response.alarm);
79
+ return {
80
+ id: response.id,
81
+ cancel: () => this.cancel(response.id),
82
+ };
83
+ }
84
+ catch (error) {
85
+ if (callbackId !== undefined)
86
+ this.releaseCallback(callbackId);
87
+ throw normalizeScheduleError(options.schedule, error);
68
88
  }
69
- return result;
70
89
  }
71
- onEvent(handler) {
72
- this.listeners.push(handler);
90
+ async cancel(id) {
91
+ this.ensureActive();
92
+ const response = await this.transport.cancelCronJob(this.session, this.sidecarVm, id);
93
+ if (response.cancelled)
94
+ this.replaceJobCallback(id, undefined);
95
+ this.applyAlarm(response.alarm);
73
96
  }
74
- dispose() {
75
- for (const state of this.jobs.values()) {
76
- this.driver.cancel(state.handle);
77
- }
78
- this.jobs.clear();
79
- this.driver.dispose();
97
+ async list() {
98
+ this.ensureActive();
99
+ const response = await this.transport.listCronJobs(this.session, this.sidecarVm);
100
+ this.applyAlarm(response.alarm);
101
+ return response.jobs.map((job) => this.toJobInfo(job));
80
102
  }
81
- emit(event) {
82
- for (const handler of this.listeners) {
83
- try {
84
- handler(event);
85
- }
86
- catch {
87
- // Event handler errors must not crash the manager.
88
- }
89
- }
103
+ onEvent(handler) {
104
+ this.ensureActive();
105
+ this.listeners.add(handler);
90
106
  }
91
- async executeJob(id) {
92
- const state = this.jobs.get(id);
93
- if (!state)
107
+ dispose() {
108
+ if (this.disposed)
94
109
  return;
95
- // Overlap policy.
96
- if (state.running && state.overlap === "skip") {
110
+ this.disposed = true;
111
+ this.alarmDriver.dispose();
112
+ this.listeners.clear();
113
+ this.callbacks.clear();
114
+ this.callbackByJob.clear();
115
+ }
116
+ async wake(generation) {
117
+ if (this.disposed)
97
118
  return;
98
- }
99
- if (state.running && state.overlap === "queue") {
100
- state.queued = true;
119
+ const dispatch = await this.transport.wakeCron(this.session, this.sidecarVm, generation);
120
+ this.consumeDispatch(dispatch);
121
+ }
122
+ consumeDispatch(dispatch) {
123
+ if (this.disposed)
101
124
  return;
125
+ this.applyAlarm(dispatch.alarm);
126
+ for (const event of dispatch.events)
127
+ this.emit(event);
128
+ for (const run of dispatch.runs) {
129
+ void this.executeRun(run).catch((error) => {
130
+ console.error("[agent-os] cron completion failed", error);
131
+ });
102
132
  }
103
- state.running = true;
104
- state.lastRun = new Date();
105
- state.runCount++;
106
- this.emit({ type: "cron:fire", jobId: state.id, time: new Date() });
107
- const startTime = Date.now();
133
+ }
134
+ async executeRun(run) {
135
+ let errorMessage;
136
+ let callbackId;
108
137
  try {
109
- await this.runAction(state.action);
110
- this.emit({
111
- type: "cron:complete",
112
- jobId: state.id,
113
- time: new Date(),
114
- durationMs: Date.now() - startTime,
115
- });
138
+ const action = decodeWireAction(run.action);
139
+ if (action.type !== "callback") {
140
+ throw new Error(`sidecar returned non-host cron action to client: ${action.type}`);
141
+ }
142
+ callbackId = action.callbackId;
143
+ const route = this.callbacks.get(callbackId);
144
+ if (!route) {
145
+ throw new Error(`cron callback route not found: ${callbackId}`);
146
+ }
147
+ route.activeRuns++;
148
+ await route.fn();
116
149
  }
117
150
  catch (error) {
118
- this.emit({
119
- type: "cron:error",
120
- jobId: state.id,
121
- time: new Date(),
122
- error: error,
123
- });
151
+ errorMessage = error instanceof Error ? error.message : String(error);
124
152
  }
125
153
  finally {
126
- state.running = false;
127
- state.nextRun = computeNextTime(state.schedule);
128
- // Process queued execution.
129
- if (state.queued) {
130
- state.queued = false;
131
- void this.executeJob(id);
154
+ if (callbackId !== undefined) {
155
+ const route = this.callbacks.get(callbackId);
156
+ if (route) {
157
+ route.activeRuns = Math.max(0, route.activeRuns - 1);
158
+ this.releaseCallback(callbackId);
159
+ }
132
160
  }
133
161
  }
162
+ // VM disposal removes the sidecar scheduler and its active runs. Do not
163
+ // issue a completion request against a transport that is being torn down.
164
+ if (this.disposed)
165
+ return;
166
+ const dispatch = await this.transport.completeCronRun(this.session, this.sidecarVm, run.runId, errorMessage);
167
+ this.consumeDispatch(dispatch);
134
168
  }
135
- async runAction(action) {
136
- switch (action.type) {
137
- case "session": {
138
- const { sessionId } = await this.vm.createSession(action.agentType, action.options);
139
- try {
140
- await this.vm.prompt(sessionId, action.prompt);
141
- }
142
- finally {
143
- this.vm.closeSession(sessionId);
144
- }
145
- break;
169
+ toJobInfo(job) {
170
+ const wireAction = decodeWireAction(job.action);
171
+ const action = wireAction.type === "callback"
172
+ ? {
173
+ type: "callback",
174
+ fn: this.callbacks.get(wireAction.callbackId)?.fn ?? missingCallback,
175
+ }
176
+ : wireAction;
177
+ return {
178
+ id: job.id,
179
+ schedule: job.schedule,
180
+ action,
181
+ overlap: job.overlap,
182
+ ...(job.lastRunMs === undefined
183
+ ? {}
184
+ : { lastRun: new Date(job.lastRunMs) }),
185
+ ...(job.nextRunMs === undefined
186
+ ? {}
187
+ : { nextRun: new Date(job.nextRunMs) }),
188
+ runCount: job.runCount,
189
+ running: job.running,
190
+ };
191
+ }
192
+ emit(event) {
193
+ let publicEvent;
194
+ if (event.kind === "fire") {
195
+ publicEvent = {
196
+ type: "cron:fire",
197
+ jobId: event.jobId,
198
+ time: new Date(event.timeMs),
199
+ };
200
+ }
201
+ else if (event.kind === "complete") {
202
+ if (event.durationMs === undefined) {
203
+ throw new Error("sidecar complete cron event is missing durationMs");
146
204
  }
147
- case "exec": {
148
- await this.vm.execArgv(action.command, action.args ?? []);
149
- break;
205
+ publicEvent = {
206
+ type: "cron:complete",
207
+ jobId: event.jobId,
208
+ time: new Date(event.timeMs),
209
+ durationMs: event.durationMs,
210
+ };
211
+ }
212
+ else {
213
+ if (event.error === undefined) {
214
+ throw new Error("sidecar error cron event is missing error");
150
215
  }
151
- case "callback": {
152
- await action.fn();
153
- break;
216
+ publicEvent = {
217
+ type: "cron:error",
218
+ jobId: event.jobId,
219
+ time: new Date(event.timeMs),
220
+ error: new Error(event.error),
221
+ };
222
+ }
223
+ for (const listener of this.listeners) {
224
+ try {
225
+ listener(publicEvent);
226
+ }
227
+ catch (error) {
228
+ console.warn("[agent-os] cron event listener failed", error);
154
229
  }
155
230
  }
156
231
  }
232
+ applyAlarm(alarm) {
233
+ if (alarm.generation < this.alarmGeneration)
234
+ return;
235
+ this.alarmGeneration = alarm.generation;
236
+ this.alarmDriver.set(alarm, (generation) => this.wake(generation));
237
+ }
238
+ replaceJobCallback(jobId, callbackId) {
239
+ const previous = this.callbackByJob.get(jobId);
240
+ if (previous !== undefined && previous !== callbackId) {
241
+ this.callbackByJob.delete(jobId);
242
+ const route = this.callbacks.get(previous);
243
+ if (route)
244
+ route.scheduled = false;
245
+ this.releaseCallback(previous);
246
+ }
247
+ if (callbackId !== undefined) {
248
+ const route = this.callbacks.get(callbackId);
249
+ if (!route)
250
+ throw new Error(`cron callback route not found: ${callbackId}`);
251
+ route.scheduled = true;
252
+ this.callbackByJob.set(jobId, callbackId);
253
+ }
254
+ }
255
+ releaseCallback(callbackId) {
256
+ const route = this.callbacks.get(callbackId);
257
+ if (route && !route.scheduled && route.activeRuns === 0) {
258
+ this.callbacks.delete(callbackId);
259
+ }
260
+ }
261
+ allocateCallbackId() {
262
+ this.callbackSequence++;
263
+ if (!Number.isSafeInteger(this.callbackSequence)) {
264
+ throw new Error("cron callback id counter exhausted; recreate the VM");
265
+ }
266
+ return `host-cron-callback-${this.callbackSequence}`;
267
+ }
268
+ ensureActive() {
269
+ if (this.disposed)
270
+ throw new Error("cron manager is disposed");
271
+ }
272
+ }
273
+ function decodeWireAction(value) {
274
+ if (!value || typeof value !== "object") {
275
+ throw new TypeError("sidecar returned an invalid cron action");
276
+ }
277
+ const action = value;
278
+ if (action.type === "callback" && typeof action.callbackId === "string") {
279
+ return { type: "callback", callbackId: action.callbackId };
280
+ }
281
+ if (action.type === "exec" &&
282
+ typeof action.command === "string" &&
283
+ (action.args === undefined ||
284
+ (Array.isArray(action.args) &&
285
+ action.args.every((arg) => typeof arg === "string")))) {
286
+ return {
287
+ type: "exec",
288
+ command: action.command,
289
+ ...(action.args === undefined ? {} : { args: action.args }),
290
+ };
291
+ }
292
+ if (action.type === "session" &&
293
+ typeof action.agentType === "string" &&
294
+ typeof action.prompt === "string") {
295
+ return {
296
+ type: "session",
297
+ agentType: action.agentType,
298
+ prompt: action.prompt,
299
+ ...(action.options === undefined
300
+ ? {}
301
+ : {
302
+ options: action.options,
303
+ }),
304
+ };
305
+ }
306
+ throw new TypeError("sidecar returned an invalid cron action");
307
+ }
308
+ function normalizeScheduleError(schedule, error) {
309
+ const message = error instanceof Error ? error.message : String(error);
310
+ if (message.includes("[invalid_schedule]"))
311
+ return new InvalidScheduleError(schedule);
312
+ if (message.includes("[past_schedule]"))
313
+ return new PastScheduleError(schedule);
314
+ return error;
315
+ }
316
+ async function missingCallback() {
317
+ throw new Error("cron callback route is unavailable");
157
318
  }
@@ -0,0 +1,8 @@
1
+ export declare class InvalidScheduleError extends Error {
2
+ readonly schedule: string;
3
+ constructor(schedule: string);
4
+ }
5
+ export declare class PastScheduleError extends Error {
6
+ readonly schedule: string;
7
+ constructor(schedule: string);
8
+ }
@@ -0,0 +1,16 @@
1
+ export class InvalidScheduleError extends Error {
2
+ schedule;
3
+ constructor(schedule) {
4
+ super(`Invalid schedule "${schedule}". Expected a cron expression or an ISO-like one-shot timestamp.`);
5
+ this.name = "InvalidScheduleError";
6
+ this.schedule = schedule;
7
+ }
8
+ }
9
+ export class PastScheduleError extends Error {
10
+ schedule;
11
+ constructor(schedule) {
12
+ super(`One-shot schedule "${schedule}" is already in the past.`);
13
+ this.name = "PastScheduleError";
14
+ this.schedule = schedule;
15
+ }
16
+ }
@@ -1,5 +1,3 @@
1
1
  export { CronManager } from "./cron-manager.js";
2
- export { InvalidScheduleError, PastScheduleError, } from "./parse-schedule.js";
3
- export type { ScheduleDriver, ScheduleEntry, ScheduleHandle, } from "./schedule-driver.js";
4
- export { TimerScheduleDriver } from "./timer-driver.js";
2
+ export { InvalidScheduleError, PastScheduleError, } from "./errors.js";
5
3
  export type { CronAction, CronEvent, CronEventHandler, CronJob, CronJobInfo, CronJobOptions, } from "./types.js";
@@ -1,3 +1,2 @@
1
1
  export { CronManager } from "./cron-manager.js";
2
- export { InvalidScheduleError, PastScheduleError, } from "./parse-schedule.js";
3
- export { TimerScheduleDriver } from "./timer-driver.js";
2
+ export { InvalidScheduleError, PastScheduleError, } from "./errors.js";
@@ -1,5 +1,5 @@
1
1
  import type { CreateSessionOptions } from "../agent-os.js";
2
- import type { AgentType } from "../agents.js";
2
+ import type { AgentType } from "../types.js";
3
3
  export type CronAction = {
4
4
  type: "session";
5
5
  agentType: AgentType;
@@ -25,7 +25,7 @@ export interface CronJobOptions {
25
25
  }
26
26
  export interface CronJob {
27
27
  id: string;
28
- cancel(): void;
28
+ cancel(): Promise<void>;
29
29
  }
30
30
  export interface CronJobInfo {
31
31
  id: string;
@@ -0,0 +1,8 @@
1
+ import type { SoftwarePackageRef } from "@agentos-software/manifest";
2
+ /**
3
+ * Default software for a bare `AgentOs.create()`: the `@agentos-software/common`
4
+ * coreutils bundle, imported like any other package. The client makes NO
5
+ * npm/node_modules assumptions (see root CLAUDE.md) — no dep scan, no
6
+ * require.resolve. Opt out with `defaultSoftware: false`; add more via `software`.
7
+ */
8
+ export declare function resolveDefaultSoftware(): SoftwarePackageRef[];
@@ -0,0 +1,10 @@
1
+ import common from "@agentos-software/common";
2
+ /**
3
+ * Default software for a bare `AgentOs.create()`: the `@agentos-software/common`
4
+ * coreutils bundle, imported like any other package. The client makes NO
5
+ * npm/node_modules assumptions (see root CLAUDE.md) — no dep scan, no
6
+ * require.resolve. Opt out with `defaultSoftware: false`; add more via `software`.
7
+ */
8
+ export function resolveDefaultSoftware() {
9
+ return [common].flat();
10
+ }
@@ -1,4 +1,4 @@
1
- import { type VirtualFileSystem } from "./runtime-compat.js";
1
+ import type { VirtualFileSystem } from "./runtime.js";
2
2
  export interface FilesystemEntry {
3
3
  path: string;
4
4
  type: "directory" | "file" | "symlink";
@@ -1,5 +1,5 @@
1
1
  import * as posixPath from "node:path/posix";
2
- import { createInMemoryFileSystem, } from "./runtime-compat.js";
2
+ import { createInMemoryFileSystem } from "./memory-filesystem.js";
3
3
  function parseMode(mode) {
4
4
  return Number.parseInt(mode, 8);
5
5
  }
@@ -0,0 +1,4 @@
1
+ export type AcpLimitsConfig = {
2
+ maxReadLineBytes?: number;
3
+ stdoutBufferByteLimit?: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { JsRuntimeConfig } from "./JsRuntimeConfig.js";
2
+ import type { NativeRootFilesystemConfig } from "./NativeRootFilesystemConfig.js";
3
+ import type { PermissionsPolicy } from "./PermissionsPolicy.js";
4
+ import type { RootFilesystemConfig } from "./RootFilesystemConfig.js";
5
+ import type { VmDnsConfig } from "./VmDnsConfig.js";
6
+ import type { VmLimitsConfig } from "./VmLimitsConfig.js";
7
+ import type { VmListenPolicyConfig } from "./VmListenPolicyConfig.js";
8
+ /**
9
+ * Canonical Rust-side VM config. Unknown fields must stay rejected here and by
10
+ * TypeScript thin-client option validation. Update both when an explicit wire
11
+ * option changes the generated VM config.
12
+ */
13
+ export type CreateVmConfig = {
14
+ cwd?: string;
15
+ env?: Record<string, string>;
16
+ rootFilesystem?: RootFilesystemConfig;
17
+ permissions?: PermissionsPolicy;
18
+ limits?: VmLimitsConfig;
19
+ dns?: VmDnsConfig;
20
+ nativeRoot?: NativeRootFilesystemConfig;
21
+ listen?: VmListenPolicyConfig;
22
+ loopbackExemptPorts?: Array<number>;
23
+ jsRuntime?: JsRuntimeConfig;
24
+ /**
25
+ * VM-scoped instructions applied to every ACP session. Session-specific
26
+ * instructions are combined with these by the ACP sidecar adapter.
27
+ */
28
+ agentAdditionalInstructions?: string;
29
+ };
@@ -0,0 +1,6 @@
1
+ import type { PermissionMode } from "./PermissionMode.js";
2
+ export type FsPermissionRule = {
3
+ mode: PermissionMode;
4
+ operations?: Array<string>;
5
+ paths?: Array<string>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { FsPermissionRule } from "./FsPermissionRule.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type FsPermissionRuleSet = {
4
+ default?: PermissionMode;
5
+ rules: Array<FsPermissionRule>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { FsPermissionRuleSet } from "./FsPermissionRuleSet.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type FsPermissionScope = PermissionMode | FsPermissionRuleSet;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type HttpLimitsConfig = {
2
+ maxFetchResponseBytes?: number;
3
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type JsModuleResolution = "node" | "relative" | "none";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};