@vellumai/cli 0.10.9 → 0.10.10-dev.202607162206.d08e98e

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/cli",
3
- "version": "0.10.9",
3
+ "version": "0.10.10-dev.202607162206.d08e98e",
4
4
  "description": "CLI tools for vellum-assistant",
5
5
  "type": "module",
6
6
  "exports": {
@@ -7,6 +7,7 @@ import {
7
7
  AVATAR_DEVICE_ENV_VAR,
8
8
  collectWatchTargets,
9
9
  dockerResourceNames,
10
+ ensureDockerDaemonRunning,
10
11
  resolveAvatarDevicePath,
11
12
  resolveDockerHatchMode,
12
13
  resolveDockerProviderCredentialSetupAction,
@@ -380,3 +381,58 @@ describe("collectWatchTargets", () => {
380
381
  expect(files).toEqual([join(repoRoot, "gateway", "package.json")]);
381
382
  });
382
383
  });
384
+
385
+ /**
386
+ * Build a fake `exec` that records calls and fails the probes named in `fail`.
387
+ * Injected into `ensureDockerDaemonRunning` so these cases need no `mock.module`
388
+ * (which is process-global and would leak across the CLI's single-process test
389
+ * run) and no real Docker/Colima subprocesses.
390
+ */
391
+ function fakeExec(fail: { dockerInfo?: boolean; colimaStatus?: boolean }) {
392
+ const calls: Array<{ cmd: string; args: string[] }> = [];
393
+ const exec = async (cmd: string, args: string[] = []): Promise<void> => {
394
+ calls.push({ cmd, args });
395
+ if (cmd === "docker" && args[0] === "info" && fail.dockerInfo) {
396
+ throw new Error("Cannot connect to the Docker daemon");
397
+ }
398
+ if (cmd === "colima" && args[0] === "status" && fail.colimaStatus) {
399
+ throw new Error("colima is not running");
400
+ }
401
+ };
402
+ const ran = (cmd: string, sub: string): boolean =>
403
+ calls.some((c) => c.cmd === cmd && c.args[0] === sub);
404
+ return { exec: exec as typeof import("../step-runner.js").exec, ran };
405
+ }
406
+
407
+ describe("ensureDockerDaemonRunning", () => {
408
+ // Regression: waking an instance hatched under Docker Desktop must NOT start
409
+ // Colima, because that switches the active `docker context` and points
410
+ // `docker start` at a VM that never held the instance's containers.
411
+ test("reuses an already-reachable daemon (e.g. Docker Desktop) and never touches Colima", async () => {
412
+ const { exec, ran } = fakeExec({ dockerInfo: false });
413
+
414
+ await ensureDockerDaemonRunning(exec);
415
+
416
+ expect(ran("docker", "info")).toBe(true);
417
+ expect(ran("colima", "status")).toBe(false);
418
+ expect(ran("colima", "start")).toBe(false);
419
+ });
420
+
421
+ test("starts Colima only when no daemon is reachable", async () => {
422
+ const { exec, ran } = fakeExec({ dockerInfo: true, colimaStatus: true });
423
+
424
+ await ensureDockerDaemonRunning(exec);
425
+
426
+ expect(ran("docker", "info")).toBe(true);
427
+ expect(ran("colima", "start")).toBe(true);
428
+ });
429
+
430
+ test("does not restart Colima when it is already running", async () => {
431
+ const { exec, ran } = fakeExec({ dockerInfo: true, colimaStatus: false });
432
+
433
+ await ensureDockerDaemonRunning(exec);
434
+
435
+ expect(ran("colima", "status")).toBe(true);
436
+ expect(ran("colima", "start")).toBe(false);
437
+ });
438
+ });
package/src/lib/docker.ts CHANGED
@@ -776,12 +776,12 @@ export async function sleepContainers(
776
776
  }
777
777
  }
778
778
 
779
- /** Start existing stopped containers, starting Colima first if it isn't running (macOS only). */
779
+ /** Start existing stopped containers, ensuring a Docker daemon is up first (macOS only). */
780
780
  export async function wakeContainers(
781
781
  res: ReturnType<typeof dockerResourceNames>,
782
782
  ): Promise<void> {
783
783
  if (platform() !== "linux") {
784
- await ensureColimaRunning();
784
+ await ensureDockerDaemonRunning();
785
785
  }
786
786
  for (const container of [
787
787
  res.assistantContainer,
@@ -793,16 +793,42 @@ export async function wakeContainers(
793
793
  }
794
794
 
795
795
  /**
796
- * Checks whether Colima is running and starts it if not.
797
- * Assumes the Docker/Colima toolchain is already installed (handled during hatch).
796
+ * Ensure a Docker daemon is reachable before waking an instance's containers
797
+ * (macOS only on Linux the daemon runs natively).
798
+ *
799
+ * If a daemon is already reachable, reuse it and return: `hatch` created the
800
+ * containers under whatever `docker context` was active at the time (Docker
801
+ * Desktop, an already-running Colima, a remote context, …), and `docker start`
802
+ * targets the active context. Unconditionally starting Colima would switch the
803
+ * active context to `colima` and point `docker start` at a VM that never held
804
+ * those containers — so Colima is only started as a fallback when no daemon is
805
+ * reachable at all (the toolchain `hatch` installs on macOS when Docker Desktop
806
+ * isn't present). This mirrors {@link ensureDockerInstalled}, which likewise
807
+ * only starts Colima when `docker info` fails.
808
+ *
809
+ * `execFn` is injectable so unit tests can drive the probe outcomes without a
810
+ * real Docker/Colima toolchain; production callers use the real {@link exec}.
811
+ * Assumes the toolchain is already installed (handled during hatch).
798
812
  */
799
- async function ensureColimaRunning(): Promise<void> {
813
+ export async function ensureDockerDaemonRunning(
814
+ execFn: typeof exec = exec,
815
+ ): Promise<void> {
800
816
  ensureLocalBinOnPath();
817
+
818
+ // A reachable daemon — Docker Desktop, a running Colima, or any other active
819
+ // context — is exactly what hatch used. Reuse it rather than forcing Colima.
820
+ try {
821
+ await execFn("docker", ["info"]);
822
+ return;
823
+ } catch {
824
+ // No daemon reachable — fall through to the Colima fallback below.
825
+ }
826
+
801
827
  try {
802
- await exec("colima", ["status"]);
828
+ await execFn("colima", ["status"]);
803
829
  } catch {
804
- console.log("🚀 Colima is not running. Starting Colima...");
805
- await exec("colima", ["start"]);
830
+ console.log("🚀 Docker daemon not running. Starting Colima...");
831
+ await execFn("colima", ["start"]);
806
832
  }
807
833
  }
808
834
 
@@ -75,6 +75,7 @@ const PROVIDER_LABELS: Record<LlmProviderId, string> = {
75
75
  minimax: "MiniMax",
76
76
  atlascloud: "Atlas Cloud",
77
77
  together: "Together AI",
78
+ baseten: "Baseten",
78
79
  };
79
80
 
80
81
  export function formatProviderName(provider: LlmProviderId): string {
@@ -190,6 +191,9 @@ export function inferProviderFromModel(model: string): string | undefined {
190
191
  if (model.startsWith("deepseek-ai/")) {
191
192
  return "atlascloud";
192
193
  }
194
+ if (model.startsWith("thinkingmachines/")) {
195
+ return "baseten";
196
+ }
193
197
  if (model.includes("/")) {
194
198
  return "openrouter";
195
199
  }
@@ -30,6 +30,7 @@ export const LLM_PROVIDER_ENV_VAR_NAMES: Record<string, string> = {
30
30
  minimax: "MINIMAX_API_KEY",
31
31
  atlascloud: "ATLASCLOUD_API_KEY",
32
32
  together: "TOGETHER_API_KEY",
33
+ baseten: "BASETEN_API_KEY",
33
34
  };
34
35
 
35
36
  /** Search-provider env var names. Mirrors `SEARCH_PROVIDER_CATALOG` BYOK entries. */