nebula-ai 0.1.16 → 0.1.17

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 CHANGED
@@ -145,7 +145,7 @@ The same surface is available from the command line:
145
145
  - `models default [model]` — show, or set, the workspace default model (admin/owner only). This is the model every conversation without its own pin runs on.
146
146
  - `models curate [--add <ids...>] [--remove <ids...>]` — choose which vendor models the workspace offers. The allowlist starts empty, so only the Nebula tiers are selectable until you add some.
147
147
  - `models custom list|add|remove` — bring-your-own models: a routing alias (`--alias <model-id>`) or an OpenAI-compatible endpoint (`--base-url`, `--model-id`, `--auth`). Add `--device <id>` to lock a model to one machine — required for a `localhost` endpoint — and `--share` to make it visible to the whole workspace.
148
- - `local-device` — manage computer use and the on-host daemon (enable, disable, status, logs, start, stop, restart, exec-mode get/set, claude-code get/set — which Claude Code install a turn on this device runs with; `NEBULA_CLAUDE_COMMAND` overrides it for one process).
148
+ - `local-device` — manage computer use and the on-host daemon (enable, disable, status, logs, start, stop, restart, exec-mode get/set, claude-code get — where this device's Claude Code command resolves and its version; the command itself is set per harness under Settings → External agents).
149
149
  - `install` / `uninstall` — `install` is an alias of `local-device enable`; `uninstall` turns computer use off, stops the daemon, and removes this device.
150
150
  - `status` — current CLI, auth, daemon, device, and folder state.
151
151
  - `usage` — workspace token usage, cache savings, request count, and model cost (default: last 7 days; use `--days <n>`). Supports `--json` for launchers and dashboards.
@@ -194,7 +194,6 @@ No events are sent when telemetry is disabled.
194
194
  | `NEBULA_AI_DOWNLOAD_BASE` | Use an alternate mirror for the prebuilt binary download (useful behind restrictive firewalls). |
195
195
  | `NEBULA_AI_NO_UPDATE_CHECK` | Set to `1` to suppress the daily update check. Already suppressed under `npx`, CI, or a non-TTY stderr. |
196
196
  | `NEBULA_API_BASE` | Override the Nebula API base URL (alternative to the `--api-url` flag). |
197
- | `NEBULA_CLAUDE_COMMAND` | The Claude Code command a turn on this device runs with, for one process; overrides `local-device claude-code set`. |
198
197
  | `NEBULA_WEB_URL` | Override the web origin `login` sends you to for approval. Unset, the CLI trusts the URL the API returns, which is right for every backend, including `--api-url` ones. Set it only when the web app you want to approve on is not the one the API names. |
199
198
  | `NEBULA_AUTH_TOKEN` | Use a pre-minted auth token instead of the stored credential. Scripting / CI escape hatch — takes precedence over the encrypted on-disk store. |
200
199
  | `NEBULA_DEBUG` / `DEBUG=nebula-cli` | Enable verbose logging (same effect as `-v/--verbose`). |
package/bin/nebula-ai.js CHANGED
@@ -157,10 +157,28 @@ function getCacheDir(version) {
157
157
  * Remove cached binaries for versions other than the current one.
158
158
  * Only touches directories whose names are `v<semver>` — leaves
159
159
  * non-version entries (e.g. `update-check.json`) untouched.
160
- * Best-effort: individual removal failures are silently ignored so one
161
- * stuck directory doesn't prevent the rest from being cleaned up.
160
+ * Best-effort: one stuck directory doesn't prevent the rest from being
161
+ * cleaned up, and it is retried on a later upgrade.
162
+ *
163
+ * Deleting the old binary is also what tells a daemon still running it
164
+ * to exit and be respawned from this version (its binary watcher sees
165
+ * the path go, #2978). Windows refuses to delete a running executable,
166
+ * so there the delete fails and the daemon would run stale code
167
+ * indefinitely; renaming a running executable is allowed, so the binary
168
+ * is moved aside instead and the directory goes on a later run.
162
169
  */
163
170
  const VERSION_CACHE_DIR_RE = /^v\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
171
+ function moveRunningBinaryAside(versionDir) {
172
+ if (process.platform !== "win32")
173
+ return;
174
+ const bin = join(versionDir, platformKey, binName);
175
+ try {
176
+ renameSync(bin, `${bin}.old`);
177
+ }
178
+ catch {
179
+ // Already gone, or not ours to move; the next run retries.
180
+ }
181
+ }
164
182
  function cleanupOldVersions(currentVersion) {
165
183
  try {
166
184
  const base = getCacheBaseDir();
@@ -169,11 +187,12 @@ function cleanupOldVersions(currentVersion) {
169
187
  if (entry.isDirectory() &&
170
188
  VERSION_CACHE_DIR_RE.test(entry.name) &&
171
189
  entry.name !== currentDir) {
190
+ const dir = join(base, entry.name);
172
191
  try {
173
- rmSync(join(base, entry.name), { recursive: true, force: true });
192
+ rmSync(dir, { recursive: true, force: true });
174
193
  }
175
194
  catch {
176
- // best-effort — skip this entry and continue
195
+ moveRunningBinaryAside(dir);
177
196
  }
178
197
  }
179
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nebula-ai",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "CLI/TUI for the nebula.gg AI task orchestration platform",
5
5
  "type": "module",
6
6
  "bin": {