@fusengine/harness 0.1.20 → 0.1.22

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 (2) hide show
  1. package/README.md +31 -3
  2. package/package.json +4 -1
package/README.md CHANGED
@@ -103,6 +103,21 @@ const prompt = await gate({ sessionId, framework: "react", tool: "Write",
103
103
  The `Prompt` it returns (`{ kind: "block" | "ask" | "inform", title, reason, actions? }`)
104
104
  is portable; each adapter maps it to the harness's native shape.
105
105
 
106
+ ### Extend it
107
+
108
+ Add your own project rules without forking — they run **after** the privileged
109
+ core chain (two-tier), and the chain is **fail-closed** (a guard that throws blocks,
110
+ never silently passes):
111
+
112
+ ```ts
113
+ import { registerGuard } from "@fusengine/harness/policy";
114
+
115
+ registerGuard(({ tool, command }) =>
116
+ tool === "Bash" && command?.includes("kubectl delete")
117
+ ? { kind: "ask", title: "Confirm cluster change", reason: command }
118
+ : null);
119
+ ```
120
+
106
121
  ## Subpath exports
107
122
 
108
123
  | Subpath | What |
@@ -118,13 +133,26 @@ is portable; each adapter maps it to the harness's native shape.
118
133
  | `./config` `./util` `./state` `./statusline` `./freshness` `./init` `./cli` | env config, project-root, locks, statusline, doc-freshness, wiring templates, staged checks. |
119
134
  | `./adapters/{claude,codex,cursor,cline,gemini}` | Thin per-harness adapters. |
120
135
 
121
- See [`docs/`](./docs) for per-module guides, and run `bun run docs:api` for the
122
- generated typedoc API reference.
136
+ ## Documentation
137
+
138
+ | Guide | What |
139
+ |-------|------|
140
+ | [docs/index.md](https://github.com/fusengine/harness/blob/main/docs/index.md) | architecture overview + map |
141
+ | [docs/detect.md](https://github.com/fusengine/harness/blob/main/docs/detect.md) | harness detection (`hook` vs `cli`) |
142
+ | [docs/policy.md](https://github.com/fusengine/harness/blob/main/docs/policy.md) | `evaluate`, file-size, framework, APEX gates |
143
+ | [docs/guards.md](https://github.com/fusengine/harness/blob/main/docs/guards.md) | the guard chain, `registerGuard`, fail-closed |
144
+ | [docs/runtime.md](https://github.com/fusengine/harness/blob/main/docs/runtime.md) | `handleHook`, `gate`, tracking, MCP intercept |
145
+ | [docs/config.md](https://github.com/fusengine/harness/blob/main/docs/config.md) | env config (TTL, max-lines, refs dir) |
146
+ | [docs/modules.md](https://github.com/fusengine/harness/blob/main/docs/modules.md) | cache · refs · state · memory · statusline · util |
147
+ | [docs/adapters.md](https://github.com/fusengine/harness/blob/main/docs/adapters.md) | adapters + `harness init`/`hook` wiring |
148
+ | [CHANGELOG.md](https://github.com/fusengine/harness/blob/main/CHANGELOG.md) | release history |
149
+
150
+ Run `bun run docs:api` for the generated typedoc API reference.
123
151
 
124
152
  ## Develop
125
153
 
126
154
  ```sh
127
- bun test # 105 tests
155
+ bun test # 117 tests
128
156
  bunx tsc --noEmit # typecheck (isolatedDeclarations)
129
157
  bun run build # dist + .d.mts via tsdown (for Node/bundler consumers)
130
158
  bun run docs:api # generate the typedoc API reference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusengine/harness",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "Harness-agnostic toolkit for AI coding agents: runtime harness detection (Claude Code, Codex, Cursor, Cline, Gemini, Aider...), pure policy core (env config, project/framework detection, SOLID/file-size limits, APEX freshness, guard patterns, portable prompts), cache, project memory, ref routing, state/locks, statusline, per-harness adapters (Claude/Cursor/Cline/Gemini) and a cli-mode harness-check binary. Bun-native, with a built dist for Node + bundlers.",
5
5
  "type": "module",
6
6
  "module": "src/index.ts",
@@ -117,6 +117,9 @@
117
117
  },
118
118
  "files": ["dist", "README.md", "LICENSE"],
119
119
  "license": "MIT",
120
+ "repository": { "type": "git", "url": "git+https://github.com/fusengine/harness.git" },
121
+ "homepage": "https://github.com/fusengine/harness#readme",
122
+ "bugs": "https://github.com/fusengine/harness/issues",
120
123
  "sideEffects": false,
121
124
  "scripts": {
122
125
  "test": "bun test",