pi-harness-runtime 0.9.11 → 0.9.14
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 +54 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# Pi Harness Runtime
|
|
2
2
|
|
|
3
|
-
[](https://github.com/ManotLuijiu/pi-harness-runtime)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[]()
|
|
6
6
|
|
|
7
7
|
> ⚠️ **Beta Notice — Not Production Ready ⚠️**
|
|
8
|
-
> This project is in active development. Core features work
|
|
8
|
+
> This project is in active development. Core features work.
|
|
9
9
|
|
|
10
10
|
**Autonomous AI coding harness for pi: local token tracking + provider mirror + task orchestration.**
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ Requires Pi v0.37.3+.
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
/usage # show full status (local tracking + provider mirror)
|
|
34
|
-
/usage refresh # force refresh quota from
|
|
34
|
+
/usage refresh # force refresh quota from provider console
|
|
35
35
|
/usage today # today's usage + 5h window
|
|
36
36
|
/usage week # this week's usage + lifetime totals
|
|
37
37
|
/usage reset # clear provider mirror
|
|
@@ -82,6 +82,8 @@ Requires Pi v0.37.3+.
|
|
|
82
82
|
```
|
|
83
83
|
pi-harness-runtime/
|
|
84
84
|
├── index.ts # Extension entry point
|
|
85
|
+
├── footer-status.ts # Footer bar renderer (local vs. mirror mode)
|
|
86
|
+
├── mirror.ts # Per-provider quota mirror (mirror.json)
|
|
85
87
|
├── harness/
|
|
86
88
|
│ ├── job-state-machine.ts # 14-state lifecycle machine
|
|
87
89
|
│ ├── task-graph.ts # DAG-based task management
|
|
@@ -92,13 +94,15 @@ pi-harness-runtime/
|
|
|
92
94
|
│ ├── context-window-manager.ts # Context tracking
|
|
93
95
|
│ ├── agent-handoff.ts # Clean agent transitions
|
|
94
96
|
│ ├── e2e/
|
|
95
|
-
│ │ ├──
|
|
96
|
-
│ │ └── playwright-runner.ts
|
|
97
|
+
│ │ ├── minimax-quota-scraper.ts # Playwright MiniMax scraper
|
|
98
|
+
│ │ └── playwright-runner.ts # Browser automation
|
|
97
99
|
│ └── project-detector/
|
|
98
100
|
│ └── detector.ts # Auto-detect project type
|
|
99
101
|
├── packages/
|
|
100
|
-
│ ├──
|
|
102
|
+
│ ├── cookie-sanitizer/ # Live cookie-file sync via chokidar
|
|
103
|
+
│ ├── providers/ # MiniMax, OpenAI, Codex adapters
|
|
101
104
|
│ ├── quota-manager/ # Quota signal collection
|
|
105
|
+
│ ├── auth/ # MiniMax browser auth
|
|
102
106
|
│ └── worktree/ # Git worktree per task
|
|
103
107
|
└── skills/
|
|
104
108
|
└── harness-runtime/
|
|
@@ -124,6 +128,7 @@ cancelled blocked waiting_human repairing ready_for_client
|
|
|
124
128
|
- **Auto-repair**: Failure classification + retry with exponential backoff
|
|
125
129
|
- **E2E testing**: Scenario-based Playwright integration (coming soon)
|
|
126
130
|
- **Project detection**: Auto-detects Frappe, Next.js, React, Django, Laravel
|
|
131
|
+
- **Per-provider mirror**: Each LLM provider maintains its own quota record
|
|
127
132
|
|
|
128
133
|
## Data Directory
|
|
129
134
|
|
|
@@ -133,7 +138,7 @@ All data stored locally in `~/.pi/`:
|
|
|
133
138
|
~/.pi/
|
|
134
139
|
├── usage-status/ # /usage data
|
|
135
140
|
│ ├── usage.jsonl
|
|
136
|
-
│ └── mirror.json
|
|
141
|
+
│ └── mirror.json # per-provider quota mirror
|
|
137
142
|
├── harness/ # /harness data
|
|
138
143
|
│ └── jobs/
|
|
139
144
|
│ └── <job-id>/
|
|
@@ -193,59 +198,58 @@ bun test # 131+ tests passing
|
|
|
193
198
|
|
|
194
199
|
Quota data is automatically surfaced per-provider:
|
|
195
200
|
|
|
196
|
-
| Provider | Source |
|
|
201
|
+
| Provider | Source | Notes |
|
|
197
202
|
|---|---|---|
|
|
198
|
-
| MiniMax |
|
|
199
|
-
| OpenAI / OpenAI Codex | TUI message capture
|
|
200
|
-
| GLM (Z.ai / Zhipu) | TUI message capture
|
|
201
|
-
| Anthropic | TUI message capture
|
|
202
|
-
| OpenRouter | TUI message capture
|
|
203
|
+
| MiniMax | Live cookie-file watch + Playwright scrape | Drop folder: `~/.pi-harness-runtime/cookies/` |
|
|
204
|
+
| OpenAI / OpenAI Codex | TUI message capture | Signal on first limit hit |
|
|
205
|
+
| GLM (Z.ai / Zhipu) | TUI message capture | Signal on first limit hit |
|
|
206
|
+
| Anthropic | TUI message capture | Signal on first limit hit |
|
|
207
|
+
| OpenRouter | TUI message capture | Signal on first limit hit |
|
|
203
208
|
| Other / unknown | (no data — footer shows hint) | — |
|
|
204
209
|
|
|
205
210
|
The footer line carries the provider label, so you always know which LLM the data is from:
|
|
206
211
|
|
|
207
212
|
```
|
|
208
|
-
MiniMax: 5h: 92% left · week: 80% left
|
|
209
|
-
OpenAI: 5h: -- · week: -- (no signal yet)
|
|
213
|
+
MiniMax: 5h: 92% left · week: 80% left # continuous (cookie scrape)
|
|
214
|
+
OpenAI: 5h: -- · week: -- (no signal yet) # pending first limit hit
|
|
210
215
|
GLM: limit hit (tokens), reset 2026-07-23T17:28:00Z # TUI signal observed
|
|
216
|
+
MiniMax: cookies not found — drop any cookie file into
|
|
217
|
+
~/.pi-harness-runtime/cookies/
|
|
211
218
|
```
|
|
212
219
|
|
|
213
|
-
|
|
220
|
+
### MiniMax Setup (one-time)
|
|
221
|
+
|
|
222
|
+
The runtime watches `~/.pi-harness-runtime/cookies/` for cookie files. Drop any cookie export there — it syncs within ~1 second:
|
|
223
|
+
|
|
224
|
+
1. **Install EditThisCookie** Chrome extension → export from `platform.minimax.io`
|
|
225
|
+
2. **Create the drop folder:**
|
|
214
226
|
|
|
215
227
|
```bash
|
|
216
|
-
|
|
217
|
-
# Go to platform.minimax.io
|
|
218
|
-
# Export cookies → Netscape format
|
|
219
|
-
# Save to ~/.config/minimax-cookies.txt
|
|
228
|
+
mkdir -p ~/.pi-harness-runtime/cookies
|
|
220
229
|
```
|
|
221
230
|
|
|
222
|
-
|
|
223
|
-
normalizes any format (Netscape or EditThisCookie JSON, any filename) on its own:
|
|
231
|
+
3. **Drop your cookie file in the folder** — any filename, any format (Netscape `.txt` or EditThisCookie JSON `.json`):
|
|
224
232
|
|
|
225
233
|
```bash
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
# …or use the EditThisCookie extension export (JSON) — same folder works.
|
|
234
|
+
cp ~/Downloads/platform.minimax.io_cookies.txt \
|
|
235
|
+
~/.pi-harness-runtime/cookies/
|
|
236
|
+
# …or use the EditThisCookie JSON export — same folder works.
|
|
230
237
|
```
|
|
231
238
|
|
|
232
|
-
The `cookie-sanitizer` package (`@pi-harness/cookie-sanitizer`) runs chokidar
|
|
239
|
+
The `cookie-sanitizer` package (`@pi-harness/cookie-sanitizer`) runs chokidar on this
|
|
233
240
|
folder, normalizes everything to standard Netscape, and writes the canonical cache at
|
|
234
241
|
`~/.config/minimax-cookies.txt`. Live update latency: <1 second after drop.
|
|
235
242
|
|
|
236
|
-
|
|
237
|
-
session and captures quota-exhaustion signals from the TUI. Once any limit is hit
|
|
238
|
-
(e.g. `OpenAI: context length exceeded, reset in 3 hr 27 min`), the footer updates
|
|
239
|
-
immediately and the data persists across `~/.pi/usage-status/mirror.json`.
|
|
243
|
+
4. **Done!** Quota auto-refreshes every ~15 minutes. Cookie file changes sync immediately.
|
|
240
244
|
|
|
241
|
-
|
|
245
|
+
**Override:** set `QUOTA_COOKIE_FILE=/path/to/your/cookies.txt` to bypass the sanitizer
|
|
246
|
+
and read a specific file directly.
|
|
242
247
|
|
|
243
|
-
|
|
244
|
-
export QUOTA_COOKIE_FILE=/path/to/your/cookies.txt
|
|
245
|
-
# When set, the sanitizer is bypassed and the scraper reads this file directly.
|
|
246
|
-
```
|
|
248
|
+
### Other Providers
|
|
247
249
|
|
|
248
|
-
|
|
250
|
+
No setup needed. The runtime reads TUI messages and captures quota-exhaustion signals.
|
|
251
|
+
Once any limit is hit (e.g. `OpenAI: context length exceeded, reset in 3 hr 27 min`), the
|
|
252
|
+
footer updates immediately and the data persists in `mirror.json`.
|
|
249
253
|
|
|
250
254
|
## Roadmap
|
|
251
255
|
|
|
@@ -254,9 +258,13 @@ GLM: limit hit (tokens), reset 2026-07-23T17:28:00Z # TUI signal observed
|
|
|
254
258
|
- [x] Repair engine
|
|
255
259
|
- [x] Shared blackboard
|
|
256
260
|
- [x] MiniMax Web automatic quota detection
|
|
261
|
+
- [x] Cookie-file drop folder + live sync (`cookie-sanitizer`)
|
|
262
|
+
- [x] Per-provider quota mirror (`mirror.json` keyed by provider)
|
|
263
|
+
- [x] Multi-provider TUI signal capture (OpenAI, GLM, Anthropic, OpenRouter)
|
|
257
264
|
- [ ] E2E test engine integration
|
|
258
265
|
- [ ] Claude adapter
|
|
259
266
|
- [ ] Production stress testing
|
|
267
|
+
- [ ] RFC-0101: Autonomous Operations Runtime (background execution, task inbox, lease protocol)
|
|
260
268
|
|
|
261
269
|
## License
|
|
262
270
|
|
|
@@ -268,17 +276,17 @@ MIT © 2026 MooCoding
|
|
|
268
276
|
- [context-mode](https://github.com/MiniMax-AI/context-mode) — Context window tracking
|
|
269
277
|
- [pi-web-access](https://github.com/nicobailon/pi-web-access) — Web search for pi
|
|
270
278
|
|
|
271
|
-
Day 6 adds runtime recovery and remote-observability architecture.
|
|
272
|
-
|
|
273
279
|
## RFCs
|
|
274
280
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
The project tracks 101 design documents:
|
|
282
|
+
|
|
283
|
+
| RFC | Title | Status |
|
|
284
|
+
|-----|-------|--------|
|
|
285
|
+
| 0001–0034 | Loop Runtime, Provider Adapter, Quota Manager, Playwright, Git Worktree, Checkpoint, Scheduler, Provider Router, Shared Context, Context Window Manager, Shared Blackboard, Agent Handoff, E2E Test Engine, Project Detector, Job State Machine, Task Graph, Master Planner, Repair Engine, Auto Compact & Continue, Output Token Limit, Partial Response Recovery, Notification Center, Local Browser Agent, Local Runtime Agent, Command Executor, Workspace Manager, Runtime API, Policy Engine, DeepAgents Adapter, Agent Worker Interface, Provider Adapter SDK, Checkpoint Engine, Session Manager | Proposed |
|
|
286
|
+
| 0035–0100 | Observability, Roadmap V1, Code Review, Code Generation, Framework Detector, Test Data Generator, Framework Plugin SDK, Prompt Compiler, Context Compiler, Requirement Compiler, Task Compiler, Project Analyzer, Dependency Analyzer, Repo Knowledge Graph, Code Merge Engine, Conflict Resolution, Documentation Generator, Capability Registry, Skill Registry, Model Registry, Cost Optimizer, Performance Optimizer, Evaluation Engine, Learning Engine, Experience Replay, Memory Engine OKF, Frappe/Next.js/React/Django/Laravel/Generic Web Plugins, CLI Plugin SDK, MCP Adapter, A2A Adapter, Codex Adapter, Requirement Intake, Project Bootstrap, Architecture Generator, Sprint Planner, Milestone Manager, Backlog Manager, Human Approval Gate, Release Manager, Version Manager, Deployment Pipeline, Multi-User Runtime, RBAC, Audit Trail, Dashboard, Analytics, Distributed Runtime, Cluster Manager, Runtime Federation, High Availability, Disaster Recovery, + 17 Autonomous Architectures | Proposed |
|
|
287
|
+
| 0101 | [Autonomous Operations Runtime](RFC/0101_AUTONOMOUS_OPERATIONS_RUNTIME.md) — durable Task Inbox, Background Worker, Task Lease protocol, Privilege Broker, Approval Class policy engine, abstract Scheduler, Notification pipeline, Recovery semantics | Proposed |
|
|
280
288
|
|
|
281
|
-
## Why
|
|
289
|
+
## Why This Matters
|
|
282
290
|
|
|
283
291
|
These RFCs address real runtime failures:
|
|
284
292
|
|
|
@@ -287,3 +295,4 @@ These RFCs address real runtime failures:
|
|
|
287
295
|
- Partial responses must be preserved and continued.
|
|
288
296
|
- The human needs mobile/tablet notifications.
|
|
289
297
|
- Headless servers cannot open interactive login windows for MiniMax usage console.
|
|
298
|
+
- The runtime must continue executing after the chat session ends, the SSH session disconnects, or the provider quota exhausts.
|
package/package.json
CHANGED