pi-harness-runtime 1.1.501 → 1.1.503
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 +157 -0
- package/harness/jev-request-scope.ts +170 -16
- package/index.ts +57 -2
- package/package.json +1 -1
- package/packages/agent-policy/package.json +1 -1
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/clipboard/package.json +1 -1
- package/packages/codex-watcher/package.json +1 -1
- package/packages/config-capture/package.json +1 -1
- package/packages/contracts/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/evaluation-engine/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/file-copy-helper/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/jev-judge/dist/continuation-controller.d.ts +10 -1
- package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +11 -0
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/dist/todo-provider.d.ts +25 -0
- package/packages/jev-judge/dist/todo-provider.d.ts.map +1 -1
- package/packages/jev-judge/dist/todo-provider.js +56 -0
- 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 +13 -1
- package/packages/jev-judge/src/todo-provider.ts +83 -0
- package/packages/knowledge-retrieval/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/logging/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/notification/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/prompt-compiler/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/relay/package.json +1 -1
- package/packages/skill-mcp-client/package.json +1 -1
- package/packages/skills/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/token-estimation/package.json +1 -1
- package/packages/tooling-preference/package.json +1 -1
- package/packages/trajectory/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/two-phase-review/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/webmcp-tester/package.json +1 -1
- package/packages/wiki/package.json +1 -1
- package/packages/write-review/package.json +1 -1
|
@@ -50,6 +50,19 @@ export interface TodoSnapshot {
|
|
|
50
50
|
createdAt: Date;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* The state of the list after one change.
|
|
55
|
+
*
|
|
56
|
+
* The history of the list is the sequence of these states. It says what a
|
|
57
|
+
* change touched, also when the item is back in the state it had before: a
|
|
58
|
+
* todo that was reopened and finished again is work of the request that
|
|
59
|
+
* did it.
|
|
60
|
+
*/
|
|
61
|
+
export interface TodoHistoryEntry {
|
|
62
|
+
/** The list as it was after the change. */
|
|
63
|
+
items: TodoItem[];
|
|
64
|
+
}
|
|
65
|
+
|
|
53
66
|
/**
|
|
54
67
|
* Availability result for todo provider
|
|
55
68
|
*/
|
|
@@ -102,6 +115,15 @@ export interface TodoProvider {
|
|
|
102
115
|
* Get blocked items (pending with unsatisfied dependencies)
|
|
103
116
|
*/
|
|
104
117
|
getBlocked(): Promise<TodoItem[]>;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The history of the list: the state after every change.
|
|
121
|
+
*
|
|
122
|
+
* The list alone says what the work is now. The history says what a
|
|
123
|
+
* request touched, also when the item is back in the state it had
|
|
124
|
+
* before.
|
|
125
|
+
*/
|
|
126
|
+
getHistory(): Promise<TodoHistoryEntry[]>;
|
|
105
127
|
}
|
|
106
128
|
|
|
107
129
|
/**
|
|
@@ -111,6 +133,8 @@ export class MockTodoProvider implements TodoProvider {
|
|
|
111
133
|
private items: TodoItem[] = [];
|
|
112
134
|
private _sessionId: string;
|
|
113
135
|
private _revision = 0;
|
|
136
|
+
/** The state of the list after every change. */
|
|
137
|
+
private history: TodoHistoryEntry[] = [];
|
|
114
138
|
|
|
115
139
|
constructor(sessionId?: string) {
|
|
116
140
|
this._sessionId = sessionId ?? `mock-${Date.now()}`;
|
|
@@ -134,6 +158,10 @@ export class MockTodoProvider implements TodoProvider {
|
|
|
134
158
|
return this.items.filter((item) => item.status === status);
|
|
135
159
|
}
|
|
136
160
|
|
|
161
|
+
async getHistory(): Promise<TodoHistoryEntry[]> {
|
|
162
|
+
return this.history.map((entry) => ({ items: entry.items.map((item) => ({ ...item })) }));
|
|
163
|
+
}
|
|
164
|
+
|
|
137
165
|
async getInProgress(): Promise<TodoItem[]> {
|
|
138
166
|
return this.getByStatus("in_progress");
|
|
139
167
|
}
|
|
@@ -173,6 +201,7 @@ export class MockTodoProvider implements TodoProvider {
|
|
|
173
201
|
const id = this.items.length + 1;
|
|
174
202
|
const newItem: TodoItem = { ...item, id };
|
|
175
203
|
this.items.push(newItem);
|
|
204
|
+
this.record();
|
|
176
205
|
return newItem;
|
|
177
206
|
}
|
|
178
207
|
|
|
@@ -180,12 +209,19 @@ export class MockTodoProvider implements TodoProvider {
|
|
|
180
209
|
const item = this.items.find((i) => i.id === id);
|
|
181
210
|
if (item) {
|
|
182
211
|
item.status = status;
|
|
212
|
+
this.record();
|
|
183
213
|
}
|
|
184
214
|
}
|
|
185
215
|
|
|
186
216
|
clear(): void {
|
|
187
217
|
this.items = [];
|
|
188
218
|
this._revision++;
|
|
219
|
+
this.record();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** Remember the state of the list after a change. */
|
|
223
|
+
private record(): void {
|
|
224
|
+
this.history.push({ items: this.items.map((item) => ({ ...item })) });
|
|
189
225
|
}
|
|
190
226
|
}
|
|
191
227
|
|
|
@@ -279,6 +315,49 @@ class PiTodoProvider implements TodoProvider {
|
|
|
279
315
|
return fromEntries ?? fromToolResults ?? null;
|
|
280
316
|
}
|
|
281
317
|
|
|
318
|
+
/**
|
|
319
|
+
* The history of the list: the state after every change.
|
|
320
|
+
*
|
|
321
|
+
* The branch holds the result of every call of the todo tool, so the
|
|
322
|
+
* history is the list of those states in the order of the calls. A
|
|
323
|
+
* branch that was compacted lost the early states, and the history is
|
|
324
|
+
* then shorter: the reader falls back to the list alone.
|
|
325
|
+
*/
|
|
326
|
+
async getHistory(): Promise<TodoHistoryEntry[]> {
|
|
327
|
+
const entries: TodoHistoryEntry[] = [];
|
|
328
|
+
try {
|
|
329
|
+
const branch = this.ctx.sessionManager.getBranch();
|
|
330
|
+
for (const entry of branch) {
|
|
331
|
+
const e = entry as {
|
|
332
|
+
type?: string;
|
|
333
|
+
customType?: string;
|
|
334
|
+
data?: unknown;
|
|
335
|
+
message?: { role?: string; toolName?: string; details?: unknown };
|
|
336
|
+
};
|
|
337
|
+
// The state of the todo extension is a state of the list.
|
|
338
|
+
if (e.type === "custom") {
|
|
339
|
+
if (e.customType === "rpiv-todo-state" && this.isTaskDetails(e.data)) {
|
|
340
|
+
entries.push({
|
|
341
|
+
items: (e.data as { tasks: TodoItem[] }).tasks.map((task) => ({ ...task })),
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
if (e.type !== "message") continue;
|
|
347
|
+
const msg = e.message;
|
|
348
|
+
if (msg?.role !== "toolResult" || msg.toolName !== "todo") continue;
|
|
349
|
+
if (!this.isTaskDetails(msg.details)) continue;
|
|
350
|
+
entries.push({
|
|
351
|
+
items: (msg.details as { tasks: TodoItem[] }).tasks.map((task) => ({ ...task })),
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
} catch (err) {
|
|
355
|
+
this._lastError = err instanceof Error ? err.message : String(err);
|
|
356
|
+
return entries;
|
|
357
|
+
}
|
|
358
|
+
return entries;
|
|
359
|
+
}
|
|
360
|
+
|
|
282
361
|
async getSnapshot(): Promise<TodoSnapshot> {
|
|
283
362
|
this._revision++;
|
|
284
363
|
const state = this.getTodoState();
|
|
@@ -359,6 +438,10 @@ class PiUnavailableTodoProvider implements TodoProvider {
|
|
|
359
438
|
return [];
|
|
360
439
|
}
|
|
361
440
|
|
|
441
|
+
async getHistory(): Promise<TodoHistoryEntry[]> {
|
|
442
|
+
return [];
|
|
443
|
+
}
|
|
444
|
+
|
|
362
445
|
async getInProgress(): Promise<TodoItem[]> {
|
|
363
446
|
return [];
|
|
364
447
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/two-phase-review",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.503",
|
|
4
4
|
"description": "pi-harness-runtime — two-phase implementation and review workflow (queue review signals, gate the phase, scope the diff)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|