pi-harness-runtime 0.9.13 → 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.
Files changed (2) hide show
  1. package/README.md +54 -45
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Pi Harness Runtime
2
2
 
3
- [![Beta](https://img.shields.io/badge/version-beta-orange?style=for-the-badge)](https://github.com/ManotLuijiu/pi-harness-runtime)
3
+ [![Beta](https://img.shields.io/badge/version-0.9.13-orange?style=for-the-badge)](https://github.com/ManotLuijiu/pi-harness-runtime)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)
5
5
  [![Platform](https://img.shields.io/badge/Platform-macOS%20|Linux-blue?style=for-the-badge)]()
6
6
 
7
7
  > ⚠️ **Beta Notice — Not Production Ready ⚠️**
8
- > This project is in active development. Core features work but E2E testing is not yet implemented.
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 MiniMax console
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
- │ │ ├── test-engine.ts # E2E test runner (coming soon)
96
- │ │ └── playwright-runner.ts # Browser automation
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
- │ ├── providers/adapters.ts # MiniMax, OpenAI adapters
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 | Cadence |
201
+ | Provider | Source | Notes |
197
202
  |---|---|---|
198
- | MiniMax | Playwright + cookies (continuous scrape) | every ~15 min |
199
- | OpenAI / OpenAI Codex | TUI message capture (signal on limit) | on first limit hit |
200
- | GLM (Z.ai / Zhipu) | TUI message capture (signal on limit) | on first limit hit |
201
- | Anthropic | TUI message capture (signal on limit) | on first limit hit |
202
- | OpenRouter | TUI message capture (signal on limit) | on first limit hit |
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 # continuous (scrape)
209
- OpenAI: 5h: -- · week: -- (no signal yet) # pending first limit hit
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
- 1. **MiniMax setup** (one-time):
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
- # Install EditThisCookie Chrome extension
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
- **Recommended:** drop the file into the dedicated cookie folder. The runtime
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
- # Save cookies as any name, any format into:
227
- mkdir -p ~/.pi-harness-runtime/cookies
228
- cp ~/Downloads/platform.minimax.io_cookies.txt ~/.pi-harness-runtime/cookies/
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 v5 on this
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
- 2. **Other providers**: no setup needed. The runtime reads messages from the active
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
- 3. **Environment** (optional override):
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
- ```bash
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
- 4. **Done!** Quota auto-refreshes every 5 minutes. Cookie file changes sync within ~1 second.
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
- - RFC-0019 Auto Compact and Continue
276
- - RFC-0020 Output Token Limit Handler
277
- - RFC-0021 Partial Response Recovery
278
- - RFC-0022 Notification Center
279
- - RFC-0023 Local Browser Agent
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 this matters
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {