pi-harness-runtime 1.1.277 → 1.1.279
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 +107 -2
- 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/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/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
|
@@ -1436,6 +1436,108 @@ async function initAgentPolicy(pi: ExtensionAPI): Promise<void> {
|
|
|
1436
1436
|
}
|
|
1437
1437
|
}
|
|
1438
1438
|
|
|
1439
|
+
// --- memory: Inject MEMORY.md and USER.md into system prompt ---
|
|
1440
|
+
// Loads curated notes at session start for Hermes-style memory
|
|
1441
|
+
async function initMemory(pi: ExtensionAPI): Promise<void> {
|
|
1442
|
+
try {
|
|
1443
|
+
const { getGlobalMemoryStore } = await import("./packages/trajectory/src/memory-store.js");
|
|
1444
|
+
const { HonchoMemory } = await import("./harness/honcho-memory.js");
|
|
1445
|
+
const memoryStore = getGlobalMemoryStore();
|
|
1446
|
+
|
|
1447
|
+
// Initialize Honcho memory (will be connected after initHoncho)
|
|
1448
|
+
let honchoMemory: HonchoMemory | null = null;
|
|
1449
|
+
let honchoReady = false;
|
|
1450
|
+
|
|
1451
|
+
// Connect Honcho memory after Honcho is initialized
|
|
1452
|
+
pi.on("session_start", async () => {
|
|
1453
|
+
if (honchoMemory) return; // Already initialized
|
|
1454
|
+
|
|
1455
|
+
try {
|
|
1456
|
+
const honchoConfig = await import("./harness/honcho-init.js");
|
|
1457
|
+
if (honchoConfig.isHonchoReady && honchoConfig.isHonchoReady()) {
|
|
1458
|
+
honchoMemory = new HonchoMemory({});
|
|
1459
|
+
honchoReady = true;
|
|
1460
|
+
logToFile("[memory]", "Honcho memory connected");
|
|
1461
|
+
}
|
|
1462
|
+
} catch {
|
|
1463
|
+
// Honcho not ready yet
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
logToFile("[memory]", "Memory store initialized");
|
|
1468
|
+
|
|
1469
|
+
// Track initialization for truthful status
|
|
1470
|
+
let memoryLoaded = false;
|
|
1471
|
+
let memoryTokenCount = 0;
|
|
1472
|
+
let lastUserMessage = "";
|
|
1473
|
+
|
|
1474
|
+
// Capture last user message for Honcho retrieval
|
|
1475
|
+
pi.on("message_end", (event) => {
|
|
1476
|
+
const msg = event.message as { role?: string; content?: string } | undefined;
|
|
1477
|
+
if (msg?.role === "user" && typeof msg.content === "string") {
|
|
1478
|
+
lastUserMessage = msg.content;
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
// Inject memory on first agent start
|
|
1483
|
+
let firstAgentStart = true;
|
|
1484
|
+
pi.on("before_agent_start", async (event) => {
|
|
1485
|
+
const parts: string[] = [];
|
|
1486
|
+
|
|
1487
|
+
// 1. Load local memory files
|
|
1488
|
+
const memorySection = memoryStore.getMemorySection();
|
|
1489
|
+
const userSection = memoryStore.getUserSection();
|
|
1490
|
+
|
|
1491
|
+
if (memorySection) parts.push(memorySection);
|
|
1492
|
+
if (userSection) parts.push(userSection);
|
|
1493
|
+
|
|
1494
|
+
if (parts.length > 0) {
|
|
1495
|
+
memoryLoaded = true;
|
|
1496
|
+
memoryTokenCount = Math.round(parts.join("\n").length / 4);
|
|
1497
|
+
logToFile("[memory]", `Local notes: ${memoryStore.getMemory().length} entries, ~${memoryTokenCount} tokens`);
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
// 2. Retrieve Honcho context if available and we have a query
|
|
1501
|
+
let honchoContext = "";
|
|
1502
|
+
if (honchoReady && honchoMemory && lastUserMessage.trim().length > 0) {
|
|
1503
|
+
try {
|
|
1504
|
+
const result = await honchoMemory.retrieveContext(lastUserMessage);
|
|
1505
|
+
if (result.success && !result.empty && result.context) {
|
|
1506
|
+
honchoContext = `\n## Relevant Context\n${result.context}\n`;
|
|
1507
|
+
logToFile("[memory]", `Honcho: retrieved ~${result.context.length} chars`);
|
|
1508
|
+
} else if (result.error) {
|
|
1509
|
+
logToFile("[memory]", `Honcho retrieval: ${result.error}`);
|
|
1510
|
+
}
|
|
1511
|
+
} catch (err) {
|
|
1512
|
+
logToFile("[memory]", `Honcho retrieval failed:`, String(err));
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1516
|
+
// Combine all memory
|
|
1517
|
+
const allMemory = parts.join("\n") + honchoContext;
|
|
1518
|
+
|
|
1519
|
+
if (!allMemory.trim()) {
|
|
1520
|
+
logToFile("[memory]", "No memory to inject");
|
|
1521
|
+
return;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
// Status on first injection
|
|
1525
|
+
if (firstAgentStart) {
|
|
1526
|
+
firstAgentStart = false;
|
|
1527
|
+
const status: string[] = [];
|
|
1528
|
+
if (memoryLoaded) status.push(`local notes`);
|
|
1529
|
+
if (honchoContext) status.push(`honcho context`);
|
|
1530
|
+
logToFile("[memory]", `Injected: ${status.join(" + ")}`);
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
// Return augmented system prompt
|
|
1534
|
+
return { systemPrompt: event.systemPrompt + "\n\n" + allMemory };
|
|
1535
|
+
});
|
|
1536
|
+
} catch (err) {
|
|
1537
|
+
logToFile("[memory]", "Init failed:", String(err));
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1439
1541
|
// --- SSH detach interceptor: Auto-transform bare ssh ... & to detached pattern ---
|
|
1440
1542
|
// Prevents 2000+ second hangs when SSH background commands aren't detached.
|
|
1441
1543
|
// Intercepts every bash tool call before execution and rewrites risky SSH commands.
|
|
@@ -2049,6 +2151,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
2049
2151
|
// --- agent-policy: Mandatory rule delivery and mutation gating -------------
|
|
2050
2152
|
void initAgentPolicy(pi);
|
|
2051
2153
|
|
|
2154
|
+
// --- memory: Inject MEMORY.md and USER.md into system prompt -------------
|
|
2155
|
+
void initMemory(pi);
|
|
2156
|
+
|
|
2052
2157
|
// --- ssh-detach-interceptor: Auto-fix bare ssh & → nohup pattern ---------
|
|
2053
2158
|
void initSshDetachInterceptor(pi);
|
|
2054
2159
|
|
|
@@ -2080,7 +2185,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
2080
2185
|
const deliveredEvents = new Map<string, PlanEvent>();
|
|
2081
2186
|
let currentCodexSessionId: string | null = null;
|
|
2082
2187
|
let currentProjectRoot = "";
|
|
2083
|
-
let
|
|
2188
|
+
let _currentPlanCandidate: { ordinal: number; text: string; timestamp: number } | null = null;
|
|
2084
2189
|
let lastActivityTime = 0;
|
|
2085
2190
|
|
|
2086
2191
|
// Check if plan file exists and is stable (mtime unchanged)
|
|
@@ -2190,7 +2295,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
2190
2295
|
currentCodexSessionId = session.id;
|
|
2191
2296
|
currentProjectRoot = session.projectRoot;
|
|
2192
2297
|
nc("CodexSessionStarted", {
|
|
2193
|
-
requirement: session.threadName || "Codex session"
|
|
2298
|
+
requirement: `${session.threadName || "Codex session"} [${session.projectRoot || "unknown"}]`,
|
|
2194
2299
|
taskTitle: session.id,
|
|
2195
2300
|
});
|
|
2196
2301
|
} else {
|
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.279",
|
|
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.279",
|
|
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",
|