helixevo 0.2.9 → 0.2.11
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/dashboard/next.config.mjs +19 -3
- package/dist/cli.js +41 -1
- package/package.json +1 -1
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import { readFileSync } from 'fs'
|
|
1
|
+
import { readFileSync, existsSync } from 'fs'
|
|
2
2
|
import { join, dirname } from 'path'
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
4
|
|
|
5
5
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
6
6
|
|
|
7
7
|
function getVersion() {
|
|
8
|
+
// 1. Check env var (set by CLI when spawning dashboard)
|
|
9
|
+
if (process.env.HELIXEVO_VERSION && process.env.HELIXEVO_VERSION !== '0.0.0') {
|
|
10
|
+
return process.env.HELIXEVO_VERSION
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 2. Check .helixevo-version marker (written by copyToHelix for npm users)
|
|
14
|
+
const markerFile = join(__dirname, '.helixevo-version')
|
|
15
|
+
if (existsSync(markerFile)) {
|
|
16
|
+
try {
|
|
17
|
+
const v = readFileSync(markerFile, 'utf-8').trim()
|
|
18
|
+
if (v) return v
|
|
19
|
+
} catch {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 3. Check parent package.json (dev: dashboard/ -> repo root)
|
|
8
23
|
const candidates = [
|
|
9
|
-
join(__dirname, '..', 'package.json'),
|
|
10
|
-
join(__dirname, 'package.json'),
|
|
24
|
+
join(__dirname, '..', 'package.json'),
|
|
25
|
+
join(__dirname, 'package.json'),
|
|
11
26
|
]
|
|
12
27
|
for (const p of candidates) {
|
|
13
28
|
try {
|
|
@@ -15,6 +30,7 @@ function getVersion() {
|
|
|
15
30
|
if (pkg.name === 'helixevo' && pkg.version) return pkg.version
|
|
16
31
|
} catch {}
|
|
17
32
|
}
|
|
33
|
+
|
|
18
34
|
return '0.0.0'
|
|
19
35
|
}
|
|
20
36
|
|
package/dist/cli.js
CHANGED
|
@@ -12350,6 +12350,8 @@ import { join as join15, dirname as dirname3 } from "node:path";
|
|
|
12350
12350
|
import { existsSync as existsSync10, cpSync as cpSync3, mkdirSync as mkdirSync4, readdirSync as readdirSync2, readFileSync as readFileSync8, rmSync as rmSync2, writeFileSync as writeFileSync9 } from "node:fs";
|
|
12351
12351
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
12352
12352
|
import { homedir as homedir3 } from "node:os";
|
|
12353
|
+
init_skills();
|
|
12354
|
+
init_data();
|
|
12353
12355
|
var __filename = "/Users/tianchichen/Documents/GitHub/helixevo/src/commands/dashboard.ts";
|
|
12354
12356
|
var HELIX_DASHBOARD_DIR = join15(homedir3(), ".helix", "dashboard");
|
|
12355
12357
|
async function dashboardCommand() {
|
|
@@ -12373,12 +12375,13 @@ async function dashboardCommand() {
|
|
|
12373
12375
|
process.exit(1);
|
|
12374
12376
|
}
|
|
12375
12377
|
}
|
|
12378
|
+
ensureSkillGraph();
|
|
12376
12379
|
console.log(` \uD83C\uDF10 Starting HelixEvo Dashboard v${VERSION} at http://localhost:3847
|
|
12377
12380
|
`);
|
|
12378
12381
|
const child = spawn2("npx", ["next", "dev", "--port", "3847"], {
|
|
12379
12382
|
cwd: dir,
|
|
12380
12383
|
stdio: "inherit",
|
|
12381
|
-
env: { ...process.env }
|
|
12384
|
+
env: { ...process.env, HELIXEVO_VERSION: VERSION }
|
|
12382
12385
|
});
|
|
12383
12386
|
setTimeout(() => {
|
|
12384
12387
|
try {
|
|
@@ -12489,6 +12492,43 @@ function copyToHelix(sourceDir) {
|
|
|
12489
12492
|
writeFileSync9(join15(HELIX_DASHBOARD_DIR, ".helixevo-version"), VERSION);
|
|
12490
12493
|
return HELIX_DASHBOARD_DIR;
|
|
12491
12494
|
}
|
|
12495
|
+
function ensureSkillGraph() {
|
|
12496
|
+
try {
|
|
12497
|
+
const existing = loadSkillGraph();
|
|
12498
|
+
const skills = loadAllGeneralSkills();
|
|
12499
|
+
if (skills.length === 0)
|
|
12500
|
+
return;
|
|
12501
|
+
const existingIds = new Set(existing.nodes.map((n) => n.id));
|
|
12502
|
+
const newSkills = skills.filter((s) => !existingIds.has(s.slug));
|
|
12503
|
+
if (existing.nodes.length > 0 && newSkills.length === 0)
|
|
12504
|
+
return;
|
|
12505
|
+
const existingNodes = existing.nodes;
|
|
12506
|
+
const newNodes = newSkills.map((s) => ({
|
|
12507
|
+
id: s.slug,
|
|
12508
|
+
name: s.slug,
|
|
12509
|
+
layer: "system",
|
|
12510
|
+
score: 0.7,
|
|
12511
|
+
generation: 0,
|
|
12512
|
+
status: "active",
|
|
12513
|
+
tags: [],
|
|
12514
|
+
failureCount: 0,
|
|
12515
|
+
lastEvolved: new Date().toISOString()
|
|
12516
|
+
}));
|
|
12517
|
+
const allNodes = [...existingNodes, ...newNodes];
|
|
12518
|
+
const graph = {
|
|
12519
|
+
updated: new Date().toISOString(),
|
|
12520
|
+
nodes: allNodes,
|
|
12521
|
+
edges: existing.edges,
|
|
12522
|
+
clusters: existing.clusters
|
|
12523
|
+
};
|
|
12524
|
+
saveSkillGraph(graph);
|
|
12525
|
+
if (existing.nodes.length === 0) {
|
|
12526
|
+
console.log(` ✓ Discovered ${allNodes.length} skills for dashboard`);
|
|
12527
|
+
} else if (newSkills.length > 0) {
|
|
12528
|
+
console.log(` ✓ Added ${newSkills.length} new skills to dashboard (${allNodes.length} total)`);
|
|
12529
|
+
}
|
|
12530
|
+
} catch {}
|
|
12531
|
+
}
|
|
12492
12532
|
|
|
12493
12533
|
// src/commands/watch.ts
|
|
12494
12534
|
import { join as join17 } from "node:path";
|
package/package.json
CHANGED