pi-harness-runtime 1.1.502 → 1.1.504

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 (55) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/harness/jev-request-scope.ts +170 -16
  3. package/index.ts +57 -2
  4. package/package.json +1 -1
  5. package/packages/agent-policy/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-runtime/package.json +1 -1
  8. package/packages/checkpoint/package.json +1 -1
  9. package/packages/clipboard/package.json +1 -1
  10. package/packages/codex-watcher/package.json +1 -1
  11. package/packages/config-capture/package.json +1 -1
  12. package/packages/contracts/package.json +1 -1
  13. package/packages/cookie-sanitizer/package.json +1 -1
  14. package/packages/evaluation-engine/package.json +1 -1
  15. package/packages/event-bus/package.json +1 -1
  16. package/packages/event-store/package.json +1 -1
  17. package/packages/experience-replay/package.json +1 -1
  18. package/packages/file-copy-helper/package.json +1 -1
  19. package/packages/intent-analyzer/package.json +1 -1
  20. package/packages/jev-judge/dist/continuation-controller.d.ts +10 -1
  21. package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
  22. package/packages/jev-judge/dist/continuation-controller.js +11 -0
  23. package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
  24. package/packages/jev-judge/dist/todo-provider.d.ts +25 -0
  25. package/packages/jev-judge/dist/todo-provider.d.ts.map +1 -1
  26. package/packages/jev-judge/dist/todo-provider.js +56 -0
  27. package/packages/jev-judge/dist/todo-provider.js.map +1 -1
  28. package/packages/jev-judge/package.json +1 -1
  29. package/packages/jev-judge/src/continuation-controller.ts +13 -1
  30. package/packages/jev-judge/src/todo-provider.ts +83 -0
  31. package/packages/knowledge-retrieval/package.json +1 -1
  32. package/packages/learning-engine/package.json +1 -1
  33. package/packages/logging/package.json +1 -1
  34. package/packages/memory-engine/package.json +1 -1
  35. package/packages/notification/package.json +1 -1
  36. package/packages/paperclip-integration/package.json +1 -1
  37. package/packages/performance-optimizer/package.json +1 -1
  38. package/packages/privilege-broker/package.json +1 -1
  39. package/packages/prompt-compiler/package.json +1 -1
  40. package/packages/providers/package.json +1 -1
  41. package/packages/qdrant-skills/package.json +1 -1
  42. package/packages/quota-manager/package.json +1 -1
  43. package/packages/relay/package.json +1 -1
  44. package/packages/skill-mcp-client/package.json +1 -1
  45. package/packages/skills/package.json +1 -1
  46. package/packages/todo-bd-sync/package.json +1 -1
  47. package/packages/token-estimation/package.json +1 -1
  48. package/packages/tooling-preference/package.json +1 -1
  49. package/packages/trajectory/package.json +1 -1
  50. package/packages/tui/package.json +1 -1
  51. package/packages/two-phase-review/package.json +1 -1
  52. package/packages/types/package.json +1 -1
  53. package/packages/webmcp-tester/package.json +1 -1
  54. package/packages/wiki/package.json +1 -1
  55. 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/knowledge-retrieval",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Knowledge retrieval via TencentDB-Agent-Memory MCP (RFC-0105)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/learning-engine",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Learning engine for extracting lessons from runtime execution (RFC-0058)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/logging",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "type": "module",
5
5
  "description": "Centralized structured application logging with buffered Cloudflare R2 and webhook transports",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/memory-engine",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Memory engine with OKF integration for durable knowledge management (RFC-0060)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/notification",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — notification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/paperclip-integration",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Paperclip API integration: poll agent inbox, route tasks to pi.dev, Telegram alerts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/performance-optimizer",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Performance optimization analyzer for pi-harness runtime (RFC-0056)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/privilege-broker",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Privilege Broker — capability registry and command executor for autonomous runtime (RFC-0101 §7)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/relay",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "type": "module",
5
5
  "description": "Cloud relay for remote access - T3 Connect style for pi-harness",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skills",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "File-based skill system with pi.dev compatibility and Hermes self-improvement",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/todo-bd-sync",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Two-way sync between rpiv-todo overlay and bd issue tracker",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-estimation",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — token-estimation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tooling-preference",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — JS/TS tooling preference (Biome vs ESLint/Prettier) proposal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Trajectory capture for the write-review loop — persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "pi-harness-runtime — tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/two-phase-review",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
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",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.502",
3
+ "version": "1.1.504",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",