Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(web): build @aisoc/report-card in the web image so /tools/coverage ships

Beenu Arora0299033d7f32
diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile
index f19718cb9..9a9ad603c 100644
--- a/apps/web/Dockerfile
+++ b/apps/web/Dockerfile
@@ -77,9 +77,12 @@ ENV NEXT_PUBLIC_DEMO_AUTOLOGIN_PASSWORD=${NEXT_PUBLIC_DEMO_AUTOLOGIN_PASSWORD}
# so tsup/tsc bin shims resolve correctly inside each workspace package.
RUN pnpm install --no-frozen-lockfile
-# Build workspace packages then the Next.js app.
+# Build workspace packages then the Next.js app. @aisoc/report-card must be
+# built here too — the /tools/coverage page imports it, and without its dist the
+# route silently drops from the build (404 in prod).
RUN pnpm --filter @aisoc/types build && \
pnpm --filter @aisoc/ui build && \
+ pnpm --filter @aisoc/report-card build && \
pnpm --filter @aisoc/web build
# ─── Runner ───────────────────────────────────────────────────────────────────
diff --git a/apps/web/vitest.config.ts b/apps/web/vitest.config.ts
index f61e1dffa..7e3d60529 100644
--- a/apps/web/vitest.config.ts
+++ b/apps/web/vitest.config.ts
@@ -64,6 +64,10 @@ export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
+ // @aisoc/report-card ships dist-based exports (built in the Docker image
+ // + turbo ^build). vitest runs without a prior build, so resolve it from
+ // source here — the package is pure TS with no build-time transform.
+ '@aisoc/report-card': path.resolve(__dirname, '../../packages/report-card/src/index.ts'),
},
},
});
diff --git a/packages/aisoc-action/dist/index.js b/packages/aisoc-action/dist/index.js
index 0a64f0f6d..41240282d 100644
--- a/packages/aisoc-action/dist/index.js
+++ b/packages/aisoc-action/dist/index.js
@@ -353,7 +353,7 @@ async function fetchAlerts(client, owner, repo, sources) {
return { alerts, notes };
}
-// ../report-card/src/index.ts
+// ../report-card/dist/index.js
function coverageGrade(percent) {
if (percent >= 90) return "A";
if (percent >= 75) return "B";
diff --git a/packages/report-card/package.json b/packages/report-card/package.json
index 61ee7f3a7..eb27804e3 100644
--- a/packages/report-card/package.json
+++ b/packages/report-card/package.json
@@ -4,13 +4,13 @@
"description": "Shared, dependency-free renderer for AiSOC share cards (triage summaries, ATT&CK coverage grades, investigation-replay verdicts) as SVG + Markdown. Used by the aisoc CLI --share flag, the noise-tuning dashboard, and the web OG image routes.",
"license": "MIT",
"type": "module",
- "main": "./src/index.ts",
- "module": "./src/index.ts",
- "types": "./src/index.ts",
+ "main": "./dist/index.js",
+ "module": "./dist/index.js",
+ "types": "./dist/index.d.ts",
"exports": {
".": {
- "types": "./src/index.ts",
- "import": "./src/index.ts"
+ "types": "./dist/index.d.ts",
+ "import": "./dist/index.js"
}
},
"files": ["dist", "src"],