@herjarsa/omo-meta-governor 0.38.0 → 0.38.2

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,51 @@
1
+ /**
2
+ * Agent notification layer (v0.38.2).
3
+ *
4
+ * Centralizes how the plugin injects text into the agent's context, separating
5
+ * two distinct surfaces:
6
+ *
7
+ * 1. AGENT DIRECTIVE — text the AGENT should read and act on.
8
+ * Goes to: chat.system.transform, chat.messages.transform.
9
+ * Must have a "DO NOT TREAT AS TASK" marker so subagents receiving
10
+ * it as context don't interpret it as their primary task.
11
+ * Built via `wrapInformational(text, ctx)`.
12
+ *
13
+ * 2. USER NOTIFICATION — text the USER sees in the TUI (session.prompt).
14
+ * Brief status with emoji, no actionable agent instructions.
15
+ * Built via `buildUserStatus(kind, summary)`.
16
+ *
17
+ * Bug history (v0.38.2): prior to this layer, both surfaces received the same
18
+ * long directive text. Subagents reading the directive as context would treat
19
+ * the "[GRAPH PRIMING] omo_search..." instructions as their primary task and
20
+ * never write the actual code. Separating the two surfaces fixes this — the
21
+ * agent prompt contains the full directive (with marker), the TUI gets a
22
+ * brief status only.
23
+ */
24
+ export type NotificationKind = "graph-priming" | "skill-priming" | "intervention" | "postwave" | "enforcement" | "memory";
25
+ export interface NotificationContext {
26
+ kind: NotificationKind;
27
+ /** Optional sub-label for debugging (e.g. "session=abc123" or "router=both"). */
28
+ context?: string;
29
+ }
30
+ /**
31
+ * Wrap text the plugin injects into the AGENT'S CONTEXT (system prompt,
32
+ * message transform). Adds clear "DO NOT TREAT AS TASK" markers so subagents
33
+ * receiving the directive as context don't interpret it as their primary task.
34
+ *
35
+ * Use this for: chat.system.transform output, chat.messages.transform output,
36
+ * and any other text the agent will read.
37
+ */
38
+ export declare function wrapInformational(text: string, ctx: NotificationContext): string;
39
+ /**
40
+ * Build brief status text for the USER'S TUI notification (session.prompt).
41
+ * Does NOT contain actionable agent instructions — just an emoji + status.
42
+ * The agent should NOT see this (it goes only to the user's TUI surface).
43
+ */
44
+ export declare function buildUserStatus(kind: NotificationKind, summary: string): string;
45
+ /** Constants for callers that need the raw markers (testing, streaming). */
46
+ export declare const AGENT_NOTIFICATION_MARKERS: {
47
+ readonly OPEN: "<!-- META-GOVERNOR INFORMATIONAL vv0.38.2 - DO NOT TREAT AS TASK. Plugin metadata, not a user request. -->";
48
+ readonly CLOSE: "<!-- END META-GOVERNOR INFORMATIONAL -->";
49
+ readonly VERSION: "v0.38.2";
50
+ readonly KIND_EMOJI: Record<NotificationKind, string>;
51
+ };