pi-harness-runtime 1.1.213 → 1.1.215
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 +103 -27
- 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
|
@@ -1156,7 +1156,8 @@ function processCompletionFile(filePath: string, pi: ExtensionAPI): void {
|
|
|
1156
1156
|
// --- Debug logging (file only, no console override) ---------------
|
|
1157
1157
|
// Logs written to file only. Real console output preserved for pi's TUI.
|
|
1158
1158
|
import { homedir } from "node:os";
|
|
1159
|
-
import { existsSync, mkdirSync, readFileSync, symlinkSync } from "node:fs";
|
|
1159
|
+
import { existsSync, mkdirSync, readFileSync, symlinkSync, appendFileSync } from "node:fs";
|
|
1160
|
+
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
1160
1161
|
import { join, dirname } from "node:path";
|
|
1161
1162
|
|
|
1162
1163
|
// --- Harness Runtime State --------------------------------------------
|
|
@@ -1164,12 +1165,19 @@ const HARNESS_ROOT_DIR = join(homedir(), ".pi-harness-runtime");
|
|
|
1164
1165
|
|
|
1165
1166
|
/** Startup messages collected during init — shown on session_start via ctx.ui.notify */
|
|
1166
1167
|
const startupMessages: string[] = [];
|
|
1168
|
+
const STARTUP_LOG_FILE = "/tmp/pi-harness-startup.log";
|
|
1167
1169
|
|
|
1168
|
-
/** Log a harness startup message
|
|
1170
|
+
/** Log a harness startup message to file (not stderr - stderr bypasses Pi's cursor tracking) */
|
|
1169
1171
|
function logStartup(...parts: string[]): void {
|
|
1170
1172
|
const msg = parts.join(" ");
|
|
1171
|
-
console.error(msg);
|
|
1172
1173
|
startupMessages.push(msg);
|
|
1174
|
+
// Write to file using synchronous appendFileSync to avoid overlapping input field
|
|
1175
|
+
// Pi's renderer handles scrolling for managed content
|
|
1176
|
+
try {
|
|
1177
|
+
appendFileSync(STARTUP_LOG_FILE, msg + "\n");
|
|
1178
|
+
} catch {
|
|
1179
|
+
// Ignore file write errors
|
|
1180
|
+
}
|
|
1173
1181
|
}
|
|
1174
1182
|
|
|
1175
1183
|
interface HarnessSession {
|
|
@@ -3016,20 +3024,66 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3016
3024
|
},
|
|
3017
3025
|
});
|
|
3018
3026
|
|
|
3019
|
-
// --- Harness
|
|
3020
|
-
//
|
|
3021
|
-
//
|
|
3022
|
-
|
|
3023
|
-
|
|
3027
|
+
// --- Harness widget state (like Todos extension) -----------------------
|
|
3028
|
+
// Learn from Todos extension:
|
|
3029
|
+
// - setWidget with placement: "aboveEditor" (fixed above input)
|
|
3030
|
+
// - Capture tui.requestRender from factory
|
|
3031
|
+
// - Return [] when hidden (removes widget height)
|
|
3032
|
+
// - Call requestRender(true) on hide for forced redraw
|
|
3033
|
+
// - Tree characters like Todos (├─ └─)
|
|
3034
|
+
// - Trailing spacer line for breathing room
|
|
3035
|
+
const HARNESS_WIDGET_KEY = "pi-harness-startup";
|
|
3036
|
+
interface HarnessMessage {
|
|
3037
|
+
id: string;
|
|
3038
|
+
label: string;
|
|
3039
|
+
text: string;
|
|
3040
|
+
status: "wait" | "ok" | "err";
|
|
3041
|
+
}
|
|
3042
|
+
const harnessMessages: HarnessMessage[] = [];
|
|
3043
|
+
let startupVisible = true;
|
|
3044
|
+
let harnessTUI: { requestRender: (forced?: boolean) => void } | null = null;
|
|
3045
|
+
let harnessWidgetRegistered = false;
|
|
3024
3046
|
let sessionGeneration = 0;
|
|
3025
|
-
|
|
3047
|
+
|
|
3048
|
+
function addHarnessMessage(label: string, text: string, status: "wait" | "ok" | "err" = "wait") {
|
|
3049
|
+
const id = `${label}-${Date.now()}`;
|
|
3050
|
+
harnessMessages.push({ id, label, text, status });
|
|
3051
|
+
harnessTUI?.requestRender();
|
|
3052
|
+
}
|
|
3053
|
+
|
|
3054
|
+
function hideHarnessBlock() {
|
|
3055
|
+
startupVisible = false;
|
|
3056
|
+
harnessTUI?.requestRender(true); // Force redraw like Todos
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
function getHarnessLines(width: number): string[] {
|
|
3060
|
+
if (!startupVisible || harnessMessages.length === 0) return [];
|
|
3061
|
+
|
|
3062
|
+
const lines: string[] = [];
|
|
3063
|
+
const heading = truncateToWidth("[pi-harness]", width);
|
|
3064
|
+
lines.push(heading);
|
|
3065
|
+
|
|
3066
|
+
for (let i = 0; i < harnessMessages.length; i++) {
|
|
3067
|
+
const msg = harnessMessages[i];
|
|
3068
|
+
const marker = msg.status === "ok" ? "[OK]" : msg.status === "err" ? "[ERR]" : "[WAIT]";
|
|
3069
|
+
const isLast = i === harnessMessages.length - 1;
|
|
3070
|
+
const treeChar = isLast ? "└─" : "├─";
|
|
3071
|
+
let text = `${treeChar} ${marker} ${msg.label}: ${msg.text}`;
|
|
3072
|
+
text = truncateToWidth(text, width);
|
|
3073
|
+
lines.push(text);
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
// Trailing spacer for breathing room (like Todos)
|
|
3077
|
+
lines.push("");
|
|
3078
|
+
|
|
3079
|
+
return lines;
|
|
3080
|
+
}
|
|
3026
3081
|
|
|
3027
3082
|
// --- Footer status (persistent badge) --------------------------------
|
|
3028
3083
|
pi.on("session_start", async (_event, ctx) => {
|
|
3029
3084
|
|
|
3030
3085
|
// Capture only the setStatus function, not the ctx
|
|
3031
3086
|
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3032
|
-
harnessStatusSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3033
3087
|
refreshFooterStatus(
|
|
3034
3088
|
footerSetStatus,
|
|
3035
3089
|
tracker,
|
|
@@ -3041,10 +3095,31 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3041
3095
|
// Increment session generation to fence late callbacks
|
|
3042
3096
|
sessionGeneration++;
|
|
3043
3097
|
const mySession = sessionGeneration;
|
|
3044
|
-
|
|
3098
|
+
startupVisible = true;
|
|
3099
|
+
harnessMessages.length = 0;
|
|
3100
|
+
harnessWidgetRegistered = false; // Reset for new session
|
|
3101
|
+
|
|
3102
|
+
// --- Install harness widget (like Todos with placement: "aboveEditor") -------
|
|
3103
|
+
// Use setWidget with placement: "aboveEditor" - fixed above input field
|
|
3104
|
+
if (!harnessWidgetRegistered) {
|
|
3105
|
+
ctx.ui.setWidget(
|
|
3106
|
+
HARNESS_WIDGET_KEY,
|
|
3107
|
+
(tui, _theme) => {
|
|
3108
|
+
harnessTUI = tui;
|
|
3109
|
+
return {
|
|
3110
|
+
render: (width: number) => getHarnessLines(width),
|
|
3111
|
+
invalidate: () => {},
|
|
3112
|
+
};
|
|
3113
|
+
},
|
|
3114
|
+
{ placement: "aboveEditor" }, // Like Todos!
|
|
3115
|
+
);
|
|
3116
|
+
harnessWidgetRegistered = true;
|
|
3117
|
+
} else {
|
|
3118
|
+
harnessTUI?.requestRender();
|
|
3119
|
+
}
|
|
3045
3120
|
|
|
3046
|
-
// Add initial
|
|
3047
|
-
|
|
3121
|
+
// Add initial harness message
|
|
3122
|
+
addHarnessMessage("Runtime", "initializing", "wait");
|
|
3048
3123
|
|
|
3049
3124
|
// Wait for async inits to complete, then update status
|
|
3050
3125
|
const startupTimeout = new Promise<void>((resolve) => {
|
|
@@ -3054,41 +3129,42 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3054
3129
|
Promise.allSettled(asyncInitPromises),
|
|
3055
3130
|
startupTimeout,
|
|
3056
3131
|
]).then(() => {
|
|
3057
|
-
// Fence: ignore if session changed
|
|
3058
|
-
if (mySession !== sessionGeneration) return;
|
|
3132
|
+
// Fence: ignore if session changed or already hidden
|
|
3133
|
+
if (mySession !== sessionGeneration || !startupVisible) return;
|
|
3059
3134
|
|
|
3060
|
-
//
|
|
3061
|
-
|
|
3135
|
+
// Update Runtime status
|
|
3136
|
+
const runtimeMsg = harnessMessages.find((m) => m.label === "Runtime");
|
|
3137
|
+
if (runtimeMsg) {
|
|
3138
|
+
runtimeMsg.status = "ok";
|
|
3139
|
+
runtimeMsg.text = "initialized";
|
|
3140
|
+
}
|
|
3062
3141
|
|
|
3142
|
+
// Add service messages from startup
|
|
3063
3143
|
for (const msg of startupMessages) {
|
|
3064
3144
|
if (msg.includes("Qdrant") && msg.includes("ready")) {
|
|
3065
|
-
|
|
3145
|
+
addHarnessMessage("Qdrant", "connected", "ok");
|
|
3066
3146
|
}
|
|
3067
3147
|
if (msg.includes("Telegram") && msg.includes("ready")) {
|
|
3068
|
-
|
|
3148
|
+
addHarnessMessage("Telegram", "verified", "ok");
|
|
3069
3149
|
}
|
|
3070
3150
|
if (msg.includes("Honcho")) {
|
|
3071
|
-
|
|
3151
|
+
addHarnessMessage("Honcho", "registered", "ok");
|
|
3072
3152
|
}
|
|
3073
3153
|
if (msg.includes("Scanned") && msg.includes("skills")) {
|
|
3074
3154
|
const match = msg.match(/Scanned (\d+)/);
|
|
3075
3155
|
if (match) {
|
|
3076
|
-
|
|
3156
|
+
addHarnessMessage("Skills", `${match[1]} discovered`, "ok");
|
|
3077
3157
|
}
|
|
3078
3158
|
}
|
|
3079
3159
|
}
|
|
3080
|
-
|
|
3081
|
-
// Update status using setStatus
|
|
3082
|
-
const statusText = "[pi-harness] " + startupMessages_.join(" | ");
|
|
3083
|
-
harnessStatusSetStatus?.(HARNESS_STATUS_KEY, statusText);
|
|
3084
3160
|
});
|
|
3085
3161
|
});
|
|
3086
3162
|
|
|
3087
|
-
//
|
|
3163
|
+
// Hide harness block on first user input (like [Prompts]/[Extensions] disappear)
|
|
3088
3164
|
pi.on("message_start", (event) => {
|
|
3089
3165
|
const msg = event.message as { role?: string };
|
|
3090
3166
|
if (msg?.role === "user") {
|
|
3091
|
-
|
|
3167
|
+
hideHarnessBlock();
|
|
3092
3168
|
}
|
|
3093
3169
|
});
|
|
3094
3170
|
|
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.215",
|
|
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",
|