Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "1.0.2",
"version": "1.0.3",
"type": "module",
"bin": {
"spawn": "cli.js"
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/commands/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,11 @@ export async function pullChildHistory(record: SpawnRecord): Promise<void> {
const childRecords: SpawnRecord[] = [];
for (const el of parsed) {
const result = v.safeParse(SpawnRecordSchema, el);
if (result.success) {
childRecords.push(result.output);
if (result.success && result.output.id) {
childRecords.push({
...result.output,
id: result.output.id,
});
}
}
if (childRecords.length > 0) {
Expand Down
10 changes: 6 additions & 4 deletions packages/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1196,11 +1196,13 @@ export async function cmdRunHeadless(agent: string, cloud: string, opts: Headles
if (conn.user && tryCatch(() => validateUsername(conn.user)).ok) {
connectionFields.ssh_user = conn.user;
}
if (conn.server_id && tryCatch(() => validateServerIdentifier(conn.server_id)).ok) {
connectionFields.server_id = conn.server_id;
const serverId = conn.server_id;
if (serverId && tryCatch(() => validateServerIdentifier(serverId)).ok) {
connectionFields.server_id = serverId;
}
if (conn.server_name && tryCatch(() => validateServerIdentifier(conn.server_name)).ok) {
connectionFields.server_name = conn.server_name;
const serverName = conn.server_name;
if (serverName && tryCatch(() => validateServerIdentifier(serverName)).ok) {
connectionFields.server_name = serverName;
}
}

Expand Down
19 changes: 12 additions & 7 deletions packages/cli/src/local/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,19 @@ export async function runLocal(cmd: string): Promise<void> {

/** Run a command locally using an argument array (no shell interpretation). */
export async function runLocalArgs(args: ReadonlyArray<string>): Promise<void> {
const proc = Bun.spawn(args, {
stdio: [
"inherit",
"inherit",
"inherit",
const proc = Bun.spawn(
[
...args,
],
env: process.env,
});
{
stdio: [
"inherit",
"inherit",
"inherit",
],
env: process.env,
},
);
const exitCode = await proc.exited;
if (exitCode !== 0) {
throw new Error(`Command failed (exit ${exitCode}): ${args.join(" ")}`);
Expand Down
Loading