pi-harness-runtime 1.1.128 → 1.1.130
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/README.md +6 -24
- package/index.ts +52 -20
- 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/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/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/README.md
CHANGED
|
@@ -514,32 +514,14 @@ Get your Jev API key from: https://openrouter.ai/keys
|
|
|
514
514
|
|
|
515
515
|
## LangChain Ping-Pong Loop Setup
|
|
516
516
|
|
|
517
|
-
The LangChain loop runs planner (GPT) → coder (MiniMax) → reviewer (GLM) → fix → approve.
|
|
517
|
+
The LangChain loop runs planner (GPT) → coder (MiniMax) → reviewer (GLM) → fix → approve. **Models are auto-detected from your existing `/model` configuration in pi** — no extra setup needed for model names.
|
|
518
518
|
|
|
519
|
-
### 1.
|
|
519
|
+
### 1. Configure models — use `/model` in pi
|
|
520
520
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
"env": {
|
|
526
|
-
"PLANNER_MODEL": "gpt-5.6-sol",
|
|
527
|
-
"PLANNER_BASE_URL": "https://api.openai.com/v1",
|
|
528
|
-
"GLM_MODEL": "GLM-5.2",
|
|
529
|
-
"GLM_BASE_URL": "https://api.z.ai/api/v1",
|
|
530
|
-
"MINIMAX_MODEL": "MiniMax-M2",
|
|
531
|
-
"MINIMAX_BASE_URL": "https://api.minimaxi.com/v1"
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
> **Note:** Model names change fast. Check your provider's API dashboard for the latest model IDs. See `.env.example` in this repo for the most up-to-date reference.
|
|
537
|
-
|
|
538
|
-
```bash
|
|
539
|
-
pi install npm:pi-env
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
> **Note:** If you're in China mainland, use `https://api.minimax.chat/v1` for MiniMax.
|
|
521
|
+
pi-harness-runtime reads models from `~/.pi/agent/models-store.json`. Use `/model` in pi to add:
|
|
522
|
+
- **Planner**: GPT model (provider: OpenAI-compatible, e.g. `openai-codex`)
|
|
523
|
+
- **Reviewer**: GLM model (provider: Z.ai)
|
|
524
|
+
- **Coder**: MiniMax model (provider: MiniMax)
|
|
543
525
|
|
|
544
526
|
### 2. API Keys — in `~/.pi-harness-runtime/keys/`
|
|
545
527
|
|
package/index.ts
CHANGED
|
@@ -355,14 +355,8 @@ async function initHoncho(pi: { events: { emit(name: string, data: unknown): voi
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
// --- langchain-loop: Ping-pong write-review loop via harness/langchain/ -----------
|
|
358
|
-
//
|
|
359
|
-
//
|
|
360
|
-
// Env vars set by pi-env (install: pi install npm:pi-env):
|
|
361
|
-
// PLANNER_MODEL, PLANNER_BASE_URL
|
|
362
|
-
// GLM_MODEL, GLM_BASE_URL
|
|
363
|
-
// MINIMAX_MODEL, MINIMAX_BASE_URL
|
|
364
|
-
//
|
|
365
|
-
// API keys from: ~/.pi-harness-runtime/keys/{planner,reviewer,coder}-api-key.txt
|
|
358
|
+
// Auto-detects models from ~/.pi/agent/models-store.json (configured via /model command).
|
|
359
|
+
// Only needs API keys in ~/.pi-harness-runtime/keys/.
|
|
366
360
|
function initLangChain(pi: {
|
|
367
361
|
registerCommand(
|
|
368
362
|
name: string,
|
|
@@ -380,24 +374,54 @@ function initLangChain(pi: {
|
|
|
380
374
|
|
|
381
375
|
const home = process.env.HOME || process.env.USERPROFILE || "/home/frappe";
|
|
382
376
|
const keysDir = `${home}/.pi-harness-runtime/keys`;
|
|
377
|
+
const modelsStorePath = `${home}/.pi/agent/models-store.json`;
|
|
383
378
|
|
|
384
|
-
//
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
379
|
+
// Read models from pi's models-store.json (configured via /model command)
|
|
380
|
+
// Provider mapping: planner=GPT(openai-codex), reviewer=GLM(zai), coder=MiniMax(minimax)
|
|
381
|
+
let plannerModel = "";
|
|
382
|
+
let plannerUrl = "";
|
|
383
|
+
let reviewerModel = "";
|
|
384
|
+
let reviewerUrl = "";
|
|
385
|
+
let coderModel = "";
|
|
386
|
+
let coderUrl = "";
|
|
387
|
+
|
|
388
|
+
try {
|
|
389
|
+
if (existsSync(modelsStorePath)) {
|
|
390
|
+
const store = JSON.parse(readFileSync(modelsStorePath, "utf8"));
|
|
391
|
+
|
|
392
|
+
// Planner (GPT) — from openai-codex provider
|
|
393
|
+
const openaiModels = store["openai-codex"]?.models;
|
|
394
|
+
if (openaiModels?.length > 0) {
|
|
395
|
+
plannerModel = openaiModels[0].id;
|
|
396
|
+
plannerUrl = openaiModels[0].baseUrl ?? "https://api.openai.com/v1";
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Reviewer (GLM) — from zai provider
|
|
400
|
+
const zaiModels = store["zai"]?.models;
|
|
401
|
+
if (zaiModels?.length > 0) {
|
|
402
|
+
reviewerModel = zaiModels[0].id;
|
|
403
|
+
reviewerUrl = zaiModels[0].baseUrl ?? "https://api.z.ai/api/v1";
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Coder (MiniMax) — from minimax provider
|
|
407
|
+
const minimaxModels = store["minimax"]?.models;
|
|
408
|
+
if (minimaxModels?.length > 0) {
|
|
409
|
+
coderModel = minimaxModels[0].id;
|
|
410
|
+
coderUrl = minimaxModels[0].baseUrl ?? "https://api.minimaxi.com/v1";
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} catch {
|
|
414
|
+
// models-store.json not readable — skip silently
|
|
415
|
+
}
|
|
388
416
|
|
|
389
417
|
// Check API keys (from keys/ dir)
|
|
390
418
|
const plannerKey = existsSync(`${keysDir}/planner-api-key.txt`);
|
|
391
419
|
const reviewerKey = existsSync(`${keysDir}/reviewer-api-key.txt`);
|
|
392
420
|
const coderKey = existsSync(`${keysDir}/coder-api-key.txt`);
|
|
393
421
|
|
|
394
|
-
if (!
|
|
395
|
-
console.error("[pi-harness] LangChain loop
|
|
396
|
-
console.error("[pi-harness]
|
|
397
|
-
console.error("[pi-harness] 2. Add to ~/.pi/agent/settings.json under \"env\":");
|
|
398
|
-
console.error("[pi-harness] PLANNER_MODEL, PLANNER_BASE_URL");
|
|
399
|
-
console.error("[pi-harness] GLM_MODEL, GLM_BASE_URL");
|
|
400
|
-
console.error("[pi-harness] MINIMAX_MODEL, MINIMAX_BASE_URL");
|
|
422
|
+
if (!plannerModel || !reviewerModel || !coderModel) {
|
|
423
|
+
console.error("[pi-harness] LangChain loop: no models configured.");
|
|
424
|
+
console.error("[pi-harness] Use /model in pi to configure GPT (planner), GLM (reviewer), MiniMax (coder)");
|
|
401
425
|
return;
|
|
402
426
|
}
|
|
403
427
|
|
|
@@ -426,6 +450,14 @@ function initLangChain(pi: {
|
|
|
426
450
|
env.GLM_API_KEY = readFileSync(`${keysDir}/reviewer-api-key.txt`, "utf8").trim();
|
|
427
451
|
env.MINIMAX_API_KEY = readFileSync(`${keysDir}/coder-api-key.txt`, "utf8").trim();
|
|
428
452
|
|
|
453
|
+
// Inject auto-detected models and URLs
|
|
454
|
+
env.PLANNER_MODEL = plannerModel;
|
|
455
|
+
env.PLANNER_BASE_URL = plannerUrl;
|
|
456
|
+
env.GLM_MODEL = reviewerModel;
|
|
457
|
+
env.GLM_BASE_URL = reviewerUrl;
|
|
458
|
+
env.MINIMAX_MODEL = coderModel;
|
|
459
|
+
env.MINIMAX_BASE_URL = coderUrl;
|
|
460
|
+
|
|
429
461
|
if (existsSync(`${keysDir}/langsmith-api-key.txt`)) {
|
|
430
462
|
env.LANGSMITH_API_KEY = readFileSync(`${keysDir}/langsmith-api-key.txt`, "utf8").trim();
|
|
431
463
|
}
|
|
@@ -443,7 +475,7 @@ function initLangChain(pi: {
|
|
|
443
475
|
},
|
|
444
476
|
});
|
|
445
477
|
|
|
446
|
-
console.error(
|
|
478
|
+
console.error(`[pi-harness] LangChain loop ready (${plannerModel} + ${reviewerModel} + ${coderModel})`);
|
|
447
479
|
}
|
|
448
480
|
|
|
449
481
|
// --- moocoding-sync-hint: Suggest syncing skills if skills dir is empty --------
|
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.130",
|
|
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.130",
|
|
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",
|