@oodarun/cli 0.1.3 → 0.1.4

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.
Files changed (2) hide show
  1. package/dist/cli.js +31 -16
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1791,27 +1791,29 @@ async function deployToolsViaRest(projectName, token, projectRoot, onProgress) {
1791
1791
  log("Deploying browser overlay tools...");
1792
1792
  const toolsDistDir = getToolsDistDir();
1793
1793
  const toolFiles = ["element-selector.js", "change-applicator.js", "bridge-client.js", "toolbar.js"];
1794
+ const uploads = [];
1794
1795
  for (const file of toolFiles) {
1795
1796
  const localPath = path4.join(toolsDistDir, file);
1796
1797
  try {
1797
1798
  const content = fs4.readFileSync(localPath, "utf-8");
1798
- await writeFile(`/home/user/.ooda/tools/${file}`, content);
1799
+ uploads.push(writeFile(`/home/user/.ooda/tools/${file}`, content));
1799
1800
  } catch {
1800
1801
  log(`Warning: ${file} not found in dist/tools \u2014 skipping`);
1801
1802
  }
1802
1803
  }
1803
- await writeFile(`${projectRoot}/ooda-vite-plugin.mjs`, OODA_VITE_PLUGIN);
1804
- try {
1805
- await exec(`cd "${projectRoot}" && node -e "require('ws')" 2>/dev/null || npm install --save-dev ws 2>/dev/null`);
1806
- } catch {
1807
- }
1808
- await writeFile("/tmp/ooda-patch-config.mjs", OODA_CONFIG_PATCH_SCRIPT);
1809
- try {
1810
- const result = await exec(`node /tmp/ooda-patch-config.mjs "${projectRoot}" 2>&1`);
1811
- log(`Config patch: ${result.trim()}`);
1812
- } catch (err) {
1813
- log(`Config patch failed: ${err instanceof Error ? err.message : String(err)}`);
1814
- }
1804
+ uploads.push(writeFile(`${projectRoot}/ooda-vite-plugin.mjs`, OODA_VITE_PLUGIN));
1805
+ uploads.push(writeFile("/tmp/ooda-patch-config.mjs", OODA_CONFIG_PATCH_SCRIPT));
1806
+ await Promise.all(uploads);
1807
+ const [, patchResult] = await Promise.all([
1808
+ exec(`cd "${projectRoot}" && node -e "require('ws')" 2>/dev/null || npm install --save-dev ws 2>/dev/null`).catch(() => {
1809
+ }),
1810
+ exec(`node /tmp/ooda-patch-config.mjs "${projectRoot}" 2>&1`).catch((err) => {
1811
+ const msg = err instanceof Error ? err.message : String(err);
1812
+ log(`Config patch failed: ${msg}`);
1813
+ return "";
1814
+ })
1815
+ ]);
1816
+ if (patchResult) log(`Config patch: ${String(patchResult).trim()}`);
1815
1817
  }
1816
1818
 
1817
1819
  // src/tools/installer.ts
@@ -2274,8 +2276,21 @@ async function createOrReuseProject(projectName, token, onProgress) {
2274
2276
  });
2275
2277
  if (res.ok) {
2276
2278
  const data = await res.json();
2277
- onProgress({ step: "Waiting for sandbox to start...", detail: "~10s" });
2278
- await new Promise((r) => setTimeout(r, 1e4));
2279
+ onProgress({ step: "Waiting for sandbox to start..." });
2280
+ for (let i = 0; i < 15; i++) {
2281
+ try {
2282
+ const params = new URLSearchParams();
2283
+ params.append("cmd", "echo");
2284
+ params.append("cmd", "ready");
2285
+ const check = await fetch(`${API_BASE}/projects/${projectName}/exec?${params}`, {
2286
+ method: "POST",
2287
+ headers
2288
+ });
2289
+ if (check.ok) break;
2290
+ } catch {
2291
+ }
2292
+ await new Promise((r) => setTimeout(r, 2e3));
2293
+ }
2279
2294
  return data.url;
2280
2295
  }
2281
2296
  if (res.status === 409) {
@@ -5307,7 +5322,7 @@ async function deployFromGitHubFlow(target, apiToken, claudeToken) {
5307
5322
  }
5308
5323
 
5309
5324
  // src/cli/index.ts
5310
- var CLI_VERSION = "0.1.3";
5325
+ var CLI_VERSION = "0.1.4";
5311
5326
  function formatMutationError(result) {
5312
5327
  const parts = [];
5313
5328
  if (result.status !== void 0) parts.push(String(result.status));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oodarun/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Launch Claude Code on cloud dev environments",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",