omegon 0.6.13 → 0.6.15

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.
@@ -6,6 +6,9 @@
6
6
  */
7
7
 
8
8
  import { execSync } from "node:child_process";
9
+ import { existsSync } from "node:fs";
10
+ import { homedir } from "node:os";
11
+ import { join } from "node:path";
9
12
 
10
13
  export type DepTier = "core" | "recommended" | "optional";
11
14
 
@@ -37,6 +40,29 @@ export interface InstallOption {
37
40
  cmd: string;
38
41
  }
39
42
 
43
+ /**
44
+ * Ensure well-known tool paths are on PATH before probing.
45
+ *
46
+ * Tools installed by Nix, Cargo, etc. land in directories that may not be
47
+ * in the inherited PATH (e.g. Omegon launched from a shell that predates
48
+ * the install). We patch once at module load so every hasCmd() call sees them.
49
+ */
50
+ function ensureToolPaths(): void {
51
+ const home = homedir();
52
+ const dirs = [
53
+ "/nix/var/nix/profiles/default/bin",
54
+ join(home, ".nix-profile", "bin"),
55
+ join(home, ".cargo", "bin"),
56
+ ];
57
+ const current = process.env.PATH ?? "";
58
+ const parts = current.split(":");
59
+ const missing = dirs.filter(d => existsSync(d) && !parts.includes(d));
60
+ if (missing.length > 0) {
61
+ process.env.PATH = [...missing, current].join(":");
62
+ }
63
+ }
64
+ ensureToolPaths();
65
+
40
66
  function hasCmd(cmd: string): boolean {
41
67
  try {
42
68
  execSync(`which ${cmd}`, { stdio: "ignore" });
@@ -79,7 +105,7 @@ export const DEPS: Dep[] = [
79
105
  tier: "core",
80
106
  check: () => hasCmd("nix"),
81
107
  install: [
82
- { platform: "any", cmd: "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install" },
108
+ { platform: "any", cmd: "curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm" },
83
109
  ],
84
110
  url: "https://zero-to-nix.com",
85
111
  },
@@ -319,7 +319,10 @@ export default function (pi: ExtensionAPI) {
319
319
  setTimeout(async () => {
320
320
  try {
321
321
  const { DEPS } = await import("../bootstrap/deps.ts");
322
- const probed = DEPS.filter(d => d.tier === "core" || d.tier === "recommended");
322
+ // Probe runtime deps only skip install-time bootstrapping tools (nix)
323
+ // that Omegon doesn't call directly at runtime.
324
+ const INSTALL_ONLY = new Set(["nix"]);
325
+ const probed = DEPS.filter(d => (d.tier === "core" || d.tier === "recommended") && !INSTALL_ONLY.has(d.id));
323
326
  const missing = probed.filter(d => !d.check());
324
327
  if (missing.length === 0) return;
325
328
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omegon",
3
- "version": "0.6.13",
3
+ "version": "0.6.15",
4
4
  "description": "Omegon — an opinionated distribution of pi (by Mario Zechner) with extensions for lifecycle management, memory, orchestration, and visualization",
5
5
  "bin": {
6
6
  "omegon": "bin/omegon.mjs",