@fusengine/harness 0.1.20 → 0.1.21
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 +15 -0
- package/package.json +1 -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 |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusengine/harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
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",
|