@muzi3/herdr 0.3.2 → 0.3.3
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.
|
@@ -381,6 +381,7 @@ export function registerBlockedReporting(pi) {
|
|
|
381
381
|
let raised = false;
|
|
382
382
|
let raisedLabel: string | undefined;
|
|
383
383
|
let askUser: { header?: string; question?: string } | undefined;
|
|
384
|
+
let turnActive = false;
|
|
384
385
|
|
|
385
386
|
function lower(): void {
|
|
386
387
|
if (!raised) return;
|
|
@@ -404,6 +405,10 @@ export function registerBlockedReporting(pi) {
|
|
|
404
405
|
|
|
405
406
|
pi.on("ui_prompt_start", (event) => {
|
|
406
407
|
if (!rootSession) return;
|
|
408
|
+
// 只有回合内的弹窗才意味着「agent 卡住等人回话」。回合外的 custom 多半是装饰性
|
|
409
|
+
// overlay(例如 prompt-nav 在每个 session_start 挂的非捕获导航条),用户不需要回答;
|
|
410
|
+
// 把它当 blocked 会让 pane 一开机就永久红点。
|
|
411
|
+
if (!turnActive) return;
|
|
407
412
|
// custom 提示(ask_user_question 走这条)的 title 是空的,用问题内容补 label。
|
|
408
413
|
raise(event.kind === "custom" ? (askUser?.header ?? askUser?.question) : event.title);
|
|
409
414
|
});
|
|
@@ -419,14 +424,28 @@ export function registerBlockedReporting(pi) {
|
|
|
419
424
|
// reload 会同时重载集成与本扩展,两侧计数一起归零。
|
|
420
425
|
if (ctx?.mode !== "tui") return;
|
|
421
426
|
rootSession = true;
|
|
422
|
-
|
|
423
|
-
|
|
427
|
+
turnActive = ctx?.isIdle?.() === false;
|
|
428
|
+
// 上一会话遗留的 raise 必须先显式降掉:官方段落只认计数,直接清 raised 会把
|
|
429
|
+
// blockedCount 永久留在 1,之后所有状态都被 blocked 压住(重启/换会话也治不好)。
|
|
430
|
+
lower();
|
|
424
431
|
askUser = undefined;
|
|
425
432
|
});
|
|
426
433
|
|
|
434
|
+
pi.on("agent_start", () => {
|
|
435
|
+
turnActive = true;
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
pi.on("agent_settled", () => {
|
|
439
|
+
turnActive = false;
|
|
440
|
+
// 等人回答时回合不会 settle,所以回合结束就不会有真问题待答;顺手清掉漏掉的 raise,
|
|
441
|
+
// 避免 pane 在回合结束后继续顶着红点。
|
|
442
|
+
lower();
|
|
443
|
+
});
|
|
444
|
+
|
|
427
445
|
pi.on("session_shutdown", () => {
|
|
428
446
|
lower();
|
|
429
447
|
rootSession = false;
|
|
448
|
+
turnActive = false;
|
|
430
449
|
askUser = undefined;
|
|
431
450
|
});
|
|
432
451
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muzi3/herdr",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Herdr for pi: three independent extensions (agent + blocked state reporting, /pi-hot-restart, and the herdr_overview / herdr_read / herdr_wait / herdr_prompt / herdr_run / herdr_create / herdr_agent_start / herdr_close manager tools aligned with dsh's herdr-tools plugin) plus the herdr-guide skill.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|