pi-harness-runtime 1.1.77 → 1.1.78
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/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/README.md +61 -0
- package/packages/jev-judge/dist/auto-continue.d.ts +92 -0
- package/packages/jev-judge/dist/auto-continue.d.ts.map +1 -0
- package/packages/jev-judge/dist/auto-continue.js +230 -0
- package/packages/jev-judge/dist/auto-continue.js.map +1 -0
- package/packages/jev-judge/dist/index.d.ts +22 -1
- package/packages/jev-judge/dist/index.d.ts.map +1 -1
- package/packages/jev-judge/dist/index.js +34 -26
- package/packages/jev-judge/dist/index.js.map +1 -1
- package/packages/jev-judge/package.json +1 -1
- package/packages/jev-judge/src/auto-continue.ts +317 -0
- package/packages/jev-judge/src/index.ts +43 -28
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.78",
|
|
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",
|
|
@@ -19,6 +19,7 @@ Jev is a "System One" model - a new class of AI optimized for **structured decis
|
|
|
19
19
|
- **E2EJudge** - E2E testing decisions (flaky detection, build blocking, retry)
|
|
20
20
|
- **FlakyDetector** - Specialized flaky test detection
|
|
21
21
|
- **DecisionEngine** - Threshold-based routing and actions
|
|
22
|
+
- **AutoContinueJudge** - Agent autonomous decision-making (continue or wait)
|
|
22
23
|
|
|
23
24
|
## Installation
|
|
24
25
|
|
|
@@ -225,6 +226,66 @@ Jev via OpenRouter:
|
|
|
225
226
|
|
|
226
227
|
See [OpenRouter pricing](https://openrouter.ai/typesafe/jev-1.13) for details.
|
|
227
228
|
|
|
229
|
+
## Auto-Continue Judge (Agent Use Case)
|
|
230
|
+
|
|
231
|
+
**Problem:** Agent completes 2/5 tasks, asks "Continue?" User asleep → agent waits indefinitely.
|
|
232
|
+
|
|
233
|
+
**Solution:** Use Jev to judge whether to auto-continue.
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
import { AutoContinueJudge, createTaskState } from "@pi-harness/jev-judge/auto-continue";
|
|
237
|
+
import { hasJevApiKey, createJevJudge } from "@pi-harness/jev-judge";
|
|
238
|
+
|
|
239
|
+
// Auto-detect API key from environment
|
|
240
|
+
const judge = new AutoContinueJudge({
|
|
241
|
+
apiKey: process.env.TYPESAFE_API_KEY!, // or auto-detect
|
|
242
|
+
proceedThreshold: 0.7, // Continue if >70% confidence
|
|
243
|
+
maxWaitMinutes: 30,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Build task state
|
|
247
|
+
const taskState = createTaskState(
|
|
248
|
+
["task-1", "task-2"], // completed
|
|
249
|
+
["task-3", "task-4", "task-5"], // remaining
|
|
250
|
+
new Date(Date.now() - 30 * 60 * 1000), // last user activity 30 min ago
|
|
251
|
+
new Date(Date.now() - 2 * 60 * 60 * 1000) // session started 2 hours ago
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
// Get decision
|
|
255
|
+
const decision = await judge.decide(taskState);
|
|
256
|
+
|
|
257
|
+
if (decision.action === "proceed") {
|
|
258
|
+
console.log("Continuing with remaining tasks...");
|
|
259
|
+
// Agent proceeds autonomously
|
|
260
|
+
} else if (decision.action === "proceed_with_caution") {
|
|
261
|
+
console.log(`Proceeding with caution (${decision.riskLevel} risk)`);
|
|
262
|
+
// Agent proceeds but logs each step
|
|
263
|
+
} else {
|
|
264
|
+
console.log(`Waiting... (recommend ${decision.waitRecommendation} min)`);
|
|
265
|
+
// Agent waits or notifies
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Environment Variable Auto-Detection
|
|
270
|
+
|
|
271
|
+
The package automatically detects API keys from environment:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Option 1: TypeSafe API key (preferred)
|
|
275
|
+
export TYPESAFE_API_KEY="your-key-here"
|
|
276
|
+
|
|
277
|
+
# Option 2: OpenRouter API key
|
|
278
|
+
export OPENROUTER_API_KEY="your-key-here"
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import { hasJevApiKey, createJevJudge } from "@pi-harness/jev-judge";
|
|
283
|
+
|
|
284
|
+
if (hasJevApiKey()) {
|
|
285
|
+
const judge = createJevJudge(); // Auto-detects API key
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
228
289
|
## Examples
|
|
229
290
|
|
|
230
291
|
See `tests/` directory for example usage.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-Continue Judge - Agent decision making when user is unavailable
|
|
3
|
+
*
|
|
4
|
+
* Uses Jev to decide whether an agent should continue autonomously
|
|
5
|
+
* when waiting for user input that may not come.
|
|
6
|
+
*
|
|
7
|
+
* Scenario: Agent completes 2/5 tasks, asks "Continue?" User asleep.
|
|
8
|
+
* Jev decides: proceed, wait, or proceed with caution.
|
|
9
|
+
*/
|
|
10
|
+
import type { JevJudgeConfig } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Task tracking state
|
|
13
|
+
*/
|
|
14
|
+
export interface TaskState {
|
|
15
|
+
completedTasks: string[];
|
|
16
|
+
remainingTasks: string[];
|
|
17
|
+
totalTasks: number;
|
|
18
|
+
waitTimeMinutes: number;
|
|
19
|
+
userResponded: boolean;
|
|
20
|
+
lastUserActivity?: Date;
|
|
21
|
+
sessionStartTime: Date;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Auto-continue decision
|
|
25
|
+
*/
|
|
26
|
+
export interface AutoContinueDecision {
|
|
27
|
+
action: "proceed" | "wait" | "proceed_with_caution";
|
|
28
|
+
probability: number;
|
|
29
|
+
riskLevel: "minimal" | "low" | "medium" | "high" | "critical";
|
|
30
|
+
reasoning: string;
|
|
31
|
+
urgency: "critical" | "high" | "normal" | "low";
|
|
32
|
+
estimatedImpact: "minimal" | "moderate" | "significant" | "major";
|
|
33
|
+
confidence: "high" | "medium" | "low";
|
|
34
|
+
waitRecommendation?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Auto-Continue Judge configuration
|
|
38
|
+
*/
|
|
39
|
+
export interface AutoContinueConfig extends JevJudgeConfig {
|
|
40
|
+
/** Minimum probability to auto-proceed (default: 0.7) */
|
|
41
|
+
proceedThreshold?: number;
|
|
42
|
+
/** Minimum probability to proceed with caution (default: 0.5) */
|
|
43
|
+
cautionThreshold?: number;
|
|
44
|
+
/** Maximum wait time before force decision (default: 30 minutes) */
|
|
45
|
+
maxWaitMinutes?: number;
|
|
46
|
+
/** Default action if Jev fails (default: "wait") */
|
|
47
|
+
fallbackAction?: "proceed" | "wait" | "proceed_with_caution";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Auto-Continue Judge
|
|
51
|
+
*
|
|
52
|
+
* Judges whether an agent should continue autonomously when user is unavailable.
|
|
53
|
+
* Integrates with pi-coding-agent hooks for automatic decision making.
|
|
54
|
+
*/
|
|
55
|
+
export declare class AutoContinueJudge {
|
|
56
|
+
private jev;
|
|
57
|
+
private config;
|
|
58
|
+
constructor(config: AutoContinueConfig);
|
|
59
|
+
/**
|
|
60
|
+
* Judge whether to continue or wait
|
|
61
|
+
*/
|
|
62
|
+
decide(taskState: TaskState): Promise<AutoContinueDecision>;
|
|
63
|
+
/**
|
|
64
|
+
* Quick decision - simple yes/no to proceed
|
|
65
|
+
*/
|
|
66
|
+
shouldContinue(taskState: TaskState): Promise<{
|
|
67
|
+
shouldContinue: boolean;
|
|
68
|
+
probability: number;
|
|
69
|
+
confidence: string;
|
|
70
|
+
}>;
|
|
71
|
+
/**
|
|
72
|
+
* Build state for Jev
|
|
73
|
+
*/
|
|
74
|
+
private buildState;
|
|
75
|
+
/**
|
|
76
|
+
* Build decision from Jev result
|
|
77
|
+
*/
|
|
78
|
+
private buildDecision;
|
|
79
|
+
/**
|
|
80
|
+
* Convert score to risk level
|
|
81
|
+
*/
|
|
82
|
+
private scoreToRiskLevel;
|
|
83
|
+
/**
|
|
84
|
+
* Fallback decision when Jev fails
|
|
85
|
+
*/
|
|
86
|
+
private fallbackDecision;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Helper: Create task state from todo list
|
|
90
|
+
*/
|
|
91
|
+
export declare function createTaskState(completedTasks: string[], remainingTasks: string[], lastUserActivity?: Date, sessionStartTime?: Date): TaskState;
|
|
92
|
+
//# sourceMappingURL=auto-continue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-continue.d.ts","sourceRoot":"","sources":["../src/auto-continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,YAAY,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,IAAI,CAAC;IACxB,gBAAgB,EAAE,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,sBAAsB,CAAC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IAChD,eAAe,EAAE,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,OAAO,CAAC;IAClE,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,S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