pi-harness-runtime 1.1.212 → 1.1.213
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 +24 -96
- 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,71 +3016,20 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3016
3016
|
},
|
|
3017
3017
|
});
|
|
3018
3018
|
|
|
3019
|
-
// --- Harness
|
|
3020
|
-
//
|
|
3021
|
-
//
|
|
3022
|
-
|
|
3023
|
-
|
|
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;
|
|
3019
|
+
// --- Harness status (like context-mode) -----------------------
|
|
3020
|
+
// Use setStatus like context-mode does - pi.dev already handles layout for these
|
|
3021
|
+
// pi.dev doesn't know about our setWidget, so it doesn't auto-scroll
|
|
3022
|
+
const HARNESS_STATUS_KEY = "pi-harness";
|
|
3023
|
+
let harnessStatusSetStatus: ((key: string, value: string) => void) | null = null;
|
|
3038
3024
|
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
|
-
}
|
|
3072
|
-
|
|
3073
|
-
// Trailing spacer for breathing room (like Todos)
|
|
3074
|
-
lines.push("");
|
|
3075
|
-
|
|
3076
|
-
return lines;
|
|
3077
|
-
}
|
|
3025
|
+
let startupMessages_: string[] = [];
|
|
3078
3026
|
|
|
3079
3027
|
// --- Footer status (persistent badge) --------------------------------
|
|
3080
3028
|
pi.on("session_start", async (_event, ctx) => {
|
|
3081
3029
|
|
|
3082
3030
|
// Capture only the setStatus function, not the ctx
|
|
3083
3031
|
footerSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3032
|
+
harnessStatusSetStatus = ctx.ui.setStatus.bind(ctx.ui);
|
|
3084
3033
|
refreshFooterStatus(
|
|
3085
3034
|
footerSetStatus,
|
|
3086
3035
|
tracker,
|
|
@@ -3092,30 +3041,10 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3092
3041
|
// Increment session generation to fence late callbacks
|
|
3093
3042
|
sessionGeneration++;
|
|
3094
3043
|
const mySession = sessionGeneration;
|
|
3095
|
-
|
|
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
|
-
}
|
|
3044
|
+
startupMessages_ = [];
|
|
3116
3045
|
|
|
3117
|
-
// Add initial
|
|
3118
|
-
|
|
3046
|
+
// Add initial status
|
|
3047
|
+
harnessStatusSetStatus?.(HARNESS_STATUS_KEY, "[pi-harness] Runtime: initializing");
|
|
3119
3048
|
|
|
3120
3049
|
// Wait for async inits to complete, then update status
|
|
3121
3050
|
const startupTimeout = new Promise<void>((resolve) => {
|
|
@@ -3125,42 +3054,41 @@ Run \`bd ready\` to see current bd issues.
|
|
|
3125
3054
|
Promise.allSettled(asyncInitPromises),
|
|
3126
3055
|
startupTimeout,
|
|
3127
3056
|
]).then(() => {
|
|
3128
|
-
// Fence: ignore if session changed
|
|
3129
|
-
if (mySession !== sessionGeneration
|
|
3057
|
+
// Fence: ignore if session changed
|
|
3058
|
+
if (mySession !== sessionGeneration) return;
|
|
3130
3059
|
|
|
3131
|
-
//
|
|
3132
|
-
|
|
3133
|
-
if (runtimeMsg) {
|
|
3134
|
-
runtimeMsg.status = "ok";
|
|
3135
|
-
runtimeMsg.text = "initialized";
|
|
3136
|
-
}
|
|
3060
|
+
// Build startup messages
|
|
3061
|
+
startupMessages_ = ["Runtime: initialized"];
|
|
3137
3062
|
|
|
3138
|
-
// Add service messages from startup
|
|
3139
3063
|
for (const msg of startupMessages) {
|
|
3140
3064
|
if (msg.includes("Qdrant") && msg.includes("ready")) {
|
|
3141
|
-
|
|
3065
|
+
startupMessages_.push("Qdrant: connected");
|
|
3142
3066
|
}
|
|
3143
3067
|
if (msg.includes("Telegram") && msg.includes("ready")) {
|
|
3144
|
-
|
|
3068
|
+
startupMessages_.push("Telegram: verified");
|
|
3145
3069
|
}
|
|
3146
3070
|
if (msg.includes("Honcho")) {
|
|
3147
|
-
|
|
3071
|
+
startupMessages_.push("Honcho: registered");
|
|
3148
3072
|
}
|
|
3149
3073
|
if (msg.includes("Scanned") && msg.includes("skills")) {
|
|
3150
3074
|
const match = msg.match(/Scanned (\d+)/);
|
|
3151
3075
|
if (match) {
|
|
3152
|
-
|
|
3076
|
+
startupMessages_.push(`Skills: ${match[1]}`);
|
|
3153
3077
|
}
|
|
3154
3078
|
}
|
|
3155
3079
|
}
|
|
3080
|
+
|
|
3081
|
+
// Update status using setStatus
|
|
3082
|
+
const statusText = "[pi-harness] " + startupMessages_.join(" | ");
|
|
3083
|
+
harnessStatusSetStatus?.(HARNESS_STATUS_KEY, statusText);
|
|
3156
3084
|
});
|
|
3157
3085
|
});
|
|
3158
3086
|
|
|
3159
|
-
//
|
|
3087
|
+
// Clear harness status on first user input
|
|
3160
3088
|
pi.on("message_start", (event) => {
|
|
3161
3089
|
const msg = event.message as { role?: string };
|
|
3162
3090
|
if (msg?.role === "user") {
|
|
3163
|
-
|
|
3091
|
+
harnessStatusSetStatus?.(HARNESS_STATUS_KEY, "");
|
|
3164
3092
|
}
|
|
3165
3093
|
});
|
|
3166
3094
|
|
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.213",
|
|
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",
|