pi-harness-runtime 1.1.195 → 1.1.197
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/package.json +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/agent-policy/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/codex-watcher/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/e2e-tester/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/package.json +1 -1
- package/packages/jev-judge/dist/continuation-controller.d.ts +33 -22
- package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +9 -41
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/dist/index.d.ts +4 -0
- package/packages/jev-judge/dist/index.d.ts.map +1 -1
- package/packages/jev-judge/dist/index.js +4 -0
- package/packages/jev-judge/dist/index.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/continuation-controller.ts +29 -70
- package/packages/jev-judge/src/index.ts +8 -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/dist/conversation-bridge.d.ts +1 -6
- package/packages/notification/dist/conversation-bridge.d.ts.map +1 -1
- package/packages/notification/dist/conversation-bridge.js +5 -36
- package/packages/notification/dist/conversation-bridge.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/conversation-bridge.ts +5 -54
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +1 -1
- package/packages/paperclip-integration/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/qdrant-skills/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/skills/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/telegram/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/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.197",
|
|
4
4
|
"description": "Capability Registry for pi-harness-runtime — tracks model capabilities and enables capability-based routing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Todo-Driven Continuation Controller
|
|
3
|
-
*
|
|
4
|
-
* Executes authorized todo items without repeated prompts.
|
|
5
|
-
* Uses deterministic rules + optional Jev for ambiguous cases.
|
|
6
|
-
*
|
|
7
|
-
* Architecture:
|
|
8
|
-
* A. Read real todo state (not bd)
|
|
9
|
-
* B. Deterministic continuation on agent_settled
|
|
10
|
-
* C. Jev for ambiguous classification only
|
|
11
|
-
* D. Single continuation controller
|
|
12
|
-
* E. Update prompts/Telegram/status together
|
|
13
|
-
*/
|
|
14
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
15
|
-
import {
|
|
2
|
+
import type { TodoItem } from "./todo-provider.js";
|
|
16
3
|
/**
|
|
17
|
-
* Continuation
|
|
4
|
+
* Continuation configuration
|
|
18
5
|
*/
|
|
19
|
-
interface ContinuationConfig {
|
|
20
|
-
/** Minimum wait
|
|
6
|
+
export interface ContinuationConfig {
|
|
7
|
+
/** Minimum wait before Jev fallback (ms) */
|
|
21
8
|
jevFallbackMinWaitMs?: number;
|
|
22
|
-
/**
|
|
9
|
+
/** Threshold for routine continuation */
|
|
23
10
|
routineThreshold?: number;
|
|
24
|
-
/** Max steer attempts
|
|
11
|
+
/** Max steer attempts per session */
|
|
25
12
|
maxSteerAttempts?: number;
|
|
26
|
-
/** Enable Jev
|
|
13
|
+
/** Enable Jev for ambiguous cases */
|
|
27
14
|
enableJev?: boolean;
|
|
28
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Continuation state
|
|
18
|
+
*/
|
|
19
|
+
export interface ContinuationState {
|
|
20
|
+
sessionId: string;
|
|
21
|
+
generation: number;
|
|
22
|
+
todoRevision: number;
|
|
23
|
+
currentItemId: number | null;
|
|
24
|
+
nextItemId: number | null;
|
|
25
|
+
lastMessageId: string | null;
|
|
26
|
+
continuationQueued: boolean;
|
|
27
|
+
userPaused: boolean;
|
|
28
|
+
lastSteerMessage: string | null;
|
|
29
|
+
steerAttempts: number;
|
|
30
|
+
lastEvaluationResult: string | null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Continuation result
|
|
34
|
+
*/
|
|
35
|
+
export interface ContinuationResult {
|
|
36
|
+
action: "continue" | "stop" | "blocked" | "ask";
|
|
37
|
+
nextItemId?: number;
|
|
38
|
+
question?: string;
|
|
39
|
+
reason?: string;
|
|
40
|
+
}
|
|
29
41
|
/**
|
|
30
42
|
* Todo-Driven Continuation Controller
|
|
31
43
|
*
|
|
@@ -56,7 +68,7 @@ export declare class TodoContinuationController {
|
|
|
56
68
|
/**
|
|
57
69
|
* Mark a todo item as complete
|
|
58
70
|
*/
|
|
59
|
-
markComplete(
|
|
71
|
+
markComplete(_itemId: number): Promise<void>;
|
|
60
72
|
/**
|
|
61
73
|
* User paused
|
|
62
74
|
*/
|
|
@@ -82,5 +94,4 @@ export declare class TodoContinuationController {
|
|
|
82
94
|
* Create and register a todo continuation controller
|
|
83
95
|
*/
|
|
84
96
|
export declare function createTodoContinuation(pi: ExtensionAPI, config?: ContinuationConfig): TodoContinuationController;
|
|
85
|
-
export {};
|
|
86
97
|
//# sourceMappingURL=continuation-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,4CAA4C;IAC5C,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yCAAyC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MA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G,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAM7E;CACD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACrC,EAAE,EAAE,YAAY,EAChB,MAAM,CAAC,EAAE,kBAAkB,GACzB,0BAA0B,CAI5B"}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Todo-Driven Continuation Controller
|
|
3
|
-
*
|
|
4
|
-
* Executes authorized todo items without repeated prompts.
|
|
5
|
-
* Uses deterministic rules + optional Jev for ambiguous cases.
|
|
6
|
-
*
|
|
7
|
-
* Architecture:
|
|
8
|
-
* A. Read real todo state (not bd)
|
|
9
|
-
* B. Deterministic continuation on agent_settled
|
|
10
|
-
* C. Jev for ambiguous classification only
|
|
11
|
-
* D. Single continuation controller
|
|
12
|
-
* E. Update prompts/Telegram/status together
|
|
13
|
-
*/
|
|
14
1
|
import { createTodoProvider } from "./todo-provider.js";
|
|
15
2
|
/**
|
|
16
3
|
* Todo-Driven Continuation Controller
|
|
@@ -43,24 +30,20 @@ export class TodoContinuationController {
|
|
|
43
30
|
enableJev: true,
|
|
44
31
|
...config,
|
|
45
32
|
};
|
|
46
|
-
// Initialize Jev judge if enabled
|
|
47
|
-
if (this.config.enableJev) {
|
|
48
|
-
// Jev will be initialized with API key from environment
|
|
49
|
-
}
|
|
50
33
|
}
|
|
51
34
|
/**
|
|
52
35
|
* Register lifecycle hooks
|
|
53
36
|
*/
|
|
54
37
|
register() {
|
|
55
|
-
console.log("[TodoContinuation] Registering lifecycle hooks...");
|
|
56
38
|
// Session start - reset state
|
|
57
39
|
this.pi.on("session_start", () => {
|
|
58
40
|
this.reset();
|
|
59
|
-
console.log("[TodoContinuation] Session started");
|
|
60
41
|
});
|
|
61
42
|
// Agent settled - evaluate continuation
|
|
62
43
|
this.pi.on("agent_settled", () => {
|
|
63
|
-
this.evaluateContinuation().catch((
|
|
44
|
+
this.evaluateContinuation().catch(() => {
|
|
45
|
+
// Silently handle errors
|
|
46
|
+
});
|
|
64
47
|
});
|
|
65
48
|
// User input - reset pause state
|
|
66
49
|
this.pi.on("message_start", (event) => {
|
|
@@ -82,7 +65,6 @@ export class TodoContinuationController {
|
|
|
82
65
|
this.state.continuationQueued = false;
|
|
83
66
|
}
|
|
84
67
|
});
|
|
85
|
-
console.log("[TodoContinuation] Lifecycle hooks registered");
|
|
86
68
|
}
|
|
87
69
|
/**
|
|
88
70
|
* Evaluate continuation decision and execute it
|
|
@@ -90,14 +72,12 @@ export class TodoContinuationController {
|
|
|
90
72
|
async evaluateContinuation() {
|
|
91
73
|
// 1. Check user pause
|
|
92
74
|
if (this.state.userPaused) {
|
|
93
|
-
console.log("[TodoContinuation] User paused, stopping");
|
|
94
75
|
return;
|
|
95
76
|
}
|
|
96
77
|
// 2. Get current todo snapshot
|
|
97
78
|
const availability = await this.todoProvider.availability();
|
|
98
79
|
if (!availability.available) {
|
|
99
80
|
// No todo provider - don't auto-continue
|
|
100
|
-
console.log("[TodoContinuation] Todo provider unavailable:", availability.error);
|
|
101
81
|
return;
|
|
102
82
|
}
|
|
103
83
|
try {
|
|
@@ -110,7 +90,6 @@ export class TodoContinuationController {
|
|
|
110
90
|
// 4. If there's work in progress, continue it
|
|
111
91
|
if (inProgressItems.length > 0) {
|
|
112
92
|
const item = inProgressItems[0];
|
|
113
|
-
console.log(`[TodoContinuation] In-progress item: ${item.subject}`);
|
|
114
93
|
await this.continueItem(item);
|
|
115
94
|
return;
|
|
116
95
|
}
|
|
@@ -118,17 +97,14 @@ export class TodoContinuationController {
|
|
|
118
97
|
const totalItems = completedItems.length + pendingItems.length + inProgressItems.length;
|
|
119
98
|
const hasWork = pendingItems.length > 0 || inProgressItems.length > 0;
|
|
120
99
|
if (!hasWork && totalItems === 0) {
|
|
121
|
-
|
|
100
|
+
// All items complete
|
|
122
101
|
return;
|
|
123
102
|
}
|
|
124
103
|
if (pendingItems.length > 0) {
|
|
125
104
|
// Check if items are blocked
|
|
126
105
|
const blockedItems = await this.todoProvider.getBlocked();
|
|
127
106
|
if (blockedItems.length === pendingItems.length) {
|
|
128
|
-
// All pending items are blocked
|
|
129
|
-
const blocker = blockedItems[0];
|
|
130
|
-
console.log("[TodoContinuation] Items blocked:", blocker?.subject);
|
|
131
|
-
// Don't auto-continue when blocked
|
|
107
|
+
// All pending items are blocked - don't auto-continue
|
|
132
108
|
return;
|
|
133
109
|
}
|
|
134
110
|
// Continue the first non-blocked pending item
|
|
@@ -138,8 +114,8 @@ export class TodoContinuationController {
|
|
|
138
114
|
}
|
|
139
115
|
}
|
|
140
116
|
}
|
|
141
|
-
catch
|
|
142
|
-
|
|
117
|
+
catch {
|
|
118
|
+
// Silently handle errors
|
|
143
119
|
}
|
|
144
120
|
}
|
|
145
121
|
/**
|
|
@@ -147,7 +123,6 @@ export class TodoContinuationController {
|
|
|
147
123
|
*/
|
|
148
124
|
async continueItem(item) {
|
|
149
125
|
if (this.state.steerAttempts >= this.config.maxSteerAttempts) {
|
|
150
|
-
console.warn("[TodoContinuation] Max steer attempts reached");
|
|
151
126
|
return;
|
|
152
127
|
}
|
|
153
128
|
this.state.steerAttempts++;
|
|
@@ -157,8 +132,6 @@ export class TodoContinuationController {
|
|
|
157
132
|
? `Continue task: ${item.subject}\n\n${item.description}`
|
|
158
133
|
: `Continue task: ${item.subject}`;
|
|
159
134
|
this.state.lastSteerMessage = message;
|
|
160
|
-
console.log(`[TodoContinuation] Continuing: ${item.subject}`);
|
|
161
|
-
console.log(`[TodoContinuation] Message: ${message}`);
|
|
162
135
|
// Note: Pi does not expose sendUserMessage API.
|
|
163
136
|
// The Telegram notification system will prompt user for ambiguous cases.
|
|
164
137
|
}
|
|
@@ -167,7 +140,6 @@ export class TodoContinuationController {
|
|
|
167
140
|
*/
|
|
168
141
|
async steerToContinue(itemId) {
|
|
169
142
|
if (this.state.steerAttempts >= this.config.maxSteerAttempts) {
|
|
170
|
-
console.warn("[TodoContinuation] Max steer attempts reached");
|
|
171
143
|
return;
|
|
172
144
|
}
|
|
173
145
|
this.state.steerAttempts++;
|
|
@@ -179,13 +151,11 @@ export class TodoContinuationController {
|
|
|
179
151
|
: `Continue work on the next ready task.`;
|
|
180
152
|
this.state.lastSteerMessage = message;
|
|
181
153
|
this.state.todoRevision = snapshot.revision;
|
|
182
|
-
console.log(`[TodoContinuation] Steering to continue item ${itemId}`);
|
|
183
154
|
}
|
|
184
155
|
/**
|
|
185
156
|
* Mark a todo item as complete
|
|
186
157
|
*/
|
|
187
|
-
async markComplete(
|
|
188
|
-
console.log(`[TodoContinuation] Marking item ${itemId} complete`);
|
|
158
|
+
async markComplete(_itemId) {
|
|
189
159
|
this.state.currentItemId = null;
|
|
190
160
|
this.state.generation++;
|
|
191
161
|
}
|
|
@@ -195,7 +165,6 @@ export class TodoContinuationController {
|
|
|
195
165
|
pause() {
|
|
196
166
|
this.state.userPaused = true;
|
|
197
167
|
this.state.continuationQueued = false;
|
|
198
|
-
console.log("[TodoContinuation] User paused");
|
|
199
168
|
}
|
|
200
169
|
/**
|
|
201
170
|
* Reset state for new session
|
|
@@ -219,7 +188,6 @@ export class TodoContinuationController {
|
|
|
219
188
|
* Cleanup on shutdown
|
|
220
189
|
*/
|
|
221
190
|
cleanup() {
|
|
222
|
-
console.log("[TodoContinuation] Cleaning up");
|
|
223
191
|
this.state.continuationQueued = false;
|
|
224
192
|
this.state.generation++;
|
|
225
193
|
}
|
|
@@ -228,7 +196,7 @@ export class TodoContinuationController {
|
|
|
228
196
|
*/
|
|
229
197
|
getState() {
|
|
230
198
|
return {
|
|
231
|
-
current: null,
|
|
199
|
+
current: null,
|
|
232
200
|
next: null,
|
|
233
201
|
ready: 0,
|
|
234
202
|
};
|