pi-harness-runtime 1.1.237 → 1.1.239
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 +63 -18
- 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 +24 -0
- package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
- package/packages/jev-judge/dist/continuation-controller.js +63 -6
- package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
- package/packages/jev-judge/dist/task-intake.d.ts +31 -1
- package/packages/jev-judge/dist/task-intake.d.ts.map +1 -1
- package/packages/jev-judge/dist/task-intake.js +70 -13
- package/packages/jev-judge/dist/task-intake.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/continuation-controller.ts +71 -6
- package/packages/jev-judge/src/task-intake.ts +84 -17
- 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/package.json +1 -1
- 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
|
@@ -510,12 +510,20 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
510
510
|
|
|
511
511
|
// Wire user messages to task intake
|
|
512
512
|
pi.on("message_start", (event) => {
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
const msgEvent = event as { message?: { role?: string; content?: string | Array<{ type?: string; text?: string }>; customType?: string } };
|
|
514
|
+
const msg = msgEvent.message;
|
|
515
|
+
if (!msg) return;
|
|
516
|
+
|
|
517
|
+
// Skip harness-generated messages (internal use)
|
|
518
|
+
if (msg.customType?.startsWith("harness:")) {
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
if (msg.role === "user" && taskIntakeController) {
|
|
523
|
+
// Temporary pause for user input processing (auto-clears on next decision)
|
|
516
524
|
if (todoContinuationController) {
|
|
517
|
-
todoContinuationController.
|
|
518
|
-
logToFile("[auto-continue]", "User input received, pausing
|
|
525
|
+
todoContinuationController.tempPause();
|
|
526
|
+
logToFile("[auto-continue]", "User input received, temp pausing");
|
|
519
527
|
}
|
|
520
528
|
|
|
521
529
|
// Extract user message content
|
|
@@ -532,13 +540,16 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
532
540
|
}
|
|
533
541
|
|
|
534
542
|
// Evaluate with task intake controller (non-blocking)
|
|
535
|
-
if (userMessage.trim().length > 10 && taskIntakeController) {
|
|
543
|
+
if (userMessage.trim().length > 10 && taskIntakeController && todoContinuationController) {
|
|
536
544
|
const intake = taskIntakeController;
|
|
537
|
-
|
|
545
|
+
const controller = todoContinuationController;
|
|
546
|
+
|
|
547
|
+
// Get current todos for duplicate detection
|
|
548
|
+
intake.evaluateWithTodos(userMessage, controller).then(async (result) => {
|
|
538
549
|
if (result.actionable && result.action !== "skip") {
|
|
539
550
|
logToFile("[auto-continue]", "Task intake result:", JSON.stringify(result));
|
|
540
|
-
// Request capture if actionable
|
|
541
|
-
await intake.requestCapture(userMessage);
|
|
551
|
+
// Request capture if actionable using harness custom message
|
|
552
|
+
await intake.requestCapture(userMessage, "harness:task-capture");
|
|
542
553
|
}
|
|
543
554
|
}).catch((err) => {
|
|
544
555
|
logToFile("[auto-continue]", "Task intake error:", String(err));
|
|
@@ -547,16 +558,43 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
547
558
|
}
|
|
548
559
|
});
|
|
549
560
|
|
|
561
|
+
// Detect explicit stop/pause requests in user messages
|
|
562
|
+
function detectExplicitPause(text: string): boolean {
|
|
563
|
+
const lower = text.toLowerCase();
|
|
564
|
+
const stopPatterns = [
|
|
565
|
+
/\bstop\b/,
|
|
566
|
+
/\bpause\b/,
|
|
567
|
+
/\bwait\b/,
|
|
568
|
+
/\bhold on\b/,
|
|
569
|
+
/\bnot now\b/,
|
|
570
|
+
/\bplease stop\b/,
|
|
571
|
+
/\bplease pause\b/,
|
|
572
|
+
];
|
|
573
|
+
for (const pattern of stopPatterns) {
|
|
574
|
+
if (pattern.test(lower)) {
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
|
|
550
581
|
// --- agent_settled: Check todos and continue work ---------------
|
|
551
582
|
pi.on("agent_settled", async (_event, ctx) => {
|
|
552
583
|
// Don't continue if user is waiting for response
|
|
553
|
-
if (waitingForUserSince)
|
|
584
|
+
if (waitingForUserSince) {
|
|
585
|
+
todoContinuationController?.clearQueue();
|
|
586
|
+
return;
|
|
587
|
+
}
|
|
554
588
|
|
|
555
589
|
// Don't continue if inference is already in progress
|
|
556
|
-
if (_inferenceInProgress)
|
|
590
|
+
if (_inferenceInProgress) {
|
|
591
|
+
return;
|
|
592
|
+
}
|
|
557
593
|
|
|
558
594
|
// Don't continue if session is not idle or has pending messages
|
|
559
|
-
if (!ctx.isIdle?.() || ctx.hasPendingMessages?.())
|
|
595
|
+
if (!ctx.isIdle?.() || ctx.hasPendingMessages?.()) {
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
560
598
|
|
|
561
599
|
// Use the retained controller (not a new one per event)
|
|
562
600
|
try {
|
|
@@ -570,15 +608,22 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
570
608
|
if (result.action === "continue" && result.nextItemId) {
|
|
571
609
|
updateAutoContinueStatus("CONTINUING");
|
|
572
610
|
await todoContinuationController.steerToContinue(result.nextItemId);
|
|
573
|
-
|
|
574
|
-
} else
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
611
|
+
// Queue remains set while agent processes, cleared on next settled if no dispatch
|
|
612
|
+
} else {
|
|
613
|
+
// Not continuing - clear queue to allow future decisions
|
|
614
|
+
todoContinuationController.clearQueue();
|
|
615
|
+
updateAutoContinueStatus("IDLE");
|
|
616
|
+
|
|
617
|
+
if (result.action === "blocked") {
|
|
618
|
+
updateAutoContinueStatus("ERROR", "blocked");
|
|
619
|
+
logToFile("[auto-continue]", "Tasks blocked:", result.question ?? "unknown");
|
|
620
|
+
} else if (result.action === "stop") {
|
|
621
|
+
logToFile("[auto-continue]", "decide returned stop:", result.reason ?? "unknown");
|
|
622
|
+
}
|
|
579
623
|
}
|
|
580
624
|
} catch (err) {
|
|
581
625
|
logToFile("[auto-continue]", "agent_settled handler error:", String(err));
|
|
626
|
+
todoContinuationController?.clearQueue();
|
|
582
627
|
}
|
|
583
628
|
});
|
|
584
629
|
|
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.239",
|
|
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",
|
|
@@ -26,6 +26,7 @@ export interface ContinuationState {
|
|
|
26
26
|
lastMessageId: string | null;
|
|
27
27
|
continuationQueued: boolean;
|
|
28
28
|
userPaused: boolean;
|
|
29
|
+
explicitPause: boolean;
|
|
29
30
|
lastSteerMessage: string | null;
|
|
30
31
|
steerAttemptsForCurrentItem: number;
|
|
31
32
|
lastItemContinued: number | null;
|
|
@@ -50,11 +51,33 @@ export declare class TodoContinuationController {
|
|
|
50
51
|
private config;
|
|
51
52
|
private todoProvider;
|
|
52
53
|
private state;
|
|
54
|
+
private _inFlight;
|
|
53
55
|
constructor(ctx: TodoContext, config?: ContinuationConfig);
|
|
54
56
|
/**
|
|
55
57
|
* Check if continuation is allowed (not paused, session idle)
|
|
56
58
|
*/
|
|
57
59
|
private canContinue;
|
|
60
|
+
/**
|
|
61
|
+
* User explicitly paused - only this clears on explicit resume
|
|
62
|
+
*/
|
|
63
|
+
explicitPause(): void;
|
|
64
|
+
/**
|
|
65
|
+
* Resume from explicit pause
|
|
66
|
+
*/
|
|
67
|
+
resume(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get current todo snapshot (exposed for task intake)
|
|
70
|
+
*/
|
|
71
|
+
getSnapshot(): Promise<import("./todo-provider.js").TodoSnapshot>;
|
|
72
|
+
/**
|
|
73
|
+
* Temporary pause for user input processing
|
|
74
|
+
* Does not require explicit resume
|
|
75
|
+
*/
|
|
76
|
+
tempPause(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Clear continuation queue (called when work completes or starts)
|
|
79
|
+
*/
|
|
80
|
+
clearQueue(): void;
|
|
58
81
|
/**
|
|
59
82
|
* Public method to evaluate and execute continuation
|
|
60
83
|
* Called by external handlers (e.g., agent_settled)
|
|
@@ -67,6 +90,7 @@ export declare class TodoContinuationController {
|
|
|
67
90
|
continueItem(item: TodoItem): Promise<void>;
|
|
68
91
|
/**
|
|
69
92
|
* Guarded dispatch - checks all conditions before sending
|
|
93
|
+
* Uses in-flight guard to prevent race conditions
|
|
70
94
|
*/
|
|
71
95
|
private guardedDispatch;
|
|
72
96
|
/**
|
|
@@ -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,iEAAiE;IACjE,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,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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