@herjarsa/omo-meta-governor 0.24.0 → 0.24.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/config.d.ts +11 -2
- package/dist/graph-retrieval.d.ts +37 -3
- package/dist/graph-sync.d.ts +8 -6
- package/dist/index.js +74 -67
- package/dist/index.js.map +9 -9
- package/dist/lib.js +78 -71
- package/dist/lib.js.map +10 -10
- package/dist/types.d.ts +19 -11
- package/package.json +41 -41
- package/dist/tui-notify.d.ts +0 -12
package/dist/config.d.ts
CHANGED
|
@@ -69,8 +69,6 @@ export interface MetaGovernorPluginConfig {
|
|
|
69
69
|
phaseAwareDoneSignal?: boolean;
|
|
70
70
|
/** v0.19.0: persist intervention messages to the session (TUI-visible). */
|
|
71
71
|
persistToSession?: boolean;
|
|
72
|
-
/** v0.24.0: TUI toast notifications on intervention. Default true. */
|
|
73
|
-
toasts?: boolean;
|
|
74
72
|
};
|
|
75
73
|
/** Sisyphus protocol enforcement config. */
|
|
76
74
|
protocolEnforcement?: {
|
|
@@ -88,6 +86,10 @@ export interface MetaGovernorPluginConfig {
|
|
|
88
86
|
/** v0.22.0: when true, graph-sync init sweeps orphaned graphify/codegraph
|
|
89
87
|
* processes left by previous crashed runs. Default true. */
|
|
90
88
|
killOrphanedOnInit?: boolean;
|
|
89
|
+
/** v0.25.1: on plugin load, fetch origin and reindex if local HEAD is behind. Default true. */
|
|
90
|
+
reindexOnFetch?: boolean;
|
|
91
|
+
/** v0.25.1: branch to fetch + compare against. Default "main". */
|
|
92
|
+
fetchBranch?: string;
|
|
91
93
|
};
|
|
92
94
|
/** Skill priming config (v0.20.0): proactive skill-selection nudge. */
|
|
93
95
|
skillPriming?: {
|
|
@@ -97,6 +99,13 @@ export interface MetaGovernorPluginConfig {
|
|
|
97
99
|
};
|
|
98
100
|
/** Post-wave workflow gate (v0.21.0): landing directives after Oracle-approved waves. */
|
|
99
101
|
postWave?: PostWaveConfig;
|
|
102
|
+
/**
|
|
103
|
+
* v0.25.0: explicit routing between codegraph and graphify.
|
|
104
|
+
* "auto" (default) | "codegraph" | "graphify" | "alternate".
|
|
105
|
+
*/
|
|
106
|
+
graphRetrieval?: {
|
|
107
|
+
preferredTool?: "auto" | "codegraph" | "graphify" | "alternate";
|
|
108
|
+
};
|
|
100
109
|
}
|
|
101
110
|
/**
|
|
102
111
|
* Project the full MetaGovernorPluginConfig into OrchestratorConfig.
|
|
@@ -23,6 +23,24 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { existsSync } from "node:fs";
|
|
25
25
|
export type GraphToolKind = "codegraph" | "graphify" | null;
|
|
26
|
+
/**
|
|
27
|
+
* v0.25.0: explicit routing preference between codegraph and graphify.
|
|
28
|
+
* - "auto" (default): codegraph first, graphify as fallback.
|
|
29
|
+
* - "codegraph": always codegraph when available (never graphify).
|
|
30
|
+
* - "graphify": always graphify when available (never codegraph).
|
|
31
|
+
* - "alternate": deterministic per-query round-robin (hash parity).
|
|
32
|
+
*/
|
|
33
|
+
export type GraphToolPreference = "auto" | "codegraph" | "graphify" | "alternate";
|
|
34
|
+
/**
|
|
35
|
+
* v0.25.0: pure selection logic — pick which graph tool to invoke.
|
|
36
|
+
* Deterministic (same inputs → same choice), platform-independent,
|
|
37
|
+
* unit-testable without subprocesses.
|
|
38
|
+
*/
|
|
39
|
+
export declare function selectGraphTool(preference: GraphToolPreference, codegraphAvailable: boolean, graphifyAvailable: boolean, query?: string): {
|
|
40
|
+
kind: "codegraph" | "graphify";
|
|
41
|
+
cmd: string;
|
|
42
|
+
args: string[];
|
|
43
|
+
} | null;
|
|
26
44
|
export interface GraphInvocationResult {
|
|
27
45
|
/** Which tool was actually invoked. */
|
|
28
46
|
kind: GraphToolKind;
|
|
@@ -42,6 +60,8 @@ export interface GraphRetrievalConfig {
|
|
|
42
60
|
cacheTtlMs?: number;
|
|
43
61
|
/** Max cache entries per session. Default: 10. */
|
|
44
62
|
maxEntriesPerSession?: number;
|
|
63
|
+
/** v0.25.0: explicit codegraph/graphify routing. Default "auto". */
|
|
64
|
+
preferredTool?: GraphToolPreference;
|
|
45
65
|
}
|
|
46
66
|
export interface InvokeOptions {
|
|
47
67
|
/** Override codegraph CLI path (default: lookup in PATH). */
|
|
@@ -52,6 +72,8 @@ export interface InvokeOptions {
|
|
|
52
72
|
timeoutMs?: number;
|
|
53
73
|
/** v0.16.0: project working directory. Defaults to process.cwd(). */
|
|
54
74
|
projectDir?: string;
|
|
75
|
+
/** v0.25.0: per-call routing override. Default: instance preference. */
|
|
76
|
+
preferredTool?: GraphToolPreference;
|
|
55
77
|
}
|
|
56
78
|
/** Deterministic hash for a query string. Used as cache key suffix. */
|
|
57
79
|
export declare function hashQuery(query: string): string;
|
|
@@ -60,7 +82,11 @@ export declare class GraphRetrieval {
|
|
|
60
82
|
private readonly cacheTtlMs;
|
|
61
83
|
private readonly maxEntriesPerSession;
|
|
62
84
|
private readonly cache;
|
|
85
|
+
/** v0.25.0: routing preference. Mutable — configureDefaultGraphRetrieval updates it. */
|
|
86
|
+
private preferredTool;
|
|
63
87
|
constructor(config?: GraphRetrievalConfig);
|
|
88
|
+
/** v0.25.0: runtime routing update (used by configureDefaultGraphRetrieval). */
|
|
89
|
+
setPreferredTool(preference: GraphToolPreference): void;
|
|
64
90
|
/** Returns true if .codegraph/ exists in the project dir. */
|
|
65
91
|
hasCodegraphDir(projectDir: string): boolean;
|
|
66
92
|
/** Returns true if graphify-out/ exists in the project dir. */
|
|
@@ -83,9 +109,10 @@ export declare class GraphRetrieval {
|
|
|
83
109
|
* Invoke a graph tool for the given query. Returns structured result.
|
|
84
110
|
* Never throws — all errors are caught and returned as `result: null`.
|
|
85
111
|
*
|
|
86
|
-
* Selection logic:
|
|
87
|
-
*
|
|
88
|
-
*
|
|
112
|
+
* Selection logic (v0.25.0 — explicit routing via selectGraphTool):
|
|
113
|
+
* - preferredTool "auto": codegraph first, graphify fallback.
|
|
114
|
+
* - "codegraph" / "graphify": only that tool (when available).
|
|
115
|
+
* - "alternate": deterministic hash-parity round-robin when both exist.
|
|
89
116
|
* 3. Else → return null result
|
|
90
117
|
*/
|
|
91
118
|
invoke(projectDir: string, query: string, options?: InvokeOptions): Promise<GraphInvocationResult>;
|
|
@@ -132,4 +159,11 @@ export declare class GraphRetrieval {
|
|
|
132
159
|
}
|
|
133
160
|
/** Returns the process-wide singleton, creating it on first use. */
|
|
134
161
|
export declare function getDefaultGraphRetrieval(): GraphRetrieval;
|
|
162
|
+
/**
|
|
163
|
+
* v0.25.0: update the singleton's routing preference WITHOUT replacing the
|
|
164
|
+
* instance — tools capture the reference at build time (omo_search) or
|
|
165
|
+
* resolve it at execute time (omo_path/omo_explain); replacing would
|
|
166
|
+
* strand the captured instance.
|
|
167
|
+
*/
|
|
168
|
+
export declare function configureDefaultGraphRetrieval(config: GraphRetrievalConfig): void;
|
|
135
169
|
export { existsSync };
|
package/dist/graph-sync.d.ts
CHANGED
|
@@ -207,17 +207,13 @@ export declare function isCacheFresh(cache: UpgradeCache | null, ttlMs: number):
|
|
|
207
207
|
* - If installed >= effective-latest → false.
|
|
208
208
|
* - Otherwise → true.
|
|
209
209
|
*/
|
|
210
|
-
export declare function shouldUpgrade(installed: string | null | undefined, registryLatest: string | null | undefined, cache: UpgradeCache | null, ttlMs: number): boolean;
|
|
210
|
+
export declare function shouldUpgrade(installed: string | null | undefined, registryLatest: string | null | undefined, cache: UpgradeCache | null, ttlMs: number, latestField?: "codegraphLatest" | "graphifyLatest"): boolean;
|
|
211
211
|
/**
|
|
212
212
|
* v0.12.0: fetch the latest version of codegraph from npm registry.
|
|
213
213
|
* Returns null on failure (best-effort, never throws).
|
|
214
214
|
*/
|
|
215
215
|
export declare function fetchCodegraphLatestVersion(): Promise<string | null>;
|
|
216
|
-
|
|
217
|
-
* v0.12.0: fetch the latest version of graphify from pip.
|
|
218
|
-
* Returns null on failure (best-effort, never throws).
|
|
219
|
-
*/
|
|
220
|
-
export declare function fetchGraphifyLatestVersion(): Promise<string | null>;
|
|
216
|
+
export declare function fetchGraphifyLatestVersion(runner?: typeof execSync): Promise<string | null>;
|
|
221
217
|
/**
|
|
222
218
|
* v0.12.0: get the installed version of codegraph by running its CLI.
|
|
223
219
|
* Returns null on failure.
|
|
@@ -228,3 +224,9 @@ export declare function getInstalledCodegraphVersion(): Promise<string | null>;
|
|
|
228
224
|
* Returns null on failure.
|
|
229
225
|
*/
|
|
230
226
|
export declare function getInstalledGraphifyVersion(): Promise<string | null>;
|
|
227
|
+
/**
|
|
228
|
+
* v0.25.1: count commits the local HEAD is behind origin/<branch>.
|
|
229
|
+
* Best-effort, never throws — returns 0 on any failure (no git, offline, no remote).
|
|
230
|
+
* Used by the plugin-load watcher to decide whether to trigger a reindex.
|
|
231
|
+
*/
|
|
232
|
+
export declare function detectRemoteNewCommits(projectDir: string, branch: string | undefined, runner?: typeof execSync): number;
|