pi-harness-runtime 1.1.191 → 1.1.192
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 +9 -3
- 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 +93 -0
- package/packages/notification/dist/conversation-bridge.d.ts.map +1 -0
- package/packages/notification/dist/conversation-bridge.js +294 -0
- package/packages/notification/dist/conversation-bridge.js.map +1 -0
- package/packages/notification/dist/index.d.ts +1 -0
- package/packages/notification/dist/index.d.ts.map +1 -1
- package/packages/notification/dist/index.js +1 -0
- package/packages/notification/dist/index.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/conversation-bridge.ts +385 -0
- package/packages/notification/src/index.ts +4 -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
package/index.ts
CHANGED
|
@@ -487,9 +487,12 @@ async function initQdrant(): Promise<void> {
|
|
|
487
487
|
|
|
488
488
|
// --- telegram-notifications: Telegram bot for harness event notifications ------------
|
|
489
489
|
// Sends Telegram messages when jobs complete, tasks finish, or human input is needed.
|
|
490
|
-
async function initTelegram(): Promise<void> {
|
|
490
|
+
async function initTelegram(pi: ExtensionAPI): Promise<void> {
|
|
491
491
|
try {
|
|
492
|
-
const {
|
|
492
|
+
const {
|
|
493
|
+
NotificationCenter,
|
|
494
|
+
createConversationBridge,
|
|
495
|
+
} = await import("./packages/notification/dist/index.js");
|
|
493
496
|
const { readFileSync, existsSync } = await import("node:fs");
|
|
494
497
|
const home = process.env.HOME || process.env.USERPROFILE || "/home/frappe";
|
|
495
498
|
const keysDir = `${home}/.pi-harness-runtime/keys`;
|
|
@@ -573,6 +576,9 @@ async function initTelegram(): Promise<void> {
|
|
|
573
576
|
getGLMQuotaCountdown().setNotificationCenter(center);
|
|
574
577
|
} catch { /* not critical */ }
|
|
575
578
|
|
|
579
|
+
// Register conversation bridge to send assistant responses to Telegram
|
|
580
|
+
createConversationBridge(pi, center);
|
|
581
|
+
|
|
576
582
|
// Log the actual bot username (fetched from Telegram API via getMe)
|
|
577
583
|
const botUsername = center.getTelegramBotUsername();
|
|
578
584
|
if (botUsername) {
|
|
@@ -1545,7 +1551,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
1545
1551
|
|
|
1546
1552
|
// --- telegram-notifications: Telegram bot for harness event notifications ----
|
|
1547
1553
|
// Collect promise so we can wait for initialization before showing startup notification
|
|
1548
|
-
asyncInitPromises.push(initTelegram());
|
|
1554
|
+
asyncInitPromises.push(initTelegram(pi));
|
|
1549
1555
|
|
|
1550
1556
|
// --- codex-watcher: Inject Codex plans into pi.dev + Telegram --------------
|
|
1551
1557
|
// Lightweight: polls ~/.codex/sessions/ every 5s, no LangChain daemon.
|
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.192",
|
|
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",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram Conversation Bridge
|
|
3
|
+
*
|
|
4
|
+
* Sends assistant responses and tool activity to Telegram.
|
|
5
|
+
* Hooks into Pi lifecycle events to capture:
|
|
6
|
+
* - message_end: Final assistant responses
|
|
7
|
+
* - agent_end: When agent finishes a turn
|
|
8
|
+
* - agent_settled: When agent fully settles
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Deduplication across events
|
|
12
|
+
* - Safe formatting
|
|
13
|
+
* - Delivery status tracking
|
|
14
|
+
*/
|
|
15
|
+
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
16
|
+
import type { NotificationCenter } from "./notification-center.js";
|
|
17
|
+
/**
|
|
18
|
+
* Configuration for the conversation bridge
|
|
19
|
+
*/
|
|
20
|
+
export interface ConversationBridgeConfig {
|
|
21
|
+
/** Whether to send assistant final responses */
|
|
22
|
+
sendAssistantResponses: boolean;
|
|
23
|
+
/** Whether to send tool summaries */
|
|
24
|
+
sendToolSummaries: boolean;
|
|
25
|
+
/** Max message length before chunking */
|
|
26
|
+
maxMessageLength: number;
|
|
27
|
+
/** Minimum confidence to send a message */
|
|
28
|
+
minConfidence: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Conversation Bridge
|
|
32
|
+
*
|
|
33
|
+
* Bridges Pi conversation events to Telegram notifications.
|
|
34
|
+
*/
|
|
35
|
+
export declare class ConversationBridge {
|
|
36
|
+
private pi;
|
|
37
|
+
private center;
|
|
38
|
+
private config;
|
|
39
|
+
private pendingMessages;
|
|
40
|
+
private deliveredMessageIds;
|
|
41
|
+
private sessionStartTime;
|
|
42
|
+
private lastMessageId;
|
|
43
|
+
constructor(pi: ExtensionAPI, center: NotificationCenter, config?: Partial<ConversationBridgeConfig>);
|
|
44
|
+
/**
|
|
45
|
+
* Register all lifecycle hooks
|
|
46
|
+
*/
|
|
47
|
+
register(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Extract text content from a message
|
|
50
|
+
*/
|
|
51
|
+
private extractMessageContent;
|
|
52
|
+
/**
|
|
53
|
+
* Format a tool execution summary
|
|
54
|
+
*/
|
|
55
|
+
private formatToolSummary;
|
|
56
|
+
/**
|
|
57
|
+
* Send a tool summary to Telegram
|
|
58
|
+
*/
|
|
59
|
+
private sendToolSummary;
|
|
60
|
+
/**
|
|
61
|
+
* Finalize and send pending messages (called on agent_settled)
|
|
62
|
+
*/
|
|
63
|
+
private finalizePendingMessages;
|
|
64
|
+
/**
|
|
65
|
+
* Flush pending messages without sending (on compaction)
|
|
66
|
+
*/
|
|
67
|
+
private flushPendingMessages;
|
|
68
|
+
/**
|
|
69
|
+
* Send an assistant response to Telegram
|
|
70
|
+
*/
|
|
71
|
+
private sendAssistantResponse;
|
|
72
|
+
/**
|
|
73
|
+
* Chunk a message into smaller parts
|
|
74
|
+
*/
|
|
75
|
+
private chunkMessage;
|
|
76
|
+
/**
|
|
77
|
+
* Truncate a string
|
|
78
|
+
*/
|
|
79
|
+
private truncate;
|
|
80
|
+
/**
|
|
81
|
+
* Reset state for new session
|
|
82
|
+
*/
|
|
83
|
+
private reset;
|
|
84
|
+
/**
|
|
85
|
+
* Stop the bridge (cleanup)
|
|
86
|
+
*/
|
|
87
|
+
stop(): void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Create and register a conversation bridge
|
|
91
|
+
*/
|
|
92
|
+
export declare function createConversationBridge(pi: ExtensionAPI, center: NotificationCenter, config?: Partial<ConversationBridgeConfig>): ConversationBridge;
|
|
93
|
+
//# sourceMappingURL=conversation-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-bridge.d.ts","sourceRoot":"","sources":["../src/conversation-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,gDAAgD;IAChD,sBAAsB,EAAE,OAAO,CAAC;IAChC,qCAAqC;IACrC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;CACtB;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;IAC9C,OAAO,CAAC,aAAa,CAAuB;IAE5C,YACC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,EAW9C;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAmFf;IAED;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA8B7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;YACW,eAAe;IA6B7B;;OAEG;YACW,uBAAuB;IAWrC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;YACW,qBAAqB;IA+CnC;;OAEG;IACH,OAAO,CAAC,YAAY;IA2BpB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,OAAO,CAAC,KAAK;IAOb;;OAEG;IACH,IAAI,IAAI,IAAI,CAGX;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"}
|