pi-harness-runtime 1.1.249 → 1.1.250
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-widget.d.ts +10 -13
- package/packages/notification/dist/harness-widget.d.ts.map +1 -1
- package/packages/notification/dist/harness-widget.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/harness-widget.ts +167 -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,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pi-harness Startup Widget
|
|
3
|
+
*
|
|
4
|
+
* Renders harness status as a widget with native Pi styling.
|
|
5
|
+
* Handles terminal width detection and overflow protection.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { HarnessStatus } from "./harness-types.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Default config
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_CONFIG = {
|
|
14
|
+
headingStyle: "mdHeading",
|
|
15
|
+
bodyStyle: "dim",
|
|
16
|
+
indent: " ",
|
|
17
|
+
defaultWidth: 80,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get terminal width
|
|
22
|
+
*/
|
|
23
|
+
export function getTerminalWidth(): number {
|
|
24
|
+
// Try stdout columns
|
|
25
|
+
if (typeof process !== "undefined" && process.stdout) {
|
|
26
|
+
const cols = (process.stdout as NodeJS.WriteStream & { columns?: number }).columns;
|
|
27
|
+
if (cols && cols > 0) {
|
|
28
|
+
return cols;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// Fallback to default
|
|
32
|
+
return DEFAULT_CONFIG.defaultWidth;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Truncate text to fit within max width
|
|
37
|
+
*/
|
|
38
|
+
export function truncate(text: string, maxWidth: number): string {
|
|
39
|
+
if (text.length <= maxWidth) {
|
|
40
|
+
return text;
|
|
41
|
+
}
|
|
42
|
+
// Leave room for "..." suffix
|
|
43
|
+
return text.substring(0, Math.max(0, maxWidth - 3)) + "...";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Truncate text in the middle (for paths/lists)
|
|
48
|
+
*/
|
|
49
|
+
export function truncateMiddle(text: string, maxWidth: number): string {
|
|
50
|
+
if (text.length <= maxWidth) {
|
|
51
|
+
return text;
|
|
52
|
+
}
|
|
53
|
+
const half = Math.floor((maxWidth - 3) / 2);
|
|
54
|
+
return text.substring(0, half) + "..." + text.substring(text.length - half);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Render a status line with optional icon
|
|
59
|
+
*/
|
|
60
|
+
function renderStatusLine(label: string, value: string, width: number, indent: string): string {
|
|
61
|
+
const maxValueWidth = width - indent.length - label.length - 2; // ": " separator
|
|
62
|
+
const truncatedValue = truncate(value, maxValueWidth);
|
|
63
|
+
return `${indent}${label}: ${truncatedValue}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Render version/tagline line
|
|
68
|
+
*/
|
|
69
|
+
function renderVersionLine(tagline: string, width: number, indent: string): string {
|
|
70
|
+
const maxTagWidth = width - indent.length - 2;
|
|
71
|
+
return `${indent}${truncate(tagline, maxTagWidth)}`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Render commands line with truncation
|
|
76
|
+
*/
|
|
77
|
+
function renderCommandsLine(commands: string[], width: number, indent: string): string {
|
|
78
|
+
const prefix = `${indent}Commands: `;
|
|
79
|
+
const maxWidth = width - prefix.length;
|
|
80
|
+
const joined = commands.join(", ");
|
|
81
|
+
return prefix + truncate(joined, maxWidth);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Render harness status as widget body (string array for setWidget)
|
|
86
|
+
*/
|
|
87
|
+
export function renderWidgetBody(
|
|
88
|
+
status: HarnessStatus,
|
|
89
|
+
config: Partial<typeof DEFAULT_CONFIG> = {}
|
|
90
|
+
): string[] {
|
|
91
|
+
const cfg = { ...DEFAULT_CONFIG, ...config };
|
|
92
|
+
const width = getTerminalWidth();
|
|
93
|
+
const indent = cfg.indent;
|
|
94
|
+
const lines: string[] = [];
|
|
95
|
+
|
|
96
|
+
// Version/tagline line
|
|
97
|
+
lines.push(renderVersionLine(status.tagline, width, indent));
|
|
98
|
+
|
|
99
|
+
// Runtime status
|
|
100
|
+
lines.push(renderStatusLine("Runtime", status.runtime.status, width, indent));
|
|
101
|
+
|
|
102
|
+
// Qdrant status
|
|
103
|
+
if (status.qdrant) {
|
|
104
|
+
lines.push(renderStatusLine("Qdrant", status.qdrant.status, width, indent));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Honcho status
|
|
108
|
+
if (status.honcho) {
|
|
109
|
+
const honchoDetail = status.honcho.sessionId
|
|
110
|
+
? `${status.honcho.status} (${status.honcho.sessionId})`
|
|
111
|
+
: status.honcho.status;
|
|
112
|
+
lines.push(renderStatusLine("Honcho", honchoDetail, width, indent));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Telegram status
|
|
116
|
+
if (status.telegram) {
|
|
117
|
+
const tgDetail = status.telegram.botName
|
|
118
|
+
? `${status.telegram.status}: @${status.telegram.botName}`
|
|
119
|
+
: status.telegram.status;
|
|
120
|
+
lines.push(renderStatusLine("Telegram", tgDetail, width, indent));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Skills status
|
|
124
|
+
if (status.skills) {
|
|
125
|
+
const skillDetail = `${status.skills.count} discovered`;
|
|
126
|
+
lines.push(renderStatusLine("Skills", skillDetail, width, indent));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Commands line (always last, most likely to overflow)
|
|
130
|
+
if (status.commands && status.commands.length > 0) {
|
|
131
|
+
lines.push(renderCommandsLine(status.commands, width, indent));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return lines;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Create initial pending status
|
|
139
|
+
*/
|
|
140
|
+
export function createInitialStatus(): HarnessStatus {
|
|
141
|
+
return {
|
|
142
|
+
version: "v1.0.0",
|
|
143
|
+
tagline: "quota management, automation, memory, multi-agent",
|
|
144
|
+
runtime: { status: "initializing..." },
|
|
145
|
+
qdrant: { status: "configuring..." },
|
|
146
|
+
honcho: { status: "initializing..." },
|
|
147
|
+
telegram: { status: "connecting..." },
|
|
148
|
+
skills: { count: 0 },
|
|
149
|
+
commands: [],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Format status with icons
|
|
155
|
+
*/
|
|
156
|
+
export function formatStatusWithIcon(status: string): { status: string; icon?: string } {
|
|
157
|
+
if (status.includes("✓") || status.includes("ready")) {
|
|
158
|
+
return { status, icon: "✓" };
|
|
159
|
+
}
|
|
160
|
+
if (status.includes("✗") || status.includes("error") || status.includes("failed")) {
|
|
161
|
+
return { status, icon: "✗" };
|
|
162
|
+
}
|
|
163
|
+
if (status.includes("...")) {
|
|
164
|
+
return { status, icon: "..." };
|
|
165
|
+
}
|
|
166
|
+
return { status };
|
|
167
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/provider-router",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.250",
|
|
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",
|