@clear-capabilities/agentic-security-scanner 0.147.0 → 0.148.0
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/CHANGELOG.md +204 -0
- package/bin/agentic-security.js +47 -15
- package/dist/1122.index.js +79 -2
- package/dist/3180.index.js +73 -1
- package/dist/5051.index.js +77 -6
- package/dist/agentic-security.mjs +2 -2
- package/dist/agentic-security.mjs.sha256 +1 -1
- package/dist/compliance-frameworks/nist-800-171-r3.json +1269 -0
- package/dist/frontend/index.html +21 -0
- package/dist/frontend/src/app.js +176 -0
- package/dist/frontend/src/components/evidence-inspector.js +141 -0
- package/dist/frontend/src/components/filter-rail.js +119 -0
- package/dist/frontend/src/components/query-bar.js +126 -0
- package/dist/frontend/src/data/flagship-graph.js +1460 -0
- package/dist/frontend/src/export-entry.js +36 -0
- package/dist/frontend/src/lib/api-client.js +92 -0
- package/dist/frontend/src/lib/contrast.js +34 -0
- package/dist/frontend/src/lib/dom.js +24 -0
- package/dist/frontend/src/lib/escape-html.js +16 -0
- package/dist/frontend/src/lib/flow-path.js +40 -0
- package/dist/frontend/src/lib/focus-controls.js +149 -0
- package/dist/frontend/src/lib/protection-visual.js +46 -0
- package/dist/frontend/src/lib/query-language.js +240 -0
- package/dist/frontend/src/lib/row-filters.js +43 -0
- package/dist/frontend/src/lib/state.js +84 -0
- package/dist/frontend/src/main.js +83 -0
- package/dist/frontend/src/shell.js +184 -0
- package/dist/frontend/src/views/architecture-view.js +798 -0
- package/dist/frontend/src/views/inventory-view.js +292 -0
- package/dist/frontend/src/views/privacy-view.js +172 -0
- package/dist/frontend/src/views/trace-view.js +206 -0
- package/dist/frontend/styles/architecture-view.css +93 -0
- package/dist/frontend/styles/filter-rail.css +34 -0
- package/dist/frontend/styles/inspector.css +69 -0
- package/dist/frontend/styles/inventory-view.css +74 -0
- package/dist/frontend/styles/privacy-view.css +86 -0
- package/dist/frontend/styles/query-bar.css +107 -0
- package/dist/frontend/styles/shell.css +155 -0
- package/dist/frontend/styles/tokens.css +128 -0
- package/dist/frontend/styles/trace-view.css +95 -0
- package/package.json +2 -2
- package/src/posture/auditor-walkthrough.js +89 -6
- package/src/posture/compliance-frameworks/nist-800-171-r3.json +1269 -0
- package/src/server/static-assets.js +11 -6
- package/src/shared/frontend-root.js +52 -0
|
@@ -14,14 +14,19 @@
|
|
|
14
14
|
|
|
15
15
|
import * as path from 'node:path';
|
|
16
16
|
import { fileURLToPath } from 'node:url';
|
|
17
|
+
import { resolveFrontendRoot } from '../shared/frontend-root.js';
|
|
17
18
|
|
|
18
|
-
// Located
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
19
|
+
// Located relative to this module's own directory (path.dirname(
|
|
20
|
+
// fileURLToPath(import.meta.url)), the same pattern scanner/src/mcp/server.js
|
|
21
|
+
// uses), but via resolveFrontendRoot's search-upward strategy rather than a
|
|
22
|
+
// single hardcoded relative depth — a fixed `../../../frontend` resolved
|
|
23
|
+
// correctly for this file's unbundled dev location but broke (silently, at
|
|
24
|
+
// runtime, for every real npx/npm user) once `npm run build` split this
|
|
25
|
+
// module into its own dist/ chunk, whose import.meta.url reflects dist/'s
|
|
26
|
+
// own shallower location. See src/shared/frontend-root.js for the full story
|
|
27
|
+
// and scripts/copy-frontend.mjs for the build-time copy this now finds.
|
|
23
28
|
const _here = path.dirname(fileURLToPath(import.meta.url));
|
|
24
|
-
export const FRONTEND_ROOT =
|
|
29
|
+
export const FRONTEND_ROOT = resolveFrontendRoot(_here);
|
|
25
30
|
|
|
26
31
|
export const CONTENT_TYPE_MAP = Object.freeze({
|
|
27
32
|
'.html': 'text/html; charset=utf-8',
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// frontend-root.js — locates the Data Flow Explorer's `frontend/` assets
|
|
2
|
+
// (index.html/src/styles) regardless of whether this code is running:
|
|
3
|
+
// - unbundled, straight out of scanner/src/ or scanner/scripts/ (dev/test —
|
|
4
|
+
// frontend/ is a monorepo sibling of scanner/, 2-3 levels up), or
|
|
5
|
+
// - bundled by `npm run build` (ncc splits a dynamic import() into its own
|
|
6
|
+
// chunk file physically written into scanner/dist/, so import.meta.url
|
|
7
|
+
// inside that chunk reflects dist/'s own location, not the original
|
|
8
|
+
// source file's — a fixed relative-levels-up path that was correct for
|
|
9
|
+
// one depth breaks silently at the other), or
|
|
10
|
+
// - installed from the published npm package, where the build copies
|
|
11
|
+
// frontend/'s servable files into scanner/dist/frontend/ (a sibling of
|
|
12
|
+
// the chunk file itself, i.e. 0 levels up) — see scripts/copy-frontend.mjs.
|
|
13
|
+
//
|
|
14
|
+
// Rather than hardcode one of those depths (the bug this file fixes: every
|
|
15
|
+
// consumer used to hardcode the dev-only depth), search upward from the
|
|
16
|
+
// caller's own directory and take the first candidate that actually has a
|
|
17
|
+
// frontend/index.html on disk. Never guessed silently past that — a caller
|
|
18
|
+
// with no match anywhere gets a clear, actionable error instead of a
|
|
19
|
+
// downstream ENOENT/404 with no indication why.
|
|
20
|
+
|
|
21
|
+
import * as fs from 'node:fs';
|
|
22
|
+
import * as path from 'node:path';
|
|
23
|
+
|
|
24
|
+
const MAX_LEVELS_UP = 4;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string} startDir - `path.dirname(fileURLToPath(import.meta.url))`
|
|
28
|
+
* of the CALLING module (not this file) — each caller's own bundled/
|
|
29
|
+
* unbundled location determines which candidate depth resolves.
|
|
30
|
+
* @returns {string} absolute path to a real `frontend/` directory containing
|
|
31
|
+
* `index.html`.
|
|
32
|
+
* @throws if no candidate directory up to MAX_LEVELS_UP contains one.
|
|
33
|
+
*/
|
|
34
|
+
export function resolveFrontendRoot(startDir) {
|
|
35
|
+
const tried = [];
|
|
36
|
+
for (let up = 0; up <= MAX_LEVELS_UP; up++) {
|
|
37
|
+
const candidate = path.resolve(startDir, ...Array(up).fill('..'), 'frontend');
|
|
38
|
+
tried.push(candidate);
|
|
39
|
+
// Every caller invokes resolveFrontendRoot() once, at module-load time,
|
|
40
|
+
// to compute a top-level FRONTEND_ROOT const (see static-assets.js /
|
|
41
|
+
// generate-html-report.mjs) — never per-request inside the explore
|
|
42
|
+
// server's request handler. At most MAX_LEVELS_UP+1 (5) sync stat calls
|
|
43
|
+
// at process startup is not a request-path DoS surface.
|
|
44
|
+
if (fs.existsSync(path.join(candidate, 'index.html'))) return candidate; // agentic-security-ignore: dos-sync-io
|
|
45
|
+
}
|
|
46
|
+
throw new Error(
|
|
47
|
+
`resolveFrontendRoot: no frontend/index.html found searching up from ${startDir}. ` +
|
|
48
|
+
`Tried: ${tried.join(', ')}. If you're running from a source checkout, run \`npm run build\` ` +
|
|
49
|
+
`first (it copies frontend/ into scanner/dist/frontend/); if you're running the published ` +
|
|
50
|
+
`package, this indicates a packaging defect — report it.`
|
|
51
|
+
);
|
|
52
|
+
}
|