helixevo 0.2.3 → 0.2.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.
- package/dashboard/app/network/page.tsx +2 -14
- package/dist/cli.js +46 -31
- package/package.json +1 -1
|
@@ -3,18 +3,6 @@ import NetworkClient from './client'
|
|
|
3
3
|
|
|
4
4
|
export const dynamic = 'force-dynamic'
|
|
5
5
|
|
|
6
|
-
interface EvolutionEntry {
|
|
7
|
-
id: string
|
|
8
|
-
timestamp: string
|
|
9
|
-
action: string
|
|
10
|
-
description: string
|
|
11
|
-
outcome: string
|
|
12
|
-
outcomeReason: string
|
|
13
|
-
task: number
|
|
14
|
-
align: number
|
|
15
|
-
sideEffect: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
6
|
export default function SkillNetworkPage() {
|
|
19
7
|
const graph = loadGraph()
|
|
20
8
|
const history = loadHistory()
|
|
@@ -31,7 +19,7 @@ export default function SkillNetworkPage() {
|
|
|
31
19
|
)
|
|
32
20
|
|
|
33
21
|
// Build evolution history per skill
|
|
34
|
-
const evolutionBySkill
|
|
22
|
+
const evolutionBySkill = {}
|
|
35
23
|
for (const iter of history.iterations) {
|
|
36
24
|
for (const p of iter.proposals) {
|
|
37
25
|
if (!evolutionBySkill[p.targetSkill]) evolutionBySkill[p.targetSkill] = []
|
|
@@ -45,7 +33,7 @@ export default function SkillNetworkPage() {
|
|
|
45
33
|
}
|
|
46
34
|
|
|
47
35
|
// Load skill contents
|
|
48
|
-
const skillContents
|
|
36
|
+
const skillContents = {}
|
|
49
37
|
for (const n of graph.nodes) {
|
|
50
38
|
const raw = loadSkillContent(n.id)
|
|
51
39
|
if (raw) skillContents[n.id] = raw.match(/^---\n[\s\S]*?\n---\n([\s\S]*)$/)?.[1]?.trim() ?? raw
|
package/dist/cli.js
CHANGED
|
@@ -12312,14 +12312,14 @@ ${replay.slice(0, 800)}`
|
|
|
12312
12312
|
// src/commands/dashboard.ts
|
|
12313
12313
|
import { execSync as execSync2, spawn as spawn2 } from "node:child_process";
|
|
12314
12314
|
import { join as join14, dirname as dirname2 } from "node:path";
|
|
12315
|
-
import { existsSync as existsSync10, cpSync as cpSync3, mkdirSync as mkdirSync4 } from "node:fs";
|
|
12315
|
+
import { existsSync as existsSync10, cpSync as cpSync3, mkdirSync as mkdirSync4, readdirSync as readdirSync2, statSync as statSync2, rmSync as rmSync2 } from "node:fs";
|
|
12316
12316
|
import { fileURLToPath } from "node:url";
|
|
12317
12317
|
import { homedir as homedir3 } from "node:os";
|
|
12318
12318
|
var __filename = "/Users/tianchichen/Documents/GitHub/skillgraph/src/commands/dashboard.ts";
|
|
12319
12319
|
var HELIX_DASHBOARD_DIR = join14(homedir3(), ".helix", "dashboard");
|
|
12320
12320
|
async function dashboardCommand() {
|
|
12321
|
-
const
|
|
12322
|
-
if (!
|
|
12321
|
+
const dir = prepareDashboard();
|
|
12322
|
+
if (!dir) {
|
|
12323
12323
|
console.error(` Dashboard not found.
|
|
12324
12324
|
`);
|
|
12325
12325
|
console.error(" You can install and run it manually:");
|
|
@@ -12327,7 +12327,6 @@ async function dashboardCommand() {
|
|
|
12327
12327
|
console.error(" cd helixevo/dashboard && npm install && npx next dev --port 3847");
|
|
12328
12328
|
process.exit(1);
|
|
12329
12329
|
}
|
|
12330
|
-
const dir = ensureWritableDashboard(sourceDir);
|
|
12331
12330
|
if (!existsSync10(join14(dir, "node_modules"))) {
|
|
12332
12331
|
console.log(" Installing dashboard dependencies...");
|
|
12333
12332
|
try {
|
|
@@ -12357,7 +12356,33 @@ async function dashboardCommand() {
|
|
|
12357
12356
|
process.exit(code ?? 0);
|
|
12358
12357
|
});
|
|
12359
12358
|
}
|
|
12360
|
-
function
|
|
12359
|
+
function prepareDashboard() {
|
|
12360
|
+
const devDir = findDevDashboard();
|
|
12361
|
+
if (devDir)
|
|
12362
|
+
return devDir;
|
|
12363
|
+
const npmSource = findNpmDashboard();
|
|
12364
|
+
if (npmSource)
|
|
12365
|
+
return copyToHelix(npmSource);
|
|
12366
|
+
if (existsSync10(join14(HELIX_DASHBOARD_DIR, "package.json"))) {
|
|
12367
|
+
return HELIX_DASHBOARD_DIR;
|
|
12368
|
+
}
|
|
12369
|
+
return null;
|
|
12370
|
+
}
|
|
12371
|
+
function findDevDashboard() {
|
|
12372
|
+
const candidates = [
|
|
12373
|
+
join14(process.cwd(), "dashboard")
|
|
12374
|
+
];
|
|
12375
|
+
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
12376
|
+
candidates.push(join14(home, "Documents", "GitHub", "helixevo", "dashboard"));
|
|
12377
|
+
candidates.push(join14(home, "Documents", "GitHub", "skillgraph", "dashboard"));
|
|
12378
|
+
for (const dir of candidates) {
|
|
12379
|
+
if (existsSync10(join14(dir, "package.json")) && !dir.includes("node_modules")) {
|
|
12380
|
+
return dir;
|
|
12381
|
+
}
|
|
12382
|
+
}
|
|
12383
|
+
return null;
|
|
12384
|
+
}
|
|
12385
|
+
function findNpmDashboard() {
|
|
12361
12386
|
const candidates = [];
|
|
12362
12387
|
try {
|
|
12363
12388
|
const thisFile = typeof __filename !== "undefined" ? __filename : fileURLToPath(import.meta.url);
|
|
@@ -12369,11 +12394,6 @@ function findDashboardSource() {
|
|
|
12369
12394
|
candidates.push(join14(globalPrefix, "lib", "node_modules", "helixevo", "dashboard"));
|
|
12370
12395
|
candidates.push(join14(globalPrefix, "node_modules", "helixevo", "dashboard"));
|
|
12371
12396
|
} catch {}
|
|
12372
|
-
candidates.push(HELIX_DASHBOARD_DIR);
|
|
12373
|
-
const home = process.env.HOME ?? process.env.USERPROFILE ?? "";
|
|
12374
|
-
candidates.push(join14(home, "Documents", "GitHub", "helixevo", "dashboard"));
|
|
12375
|
-
candidates.push(join14(home, "Documents", "GitHub", "skillgraph", "dashboard"));
|
|
12376
|
-
candidates.push(join14(process.cwd(), "dashboard"));
|
|
12377
12397
|
for (const dir of candidates) {
|
|
12378
12398
|
if (existsSync10(join14(dir, "package.json"))) {
|
|
12379
12399
|
return dir;
|
|
@@ -12381,25 +12401,20 @@ function findDashboardSource() {
|
|
|
12381
12401
|
}
|
|
12382
12402
|
return null;
|
|
12383
12403
|
}
|
|
12384
|
-
function
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
const sourceMtime = __require("fs").statSync(sourcePackage).mtimeMs;
|
|
12395
|
-
const destMtime = __require("fs").statSync(destPackage).mtimeMs;
|
|
12396
|
-
if (sourceMtime <= destMtime) {
|
|
12397
|
-
return HELIX_DASHBOARD_DIR;
|
|
12398
|
-
}
|
|
12404
|
+
function copyToHelix(sourceDir) {
|
|
12405
|
+
const destPkg = join14(HELIX_DASHBOARD_DIR, "package.json");
|
|
12406
|
+
if (existsSync10(destPkg)) {
|
|
12407
|
+
try {
|
|
12408
|
+
const srcTime = statSync2(join14(sourceDir, "package.json")).mtimeMs;
|
|
12409
|
+
const dstTime = statSync2(destPkg).mtimeMs;
|
|
12410
|
+
if (srcTime <= dstTime) {
|
|
12411
|
+
return HELIX_DASHBOARD_DIR;
|
|
12412
|
+
}
|
|
12413
|
+
} catch {}
|
|
12399
12414
|
}
|
|
12400
|
-
console.log(" Setting up dashboard...");
|
|
12415
|
+
console.log(" Setting up dashboard at ~/.helix/dashboard...");
|
|
12401
12416
|
mkdirSync4(HELIX_DASHBOARD_DIR, { recursive: true });
|
|
12402
|
-
const items =
|
|
12417
|
+
const items = readdirSync2(sourceDir, { withFileTypes: true });
|
|
12403
12418
|
for (const item of items) {
|
|
12404
12419
|
if (item.name === "node_modules" || item.name === ".next")
|
|
12405
12420
|
continue;
|
|
@@ -12409,7 +12424,7 @@ function ensureWritableDashboard(sourceDir) {
|
|
|
12409
12424
|
}
|
|
12410
12425
|
const oldModules = join14(HELIX_DASHBOARD_DIR, "node_modules");
|
|
12411
12426
|
if (existsSync10(oldModules)) {
|
|
12412
|
-
|
|
12427
|
+
rmSync2(oldModules, { recursive: true });
|
|
12413
12428
|
}
|
|
12414
12429
|
return HELIX_DASHBOARD_DIR;
|
|
12415
12430
|
}
|
|
@@ -12421,7 +12436,7 @@ import { existsSync as existsSync13 } from "node:fs";
|
|
|
12421
12436
|
// src/core/auto-capture.ts
|
|
12422
12437
|
init_data();
|
|
12423
12438
|
init_llm();
|
|
12424
|
-
import { readFileSync as readFileSync8, existsSync as existsSync11, statSync as
|
|
12439
|
+
import { readFileSync as readFileSync8, existsSync as existsSync11, statSync as statSync3 } from "node:fs";
|
|
12425
12440
|
var CORRECTION_SIGNALS = [
|
|
12426
12441
|
/\bno[, ]+(?:that's|thats|that is)\s+(?:wrong|incorrect|not right)/i,
|
|
12427
12442
|
/\bdon'?t\s+do\s+(?:that|it\s+like\s+that)/i,
|
|
@@ -12509,14 +12524,14 @@ If no corrections found, return: { "corrections": [] }`
|
|
|
12509
12524
|
}
|
|
12510
12525
|
function watchEvents(options) {
|
|
12511
12526
|
const { eventsPath, project, onCapture, onError, pollIntervalMs = 5000 } = options;
|
|
12512
|
-
let lastSize = existsSync11(eventsPath) ?
|
|
12527
|
+
let lastSize = existsSync11(eventsPath) ? statSync3(eventsPath).size : 0;
|
|
12513
12528
|
let messageBuffer = [];
|
|
12514
12529
|
let pendingExtraction = false;
|
|
12515
12530
|
const interval = setInterval(async () => {
|
|
12516
12531
|
try {
|
|
12517
12532
|
if (!existsSync11(eventsPath))
|
|
12518
12533
|
return;
|
|
12519
|
-
const currentSize =
|
|
12534
|
+
const currentSize = statSync3(eventsPath).size;
|
|
12520
12535
|
if (currentSize <= lastSize)
|
|
12521
12536
|
return;
|
|
12522
12537
|
const content = readFileSync8(eventsPath, "utf-8");
|
package/package.json
CHANGED