@herjarsa/omo-meta-governor 0.27.0 → 0.27.1
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/health.d.ts +41 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +4 -4
- package/dist/lib.js +3 -3
- package/dist/lib.js.map +4 -4
- package/package.json +1 -1
package/dist/health.d.ts
CHANGED
|
@@ -39,6 +39,47 @@ export interface PluginHealth {
|
|
|
39
39
|
firstSeenISO: string;
|
|
40
40
|
lastSeenISO: string;
|
|
41
41
|
};
|
|
42
|
+
graphSync?: {
|
|
43
|
+
lastUpgradeAtISO: string | null;
|
|
44
|
+
lastUpgradeResult: "success" | "failed" | "skipped" | "unknown";
|
|
45
|
+
lastUpgradeTarget: "codegraph" | "graphify" | null;
|
|
46
|
+
lastUpgradeMs: number | null;
|
|
47
|
+
};
|
|
48
|
+
graphToolsUsed: {
|
|
49
|
+
omo_search: number;
|
|
50
|
+
omo_recall: number;
|
|
51
|
+
omo_health: number;
|
|
52
|
+
omo_find: number;
|
|
53
|
+
omo_impact: number;
|
|
54
|
+
omo_remember: number;
|
|
55
|
+
omo_recall_mcp: number;
|
|
56
|
+
omo_path: number;
|
|
57
|
+
omo_explain: number;
|
|
58
|
+
omo_files: number;
|
|
59
|
+
omo_callers: number;
|
|
60
|
+
omo_node: number;
|
|
61
|
+
omo_context: number;
|
|
62
|
+
omo_affected_cg: number;
|
|
63
|
+
omo_status: number;
|
|
64
|
+
omo_unlock: number;
|
|
65
|
+
omo_mark_dirty: number;
|
|
66
|
+
omo_sync_if_dirty: number;
|
|
67
|
+
omo_index: number;
|
|
68
|
+
omo_visualize: number;
|
|
69
|
+
omo_serve: number;
|
|
70
|
+
omo_uninit: number;
|
|
71
|
+
omo_diagnose: number;
|
|
72
|
+
omo_merge_graphs: number;
|
|
73
|
+
omo_save_result: number;
|
|
74
|
+
omo_extract: number;
|
|
75
|
+
omo_cluster_only: number;
|
|
76
|
+
omo_label: number;
|
|
77
|
+
omo_tree: number;
|
|
78
|
+
omo_clone: number;
|
|
79
|
+
omo_add: number;
|
|
80
|
+
omo_check_update: number;
|
|
81
|
+
omo_hook_status: number;
|
|
82
|
+
};
|
|
42
83
|
}
|
|
43
84
|
/**
|
|
44
85
|
* Atomically write the health state to the given path. Writes to a
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ After the tool call, briefly confirm what you stored and for which tool.`};try{r
|
|
|
30
30
|
|
|
31
31
|
Please invoke the \`task\` tool with \`subagent_type=oracle\` to perform a verification pass on the current session state. Decision context: ${$.evidenceCount} evidence unit(s). After Oracle returns, you should continue with the recommended action.`;return`[MetaGovernor] Escalation to user required. Reason: ${$.reasoning}
|
|
32
32
|
|
|
33
|
-
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var zr,_k=0,R4=null;var c4=t$(()=>{zr=new MK});var kk=GO((vY,DK)=>{DK.exports={name:"@herjarsa/omo-meta-governor",version:"0.
|
|
33
|
+
Present a clear summary to the user with the deviation(s) detected and your recommended next steps. Wait for explicit user input before proceeding.`}var zr,_k=0,R4=null;var c4=t$(()=>{zr=new MK});var kk=GO((vY,DK)=>{DK.exports={name:"@herjarsa/omo-meta-governor",version:"0.27.0",type:"module",description:"Self-judging agent orchestration layer for OpenCode. Reads memory, scores sessions, dispatches decisions.",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./lib":{types:"./dist/lib.d.ts",import:"./dist/lib.js"}},types:"./dist/index.d.ts",main:"./dist/index.js",files:["dist","README.md"],scripts:{build:"bun build.ts",typecheck:"tsc --noEmit",test:"bun test"},peerDependencies:{"@opencode-ai/plugin":">=1.0.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},license:"MIT",repository:{type:"git",url:"https://github.com/herjarsa/omo-meta-governor.git"},devDependencies:{"@colbymchenry/codegraph":"^1.5.0","@opencode-ai/plugin":"^1.17.4","@types/node":"^25.9.3",typescript:"^7.0.2"}}});var bO={};K$(bO,{stripJsoncComments:()=>$O,parseJsonc:()=>vO,loadMetaGovernorConfig:()=>I_,loadJsoncFile:()=>N_,getUserConfigPath:()=>rO,getProjectConfigPath:()=>UO,deepMerge:()=>_r});import{readFile as hK,access as nK}from"node:fs/promises";import{resolve as fK,join as yK}from"node:path";import{homedir as iK}from"node:os";function $O($){let r=[],U=0;while(U<$.length){let v=$[U];if(v==='"'||v==="'"){let z=v;r.push(z),U++;while(U<$.length){let _=$[U];if(r.push(_),_==="\\"){if(U++,U<$.length)r.push($[U])}else if(_===z){U++;break}U++}continue}if(v==="/"&&U+1<$.length&&$[U+1]==="/"){U+=2;while(U<$.length&&$[U]!==`
|
|
34
34
|
`)U++;continue}if(v==="/"&&U+1<$.length&&$[U+1]==="*"){U+=2;while(U<$.length){if($[U]==="*"&&U+1<$.length&&$[U+1]==="/"){U+=2;break}U++}continue}r.push(v),U++}let b=r.join("");for(let v=0;v<10;v++){let z=b;if(b=b.replace(/,(\s*[\]}])/g,"$1"),b===z)break}return b}function vO($){try{let r=$O($);return JSON.parse(r)}catch{return}}function rO(){return fK(iK(),".config","opencode",sk)}function UO($){let r=$??process.cwd();return yK(r,".opencode",sk)}async function lK($){try{return await nK($),!0}catch{return!1}}async function N_($){if(!await lK($))return;try{let r=await hK($,"utf-8");return vO(r)}catch{return}}function _r($,r){let U={...$};for(let b of Object.keys(r)){let v=r[b],z=U[b];if(v===void 0)continue;if(ak(v)&&ak(z))U[b]=_r(z,v);else U[b]=v}return U}function ak($){return typeof $==="object"&&$!==null&&!Array.isArray($)}async function I_($={}){let r=[],U="defaults",b={},v=rO(),z=await N_(v);if(z)b=_r(b,z),r.push(`user:${v}`),U="user";let _=UO($.projectDir),N=await N_(_);if(N)b=_r(b,N),r.push(`project:${_}`),U="project";if($.cliOptions&&Object.keys($.cliOptions).length>0)b=_r(b,$.cliOptions),r.push("cli:inline"),U="cli";return{config:b,sources:r,effectiveSource:U}}var sk="omo-meta-governor.jsonc";var k_=()=>{};var JO={};K$(JO,{triggerWorkflow:()=>vX,pollRunUntilComplete:()=>$X,getLatestRunForSha:()=>sK,getFailedLogs:()=>rX,DEFAULT_CI_MONITOR_CONFIG:()=>aK});import{execFileSync as eK}from"node:child_process";function Nr($,r=1e4){try{return eK("gh",$,{encoding:"utf-8",timeout:r,stdio:["ignore","pipe","pipe"],windowsHide:!0}).toString().replace(/\r\n/g,`
|
|
35
35
|
`).trim()}catch{return null}}function sK($){let r=Nr(["run","list","--limit","1","--commit",$,"--json","databaseId,status,conclusion,displayTitle,headSha,url"],1e4);if(!r)return null;try{return JSON.parse(r)[0]??null}catch{return null}}function $X($,r){let U=Date.now(),b="",v=Nr(["run","view",String($),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!v)return null;let z;try{z=JSON.parse(v)}catch{return null}while((z.status==="queued"||z.status==="in_progress"||z.status==="waiting"||z.status==="requested")&&Date.now()-U<r.maxWaitMs){let _=Date.now()+r.pollIntervalMs;while(Date.now()<_);let N=Nr(["run","view",String($),"--json","status,conclusion,url,headSha,displayTitle"],1e4);if(!N)return null;try{z=JSON.parse(N)}catch{return null}}return z}function vX($,r){let U=Nr(["workflow","run",$,"--ref",r],15000);return null}function rX($,r=4000){let U=Nr(["run","view",String($),"--log-failed"],30000);if(!U)return"";if(U.length<=r)return U;return U.slice(0,r)+`
|
|
36
36
|
|
|
@@ -143,7 +143,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
143
143
|
|
|
144
144
|
`);return{title:`omo_recall: ${z.length} lesson${z.length===1?"":"s"}`,output:`Found ${z.length} past lesson${z.length===1?"":"s"} matching "${r.query}":
|
|
145
145
|
|
|
146
|
-
${_}`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-b,lessonsFound:z.length}}}})}function Xk($){return D({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(r,U){let b=$.metrics.getMetrics(),v=b.counters.interventions_delivered?.count??0,z=(b.counters.decisions_skipped_continue?.count??0)+(b.counters.decisions_skipped_no_decision?.count??0)+(b.counters.decisions_skipped_no_message?.count??0)+(b.counters.decisions_skipped_below_threshold?.count??0),_=b.counters.decisions_taken?.lastOccurrenceISO,N=b.counters.interventions_delivered?.lastOccurrenceISO,I={version:U_,status:b.counters.orchestrator_errors?.count?"degraded":"healthy",enabled:!0,startedAtISO:b.startedAtISO,uptimeMs:b.uptimeMs,metrics:{decisionsTaken:b.counters.decisions_taken?.count??0,decisionsStored:b.counters.decisions_stored?.count??0,interventionsDelivered:v,orchestratorRuns:b.counters.orchestrator_runs?.count??0,orchestratorErrors:b.counters.orchestrator_errors?.count??0,lastDecisionISO:_,lastInterventionISO:N},logFile:{path:$.logFilePath,sizeBytes:0,rotatedFiles:0},session:{id:U.sessionID,toolCallsObserved:b.counters.orchestrator_runs?.count??0,violationsDetected:b.counters.protocol_violations_detected?.count??0,interventionsSkipped:z,firstSeenISO:b.startedAtISO,lastSeenISO:new Date().toISOString()}};try{aI(I,$.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${U_} — Health Report
|
|
146
|
+
${_}`,metadata:{tool:"omo_recall",query:r.query,durationMs:Date.now()-b,lessonsFound:z.length}}}})}function Xk($){return D({description:"Show omo-meta-governor plugin status: enabled, metrics, recent decisions, and current config. Use when the user asks 'is the plugin working?' or to verify that lessons are being persisted.",args:{},async execute(r,U){let b=$.metrics.getMetrics(),v=b.counters.interventions_delivered?.count??0,z=(b.counters.decisions_skipped_continue?.count??0)+(b.counters.decisions_skipped_no_decision?.count??0)+(b.counters.decisions_skipped_no_message?.count??0)+(b.counters.decisions_skipped_below_threshold?.count??0),_=b.counters.decisions_taken?.lastOccurrenceISO,N=b.counters.interventions_delivered?.lastOccurrenceISO,I={version:U_,status:b.counters.orchestrator_errors?.count?"degraded":"healthy",enabled:!0,startedAtISO:b.startedAtISO,uptimeMs:b.uptimeMs,metrics:{decisionsTaken:b.counters.decisions_taken?.count??0,decisionsStored:b.counters.decisions_stored?.count??0,interventionsDelivered:v,orchestratorRuns:b.counters.orchestrator_runs?.count??0,orchestratorErrors:b.counters.orchestrator_errors?.count??0,lastDecisionISO:_,lastInterventionISO:N},logFile:{path:$.logFilePath,sizeBytes:0,rotatedFiles:0},session:{id:U.sessionID,toolCallsObserved:b.counters.orchestrator_runs?.count??0,violationsDetected:b.counters.protocol_violations_detected?.count??0,interventionsSkipped:z,firstSeenISO:b.startedAtISO,lastSeenISO:new Date().toISOString()},graphSync:{lastUpgradeAtISO:null,lastUpgradeResult:"unknown",lastUpgradeTarget:null,lastUpgradeMs:null},graphToolsUsed:{omo_search:0,omo_recall:0,omo_health:0,omo_find:0,omo_impact:0,omo_remember:0,omo_recall_mcp:0,omo_path:0,omo_explain:0,omo_files:0,omo_callers:0,omo_node:0,omo_context:0,omo_affected_cg:0,omo_status:0,omo_unlock:0,omo_mark_dirty:0,omo_sync_if_dirty:0,omo_index:0,omo_visualize:0,omo_serve:0,omo_uninit:0,omo_diagnose:0,omo_merge_graphs:0,omo_save_result:0,omo_extract:0,omo_cluster_only:0,omo_label:0,omo_tree:0,omo_clone:0,omo_add:0,omo_check_update:0,omo_hook_status:0}};try{aI(I,$.healthFilePath)}catch{}return{title:"omo_health",output:`# omo-meta-governor v${U_} — Health Report
|
|
147
147
|
|
|
148
148
|
`+`**Status**: ${I.status}
|
|
149
149
|
**Enabled**: ${I.enabled}
|
|
@@ -217,5 +217,5 @@ Current decision: ${s.message}`;S.recentInterventionTexts=[...x,`[${s.action}] $
|
|
|
217
217
|
`)}function LX($,r,U=NX){if($==="own"||$==="third-party")return $;try{let b=U("gh repo view --json isFork,parent",{cwd:r,stdio:"pipe",timeout:1e4}),v=JSON.parse(String(b));if(v.isFork===!0&&v.parent!==null&&v.parent!==void 0)return"third-party";return"own"}catch{try{let b=U("git remote -v",{cwd:r,stdio:"pipe",timeout:1e4});if(String(b).split(`
|
|
218
218
|
`).some((z)=>/^\s*upstream\s+/.test(z)))return"third-party"}catch{}return"own"}}var EX=YO();function C4($,r){return EX($,r)}C4.id="omo-meta-governor";C4.server=C4;var X8=C4;export{X8 as default};
|
|
219
219
|
|
|
220
|
-
//# debugId=
|
|
220
|
+
//# debugId=46A69CDB6198D6E264756E2164756E21
|
|
221
221
|
//# sourceMappingURL=index.js.map
|