pi-harness-runtime 1.1.49 → 1.1.71-3
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/CHANGELOG.md +30 -9
- package/README.md +119 -0
- package/harness/langchain/agents.d.ts +143 -0
- package/harness/langchain/agents.test.d.ts +2 -0
- package/harness/langchain/agents.test.ts +0 -1
- package/harness/langchain/agents.ts +196 -13
- package/harness/langchain/checkpointer.d.ts +48 -0
- package/harness/langchain/checkpointer.test.d.ts +8 -0
- package/harness/langchain/cron-cli.d.ts +12 -0
- package/harness/langchain/cron-cli.ts +169 -0
- package/harness/langchain/daemon.d.ts +161 -0
- package/harness/langchain/daemon.test.d.ts +11 -0
- package/harness/langchain/daemon.test.ts +62 -5
- package/harness/langchain/daemon.ts +231 -12
- package/harness/langchain/file-tools.d.ts +97 -0
- package/harness/langchain/file-tools.ts +29 -11
- package/harness/langchain/graph.d.ts +706 -0
- package/harness/langchain/graph.ts +184 -26
- package/harness/langchain/model-router.d.ts +63 -0
- package/harness/langchain/model-router.test.d.ts +2 -0
- package/harness/langchain/model-router.test.ts +191 -0
- package/harness/langchain/model-router.ts +188 -0
- package/harness/langchain/models.d.ts +72 -0
- package/harness/langchain/models.ts +111 -49
- package/harness/langchain/ping-pong-middleware.d.ts +28 -0
- package/harness/langchain/ping-pong-middleware.test.d.ts +2 -0
- package/harness/langchain/ping-pong-middleware.test.ts +69 -0
- package/harness/langchain/ping-pong-middleware.ts +204 -0
- package/harness/langchain/run.d.ts +15 -0
- package/harness/langchain/run.ts +15 -3
- package/harness/langchain/scoreboard.test.d.ts +13 -0
- package/harness/langchain/scoreboard.test.ts +28 -5
- package/harness/langchain/status-line.d.ts +91 -0
- package/harness/langchain/status-line.test.d.ts +8 -0
- package/harness/langchain/surge.d.ts +103 -0
- package/harness/langchain/surge.test.d.ts +10 -0
- package/harness/langchain/surge.test.ts +179 -0
- package/harness/langchain/surge.ts +188 -19
- package/harness/langchain/widget.d.ts +105 -0
- package/harness/langchain/widget.test.d.ts +8 -0
- package/harness/ssh-detach-interceptor.test.ts +263 -0
- package/harness/ssh-detach-interceptor.ts +438 -0
- package/index.ts +212 -47
- package/package.json +4 -2
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/architecture-generator/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard-plugin/package.json +1 -1
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +1 -1
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/dist/src/index.d.ts +2 -0
- package/packages/intent-analyzer/dist/src/index.d.ts.map +1 -1
- package/packages/intent-analyzer/dist/src/index.js +1 -0
- package/packages/intent-analyzer/dist/src/index.js.map +1 -1
- package/packages/intent-analyzer/dist/src/ping-pong.d.ts +56 -0
- package/packages/intent-analyzer/dist/src/ping-pong.d.ts.map +1 -0
- package/packages/intent-analyzer/dist/src/ping-pong.js +286 -0
- package/packages/intent-analyzer/dist/src/ping-pong.js.map +1 -0
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/intent-analyzer/src/index.ts +13 -0
- package/packages/intent-analyzer/src/ping-pong.ts +387 -0
- package/packages/intent-analyzer/test/ping-pong.test.ts +96 -0
- package/packages/jev-judge/README.md +234 -0
- package/packages/jev-judge/dist/decision-engine.d.ts +100 -0
- package/packages/jev-judge/dist/decision-engine.d.ts.map +1 -0
- package/packages/jev-judge/dist/decision-engine.js +151 -0
- package/packages/jev-judge/dist/decision-engine.js.map +1 -0
- package/packages/jev-judge/dist/e2e-judge.d.ts +61 -0
- package/packages/jev-judge/dist/e2e-judge.d.ts.map +1 -0
- package/packages/jev-judge/dist/e2e-judge.js +268 -0
- package/packages/jev-judge/dist/e2e-judge.js.map +1 -0
- package/packages/jev-judge/dist/flaky-detector.d.ts +34 -0
- package/packages/jev-judge/dist/flaky-detector.d.ts.map +1 -0
- package/packages/jev-judge/dist/flaky-detector.js +154 -0
- package/packages/jev-judge/dist/flaky-detector.js.map +1 -0
- package/packages/jev-judge/dist/index.d.ts +77 -0
- package/packages/jev-judge/dist/index.d.ts.map +1 -0
- package/packages/jev-judge/dist/index.js +271 -0
- package/packages/jev-judge/dist/index.js.map +1 -0
- package/packages/jev-judge/dist/types.d.ts +97 -0
- package/packages/jev-judge/dist/types.d.ts.map +1 -0
- package/packages/jev-judge/dist/types.js +8 -0
- package/packages/jev-judge/dist/types.js.map +1 -0
- package/packages/jev-judge/package.json +46 -0
- package/packages/jev-judge/src/decision-engine.ts +231 -0
- package/packages/jev-judge/src/e2e-judge.ts +364 -0
- package/packages/jev-judge/src/flaky-detector.ts +190 -0
- package/packages/jev-judge/src/index.ts +345 -0
- package/packages/jev-judge/src/types.ts +131 -0
- package/packages/knowledge-graph/package.json +1 -1
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +1 -1
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +1 -1
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/quota-manager/package.json +1 -1
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/tencentdb-memory/package.json +1 -1
- package/packages/tencentdb-sync/package.json +1 -1
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/README.md +71 -0
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/todo-bd-sync/src/extension.ts +16 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/dist/src/approved-patterns.d.ts +51 -0
- package/packages/trajectory/dist/src/approved-patterns.d.ts.map +1 -0
- package/packages/trajectory/dist/src/approved-patterns.js +134 -0
- package/packages/trajectory/dist/src/approved-patterns.js.map +1 -0
- package/packages/trajectory/dist/src/index.d.ts +13 -0
- package/packages/trajectory/dist/src/index.d.ts.map +1 -0
- package/packages/trajectory/dist/src/index.js +12 -0
- package/packages/trajectory/dist/src/index.js.map +1 -0
- package/packages/trajectory/dist/src/store.d.ts +69 -0
- package/packages/trajectory/dist/src/store.d.ts.map +1 -0
- package/packages/trajectory/dist/src/store.js +253 -0
- package/packages/trajectory/dist/src/store.js.map +1 -0
- package/packages/trajectory/dist/src/types.d.ts +73 -0
- package/packages/trajectory/dist/src/types.d.ts.map +1 -0
- package/packages/trajectory/dist/src/types.js +9 -0
- package/packages/trajectory/dist/src/types.js.map +1 -0
- package/packages/trajectory/dist/test/store.test.d.ts +2 -0
- package/packages/trajectory/dist/test/store.test.d.ts.map +1 -0
- package/packages/trajectory/dist/test/store.test.js +228 -0
- package/packages/trajectory/dist/test/store.test.js.map +1 -0
- package/packages/trajectory/package.json +29 -0
- package/packages/trajectory/src/approved-patterns.ts +180 -0
- package/packages/trajectory/src/index.ts +26 -0
- package/packages/trajectory/src/store.ts +285 -0
- package/packages/trajectory/src/types.ts +84 -0
- package/packages/trajectory/test/store.test.d.ts +2 -0
- package/packages/trajectory/test/store.test.ts +250 -0
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/write-review/package.json +1 -1
- package/packages/write-review/src/blackboard.ts +38 -5
- package/packages/write-review/src/types.ts +13 -0
- package/skills/harness-runtime/SKILL.md +67 -4
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
9
9
|
import { join } from "path";
|
|
10
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
WriteReviewStatus,
|
|
12
|
+
ReviewPhase,
|
|
13
|
+
Verdict,
|
|
14
|
+
PingPongDecisionSnapshot,
|
|
15
|
+
} from "./types.js";
|
|
11
16
|
|
|
12
17
|
const DEFAULT_DIR = ".write-review";
|
|
13
18
|
const STATUS_FILE = "status.json";
|
|
@@ -72,6 +77,24 @@ export class WriteReviewBlackboard {
|
|
|
72
77
|
return this.status;
|
|
73
78
|
}
|
|
74
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Record the automatic decision that selected or skipped PING-PONG.
|
|
82
|
+
* This is the durable middleware state shared by separate agent terminals.
|
|
83
|
+
*/
|
|
84
|
+
recordPingPongDecision(snapshot: PingPongDecisionSnapshot): void {
|
|
85
|
+
if (!this.status) this.init();
|
|
86
|
+
this.status!.mode = "ping_pong";
|
|
87
|
+
this.status!.pingPong = snapshot;
|
|
88
|
+
this.status!.writerMessage = snapshot.request;
|
|
89
|
+
if (snapshot.decision === "run_ping_pong") {
|
|
90
|
+
this.status!.phase = "writing";
|
|
91
|
+
this.status!.writerDone = false;
|
|
92
|
+
} else {
|
|
93
|
+
this.status!.phase = "idle";
|
|
94
|
+
}
|
|
95
|
+
this.save();
|
|
96
|
+
}
|
|
97
|
+
|
|
75
98
|
/**
|
|
76
99
|
* Start a new write session
|
|
77
100
|
*/
|
|
@@ -221,9 +244,9 @@ export class WriteReviewBlackboard {
|
|
|
221
244
|
? "✅"
|
|
222
245
|
: verdict === "blocked"
|
|
223
246
|
? "⛔"
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
247
|
+
: verdict === "changes_requested"
|
|
248
|
+
? "🔄"
|
|
249
|
+
: "⏳";
|
|
227
250
|
|
|
228
251
|
const lines: string[] = [
|
|
229
252
|
`## Write-Review Scoreboard`,
|
|
@@ -268,7 +291,17 @@ export class WriteReviewBlackboard {
|
|
|
268
291
|
while ((match = fencedRe.exec(code)) !== null) {
|
|
269
292
|
const path = match[1]!.trim();
|
|
270
293
|
// Skip if it looks like a filename with spaces (not a path)
|
|
271
|
-
if (
|
|
294
|
+
if (
|
|
295
|
+
path &&
|
|
296
|
+
!path.includes(" ") &&
|
|
297
|
+
(path.includes("/") ||
|
|
298
|
+
path.includes("\\") ||
|
|
299
|
+
path.endsWith(".ts") ||
|
|
300
|
+
path.endsWith(".js") ||
|
|
301
|
+
path.endsWith(".tsx") ||
|
|
302
|
+
path.endsWith(".json") ||
|
|
303
|
+
path.endsWith(".md"))
|
|
304
|
+
) {
|
|
272
305
|
files.add(path);
|
|
273
306
|
}
|
|
274
307
|
}
|
|
@@ -21,6 +21,17 @@ export type ReviewPhase =
|
|
|
21
21
|
*/
|
|
22
22
|
export type Verdict = "approved" | "changes_requested" | "blocked";
|
|
23
23
|
|
|
24
|
+
export interface PingPongDecisionSnapshot {
|
|
25
|
+
decision: "run_ping_pong" | "suggest_ping_pong" | "handle_inline";
|
|
26
|
+
score: number;
|
|
27
|
+
runThreshold: number;
|
|
28
|
+
suggestThreshold: number;
|
|
29
|
+
reasons: string[];
|
|
30
|
+
request: string;
|
|
31
|
+
taskId?: string;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
24
35
|
/**
|
|
25
36
|
* Blackboard status record
|
|
26
37
|
*/
|
|
@@ -37,6 +48,8 @@ export interface WriteReviewStatus {
|
|
|
37
48
|
changesRequested?: string[]; // Changes needed
|
|
38
49
|
approvedAt?: string; // ISO timestamp
|
|
39
50
|
blockedAt?: string; // ISO timestamp
|
|
51
|
+
mode?: "manual" | "ping_pong";
|
|
52
|
+
pingPong?: PingPongDecisionSnapshot;
|
|
40
53
|
updatedAt: string;
|
|
41
54
|
createdAt: string;
|
|
42
55
|
}
|
|
@@ -4,6 +4,69 @@ description: Local-first, provider-agnostic AI coding harness runtime for pi.dev
|
|
|
4
4
|
|
|
5
5
|
# Harness Runtime — pi Extension
|
|
6
6
|
|
|
7
|
+
## CRITICAL: Todo List Rule
|
|
8
|
+
|
|
9
|
+
**When you identify 2+ tasks, issues, or jobs — add ALL of them to the Todo list immediately.**
|
|
10
|
+
|
|
11
|
+
Do NOT just list them in text. Use the `todo` tool to create tracked tasks:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Creating multiple tasks at once
|
|
15
|
+
bd create "Fix initialRemotionData not defined" -p 2
|
|
16
|
+
bd create "Fix dictionary.title undefined" -p 2
|
|
17
|
+
bd create "Replace Film icon with themed icon" -p 2
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Rule**: If you write something like:
|
|
21
|
+
|
|
22
|
+
- "There are 3 issues: ..."
|
|
23
|
+
- "I found several problems: ..."
|
|
24
|
+
- "Let me fix these: 1) X 2) Y 3) Z"
|
|
25
|
+
- "Here are the tasks to do: ..."
|
|
26
|
+
|
|
27
|
+
**Then you MUST create Todo items for each one.** Single-issue fixes don't need tracking.
|
|
28
|
+
|
|
29
|
+
**Why**: Agents often identify issues verbally but forget to track them. This rule ensures nothing slips through.
|
|
30
|
+
|
|
31
|
+
## Remote Server Commands (SSH)
|
|
32
|
+
|
|
33
|
+
**ALWAYS use detached SSH pattern to prevent long hangs.**
|
|
34
|
+
|
|
35
|
+
### Anti-Pattern (blocks SSH, hangs indefinitely)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# WRONG - SSH blocks waiting for background process
|
|
39
|
+
ssh user@host "kill old; sleep 2; uvicorn ... &"
|
|
40
|
+
# SSH never returns because it waits for uvicorn
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Correct Pattern (fast exit, process stays on server)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# CORRECT - SSH exits fast, process continues on server
|
|
47
|
+
ssh -o BatchMode=yes user@host \
|
|
48
|
+
"kill -9 OLD_PID 2>/dev/null; sleep 1; \
|
|
49
|
+
cd /path/to/service && \
|
|
50
|
+
nohup .venv/bin/uvicorn amos_api.main:app --host 0.0.0.0 --port 8100 \
|
|
51
|
+
> /tmp/uvicorn.log 2>&1 & \
|
|
52
|
+
echo 'UVICORN_STARTED'"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Key changes:**
|
|
56
|
+
|
|
57
|
+
- `nohup ... &` — detaches from SSH session
|
|
58
|
+
- `> /tmp/uvicorn.log 2>&1` — captures output to file
|
|
59
|
+
- `echo 'UVICORN_STARTED'` — SSH exits fast with confirmation
|
|
60
|
+
- `-o BatchMode=yes` — non-interactive, fails fast on auth issues
|
|
61
|
+
|
|
62
|
+
**Why this matters**: A bare `&` in SSH keeps the shell open. `nohup` + redirect + `echo` ensures SSH exits immediately while the process runs on the server.
|
|
63
|
+
|
|
64
|
+
**For long-running commands**, add a timeout guard:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
timeout 60s ssh -o BatchMode=yes user@host "long-command; echo DONE"
|
|
68
|
+
```
|
|
69
|
+
|
|
7
70
|
**Status:** v0.3.0 | **RFCs:** 18 defined | **Implementation:** Phase 1-6
|
|
8
71
|
|
|
9
72
|
## Overview
|
|
@@ -31,7 +94,7 @@ Human Requirement
|
|
|
31
94
|
### Usage Commands
|
|
32
95
|
|
|
33
96
|
| Command | Description |
|
|
34
|
-
|
|
97
|
+
| --------- | ------------- |
|
|
35
98
|
| `/usage` | Show full status (local tracking + provider mirror) |
|
|
36
99
|
| `/usage refresh` | Force refresh quota from MiniMax console |
|
|
37
100
|
| `/usage today` | Today's usage + 5h window |
|
|
@@ -41,7 +104,7 @@ Human Requirement
|
|
|
41
104
|
### Harness Commands
|
|
42
105
|
|
|
43
106
|
| Command | Description |
|
|
44
|
-
|
|
107
|
+
| --------- | ------------- |
|
|
45
108
|
| `/harness start <requirement>` | Start a new harness job |
|
|
46
109
|
| `/harness status` | Show current job status |
|
|
47
110
|
| `/harness tasks` | List all tasks |
|
|
@@ -52,7 +115,7 @@ Human Requirement
|
|
|
52
115
|
### Authentication Commands
|
|
53
116
|
|
|
54
117
|
| Command | Description |
|
|
55
|
-
|
|
118
|
+
| --------- | ------------- |
|
|
56
119
|
| `/harness auth minimax` | Authenticate with MiniMax (opens browser) |
|
|
57
120
|
| `/harness auth check` | Check MiniMax auth status |
|
|
58
121
|
| `/harness auth scrape` | Scrape MiniMax usage (silent, uses saved profile) |
|
|
@@ -86,7 +149,7 @@ cancelled blocked waiting_human repairing ready_for_client
|
|
|
86
149
|
### State Transitions
|
|
87
150
|
|
|
88
151
|
| From | Valid Transitions |
|
|
89
|
-
|
|
152
|
+
| ------ | ----------------- |
|
|
90
153
|
| created | planning |
|
|
91
154
|
| planning | queued, cancelled |
|
|
92
155
|
| queued | running, cancelled, waiting_human |
|