@xzzpig/pi-subagents 0.10.0 → 0.12.0

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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * pi-notify silent-span marker protocol.
3
+ *
4
+ * Dialogs that are NOT agent-waiting prompts (monitoring panels such as the
5
+ * fleet inspector, admin management dialogs) claim the next core
6
+ * `ui_prompt_start` span as silent, so pi-notify produces no notification
7
+ * and no Herdr wait entry for it. The event name is a literal on purpose:
8
+ * pi-notify may not be installed, in which case this emit is a harmless
9
+ * no-op and pi-subagents must not depend on the pi-notify package.
10
+ */
11
+ export const PI_NOTIFY_UI_SPAN_SILENT_EVENT = "pi-notify:ui_span_silent";
12
+
13
+ /** Minimal event bus accepted by `emitUiSpanSilent`. */
14
+ export interface UiSpanSilentEvents {
15
+ emit(event: string, data: unknown): void;
16
+ }
17
+
18
+ /**
19
+ * Observational emit: claims the next dialog span as silent. A missing or
20
+ * failing bus must never break the dialog flow.
21
+ */
22
+ export function emitUiSpanSilent(
23
+ events: UiSpanSilentEvents | undefined,
24
+ reason: string,
25
+ ): void {
26
+ if (!events) return;
27
+ try {
28
+ events.emit(PI_NOTIFY_UI_SPAN_SILENT_EVENT, { reason });
29
+ } catch {
30
+ // Observational only.
31
+ }
32
+ }