pi-harness-runtime 1.1.193 → 1.1.194
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/index.ts +4 -0
- 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 +3 -4
- package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +62 -96
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/dist/todo-provider.d.ts.map +1 -1
- package/packages/jev-judge/dist/todo-provider.js +37 -3
- package/packages/jev-judge/dist/todo-provider.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/continuation-controller.ts +69 -114
- package/packages/jev-judge/src/todo-provider.ts +45 -3
- 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 -1
- package/packages/notification/dist/conversation-bridge.d.ts.map +1 -1
- package/packages/notification/dist/conversation-bridge.js +60 -23
- package/packages/notification/dist/conversation-bridge.js.map +1 -1
- package/packages/notification/dist/notification-center.d.ts.map +1 -1
- package/packages/notification/dist/notification-center.js +8 -0
- package/packages/notification/dist/notification-center.js.map +1 -1
- package/packages/notification/dist/types.d.ts +1 -1
- package/packages/notification/dist/types.d.ts.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/conversation-bridge.ts +62 -24
- package/packages/notification/src/notification-center.ts +8 -0
- package/packages/notification/src/types.ts +2 -0
- 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/index.ts
CHANGED
|
@@ -78,6 +78,7 @@ import {
|
|
|
78
78
|
|
|
79
79
|
// --- Jev Auto-Continue: Agent autonomous decision-making --------------------
|
|
80
80
|
// Lazy import - only loads when packages/jev-judge exists and API key available
|
|
81
|
+
import { createTodoContinuation } from "./packages/jev-judge/dist/continuation-controller.js";
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* Get tasks from bd (beads) for Jev decision context.
|
|
@@ -1545,6 +1546,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
1545
1546
|
// --- jev-auto-continue: Agent autonomous decision when user unavailable -----
|
|
1546
1547
|
void initAutoContinue(pi);
|
|
1547
1548
|
|
|
1549
|
+
// Register todo-driven continuation controller
|
|
1550
|
+
createTodoContinuation(pi);
|
|
1551
|
+
|
|
1548
1552
|
// --- qdrant-vector-search: Qdrant integration for semantic skill search ----
|
|
1549
1553
|
// Collect promise so we can wait for initialization before showing startup notification
|
|
1550
1554
|
asyncInitPromises.push(initQdrant());
|
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.194",
|
|
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",
|
|
@@ -35,7 +35,6 @@ export declare class TodoContinuationController {
|
|
|
35
35
|
private pi;
|
|
36
36
|
private config;
|
|
37
37
|
private todoProvider;
|
|
38
|
-
private jevJudge?;
|
|
39
38
|
private state;
|
|
40
39
|
constructor(pi: ExtensionAPI, config?: ContinuationConfig);
|
|
41
40
|
/**
|
|
@@ -43,13 +42,13 @@ export declare class TodoContinuationController {
|
|
|
43
42
|
*/
|
|
44
43
|
register(): void;
|
|
45
44
|
/**
|
|
46
|
-
* Evaluate continuation decision
|
|
45
|
+
* Evaluate continuation decision and execute it
|
|
47
46
|
*/
|
|
48
47
|
private evaluateContinuation;
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
49
|
+
* Continue a specific todo item
|
|
51
50
|
*/
|
|
52
|
-
private
|
|
51
|
+
private continueItem;
|
|
53
52
|
/**
|
|
54
53
|
* Steer to continue a todo item
|
|
55
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAsB,KAAK,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AA8B1F;;GAEG;AACH,UAAU,kBAAkB;IAC3B,iDAAiD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC7B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,0BAA0B;IACtC,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,YAAY,CAAwB;
|
|
1
|
+
{"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAsB,KAAK,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AA8B1F;;GAEG;AACH,UAAU,kBAAkB;IAC3B,iDAAiD;IAClD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC7B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,0BAA0B;IACtC,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,YAAY,CAAwB;IAE5C,OAAO,CAAC,KAAK,CAYX;IAEF,YAAY,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAcxD;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAwCf;IAED;;OAEG;YACW,oBAAoB;IA+DlC;;OAEG;YACW,YAAY;IAsB1B;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBnD;IAED;;OAEG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhD;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAIZ;IAED;;OAEG;IACH,OAAO,CAAC,KAAK;IAgBb;;OAEG;IACH,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,QAAQ,IAAI;QAAE,OAAO,EAAE,QAAQ,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,QAAQ,GAAG,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"}
|
|
@@ -21,7 +21,6 @@ export class TodoContinuationController {
|
|
|
21
21
|
pi;
|
|
22
22
|
config;
|
|
23
23
|
todoProvider = createTodoProvider();
|
|
24
|
-
jevJudge;
|
|
25
24
|
state = {
|
|
26
25
|
sessionId: "",
|
|
27
26
|
generation: 0,
|
|
@@ -33,6 +32,7 @@ export class TodoContinuationController {
|
|
|
33
32
|
userPaused: false,
|
|
34
33
|
lastSteerMessage: null,
|
|
35
34
|
steerAttempts: 0,
|
|
35
|
+
lastEvaluationResult: null,
|
|
36
36
|
};
|
|
37
37
|
constructor(pi, config) {
|
|
38
38
|
this.pi = pi;
|
|
@@ -85,117 +85,82 @@ export class TodoContinuationController {
|
|
|
85
85
|
console.log("[TodoContinuation] Lifecycle hooks registered");
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
|
-
* Evaluate continuation decision
|
|
88
|
+
* Evaluate continuation decision and execute it
|
|
89
89
|
*/
|
|
90
90
|
async evaluateContinuation() {
|
|
91
91
|
// 1. Check user pause
|
|
92
92
|
if (this.state.userPaused) {
|
|
93
|
-
|
|
93
|
+
console.log("[TodoContinuation] User paused, stopping");
|
|
94
|
+
return;
|
|
94
95
|
}
|
|
95
96
|
// 2. Get current todo snapshot
|
|
96
97
|
const availability = await this.todoProvider.availability();
|
|
97
98
|
if (!availability.available) {
|
|
99
|
+
// No todo provider - don't auto-continue
|
|
98
100
|
console.log("[TodoContinuation] Todo provider unavailable:", availability.error);
|
|
99
|
-
return
|
|
100
|
-
}
|
|
101
|
-
const snapshot = await this.todoProvider.getSnapshot();
|
|
102
|
-
// 3. Check if state changed significantly
|
|
103
|
-
if (snapshot.revision === this.state.todoRevision && this.state.nextItemId) {
|
|
104
|
-
// Same todo state, try to continue next item
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
// Todo state changed, recalculate
|
|
108
|
-
this.state.todoRevision = snapshot.revision;
|
|
109
|
-
this.state.currentItemId = null;
|
|
110
|
-
this.state.nextItemId = null;
|
|
111
|
-
}
|
|
112
|
-
// 4. Get ready items
|
|
113
|
-
const readyItems = await this.todoProvider.getReady();
|
|
114
|
-
const completedItems = await this.todoProvider.getCompleted();
|
|
115
|
-
const pendingItems = await this.todoProvider.getPending();
|
|
116
|
-
// 5. Determine action
|
|
117
|
-
if (readyItems.length === 0 && pendingItems.length === 0) {
|
|
118
|
-
console.log("[TodoContinuation] All items complete");
|
|
119
|
-
return { action: "stop", reason: "All todos complete" };
|
|
120
|
-
}
|
|
121
|
-
if (readyItems.length === 0 && pendingItems.length > 0) {
|
|
122
|
-
// Items exist but all blocked
|
|
123
|
-
const blockedItems = await this.todoProvider.getBlocked();
|
|
124
|
-
const blocker = blockedItems[0];
|
|
125
|
-
console.log("[TodoContinuation] Items blocked:", blocker?.subject);
|
|
126
|
-
return {
|
|
127
|
-
action: "blocked",
|
|
128
|
-
question: `Task "${blocker?.subject}" is blocked. What is needed to unblock it?`,
|
|
129
|
-
reason: `Blocked by dependencies`,
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
// 6. Select next ready item
|
|
133
|
-
const nextItem = this.state.nextItemId
|
|
134
|
-
? readyItems.find((i) => i.id === this.state.nextItemId) ?? readyItems[0]
|
|
135
|
-
: readyItems[0];
|
|
136
|
-
if (!nextItem) {
|
|
137
|
-
return { action: "stop", reason: "No ready items" };
|
|
101
|
+
return;
|
|
138
102
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
103
|
+
try {
|
|
104
|
+
// Get snapshot for state tracking
|
|
105
|
+
await this.todoProvider.getSnapshot();
|
|
106
|
+
// 3. Get in-progress and pending items
|
|
107
|
+
const inProgressItems = await this.todoProvider.getByStatus("in_progress");
|
|
108
|
+
const pendingItems = await this.todoProvider.getPending();
|
|
109
|
+
const completedItems = await this.todoProvider.getCompleted();
|
|
110
|
+
// 4. If there's work in progress, continue it
|
|
111
|
+
if (inProgressItems.length > 0) {
|
|
112
|
+
const item = inProgressItems[0];
|
|
113
|
+
console.log(`[TodoContinuation] In-progress item: ${item.subject}`);
|
|
114
|
+
await this.continueItem(item);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
// 5. Determine action based on state
|
|
118
|
+
const totalItems = completedItems.length + pendingItems.length + inProgressItems.length;
|
|
119
|
+
const hasWork = pendingItems.length > 0 || inProgressItems.length > 0;
|
|
120
|
+
if (!hasWork && totalItems === 0) {
|
|
121
|
+
console.log("[TodoContinuation] All items complete");
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (pendingItems.length > 0) {
|
|
125
|
+
// Check if items are blocked
|
|
126
|
+
const blockedItems = await this.todoProvider.getBlocked();
|
|
127
|
+
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
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// Continue the first non-blocked pending item
|
|
135
|
+
const readyItems = await this.todoProvider.getReady();
|
|
136
|
+
if (readyItems.length > 0) {
|
|
137
|
+
await this.continueItem(readyItems[0]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
143
140
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
this.state.nextItemId = readyItems.length > 1 ? readyItems[1].id : null;
|
|
147
|
-
// 9. Determine if we should continue or ask
|
|
148
|
-
const shouldContinue = await this.shouldAutoContinue(nextItem);
|
|
149
|
-
if (shouldContinue.continue) {
|
|
150
|
-
console.log(`[TodoContinuation] Continuing item ${nextItem.id}: ${nextItem.subject}`);
|
|
151
|
-
return { action: "continue", nextItemId: nextItem.id };
|
|
141
|
+
catch (err) {
|
|
142
|
+
console.error("[TodoContinuation] Evaluation error:", err);
|
|
152
143
|
}
|
|
153
|
-
// 10. Jev says ask user
|
|
154
|
-
return {
|
|
155
|
-
action: "ask",
|
|
156
|
-
nextItemId: nextItem.id,
|
|
157
|
-
question: shouldContinue.question,
|
|
158
|
-
reason: shouldContinue.reason,
|
|
159
|
-
};
|
|
160
144
|
}
|
|
161
145
|
/**
|
|
162
|
-
*
|
|
146
|
+
* Continue a specific todo item
|
|
163
147
|
*/
|
|
164
|
-
async
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return
|
|
168
|
-
}
|
|
169
|
-
// If completing current item and next is ready, continue is routine
|
|
170
|
-
if (this.state.currentItemId !== item.id && this.state.nextItemId === item.id) {
|
|
171
|
-
return { continue: true };
|
|
172
|
-
}
|
|
173
|
-
// Check if we're mid-item
|
|
174
|
-
if (this.state.currentItemId === item.id) {
|
|
175
|
-
// Already working on this item, continue
|
|
176
|
-
return { continue: true };
|
|
177
|
-
}
|
|
178
|
-
// For ambiguous cases, use Jev
|
|
179
|
-
if (this.config.enableJev && this.jevJudge) {
|
|
180
|
-
const decision = await this.jevJudge.decide({
|
|
181
|
-
completedTasks: [],
|
|
182
|
-
remainingTasks: [item.subject],
|
|
183
|
-
totalTasks: 1,
|
|
184
|
-
waitTimeMinutes: 0,
|
|
185
|
-
userResponded: false,
|
|
186
|
-
sessionStartTime: new Date(),
|
|
187
|
-
});
|
|
188
|
-
if (decision.action === "proceed") {
|
|
189
|
-
return { continue: true };
|
|
190
|
-
}
|
|
191
|
-
return {
|
|
192
|
-
continue: false,
|
|
193
|
-
question: `Ready to continue: "${item.subject}"?`,
|
|
194
|
-
reason: decision.reasoning,
|
|
195
|
-
};
|
|
148
|
+
async continueItem(item) {
|
|
149
|
+
if (this.state.steerAttempts >= this.config.maxSteerAttempts) {
|
|
150
|
+
console.warn("[TodoContinuation] Max steer attempts reached");
|
|
151
|
+
return;
|
|
196
152
|
}
|
|
197
|
-
|
|
198
|
-
|
|
153
|
+
this.state.steerAttempts++;
|
|
154
|
+
this.state.continuationQueued = true;
|
|
155
|
+
// Build continuation message
|
|
156
|
+
const message = item.description
|
|
157
|
+
? `Continue task: ${item.subject}\n\n${item.description}`
|
|
158
|
+
: `Continue task: ${item.subject}`;
|
|
159
|
+
this.state.lastSteerMessage = message;
|
|
160
|
+
console.log(`[TodoContinuation] Continuing: ${item.subject}`);
|
|
161
|
+
console.log(`[TodoContinuation] Message: ${message}`);
|
|
162
|
+
// Note: Pi does not expose sendUserMessage API.
|
|
163
|
+
// The Telegram notification system will prompt user for ambiguous cases.
|
|
199
164
|
}
|
|
200
165
|
/**
|
|
201
166
|
* Steer to continue a todo item
|
|
@@ -247,6 +212,7 @@ export class TodoContinuationController {
|
|
|
247
212
|
userPaused: false,
|
|
248
213
|
lastSteerMessage: null,
|
|
249
214
|
steerAttempts: 0,
|
|
215
|
+
lastEvaluationResult: null,
|
|
250
216
|
};
|
|
251
217
|
}
|
|
252
218
|
/**
|