pi-harness-runtime 1.1.201 → 1.1.202
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/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/dist/harness-types.d.ts +87 -0
- package/packages/notification/dist/harness-types.d.ts.map +1 -0
- package/packages/notification/dist/harness-types.js +7 -0
- package/packages/notification/dist/harness-types.js.map +1 -0
- package/packages/notification/dist/harness-widget-manager.d.ts +79 -0
- package/packages/notification/dist/harness-widget-manager.d.ts.map +1 -0
- package/packages/notification/dist/harness-widget-manager.js +162 -0
- package/packages/notification/dist/harness-widget-manager.js.map +1 -0
- package/packages/notification/dist/harness-widget.d.ts +48 -0
- package/packages/notification/dist/harness-widget.d.ts.map +1 -0
- package/packages/notification/dist/harness-widget.js +145 -0
- package/packages/notification/dist/harness-widget.js.map +1 -0
- package/packages/notification/dist/index.d.ts +3 -0
- package/packages/notification/dist/index.d.ts.map +1 -1
- package/packages/notification/dist/index.js +3 -0
- package/packages/notification/dist/index.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/harness-types.ts +93 -0
- package/packages/notification/src/harness-widget-manager.ts +194 -0
- package/packages/notification/src/index.ts +11 -0
- 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
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pi-harness Startup Widget Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages the Pi-harness startup widget with proper styling
|
|
5
|
+
* and overflow protection.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
9
|
+
import type { HarnessStatus } from "./harness-types.js";
|
|
10
|
+
import {
|
|
11
|
+
renderWidgetBody,
|
|
12
|
+
createInitialStatus,
|
|
13
|
+
getTerminalWidth,
|
|
14
|
+
} from "./harness-widget.js";
|
|
15
|
+
|
|
16
|
+
// Widget key constant
|
|
17
|
+
const HARNESS_WIDGET_KEY = "pi-harness-startup";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Harness Widget Manager
|
|
21
|
+
*/
|
|
22
|
+
export class HarnessWidget {
|
|
23
|
+
private ui: ExtensionContext["ui"] | null = null;
|
|
24
|
+
private status: HarnessStatus;
|
|
25
|
+
private expanded: boolean = false;
|
|
26
|
+
private updateTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
27
|
+
|
|
28
|
+
constructor(_pi: ExtensionAPI) {
|
|
29
|
+
this.status = createInitialStatus();
|
|
30
|
+
|
|
31
|
+
// Get ui from ExtensionContext if available
|
|
32
|
+
// In extensions, pi.ui is available through ctx.ui in event handlers
|
|
33
|
+
// We store a reference during session_start
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Initialize with UI context (called during setup)
|
|
38
|
+
*/
|
|
39
|
+
initWithUI(ui: ExtensionContext["ui"]): void {
|
|
40
|
+
this.ui = ui;
|
|
41
|
+
this.render();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Update harness status and refresh widget
|
|
46
|
+
*/
|
|
47
|
+
updateStatus(updates: Partial<HarnessStatus>): void {
|
|
48
|
+
// Merge updates
|
|
49
|
+
this.status = {
|
|
50
|
+
...this.status,
|
|
51
|
+
...updates,
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Debounce updates to avoid excessive re-renders
|
|
55
|
+
if (this.updateTimeout) {
|
|
56
|
+
clearTimeout(this.updateTimeout);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.updateTimeout = setTimeout(() => {
|
|
60
|
+
this.render();
|
|
61
|
+
}, 100);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Update specific component status
|
|
66
|
+
*/
|
|
67
|
+
updateComponent<K extends keyof HarnessStatus>(
|
|
68
|
+
component: K,
|
|
69
|
+
value: HarnessStatus[K],
|
|
70
|
+
): void {
|
|
71
|
+
this.status = {
|
|
72
|
+
...this.status,
|
|
73
|
+
[component]: value,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
if (this.updateTimeout) {
|
|
77
|
+
clearTimeout(this.updateTimeout);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this.updateTimeout = setTimeout(() => {
|
|
81
|
+
this.render();
|
|
82
|
+
}, 100);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Render and display the widget
|
|
87
|
+
*/
|
|
88
|
+
render(): void {
|
|
89
|
+
if (!this.ui) return;
|
|
90
|
+
|
|
91
|
+
const body = renderWidgetBody(this.status);
|
|
92
|
+
|
|
93
|
+
// Build widget content with heading
|
|
94
|
+
const heading = `[Pi-harness]`;
|
|
95
|
+
const content = [heading, ...body];
|
|
96
|
+
|
|
97
|
+
// Use setWidget
|
|
98
|
+
try {
|
|
99
|
+
this.ui.setWidget(HARNESS_WIDGET_KEY, content);
|
|
100
|
+
} catch (err) {
|
|
101
|
+
// Fallback: log to stderr if widget fails
|
|
102
|
+
console.error("[pi-harness] Widget render failed:", err);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Initialize widget with version info
|
|
108
|
+
*/
|
|
109
|
+
initialize(version: string, tagline: string): void {
|
|
110
|
+
this.status.version = version;
|
|
111
|
+
this.status.tagline = tagline;
|
|
112
|
+
this.render();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Set runtime status
|
|
117
|
+
*/
|
|
118
|
+
setRuntime(status: string): void {
|
|
119
|
+
this.updateComponent("runtime", { status });
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Set Qdrant status
|
|
124
|
+
*/
|
|
125
|
+
setQdrant(status: string, details?: string): void {
|
|
126
|
+
this.updateComponent("qdrant", { status, details });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Set Honcho status
|
|
131
|
+
*/
|
|
132
|
+
setHoncho(status: string, sessionId?: string): void {
|
|
133
|
+
this.updateComponent("honcho", { status, sessionId });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Set Telegram status
|
|
138
|
+
*/
|
|
139
|
+
setTelegram(status: string, botName?: string): void {
|
|
140
|
+
this.updateComponent("telegram", { status, botName });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Set skills count
|
|
145
|
+
*/
|
|
146
|
+
setSkills(count: number): void {
|
|
147
|
+
this.updateComponent("skills", { count });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Set commands
|
|
152
|
+
*/
|
|
153
|
+
setCommands(commands: string[]): void {
|
|
154
|
+
this.updateComponent("commands", commands);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Mark component as complete with icon
|
|
159
|
+
*/
|
|
160
|
+
markComplete(component: keyof HarnessStatus, value?: string): void {
|
|
161
|
+
const completeStatus = value ? `${value} ✓` : "ready ✓";
|
|
162
|
+
this.updateComponent(component, { status: completeStatus } as HarnessStatus[keyof HarnessStatus]);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Mark component as failed
|
|
167
|
+
*/
|
|
168
|
+
markFailed(component: keyof HarnessStatus, error: string): void {
|
|
169
|
+
this.updateComponent(component, { status: "failed", error } as HarnessStatus[keyof HarnessStatus]);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Cleanup
|
|
174
|
+
*/
|
|
175
|
+
dispose(): void {
|
|
176
|
+
if (this.updateTimeout) {
|
|
177
|
+
clearTimeout(this.updateTimeout);
|
|
178
|
+
}
|
|
179
|
+
// Remove widget
|
|
180
|
+
try {
|
|
181
|
+
this.ui?.setWidget(HARNESS_WIDGET_KEY, undefined);
|
|
182
|
+
} catch {
|
|
183
|
+
// Ignore cleanup errors
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Create harness widget instance
|
|
190
|
+
*/
|
|
191
|
+
export function createHarnessWidget(_pi: ExtensionAPI): HarnessWidget {
|
|
192
|
+
const widget = new HarnessWidget(_pi);
|
|
193
|
+
return widget;
|
|
194
|
+
}
|
|
@@ -26,3 +26,14 @@ export {
|
|
|
26
26
|
ConversationBridge,
|
|
27
27
|
createConversationBridge,
|
|
28
28
|
} from "./conversation-bridge.js";
|
|
29
|
+
|
|
30
|
+
// Harness widget exports
|
|
31
|
+
export { HarnessWidget, createHarnessWidget } from "./harness-widget-manager.js";
|
|
32
|
+
export type { HarnessStatus, StatusDetail, HonchoStatus, TelegramStatus, SkillsStatus } from "./harness-types.js";
|
|
33
|
+
export {
|
|
34
|
+
renderWidgetBody,
|
|
35
|
+
createInitialStatus,
|
|
36
|
+
getTerminalWidth,
|
|
37
|
+
truncate,
|
|
38
|
+
truncateMiddle,
|
|
39
|
+
} from "./harness-widget-manager.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/provider-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.202",
|
|
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",
|