@tech-leads-club/harness-toolkit 0.16.2 → 0.16.3
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/README.md +9 -5
- package/bin/tlc-exec.mjs +14 -2
- package/dist/compact-before.mjs +23 -23
- package/dist/doctor.mjs +35 -35
- package/dist/prompt-submit.mjs +25 -25
- package/dist/response-after.mjs +2 -2
- package/dist/run.mjs +22 -22
- package/dist/session-end.mjs +25 -25
- package/dist/session-start.mjs +2 -2
- package/dist/ship-gate.mjs +36 -36
- package/dist/stop.mjs +2 -2
- package/dist/subagent-start.mjs +2 -2
- package/dist/subagent-stop.mjs +24 -24
- package/dist/support.mjs +1 -1
- package/dist/tool-after.mjs +2 -2
- package/dist/tool-before.mjs +2 -2
- package/dist/tool-failure.mjs +27 -27
- package/docs/architecture.md +20 -10
- package/docs/providers/cursor.md +2 -1
- package/package.json +1 -1
- package/src/entrypoints/run.ts +1 -1
- package/src/providers/cursor/cursor.detect.ts +1 -4
package/README.md
CHANGED
|
@@ -448,11 +448,15 @@ Healthy install checklist:
|
|
|
448
448
|
|
|
449
449
|
```mermaid
|
|
450
450
|
graph LR
|
|
451
|
-
EV["provider event
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
451
|
+
EV["`provider event
|
|
452
|
+
*Cursor or Claude Code hook*`"]
|
|
453
|
+
HK["`user-level hook file`"]
|
|
454
|
+
LX["`bin/tlc-exec.mjs #60;handler#62;
|
|
455
|
+
*Bun first, Node + dist fallback*`"]
|
|
456
|
+
EP["`src/entrypoints/#60;handler#62;.ts
|
|
457
|
+
*core + resolved adapter*`"]
|
|
458
|
+
OUT["`follow-up · handoff · observability
|
|
459
|
+
*under project policy*`"]
|
|
456
460
|
EV --> HK --> LX --> EP --> OUT
|
|
457
461
|
```
|
|
458
462
|
|
package/bin/tlc-exec.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync, writeSync } from "node:fs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { delimiter, dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -235,8 +235,10 @@ export function decideRuntime({ harnessHome, entry, bunPath, nodeMajor, distExis
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
function run(harnessHome, command, commandArgs, origin = harnessHome, entry = "") {
|
|
238
|
+
const isHook = HOOK_ENTRIES.has(entry);
|
|
238
239
|
const result = spawnSync(command, commandArgs, {
|
|
239
|
-
stdio: "inherit",
|
|
240
|
+
stdio: isHook ? ["inherit", "pipe", "inherit"] : "inherit",
|
|
241
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
240
242
|
// why: `TLC_ORIGIN` is where this copy physically lives, which is not `TLC_HOME` once an npm-installed shim
|
|
241
243
|
// is driving the runtime installed under the conventional path. `tlc harness install` needs the former as
|
|
242
244
|
// its source and the latter as its destination, and nothing else in the runtime reads it.
|
|
@@ -259,6 +261,16 @@ function run(harnessHome, command, commandArgs, origin = harnessHome, entry = ""
|
|
|
259
261
|
}
|
|
260
262
|
process.exit(127);
|
|
261
263
|
}
|
|
264
|
+
if (isHook) {
|
|
265
|
+
const stdout = result.stdout ?? Buffer.alloc(0);
|
|
266
|
+
if (stdout.toString("utf8").trim() === "") {
|
|
267
|
+
console.error(
|
|
268
|
+
`tlc: ${entry} produced no verdict (exit ${result.status ?? result.signal}); carrying on without one.`,
|
|
269
|
+
);
|
|
270
|
+
carryOn();
|
|
271
|
+
}
|
|
272
|
+
writeSync(1, stdout);
|
|
273
|
+
}
|
|
262
274
|
process.exit(result.status ?? 1);
|
|
263
275
|
}
|
|
264
276
|
|