stable-harness 0.0.4 → 0.0.5
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 +189 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,32 +1,212 @@
|
|
|
1
1
|
# stable-harness
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/stable-harness)
|
|
4
|
+
[](https://www.npmjs.com/package/stable-harness)
|
|
5
|
+
|
|
3
6
|
Stable runtime and operator control plane for agent applications.
|
|
4
7
|
|
|
5
|
-
`stable-harness`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
`stable-harness` lets a team keep its chosen agent framework while adding the
|
|
9
|
+
production surfaces that real workspaces need: YAML inventory, runtime requests,
|
|
10
|
+
sessions, event traces, artifacts, memory lifecycle, governance hooks, recovery,
|
|
11
|
+
tool repair, and protocol access.
|
|
12
|
+
|
|
13
|
+
It is not another agent execution framework. Upstream frameworks own execution
|
|
14
|
+
semantics. Stable Harness owns the runtime boundary around them.
|
|
15
|
+
|
|
16
|
+
## Why Use It
|
|
17
|
+
|
|
18
|
+
Agent frameworks are good at deciding what an agent should do next. Production
|
|
19
|
+
applications also need a stable layer that can be inspected, governed, resumed,
|
|
20
|
+
replayed, and called through predictable APIs.
|
|
9
21
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
Stable Harness gives you that layer without rewriting the backend:
|
|
23
|
+
|
|
24
|
+
- define agents, tools, models, memory, workflows, and protocol exposure in YAML
|
|
25
|
+
- run the same workspace through CLI, SDK, HTTP, and OpenAI-compatible clients
|
|
26
|
+
- keep DeepAgents and LangGraph behavior upstream-native through thin adapters
|
|
27
|
+
- validate and repair tool calls at the runtime gateway before execution
|
|
28
|
+
- observe upstream tool, planning, delegation, progress, memory, and artifact events
|
|
29
|
+
- keep downstream product logic in the workspace, not inside the framework
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install stable-harness
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Stable Harness currently targets Node.js `>=24 <25`.
|
|
13
38
|
|
|
14
39
|
## First Run
|
|
15
40
|
|
|
41
|
+
Clone the repo when developing the framework itself:
|
|
42
|
+
|
|
16
43
|
```bash
|
|
44
|
+
git clone git@github.com:botbotgo/stable-harness.git
|
|
45
|
+
cd stable-harness
|
|
17
46
|
npm install
|
|
18
47
|
npm run build
|
|
19
48
|
npm run check:rules
|
|
20
|
-
npm
|
|
49
|
+
npm test
|
|
21
50
|
npm run example:minimal
|
|
22
51
|
```
|
|
23
52
|
|
|
53
|
+
Run an existing Stable Harness workspace:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
stable-harness -w ./examples/minimal-deepagents "hello stable harness"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Inspect the workspace without running an agent:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
stable-harness -w ./examples/minimal-deepagents
|
|
63
|
+
stable-harness agent render orchestra -w ./examples/minimal-deepagents
|
|
64
|
+
stable-harness workflow render review-shell -w ./examples/minimal-deepagents
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Start the OpenAI-compatible facade:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
stable-harness start -w ./examples/minimal-deepagents --port 8642
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then point compatible clients at:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
http://127.0.0.1:8642/v1
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Embed In An App
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { createStableHarnessRuntime } from "stable-harness";
|
|
83
|
+
|
|
84
|
+
const runtime = await createStableHarnessRuntime("/path/to/workspace");
|
|
85
|
+
|
|
86
|
+
const response = await runtime.request({
|
|
87
|
+
input: "Review the current release evidence.",
|
|
88
|
+
agentId: "orchestra",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
console.log(response.output);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
The runtime also exposes `subscribe`, `inspect`, `getRun`, `listRequests`,
|
|
95
|
+
`listSessions`, `inspectRequest`, `cancel`, and `stop` so applications can build
|
|
96
|
+
operator workflows around the same execution surface.
|
|
97
|
+
|
|
98
|
+
## Workspace Shape
|
|
99
|
+
|
|
100
|
+
A workspace is a folder with Kubernetes-style YAML documents:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
config/
|
|
104
|
+
runtime/workspace.yaml
|
|
105
|
+
agents/orchestra.yaml
|
|
106
|
+
catalogs/models.yaml
|
|
107
|
+
catalogs/tools.yaml
|
|
108
|
+
workflows/review-shell.yaml
|
|
109
|
+
resources/
|
|
110
|
+
tools/
|
|
111
|
+
skills/
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Minimal runtime:
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
apiVersion: stable-harness.dev/v1
|
|
118
|
+
kind: Runtime
|
|
119
|
+
metadata:
|
|
120
|
+
name: app-runtime
|
|
121
|
+
spec:
|
|
122
|
+
routing:
|
|
123
|
+
defaultAgentId: orchestra
|
|
124
|
+
protocols:
|
|
125
|
+
inProcess: true
|
|
126
|
+
openaiCompatible:
|
|
127
|
+
bearerToken: ${env:STABLE_HARNESS_API_KEY}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Minimal agent:
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
apiVersion: stable-harness.dev/v1
|
|
134
|
+
kind: Agent
|
|
135
|
+
metadata:
|
|
136
|
+
name: orchestra
|
|
137
|
+
spec:
|
|
138
|
+
backend: deepagents
|
|
139
|
+
modelRef: local-dev
|
|
140
|
+
systemPrompt: You are a concise workspace agent.
|
|
141
|
+
tools:
|
|
142
|
+
- shell
|
|
143
|
+
subagents:
|
|
144
|
+
- reviewer
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Runtime Boundary
|
|
148
|
+
|
|
149
|
+
```mermaid
|
|
150
|
+
flowchart LR
|
|
151
|
+
Client["CLI / SDK / HTTP / OpenAI-compatible client"]
|
|
152
|
+
Runtime["Stable Harness runtime"]
|
|
153
|
+
Inventory["YAML workspace inventory"]
|
|
154
|
+
Gateway["Tool gateway + repair policy"]
|
|
155
|
+
Adapter["Thin backend adapter"]
|
|
156
|
+
Backend["DeepAgents / LangGraph / future backend"]
|
|
157
|
+
Ops["Events / runs / memory / approvals / artifacts"]
|
|
158
|
+
|
|
159
|
+
Client --> Runtime
|
|
160
|
+
Inventory --> Runtime
|
|
161
|
+
Runtime --> Gateway
|
|
162
|
+
Runtime --> Adapter
|
|
163
|
+
Adapter --> Backend
|
|
164
|
+
Runtime --> Ops
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Stable Harness owns lifecycle, governance, observability, persistence, recovery,
|
|
168
|
+
protocol access, and tool-gateway policy. It does not infer routing from user
|
|
169
|
+
keywords, synthesize upstream planning calls, or rebuild backend-native agent
|
|
170
|
+
semantics.
|
|
171
|
+
|
|
172
|
+
## Current Backends
|
|
173
|
+
|
|
174
|
+
| Backend | Status | Boundary |
|
|
175
|
+
| --- | --- | --- |
|
|
176
|
+
| DeepAgents | Primary adapter | Upstream execution, skills, planning, delegation, and built-ins are passed through; Stable Harness observes and governs the runtime edge. |
|
|
177
|
+
| LangGraph | Runtime and workflow adapter | Stable Harness can compile explicit workflow topology and expose LangGraph-compatible protocol surfaces. |
|
|
178
|
+
| Custom adapters | Supported through SDK | Implement `RuntimeAdapter` and declare the backend in workspace YAML. |
|
|
179
|
+
|
|
180
|
+
## Tool Reliability
|
|
181
|
+
|
|
182
|
+
Stable Harness uses `@botbotgo/better-call` at the tool-gateway boundary. The
|
|
183
|
+
default CLI path configures repair mode for registered tools, so malformed or
|
|
184
|
+
near-miss tool calls can be repaired before execution while agent inventory,
|
|
185
|
+
schema validation, semantic validators, and governance policy still define what
|
|
186
|
+
is allowed.
|
|
187
|
+
|
|
188
|
+
This is constrained repair, not silent magic:
|
|
189
|
+
|
|
190
|
+
- unknown or unauthorized tools stay blocked
|
|
191
|
+
- semantic validators remain authoritative
|
|
192
|
+
- upstream built-ins stay upstream-owned
|
|
193
|
+
- repaired calls are observable through runtime events and traces
|
|
194
|
+
|
|
195
|
+
## Protocols
|
|
196
|
+
|
|
197
|
+
- OpenAI-compatible facade: [docs/protocols/openai-compatible.md](docs/protocols/openai-compatible.md)
|
|
198
|
+
- LangGraph-compatible facade: [docs/protocols/langgraph-compatible.md](docs/protocols/langgraph-compatible.md)
|
|
199
|
+
- HTTP runtime protocol: [docs/protocols/http-runtime.md](docs/protocols/http-runtime.md)
|
|
200
|
+
|
|
24
201
|
## Product Boundary
|
|
25
202
|
|
|
26
|
-
|
|
203
|
+
Read these before adding public runtime behavior:
|
|
27
204
|
|
|
28
205
|
- [Product boundary](docs/product-boundary.md)
|
|
29
206
|
- [Compatibility matrix](docs/compatibility-matrix.md)
|
|
30
207
|
- [Implementation blueprint](docs/implementation-blueprint.md)
|
|
31
208
|
- [Engineering rules](docs/engineering-rules.md)
|
|
32
209
|
- [Adapter contract](docs/adapter-contract.md)
|
|
210
|
+
|
|
211
|
+
The short rule: pass through upstream execution semantics first, then add only
|
|
212
|
+
small, typed, replaceable runtime capabilities around them.
|