@connexum/ai-governance 1.0.0-beta.18 → 1.0.0-beta.20

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.
Files changed (45) hide show
  1. package/dist/cli/index.d.ts.map +1 -1
  2. package/dist/cli/index.js +92 -26
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/cli/normalize-agent-dir.d.ts +24 -0
  5. package/dist/cli/normalize-agent-dir.d.ts.map +1 -0
  6. package/dist/cli/normalize-agent-dir.js +64 -0
  7. package/dist/cli/normalize-agent-dir.js.map +1 -0
  8. package/dist/cli/normalize-agent-dir.test.d.ts +10 -0
  9. package/dist/cli/normalize-agent-dir.test.d.ts.map +1 -0
  10. package/dist/cli/normalize-agent-dir.test.js +59 -0
  11. package/dist/cli/normalize-agent-dir.test.js.map +1 -0
  12. package/dist/dashboard/api.d.ts.map +1 -1
  13. package/dist/dashboard/api.js +3 -0
  14. package/dist/dashboard/api.js.map +1 -1
  15. package/dist/esm/cli/index.js +91 -25
  16. package/dist/esm/cli/index.js.map +1 -1
  17. package/dist/esm/cli/normalize-agent-dir.js +61 -0
  18. package/dist/esm/cli/normalize-agent-dir.js.map +1 -0
  19. package/dist/esm/cli/normalize-agent-dir.test.js +54 -0
  20. package/dist/esm/cli/normalize-agent-dir.test.js.map +1 -0
  21. package/dist/esm/dashboard/api.js +3 -0
  22. package/dist/esm/dashboard/api.js.map +1 -1
  23. package/dist/esm/governance/asi-remediation-flow.test.js +51 -0
  24. package/dist/esm/governance/asi-remediation-flow.test.js.map +1 -0
  25. package/dist/esm/governance/owasp-agentic-scanner.js +50 -7
  26. package/dist/esm/governance/owasp-agentic-scanner.js.map +1 -1
  27. package/dist/esm/governance/owasp-agentic-scanner.test.js +23 -7
  28. package/dist/esm/governance/owasp-agentic-scanner.test.js.map +1 -1
  29. package/dist/esm/governance/owasp-scanner-custom-tool-names.test.js +72 -0
  30. package/dist/esm/governance/owasp-scanner-custom-tool-names.test.js.map +1 -0
  31. package/dist/governance/asi-remediation-flow.test.d.ts +11 -0
  32. package/dist/governance/asi-remediation-flow.test.d.ts.map +1 -0
  33. package/dist/governance/asi-remediation-flow.test.js +56 -0
  34. package/dist/governance/asi-remediation-flow.test.js.map +1 -0
  35. package/dist/governance/owasp-agentic-scanner.d.ts +11 -0
  36. package/dist/governance/owasp-agentic-scanner.d.ts.map +1 -1
  37. package/dist/governance/owasp-agentic-scanner.js +50 -7
  38. package/dist/governance/owasp-agentic-scanner.js.map +1 -1
  39. package/dist/governance/owasp-agentic-scanner.test.js +23 -7
  40. package/dist/governance/owasp-agentic-scanner.test.js.map +1 -1
  41. package/dist/governance/owasp-scanner-custom-tool-names.test.d.ts +13 -0
  42. package/dist/governance/owasp-scanner-custom-tool-names.test.d.ts.map +1 -0
  43. package/dist/governance/owasp-scanner-custom-tool-names.test.js +77 -0
  44. package/dist/governance/owasp-scanner-custom-tool-names.test.js.map +1 -0
  45. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAyD7E,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MA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CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,CAAA;KAAE,CAAC,CAAC;IACzG,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ,GAAG,oBAAoB,CA0DvB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CA6QrE;AA6JD;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,EAAE,MAAM,GACjB,IAAI,CA0GN"}
package/dist/cli/index.js CHANGED
@@ -77,6 +77,7 @@ const https = __importStar(require("https"));
77
77
  const index_1 = require("../license/index");
78
78
  const governed_agent_1 = require("../governed-agent");
79
79
  const agent_dir_scanner_1 = require("./agent-dir-scanner");
80
+ const normalize_agent_dir_1 = require("./normalize-agent-dir");
80
81
  const wrap_shim_generator_1 = require("./wrap-shim-generator");
81
82
  const preflight_1 = require("./preflight");
82
83
  const preflight_report_1 = require("./preflight-report");
@@ -834,6 +835,87 @@ function uninstallGovernance(projectDir, opts = {}) {
834
835
  }
835
836
  }
836
837
  catch { /* unreadable dir — skip, never fail the uninstall */ }
838
+ // 5. `--purge` ALSO removes the AI-tool governance integration files that `init`
839
+ // generated and that the default uninstall intentionally preserves (Thomas
840
+ // 2026-06-07: "completely remove the runtime locally"). Only governance-
841
+ // authored content is touched: the Cursor/Continue governance rule files, the
842
+ // Continue config when it is governance-generated, and the CLAUDE.md
843
+ // `## Governance` section (user prose in CLAUDE.md is preserved). Empty parent
844
+ // dirs that we created are then pruned. Never force-removes a non-empty dir.
845
+ if (opts.purge) {
846
+ rmIfExists(path.join(projectDir, '.cursor', 'rules', 'governance.md'));
847
+ rmIfExists(path.join(projectDir, '.continue', 'governance.md'));
848
+ // .continue/config.yaml: remove only when it is governance-generated (small +
849
+ // references our governance wiring) — never nuke a substantial user config.
850
+ const continueCfg = path.join(projectDir, '.continue', 'config.yaml');
851
+ try {
852
+ if (fs.existsSync(continueCfg)) {
853
+ const body = fs.readFileSync(continueCfg, 'utf-8');
854
+ if (/governance/i.test(body) && body.length < 4096) {
855
+ fs.rmSync(continueCfg, { force: true });
856
+ removedPaths.push(continueCfg);
857
+ }
858
+ }
859
+ }
860
+ catch { /* leave it for the user to inspect */ }
861
+ // CLAUDE.md: strip the "## Governance" section `init` appended; if that leaves
862
+ // the file empty (it was our 10-line stub), remove it entirely.
863
+ const claudePath = path.join(projectDir, 'CLAUDE.md');
864
+ try {
865
+ if (fs.existsSync(claudePath)) {
866
+ const text = fs.readFileSync(claudePath, 'utf-8');
867
+ const idx = text.indexOf('## Governance');
868
+ if (idx !== -1) {
869
+ const after = text.slice(idx + '## Governance'.length);
870
+ const nextHeading = after.search(/\n## /);
871
+ const tail = nextHeading === -1 ? '' : after.slice(nextHeading + 1);
872
+ const stripped = (text.slice(0, idx) + tail).trim();
873
+ if (stripped.length === 0) {
874
+ fs.rmSync(claudePath, { force: true });
875
+ removedPaths.push(claudePath);
876
+ }
877
+ else {
878
+ fs.writeFileSync(claudePath, stripped + '\n');
879
+ removedPaths.push(`${claudePath} (## Governance section)`);
880
+ }
881
+ }
882
+ }
883
+ }
884
+ catch { /* leave CLAUDE.md for the user to inspect */ }
885
+ // settings.json: if stripping our hooks left only empty hook arrays / an empty
886
+ // object, remove it so the (now governance-only) .claude dir can be pruned.
887
+ const settingsFile = path.join(projectDir, '.claude', 'settings.json');
888
+ try {
889
+ if (fs.existsSync(settingsFile)) {
890
+ const s = JSON.parse(fs.readFileSync(settingsFile, 'utf-8'));
891
+ const hooks = (s['hooks'] ?? {});
892
+ const onlyHooksKey = Object.keys(s).every((k) => k === 'hooks');
893
+ const hooksEmpty = Object.values(hooks).every((v) => Array.isArray(v) && v.length === 0);
894
+ if (onlyHooksKey && hooksEmpty) {
895
+ fs.rmSync(settingsFile, { force: true });
896
+ removedPaths.push(settingsFile);
897
+ }
898
+ }
899
+ }
900
+ catch { /* leave it */ }
901
+ // Prune now-empty governance-created directories (never a non-empty user dir).
902
+ const rmdirIfEmpty = (p) => {
903
+ try {
904
+ if (fs.existsSync(p) && fs.readdirSync(p).length === 0) {
905
+ fs.rmdirSync(p);
906
+ removedPaths.push(p);
907
+ }
908
+ }
909
+ catch { /* skip */ }
910
+ };
911
+ for (const dir of [
912
+ ['.cursor', 'rules'], ['.cursor', 'audit'], ['.cursor'],
913
+ ['.continue', 'audit'], ['.continue'],
914
+ ['.claude', 'commands'], ['.claude', 'agents'], ['.claude'],
915
+ ]) {
916
+ rmdirIfEmpty(path.join(projectDir, ...dir));
917
+ }
918
+ }
837
919
  return { hooksRemoved, removedPaths, auditPreserved };
838
920
  }
839
921
  const IDE_RULES_SPECS = {
@@ -2342,7 +2424,10 @@ Usage:
2342
2424
  [--json] Output machine-readable JSON
2343
2425
  ai-governance status Show governance status
2344
2426
  ai-governance uninstall Cleanly remove governance from this project
2345
- [--purge] Also delete the audit chain (default: preserved)
2427
+ [--purge] Also delete the audit chain AND the AI-tool
2428
+ governance configs (.cursor/.continue governance
2429
+ files, CLAUDE.md ## Governance section) — full
2430
+ runtime removal (default: audit + those preserved)
2346
2431
  ai-governance discover Scan project + push signed manifests
2347
2432
  --root <path> Project directory to scan
2348
2433
  --org-id <org> Organisation identifier
@@ -2606,31 +2691,12 @@ if (isDirectRun) {
2606
2691
  // entire top-level init block to async (which would break the existing
2607
2692
  // sync interactiveInit / nonInteractiveInit paths below).
2608
2693
  void (async () => {
2609
- // Windows UNC path normalization (register-fleet: path-normalize).
2610
- // When the dashboard embeds a --agent-dir from a Windows host it may
2611
- // produce a UNC path like \\wsl.localhost\Ubuntu\root\fleet. The CLI
2612
- // runs on Linux (WSL) where this path is not resolvable. Normalize it
2613
- // to the POSIX path the local FS understands: /root/fleet.
2614
- //
2615
- // Pattern: \\wsl.localhost\<distro>\<rest> → /<rest>
2616
- // \\wsl$\<distro>\<rest> → /<rest>
2617
- // Backslashes are replaced with forward slashes after stripping the UNC prefix.
2618
- function normalizeAgentDir(rawPath) {
2619
- const wslUncRe = /^\\\\wsl(?:\.localhost|\$)\\[^\\]+\\/i;
2620
- if (wslUncRe.test(rawPath)) {
2621
- return '/' + rawPath.replace(wslUncRe, '').replace(/\\/g, '/');
2622
- }
2623
- // General UNC → POSIX: \\server\share\path → /path (best-effort)
2624
- if (rawPath.startsWith('\\\\')) {
2625
- const withFwd = rawPath.replace(/\\/g, '/');
2626
- // Strip //server/share prefix
2627
- const match = /^\/\/[^/]+\/[^/]+\/(.*)$/.exec(withFwd);
2628
- if (match)
2629
- return '/' + match[1];
2630
- }
2631
- return rawPath;
2632
- }
2633
- const normalizedAgentDirFlag = normalizeAgentDir(agentDirFlag);
2694
+ // Cross-OS, cross-LLM path normalization for whatever --agent-dir the
2695
+ // dashboard/customer/any-LLM pasted. The CLI (not the LLM) deterministically
2696
+ // converts Windows/WSL path forms to the POSIX path the local FS uses:
2697
+ // \\wsl.localhost\<distro>\root\x /root/x · C:\x /mnt/c/x · POSIX unchanged.
2698
+ // Native Windows paths are left alone. See ./normalize-agent-dir.ts.
2699
+ const normalizedAgentDirFlag = (0, normalize_agent_dir_1.normalizeAgentDir)(agentDirFlag);
2634
2700
  const resolvedAgentDir = path.isAbsolute(normalizedAgentDirFlag)
2635
2701
  ? normalizedAgentDirFlag
2636
2702
  : path.join(projectDir, normalizedAgentDirFlag);