pi-harness-runtime 1.1.78 → 1.1.80
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 +123 -6
- package/package.json +1 -1
- package/packages/a2a-adapter/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/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/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/package.json +1 -1
- 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/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/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/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/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/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
|
@@ -69,6 +69,113 @@ import {
|
|
|
69
69
|
} from "./harness/blackboard.ts";
|
|
70
70
|
import { scheduleAutoResume, cancelAutoResume } from "./harness/index.js";
|
|
71
71
|
|
|
72
|
+
// --- Jev Auto-Continue: Agent autonomous decision-making --------------------
|
|
73
|
+
// Lazy import - only loads when packages/jev-judge exists and API key available
|
|
74
|
+
async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
75
|
+
try {
|
|
76
|
+
// Check if TYPESAFE_API_KEY is available
|
|
77
|
+
if (!process.env.TYPESAFE_API_KEY && !process.env.OPENROUTER_API_KEY) {
|
|
78
|
+
console.log("[auto-continue] No Jev API key found, skipping");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const mod = await import("./packages/jev-judge/src/auto-continue.js");
|
|
83
|
+
|
|
84
|
+
// Track waiting state
|
|
85
|
+
let waitingForUserSince: Date | null = null;
|
|
86
|
+
let lastUserMessage: Date | null = null;
|
|
87
|
+
|
|
88
|
+
// Detect when agent asks for continuation
|
|
89
|
+
pi.on("message_end", async (event) => {
|
|
90
|
+
const msg = event.message as { role?: string; content?: string } | undefined;
|
|
91
|
+
if (!msg || msg.role !== "assistant") return;
|
|
92
|
+
|
|
93
|
+
const content = typeof msg.content === "string" ? msg.content : "";
|
|
94
|
+
const hasContinuation = /continue|proceed|next phase|next step/i.test(content);
|
|
95
|
+
|
|
96
|
+
if (hasContinuation && !waitingForUserSince) {
|
|
97
|
+
waitingForUserSince = new Date();
|
|
98
|
+
console.log("[auto-continue] Agent waiting for continuation confirmation");
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// Detect user responses
|
|
103
|
+
pi.on("message_start", async (event) => {
|
|
104
|
+
const msg = event.message as { role?: string } | undefined;
|
|
105
|
+
if (msg?.role === "user") {
|
|
106
|
+
lastUserMessage = new Date();
|
|
107
|
+
if (waitingForUserSince) {
|
|
108
|
+
console.log("[auto-continue] User responded, cancelling wait");
|
|
109
|
+
waitingForUserSince = null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Periodic check for auto-continue decision
|
|
115
|
+
const AUTO_CONTINUE_INTERVAL_MS = 5 * 60 * 1000; // Check every 5 minutes
|
|
116
|
+
const MIN_WAIT_MINUTES = 5; // Minimum wait before auto-continue
|
|
117
|
+
|
|
118
|
+
const checkAndAutoContinue = async () => {
|
|
119
|
+
if (!waitingForUserSince) return;
|
|
120
|
+
|
|
121
|
+
const waitMinutes = (Date.now() - waitingForUserSince.getTime()) / 60000;
|
|
122
|
+
if (waitMinutes < MIN_WAIT_MINUTES) return;
|
|
123
|
+
|
|
124
|
+
console.log(`[auto-continue] Checking after ${waitMinutes.toFixed(0)} minutes wait...`);
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
const judge = new mod.AutoContinueJudge({
|
|
128
|
+
apiKey: process.env.TYPESAFE_API_KEY || process.env.OPENROUTER_API_KEY!,
|
|
129
|
+
proceedThreshold: 0.7,
|
|
130
|
+
maxWaitMinutes: 30,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const taskState = mod.createTaskState(
|
|
134
|
+
[], // completed tasks
|
|
135
|
+
[], // remaining tasks
|
|
136
|
+
lastUserMessage || undefined,
|
|
137
|
+
new Date(Date.now() - waitMinutes * 60000),
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const decision = await judge.decide(taskState);
|
|
141
|
+
|
|
142
|
+
console.log(
|
|
143
|
+
`[auto-continue] Decision: ${decision.action} (${(decision.probability * 100).toFixed(0)}% confidence)`,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
if (decision.action === "proceed") {
|
|
147
|
+
// Send steer message to continue
|
|
148
|
+
pi.sendUserMessage(
|
|
149
|
+
"User is unavailable. Based on task progress and low risk, proceeding autonomously.\n" +
|
|
150
|
+
`Decision: ${decision.reasoning}\n` +
|
|
151
|
+
"Continue with remaining tasks.",
|
|
152
|
+
{ deliverAs: "steer" },
|
|
153
|
+
);
|
|
154
|
+
waitingForUserSince = null;
|
|
155
|
+
} else if (decision.action === "proceed_with_caution") {
|
|
156
|
+
pi.sendUserMessage(
|
|
157
|
+
"User is unavailable. Proceeding with caution - will log each significant step.\n" +
|
|
158
|
+
`Risk level: ${decision.riskLevel}\n` +
|
|
159
|
+
"Continue with remaining tasks, reporting progress.",
|
|
160
|
+
{ deliverAs: "steer" },
|
|
161
|
+
);
|
|
162
|
+
waitingForUserSince = null;
|
|
163
|
+
}
|
|
164
|
+
// If action is "wait", do nothing and check again later
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error("[auto-continue] Error:", error);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// Start periodic check
|
|
171
|
+
setInterval(checkAndAutoContinue, AUTO_CONTINUE_INTERVAL_MS);
|
|
172
|
+
|
|
173
|
+
console.log("[auto-continue] Jev Auto-Continue initialized");
|
|
174
|
+
} catch {
|
|
175
|
+
// auto-continue not available
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
72
179
|
// --- todo-bd-sync: Two-way sync between rpiv-todo and bd --------------------
|
|
73
180
|
// Lazy import - only loads when packages/todo-bd-sync exists
|
|
74
181
|
async function initTodoBdSync(pi: ExtensionAPI): Promise<void> {
|
|
@@ -375,6 +482,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
375
482
|
// --- ssh-detach-interceptor: Auto-fix bare ssh & → nohup pattern ---------
|
|
376
483
|
void initSshDetachInterceptor(pi);
|
|
377
484
|
|
|
485
|
+
// --- jev-auto-continue: Agent autonomous decision when user unavailable -----
|
|
486
|
+
void initAutoContinue(pi);
|
|
487
|
+
|
|
378
488
|
// --- loop-completions: Watch daemon completions → agent TUI todos --------
|
|
379
489
|
void initLoopCompletions(pi);
|
|
380
490
|
|
|
@@ -466,13 +576,20 @@ Server process examples that must be detached: uvicorn, fastapi dev server, guni
|
|
|
466
576
|
let firstAgentStart = true;
|
|
467
577
|
pi.on("before_agent_start", async (event) => {
|
|
468
578
|
if (firstAgentStart) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
579
|
+
// Return additional system prompt content to append
|
|
580
|
+
const additionalPrompt = [
|
|
581
|
+
TASK_TERMINOLOGY_CLARIFICATION,
|
|
582
|
+
AUTO_TODO_INVOKE_HINT,
|
|
583
|
+
COMMIT_BUILD_CHECKLIST,
|
|
584
|
+
WRITE_REVIEW_HINT,
|
|
585
|
+
DOCKER_CLEANUP_HINT,
|
|
586
|
+
SSH_GUARD_RULES,
|
|
587
|
+
].join("\n");
|
|
588
|
+
|
|
475
589
|
firstAgentStart = false;
|
|
590
|
+
|
|
591
|
+
// Return the additional prompt to append to systemPrompt
|
|
592
|
+
return { systemPrompt: event.systemPrompt + "\n" + additionalPrompt };
|
|
476
593
|
}
|
|
477
594
|
});
|
|
478
595
|
|
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.80",
|
|
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-harness/provider-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.80",
|
|
4
4
|
"description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/provider-router.js",
|