pi-harness-runtime 1.1.233 → 1.1.235

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 (109) hide show
  1. package/index.ts +39 -12
  2. package/package.json +1 -1
  3. package/packages/a2a-adapter/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/architecture-generator/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-refactor/package.json +1 -1
  8. package/packages/autonomous-runtime/package.json +1 -1
  9. package/packages/cache-strategy/package.json +1 -1
  10. package/packages/capability-registry/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/cli-plugin-sdk/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/clipboard-plugin/package.json +1 -1
  15. package/packages/code-generation/package.json +1 -1
  16. package/packages/code-review/package.json +1 -1
  17. package/packages/codex-adapter/package.json +1 -1
  18. package/packages/codex-watcher/package.json +1 -1
  19. package/packages/config-capture/package.json +1 -1
  20. package/packages/context-compiler/package.json +1 -1
  21. package/packages/context-discovery/package.json +1 -1
  22. package/packages/context-manager/package.json +1 -1
  23. package/packages/cookie-sanitizer/package.json +1 -1
  24. package/packages/cost-optimizer/package.json +1 -1
  25. package/packages/dependency-analyzer/package.json +1 -1
  26. package/packages/django-plugin/package.json +1 -1
  27. package/packages/doc-generator/package.json +1 -1
  28. package/packages/e2e-tester/package.json +1 -1
  29. package/packages/evaluation-engine/package.json +1 -1
  30. package/packages/evaluation-runner/package.json +1 -1
  31. package/packages/event-bus/package.json +1 -1
  32. package/packages/event-store/package.json +1 -1
  33. package/packages/experience-replay/package.json +1 -1
  34. package/packages/feedback-collector/package.json +1 -1
  35. package/packages/file-copy-helper/package.json +1 -1
  36. package/packages/framework-detector/package.json +1 -1
  37. package/packages/framework-plugin-sdk/package.json +1 -1
  38. package/packages/frappe-plugin/package.json +1 -1
  39. package/packages/generic-web-plugin/package.json +1 -1
  40. package/packages/health-monitor/package.json +1 -1
  41. package/packages/intent-analyzer/package.json +1 -1
  42. package/packages/jev-judge/dist/continuation-controller.d.ts +2 -4
  43. package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
  44. package/packages/jev-judge/dist/continuation-controller.js +15 -72
  45. package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
  46. package/packages/jev-judge/dist/typesafe-provider.js +2 -2
  47. package/packages/jev-judge/dist/typesafe-provider.js.map +1 -1
  48. package/packages/jev-judge/package.json +1 -1
  49. package/packages/jev-judge/src/continuation-controller.ts +18 -81
  50. package/packages/jev-judge/src/typesafe-provider.ts +2 -2
  51. package/packages/knowledge-graph/package.json +1 -1
  52. package/packages/knowledge-retrieval/package.json +1 -1
  53. package/packages/laravel-plugin/package.json +1 -1
  54. package/packages/learning-engine/package.json +1 -1
  55. package/packages/mcp-adapter/package.json +1 -1
  56. package/packages/memory-engine/package.json +1 -1
  57. package/packages/milestone-manager/package.json +1 -1
  58. package/packages/model-registry/package.json +1 -1
  59. package/packages/nextjs-plugin/package.json +1 -1
  60. package/packages/notification/package.json +1 -1
  61. package/packages/observability/package.json +1 -1
  62. package/packages/okf-indexer/package.json +1 -1
  63. package/packages/paperclip-integration/package.json +1 -1
  64. package/packages/performance-optimizer/package.json +1 -1
  65. package/packages/privilege-broker/package.json +1 -1
  66. package/packages/project-analyzer/package.json +1 -1
  67. package/packages/project-bootstrap/package.json +1 -1
  68. package/packages/projection-engine/package.json +1 -1
  69. package/packages/prompt-compiler/package.json +1 -1
  70. package/packages/prompt-versioning/package.json +1 -1
  71. package/packages/provider-adapter-sdk/package.json +1 -1
  72. package/packages/provider-router/package.json +1 -1
  73. package/packages/provider-selector/package.json +1 -1
  74. package/packages/providers/package.json +1 -1
  75. package/packages/qdrant-skills/package.json +1 -1
  76. package/packages/quota-manager/package.json +1 -1
  77. package/packages/rate-limiter/package.json +1 -1
  78. package/packages/react-vite-plugin/package.json +1 -1
  79. package/packages/release-manager/package.json +1 -1
  80. package/packages/requirement-compiler/package.json +1 -1
  81. package/packages/runtime/package.json +1 -1
  82. package/packages/scheduler/package.json +1 -1
  83. package/packages/scheduler-adapter/package.json +1 -1
  84. package/packages/session/package.json +1 -1
  85. package/packages/session-api/package.json +1 -1
  86. package/packages/session-export/package.json +1 -1
  87. package/packages/shared-context/package.json +1 -1
  88. package/packages/skill-mcp-client/package.json +1 -1
  89. package/packages/skill-registry/package.json +1 -1
  90. package/packages/skills/package.json +1 -1
  91. package/packages/sprint-planner/package.json +1 -1
  92. package/packages/subscription-engine/package.json +1 -1
  93. package/packages/task-compiler/package.json +1 -1
  94. package/packages/telegram/package.json +1 -1
  95. package/packages/tencentdb-memory/package.json +1 -1
  96. package/packages/tencentdb-sync/package.json +1 -1
  97. package/packages/test-data-generator/package.json +1 -1
  98. package/packages/test-generator/package.json +1 -1
  99. package/packages/todo-bd-sync/package.json +1 -1
  100. package/packages/token-estimation/package.json +1 -1
  101. package/packages/token-optimizer/package.json +1 -1
  102. package/packages/trajectory/package.json +1 -1
  103. package/packages/tui/package.json +1 -1
  104. package/packages/types/package.json +1 -1
  105. package/packages/webmcp-tester/package.json +1 -1
  106. package/packages/workflow-events/package.json +1 -1
  107. package/packages/workspace-scanner/package.json +1 -1
  108. package/packages/worktree/package.json +1 -1
  109. package/packages/write-review/package.json +1 -1
package/index.ts CHANGED
@@ -79,7 +79,7 @@ import {
79
79
 
80
80
  // --- Jev Auto-Continue: Agent autonomous decision-making --------------------
81
81
  // Lazy import - only loads when packages/jev-judge exists and API key available
82
- import { createTodoContinuation } from "./packages/jev-judge/dist/continuation-controller.js";
82
+
83
83
 
84
84
  /**
85
85
  * Get tasks from bd (beads) for Jev decision context.
@@ -439,6 +439,34 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
439
439
  }
440
440
  };
441
441
 
442
+ // --- todo continuation: Retain one controller per session ----------
443
+ let todoContinuationController: import("./packages/jev-judge/dist/continuation-controller.js").TodoContinuationController | null = null;
444
+
445
+ // Create controller on session_start with proper dispatch callback
446
+ pi.on("session_start", async (_event, ctx) => {
447
+ try {
448
+ const { TodoContinuationController } = await import("./packages/jev-judge/dist/continuation-controller.js");
449
+ // SAFETY: ctx is ExtensionContext with sessionManager, isIdle, hasPendingMessages
450
+ // dispatch uses pi.sendUserMessage for actual message delivery
451
+ todoContinuationController = new TodoContinuationController(
452
+ ctx as unknown as import("./packages/jev-judge/dist/todo-provider.js").TodoContext,
453
+ {
454
+ dispatch: async (content: string) => {
455
+ await pi.sendUserMessage(content, { deliverAs: "steer" });
456
+ },
457
+ }
458
+ );
459
+ logToFile("[auto-continue]", "Todo continuation controller initialized");
460
+ } catch (err) {
461
+ logToFile("[auto-continue]", "Failed to create todo continuation controller:", String(err));
462
+ }
463
+ });
464
+
465
+ // Clean up controller on session shutdown
466
+ pi.on("session_shutdown", () => {
467
+ todoContinuationController = null;
468
+ });
469
+
442
470
  // --- agent_settled: Check todos and continue work ---------------
443
471
  pi.on("agent_settled", async (_event, ctx) => {
444
472
  // Don't continue if user is waiting for response
@@ -450,17 +478,18 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
450
478
  // Don't continue if session is not idle or has pending messages
451
479
  if (!ctx.isIdle?.() || ctx.hasPendingMessages?.()) return;
452
480
 
453
- // Import and use the continuation controller with proper context
481
+ // Use the retained controller (not a new one per event)
454
482
  try {
455
- const { TodoContinuationController } = await import("./packages/jev-judge/dist/continuation-controller.js");
456
- // SAFETY: ctx is ExtensionContext which has all TodoContext properties (sessionManager, isIdle, hasPendingMessages, sendUserMessage)
457
- // TodoContinuationController only needs the subset defined in TodoContext
458
- const controller = new TodoContinuationController(ctx as unknown as import("./packages/jev-judge/dist/todo-provider.js").TodoContext);
459
- const result = await controller.decide();
483
+ if (!todoContinuationController) {
484
+ logToFile("[auto-continue]", "No todo continuation controller available");
485
+ return;
486
+ }
487
+
488
+ const result = await todoContinuationController.decide();
460
489
 
461
490
  if (result.action === "continue" && result.nextItemId) {
462
491
  updateAutoContinueStatus("CONTINUING");
463
- await controller.steerToContinue(result.nextItemId);
492
+ await todoContinuationController.steerToContinue(result.nextItemId);
464
493
  setTimeout(() => updateAutoContinueStatus("IDLE"), 2000);
465
494
  } else if (result.action === "blocked") {
466
495
  updateAutoContinueStatus("ERROR", "blocked");
@@ -538,7 +567,8 @@ async function initQdrant(): Promise<void> {
538
567
 
539
568
  // Verify Qdrant connection with health check
540
569
  try {
541
- const healthUrl = `${cfg.url}/health`;
570
+ // Use /healthz endpoint (not /health) for Qdrant
571
+ const healthUrl = `${cfg.url}/healthz`;
542
572
  const healthResponse = await fetch(healthUrl, {
543
573
  headers: cfg.apiKey ? { "api-key": cfg.apiKey } : {},
544
574
  });
@@ -1687,9 +1717,6 @@ export default function (pi: ExtensionAPI) {
1687
1717
  // --- jev-auto-continue: Agent autonomous decision when user unavailable -----
1688
1718
  asyncInitPromises.push(initAutoContinue(pi));
1689
1719
 
1690
- // Register todo-driven continuation controller
1691
- createTodoContinuation(pi);
1692
-
1693
1720
  // --- qdrant-vector-search: Qdrant integration for semantic skill search ----
1694
1721
  // Collect promise so we can wait for initialization before showing startup notification
1695
1722
  asyncInitPromises.push(initQdrant());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/a2a-adapter",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Google Agent-to-Agent (A2A) protocol adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/agent-policy",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Agent policy runtime for pi-harness - enforces mandatory rule delivery and mutation gating",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/architecture-generator",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Generate ADR and Mermaid diagrams from project analysis",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/auth",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "pi-harness-runtime — auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-refactor",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Autonomous refactoring engine",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/autonomous-runtime",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Autonomous Operations Runtime — task inbox, lease management, and worker lifecycle (RFC-0101)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cache-strategy",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Smart caching with TTL and invalidation strategies (RFC-0022)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/capability-registry",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/checkpoint",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Enhanced checkpoint system with incremental snapshots, diff-based storage, and recovery strategies",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/cli-plugin-sdk",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "CLI Plugin SDK for pi-harness — install, list, remove, update, invoke plugins",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/clipboard",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/clipboard-plugin",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-generation",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Code generation pipeline for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/code-review",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Automated code review engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/codex-adapter",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "OpenAI Codex provider adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/codex-watcher",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Watches Codex CLI sessions and emits visible messages for PING-PONG monitoring",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/config-capture",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Auto-capture API-fetched configuration values to AGENTS.md",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-compiler",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Bounded context selection engine for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-discovery",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/context-manager",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Context Window Manager — prevents model context overflow via compaction and resume prompts (RFC-0010)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cost-optimizer",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Cost Optimizer for pi-harness-runtime — budget tracking, forecasting, and model selection optimization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/dependency-analyzer",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/django-plugin",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Django framework analysis — models, management commands, settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/doc-generator",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Auto-Doc Generator — generate documentation from source code (RFC-0014)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/e2e-tester",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
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/evaluation-engine",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/evaluation-runner",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic evaluation framework for AI outputs (RFC-0020)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-bus",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/event-store",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/experience-replay",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Experience replay for debugging and reproducibility (RFC-0059)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/feedback-collector",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Collect and aggregate human/automated feedback (RFC-0021)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/file-copy-helper",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Injects cp/sudo cp rule when user asks to mimic/copy files",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/framework-detector",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Framework detection system for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/framework-plugin-sdk",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Framework plugin SDK for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/frappe-plugin",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Frappe/ERPNext framework analysis — DocTypes, hooks, bench sites, site config",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/generic-web-plugin",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "description": "Generic web framework analysis — REST/GraphQL endpoints, OpenAPI, auth",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/health-monitor",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "description": "Health monitoring and auto-healing",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/intent-analyzer",
3
- "version": "1.1.233",
3
+ "version": "1.1.235",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -3,6 +3,8 @@ import type { TodoItem, TodoContext } from "./todo-provider.js";
3
3
  * Continuation configuration
4
4
  */
5
5
  export interface ContinuationConfig {
6
+ /** Dispatch function to send messages to the agent (required) */
7
+ dispatch: (content: string) => Promise<void>;
6
8
  /** Minimum wait before Jev fallback (ms) */
7
9
  jevFallbackMinWaitMs?: number;
8
10
  /** Threshold for routine continuation */
@@ -59,10 +61,6 @@ export declare class TodoContinuationController {
59
61
  * Checks blockers and pause BEFORE selecting a task
60
62
  */
61
63
  decide(): Promise<ContinuationResult>;
62
- /**
63
- * Evaluate continuation decision and execute it
64
- */
65
- private evaluateContinuation;
66
64
  /**
67
65
  * Continue a specific todo item
68
66
  */
@@ -1 +1 @@
1
- {"version":3,"file":"continuation-controller.d.ts","sourceRoot":"","sources":["../src/continuation-controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAmBhE;;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,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2BAA2B,EAAE,MAAM,CAAC;IACpC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,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BAA0B;IACtC,OAAO,CAAC,GAAG,CAAc;IACzB,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,YAAY,CAAwC;IAE5D,OAAO,CAAC,KAAK,CAaX;IAEF,YAAY,GAAG,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAUxD;IAED;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAuE1C;IAED;;OAEG;IACG,YAAY,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BhD;IAED;;OAEG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCnD;IAED;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjD;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAIZ;IAED;;OAEG;IACH,MAAM,IAAI,IAAI,CAeb;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAIf;IAED;;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;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,WAAW,EAChB,MAAM,CAAC,EAAE,kBAAkB,GACzB,0BAA0B,CAE5B"}
@@ -85,11 +85,11 @@ export class TodoContinuationController {
85
85
  }
86
86
  // 3. Get todo state (throws on branch read failure)
87
87
  let inProgress;
88
- let pending;
88
+ let ready;
89
89
  let blocked;
90
90
  try {
91
91
  inProgress = await this.todoProvider.getInProgress();
92
- pending = await this.todoProvider.getPending();
92
+ ready = await this.todoProvider.getReady();
93
93
  blocked = await this.todoProvider.getBlocked();
94
94
  }
95
95
  catch (err) {
@@ -97,12 +97,7 @@ export class TodoContinuationController {
97
97
  debugLog("TodoContinuation", "Failed to read todos:", msg);
98
98
  return { action: "stop", reason: `todo read failed: ${msg}` };
99
99
  }
100
- // 4. Check for blocked items FIRST (before selecting any task)
101
- if (blocked.length > 0) {
102
- debugLog("TodoContinuation", "Tasks blocked:", blocked.length);
103
- return { action: "blocked", question: `${blocked.length} task(s) blocked` };
104
- }
105
- // 5. Continue in-progress work if any
100
+ // 4. Continue in-progress work first
106
101
  if (inProgress.length > 0) {
107
102
  const item = inProgress[0];
108
103
  // Reset counter if switching to a different task
@@ -116,9 +111,9 @@ export class TodoContinuationController {
116
111
  }
117
112
  return { action: "continue", nextItemId: item.id };
118
113
  }
119
- // 6. Continue pending work if any
120
- if (pending.length > 0) {
121
- const item = pending[0];
114
+ // 5. Continue ready pending work (not blocked)
115
+ if (ready.length > 0) {
116
+ const item = ready[0];
122
117
  // Reset counter if switching to a different task
123
118
  if (this.state.lastItemContinued !== item.id) {
124
119
  this.state.steerAttemptsForCurrentItem = 0;
@@ -130,66 +125,14 @@ export class TodoContinuationController {
130
125
  }
131
126
  return { action: "continue", nextItemId: item.id };
132
127
  }
128
+ // 6. Only report blocked when nothing can proceed
129
+ if (blocked.length > 0) {
130
+ debugLog("TodoContinuation", "Tasks blocked:", blocked.length);
131
+ return { action: "blocked", question: `${blocked.length} task(s) blocked` };
132
+ }
133
133
  // 7. No work remaining
134
134
  return { action: "stop", reason: "No pending tasks" };
135
135
  }
136
- /**
137
- * Evaluate continuation decision and execute it
138
- */
139
- async evaluateContinuation() {
140
- // 1. Check user pause
141
- if (this.state.userPaused) {
142
- debugLog("TodoContinuation", "User paused, stopping");
143
- return;
144
- }
145
- // 2. Get current todo snapshot
146
- const availability = await this.todoProvider.availability();
147
- if (!availability.available) {
148
- // No todo provider - don't auto-continue
149
- debugLog("TodoContinuation", "Provider unavailable:", availability.error);
150
- return;
151
- }
152
- try {
153
- // Get snapshot for state tracking
154
- await this.todoProvider.getSnapshot();
155
- // 3. Get in-progress and pending items
156
- const inProgressItems = await this.todoProvider.getByStatus("in_progress");
157
- const pendingItems = await this.todoProvider.getPending();
158
- const completedItems = await this.todoProvider.getCompleted();
159
- // 4. If there's work in progress, continue it
160
- if (inProgressItems.length > 0) {
161
- const item = inProgressItems[0];
162
- debugLog("TodoContinuation", "In-progress item:", item.subject);
163
- await this.continueItem(item);
164
- return;
165
- }
166
- // 5. Determine action based on state
167
- const totalItems = completedItems.length + pendingItems.length + inProgressItems.length;
168
- const hasWork = pendingItems.length > 0 || inProgressItems.length > 0;
169
- if (!hasWork && totalItems === 0) {
170
- debugLog("TodoContinuation", "All items complete");
171
- return;
172
- }
173
- if (pendingItems.length > 0) {
174
- // Check if items are blocked
175
- const blockedItems = await this.todoProvider.getBlocked();
176
- if (blockedItems.length === pendingItems.length) {
177
- // All pending items are blocked - don't auto-continue
178
- const blocker = blockedItems[0];
179
- debugLog("TodoContinuation", "Items blocked:", blocker?.subject);
180
- return;
181
- }
182
- // Continue the first non-blocked pending item
183
- const readyItems = await this.todoProvider.getReady();
184
- if (readyItems.length > 0) {
185
- await this.continueItem(readyItems[0]);
186
- }
187
- }
188
- }
189
- catch (err) {
190
- debugLog("TodoContinuation", "Evaluation error:", err);
191
- }
192
- }
193
136
  /**
194
137
  * Continue a specific todo item
195
138
  */
@@ -211,9 +154,9 @@ export class TodoContinuationController {
211
154
  : `Continue task: ${item.subject}`;
212
155
  this.state.lastSteerMessage = message;
213
156
  debugLog("TodoContinuation", "Sending continuation:", item.subject);
214
- // Send continuation message via Pi API
157
+ // Send continuation message via dispatch callback
215
158
  try {
216
- await this.ctx.sendUserMessage?.(message, { deliverAs: "steer" });
159
+ await this.config.dispatch(message);
217
160
  }
218
161
  catch (err) {
219
162
  debugLog("TodoContinuation", "Failed to send continuation:", String(err));
@@ -243,9 +186,9 @@ export class TodoContinuationController {
243
186
  this.state.lastSteerMessage = message;
244
187
  this.state.todoRevision = snapshot.revision;
245
188
  debugLog("TodoContinuation", "Steering to continue item", itemId);
246
- // Send continuation message via Pi API
189
+ // Send continuation message via dispatch callback
247
190
  try {
248
- await this.ctx.sendUserMessage?.(message, { deliverAs: "steer" });
191
+ await this.config.dispatch(message);
249
192
  }
250
193
  catch (err) {
251
194
  debugLog("TodoContinuation", "Failed to send steer:", String(err));