@tech-leads-club/harness-toolkit 0.16.2 → 0.16.4
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 +10 -6
- package/bin/tlc-cli.ts +3 -3
- package/bin/tlc-exec.mjs +14 -2
- package/dist/compact-before.mjs +89 -89
- package/dist/doctor.mjs +88 -88
- package/dist/init-project.mjs +84 -84
- package/dist/install-runtime.mjs +87 -87
- package/dist/lessons-cli.mjs +81 -81
- package/dist/obs-cli.mjs +82 -82
- package/dist/prompt-submit.mjs +89 -89
- package/dist/refresh-model-prices.mjs +81 -81
- package/dist/response-after.mjs +89 -89
- package/dist/run.mjs +89 -89
- package/dist/session-end.mjs +89 -89
- package/dist/session-start.mjs +91 -91
- package/dist/shim.mjs +80 -80
- package/dist/ship-gate.mjs +83 -83
- package/dist/stop.mjs +95 -95
- package/dist/subagent-start.mjs +89 -89
- package/dist/subagent-stop.mjs +90 -90
- package/dist/support.mjs +85 -85
- package/dist/tlc-cli.mjs +97 -97
- package/dist/tool-after.mjs +89 -89
- package/dist/tool-before.mjs +98 -98
- package/dist/tool-failure.mjs +89 -89
- package/dist/uninstall-runtime.mjs +3 -3
- package/docs/architecture.md +20 -10
- package/docs/concepts.md +4 -2
- package/docs/diagnose.md +3 -2
- package/docs/providers/cursor.md +2 -1
- package/docs/troubleshooting.md +1 -1
- package/package.json +1 -1
- package/src/core/core.facade.ts +3 -0
- package/src/core/policy/policy.pause.ts +21 -0
- package/src/entrypoints/run.ts +38 -4
- package/src/entrypoints/tool-before.ts +13 -10
- package/src/platform/git.ts +15 -0
- 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
|
|
|
@@ -482,7 +486,7 @@ See `tlc harness help architecture` or [`docs/architecture.md`](docs/architectur
|
|
|
482
486
|
| `tlc harness build` | Compile `dist/` for the Node fallback path |
|
|
483
487
|
| `tlc harness test` | Run the full local gate |
|
|
484
488
|
| `tlc harness grind [on\|off]` | Lint/test follow-ups on stop |
|
|
485
|
-
| `tlc harness pause` / `resume` |
|
|
489
|
+
| `tlc harness pause` / `resume` | Circuit breaker: every hook steps aside except the floor / back on |
|
|
486
490
|
| `tlc harness mode solo\|paired\|focus` | Operator posture |
|
|
487
491
|
| `tlc harness attest` | Tamper-evident record of what each session ran under |
|
|
488
492
|
| `tlc harness handoff` | Handoff state between turns and sessions — the sanctioned reader |
|
package/bin/tlc-cli.ts
CHANGED
|
@@ -116,7 +116,7 @@ export function statusScreen(root: string): Screen {
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
label: "gates",
|
|
119
|
-
value: report.gatesPaused ? "PAUSED —
|
|
119
|
+
value: report.gatesPaused ? "PAUSED — every hook steps aside; only the floor runs" : "active",
|
|
120
120
|
level: report.gatesPaused ? "warn" : "ok",
|
|
121
121
|
},
|
|
122
122
|
],
|
|
@@ -185,13 +185,13 @@ export function setPaused(root: string, on: boolean): string {
|
|
|
185
185
|
if (on) {
|
|
186
186
|
writeFileSync(path, "");
|
|
187
187
|
coreFacade.policy.refreshPolicyBaselines(root);
|
|
188
|
-
return "
|
|
188
|
+
return "harness PAUSED — every hook steps aside (only the floor still runs) until `tlc harness resume`";
|
|
189
189
|
}
|
|
190
190
|
if (existsSync(path)) {
|
|
191
191
|
rmSync(path);
|
|
192
192
|
}
|
|
193
193
|
coreFacade.policy.refreshPolicyBaselines(root);
|
|
194
|
-
return "
|
|
194
|
+
return "harness ACTIVE again";
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
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
|
|