Support remote project tabs with local OpenCode bridge
Keeps provider credentials local while executing OpenCode shell and file tools against the selected remote workspace over SSH.
This commit is contained in:
@@ -19,6 +19,7 @@ export interface ISshRunOptions {
|
||||
batchMode?: boolean;
|
||||
cwd?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
stdin?: string | Buffer;
|
||||
}
|
||||
|
||||
export interface ISshRunResult {
|
||||
@@ -232,7 +233,7 @@ export const runSshCommand = async (
|
||||
cwd: options.cwd,
|
||||
env,
|
||||
shell: false,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
stdio: options.stdin === undefined ? ['ignore', 'pipe', 'pipe'] : ['pipe', 'pipe', 'pipe'],
|
||||
windowsHide: true,
|
||||
});
|
||||
|
||||
@@ -247,8 +248,11 @@ export const runSshCommand = async (
|
||||
}, options.timeoutMs)
|
||||
: undefined;
|
||||
|
||||
child.stdout.on('data', (chunk: Buffer) => stdout.push(chunk));
|
||||
child.stderr.on('data', (chunk: Buffer) => stderr.push(chunk));
|
||||
child.stdout!.on('data', (chunk: Buffer) => stdout.push(chunk));
|
||||
child.stderr!.on('data', (chunk: Buffer) => stderr.push(chunk));
|
||||
if (options.stdin !== undefined) {
|
||||
child.stdin!.end(options.stdin);
|
||||
}
|
||||
child.on('error', (error) => {
|
||||
finished = true;
|
||||
if (timeout) {
|
||||
|
||||
Reference in New Issue
Block a user