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