@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/docs/architecture.md
CHANGED
|
@@ -20,13 +20,18 @@ Global does the work. Project only configures *this* repo. Do not copy `~/.tlc/h
|
|
|
20
20
|
```mermaid
|
|
21
21
|
graph LR
|
|
22
22
|
subgraph one["One machine"]
|
|
23
|
-
R["
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
R["`~/.tlc/harness
|
|
24
|
+
*runtime, CLI, hooks*`"]
|
|
25
|
+
CU["`cursor config
|
|
26
|
+
*hooks.json*`"]
|
|
27
|
+
CL["`claude config
|
|
28
|
+
*settings.json*`"]
|
|
26
29
|
end
|
|
27
30
|
subgraph repo["One repository, shared by both"]
|
|
28
|
-
PC["config.json
|
|
29
|
-
|
|
31
|
+
PC["`config.json
|
|
32
|
+
*policy, tracked*`"]
|
|
33
|
+
ST["`state/
|
|
34
|
+
*handoff, lessons, obs*`"]
|
|
30
35
|
end
|
|
31
36
|
CU --> R
|
|
32
37
|
CL --> R
|
|
@@ -55,11 +60,16 @@ Arrows are imports, and every one of them is checked mechanically:
|
|
|
55
60
|
|
|
56
61
|
```mermaid
|
|
57
62
|
graph TD
|
|
58
|
-
E["entrypoints
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
E["`entrypoints/
|
|
64
|
+
*one file per hook handler*`"]
|
|
65
|
+
C["`core/
|
|
66
|
+
*steering logic, provider-agnostic*`"]
|
|
67
|
+
P["`providers/
|
|
68
|
+
*one ACL adapter per provider*`"]
|
|
69
|
+
K["`contracts/
|
|
70
|
+
*shared vocabulary*`"]
|
|
71
|
+
L["`platform/
|
|
72
|
+
*OS primitives*`"]
|
|
63
73
|
|
|
64
74
|
E --> C
|
|
65
75
|
E --> P
|
package/docs/providers/cursor.md
CHANGED
|
@@ -13,7 +13,8 @@ Source: `src/providers/cursor/`.
|
|
|
13
13
|
## Detection
|
|
14
14
|
|
|
15
15
|
`cursor.detect.ts`: a raw hook payload is Cursor's when `hook_event_name` is camelCase (e.g.
|
|
16
|
-
`beforeShellExecution`)
|
|
16
|
+
`beforeShellExecution`). `workspace_roots` is read when present but not required: a payload without it used to
|
|
17
|
+
match no provider and be answered with nothing, which Cursor's fail-closed hooks treat as a deny.
|
|
17
18
|
|
|
18
19
|
## Capability descriptor
|
|
19
20
|
|
package/package.json
CHANGED
package/src/entrypoints/run.ts
CHANGED
|
@@ -154,7 +154,7 @@ function asRecord(value: unknown): Record<string, unknown> {
|
|
|
154
154
|
export async function runHandler(handler: Handler, io: RunIo = {}): Promise<RunOutcome> {
|
|
155
155
|
const readStdin = io.readStdin ?? readStdinText;
|
|
156
156
|
const now = io.now ? io.now() : new Date();
|
|
157
|
-
const abstainRendered: Rendered = { stdout:
|
|
157
|
+
const abstainRendered: Rendered = { stdout: "{}", exitCode: 0 };
|
|
158
158
|
|
|
159
159
|
const text = await readStdin();
|
|
160
160
|
const trimmed = text.trim();
|
|
@@ -7,8 +7,5 @@ export function detectCursor(raw: unknown): boolean {
|
|
|
7
7
|
}
|
|
8
8
|
const value = raw as Record<string, unknown>;
|
|
9
9
|
const eventName = value.hook_event_name;
|
|
10
|
-
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return Array.isArray(value.workspace_roots);
|
|
10
|
+
return typeof eventName === "string" && CAMEL_CASE_EVENT_NAME.test(eventName);
|
|
14
11
|
}
|