pi-harness-runtime 1.1.195 → 1.1.196
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/conversation-bridge.d.ts +1 -6
- package/packages/notification/dist/conversation-bridge.d.ts.map +1 -1
- package/packages/notification/dist/conversation-bridge.js +5 -36
- package/packages/notification/dist/conversation-bridge.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/conversation-bridge.ts +5 -54
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-harness/capability-registry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.196",
|
|
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",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Telegram Conversation Bridge
|
|
3
3
|
*
|
|
4
|
-
* Sends assistant responses
|
|
4
|
+
* Sends assistant responses to Telegram.
|
|
5
5
|
* Hooks into Pi lifecycle events to capture:
|
|
6
6
|
* - message_end: Final assistant responses
|
|
7
|
-
* - agent_end: When agent finishes a turn
|
|
8
7
|
* - agent_settled: When agent fully settles
|
|
9
8
|
*
|
|
10
9
|
* Features:
|
|
@@ -20,12 +19,8 @@ import type { NotificationCenter } from "./notification-center.js";
|
|
|
20
19
|
export interface ConversationBridgeConfig {
|
|
21
20
|
/** Whether to send assistant final responses */
|
|
22
21
|
sendAssistantResponses: boolean;
|
|
23
|
-
/** Whether to send tool summaries */
|
|
24
|
-
sendToolSummaries: boolean;
|
|
25
22
|
/** Max message length before chunking */
|
|
26
23
|
maxMessageLength: number;
|
|
27
|
-
/** Minimum confidence to send a message */
|
|
28
|
-
minConfidence: number;
|
|
29
24
|
}
|
|
30
25
|
/**
|
|
31
26
|
* Conversation Bridge
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-bridge.d.ts","sourceRoot":"","sources":["../src/conversation-bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"conversation-bridge.d.ts","sourceRoot":"","sources":["../src/conversation-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,gDAAgD;IAChD,sBAAsB,EAAE,OAAO,CAAC;IAChC,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAYD;;;;GAIG;AACH,qBAAa,kBAAkB;IAC9B,OAAO,CAAC,EAAE,CAAe;IACzB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,eAAe,CAA0C;IACjE,OAAO,CAAC,mBAAmB,CAA0B;IACrD,OAAO,CAAC,gBAAgB,CAAsB;IAE9C,YACC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,EAS9C;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAkDf;IAED;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;OAEG;YACW,uBAAuB;IAarC;;OAEG;YACW,oBAAoB;IAKlC;;OAEG;YACW,qBAAqB;IAmCnC;;OAEG;IACH,OAAO,CAAC,YAAY;IA6DpB;;OAEG;IACH,OAAO,CAAC,KAAK;IAMb;;OAEG;IACH,IAAI,IAAI,IAAI,CAEX;CACD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACvC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GACxC,kBAAkB,CAIpB"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Telegram Conversation Bridge
|
|
3
3
|
*
|
|
4
|
-
* Sends assistant responses
|
|
4
|
+
* Sends assistant responses to Telegram.
|
|
5
5
|
* Hooks into Pi lifecycle events to capture:
|
|
6
6
|
* - message_end: Final assistant responses
|
|
7
|
-
* - agent_end: When agent finishes a turn
|
|
8
7
|
* - agent_settled: When agent fully settles
|
|
9
8
|
*
|
|
10
9
|
* Features:
|
|
@@ -29,9 +28,7 @@ export class ConversationBridge {
|
|
|
29
28
|
this.center = center;
|
|
30
29
|
this.config = {
|
|
31
30
|
sendAssistantResponses: true,
|
|
32
|
-
sendToolSummaries: true,
|
|
33
31
|
maxMessageLength: 4000,
|
|
34
|
-
minConfidence: 0.5,
|
|
35
32
|
...config,
|
|
36
33
|
};
|
|
37
34
|
}
|
|
@@ -39,28 +36,19 @@ export class ConversationBridge {
|
|
|
39
36
|
* Register all lifecycle hooks
|
|
40
37
|
*/
|
|
41
38
|
register() {
|
|
42
|
-
console.log("[ConversationBridge] Registering lifecycle hooks...");
|
|
43
39
|
// Session start - reset state
|
|
44
40
|
this.pi.on("session_start", () => {
|
|
45
41
|
this.reset();
|
|
46
|
-
console.log("[ConversationBridge] Session started");
|
|
47
42
|
});
|
|
48
43
|
// Session compact - flush pending messages
|
|
49
|
-
this.pi.on("session_compact", (
|
|
50
|
-
console.log(`[ConversationBridge] Compaction: ${event.reason} (willRetry=${event.willRetry})`);
|
|
44
|
+
this.pi.on("session_compact", (_event) => {
|
|
51
45
|
this.flushPendingMessages();
|
|
52
46
|
});
|
|
53
47
|
// Session shutdown - cleanup
|
|
54
48
|
this.pi.on("session_shutdown", () => {
|
|
55
|
-
console.log("[ConversationBridge] Session shutting down");
|
|
56
49
|
this.flushPendingMessages();
|
|
57
50
|
this.stop();
|
|
58
51
|
});
|
|
59
|
-
// Message start - track new message
|
|
60
|
-
// Track message start for assistant messages
|
|
61
|
-
this.pi.on("message_start", (_event) => {
|
|
62
|
-
// Message tracking is handled in message_end
|
|
63
|
-
});
|
|
64
52
|
// Message end - capture final assistant response
|
|
65
53
|
this.pi.on("message_end", (event) => {
|
|
66
54
|
const msg = event.message;
|
|
@@ -72,7 +60,6 @@ export class ConversationBridge {
|
|
|
72
60
|
const messageId = msg.id ?? `msg-${this.sessionStartTime}`;
|
|
73
61
|
// Deduplicate
|
|
74
62
|
if (this.deliveredMessageIds.has(messageId)) {
|
|
75
|
-
console.log(`[ConversationBridge] Skipping duplicate: ${messageId}`);
|
|
76
63
|
return;
|
|
77
64
|
}
|
|
78
65
|
// Check if already pending
|
|
@@ -87,17 +74,11 @@ export class ConversationBridge {
|
|
|
87
74
|
this.pendingMessages.set(messageId, pending);
|
|
88
75
|
}
|
|
89
76
|
pending.events.add("message_end");
|
|
90
|
-
console.log(`[ConversationBridge] Assistant message captured: ${messageId.substring(0, 20)}...`);
|
|
91
77
|
});
|
|
92
|
-
// Tool execution end - DISABLED by default (too noisy)
|
|
93
|
-
// Tool summaries spam Telegram with every tool call
|
|
94
|
-
// Enable only if explicitly configured and user wants verbose output
|
|
95
78
|
// Agent settled - finalize and send pending messages
|
|
96
79
|
this.pi.on("agent_settled", () => {
|
|
97
|
-
console.log("[ConversationBridge] Agent settled, finalizing messages...");
|
|
98
80
|
this.finalizePendingMessages();
|
|
99
81
|
});
|
|
100
|
-
console.log("[ConversationBridge] Lifecycle hooks registered");
|
|
101
82
|
}
|
|
102
83
|
/**
|
|
103
84
|
* Extract text content from a message
|
|
@@ -138,16 +119,12 @@ export class ConversationBridge {
|
|
|
138
119
|
this.deliveredMessageIds.add(messageId);
|
|
139
120
|
this.pendingMessages.delete(messageId);
|
|
140
121
|
}
|
|
141
|
-
else {
|
|
142
|
-
console.log(`[ConversationBridge] Failed to send ${messageId}, will retry`);
|
|
143
|
-
}
|
|
144
122
|
}
|
|
145
123
|
}
|
|
146
124
|
/**
|
|
147
125
|
* Flush pending messages (on compaction) - send before clearing
|
|
148
126
|
*/
|
|
149
127
|
async flushPendingMessages() {
|
|
150
|
-
console.log(`[ConversationBridge] Flushing ${this.pendingMessages.size} pending messages`);
|
|
151
128
|
// Send all pending messages before clearing
|
|
152
129
|
await this.finalizePendingMessages();
|
|
153
130
|
}
|
|
@@ -156,7 +133,6 @@ export class ConversationBridge {
|
|
|
156
133
|
*/
|
|
157
134
|
async sendAssistantResponse(content, messageId) {
|
|
158
135
|
if (!this.center.hasHealthyChannels()) {
|
|
159
|
-
console.log("[ConversationBridge] No healthy channels, skipping");
|
|
160
136
|
return false;
|
|
161
137
|
}
|
|
162
138
|
// Chunk if too long
|
|
@@ -171,17 +147,12 @@ export class ConversationBridge {
|
|
|
171
147
|
requirement: chunk + chunkSuffix,
|
|
172
148
|
});
|
|
173
149
|
for (const result of results) {
|
|
174
|
-
if (result.success) {
|
|
175
|
-
console.log(`[ConversationBridge] Response chunk ${i + 1}/${chunks.length} sent`);
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
console.warn(`[ConversationBridge] Response chunk failed: ${result.error}`);
|
|
150
|
+
if (!result.success) {
|
|
179
151
|
allSent = false;
|
|
180
152
|
}
|
|
181
153
|
}
|
|
182
154
|
}
|
|
183
|
-
catch
|
|
184
|
-
console.error("[ConversationBridge] Failed to send response:", err);
|
|
155
|
+
catch {
|
|
185
156
|
allSent = false;
|
|
186
157
|
}
|
|
187
158
|
}
|
|
@@ -197,7 +168,6 @@ export class ConversationBridge {
|
|
|
197
168
|
const chunks = [];
|
|
198
169
|
const maxLen = this.config.maxMessageLength;
|
|
199
170
|
// Split by sentence boundaries, keeping the punctuation
|
|
200
|
-
// Also split on newlines and other natural breaks
|
|
201
171
|
const parts = message.split(/(?<=[.!?])\s+|(?<=\n)\s*|(?<=[,;:])\s+/);
|
|
202
172
|
let currentChunk = "";
|
|
203
173
|
for (const part of parts) {
|
|
@@ -259,8 +229,7 @@ export class ConversationBridge {
|
|
|
259
229
|
* Stop the bridge (cleanup)
|
|
260
230
|
*/
|
|
261
231
|
stop() {
|
|
262
|
-
|
|
263
|
-
// Cleanup will happen on shutdown
|
|
232
|
+
// Cleanup happens on shutdown
|
|
264
233
|
}
|
|
265
234
|
}
|
|
266
235
|
/**
|