diff --git a/packages/cli/package.json b/packages/cli/package.json index 126f7daf..8ef43070 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@openrouter/spawn", - "version": "0.10.19", + "version": "0.10.20", "type": "module", "bin": { "spawn": "cli.js" diff --git a/packages/cli/src/daytona/daytona.ts b/packages/cli/src/daytona/daytona.ts index 20424415..44c16569 100644 --- a/packages/cli/src/daytona/daytona.ts +++ b/packages/cli/src/daytona/daytona.ts @@ -20,7 +20,7 @@ import { getPackagesForTier, needsNode, needsBun, NODE_INSTALL_CMD } from "../sh import { parseJsonWith, parseJsonRaw, isString, toObjectArray, toRecord } from "@openrouter/spawn-shared"; import * as v from "valibot"; import { saveVmConnection } from "../history.js"; -import { spawnInteractive } from "../shared/ssh"; +import { sleep, spawnInteractive } from "../shared/ssh"; const DAYTONA_API_BASE = "https://app.daytona.io/api"; const DAYTONA_DASHBOARD_URL = "https://app.daytona.io/"; @@ -45,10 +45,6 @@ export function getState() { // ─── API Client ────────────────────────────────────────────────────────────── -function sleep(ms: number): Promise { - return new Promise((r) => setTimeout(r, ms)); -} - const LooseObject = v.record(v.string(), v.unknown()); /** Parse a JSON string into a Record via valibot, or null. */ diff --git a/packages/cli/src/fly/fly.ts b/packages/cli/src/fly/fly.ts index 8dcc4a2e..ffed766d 100644 --- a/packages/cli/src/fly/fly.ts +++ b/packages/cli/src/fly/fly.ts @@ -20,7 +20,7 @@ import type { CloudInitTier } from "../shared/agents"; import { getPackagesForTier, needsNode, needsBun, NODE_INSTALL_CMD } from "../shared/cloud-init"; import * as v from "valibot"; import { parseJsonWith, parseJsonRaw, isString, isNumber, toObjectArray } from "@openrouter/spawn-shared"; -import { killWithTimeout, spawnInteractive } from "../shared/ssh"; +import { killWithTimeout, sleep, spawnInteractive } from "../shared/ssh"; import { saveVmConnection } from "../history.js"; const FLY_API_BASE = "https://api.machines.dev/v1"; @@ -159,10 +159,6 @@ async function flyApi(method: string, endpoint: string, body?: string, maxRetrie // ─── Helpers ───────────────────────────────────────────────────────────────── -function sleep(ms: number): Promise { - return new Promise((r) => setTimeout(r, ms)); -} - const LooseObject = v.record(v.string(), v.unknown()); function parseJson(text: string): Record | null {