@srobroek/pi-agent-reviewer 0.18.0 → 0.19.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.
- package/CHANGELOG.md +12 -0
- package/_kit/prereqs.ts +15 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## agent-reviewer [0.19.1](https://github.com/srobroek/harness-plugins/compare/agent-reviewer--v0.19.0...agent-reviewer--v0.19.1) (2026-12-03)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **kit:** bump @srobroek/harness-kit to 1.11.1 (prereq probe timeout) ([206f2c4](https://github.com/srobroek/harness-plugins/commit/206f2c4c6c0dee08d9f06977db78f778b2fd1bf6))
|
|
6
|
+
|
|
7
|
+
## agent-reviewer [0.19.0](https://github.com/srobroek/harness-plugins/compare/agent-reviewer--v0.18.0...agent-reviewer--v0.19.0) (2026-12-02)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **beads:** add beads-hygiene ledger audit skill and ledger-auditor agents ([611b67a](https://github.com/srobroek/harness-plugins/commit/611b67a0a6e02ec7a1917170843feb946766a4a7))
|
|
12
|
+
|
|
1
13
|
## agent-reviewer [0.18.0](https://github.com/srobroek/harness-plugins/compare/agent-reviewer--v0.17.1...agent-reviewer--v0.18.0) (2026-11-30)
|
|
2
14
|
|
|
3
15
|
### Features
|
package/_kit/prereqs.ts
CHANGED
|
@@ -74,6 +74,9 @@ export interface Finding {
|
|
|
74
74
|
prerequisite: Prerequisite
|
|
75
75
|
problem: "missing" | "version"
|
|
76
76
|
found?: string
|
|
77
|
+
/** Set when `<bin> --version` did not answer within `timeoutMs`, as opposed to answering with something unreadable. */
|
|
78
|
+
timedOut?: boolean
|
|
79
|
+
timeoutMs?: number
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
export type Env = Record<string, string | undefined>
|
|
@@ -102,7 +105,8 @@ interface Api {
|
|
|
102
105
|
type Version = readonly [number, number, number]
|
|
103
106
|
type Comparator = { op: "<" | "<=" | ">" | ">="; version: Version }
|
|
104
107
|
|
|
105
|
-
|
|
108
|
+
/** Python and node CLIs take 1 to 2 s to start cold on a loaded machine, and many extensions start at once. */
|
|
109
|
+
export const VERSION_TIMEOUT_MS = 10_000
|
|
106
110
|
const OPERATOR = /^(<=|>=|<|>|=|\^|~)?v?(.+)$/
|
|
107
111
|
const NUMBER = /^\d+$/
|
|
108
112
|
const WILDCARD = /^[xX*]$/
|
|
@@ -215,20 +219,21 @@ export function which(bin: string, dirs: readonly string[]): string | undefined
|
|
|
215
219
|
return undefined
|
|
216
220
|
}
|
|
217
221
|
|
|
218
|
-
function readVersion(file: string): string
|
|
219
|
-
const run = spawnSync(file, ["--version"], { encoding: "utf8", timeout:
|
|
220
|
-
if (run.error) return
|
|
221
|
-
|
|
222
|
+
function readVersion(file: string, timeoutMs: number): { found?: string; timedOut?: true } {
|
|
223
|
+
const run = spawnSync(file, ["--version"], { encoding: "utf8", timeout: timeoutMs, killSignal: "SIGKILL", stdio: ["ignore", "pipe", "pipe"] })
|
|
224
|
+
if (run.error) return (run.error as NodeJS.ErrnoException).code === "ETIMEDOUT" ? { timedOut: true } : {}
|
|
225
|
+
const found = versionIn(`${run.stdout ?? ""}\n${run.stderr ?? ""}`)
|
|
226
|
+
return found === undefined ? {} : { found }
|
|
222
227
|
}
|
|
223
228
|
|
|
224
229
|
/** The unmet prerequisites of a manifest, in its order. Runs the lookups and version commands on every call. */
|
|
225
|
-
export function check(manifest: Manifest, root: string, env: Env): Finding[] {
|
|
230
|
+
export function check(manifest: Manifest, root: string, env: Env, timeoutMs = VERSION_TIMEOUT_MS): Finding[] {
|
|
226
231
|
return manifest.prerequisites.flatMap((prerequisite): Finding[] => {
|
|
227
232
|
const file = which(prerequisite.bin, searchPath(prerequisite, root, env))
|
|
228
233
|
if (!file) return [{ prerequisite, problem: "missing" }]
|
|
229
234
|
if (!prerequisite.version) return []
|
|
230
|
-
const found = readVersion(file)
|
|
231
|
-
if (found === undefined) return [{ prerequisite, problem: "version" }]
|
|
235
|
+
const { found, timedOut } = readVersion(file, timeoutMs)
|
|
236
|
+
if (found === undefined) return [{ prerequisite, problem: "version", ...(timedOut ? { timedOut, timeoutMs } : {}) }]
|
|
232
237
|
return satisfies(found, prerequisite.version) ? [] : [{ prerequisite, problem: "version", found }]
|
|
233
238
|
})
|
|
234
239
|
}
|
|
@@ -240,9 +245,9 @@ export function installHint(install: Install): string {
|
|
|
240
245
|
}
|
|
241
246
|
|
|
242
247
|
/** One unmet prerequisite: what it is for, what is wrong, and how to install it. */
|
|
243
|
-
export function describeFinding({ prerequisite, problem, found }: Finding): string {
|
|
248
|
+
export function describeFinding({ prerequisite, problem, found, timedOut, timeoutMs }: Finding): string {
|
|
244
249
|
const where = prerequisite.install.npm ? "not in node_modules/.bin or on PATH" : "not on PATH"
|
|
245
|
-
const wrong = problem === "missing" ? where : found ? `version ${found} does not satisfy ${prerequisite.version}` : `cannot read its version from \`${prerequisite.bin} --version\` (needs ${prerequisite.version})`
|
|
250
|
+
const wrong = problem === "missing" ? where : found ? `version ${found} does not satisfy ${prerequisite.version}` : timedOut ? `\`${prerequisite.bin} --version\` did not answer within ${(timeoutMs ?? VERSION_TIMEOUT_MS) / 1000} s (needs ${prerequisite.version})` : `cannot read its version from \`${prerequisite.bin} --version\` (needs ${prerequisite.version})`
|
|
246
251
|
return `${prerequisite.bin} (${prerequisite.required ? "required, " : ""}for ${prerequisite.for}): ${wrong}; install: ${installHint(prerequisite.install)}`
|
|
247
252
|
}
|
|
248
253
|
|
package/package.json
CHANGED