pi-harness-runtime 1.1.278 → 1.1.280
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 +129 -0
- 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,132 @@ 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
|
+
// Also ingest messages to Honcho for conversational memory
|
|
1476
|
+
pi.on("message_end", async (event) => {
|
|
1477
|
+
const msg = event.message as { role?: string; content?: string | Array<{type?: string; text?: string}> } | undefined;
|
|
1478
|
+
if (!msg?.role || !msg.content) return;
|
|
1479
|
+
|
|
1480
|
+
// Store for retrieval
|
|
1481
|
+
if (msg.role === "user" && typeof msg.content === "string") {
|
|
1482
|
+
lastUserMessage = msg.content;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
// Ingest to Honcho for conversational memory
|
|
1486
|
+
if (honchoReady && honchoMemory) {
|
|
1487
|
+
try {
|
|
1488
|
+
// Skip harness-generated prompts
|
|
1489
|
+
const content = typeof msg.content === "string" ? msg.content : "";
|
|
1490
|
+
if (content.includes("[harness:") || content.includes("Please add all tasks")) {
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
await honchoMemory.ingestMessage(
|
|
1495
|
+
msg.role as "user" | "assistant",
|
|
1496
|
+
msg.content,
|
|
1497
|
+
new Date(),
|
|
1498
|
+
`turn-${Date.now()}`
|
|
1499
|
+
);
|
|
1500
|
+
} catch (err) {
|
|
1501
|
+
logToFile("[memory]", `Ingest failed:`, String(err));
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
// Inject memory on first agent start
|
|
1507
|
+
let firstAgentStart = true;
|
|
1508
|
+
pi.on("before_agent_start", async (event) => {
|
|
1509
|
+
const parts: string[] = [];
|
|
1510
|
+
|
|
1511
|
+
// 1. Load local memory files
|
|
1512
|
+
const memorySection = memoryStore.getMemorySection();
|
|
1513
|
+
const userSection = memoryStore.getUserSection();
|
|
1514
|
+
|
|
1515
|
+
if (memorySection) parts.push(memorySection);
|
|
1516
|
+
if (userSection) parts.push(userSection);
|
|
1517
|
+
|
|
1518
|
+
if (parts.length > 0) {
|
|
1519
|
+
memoryLoaded = true;
|
|
1520
|
+
memoryTokenCount = Math.round(parts.join("\n").length / 4);
|
|
1521
|
+
logToFile("[memory]", `Local notes: ${memoryStore.getMemory().length} entries, ~${memoryTokenCount} tokens`);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
// 2. Retrieve Honcho context if available and we have a query
|
|
1525
|
+
let honchoContext = "";
|
|
1526
|
+
if (honchoReady && honchoMemory && lastUserMessage.trim().length > 0) {
|
|
1527
|
+
try {
|
|
1528
|
+
const result = await honchoMemory.retrieveContext(lastUserMessage);
|
|
1529
|
+
if (result.success && !result.empty && result.context) {
|
|
1530
|
+
honchoContext = `\n## Relevant Context\n${result.context}\n`;
|
|
1531
|
+
logToFile("[memory]", `Honcho: retrieved ~${result.context.length} chars`);
|
|
1532
|
+
} else if (result.error) {
|
|
1533
|
+
logToFile("[memory]", `Honcho retrieval: ${result.error}`);
|
|
1534
|
+
}
|
|
1535
|
+
} catch (err) {
|
|
1536
|
+
logToFile("[memory]", `Honcho retrieval failed:`, String(err));
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// Combine all memory
|
|
1541
|
+
const allMemory = parts.join("\n") + honchoContext;
|
|
1542
|
+
|
|
1543
|
+
if (!allMemory.trim()) {
|
|
1544
|
+
logToFile("[memory]", "No memory to inject");
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
// Status on first injection
|
|
1549
|
+
if (firstAgentStart) {
|
|
1550
|
+
firstAgentStart = false;
|
|
1551
|
+
const status: string[] = [];
|
|
1552
|
+
if (memoryLoaded) status.push(`local notes`);
|
|
1553
|
+
if (honchoContext) status.push(`honcho context`);
|
|
1554
|
+
logToFile("[memory]", `Injected: ${status.join(" + ")}`);
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
// Return augmented system prompt
|
|
1558
|
+
return { systemPrompt: event.systemPrompt + "\n\n" + allMemory };
|
|
1559
|
+
});
|
|
1560
|
+
} catch (err) {
|
|
1561
|
+
logToFile("[memory]", "Init failed:", String(err));
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1439
1565
|
// --- SSH detach interceptor: Auto-transform bare ssh ... & to detached pattern ---
|
|
1440
1566
|
// Prevents 2000+ second hangs when SSH background commands aren't detached.
|
|
1441
1567
|
// Intercepts every bash tool call before execution and rewrites risky SSH commands.
|
|
@@ -2049,6 +2175,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
2049
2175
|
// --- agent-policy: Mandatory rule delivery and mutation gating -------------
|
|
2050
2176
|
void initAgentPolicy(pi);
|
|
2051
2177
|
|
|
2178
|
+
// --- memory: Inject MEMORY.md and USER.md into system prompt -------------
|
|
2179
|
+
void initMemory(pi);
|
|
2180
|
+
|
|
2052
2181
|
// --- ssh-detach-interceptor: Auto-fix bare ssh & → nohup pattern ---------
|
|
2053
2182
|
void initSshDetachInterceptor(pi);
|
|
2054
2183
|
|
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.280",
|
|
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.280",
|
|
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",
|