karajan-code 3.4.0 → 3.4.1

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 (52) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/packages/hu-board/src/routes/api.js +70 -49
  4. package/packages/hu-board/src/zombie-reaper.js +1 -1
  5. package/src/agents/aider-agent.js +1 -1
  6. package/src/agents/gemini-agent.js +1 -1
  7. package/src/agents/opencode-agent.js +1 -1
  8. package/src/audit/agent-readiness.js +2 -1
  9. package/src/audit/deterministic-summary.js +11 -5
  10. package/src/audit/issue-filter.js +3 -6
  11. package/src/audit/plan-adherence.js +3 -1
  12. package/src/audit/semgrep-findings.js +5 -1
  13. package/src/brain/agent-error-classifier.js +8 -1
  14. package/src/brain/decisor.js +2 -2
  15. package/src/brain/solomon-consult.js +2 -2
  16. package/src/brain/standby-scheduler.js +0 -2
  17. package/src/commands/audit.js +8 -3
  18. package/src/commands/board.js +1 -1
  19. package/src/commands/standby.js +4 -1
  20. package/src/config/loader.js +2 -2
  21. package/src/golden/asserter.js +3 -1
  22. package/src/golden/schema.js +1 -1
  23. package/src/hu/auto-generator.js +1 -1
  24. package/src/lang/tree-sitter-loader.js +1 -5
  25. package/src/mcp/handlers/management-handlers.js +4 -3
  26. package/src/orchestrator/drivers/post-loop.js +43 -91
  27. package/src/orchestrator/flow-runner.js +25 -0
  28. package/src/orchestrator/fs-leak-detector.js +6 -1
  29. package/src/orchestrator/preflight-checks.js +51 -0
  30. package/src/orchestrator/solomon-rules.js +12 -1
  31. package/src/prompts/audit.js +12 -11
  32. package/src/prompts/hu-reviewer.js +1 -1
  33. package/src/prompts/planner.js +1 -1
  34. package/src/rag/embedders/factory.js +0 -1
  35. package/src/rag/retriever.js +1 -1
  36. package/src/roles/agent-role.js +1 -1
  37. package/src/roles/audit-role.js +10 -2
  38. package/src/session/journal/write-all.js +89 -0
  39. package/src/sonar/discovery.js +2 -1
  40. package/src/sonar/scanner.js +1 -1
  41. package/src/utils/cli-progress.js +4 -2
  42. package/src/utils/escape-regexp.js +15 -0
  43. package/src/utils/paths.js +0 -1
  44. package/src/utils/port-occupant.js +2 -1
  45. package/src/utils/project-detect.js +1 -1
  46. package/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
  47. package/node_modules/deep-extend/CHANGELOG.md +0 -46
  48. package/node_modules/sqlite-vec/index.cjs +0 -46
  49. package/node_modules/sqlite-vec/index.d.ts +0 -17
  50. package/node_modules/sqlite-vec/index.mjs +0 -47
  51. package/node_modules/sqlite-vec-linux-x64/vec0.so +0 -0
  52. package/node_modules/which/CHANGELOG.md +0 -166
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Escape regex metacharacters so a value can be interpolated into a
3
+ * RegExp literally (KJC-TSK-0536 — closes Semgrep's
4
+ * detect-non-literal-regexp findings in one move).
5
+ *
6
+ * Use this EVERY time a variable lands inside `new RegExp(...)`. It is
7
+ * NOT for config-provided patterns (output-guard/perf-guard policies),
8
+ * which are regexes by design.
9
+ *
10
+ * @param {unknown} value - coerced to string
11
+ * @returns {string}
12
+ */
13
+ export function escapeRegExp(value) {
14
+ return String(value).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
15
+ }
@@ -9,6 +9,5 @@ export {
9
9
  getSonarComposePath,
10
10
  getOllamaComposePath,
11
11
  getWebperfDir,
12
- getRunsDir,
13
12
  getPromptsDir,
14
13
  } from "@karajan/core/paths";
@@ -9,6 +9,7 @@
9
9
  */
10
10
 
11
11
  import { runCommand } from "./process.js";
12
+ import { escapeRegExp } from "./escape-regexp.js";
12
13
 
13
14
  /**
14
15
  * @typedef {Object} PortOccupant
@@ -74,7 +75,7 @@ async function detectWindows(port) {
74
75
  if (netstat.exitCode !== 0) return null;
75
76
  const line = netstat.stdout
76
77
  .split(/\r?\n/)
77
- .find((l) => l.match(new RegExp(`:${port}\\s+.*LISTENING`)));
78
+ .find((l) => l.match(new RegExp(`:${escapeRegExp(port)}\\s+.*LISTENING`)));
78
79
  if (!line) return null;
79
80
  const parts = line.trim().split(/\s+/);
80
81
  const pid = Number(parts[parts.length - 1]) || null;
@@ -97,7 +97,7 @@ export async function detectTestFramework(cwd = process.cwd()) {
97
97
  try {
98
98
  if (marker.glob) {
99
99
  const entries = await fs.readdir(cwd);
100
- const ext = marker.file.replace("*", "");
100
+ const ext = marker.file.replaceAll("*", "");
101
101
  if (entries.some((e) => e.endsWith(ext))) {
102
102
  return { hasTests: true, framework: marker.framework, language: marker.language };
103
103
  }
@@ -1,46 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- v0.6.0
5
- ------
6
-
7
- - Updated "devDependencies" versions to fix vulnerability alerts
8
- - Dropped support of io.js and node.js v0.12.x and lower since new versions of
9
- "devDependencies" couldn't work with those old node.js versions
10
- (minimal supported version of node.js now is v4.0.0)
11
-
12
- v0.5.1
13
- ------
14
-
15
- - Fix prototype pollution vulnerability (thanks to @mwakerman for the PR)
16
- - Avoid using deprecated Buffer API (thanks to @ChALkeR for the PR)
17
-
18
- v0.5.0
19
- ------
20
-
21
- - Auto-testing provided by Travis CI;
22
- - Support older Node.JS versions (`v0.11.x` and `v0.10.x`);
23
- - Removed tests files from npm package.
24
-
25
- v0.4.2
26
- ------
27
-
28
- - Fix for `null` as an argument.
29
-
30
- v0.4.1
31
- ------
32
-
33
- - Removed test code from <b>npm</b> package
34
- ([see pull request #21](https://github.com/unclechu/node-deep-extend/pull/21));
35
- - Increased minimal version of Node from `0.4.0` to `0.12.0`
36
- (because can't run tests on lesser version anyway).
37
-
38
- v0.4.0
39
- ------
40
-
41
- - **WARNING!** Broken backward compatibility with `v0.3.x`;
42
- - Fixed bug with extending arrays instead of cloning;
43
- - Deep cloning for arrays;
44
- - Check for own property;
45
- - Fixed some documentation issues;
46
- - Strict JS mode.
@@ -1,46 +0,0 @@
1
-
2
-
3
- const { arch, platform } = require("node:process");
4
-
5
-
6
- const BASE_PACKAGE_NAME = "sqlite-vec";
7
- const ENTRYPOINT_BASE_NAME = "vec0";
8
- const supportedPlatforms = [["darwin","x64"],["linux","x64"],["darwin","arm64"],["win32","x64"],["linux","arm64"]];
9
-
10
- const invalidPlatformErrorMessage = `Unsupported platform for ${BASE_PACKAGE_NAME}, on a ${platform}-${arch} machine. Supported platforms are (${supportedPlatforms
11
- .map(([p, a]) => `${p}-${a}`)
12
- .join(",")}). Consult the ${BASE_PACKAGE_NAME} NPM package README for details.`;
13
-
14
- const extensionNotFoundErrorMessage = packageName => `Loadble extension for ${BASE_PACKAGE_NAME} not found. Was the ${packageName} package installed?`;
15
-
16
- function validPlatform(platform, arch) {
17
- return (
18
- supportedPlatforms.find(([p, a]) => platform === p && arch === a) !== undefined
19
- );
20
- }
21
- function extensionSuffix(platform) {
22
- if (platform === "win32") return "dll";
23
- if (platform === "darwin") return "dylib";
24
- return "so";
25
- }
26
- function platformPackageName(platform, arch) {
27
- const os = platform === "win32" ? "windows" : platform;
28
- return `${BASE_PACKAGE_NAME}-${os}-${arch}`;
29
- }
30
-
31
- function getLoadablePath() {
32
- if (!validPlatform(platform, arch)) {
33
- throw new Error(
34
- invalidPlatformErrorMessage
35
- );
36
- }
37
- const packageName = platformPackageName(platform, arch);
38
- const loadablePath = require.resolve(packageName + "/" + ENTRYPOINT_BASE_NAME + "." + extensionSuffix(platform));
39
- return loadablePath;
40
- }
41
-
42
- function load(db) {
43
- db.loadExtension(getLoadablePath());
44
- }
45
-
46
- module.exports = {getLoadablePath, load};
@@ -1,17 +0,0 @@
1
-
2
-
3
- /**
4
- * TODO JSDoc
5
- */
6
- export declare function getLoadablePath(): string;
7
-
8
-
9
- interface Db {
10
- loadExtension(file: string, entrypoint?: string | undefined): void;
11
- }
12
-
13
- /**
14
- * TODO JSDoc
15
- */
16
- export declare function load(db: Db): void;
17
-
@@ -1,47 +0,0 @@
1
-
2
-
3
- import { fileURLToPath } from "node:url";
4
- import { arch, platform } from "node:process";
5
-
6
-
7
- const BASE_PACKAGE_NAME = "sqlite-vec";
8
- const ENTRYPOINT_BASE_NAME = "vec0";
9
- const supportedPlatforms = [["darwin","x64"],["linux","x64"],["darwin","arm64"],["win32","x64"],["linux","arm64"]];
10
-
11
- const invalidPlatformErrorMessage = `Unsupported platform for ${BASE_PACKAGE_NAME}, on a ${platform}-${arch} machine. Supported platforms are (${supportedPlatforms
12
- .map(([p, a]) => `${p}-${a}`)
13
- .join(",")}). Consult the ${BASE_PACKAGE_NAME} NPM package README for details.`;
14
-
15
- const extensionNotFoundErrorMessage = packageName => `Loadble extension for ${BASE_PACKAGE_NAME} not found. Was the ${packageName} package installed?`;
16
-
17
- function validPlatform(platform, arch) {
18
- return (
19
- supportedPlatforms.find(([p, a]) => platform === p && arch === a) !== undefined
20
- );
21
- }
22
- function extensionSuffix(platform) {
23
- if (platform === "win32") return "dll";
24
- if (platform === "darwin") return "dylib";
25
- return "so";
26
- }
27
- function platformPackageName(platform, arch) {
28
- const os = platform === "win32" ? "windows" : platform;
29
- return `${BASE_PACKAGE_NAME}-${os}-${arch}`;
30
- }
31
-
32
- function getLoadablePath() {
33
- if (!validPlatform(platform, arch)) {
34
- throw new Error(
35
- invalidPlatformErrorMessage
36
- );
37
- }
38
- const packageName = platformPackageName(platform, arch);
39
- const loadablePath = fileURLToPath(import.meta.resolve(packageName + "/" + ENTRYPOINT_BASE_NAME + "." + extensionSuffix(platform)));
40
- return loadablePath;
41
- }
42
-
43
- function load(db) {
44
- db.loadExtension(getLoadablePath());
45
- }
46
-
47
- export {getLoadablePath, load};
@@ -1,166 +0,0 @@
1
- # Changes
2
-
3
-
4
- ## 2.0.2
5
-
6
- * Rename bin to `node-which`
7
-
8
- ## 2.0.1
9
-
10
- * generate changelog and publish on version bump
11
- * enforce 100% test coverage
12
- * Promise interface
13
-
14
- ## 2.0.0
15
-
16
- * Parallel tests, modern JavaScript, and drop support for node < 8
17
-
18
- ## 1.3.1
19
-
20
- * update deps
21
- * update travis
22
-
23
- ## v1.3.0
24
-
25
- * Add nothrow option to which.sync
26
- * update tap
27
-
28
- ## v1.2.14
29
-
30
- * appveyor: drop node 5 and 0.x
31
- * travis-ci: add node 6, drop 0.x
32
-
33
- ## v1.2.13
34
-
35
- * test: Pass missing option to pass on windows
36
- * update tap
37
- * update isexe to 2.0.0
38
- * neveragain.tech pledge request
39
-
40
- ## v1.2.12
41
-
42
- * Removed unused require
43
-
44
- ## v1.2.11
45
-
46
- * Prevent changelog script from being included in package
47
-
48
- ## v1.2.10
49
-
50
- * Use env.PATH only, not env.Path
51
-
52
- ## v1.2.9
53
-
54
- * fix for paths starting with ../
55
- * Remove unused `is-absolute` module
56
-
57
- ## v1.2.8
58
-
59
- * bullet items in changelog that contain (but don't start with) #
60
-
61
- ## v1.2.7
62
-
63
- * strip 'update changelog' changelog entries out of changelog
64
-
65
- ## v1.2.6
66
-
67
- * make the changelog bulleted
68
-
69
- ## v1.2.5
70
-
71
- * make a changelog, and keep it up to date
72
- * don't include tests in package
73
- * Properly handle relative-path executables
74
- * appveyor
75
- * Attach error code to Not Found error
76
- * Make tests pass on Windows
77
-
78
- ## v1.2.4
79
-
80
- * Fix typo
81
-
82
- ## v1.2.3
83
-
84
- * update isexe, fix regression in pathExt handling
85
-
86
- ## v1.2.2
87
-
88
- * update deps, use isexe module, test windows
89
-
90
- ## v1.2.1
91
-
92
- * Sometimes windows PATH entries are quoted
93
- * Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
94
- * doc cli
95
-
96
- ## v1.2.0
97
-
98
- * Add support for opt.all and -as cli flags
99
- * test the bin
100
- * update travis
101
- * Allow checking for multiple programs in bin/which
102
- * tap 2
103
-
104
- ## v1.1.2
105
-
106
- * travis
107
- * Refactored and fixed undefined error on Windows
108
- * Support strict mode
109
-
110
- ## v1.1.1
111
-
112
- * test +g exes against secondary groups, if available
113
- * Use windows exe semantics on cygwin & msys
114
- * cwd should be first in path on win32, not last
115
- * Handle lower-case 'env.Path' on Windows
116
- * Update docs
117
- * use single-quotes
118
-
119
- ## v1.1.0
120
-
121
- * Add tests, depend on is-absolute
122
-
123
- ## v1.0.9
124
-
125
- * which.js: root is allowed to execute files owned by anyone
126
-
127
- ## v1.0.8
128
-
129
- * don't use graceful-fs
130
-
131
- ## v1.0.7
132
-
133
- * add license to package.json
134
-
135
- ## v1.0.6
136
-
137
- * isc license
138
-
139
- ## 1.0.5
140
-
141
- * Awful typo
142
-
143
- ## 1.0.4
144
-
145
- * Test for path absoluteness properly
146
- * win: Allow '' as a pathext if cmd has a . in it
147
-
148
- ## 1.0.3
149
-
150
- * Remove references to execPath
151
- * Make `which.sync()` work on Windows by honoring the PATHEXT variable.
152
- * Make `isExe()` always return true on Windows.
153
- * MIT
154
-
155
- ## 1.0.2
156
-
157
- * Only files can be exes
158
-
159
- ## 1.0.1
160
-
161
- * Respect the PATHEXT env for win32 support
162
- * should 0755 the bin
163
- * binary
164
- * guts
165
- * package
166
- * 1st