@herjarsa/omo-meta-governor 0.37.2 → 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.
- package/dist/agent-notifications.d.ts +51 -0
- package/dist/config.d.ts +57 -7
- package/dist/error-handler.d.ts +15 -0
- package/dist/generate-schema.d.ts +7 -4
- package/dist/index.js +57 -56
- package/dist/index.js.map +8 -6
- package/dist/lib.js +65 -64
- package/dist/lib.js.map +9 -7
- package/dist/mcp-server.js +105 -105
- package/dist/mcp-server.js.map +6 -6
- package/dist/plugin.d.ts +9 -0
- package/dist/skill-priming.d.ts +26 -1
- package/dist/skills/chore.tar.gz +0 -0
- package/package.json +55 -58
|
@@ -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
|
+
};
|
package/dist/config.d.ts
CHANGED
|
@@ -57,17 +57,33 @@ export interface MetaGovernorPluginConfig {
|
|
|
57
57
|
modelOverride?: ModelOverrideConfig;
|
|
58
58
|
/** Intervention config for visible decision injection. */
|
|
59
59
|
intervention?: {
|
|
60
|
+
/** @default "silent" */
|
|
60
61
|
mode?: "silent" | "message" | "system";
|
|
62
|
+
/** @default true */
|
|
61
63
|
includeDecisionHistory?: boolean;
|
|
64
|
+
/** @default 5 */
|
|
62
65
|
maxHistoryMessages?: number;
|
|
66
|
+
/** @default "stop" */
|
|
63
67
|
minActionForMessage?: "warn" | "escalate" | "stop";
|
|
64
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* v0.10.0: rate-limit interventions to break instruction loops.
|
|
70
|
+
* @default 3
|
|
71
|
+
*/
|
|
65
72
|
maxInterventionsPerSession?: number;
|
|
66
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* v0.10.0: stop injecting after <promise>DONE</promise> + Oracle verified.
|
|
75
|
+
* @default true
|
|
76
|
+
*/
|
|
67
77
|
respectDoneSignal?: boolean;
|
|
68
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* v0.15.0: split per-phase hint from terminal signal. See types.ts.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
69
82
|
phaseAwareDoneSignal?: boolean;
|
|
70
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* v0.19.0: persist intervention messages to the session (TUI-visible).
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
71
87
|
persistToSession?: boolean;
|
|
72
88
|
/**
|
|
73
89
|
* v0.31.1: overflow compaction loop guard. Defends against opencode
|
|
@@ -80,7 +96,9 @@ export interface MetaGovernorPluginConfig {
|
|
|
80
96
|
* explicitly if they relied on the previous OFF default.
|
|
81
97
|
*/
|
|
82
98
|
compactionLoopGuard?: {
|
|
99
|
+
/** @default true */
|
|
83
100
|
enabled?: boolean;
|
|
101
|
+
/** @default 1 */
|
|
84
102
|
maxOverflowRecoveries?: number;
|
|
85
103
|
};
|
|
86
104
|
};
|
|
@@ -93,29 +111,44 @@ export interface MetaGovernorPluginConfig {
|
|
|
93
111
|
};
|
|
94
112
|
/** Graph sync config for auto-initializing codegraph/graphify. */
|
|
95
113
|
graphSync?: {
|
|
114
|
+
/** @default true */
|
|
96
115
|
enabled?: boolean;
|
|
116
|
+
/** @default false */
|
|
97
117
|
watch?: boolean;
|
|
118
|
+
/** @default true */
|
|
98
119
|
autoInstall?: boolean;
|
|
120
|
+
/** @default 120000 */
|
|
99
121
|
installTimeoutMs?: number;
|
|
100
122
|
/** v0.22.0: when true, graph-sync init sweeps orphaned graphify/codegraph
|
|
123
|
+
* @default true
|
|
101
124
|
* processes left by previous crashed runs. Default true. */
|
|
102
125
|
killOrphanedOnInit?: boolean;
|
|
103
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* v0.25.1: on plugin load, fetch origin and reindex if local HEAD is behind.
|
|
128
|
+
* @default true
|
|
129
|
+
*/
|
|
104
130
|
reindexOnFetch?: boolean;
|
|
105
|
-
/**
|
|
131
|
+
/**
|
|
132
|
+
* v0.25.1: branch to fetch + compare against.
|
|
133
|
+
* @default "main"
|
|
134
|
+
*/
|
|
106
135
|
fetchBranch?: string;
|
|
107
136
|
/** v0.26.0: auto-upgrade installed codegraph and graphify binaries on graph-sync init.
|
|
137
|
+
* @default true
|
|
108
138
|
* Default true. Tiered probe + pip --upgrade flag fixes 6 silent-failure bugs from v0.24.x. */
|
|
109
139
|
autoUpgrade?: boolean;
|
|
110
140
|
/** v0.26.0: filesystem path for the upgrade cache file (tracks latest-known
|
|
141
|
+
* @default "~/.omo-meta-governor/upgrade-cache.json"
|
|
111
142
|
* codegraph/graphify versions to avoid re-fetching the npm/PyPI registry on every load). */
|
|
112
143
|
upgradeCachePath?: string;
|
|
113
144
|
/** v0.26.0: when true, run 'graphify check-update' after upgrade and emit a
|
|
114
145
|
* 'graphify-reextract-triggered' diagnostic code if the schema changed.
|
|
146
|
+
* @default true
|
|
115
147
|
* Default true. */
|
|
116
148
|
checkGraphifyNeedsUpdate?: boolean;
|
|
117
149
|
/** v0.27.0: when true, register the project graph in the global graphify
|
|
118
150
|
* registry after initial install (so 'graphify global list' surfaces it).
|
|
151
|
+
* @default false
|
|
119
152
|
* Default false (opt-in — multi-project users want explicit control). */
|
|
120
153
|
addToGlobalGraph?: boolean;
|
|
121
154
|
};
|
|
@@ -123,26 +156,37 @@ export interface MetaGovernorPluginConfig {
|
|
|
123
156
|
* When enabled, the plugin ensures `cli-anything-hub` (pip) and
|
|
124
157
|
* `cli-hub-meta-skill` (npx skills) are installed and current. */
|
|
125
158
|
cliAnything?: {
|
|
159
|
+
/** @default false */
|
|
126
160
|
enabled?: boolean;
|
|
161
|
+
/** @default true */
|
|
127
162
|
autoInstall?: boolean;
|
|
163
|
+
/** @default true */
|
|
128
164
|
autoUpgrade?: boolean;
|
|
129
165
|
cachePath?: string;
|
|
166
|
+
/** @default 86400000 */
|
|
130
167
|
upgradeCheckTtlMs?: number;
|
|
131
168
|
cliHubBin?: string;
|
|
132
169
|
skillsBin?: string;
|
|
170
|
+
/** @default "global" */
|
|
133
171
|
installScope?: "global" | "project";
|
|
134
172
|
};
|
|
135
173
|
/** Skill priming config (v0.20.0): proactive skill-selection nudge. */
|
|
136
174
|
skillPriming?: {
|
|
175
|
+
/** @default false */
|
|
137
176
|
enabled?: boolean;
|
|
177
|
+
/** @default "firstImplement" */
|
|
138
178
|
trigger?: SkillPrimingTrigger;
|
|
179
|
+
/** @default "both" */
|
|
139
180
|
router?: SkillPrimingRouter;
|
|
140
181
|
/** v0.34.0: enforcement mode for the skill-priming directive. */
|
|
182
|
+
/** @default "directive" */
|
|
141
183
|
enforceMode?: "directive" | "block";
|
|
142
184
|
};
|
|
143
185
|
/** Skill hub config (v0.32.0): registry-backed catalog + hybrid search. */
|
|
144
186
|
skillHub?: {
|
|
187
|
+
/** @default true */
|
|
145
188
|
enabled?: boolean;
|
|
189
|
+
/** @default 3600000 */
|
|
146
190
|
syncIntervalMs?: number;
|
|
147
191
|
bootstrapUrl?: string;
|
|
148
192
|
searchFallbackUrl?: string;
|
|
@@ -153,7 +197,10 @@ export interface MetaGovernorPluginConfig {
|
|
|
153
197
|
filterDuplicates?: boolean;
|
|
154
198
|
depsCheck?: boolean;
|
|
155
199
|
choreDir?: string;
|
|
156
|
-
/**
|
|
200
|
+
/**
|
|
201
|
+
* v0.35.0: write fetched hub skills to <cwd>/.agents/skills/<slug>/SKILL.md.
|
|
202
|
+
* @default true
|
|
203
|
+
*/
|
|
157
204
|
autoMaterialize?: boolean;
|
|
158
205
|
};
|
|
159
206
|
/** Post-wave workflow gate (v0.21.0): landing directives after Oracle-approved waves. */
|
|
@@ -163,12 +210,15 @@ export interface MetaGovernorPluginConfig {
|
|
|
163
210
|
* "auto" (default) | "codegraph" | "graphify" | "alternate".
|
|
164
211
|
*/
|
|
165
212
|
graphRetrieval?: {
|
|
213
|
+
/** @default "auto" */
|
|
166
214
|
preferredTool?: "auto" | "codegraph" | "graphify" | "alternate";
|
|
167
215
|
/** v0.27.0: when true, prefer the locally-installed codegraph binary
|
|
216
|
+
* @default false
|
|
168
217
|
* (node_modules/.bin/codegraph) over the npx-resolved one. Default false. */
|
|
169
218
|
preferLocalCodegraph?: boolean;
|
|
170
219
|
/** v0.27.0: route omo_search queries to codegraph `context` instead of
|
|
171
220
|
* `explore`. Default false. context returns a focused code window; explore
|
|
221
|
+
* @default false
|
|
172
222
|
* returns a conceptual explanation. */
|
|
173
223
|
contextRouting?: boolean;
|
|
174
224
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Logger {
|
|
2
|
+
warn?: (msg: string, ctx?: unknown) => void;
|
|
3
|
+
error?: (msg: string, ctx?: unknown) => void;
|
|
4
|
+
info?: (msg: string, ctx?: unknown) => void;
|
|
5
|
+
debug?: (msg: string, ctx?: unknown) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_PATH_PATTERNS: RegExp[];
|
|
8
|
+
export declare const DEFAULT_ERROR_CODES: Set<string>;
|
|
9
|
+
export interface ErrorHandlerOptions {
|
|
10
|
+
logger?: Logger;
|
|
11
|
+
paths?: RegExp[];
|
|
12
|
+
errorCodes?: Set<string>;
|
|
13
|
+
}
|
|
14
|
+
export declare function installGlobalErrorHandler(opts?: ErrorHandlerOptions): () => void;
|
|
15
|
+
export {};
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* interface definition. The schema is used for IDE autocompletion and
|
|
6
6
|
* validation when editing the .jsonc config file.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Single source of truth for the schema shape. The committed asset at
|
|
9
|
+
* assets/omo-meta-governor.schema.json is regenerated from this file via
|
|
10
|
+
* `bun build.ts` (which calls writeSchemaFile) and pinned by
|
|
11
|
+
* src/generate-schema-sync.test.ts to prevent silent drift.
|
|
12
12
|
*/
|
|
13
13
|
export interface JsonSchema {
|
|
14
14
|
$schema: string;
|
|
@@ -37,6 +37,9 @@ export interface JsonSchemaProperty {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Generate the full JSON Schema for the omo-meta-governor.jsonc config file.
|
|
40
|
+
*
|
|
41
|
+
* Shape MUST mirror src/config.ts (MetaGovernorPluginConfig + loadOrchestratorConfig).
|
|
42
|
+
* Any drift is caught by src/generate-schema-sync.test.ts (committed-asset sync).
|
|
40
43
|
*/
|
|
41
44
|
export declare function generateSchema(): JsonSchema;
|
|
42
45
|
/**
|