@rivet-dev/agentos-core 0.2.12 → 0.2.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @rivet-dev/agentos-core
2
2
 
3
- A high-level SDK for running coding agents in isolated VMs. agentOS manages the full lifecycle of virtual machines -- from filesystem setup and process management to launching AI agents via the Agent Communication Protocol (ACP).
3
+ A high-level SDK for running coding agents in isolated VMs. agentOS manages the full lifecycle of virtual machines -- from filesystem setup and process management to launching AI agents via the Agent Client Protocol (ACP).
4
4
 
5
5
  Agents run inside isolated VMs with their own filesystem, process table, and network stack. The host only communicates through well-defined APIs, keeping agent execution fully contained.
6
6
 
@@ -226,6 +226,10 @@ export interface AgentOsLimits {
226
226
  /** Cap on `vm.httpRequest()` buffered response bodies. Must be <= the sidecar wire frame cap. */
227
227
  maxFetchResponseBytes?: number;
228
228
  };
229
+ /** TLS plaintext buffering limits. */
230
+ tls?: {
231
+ maxBufferedBytes?: number;
232
+ };
229
233
  /** Host binding registration and invocation limits. */
230
234
  bindings?: {
231
235
  defaultBindingTimeoutMs?: number;
@@ -531,6 +535,23 @@ export declare class AgentOs {
531
535
  recursive?: boolean;
532
536
  }): Promise<void>;
533
537
  httpRequest(request: HttpRequest): Promise<HttpResponse>;
538
+ /**
539
+ * Fetch an HTTP endpoint inside the VM while preserving duplicate response
540
+ * headers and arbitrary binary bodies. AgentOS Apps uses this compatibility
541
+ * surface for its direct actor API.
542
+ */
543
+ fetch(port: number, request: Request): Promise<Response>;
544
+ fetchStreamStart(port: number, request: Request): Promise<{
545
+ streamId: string;
546
+ status: number;
547
+ statusText: string;
548
+ headers: Array<[string, string]>;
549
+ }>;
550
+ fetchStreamRead(streamId: string, maxBytes?: number): Promise<{
551
+ body: Uint8Array;
552
+ done: boolean;
553
+ }>;
554
+ fetchStreamCancel(streamId: string): Promise<void>;
534
555
  openShell(options?: ShellOptions): {
535
556
  shellId: string;
536
557
  };
package/dist/agent-os.js CHANGED
@@ -2074,6 +2074,74 @@ export class AgentOs {
2074
2074
  body: new Uint8Array(Buffer.from(responsePayload.body ?? "", "base64")),
2075
2075
  };
2076
2076
  }
2077
+ /**
2078
+ * Fetch an HTTP endpoint inside the VM while preserving duplicate response
2079
+ * headers and arbitrary binary bodies. AgentOS Apps uses this compatibility
2080
+ * surface for its direct actor API.
2081
+ */
2082
+ async fetch(port, request) {
2083
+ const url = new URL(request.url);
2084
+ const responsePayload = JSON.parse(await this._sidecarClient.vmFetch(this._sidecarSession, this._sidecarVm, {
2085
+ port,
2086
+ method: request.method,
2087
+ path: `${url.pathname}${url.search}`,
2088
+ headersJson: JSON.stringify(Object.fromEntries(request.headers.entries())),
2089
+ ...(request.method !== "GET" && request.method !== "HEAD"
2090
+ ? {
2091
+ bodyBase64: Buffer.from(await request.arrayBuffer()).toString("base64"),
2092
+ }
2093
+ : {}),
2094
+ }));
2095
+ const headers = new Headers();
2096
+ for (const [key, value] of responsePayload.headers ?? []) {
2097
+ headers.append(key, value);
2098
+ }
2099
+ return new Response(Buffer.from(responsePayload.body ?? "", "base64"), {
2100
+ status: responsePayload.status,
2101
+ statusText: responsePayload.statusText ?? "",
2102
+ headers,
2103
+ });
2104
+ }
2105
+ async fetchStreamStart(port, request) {
2106
+ const url = new URL(request.url);
2107
+ return JSON.parse(await this._sidecarClient.vmFetch(this._sidecarSession, this._sidecarVm, {
2108
+ port,
2109
+ method: request.method,
2110
+ path: `${url.pathname}${url.search}`,
2111
+ headersJson: JSON.stringify(Object.fromEntries(request.headers.entries())),
2112
+ ...(request.method !== "GET" && request.method !== "HEAD"
2113
+ ? {
2114
+ bodyBase64: Buffer.from(await request.arrayBuffer()).toString("base64"),
2115
+ }
2116
+ : {}),
2117
+ streamOperation: "start",
2118
+ }));
2119
+ }
2120
+ async fetchStreamRead(streamId, maxBytes = 64 * 1024) {
2121
+ const response = JSON.parse(await this._sidecarClient.vmFetch(this._sidecarSession, this._sidecarVm, {
2122
+ port: 0,
2123
+ method: "GET",
2124
+ path: "/",
2125
+ headersJson: "{}",
2126
+ streamOperation: "read",
2127
+ streamId,
2128
+ maxBytes,
2129
+ }));
2130
+ return {
2131
+ body: new Uint8Array(Buffer.from(response.body, "base64")),
2132
+ done: response.done,
2133
+ };
2134
+ }
2135
+ async fetchStreamCancel(streamId) {
2136
+ await this._sidecarClient.vmFetch(this._sidecarSession, this._sidecarVm, {
2137
+ port: 0,
2138
+ method: "GET",
2139
+ path: "/",
2140
+ headersJson: "{}",
2141
+ streamOperation: "cancel",
2142
+ streamId,
2143
+ });
2144
+ }
2077
2145
  openShell(options) {
2078
2146
  const shellId = `shell-${++this._shellCounter}`;
2079
2147
  this._closedShellIds.delete(shellId);
@@ -131,6 +131,9 @@ export declare const agentOsLimitsSchema: z.ZodObject<{
131
131
  http: z.ZodOptional<z.ZodObject<{
132
132
  maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
133
133
  }, z.core.$strict>>;
134
+ tls: z.ZodOptional<z.ZodObject<{
135
+ maxBufferedBytes: z.ZodOptional<z.ZodNumber>;
136
+ }, z.core.$strict>>;
134
137
  bindings: z.ZodOptional<z.ZodObject<{
135
138
  defaultBindingTimeoutMs: z.ZodOptional<z.ZodNumber>;
136
139
  maxBindingTimeoutMs: z.ZodOptional<z.ZodNumber>;
@@ -478,6 +481,9 @@ export declare const agentOsOptionFieldSchemas: {
478
481
  http: z.ZodOptional<z.ZodObject<{
479
482
  maxFetchResponseBytes: z.ZodOptional<z.ZodNumber>;
480
483
  }, z.core.$strict>>;
484
+ tls: z.ZodOptional<z.ZodObject<{
485
+ maxBufferedBytes: z.ZodOptional<z.ZodNumber>;
486
+ }, z.core.$strict>>;
481
487
  bindings: z.ZodOptional<z.ZodObject<{
482
488
  defaultBindingTimeoutMs: z.ZodOptional<z.ZodNumber>;
483
489
  maxBindingTimeoutMs: z.ZodOptional<z.ZodNumber>;
@@ -119,6 +119,10 @@ export const agentOsLimitsSchema = z
119
119
  .object({ maxFetchResponseBytes: positiveInteger.optional() })
120
120
  .strict()
121
121
  .optional(),
122
+ tls: z
123
+ .object({ maxBufferedBytes: positiveInteger.optional() })
124
+ .strict()
125
+ .optional(),
122
126
  bindings: z
123
127
  .object({
124
128
  defaultBindingTimeoutMs: nonNegativeInteger.optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivet-dev/agentos-core",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -59,14 +59,14 @@
59
59
  "@agentclientprotocol/sdk": "0.16.1",
60
60
  "@agentos-software/claude-code": "0.2.7",
61
61
  "@agentos-software/codex-cli": "0.3.4",
62
- "@agentos-software/common": "0.2.12",
63
- "@agentos-software/manifest": "0.2.12",
62
+ "@agentos-software/common": "0.2.13",
63
+ "@agentos-software/manifest": "0.2.13",
64
64
  "@agentos-software/opencode": "0.2.7",
65
65
  "@agentos-software/pi": "0.2.7",
66
66
  "@aws-sdk/client-s3": "^3.1019.0",
67
- "@rivet-dev/agentos-sidecar": "0.2.12",
67
+ "@rivet-dev/agentos-sidecar": "0.2.13",
68
68
  "@rivetkit/bare-ts": "^0.6.2",
69
- "@rivet-dev/agentos-runtime-core": "0.2.12",
69
+ "@rivet-dev/agentos-runtime-core": "0.2.13",
70
70
  "@xterm/headless": "^6.0.0",
71
71
  "better-sqlite3": "^12.8.0",
72
72
  "croner": "^10.0.1",
@@ -96,12 +96,12 @@
96
96
  "@agentos-software/pi": "0.2.7",
97
97
  "@agentos-software/ripgrep": "0.3.3",
98
98
  "@agentos-software/sed": "0.3.4",
99
- "@agentos-software/tar": "0.3.4",
99
+ "@agentos-software/tar": "0.3.5",
100
100
  "@agentos-software/tree": "0.3.3",
101
101
  "@agentos-software/vim": "0.3.3",
102
102
  "@agentos-software/wget": "0.3.3",
103
103
  "@agentos-software/yq": "0.3.3",
104
- "@rivet-dev/agentos-test-harness": "0.2.12",
104
+ "@rivet-dev/agentos-test-harness": "0.2.13",
105
105
  "@anthropic-ai/claude-agent-sdk": "^0.2.87",
106
106
  "@anthropic-ai/claude-code": "^2.1.86",
107
107
  "@bare-ts/tools": "0.15.0",