@shrkcrft/cli 0.1.0-alpha.10 → 0.1.0-alpha.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-api-server.d.ts","sourceRoot":"","sources":["../../src/dashboard/dashboard-api-server.ts"],"names":[],"mappings":"AA4DA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AA2BD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAqC1F;
|
|
1
|
+
{"version":3,"file":"dashboard-api-server.d.ts","sourceRoot":"","sources":["../../src/dashboard/dashboard-api-server.ts"],"names":[],"mappings":"AA4DA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,+FAA+F;IAC/F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,UAAU,aAAa;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AA2BD,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAqC1F;AA2jBD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -249,6 +249,12 @@ async function handle(req, res, ctx) {
|
|
|
249
249
|
if (!path.startsWith('/api/') && opts.staticDir) {
|
|
250
250
|
return serveStatic(res, opts.staticDir, path);
|
|
251
251
|
}
|
|
252
|
+
// Non-API request with no static UI installed. Common when @shrkcrft/cli
|
|
253
|
+
// is consumed without @shrkcrft/dashboard present. Return a helpful page
|
|
254
|
+
// instead of falling through to the cryptic "Unknown route: /".
|
|
255
|
+
if (!path.startsWith('/api/') && !opts.staticDir) {
|
|
256
|
+
return serveNoUiHint(res, path);
|
|
257
|
+
}
|
|
252
258
|
// Session live events (SSE). Subscribe via EventSource on the session detail page.
|
|
253
259
|
const sseMatch = path.match(/^\/api\/sessions\/([^/]+)\/events$/);
|
|
254
260
|
if (sseMatch) {
|
|
@@ -505,6 +511,25 @@ function serveSessionReportHtml(res, cwd, sessionId) {
|
|
|
505
511
|
}
|
|
506
512
|
res.end(html);
|
|
507
513
|
}
|
|
514
|
+
function serveNoUiHint(res, urlPath) {
|
|
515
|
+
const accept = (res.req?.headers['accept'] ?? '');
|
|
516
|
+
const wantsHtml = accept.includes('text/html');
|
|
517
|
+
if (wantsHtml) {
|
|
518
|
+
const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>SharkCraft dashboard — UI not installed</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>body{font-family:ui-sans-serif,system-ui,-apple-system,sans-serif;max-width:680px;margin:48px auto;padding:0 16px;color:#1f2937;line-height:1.55}code,pre{background:#f3f4f6;padding:2px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}pre{padding:12px;overflow:auto}h1{font-size:20px;margin-top:0}a{color:#2563eb}</style></head><body><h1>SharkCraft dashboard</h1><p>The API is running, but the web UI bundle (<code>@shrkcrft/dashboard</code>) was not found next to <code>@shrkcrft/cli</code>.</p><p>Install or upgrade it alongside the CLI:</p><pre>npm i -D @shrkcrft/dashboard@alpha</pre><p>Or point the server at a local build:</p><pre>shrk dashboard --dev-assets path/to/dashboard/dist</pre><p>The API itself is available — try <a href="/api/health">/api/health</a> or <a href="/api/overview">/api/overview</a>.</p></body></html>`;
|
|
519
|
+
res.statusCode = 200;
|
|
520
|
+
res.setHeader('content-type', 'text/html; charset=utf-8');
|
|
521
|
+
res.setHeader('cache-control', 'no-store');
|
|
522
|
+
res.setHeader('x-content-type-options', 'nosniff');
|
|
523
|
+
res.setHeader('referrer-policy', 'no-referrer');
|
|
524
|
+
if ((res.req?.method ?? 'GET') === 'HEAD') {
|
|
525
|
+
res.end();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
res.end(html);
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
respondError(res, 404, 'not-found', `No UI assets installed; ${urlPath} cannot be served. Install @shrkcrft/dashboard or pass --dev-assets.`);
|
|
532
|
+
}
|
|
508
533
|
function serveStatic(res, staticDir, urlPath) {
|
|
509
534
|
// Strip leading / and resolve against staticDir. Reject traversal.
|
|
510
535
|
const rel = urlPath.replace(/^\/+/, '');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shrkcrft/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
4
4
|
"description": "SharkCraft CLI (`shrk`): structured project intelligence for AI coding agents.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "SharkCraft contributors",
|
|
@@ -47,35 +47,36 @@
|
|
|
47
47
|
"typecheck": "tsc --noEmit -p tsconfig.json"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@shrkcrft/core": "^0.1.0-alpha.
|
|
51
|
-
"@shrkcrft/config": "^0.1.0-alpha.
|
|
52
|
-
"@shrkcrft/workspace": "^0.1.0-alpha.
|
|
53
|
-
"@shrkcrft/knowledge": "^0.1.0-alpha.
|
|
54
|
-
"@shrkcrft/context": "^0.1.0-alpha.
|
|
55
|
-
"@shrkcrft/rules": "^0.1.0-alpha.
|
|
56
|
-
"@shrkcrft/paths": "^0.1.0-alpha.
|
|
57
|
-
"@shrkcrft/templates": "^0.1.0-alpha.
|
|
58
|
-
"@shrkcrft/plugin-api": "^0.1.0-alpha.
|
|
59
|
-
"@shrkcrft/dashboard
|
|
60
|
-
"@shrkcrft/
|
|
61
|
-
"@shrkcrft/
|
|
62
|
-
"@shrkcrft/
|
|
63
|
-
"@shrkcrft/
|
|
64
|
-
"@shrkcrft/
|
|
65
|
-
"@shrkcrft/
|
|
66
|
-
"@shrkcrft/
|
|
67
|
-
"@shrkcrft/
|
|
68
|
-
"@shrkcrft/
|
|
69
|
-
"@shrkcrft/
|
|
70
|
-
"@shrkcrft/
|
|
71
|
-
"@shrkcrft/
|
|
72
|
-
"@shrkcrft/
|
|
73
|
-
"@shrkcrft/
|
|
74
|
-
"@shrkcrft/
|
|
75
|
-
"@shrkcrft/
|
|
76
|
-
"@shrkcrft/
|
|
77
|
-
"@shrkcrft/
|
|
78
|
-
"@shrkcrft/
|
|
50
|
+
"@shrkcrft/core": "^0.1.0-alpha.11",
|
|
51
|
+
"@shrkcrft/config": "^0.1.0-alpha.11",
|
|
52
|
+
"@shrkcrft/workspace": "^0.1.0-alpha.11",
|
|
53
|
+
"@shrkcrft/knowledge": "^0.1.0-alpha.11",
|
|
54
|
+
"@shrkcrft/context": "^0.1.0-alpha.11",
|
|
55
|
+
"@shrkcrft/rules": "^0.1.0-alpha.11",
|
|
56
|
+
"@shrkcrft/paths": "^0.1.0-alpha.11",
|
|
57
|
+
"@shrkcrft/templates": "^0.1.0-alpha.11",
|
|
58
|
+
"@shrkcrft/plugin-api": "^0.1.0-alpha.11",
|
|
59
|
+
"@shrkcrft/dashboard": "^0.1.0-alpha.11",
|
|
60
|
+
"@shrkcrft/dashboard-api": "^0.1.0-alpha.11",
|
|
61
|
+
"@shrkcrft/pipelines": "^0.1.0-alpha.11",
|
|
62
|
+
"@shrkcrft/presets": "^0.1.0-alpha.11",
|
|
63
|
+
"@shrkcrft/boundaries": "^0.1.0-alpha.11",
|
|
64
|
+
"@shrkcrft/graph": "^0.1.0-alpha.11",
|
|
65
|
+
"@shrkcrft/rule-graph": "^0.1.0-alpha.11",
|
|
66
|
+
"@shrkcrft/structural-search": "^0.1.0-alpha.11",
|
|
67
|
+
"@shrkcrft/impact-engine": "^0.1.0-alpha.11",
|
|
68
|
+
"@shrkcrft/context-planner": "^0.1.0-alpha.11",
|
|
69
|
+
"@shrkcrft/architecture-guard": "^0.1.0-alpha.11",
|
|
70
|
+
"@shrkcrft/framework-scanners": "^0.1.0-alpha.11",
|
|
71
|
+
"@shrkcrft/api-surface-diff": "^0.1.0-alpha.11",
|
|
72
|
+
"@shrkcrft/quality-gates": "^0.1.0-alpha.11",
|
|
73
|
+
"@shrkcrft/migrate": "^0.1.0-alpha.11",
|
|
74
|
+
"@shrkcrft/generator": "^0.1.0-alpha.11",
|
|
75
|
+
"@shrkcrft/importer": "^0.1.0-alpha.11",
|
|
76
|
+
"@shrkcrft/inspector": "^0.1.0-alpha.11",
|
|
77
|
+
"@shrkcrft/ai": "^0.1.0-alpha.11",
|
|
78
|
+
"@shrkcrft/shared": "^0.1.0-alpha.11",
|
|
79
|
+
"@shrkcrft/mcp-server": "^0.1.0-alpha.11"
|
|
79
80
|
},
|
|
80
81
|
"publishConfig": {
|
|
81
82
|
"access": "public"
|