@rivet-dev/agentos-core 0.2.8-rc.1 → 0.2.8-rc.2
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 +1 -1
- package/dist/agent-os.d.ts +5 -1
- package/dist/agent-os.js +5 -4
- package/dist/runtime-compat.d.ts +2 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/sidecar/rpc-client.js +12 -13
- package/dist/test/terminal-harness.js +0 -3
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ await vm.dispose();
|
|
|
104
104
|
| `connectTerminal` | `connectTerminal(options?: ConnectTerminalOptions): Promise<number>` | Attach a shell directly to the host terminal and wait for exit |
|
|
105
105
|
| `openShell` | `openShell(options?: OpenShellOptions): { shellId: string }` | Open an interactive shell with PTY support |
|
|
106
106
|
| `writeShell` | `writeShell(shellId: string, data: string \| Uint8Array): void` | Write data to a shell's PTY input |
|
|
107
|
-
| `onShellData` | `onShellData(shellId: string, handler: (data: Uint8Array) => void): () => void` | Subscribe to
|
|
107
|
+
| `onShellData` | `onShellData(shellId: string, handler: (data: Uint8Array) => void): () => void` | Subscribe to ordered PTY output (stdout and stderr exactly once) |
|
|
108
108
|
| `resizeShell` | `resizeShell(shellId: string, cols: number, rows: number): void` | Notify terminal resize |
|
|
109
109
|
| `closeShell` | `closeShell(shellId: string): void` | Kill the shell process |
|
|
110
110
|
|
package/dist/agent-os.d.ts
CHANGED
|
@@ -520,7 +520,11 @@ export declare class AgentOs {
|
|
|
520
520
|
connectTerminal(options?: ConnectTerminalOptions): Promise<number>;
|
|
521
521
|
/** Write data to a shell's PTY input. */
|
|
522
522
|
writeShell(shellId: string, data: string | Uint8Array): Promise<void>;
|
|
523
|
-
/**
|
|
523
|
+
/**
|
|
524
|
+
* Subscribe to ordered PTY output (stdout and stderr). Returns an unsubscribe
|
|
525
|
+
* function. `OpenShellOptions.onStderr` is a diagnostic tap for callers that
|
|
526
|
+
* need channel identity; do not render both surfaces.
|
|
527
|
+
*/
|
|
524
528
|
onShellData(shellId: string, handler: (data: Uint8Array) => void): () => void;
|
|
525
529
|
/** Notify a shell of terminal resize. */
|
|
526
530
|
resizeShell(shellId: string, cols: number, rows: number): void;
|
package/dist/agent-os.js
CHANGED
|
@@ -2017,7 +2017,11 @@ export class AgentOs {
|
|
|
2017
2017
|
throw new Error(`Shell not found: ${shellId}`);
|
|
2018
2018
|
return entry.handle.write(data);
|
|
2019
2019
|
}
|
|
2020
|
-
/**
|
|
2020
|
+
/**
|
|
2021
|
+
* Subscribe to ordered PTY output (stdout and stderr). Returns an unsubscribe
|
|
2022
|
+
* function. `OpenShellOptions.onStderr` is a diagnostic tap for callers that
|
|
2023
|
+
* need channel identity; do not render both surfaces.
|
|
2024
|
+
*/
|
|
2021
2025
|
onShellData(shellId, handler) {
|
|
2022
2026
|
const entry = this._shells.get(shellId);
|
|
2023
2027
|
if (!entry)
|
|
@@ -3210,9 +3214,6 @@ export class AgentOs {
|
|
|
3210
3214
|
...(cwd ? { cwd } : {}),
|
|
3211
3215
|
...(cols !== undefined ? { cols: Math.trunc(cols) } : {}),
|
|
3212
3216
|
...(rows !== undefined ? { rows: Math.trunc(rows) } : {}),
|
|
3213
|
-
onStderr: (data) => {
|
|
3214
|
-
this._appendAcpTerminalOutput(terminal, data);
|
|
3215
|
-
},
|
|
3216
3217
|
}),
|
|
3217
3218
|
output: "",
|
|
3218
3219
|
truncated: false,
|
package/dist/runtime-compat.d.ts
CHANGED
|
@@ -111,6 +111,7 @@ export interface ManagedProcess {
|
|
|
111
111
|
export interface ShellHandle {
|
|
112
112
|
pid: number;
|
|
113
113
|
write(data: Uint8Array | string): Promise<void>;
|
|
114
|
+
/** Ordered PTY output containing stdout and stderr exactly once. */
|
|
114
115
|
onData: ((data: Uint8Array) => void) | null;
|
|
115
116
|
resize(cols: number, rows: number): void;
|
|
116
117
|
kill(signal?: number): void;
|
|
@@ -123,6 +124,7 @@ export interface OpenShellOptions {
|
|
|
123
124
|
cwd?: string;
|
|
124
125
|
cols?: number;
|
|
125
126
|
rows?: number;
|
|
127
|
+
/** Optional stderr-only diagnostic tap; do not render it alongside `onData`. */
|
|
126
128
|
onStderr?: (data: Uint8Array) => void;
|
|
127
129
|
}
|
|
128
130
|
export interface ConnectTerminalOptions extends OpenShellOptions {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export interface ManagedProcess {
|
|
|
105
105
|
export interface ShellHandle {
|
|
106
106
|
pid: number;
|
|
107
107
|
write(data: Uint8Array | string): Promise<void>;
|
|
108
|
+
/** Ordered PTY output containing stdout and stderr exactly once. */
|
|
108
109
|
onData: ((data: Uint8Array) => void) | null;
|
|
109
110
|
resize(cols: number, rows: number): void;
|
|
110
111
|
kill(signal?: number): void;
|
|
@@ -117,6 +118,7 @@ export interface OpenShellOptions {
|
|
|
117
118
|
cwd?: string;
|
|
118
119
|
cols?: number;
|
|
119
120
|
rows?: number;
|
|
121
|
+
/** Optional stderr-only diagnostic tap; do not render it alongside `onData`. */
|
|
120
122
|
onStderr?: (data: Uint8Array) => void;
|
|
121
123
|
}
|
|
122
124
|
export interface ConnectTerminalOptions extends OpenShellOptions {
|
|
@@ -583,7 +583,7 @@ export class NativeSidecarKernelProxy {
|
|
|
583
583
|
return proc;
|
|
584
584
|
}
|
|
585
585
|
openShell(options) {
|
|
586
|
-
const
|
|
586
|
+
const terminalHandlers = new Set();
|
|
587
587
|
const stderrHandlers = new Set();
|
|
588
588
|
const command = options?.command ?? "sh";
|
|
589
589
|
const args = options?.args ??
|
|
@@ -638,7 +638,7 @@ export class NativeSidecarKernelProxy {
|
|
|
638
638
|
const normalized = normalizeSyntheticTerminalText(text);
|
|
639
639
|
updateSyntheticCursor(normalized);
|
|
640
640
|
const chunk = textEncoder.encode(normalized);
|
|
641
|
-
for (const handler of
|
|
641
|
+
for (const handler of terminalHandlers) {
|
|
642
642
|
handler(chunk);
|
|
643
643
|
}
|
|
644
644
|
};
|
|
@@ -649,7 +649,7 @@ export class NativeSidecarKernelProxy {
|
|
|
649
649
|
const normalized = normalizeSyntheticTerminalText(text);
|
|
650
650
|
updateSyntheticCursor(normalized);
|
|
651
651
|
const chunk = textEncoder.encode(normalized);
|
|
652
|
-
for (const handler of
|
|
652
|
+
for (const handler of terminalHandlers) {
|
|
653
653
|
handler(chunk);
|
|
654
654
|
}
|
|
655
655
|
};
|
|
@@ -694,7 +694,7 @@ export class NativeSidecarKernelProxy {
|
|
|
694
694
|
commandInFlight = false;
|
|
695
695
|
const promptPrefix = syntheticCursorAtLineStart ? "" : "\r\n";
|
|
696
696
|
const promptChunk = textEncoder.encode(`${promptPrefix}${promptText}`);
|
|
697
|
-
for (const handler of
|
|
697
|
+
for (const handler of terminalHandlers) {
|
|
698
698
|
handler(promptChunk);
|
|
699
699
|
}
|
|
700
700
|
syntheticCursorAtLineStart = false;
|
|
@@ -752,7 +752,7 @@ export class NativeSidecarKernelProxy {
|
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
754
|
let onData = null;
|
|
755
|
-
|
|
755
|
+
terminalHandlers.add((data) => onData?.(data));
|
|
756
756
|
if (options?.onStderr) {
|
|
757
757
|
stderrHandlers.add(options.onStderr);
|
|
758
758
|
}
|
|
@@ -921,7 +921,7 @@ export class NativeSidecarKernelProxy {
|
|
|
921
921
|
if (!sanitized) {
|
|
922
922
|
return;
|
|
923
923
|
}
|
|
924
|
-
for (const handler of
|
|
924
|
+
for (const handler of terminalHandlers) {
|
|
925
925
|
handler(sanitized);
|
|
926
926
|
}
|
|
927
927
|
if (commandInFlight) {
|
|
@@ -933,6 +933,11 @@ export class NativeSidecarKernelProxy {
|
|
|
933
933
|
if (!sanitized) {
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
|
+
// `onData` is the ordered PTY rendering stream. `onStderr` remains an
|
|
937
|
+
// optional channel-specific diagnostic tap and must not also be rendered.
|
|
938
|
+
for (const handler of terminalHandlers) {
|
|
939
|
+
handler(sanitized);
|
|
940
|
+
}
|
|
936
941
|
for (const handler of stderrHandlers) {
|
|
937
942
|
handler(sanitized);
|
|
938
943
|
}
|
|
@@ -986,13 +991,7 @@ export class NativeSidecarKernelProxy {
|
|
|
986
991
|
const stdin = process.stdin;
|
|
987
992
|
const stdout = process.stdout;
|
|
988
993
|
const { onData, ...shellOptions } = options ?? {};
|
|
989
|
-
const shell = this.openShell(
|
|
990
|
-
...shellOptions,
|
|
991
|
-
onStderr: shellOptions.onStderr ??
|
|
992
|
-
((data) => {
|
|
993
|
-
process.stderr.write(data);
|
|
994
|
-
}),
|
|
995
|
-
});
|
|
994
|
+
const shell = this.openShell(shellOptions);
|
|
996
995
|
const outputHandler = onData ??
|
|
997
996
|
((data) => {
|
|
998
997
|
stdout.write(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivet-dev/agentos-core",
|
|
3
|
-
"version": "0.2.8-rc.
|
|
3
|
+
"version": "0.2.8-rc.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
"test": "vitest run --reporter=verbose"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@agentos-software/claude-code": "0.2.8-rc.
|
|
57
|
-
"@agentos-software/codex-cli": "0.3.
|
|
58
|
-
"@agentos-software/common": "0.2.8-rc.
|
|
59
|
-
"@agentos-software/manifest": "0.2.8-rc.
|
|
60
|
-
"@agentos-software/opencode": "0.2.8-rc.
|
|
61
|
-
"@agentos-software/pi": "0.2.8-rc.
|
|
62
|
-
"@agentos-software/pi-cli": "0.2.8-rc.
|
|
56
|
+
"@agentos-software/claude-code": "0.2.8-rc.2",
|
|
57
|
+
"@agentos-software/codex-cli": "0.3.4",
|
|
58
|
+
"@agentos-software/common": "0.2.8-rc.2",
|
|
59
|
+
"@agentos-software/manifest": "0.2.8-rc.2",
|
|
60
|
+
"@agentos-software/opencode": "0.2.8-rc.2",
|
|
61
|
+
"@agentos-software/pi": "0.2.8-rc.2",
|
|
62
|
+
"@agentos-software/pi-cli": "0.2.8-rc.2",
|
|
63
63
|
"@aws-sdk/client-s3": "^3.1019.0",
|
|
64
|
-
"@rivet-dev/agentos-sidecar": "0.2.8-rc.
|
|
64
|
+
"@rivet-dev/agentos-sidecar": "0.2.8-rc.2",
|
|
65
65
|
"@rivetkit/bare-ts": "^0.6.2",
|
|
66
|
-
"@rivet-dev/agentos-runtime-core": "0.2.8-rc.
|
|
66
|
+
"@rivet-dev/agentos-runtime-core": "0.2.8-rc.2",
|
|
67
67
|
"@xterm/headless": "^6.0.0",
|
|
68
68
|
"better-sqlite3": "^12.8.0",
|
|
69
69
|
"croner": "^10.0.1",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"zod-to-json-schema": "^3.25.2"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@agentos-software/claude-code": "0.2.8-rc.
|
|
79
|
-
"@agentos-software/codex": "0.2.8-rc.
|
|
78
|
+
"@agentos-software/claude-code": "0.2.8-rc.2",
|
|
79
|
+
"@agentos-software/codex": "0.2.8-rc.2",
|
|
80
80
|
"@agentos-software/coreutils": "0.3.3",
|
|
81
81
|
"@agentos-software/curl": "0.3.3",
|
|
82
82
|
"@agentos-software/diffutils": "0.3.3",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"@agentos-software/gzip": "0.3.3",
|
|
91
91
|
"@agentos-software/http-get": "0.3.3",
|
|
92
92
|
"@agentos-software/jq": "0.3.3",
|
|
93
|
-
"@agentos-software/opencode": "0.2.8-rc.
|
|
94
|
-
"@agentos-software/pi": "0.2.8-rc.
|
|
95
|
-
"@agentos-software/pi-cli": "0.2.8-rc.
|
|
93
|
+
"@agentos-software/opencode": "0.2.8-rc.2",
|
|
94
|
+
"@agentos-software/pi": "0.2.8-rc.2",
|
|
95
|
+
"@agentos-software/pi-cli": "0.2.8-rc.2",
|
|
96
96
|
"@agentos-software/ripgrep": "0.3.3",
|
|
97
97
|
"@agentos-software/sed": "0.3.3",
|
|
98
98
|
"@agentos-software/tar": "0.3.3",
|