skillmkt 0.1.6 → 0.1.7
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/client/bin/skillmkt.js
CHANGED
|
@@ -36,9 +36,11 @@ async function bareRun(ctx) {
|
|
|
36
36
|
process.exit(1);
|
|
37
37
|
}
|
|
38
38
|
const mod = await import('../commands/init.js');
|
|
39
|
+
withState(ctx);
|
|
39
40
|
return mod.run(ctx);
|
|
40
41
|
}
|
|
41
42
|
const { renderDashboard } = await import('../lib/dashboard.js');
|
|
43
|
+
withState(ctx);
|
|
42
44
|
return renderDashboard(ctx);
|
|
43
45
|
}
|
|
44
46
|
|
package/client/commands/serve.js
CHANGED
|
@@ -9,7 +9,7 @@ import { loadDecisions, decide } from '../lib/decide.js';
|
|
|
9
9
|
import { readLibrary, readLock, readConfig, writeConfig, registerSkill, updateLock, ensureHub } from '../lib/hub.js';
|
|
10
10
|
import { readUpstream } from '../lib/state.js';
|
|
11
11
|
import { readYAML } from '../../pipeline/lib/util.js';
|
|
12
|
-
import { scanAll } from '../lib/scanner.js';
|
|
12
|
+
import { scanAll, detectHarnesses } from '../lib/scanner.js';
|
|
13
13
|
import { probeEndpoints, chat } from '../lib/llm.js';
|
|
14
14
|
import { projectSkill, targetDirFor } from '../lib/project.js';
|
|
15
15
|
import { treeHash } from '../lib/package.js';
|
|
@@ -28,14 +28,15 @@ export async function startServer(ctx, { quiet = false, port = 0 } = {}) {
|
|
|
28
28
|
let lastActive = Date.now();
|
|
29
29
|
const idleMs = (ctx.config.daemon?.idle_minutes ?? 30) * 60e3;
|
|
30
30
|
|
|
31
|
+
const harnesses = ctx.harnesses ?? detectHarnesses(); // bareRun/init 路径 ctx 可能没 withState
|
|
31
32
|
const state = () => ({
|
|
32
33
|
hub: ctx.hub,
|
|
33
34
|
initialized: (() => { const r = readConfig(ctx.hub)._raw; return !!(r.ui || r.llm || r.default_targets); })(),
|
|
34
35
|
library: readLibrary(ctx.hub), lock: readLock(ctx.hub),
|
|
35
36
|
upstream: readUpstream(ctx.hub), conflicts: loadConflicts(ctx.hub),
|
|
36
|
-
decisions: loadDecisions(ctx.hub), harnesses
|
|
37
|
+
decisions: loadDecisions(ctx.hub), harnesses,
|
|
37
38
|
scans: fs.existsSync(path.join(ctx.hub, 'scans')) ? fs.readdirSync(path.join(ctx.hub, 'scans')).map((f) => readYAML(path.join(ctx.hub, 'scans', f))).filter(Boolean) : [],
|
|
38
|
-
scans_all: scanAll(ctx.hub,
|
|
39
|
+
scans_all: scanAll(ctx.hub, harnesses, readLibrary(ctx.hub), ctx.cwd),
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
const routes = {
|
|
@@ -115,7 +116,10 @@ export async function startServer(ctx, { quiet = false, port = 0 } = {}) {
|
|
|
115
116
|
res.writeHead(404); return res.end('{"error":"not found"}');
|
|
116
117
|
}
|
|
117
118
|
const h = routes[`${req.method} ${u.pathname}`];
|
|
118
|
-
if (h)
|
|
119
|
+
if (h) {
|
|
120
|
+
try { return res.end(JSON.stringify(await h())); }
|
|
121
|
+
catch (e) { res.writeHead(500); return res.end(JSON.stringify({ error: e.message })); }
|
|
122
|
+
}
|
|
119
123
|
res.writeHead(404); return res.end('{"error":"not found"}');
|
|
120
124
|
}
|
|
121
125
|
// 静态:public/ + evidence 文件(冲突截图)
|
package/client/public/index.html
CHANGED
|
@@ -77,7 +77,7 @@ th { font-size: 13px; color: var(--color-ink-mut); font-weight: 500; }
|
|
|
77
77
|
footer { padding: 20px 28px; border-top: 1px solid var(--color-line); font-size: 13px; color: var(--color-ink-mut); }
|
|
78
78
|
</style></head><body>
|
|
79
79
|
<header>
|
|
80
|
-
<h1>
|
|
80
|
+
<h1>awesome-skill-market</h1>
|
|
81
81
|
<nav>
|
|
82
82
|
<button class="on" data-t="skills">skills</button>
|
|
83
83
|
<button data-t="conflicts">conflicts</button>
|