pi-harness-runtime 1.1.184 → 1.1.185
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/CHANGELOG.md +7 -0
- package/harness/glm-quota-countdown.ts +9 -1
- package/harness/honcho-init.ts +745 -0
- package/harness/honcho-memory.ts +290 -97
- package/harness/service-commands.ts +28 -3
- package/index.ts +191 -63
- 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/adapters/telegram-adapter.d.ts +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.d.ts.map +1 -1
- package/packages/notification/dist/adapters/telegram-adapter.js +34 -21
- package/packages/notification/dist/adapters/telegram-adapter.js.map +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/adapters/telegram-adapter.ts +37 -21
- 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
|
@@ -158,18 +158,87 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
158
158
|
let autoContinueTimer: NodeJS.Timeout | null = null;
|
|
159
159
|
let _inferenceInProgress = false; // Track for overlap prevention
|
|
160
160
|
let _sessionId = Date.now().toString(36); // Track session for cancellation
|
|
161
|
+
let _lastNotifiedQuestion = ""; // Track last question to prevent repeat notifications
|
|
162
|
+
|
|
163
|
+
// UI status for auto-continue (captured from session_start ctx)
|
|
164
|
+
let _setAutoContinueStatus: ((text: string | undefined) => void) | null = null;
|
|
165
|
+
let _currentAutoContinueState = ""; // Track current state for deduplication
|
|
166
|
+
|
|
167
|
+
// Auto-continue state labels
|
|
168
|
+
const AC_STATE = {
|
|
169
|
+
IDLE: "",
|
|
170
|
+
WAITING: "WAIT",
|
|
171
|
+
CHECKING: "CHECK",
|
|
172
|
+
CONTINUING: "RUN",
|
|
173
|
+
ERROR: "WARN",
|
|
174
|
+
} as const;
|
|
175
|
+
|
|
176
|
+
// Status message for each state
|
|
177
|
+
const AC_STATE_MESSAGES = {
|
|
178
|
+
IDLE: "",
|
|
179
|
+
WAITING: "Awaiting your response",
|
|
180
|
+
CHECKING: "Evaluating continuation",
|
|
181
|
+
CONTINUING: "Continuing autonomously",
|
|
182
|
+
ERROR: "Auto-continue unavailable",
|
|
183
|
+
} as const;
|
|
184
|
+
|
|
185
|
+
// Update auto-continue status in TUI footer
|
|
186
|
+
function updateAutoContinueStatus(state: keyof typeof AC_STATE_MESSAGES, requestId?: string): void {
|
|
187
|
+
if (!_setAutoContinueStatus) return;
|
|
188
|
+
|
|
189
|
+
const message = AC_STATE_MESSAGES[state];
|
|
190
|
+
if (state === "IDLE") {
|
|
191
|
+
// Clear status
|
|
192
|
+
_setAutoContinueStatus(undefined);
|
|
193
|
+
_currentAutoContinueState = "";
|
|
194
|
+
} else {
|
|
195
|
+
const statusText = requestId
|
|
196
|
+
? `[${AC_STATE[state]}] ${message} | ${requestId}`
|
|
197
|
+
: `[${AC_STATE[state]}] ${message}`;
|
|
198
|
+
|
|
199
|
+
// Only update if state changed (prevent flicker)
|
|
200
|
+
if (statusText !== _currentAutoContinueState) {
|
|
201
|
+
_setAutoContinueStatus(statusText);
|
|
202
|
+
_currentAutoContinueState = statusText;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
161
206
|
|
|
162
|
-
//
|
|
163
|
-
pi.on("
|
|
164
|
-
|
|
165
|
-
|
|
207
|
+
// Capture UI context from session_start
|
|
208
|
+
pi.on("session_start", (_event, ctx) => {
|
|
209
|
+
if (ctx.hasUI && ctx.ui) {
|
|
210
|
+
_setAutoContinueStatus = ctx.ui.setStatus.bind(ctx.ui, "harness-auto-continue");
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// Clear status and cancel background work on session shutdown
|
|
215
|
+
pi.on("session_shutdown", () => {
|
|
216
|
+
// Cancel the auto-continue interval
|
|
217
|
+
if (autoContinueTimer) {
|
|
218
|
+
clearInterval(autoContinueTimer);
|
|
219
|
+
autoContinueTimer = null;
|
|
220
|
+
}
|
|
166
221
|
|
|
167
|
-
//
|
|
222
|
+
// Clear UI binding and status
|
|
223
|
+
if (_setAutoContinueStatus) {
|
|
224
|
+
_setAutoContinueStatus(undefined);
|
|
225
|
+
_setAutoContinueStatus = null;
|
|
226
|
+
}
|
|
227
|
+
_currentAutoContinueState = "";
|
|
228
|
+
|
|
229
|
+
// Reset state
|
|
230
|
+
waitingForUserSince = null;
|
|
231
|
+
_lastNotifiedQuestion = "";
|
|
232
|
+
_inferenceInProgress = false;
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
// Extract assistant message text and detect actual confirmation requests
|
|
236
|
+
function extractAssistantText(msg: { role?: string; content?: string | Array<{ type?: string; text?: string }> } | undefined): string {
|
|
237
|
+
if (!msg) return "";
|
|
168
238
|
let content = "";
|
|
169
239
|
if (typeof msg.content === "string") {
|
|
170
240
|
content = msg.content;
|
|
171
241
|
} else if (Array.isArray(msg.content)) {
|
|
172
|
-
// Extract text from TextContent blocks only; ignore thinking/tool calls
|
|
173
242
|
content = msg.content
|
|
174
243
|
.filter((block): block is { type: "text"; text: string } =>
|
|
175
244
|
block.type === "text" && typeof block.text === "string"
|
|
@@ -177,15 +246,65 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
177
246
|
.map(block => block.text)
|
|
178
247
|
.join("\n");
|
|
179
248
|
}
|
|
180
|
-
|
|
249
|
+
return content;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Detect actual confirmation requests (questions, not progress statements)
|
|
253
|
+
// Must be a question ending with ? AND contain both a request word AND user intent
|
|
254
|
+
function detectConfirmationRequest(text: string): string | null {
|
|
255
|
+
// Find questions ending with ? and check each
|
|
256
|
+
// Use regex to match question sentences (ending with ?)
|
|
257
|
+
const questionPattern = /([^?]*\?)/g;
|
|
258
|
+
const matches = text.matchAll(questionPattern);
|
|
259
|
+
|
|
260
|
+
for (const match of matches) {
|
|
261
|
+
const sentence = match[1].trim();
|
|
262
|
+
const lower = sentence.toLowerCase();
|
|
263
|
+
|
|
264
|
+
// Must contain request words AND user intent words
|
|
265
|
+
const hasRequest = /\b(continue|proceed|next|wait|pause|stop|hold|resume|repeat|rephrase|clarify|explain)\b/i.test(lower);
|
|
266
|
+
const hasUserIntent = /\b(should|would|could|shall|may i|do you|would you|should i|could we|can i|can we|would like)\b/i.test(lower);
|
|
267
|
+
|
|
268
|
+
if (hasRequest && hasUserIntent) {
|
|
269
|
+
// Return the question for deduplication (with the ? preserved)
|
|
270
|
+
return sentence;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
181
273
|
|
|
182
|
-
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Detect when agent asks for continuation
|
|
278
|
+
pi.on("message_end", async (event) => {
|
|
279
|
+
const msg = event.message as { role?: string; content?: string | Array<{ type?: string; text?: string }> } | undefined;
|
|
280
|
+
if (!msg || msg.role !== "assistant") return;
|
|
281
|
+
|
|
282
|
+
const content = extractAssistantText(msg);
|
|
283
|
+
const detectedQuestion = detectConfirmationRequest(content);
|
|
284
|
+
|
|
285
|
+
// Only trigger if: we found a question AND it's different from last notification
|
|
286
|
+
if (detectedQuestion && detectedQuestion !== _lastNotifiedQuestion && !waitingForUserSince) {
|
|
287
|
+
_lastNotifiedQuestion = detectedQuestion;
|
|
183
288
|
waitingForUserSince = new Date();
|
|
184
|
-
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
289
|
+
|
|
290
|
+
// Create stable jobId from question content hash (callback-safe: digits only)
|
|
291
|
+
const questionHash = Math.abs(
|
|
292
|
+
detectedQuestion.split("").reduce((a, c) => {
|
|
293
|
+
a = ((a << 5) - a) + c.charCodeAt(0);
|
|
294
|
+
return a & a;
|
|
295
|
+
}, 0)
|
|
296
|
+
).toString(36);
|
|
297
|
+
|
|
298
|
+
// Update TUI status - use short ID for display
|
|
299
|
+
updateAutoContinueStatus("WAITING", questionHash);
|
|
300
|
+
|
|
301
|
+
// Emit WaitingForUserInput to Telegram with Yes/No buttons
|
|
302
|
+
_nc?.notifyWithApproval("WaitingForUserInput", {
|
|
303
|
+
jobId: `waiting-user-${questionHash}`,
|
|
304
|
+
requirement: detectedQuestion,
|
|
305
|
+
}, {
|
|
306
|
+
approveLabel: "Continue",
|
|
307
|
+
rejectLabel: "Not yet",
|
|
189
308
|
});
|
|
190
309
|
}
|
|
191
310
|
});
|
|
@@ -196,8 +315,9 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
196
315
|
if (msg?.role === "user") {
|
|
197
316
|
lastUserMessage = new Date();
|
|
198
317
|
if (waitingForUserSince) {
|
|
199
|
-
console.log("[auto-continue] User responded, cancelling wait");
|
|
200
318
|
waitingForUserSince = null;
|
|
319
|
+
_lastNotifiedQuestion = "";
|
|
320
|
+
updateAutoContinueStatus("IDLE");
|
|
201
321
|
}
|
|
202
322
|
}
|
|
203
323
|
});
|
|
@@ -209,7 +329,6 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
209
329
|
const checkAndAutoContinue = async () => {
|
|
210
330
|
// Prevent overlap if inference is already in progress
|
|
211
331
|
if (_inferenceInProgress) {
|
|
212
|
-
console.log("[auto-continue] Inference in progress, skipping this check");
|
|
213
332
|
return;
|
|
214
333
|
}
|
|
215
334
|
|
|
@@ -217,11 +336,19 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
217
336
|
|
|
218
337
|
// Capture session ID at check time for post-inference validation
|
|
219
338
|
const checkSessionId = _sessionId;
|
|
339
|
+
// Use same hash algorithm as detection
|
|
340
|
+
const questionHash = _lastNotifiedQuestion
|
|
341
|
+
? Math.abs(_lastNotifiedQuestion.split("").reduce((a, c) => {
|
|
342
|
+
a = ((a << 5) - a) + c.charCodeAt(0);
|
|
343
|
+
return a & a;
|
|
344
|
+
}, 0)).toString(36)
|
|
345
|
+
: "";
|
|
220
346
|
|
|
221
347
|
const waitMinutes = (Date.now() - waitingForUserSince.getTime()) / 60000;
|
|
222
348
|
if (waitMinutes < MIN_WAIT_MINUTES) return;
|
|
223
349
|
|
|
224
|
-
|
|
350
|
+
// Update status to checking
|
|
351
|
+
updateAutoContinueStatus("CHECKING", questionHash);
|
|
225
352
|
|
|
226
353
|
try {
|
|
227
354
|
// Mark inference as in progress to prevent overlap
|
|
@@ -238,7 +365,6 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
238
365
|
|
|
239
366
|
// Guard against empty task list
|
|
240
367
|
if (taskContext.total === 0) {
|
|
241
|
-
console.log("[auto-continue] No tasks to decide on — skipping");
|
|
242
368
|
_inferenceInProgress = false;
|
|
243
369
|
return;
|
|
244
370
|
}
|
|
@@ -254,49 +380,47 @@ async function initAutoContinue(pi: ExtensionAPI): Promise<void> {
|
|
|
254
380
|
|
|
255
381
|
// Check session validity and user response before applying
|
|
256
382
|
if (checkSessionId !== _sessionId) {
|
|
257
|
-
console.log("[auto-continue] Session changed during inference — cancelling");
|
|
258
383
|
_inferenceInProgress = false;
|
|
384
|
+
updateAutoContinueStatus("IDLE");
|
|
259
385
|
return;
|
|
260
386
|
}
|
|
261
387
|
|
|
262
388
|
if (!waitingForUserSince) {
|
|
263
|
-
console.log("[auto-continue] User responded during inference — cancelling");
|
|
264
389
|
_inferenceInProgress = false;
|
|
390
|
+
updateAutoContinueStatus("IDLE");
|
|
265
391
|
return;
|
|
266
392
|
}
|
|
267
393
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
394
|
+
if (decision.action === "proceed" || decision.action === "proceed_with_caution") {
|
|
395
|
+
// Update status to continuing
|
|
396
|
+
updateAutoContinueStatus("CONTINUING", questionHash);
|
|
271
397
|
|
|
272
|
-
if (decision.action === "proceed") {
|
|
273
398
|
// Send steer message to continue
|
|
274
399
|
pi.sendUserMessage(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
pi.sendUserMessage(
|
|
283
|
-
"User is unavailable. Proceeding with caution - will log each significant step.\n" +
|
|
284
|
-
`Risk level: ${decision.riskLevel}\n` +
|
|
285
|
-
"Continue with remaining tasks, reporting progress.",
|
|
400
|
+
decision.action === "proceed"
|
|
401
|
+
? "User is unavailable. Based on task progress and low risk, proceeding autonomously.\n" +
|
|
402
|
+
`Decision: ${decision.reasoning}\n` +
|
|
403
|
+
"Continue with remaining tasks."
|
|
404
|
+
: "User is unavailable. Proceeding with caution - will log each significant step.\n" +
|
|
405
|
+
`Risk level: ${decision.riskLevel}\n` +
|
|
406
|
+
"Continue with remaining tasks, reporting progress.",
|
|
286
407
|
{ deliverAs: "steer" },
|
|
287
408
|
);
|
|
288
409
|
waitingForUserSince = null;
|
|
410
|
+
_lastNotifiedQuestion = "";
|
|
411
|
+
|
|
412
|
+
// Clear status after short delay
|
|
413
|
+
setTimeout(() => updateAutoContinueStatus("IDLE"), 2000);
|
|
289
414
|
}
|
|
290
|
-
|
|
291
|
-
} catch
|
|
292
|
-
|
|
415
|
+
_inferenceInProgress = false;
|
|
416
|
+
} catch {
|
|
417
|
+
_inferenceInProgress = false;
|
|
418
|
+
updateAutoContinueStatus("ERROR");
|
|
293
419
|
}
|
|
294
420
|
};
|
|
295
421
|
|
|
296
422
|
// Start periodic check
|
|
297
423
|
autoContinueTimer = setInterval(checkAndAutoContinue, AUTO_CONTINUE_INTERVAL_MS);
|
|
298
|
-
|
|
299
|
-
console.error("[auto-continue] Jev Auto-Continue initialized");
|
|
300
424
|
} catch {
|
|
301
425
|
// auto-continue not available
|
|
302
426
|
}
|
|
@@ -403,6 +527,11 @@ async function initTelegram(): Promise<void> {
|
|
|
403
527
|
center,
|
|
404
528
|
notify: (event: string, ctx: Record<string, unknown>) =>
|
|
405
529
|
center.notify(event as never, ctx as never),
|
|
530
|
+
notifyWithApproval: (
|
|
531
|
+
event: string,
|
|
532
|
+
ctx: Record<string, unknown>,
|
|
533
|
+
options?: { approveLabel?: string; rejectLabel?: string },
|
|
534
|
+
) => center.notifyWithApproval(event as never, ctx as never, options as never),
|
|
406
535
|
};
|
|
407
536
|
|
|
408
537
|
// Wire to GLMQuotaCountdown so it sends Telegram alerts
|
|
@@ -430,13 +559,11 @@ async function initTelegram(): Promise<void> {
|
|
|
430
559
|
// - Deduplication by message ID
|
|
431
560
|
// - Bounded context injection with provenance
|
|
432
561
|
|
|
433
|
-
/** Module-level Honcho memory instance */
|
|
434
|
-
let _honchoMemory: import("./harness/honcho-memory.js").HonchoMemory | null = null;
|
|
435
|
-
|
|
436
562
|
async function initHoncho(pi: ExtensionAPI): Promise<void> {
|
|
437
|
-
// Import
|
|
438
|
-
await import("./harness/honcho-
|
|
563
|
+
// Import new Honcho integration module
|
|
564
|
+
const { initHoncho: honchoInit, registerHonchoLifecycle } = await import("./harness/honcho-init.js");
|
|
439
565
|
|
|
566
|
+
// Check for API key
|
|
440
567
|
const { readFileSync, existsSync } = await import("node:fs");
|
|
441
568
|
const home = process.env.HOME || process.env.USERPROFILE || "/home/frappe";
|
|
442
569
|
const keyPath = `${home}/.pi-harness-runtime/keys/honcho-api-key.txt`;
|
|
@@ -455,26 +582,19 @@ async function initHoncho(pi: ExtensionAPI): Promise<void> {
|
|
|
455
582
|
}
|
|
456
583
|
|
|
457
584
|
try {
|
|
458
|
-
// Register
|
|
459
|
-
pi.on
|
|
460
|
-
|
|
461
|
-
version: 1 as const,
|
|
462
|
-
name: "honcho",
|
|
463
|
-
definition: {
|
|
464
|
-
url: "https://mcp.honcho.dev",
|
|
465
|
-
auth: "bearer" as const,
|
|
466
|
-
bearerToken: apiKey,
|
|
467
|
-
},
|
|
468
|
-
};
|
|
585
|
+
// Register lifecycle hooks using the new integration
|
|
586
|
+
// SAFETY: pi.on accepts these event names at runtime
|
|
587
|
+
registerHonchoLifecycle(pi as unknown as { on: (event: string, handler: (...args: unknown[]) => void | Promise<void>) => void });
|
|
469
588
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
console.log("[honcho] MCP registration emitted (awaiting adapter ack)");
|
|
474
|
-
});
|
|
589
|
+
// Initialize Honcho with the API key and pi.events
|
|
590
|
+
// SAFETY: pi.events implements the required on/emit interface
|
|
591
|
+
const result = await honchoInit({ apiKey, piEvents: pi.events });
|
|
475
592
|
|
|
476
|
-
|
|
477
|
-
|
|
593
|
+
if (result) {
|
|
594
|
+
logStartup("[pi-harness] Honcho integration ready");
|
|
595
|
+
} else {
|
|
596
|
+
logStartup("[pi-harness] Honcho: initialization returned null");
|
|
597
|
+
}
|
|
478
598
|
} catch (err) {
|
|
479
599
|
logStartup("[pi-harness] Honcho: init failed:", err instanceof Error ? err.message : String(err));
|
|
480
600
|
}
|
|
@@ -1023,7 +1143,15 @@ interface HarnessSession {
|
|
|
1023
1143
|
let currentSession: HarnessSession | null = null;
|
|
1024
1144
|
|
|
1025
1145
|
/** Singleton notification center — set by initTelegram(), used by all emit helpers */
|
|
1026
|
-
let _nc: {
|
|
1146
|
+
let _nc: {
|
|
1147
|
+
center: unknown;
|
|
1148
|
+
notify: (event: string, ctx: Record<string, unknown>) => Promise<unknown>;
|
|
1149
|
+
notifyWithApproval: (
|
|
1150
|
+
event: string,
|
|
1151
|
+
ctx: Record<string, unknown>,
|
|
1152
|
+
options?: { approveLabel?: string; rejectLabel?: string },
|
|
1153
|
+
) => Promise<unknown>;
|
|
1154
|
+
} | null = null;
|
|
1027
1155
|
|
|
1028
1156
|
/**
|
|
1029
1157
|
* Fire a Telegram notification event. Silently skips if Telegram is not configured.
|
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.185",
|
|
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",
|