pi-harness-runtime 1.1.210 → 1.1.212
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 +104 -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
|
@@ -3016,22 +3016,71 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3016
3016
|
},
|
|
3017
3017
|
});
|
|
3018
3018
|
|
|
3019
|
-
// ---
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3019
|
+
// --- Harness widget state (like Todos extension) -----------------------
|
|
3020
|
+
// Learn from Todos extension:
|
|
3021
|
+
// - setWidget with placement: "aboveEditor" (fixed above input)
|
|
3022
|
+
// - Capture tui.requestRender from factory
|
|
3023
|
+
// - Return [] when hidden (removes widget height)
|
|
3024
|
+
// - Call requestRender(true) on hide for forced redraw
|
|
3025
|
+
// - Tree characters like Todos (├─ └─)
|
|
3026
|
+
// - Trailing spacer line for breathing room
|
|
3027
|
+
const HARNESS_WIDGET_KEY = "pi-harness-startup";
|
|
3028
|
+
interface HarnessMessage {
|
|
3029
|
+
id: string;
|
|
3030
|
+
label: string;
|
|
3031
|
+
text: string;
|
|
3032
|
+
status: "wait" | "ok" | "err";
|
|
3033
|
+
}
|
|
3034
|
+
const harnessMessages: HarnessMessage[] = [];
|
|
3035
|
+
let startupVisible = true;
|
|
3036
|
+
let harnessTUI: { requestRender: (forced?: boolean) => void } | null = null;
|
|
3037
|
+
let harnessWidgetRegistered = false;
|
|
3038
|
+
let sessionGeneration = 0;
|
|
3039
|
+
|
|
3040
|
+
function addHarnessMessage(label: string, text: string, status: "wait" | "ok" | "err" = "wait") {
|
|
3041
|
+
const id = `${label}-${Date.now()}`;
|
|
3042
|
+
harnessMessages.push({ id, label, text, status });
|
|
3043
|
+
harnessTUI?.requestRender();
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
function hideHarnessBlock() {
|
|
3047
|
+
startupVisible = false;
|
|
3048
|
+
harnessTUI?.requestRender(true); // Force redraw like Todos
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
function truncateToWidth(text: string, width: number): string {
|
|
3052
|
+
if (text.length <= width) return text;
|
|
3053
|
+
return text.substring(0, width - 1) + "…";
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
function getHarnessLines(width: number): string[] {
|
|
3057
|
+
if (!startupVisible || harnessMessages.length === 0) return [];
|
|
3058
|
+
|
|
3059
|
+
const lines: string[] = [];
|
|
3060
|
+
const heading = truncateToWidth("[pi-harness]", width);
|
|
3061
|
+
lines.push(heading);
|
|
3062
|
+
|
|
3063
|
+
for (let i = 0; i < harnessMessages.length; i++) {
|
|
3064
|
+
const msg = harnessMessages[i];
|
|
3065
|
+
const marker = msg.status === "ok" ? "[OK]" : msg.status === "err" ? "[ERR]" : "[WAIT]";
|
|
3066
|
+
const isLast = i === harnessMessages.length - 1;
|
|
3067
|
+
const treeChar = isLast ? "└─" : "├─";
|
|
3068
|
+
let text = `${treeChar} ${marker} ${msg.label}: ${msg.text}`;
|
|
3069
|
+
text = truncateToWidth(text, width);
|
|
3070
|
+
lines.push(text);
|
|
3071
|
+
}
|
|
3029
3072
|
|
|
3073
|
+
// Trailing spacer for breathing room (like Todos)
|
|
3074
|
+
lines.push("");
|
|
3075
|
+
|
|
3076
|
+
return lines;
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
// --- Footer status (persistent badge) --------------------------------
|
|
3030
3080
|
pi.on("session_start", async (_event, ctx) => {
|
|
3031
3081
|
|
|
3032
3082
|
// Capture only the setStatus function, not the ctx
|
|
3033
3083
|
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3034
|
-
harnessSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3035
3084
|
refreshFooterStatus(
|
|
3036
3085
|
footerSetStatus,
|
|
3037
3086
|
tracker,
|
|
@@ -3040,10 +3089,33 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3040
3089
|
() => lastActiveProvider,
|
|
3041
3090
|
);
|
|
3042
3091
|
|
|
3043
|
-
//
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3092
|
+
// Increment session generation to fence late callbacks
|
|
3093
|
+
sessionGeneration++;
|
|
3094
|
+
const mySession = sessionGeneration;
|
|
3095
|
+
startupVisible = true;
|
|
3096
|
+
harnessMessages.length = 0;
|
|
3097
|
+
|
|
3098
|
+
// --- Install harness widget (like Todos with placement: "aboveEditor") -------
|
|
3099
|
+
// Use setWidget with placement: "aboveEditor" - fixed above input field
|
|
3100
|
+
if (!harnessWidgetRegistered) {
|
|
3101
|
+
ctx.ui.setWidget(
|
|
3102
|
+
HARNESS_WIDGET_KEY,
|
|
3103
|
+
(tui, _theme) => {
|
|
3104
|
+
harnessTUI = tui;
|
|
3105
|
+
return {
|
|
3106
|
+
render: (width: number) => getHarnessLines(width),
|
|
3107
|
+
invalidate: () => {},
|
|
3108
|
+
};
|
|
3109
|
+
},
|
|
3110
|
+
{ placement: "aboveEditor" }, // Like Todos!
|
|
3111
|
+
);
|
|
3112
|
+
harnessWidgetRegistered = true;
|
|
3113
|
+
} else {
|
|
3114
|
+
harnessTUI?.requestRender();
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
// Add initial harness message
|
|
3118
|
+
addHarnessMessage("Runtime", "initializing", "wait");
|
|
3047
3119
|
|
|
3048
3120
|
// Wait for async inits to complete, then update status
|
|
3049
3121
|
const startupTimeout = new Promise<void>((resolve) => {
|
|
@@ -3053,36 +3125,42 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3053
3125
|
Promise.allSettled(asyncInitPromises),
|
|
3054
3126
|
startupTimeout,
|
|
3055
3127
|
]).then(() => {
|
|
3056
|
-
|
|
3128
|
+
// Fence: ignore if session changed or already hidden
|
|
3129
|
+
if (mySession !== sessionGeneration || !startupVisible) return;
|
|
3057
3130
|
|
|
3131
|
+
// Update Runtime status
|
|
3132
|
+
const runtimeMsg = harnessMessages.find((m) => m.label === "Runtime");
|
|
3133
|
+
if (runtimeMsg) {
|
|
3134
|
+
runtimeMsg.status = "ok";
|
|
3135
|
+
runtimeMsg.text = "initialized";
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
// Add service messages from startup
|
|
3058
3139
|
for (const msg of startupMessages) {
|
|
3059
3140
|
if (msg.includes("Qdrant") && msg.includes("ready")) {
|
|
3060
|
-
|
|
3141
|
+
addHarnessMessage("Qdrant", "connected", "ok");
|
|
3061
3142
|
}
|
|
3062
3143
|
if (msg.includes("Telegram") && msg.includes("ready")) {
|
|
3063
|
-
|
|
3144
|
+
addHarnessMessage("Telegram", "verified", "ok");
|
|
3064
3145
|
}
|
|
3065
3146
|
if (msg.includes("Honcho")) {
|
|
3066
|
-
|
|
3147
|
+
addHarnessMessage("Honcho", "registered", "ok");
|
|
3067
3148
|
}
|
|
3068
3149
|
if (msg.includes("Scanned") && msg.includes("skills")) {
|
|
3069
3150
|
const match = msg.match(/Scanned (\d+)/);
|
|
3070
3151
|
if (match) {
|
|
3071
|
-
|
|
3152
|
+
addHarnessMessage("Skills", `${match[1]} discovered`, "ok");
|
|
3072
3153
|
}
|
|
3073
3154
|
}
|
|
3074
3155
|
}
|
|
3075
3156
|
});
|
|
3076
3157
|
});
|
|
3077
3158
|
|
|
3078
|
-
//
|
|
3159
|
+
// Hide harness block on first user input (like [Prompts]/[Extensions] disappear)
|
|
3079
3160
|
pi.on("message_start", (event) => {
|
|
3080
3161
|
const msg = event.message as { role?: string };
|
|
3081
|
-
if (msg?.role === "user"
|
|
3082
|
-
|
|
3083
|
-
for (const key of HARNESS_STATUS_KEYS) {
|
|
3084
|
-
harnessSetStatus?.(key, "");
|
|
3085
|
-
}
|
|
3162
|
+
if (msg?.role === "user") {
|
|
3163
|
+
hideHarnessBlock();
|
|
3086
3164
|
}
|
|
3087
3165
|
});
|
|
3088
3166
|
|
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.212",
|
|
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",
|