oh-my-agent 8.2.0 → 8.2.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.
Files changed (2) hide show
  1. package/bin/cli.js +1 -1
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -1637,7 +1637,7 @@ spawn_error:${Q.message}`})})})}async function xK2($,z,G={}){let J=performance.n
1637
1637
  `);let z=new V6("!xml"),G=z,J="";this.matcher.reset(),this.entityDecoder.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let U=this.options,K=new yD(U.processEntities),X=$.length;for(let Q=0;Q<X;Q++)if($[Q]==="<"){let j=$.charCodeAt(Q+1);if(j===47){let Y=PZ($,">",Q,"Closing Tag is not closed."),W=$.substring(Q+2,Y).trim();if(U.removeNSPrefix){let k=W.indexOf(":");if(k!==-1)W=W.substr(k+1)}if(W=Bd(U.transformTagName,W,"",U).tagName,G)J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let L=this.matcher.getCurrentTag();if(W&&U.unpairedTagsSet.has(W))throw Error(`Unpaired tag can not be used as closing tag: </${W}>`);if(L&&U.unpairedTagsSet.has(L))this.matcher.pop(),this.tagsNodeStack.pop();this.matcher.pop(),this.isCurrentNodeStopNode=!1,G=this.tagsNodeStack.pop(),J="",Q=Y}else if(j===63){let Y=Ad($,Q,!1,"?>");if(!Y)throw Error("Pi Tag is not closed.");J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let W=this.buildAttributesMap(Y.tagExp,this.matcher,Y.tagName,!0);if(W){let L=W[this.options.attributeNamePrefix+"version"];this.entityDecoder.setXmlVersion(Number(L)||1),K.setXmlVersion(Number(L)||1)}if(U.ignoreDeclaration&&Y.tagName==="?xml"||U.ignorePiTags);else{let L=new V6(Y.tagName);if(L.add(U.textNodeName,""),Y.tagName!==Y.tagExp&&Y.attrExpPresent&&U.ignoreAttributes!==!0)L[":@"]=W;this.addChild(G,L,this.readonlyMatcher,Q)}Q=Y.closeIndex+1}else if(j===33&&$.charCodeAt(Q+2)===45&&$.charCodeAt(Q+3)===45){let Y=PZ($,"-->",Q+4,"Comment is not closed.");if(U.commentPropName){let W=$.substring(Q+4,Y-2);J=this.saveTextToParentTag(J,G,this.readonlyMatcher),G.add(U.commentPropName,[{[U.textNodeName]:W}])}Q=Y}else if(j===33&&$.charCodeAt(Q+2)===68){let Y=K.readDocType($,Q);this.entityDecoder.addInputEntities(Y.entities),Q=Y.i}else if(j===33&&$.charCodeAt(Q+2)===91){let Y=PZ($,"]]>",Q,"CDATA is not closed.")-2,W=$.substring(Q+9,Y);J=this.saveTextToParentTag(J,G,this.readonlyMatcher);let L=this.parseTextData(W,G.tagname,this.readonlyMatcher,!0,!1,!0,!0);if(L==null)L="";if(U.cdataPropName)G.add(U.cdataPropName,[{[U.textNodeName]:W}]);else G.add(U.textNodeName,L);Q=Y+2}else{let Y=Ad($,Q,U.removeNSPrefix);if(!Y){let I=$.substring(Math.max(0,Q-50),Math.min(X,Q+50));throw Error(`readTagExp returned undefined at position ${Q}. Context: "${I}"`)}let{tagName:W,rawTagName:L,tagExp:k,attrExpPresent:H,closeIndex:B}=Y;if({tagName:W,tagExp:k}=Bd(U.transformTagName,W,k,U),U.strictReservedNames&&(W===U.commentPropName||W===U.cdataPropName||W===U.textNodeName||W===U.attributesGroupName))throw Error(`Invalid tag name: ${W}`);if(G&&J){if(G.tagname!=="!xml")J=this.saveTextToParentTag(J,G,this.readonlyMatcher,!1)}let A=G;if(A&&U.unpairedTagsSet.has(A.tagname))G=this.tagsNodeStack.pop(),this.matcher.pop();let V=!1;if(k.length>0&&k.lastIndexOf("/")===k.length-1){if(V=!0,W[W.length-1]==="/")W=W.substr(0,W.length-1),k=W;else k=k.substr(0,k.length-1);H=W!==k}let F=null,N={},u=void 0;if(u=GC5(L),W!==z.tagname)this.matcher.push(W,{},u);if(W!==k&&H){if(F=this.buildAttributesMap(k,this.matcher,W),F)N=zC5(F,U)}if(W!==z.tagname)this.isCurrentNodeStopNode=this.isItStopNode();let q=Q;if(this.isCurrentNodeStopNode){let I="";if(V)Q=Y.closeIndex;else if(U.unpairedTagsSet.has(W))Q=Y.closeIndex;else{let M=this.readStopNodeData($,L,B+1);if(!M)throw Error(`Unexpected end of ${L}`);Q=M.i,I=M.tagContent}let D=new V6(W);if(F)D[":@"]=F;D.add(U.textNodeName,I),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(G,D,this.readonlyMatcher,q)}else{if(V){({tagName:W,tagExp:k}=Bd(U.transformTagName,W,k,U));let I=new V6(W);if(F)I[":@"]=F;this.addChild(G,I,this.readonlyMatcher,q),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(U.unpairedTagsSet.has(W)){let I=new V6(W);if(F)I[":@"]=F;this.addChild(G,I,this.readonlyMatcher,q),this.matcher.pop(),this.isCurrentNodeStopNode=!1,Q=Y.closeIndex;continue}else{let I=new V6(W);if(this.tagsNodeStack.length>U.maxNestedTags)throw Error("Maximum nested tags exceeded");if(this.tagsNodeStack.push(G),F)I[":@"]=F;this.addChild(G,I,this.readonlyMatcher,q),G=I}J="",Q=B}}}else J+=$[Q];return z.child};function ZC5($,z,G,J){if(!this.options.captureMetaData)J=void 0;let U=this.options.jPath?G.toString():G,K=this.options.updateTag(z.tagname,U,z[":@"]);if(K===!1);else if(typeof K==="string")z.tagname=K,$.addChild(z,J);else $.addChild(z,J)}function jC5($,z,G){let J=this.options.processEntities;if(!J||!J.enabled)return $;if(J.allowedTags){let U=this.options.jPath?G.toString():G;if(!(Array.isArray(J.allowedTags)?J.allowedTags.includes(z):J.allowedTags(z,U)))return $}if(J.tagFilter){let U=this.options.jPath?G.toString():G;if(!J.tagFilter(z,U))return $}return this.entityDecoder.decode($)}function YC5($,z,G,J){if($){if(J===void 0)J=z.child.length===0;if($=this.parseTextData($,z.tagname,G,!1,z[":@"]?Object.keys(z[":@"]).length!==0:!1,J),$!==void 0&&$!=="")z.add(this.options.textNodeName,$);$=""}return $}function WC5(){if(this.stopNodeExpressionsSet.size===0)return!1;return this.matcher.matchesAny(this.stopNodeExpressionsSet)}function kC5($,z,G=">"){let J=0,U=$.length,K=G.charCodeAt(0),X=G.length>1?G.charCodeAt(1):-1,Q="",Z=z;for(let j=z;j<U;j++){let Y=$.charCodeAt(j);if(J){if(Y===J)J=0}else if(Y===34||Y===39)J=Y;else if(Y===K)if(X!==-1){if($.charCodeAt(j+1)===X)return Q+=$.substring(Z,j),{data:Q,index:j}}else return Q+=$.substring(Z,j),{data:Q,index:j};else if(Y===9&&!J)Q+=$.substring(Z,j)+" ",Z=j+1}}function PZ($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);else return U+z.length-1}function LC5($,z,G,J){let U=$.indexOf(z,G);if(U===-1)throw Error(J);return U}function Ad($,z,G,J=">"){let U=kC5($,z+1,J);if(!U)return;let{data:K,index:X}=U,Q=K.search(/\s/),Z=K,j=!0;if(Q!==-1)Z=K.substring(0,Q),K=K.substring(Q+1).trimStart();let Y=Z;if(G){let W=Z.indexOf(":");if(W!==-1)Z=Z.substr(W+1),j=Z!==U.data.substr(W+1)}return{tagName:Z,tagExp:K,closeIndex:X,attrExpPresent:j,rawTagName:Y}}function HC5($,z,G){let J=G,U=1,K=$.length;for(;G<K;G++)if($[G]==="<"){let X=$.charCodeAt(G+1);if(X===47){let Q=LC5($,">",G,`${z} is not closed`);if($.substring(G+2,Q).trim()===z){if(U--,U===0)return{tagContent:$.substring(J,G),i:Q}}G=Q}else if(X===63)G=PZ($,"?>",G+1,"StopNode is not closed.");else if(X===33&&$.charCodeAt(G+2)===45&&$.charCodeAt(G+3)===45)G=PZ($,"-->",G+3,"StopNode is not closed.");else if(X===33&&$.charCodeAt(G+2)===91)G=PZ($,"]]>",G,"StopNode is not closed.")-2;else{let Q=Ad($,G,!1);if(Q){if((Q&&Q.tagName)===z&&Q.tagExp[Q.tagExp.length-1]!=="/")U++;G=Q.closeIndex}}}}function Vd($,z,G){if(z&&typeof $==="string"){let J=$.trim();if(J==="true")return!0;else if(J==="false")return!1;else return Ld($,G)}else if(UT2($))return $;else return""}function Bd($,z,G,J){if($){let U=$(z);if(G===z)G=U;z=U}return z=PT2(z,J),{tagName:z,tagExp:G}}function PT2($,z){if(bD.includes($))throw Error(`[SECURITY] Invalid name: "${$}" is a reserved JavaScript keyword that could cause prototype pollution`);else if(fL.includes($))return z.onDangerousProperty($);return $}var Fd=V6.getMetaDataSymbol();function BC5($,z){if(!$||typeof $!=="object")return{};if(!z)return $;let G={};for(let J in $)if(J.startsWith(z)){let U=J.substring(z.length);G[U]=$[J]}else G[J]=$[J];return G}function Nd($,z,G,J){return wT2($,z,G,J)}function wT2($,z,G,J){let U,K={};for(let X=0;X<$.length;X++){let Q=$[X],Z=AC5(Q);if(Z!==void 0&&Z!==z.textNodeName){let j=BC5(Q[":@"]||{},z.attributeNamePrefix);G.push(Z,j)}if(Z===z.textNodeName)if(U===void 0)U=Q[Z];else U+=""+Q[Z];else if(Z===void 0)continue;else if(Q[Z]){let j=wT2(Q[Z],z,G,J),Y=FC5(j,z);if(Object.keys(j).length===0&&z.alwaysCreateTextNode)j[z.textNodeName]="";if(Q[":@"])VC5(j,Q[":@"],J,z);else if(Object.keys(j).length===1&&j[z.textNodeName]!==void 0&&!z.alwaysCreateTextNode)j=j[z.textNodeName];else if(Object.keys(j).length===0)if(z.alwaysCreateTextNode)j[z.textNodeName]="";else j="";if(Q[Fd]!==void 0&&typeof j==="object"&&j!==null)j[Fd]=Q[Fd];if(K[Z]!==void 0&&Object.prototype.hasOwnProperty.call(K,Z)){if(!Array.isArray(K[Z]))K[Z]=[K[Z]];K[Z].push(j)}else{let W=z.jPath?J.toString():J;if(z.isArray(Z,W,Y))K[Z]=[j];else K[Z]=j}if(Z!==void 0&&Z!==z.textNodeName)G.pop()}}if(typeof U==="string"){if(U.length>0)K[z.textNodeName]=U}else if(U!==void 0)K[z.textNodeName]=U;return K}function AC5($){let z=Object.keys($);for(let G=0;G<z.length;G++){let J=z[G];if(J!==":@")return J}}function VC5($,z,G,J){if(z){let U=Object.keys(z),K=U.length;for(let X=0;X<K;X++){let Q=U[X],Z=Q.startsWith(J.attributeNamePrefix)?Q.substring(J.attributeNamePrefix.length):Q,j=J.jPath?G.toString()+"."+Z:G;if(J.isArray(Q,j,!0,!0))$[Q]=[z[Q]];else $[Q]=z[Q]}}}function FC5($,z){let{textNodeName:G}=z,J=Object.keys($).length;if(J===0)return!0;if(J===1&&($[G]||typeof $[G]==="boolean"||$[G]===0))return!0;return!1}class oL{constructor($){this.externalEntities={},this.options=IT2($)}parse($,z){if(typeof $!=="string"&&$.toString)$=$.toString();else if(typeof $!=="string")throw Error("XML data is accepted in String or Bytes[] form.");if(z){if(z===!0)z={};let U=jT2($,z);if(U!==!0)throw Error(`${U.err.msg}:${U.err.line}:${U.err.col}`)}let G=new hD(this.options,this.externalEntities),J=G.parseXml($);if(this.options.preserveOrder||J===void 0)return J;else return Nd(J,this.options,G.matcher,G.readonlyMatcher)}addEntity($,z){if(z.indexOf("&")!==-1)throw Error("Entity value can't have '&'");else if($.indexOf("&")!==-1||$.indexOf(";")!==-1)throw Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");else if(z==="&")throw Error("An entity with value '&' is not permitted");else this.externalEntities[$]=z}static getMetaDataSymbol(){return V6.getMetaDataSymbol()}}X8();var NC5=["/rss","/feed","/atom.xml","/rss.xml","/index.xml"],uC5=new oL({ignoreAttributes:!1,attributeNamePrefix:"@_",textNodeName:"#text"});function ud($){if($===void 0||$===null)return[];return Array.isArray($)?$:[$]}function P3($){if($==null)return;if(typeof $==="string")return $;if(typeof $==="object"){let z=$;if(typeof z["#text"]==="string")return z["#text"];if(typeof z["#cdata"]==="string")return z["#cdata"]}return}function bT2($){for(let z of ud($)){let G=z?.["@_href"],J=z?.["@_rel"];if(typeof G==="string"&&(J===void 0||J==="alternate"))return G}return}function CT2($){let z;try{z=uC5.parse($)}catch{return null}let G=z.rss;if(G){let U=G.channel;if(!U)return null;let K=ud(U.item);return{kind:"rss",title:P3(U.title),description:P3(U.description),link:P3(U.link),entries:K.map((X)=>({title:P3(X.title),link:P3(X.link),pubDate:P3(X.pubDate),description:P3(X.description),content:P3(X["content:encoded"])??P3(X.content)}))}}let J=z.feed;if(J){let U=ud(J.entry);return{kind:"atom",title:P3(J.title),description:P3(J.subtitle),link:bT2(J.link),entries:U.map((K)=>({title:P3(K.title),link:bT2(K.link),pubDate:P3(K.published)??P3(K.updated),description:P3(K.summary),content:P3(K.content)??P3(K.summary)}))}}return null}async function ST2($,z){let G=performance.now(),J;try{let K=await d1($.toString(),{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(K.ok)J=Ju(K.text).alternate?.[0]?.href}catch{}let U=new Set;if(J)try{U.add(new URL(J,$).toString())}catch{}for(let K of NC5)U.add(new URL(K,`${$.protocol}//${$.host}`).toString());for(let K of U){if(z.signal?.aborted)break;try{let X=await d1(K,{timeoutMs:z.timeoutMs,locale:z.locale,signal:z.signal});if(!X.ok||X.text.length<50)continue;let Q=CT2(X.text);if(!Q||Q.entries.length===0)continue;return{url:$.toString(),status:"ok",strategy:"probe",platform:"rss",httpStatus:X.status,content:X.text,contentType:X.headers.get("content-type")??void 0,elapsedMs:Math.round(performance.now()-G),signals:[],feedUrl:K,feed:Q}}catch{}}return{url:$.toString(),status:"not-found",strategy:"probe",platform:"rss",content:"",elapsedMs:Math.round(performance.now()-G),signals:[],error:"no RSS/Atom feed discovered"}}function _T2($,z="en-US"){let[G,J]=z.split("-"),U=new URL("https://news.google.com/rss/search");return U.searchParams.set("q",$),U.searchParams.set("hl",G??"en"),U.searchParams.set("gl",J??"US"),U.searchParams.set("ceid",`${J??"US"}:${G??"en"}`),U.toString()}UW();X8();var xD={"github.com":{domain:"github.com",level:"verified",score:0.95,tags:["code-host"],source:"registry"},"docs.github.com":{domain:"docs.github.com",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"developer.mozilla.org":{domain:"developer.mozilla.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"nextjs.org":{domain:"nextjs.org",level:"verified",score:0.9,tags:["vendor","lang-docs"],source:"registry"},"vercel.com":{domain:"vercel.com",level:"verified",score:0.9,tags:["vendor"],source:"registry"},"typescriptlang.org":{domain:"typescriptlang.org",level:"verified",score:0.95,tags:["lang-docs"],source:"registry"},"stackoverflow.com":{domain:"stackoverflow.com",level:"community",score:0.7,tags:["qna"],source:"registry"},"dev.to":{domain:"dev.to",level:"external",score:0.4,tags:["blog"],source:"registry"},"medium.com":{domain:"medium.com",level:"external",score:0.35,tags:["blog"],source:"registry"},"npmjs.com":{domain:"npmjs.com",level:"verified",score:0.9,tags:["registry"],source:"registry"},"pypi.org":{domain:"pypi.org",level:"verified",score:0.9,tags:["registry"],source:"registry"},"news.ycombinator.com":{domain:"news.ycombinator.com",level:"community",score:0.65,tags:["news"],source:"registry"},"reddit.com":{domain:"reddit.com",level:"community",score:0.55,tags:["forum"],source:"registry"},"wikipedia.org":{domain:"wikipedia.org",level:"community",score:0.75,tags:["encyclopedia"],source:"registry"},"arxiv.org":{domain:"arxiv.org",level:"verified",score:0.9,tags:["academic"],source:"registry"},"doi.org":{domain:"doi.org",level:"verified",score:0.95,tags:["academic"],source:"registry"}};function OC5($){return $.replace(/^www\./,"")}function qC5($){if($ in xD){let G=xD[$];return G?{...G}:null}let z=OC5($);if(z in xD){let G=xD[z];return G?{...G}:null}return null}function MC5($){let z=$.split(".").pop();if(z==="gov"||z==="edu"||z==="mil")return{domain:$,level:"verified",score:0.9,tags:["institution"],source:"heuristic"};if(/\.gov\.[a-z]{2}$/.test($)||/\.ac\.[a-z]{2}$/.test($))return{domain:$,level:"verified",score:0.85,tags:["institution"],source:"heuristic"};return null}async function DC5($){try{let z=await d1(`https://tranco-list.eu/api/ranks/domain/${$}`,{timeoutMs:5000});if(!z.ok)return null;let J=JSON.parse(z.text).ranks?.[0]?.rank;if(!J)return null;let U=J<1e4?0.6:J<1e5?0.4:0.2;return{domain:$,level:J<1e4?"community":"external",score:U,tags:["tranco"],source:"tranco",rank:J}}catch{return null}}async function yT2($){let z=qC5($);if(z)return z;let G=MC5($);if(G)return G;let J=await DC5($);if(J)return J;return{domain:$,level:"unknown",score:null,tags:[],source:"heuristic"}}var hT2=["api","probe","impersonate","browser","archive"];function xT2($){if(!$)return;let z=$.split(",").map((J)=>J.trim()).filter(Boolean),G=z.filter((J)=>!hT2.includes(J));if(G.length>0)throw Error(`Unknown strategy: ${G.join(", ")}. Valid: ${hT2.join(", ")}`);return z}function wZ($){try{return new URL($)}catch{throw Error(`Invalid URL: ${$}`)}}function lz($){return{timeoutMs:$.timeout?Math.max(1000,Math.floor(Number($.timeout)*1000)):15000,locale:$.locale??"en-US,en;q=0.9"}}function m0($,z){if(z)console.log(JSON.stringify($,null,2));else console.log(JSON.stringify($))}function XU($){if(!$){process.exitCode=1;return}if($.status==="ok")process.exitCode=0;else if($.status==="blocked")process.exitCode=2;else if($.status==="not-found")process.exitCode=3;else if($.status==="invalid-input")process.exitCode=4;else if($.status==="auth-required")process.exitCode=5;else if($.status==="timeout")process.exitCode=6;else process.exitCode=1}function iT2($){let z=$.command("search").description("Mechanical search primitives — fetch, meta, rss, media, trust, code").alias("s");z.command("fetch <url>").description("Fetch URL via auto-escalating strategy pipeline").option("--only <strategies>","Comma-separated strategies to run").option("--skip <strategies>","Comma-separated strategies to skip").option("--include-archive","Include archive strategy as last fallback").option("--timeout <seconds>","Per-strategy timeout","15").option("--locale <value>","Accept-Language header","en-US,en;q=0.9").option("--pretty","Pretty-print JSON output").action(async(G,J)=>{try{let U=wZ(G),K=lz(J),X=await JT2(U,K,{only:xT2(J.only),skip:xT2(J.skip),includeArchive:J.includeArchive});m0(X,Boolean(J.pretty)),XU(X)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("api <url>").description("Fetch via matched platform API (Phase 0)").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=wZ(G);if(!qy(U)){console.error(w8.default.yellow(`No API handler matches host ${U.hostname}`)),process.exitCode=3;return}let X=lz(J),Q=await pF(U,X);if(!Q){process.exitCode=3;return}m0(Q,Boolean(J.pretty)),XU(Q)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("api:search <query>").description("Fan-out keyword search across platforms that support it").option("--platforms <list>","Comma-separated platform ids").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=lz(J),K=J.platforms?J.platforms.split(",").map((Q)=>Q.trim()).filter(Boolean):void 0,X=await x$(G,U,K);m0(X,Boolean(J.pretty))}),z.command("meta <url>").description("Extract OGP / JSON-LD / Schema.org from URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=wZ(G),K=lz(J),X=await gK2(U,K),{content:Q,...Z}=X;m0(Z,Boolean(J.pretty)),XU(X)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("rss <url>").description("Discover and parse RSS/Atom feed for a URL").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=wZ(G),K=lz(J),X=await ST2(U,K),{content:Q,...Z}=X;m0(Z,Boolean(J.pretty)),XU(X)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("rss:google <query>").description("Build Google News RSS URL for a query").option("--locale <value>","Locale (e.g., ko-KR)","en-US").action((G,J)=>{let U=_T2(G,J.locale??"en-US");console.log(U)}),z.command("media <url>").description("Extract media metadata via yt-dlp (1858 sites)").option("--subs","Write subtitles").option("--sub-lang <list>","Subtitle languages (comma-separated)","en").option("--format <spec>","yt-dlp format spec").option("--timeout <seconds>","Timeout","30").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=wZ(G),K=lz(J),X=J.subLang?J.subLang.split(",").map((Z)=>Z.trim()).filter(Boolean):void 0,Q=await xK2(U,K,{subtitles:J.subs,...X?{subLangs:X}:{},...J.format?{format:J.format}:{}});m0(Q,Boolean(J.pretty)),XU(Q)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("archive <url>").description("Fetch via AMP / archive.today / Wayback").option("--timeout <seconds>","Timeout","15").option("--locale <value>","Accept-Language","en-US,en;q=0.9").option("--pretty","Pretty-print JSON").action(async(G,J)=>{try{let U=wZ(G),K=lz(J),X=await wW(U,K);m0(X,Boolean(J.pretty)),XU(X)}catch(U){console.error(w8.default.red(U.message)),process.exitCode=1}}),z.command("trust <domain>").description("Resolve trust level / score for a domain").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=await yT2(G.toLowerCase());m0(U,Boolean(J.pretty))}),z.command("code <query>").description("Search code via gh / glab").option("--host <github|gitlab>","Host","github").option("--language <lang>","Language filter").option("--repo <owner/repo>","Scope to a repo").option("--limit <n>","Max results","20").option("--pretty","Pretty-print JSON").action(async(G,J)=>{let U=J.host==="gitlab"||J.host==="github"?J.host:"github",K=lz({}),X=await hK2(G,K,{host:U,...J.language?{language:J.language}:{},...J.repo?{repo:J.repo}:{},...J.limit?{limit:Number.parseInt(J.limit,10)}:{}});m0(X,Boolean(J.pretty)),XU(X)}),z.command("doctor").description("Check dependencies (Chrome, python3 curl_cffi, yt-dlp, gh)").action(async()=>{let G=[],J=Kd();G.push({name:"chrome",ok:Boolean(J),detail:J??"Install Chrome or set OMA_CHROME_PATH"}),G.push(await Od("python3",["--version"])),G.push(await IC5()),G.push(await Od("yt-dlp",["--version"])),G.push(await Od("gh",["--version"]));for(let U of G){let K=U.ok?w8.default.green("✓"):w8.default.yellow("!");console.log(`${K} ${U.name}: ${U.detail}`)}if(G.some((U)=>!U.ok))process.exitCode=1})}async function Od($,z){return new Promise((G)=>{let{spawn:J}=X2("node:child_process"),U=J($,z,{stdio:["ignore","pipe","pipe"]}),K="";U.stdout?.on("data",(X)=>{K+=X.toString()}),U.on("error",()=>G({name:$,ok:!1,detail:"not found"})),U.on("close",(X)=>{if(X===0)G({name:$,ok:!0,detail:K.trim()});else G({name:$,ok:!1,detail:`exit code ${X}`})})})}async function IC5(){return new Promise(($)=>{let{spawn:z}=X2("node:child_process"),G=z("python3",["-c","import curl_cffi; print(curl_cffi.__version__)"],{stdio:["ignore","pipe","pipe"]}),J="";G.stdout?.on("data",(U)=>{J+=U.toString()}),G.on("error",()=>$({name:"curl_cffi",ok:!1,detail:"python3 not found"})),G.on("close",(U)=>{if(U===0)$({name:"curl_cffi",ok:!0,detail:`v${J.trim()}`});else $({name:"curl_cffi",ok:!1,detail:"not installed (pip install curl_cffi)"})})})}U7();var cz=p2(I4(),1);import{execSync as EC5,spawnSync as gT2}from"node:child_process";import{platform as TC5}from"node:os";function RC5(){let $=TC5();if($==="darwin")return"brew install gh";if($==="win32")return"winget install GitHub.cli";return"sudo apt install gh"}async function mT2(){if(console.clear(),d4(cz.default.bgMagenta(cz.default.white(" ⭐ oh-my-agent star "))),!NG()){let z=RC5(),G=await F3({message:`GitHub CLI (gh) is not installed. Install with ${cz.default.cyan(z)}?`});if(Y4(G)||!G){T5("Install gh manually and try again.");return}let J=D6();J.start("Installing GitHub CLI...");let U=gT2(z,{shell:!0,stdio:"pipe"});if(U.status!==0){J.stop("Installation failed"),c5.error(U.stderr?.toString()||"Unknown error"),T5("Please install gh manually.");return}J.stop("GitHub CLI installed!")}if(!$8()){c5.warn("GitHub CLI is not authenticated.");let z=await F3({message:`Run ${cz.default.cyan("gh auth login")} now?`});if(Y4(z)||!z){T5("Authenticate and try again.");return}if(gT2("gh",["auth","login"],{stdio:"inherit"}),!$8()){T5("Authentication was not completed. Try again.");return}c5.success("Authenticated!")}if(uG()){T5(`Already starred ${cz.default.cyan(K1)}! Thank you! \uD83D\uDE4F`);return}let $=await F3({message:`Star ${cz.default.cyan(K1)} on GitHub?`});if(Y4($)||!$){T5("Maybe next time!");return}try{EC5(`gh api -X PUT /user/starred/${K1}`,{stdio:"ignore"}),T5(`Starred ${cz.default.cyan(K1)}! Thank you! \uD83C\uDF1F`)}catch{c5.error("Failed to star the repository."),T5("Please try again later.")}}function fT2($){$.command("star").description("Star oh-my-agent on GitHub").action(Y5(async()=>{await mT2()}))}U7();hx();oj();var w3=p2(I4(),1);import{existsSync as rL,mkdirSync as vC5,readdirSync as PC5,readFileSync as lT2,writeFileSync as dT2}from"node:fs";import{dirname as wC5,join as qd}from"node:path";function bC5($){let z=re($),G={},J=0,U=0;for(let K of z){J+=K.tokens;let X=oe(K.tokens,K.vendor);U+=X;let Q=G[K.vendor]??{tokens:0,spawns:0,usd:0};Q.tokens+=K.tokens,Q.spawns+=1,Q.usd+=X,G[K.vendor]=Q}return{totalTokens:J,totalSpawns:z.length,estimatedUsd:U,byVendor:G}}function cT2($){return $.toLocaleString("en-US")}function nT2($){if($===0)return"$0.00";if($<0.01)return"<$0.01";return`$${$.toFixed(2)}`}function Md($){return qd($,".agents","state","metrics.json")}function CC5($){return qd($,".serena","metrics.json")}function iD(){return{sessions:0,skillsUsed:{},tasksCompleted:0,totalSessionTime:0,filesChanged:0,linesAdded:0,linesRemoved:0,lastUpdated:new Date().toISOString(),startDate:new Date().toISOString()}}function SC5($){let z=Md($);if(rL(z))try{return JSON.parse(lT2(z,"utf-8"))}catch{return iD()}let G=CC5($);if(rL(G))try{return JSON.parse(lT2(G,"utf-8"))}catch{return iD()}return iD()}function _C5($,z){let G=Md($),J=wC5(G);if(!rL(J))vC5(J,{recursive:!0});z.lastUpdated=new Date().toISOString(),dT2(G,JSON.stringify(z,null,2),"utf-8")}function yC5($){let z=qd($,".serena","memories"),G={};if(!rL(z))return G;try{let J=PC5(z);for(let U of J){let K=U.match(/(?:progress|result)-(\w+)/);if(K?.[1]){let X=K[1];G[X]=(G[X]||0)+1}}}catch{}return G}async function pT2($=!1,z=!1){let G=process.cwd(),J=Md(G);if(z){if(rL(J))dT2(J,JSON.stringify(iD(),null,2),"utf-8");if($)console.log(JSON.stringify({reset:!0}));else console.log(w3.default.green("✅ Metrics reset successfully."));return}let U=SC5(G),K=oN(G),X=yC5(G),Q=Te(G),Z=rA(G),j=Z.startedAt?new Date(Z.startedAt):null,Y=j&&!Number.isNaN(j.getTime())?Math.max(0,Math.floor((Date.now()-j.getTime())/1000)):0;for(let[A,V]of Object.entries(X))U.skillsUsed[A]=(U.skillsUsed[A]||0)+V;if(Q>U.tasksCompleted)U.tasksCompleted=Q;if(Z.id){if(["completed","failed","aborted"].includes(Z.status||"")&&(U.lastSessionId!==Z.id||U.lastSessionStatus!==Z.status)&&Y>0)U.totalSessionTime+=Y;U.lastSessionId=Z.id,U.lastSessionStatus=Z.status,U.lastSessionStarted=Z.startedAt,U.lastSessionDuration=Y}U.filesChanged+=K.filesChanged,U.linesAdded+=K.linesAdded,U.linesRemoved+=K.linesRemoved,U.sessions+=1,_C5(G,U);let W=Math.max(1,Math.ceil((Date.now()-new Date(U.startDate).getTime())/86400000)),L=U.sessions>0?Math.round(U.totalSessionTime/U.sessions):0,k=bC5(G);if($){console.log(JSON.stringify({...U,gitStats:K,daysSinceStart:W,avgSessionTime:L,cost:k},null,2));return}console.clear(),d4(w3.default.bgMagenta(w3.default.white(" \uD83D\uDCCA oh-my-agent stats ")));let H=[w3.default.bold(`\uD83D\uDCC8 Productivity Metrics (${W} days)`),"┌─────────────────────┬──────────────┐",`│ ${w3.default.bold("Metric")} │ ${w3.default.bold("Value")} │`,"├─────────────────────┼──────────────┤",`│ Sessions │ ${String(U.sessions).padEnd(12)} │`,`│ Tasks Completed │ ${String(U.tasksCompleted).padEnd(12)} │`,`│ Files Changed │ ${String(U.filesChanged).padEnd(12)} │`,`│ Lines Added │ ${w3.default.green(`+${U.linesAdded}`.padEnd(12))} │`,`│ Lines Removed │ ${w3.default.red(`-${U.linesRemoved}`.padEnd(12))} │`,"└─────────────────────┴──────────────┘"].join(`
1638
1638
  `);if(G5(H,"Overview"),k.totalSpawns>0){let A=Object.entries(k.byVendor).sort(([,F],[,N])=>N.tokens-F.tokens).map(([F,N])=>` ${F.padEnd(12)} ${cT2(N.tokens).padStart(12)} tokens · ${String(N.spawns).padStart(3)} spawns · ${nT2(N.usd).padStart(7)}`),V=[w3.default.bold("\uD83D\uDCB0 Cost Telemetry (all sessions)"),"┌─────────────────────┬──────────────┐",`│ ${w3.default.bold("Metric")} │ ${w3.default.bold("Value")} │`,"├─────────────────────┼──────────────┤",`│ Total tokens (est.) │ ${cT2(k.totalTokens).padEnd(12)} │`,`│ Total spawns │ ${String(k.totalSpawns).padEnd(12)} │`,`│ Estimated USD │ ${nT2(k.estimatedUsd).padEnd(12)} │`,"└─────────────────────┴──────────────┘",w3.default.dim("By vendor (sorted by tokens):"),...A,w3.default.dim("Estimate is input-only (prompt char approximation); output tokens not yet tracked."),w3.default.dim("Configure session.quota_cap in .agents/oma-config.yaml to enforce budgets.")].join(`
1639
1639
  `);G5(V,"Cost")}let B=Object.entries(U.skillsUsed).sort(([,A],[,V])=>V-A).slice(0,5);if(B.length>0){let A=[w3.default.bold("\uD83C\uDFC6 Top Skills Used"),...B.map(([V,F],N)=>` ${N+1}. ${V} (${F})`)].join(`
1640
- `);G5(A,"Skills")}T5(w3.default.dim(`Data stored in: ${J}`))}function aT2($){$3($.command("stats").description("View productivity metrics").option("--reset","Reset metrics data")).action(Y5(async(z)=>{await pT2(l1(z),z.reset)},{supportsJsonOutput:!0}))}U7();var c4=p2(I4(),1);import{execSync as tT2}from"node:child_process";import{cpSync as fD,existsSync as ZU,mkdirSync as Dd,readFileSync as eT2,rmSync as Id,writeFileSync as Ed}from"node:fs";import{tmpdir as lC5}from"node:os";import{join as l7}from"node:path";var gD=p2(I4(),1);import{execSync as hC5,spawn as xC5}from"node:child_process";import{realpathSync as oT2}from"node:fs";import sL from"node:process";var QU="oh-my-agent";function iC5($=sL.argv[1]){if(!$)return{packageManager:"unknown",isGlobal:!1};if(sL.env.IS_BINARY==="true")return{packageManager:"binary",isGlobal:!0,updateMessage:"Running as a standalone binary. Download the latest release from GitHub."};let z;try{z=j9(oT2($))}catch{return{packageManager:"unknown",isGlobal:!1}}if(z.includes("/.npm/_npx")||z.includes("/npm/_npx"))return{packageManager:"npx",isGlobal:!1,updateMessage:"Running via npx, auto-update not applicable."};if(z.includes("/.pnpm/_pnpx")||z.includes("/.cache/pnpm/dlx"))return{packageManager:"pnpx",isGlobal:!1,updateMessage:"Running via pnpx, auto-update not applicable."};if(z.includes("/.bun/install/cache"))return{packageManager:"bunx",isGlobal:!1,updateMessage:"Running via bunx, auto-update not applicable."};if(sL.platform==="darwin")try{let G=hC5(`brew --prefix ${QU}`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(G){let J=j9(oT2(G));if(z.startsWith(J))return{packageManager:"homebrew",isGlobal:!0,updateCommand:`brew upgrade ${QU}`,updateMessage:"Installed via Homebrew. Updating in background..."}}}catch{}if(z.includes("/.pnpm/global")||z.includes("/.local/share/pnpm"))return{packageManager:"pnpm",isGlobal:!0,updateCommand:`pnpm add -g ${QU}@latest`,updateMessage:"Installed via pnpm. Updating in background..."};if(z.includes("/.yarn/global"))return{packageManager:"yarn",isGlobal:!0,updateCommand:`yarn global add ${QU}@latest`,updateMessage:"Installed via yarn. Updating in background..."};if(z.includes("/.bun/install/global"))return{packageManager:"bun",isGlobal:!0,updateCommand:`bun add -g ${QU}@latest`,updateMessage:"Installed via bun. Updating in background..."};return{packageManager:"npm",isGlobal:!0,updateCommand:`npm install -g ${QU}@latest`,updateMessage:"Installed via npm. Updating in background..."}}var rT2=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/;function gC5($,z){let G=$.match(rT2),J=z.match(rT2);if(!G||!J)return!1;for(let U=1;U<=3;U++){let K=Number(G[U]),X=Number(J[U]);if(K<X)return!0;if(K>X)return!1}return!1}async function mC5($=QU,z=2000){try{let G=await S$.get(`https://registry.npmjs.org/${$}/latest`,{timeout:z});return typeof G.data?.version==="string"?G.data.version:null}catch{return null}}async function sT2($){if(!$.enabled)return{triggered:!1,reason:"disabled"};if(sL.env.OMA_SKIP_VERSION_CHECK==="1")return{triggered:!1,reason:"skipped-env"};if(sL.env.NODE_ENV==="development")return{triggered:!1,reason:"skipped-env"};let z=await mC5();if(!z)return{triggered:!1,reason:"fetch-failed"};if(!gC5($.currentVersion,z))return{triggered:!1,reason:"up-to-date",latest:z};let G=iC5();if(!G.updateCommand)return $.onNotice?.(gD.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. ${G.updateMessage??"Update manually."}`)),{triggered:!1,reason:"non-upgradable",latest:z};try{return xC5(G.updateCommand,{stdio:"ignore",shell:!0,detached:!0}).unref(),$.onSpawnStart?.(gD.default.cyan(`global oh-my-agent ${$.currentVersion} → ${z} updating in background. New version applies on next run.`)),{triggered:!0,latest:z}}catch{return $.onNotice?.(gD.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. Run: ${G.updateCommand}`)),{triggered:!1,reason:"spawn-failed",latest:z}}}var mD={name:"oh-my-agent",version:"8.2.0",description:"Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",type:"module",bin:{"oh-my-agent":"./bin/cli.js",oma:"./bin/cli.js"},files:["bin"],keywords:["oh-my-agent","antigravity",".agents","agent","skills","agent-skills","multi-agent","orchestrator","claude","claude-code","codex","opencode","copilot","cursor","chatgpt","pm","frontend","backend","mobile","qa","debug","terraform","database","workflow","bug-fixing","gemini"],author:"our.first.fluke <our.first.fluke@gmail.com>",contributors:["gracefullight <gracefullight.dev@gmail.com>","gahyun-git <go4it.gh@gmail.com>"],license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/first-fluke"},{type:"buymeacoffee",url:"https://buymeacoffee.com/firstfluke"}],scripts:{"sync:readme":"node ./scripts/sync-readme.mjs","generate:skill-data":"node ./scripts/generate-skill-data.mjs",build:"bun run generate:skill-data && bun run sync:readme && bun build cli.ts --outfile bin/cli.js --target node --minify --external @napi-rs/keyring",dev:"bun run generate:skill-data && bun run cli.ts",lint:"biome check .","lint:fix":"biome check --write --unsafe .","check:boundaries":"node ./scripts/check-boundaries.mjs",test:"vitest run","test:coverage":"vitest run --coverage",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^1.1.0","@date-fns/tz":"^1.4.1","@napi-rs/keyring":"^1.3.0",axios:"^1.15.0","better-sqlite3":"^12.9.0",chokidar:"^5.0.0",commander:"^14.0.3","date-fns":"^4.2.1",eld:"^2.0.3","fast-xml-parser":"^5",minimatch:"^10.2.5","p-map":"^7.0.4",picocolors:"^1.1.1","puppeteer-core":"^24",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-parse":"^11.0.0","smol-toml":"^1.6.1",unified:"^11.0.5",ws:"^8.18.0",yaml:"^2.8.2",zod:"^4.3.6"},devDependencies:{"@biomejs/biome":"^2.4.15","@types/better-sqlite3":"^7.6.13","@types/mdast":"^4.0.4","@types/node":"^24","@types/ws":"^8.18.1","@vitest/coverage-v8":"^4.1.4",typescript:"^6",vitest:"^4.0.18"},repository:{type:"git",url:"https://github.com/first-fluke/oh-my-agent"},antigravity:{skillsPath:".agents/skills",skills:["oma-architecture","oma-brainstorm","oma-coordination","oma-pm","oma-frontend","oma-backend","oma-db","oma-mobile","oma-qa","oma-debug","oma-orchestrator","oma-dev-workflow","oma-tf-infra","oma-scm","oma-pdf","oma-recap"]}};function cC5($){if(!$)return{intro:(G)=>d4(G),outro:(G)=>T5(G),note:(G,J)=>G5(G,J),logError:(G)=>c5.error(G),spinnerStart:(G)=>{let J=D6();return J.start(G),J}};let z={start(G){},stop(G){if(G)console.log(G)},message(G){console.log(G)}};return{intro:(G)=>console.log(G),outro:(G)=>console.log(G),note:(G,J)=>console.log(G),logError:(G)=>console.error(G),spinnerStart:(G)=>{return console.log(G),z}}}function nC5($,z){if($!==null)return"ready";return z?"legacy":"missing"}async function Td($=!1,z=!1){if(!z&&process.stdout.isTTY)console.clear();let G=cC5(z);G.intro(c4.default.bgMagenta(c4.default.white(" \uD83D\uDEF8 oh-my-agent update ")));let J=process.cwd();await sT2({currentVersion:mD.version,enabled:c82(J),onSpawnStart:(Y)=>G.note(Y,"CLI auto-update"),onNotice:(Y)=>G.note(Y,"CLI update available")});let U=await DF(J),K=S82(J),X=nC5(U,K);if(X==="missing"){if(G.logError("oh-my-agent is not installed in this project. Run `oma install` first."),z)throw Error("oh-my-agent is not installed in this project. Run `oma install` first.");process.exit(1)}let Q=cG(J);if(Q.length>0)G.note(Q.map((Y)=>`${c4.default.green("✓")} ${Y}`).join(`
1640
+ `);G5(A,"Skills")}T5(w3.default.dim(`Data stored in: ${J}`))}function aT2($){$3($.command("stats").description("View productivity metrics").option("--reset","Reset metrics data")).action(Y5(async(z)=>{await pT2(l1(z),z.reset)},{supportsJsonOutput:!0}))}U7();var c4=p2(I4(),1);import{execSync as tT2}from"node:child_process";import{cpSync as fD,existsSync as ZU,mkdirSync as Dd,readFileSync as eT2,rmSync as Id,writeFileSync as Ed}from"node:fs";import{tmpdir as lC5}from"node:os";import{join as l7}from"node:path";var gD=p2(I4(),1);import{execSync as hC5,spawn as xC5}from"node:child_process";import{realpathSync as oT2}from"node:fs";import sL from"node:process";var QU="oh-my-agent";function iC5($=sL.argv[1]){if(!$)return{packageManager:"unknown",isGlobal:!1};if(sL.env.IS_BINARY==="true")return{packageManager:"binary",isGlobal:!0,updateMessage:"Running as a standalone binary. Download the latest release from GitHub."};let z;try{z=j9(oT2($))}catch{return{packageManager:"unknown",isGlobal:!1}}if(z.includes("/.npm/_npx")||z.includes("/npm/_npx"))return{packageManager:"npx",isGlobal:!1,updateMessage:"Running via npx, auto-update not applicable."};if(z.includes("/.pnpm/_pnpx")||z.includes("/.cache/pnpm/dlx"))return{packageManager:"pnpx",isGlobal:!1,updateMessage:"Running via pnpx, auto-update not applicable."};if(z.includes("/.bun/install/cache"))return{packageManager:"bunx",isGlobal:!1,updateMessage:"Running via bunx, auto-update not applicable."};if(sL.platform==="darwin")try{let G=hC5(`brew --prefix ${QU}`,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(G){let J=j9(oT2(G));if(z.startsWith(J))return{packageManager:"homebrew",isGlobal:!0,updateCommand:`brew upgrade ${QU}`,updateMessage:"Installed via Homebrew. Updating in background..."}}}catch{}if(z.includes("/.pnpm/global")||z.includes("/.local/share/pnpm"))return{packageManager:"pnpm",isGlobal:!0,updateCommand:`pnpm add -g ${QU}@latest`,updateMessage:"Installed via pnpm. Updating in background..."};if(z.includes("/.yarn/global"))return{packageManager:"yarn",isGlobal:!0,updateCommand:`yarn global add ${QU}@latest`,updateMessage:"Installed via yarn. Updating in background..."};if(z.includes("/.bun/install/global"))return{packageManager:"bun",isGlobal:!0,updateCommand:`bun add -g ${QU}@latest`,updateMessage:"Installed via bun. Updating in background..."};return{packageManager:"npm",isGlobal:!0,updateCommand:`npm install -g ${QU}@latest`,updateMessage:"Installed via npm. Updating in background..."}}var rT2=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/;function gC5($,z){let G=$.match(rT2),J=z.match(rT2);if(!G||!J)return!1;for(let U=1;U<=3;U++){let K=Number(G[U]),X=Number(J[U]);if(K<X)return!0;if(K>X)return!1}return!1}async function mC5($=QU,z=2000){try{let G=await S$.get(`https://registry.npmjs.org/${$}/latest`,{timeout:z});return typeof G.data?.version==="string"?G.data.version:null}catch{return null}}async function sT2($){if(!$.enabled)return{triggered:!1,reason:"disabled"};if(sL.env.OMA_SKIP_VERSION_CHECK==="1")return{triggered:!1,reason:"skipped-env"};if(sL.env.NODE_ENV==="development")return{triggered:!1,reason:"skipped-env"};let z=await mC5();if(!z)return{triggered:!1,reason:"fetch-failed"};if(!gC5($.currentVersion,z))return{triggered:!1,reason:"up-to-date",latest:z};let G=iC5();if(!G.updateCommand)return $.onNotice?.(gD.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. ${G.updateMessage??"Update manually."}`)),{triggered:!1,reason:"non-upgradable",latest:z};try{return xC5(G.updateCommand,{stdio:"ignore",shell:!0,detached:!0}).unref(),$.onSpawnStart?.(gD.default.cyan(`global oh-my-agent ${$.currentVersion} → ${z} updating in background. New version applies on next run.`)),{triggered:!0,latest:z}}catch{return $.onNotice?.(gD.default.yellow(`global oh-my-agent ${$.currentVersion} → ${z} available. Run: ${G.updateCommand}`)),{triggered:!1,reason:"spawn-failed",latest:z}}}var mD={name:"oh-my-agent",version:"8.2.1",description:"Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",type:"module",bin:{"oh-my-agent":"./bin/cli.js",oma:"./bin/cli.js"},files:["bin"],keywords:["oh-my-agent","antigravity",".agents","agent","skills","agent-skills","multi-agent","orchestrator","claude","claude-code","codex","opencode","copilot","cursor","chatgpt","pm","frontend","backend","mobile","qa","debug","terraform","database","workflow","bug-fixing","gemini"],author:"our.first.fluke <our.first.fluke@gmail.com>",contributors:["gracefullight <gracefullight.dev@gmail.com>","gahyun-git <go4it.gh@gmail.com>"],license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/first-fluke"},{type:"buymeacoffee",url:"https://buymeacoffee.com/firstfluke"}],scripts:{"sync:readme":"node ./scripts/sync-readme.mjs","generate:skill-data":"node ./scripts/generate-skill-data.mjs",build:"bun run generate:skill-data && bun run sync:readme && bun build cli.ts --outfile bin/cli.js --target node --minify --external @napi-rs/keyring",dev:"bun run generate:skill-data && bun run cli.ts",lint:"biome check .","lint:fix":"biome check --write --unsafe .","check:boundaries":"node ./scripts/check-boundaries.mjs",test:"vitest run","test:coverage":"vitest run --coverage",prepublishOnly:"bun run build"},dependencies:{"@clack/prompts":"^1.1.0","@date-fns/tz":"^1.4.1","@napi-rs/keyring":"^1.3.0",axios:"^1.15.0","better-sqlite3":"^12.9.0",chokidar:"^5.0.0",commander:"^14.0.3","date-fns":"^4.2.1",eld:"^2.0.3","fast-xml-parser":"^5",minimatch:"^10.2.5","p-map":"^7.0.4",picocolors:"^1.1.1","puppeteer-core":"^24",remark:"^15.0.1","remark-frontmatter":"^5.0.0","remark-parse":"^11.0.0","smol-toml":"^1.6.1",unified:"^11.0.5",ws:"^8.18.0",yaml:"^2.8.2",zod:"^4.3.6"},devDependencies:{"@biomejs/biome":"^2.4.15","@types/better-sqlite3":"^7.6.13","@types/mdast":"^4.0.4","@types/node":"^24","@types/ws":"^8.18.1","@vitest/coverage-v8":"^4.1.4",typescript:"^6",vitest:"^4.0.18"},repository:{type:"git",url:"https://github.com/first-fluke/oh-my-agent"},antigravity:{skillsPath:".agents/skills",skills:["oma-architecture","oma-brainstorm","oma-coordination","oma-pm","oma-frontend","oma-backend","oma-db","oma-mobile","oma-qa","oma-debug","oma-orchestrator","oma-dev-workflow","oma-tf-infra","oma-scm","oma-pdf","oma-recap"]}};function cC5($){if(!$)return{intro:(G)=>d4(G),outro:(G)=>T5(G),note:(G,J)=>G5(G,J),logError:(G)=>c5.error(G),spinnerStart:(G)=>{let J=D6();return J.start(G),J}};let z={start(G){},stop(G){if(G)console.log(G)},message(G){console.log(G)}};return{intro:(G)=>console.log(G),outro:(G)=>console.log(G),note:(G,J)=>console.log(G),logError:(G)=>console.error(G),spinnerStart:(G)=>{return console.log(G),z}}}function nC5($,z){if($!==null)return"ready";return z?"legacy":"missing"}async function Td($=!1,z=!1){if(!z&&process.stdout.isTTY)console.clear();let G=cC5(z);G.intro(c4.default.bgMagenta(c4.default.white(" \uD83D\uDEF8 oh-my-agent update ")));let J=process.cwd();await sT2({currentVersion:mD.version,enabled:c82(J),onSpawnStart:(Y)=>G.note(Y,"CLI auto-update"),onNotice:(Y)=>G.note(Y,"CLI update available")});let U=await DF(J),K=S82(J),X=nC5(U,K);if(X==="missing"){if(G.logError("oh-my-agent is not installed in this project. Run `oma install` first."),z)throw Error("oh-my-agent is not installed in this project. Run `oma install` first.");process.exit(1)}let Q=cG(J);if(Q.length>0)G.note(Q.map((Y)=>`${c4.default.green("✓")} ${Y}`).join(`
1641
1641
  `),"Migration");let Z=Q.length>0||$y(J);if(Q.length>0&&!$y(J))zy(J,!0);if(!z)await TF(J);if(X==="legacy")G.note("Existing .agents installation detected without _version.json. Updating in place and restoring version metadata.","Legacy install");let j;try{j=G.spinnerStart("Checking for updates...");let Y=await g82();if(U===Y.version&&!Z){j.stop(c4.default.green("Already up to date!")),G.outro(`Current version: ${c4.default.cyan(U)}`);return}let W=U===Y.version;j.message(`Downloading ${c4.default.cyan(Y.version)}...`);let{dir:L,cleanup:k}=await hK();try{j.message("Copying files..."),cG(J);let H=l7(J,".agents","oma-config.yaml"),B=l7(J,".agents","mcp.json"),A=!$&&ZU(H)?eT2(H):null,V=!$&&ZU(B)?eT2(B):null,F=l7(lC5(),`oma-stack-backup-${Date.now()}`),N=l7(J,".agents","skills","oma-backend","stack"),u=!$&&ZU(N);if(u)Dd(F,{recursive:!0}),fD(N,l7(F,"oma-backend"),{recursive:!0});let q=["snippets.md","tech-stack.md","api-template.py"],I=l7(J,".agents","skills","oma-backend","resources"),D=!$&&!u&&q.some((r)=>ZU(l7(I,r))),M=Gy(J);if(fD(l7(L,".agents"),l7(J,".agents"),{recursive:!0,force:!0}),A)Ed(H,A);if(V)Ed(B,V);if(u)try{Dd(N,{recursive:!0}),fD(l7(F,"oma-backend"),N,{recursive:!0,force:!0})}finally{Id(F,{recursive:!0,force:!0})}if(D){let r=l7(L,".agents","skills","oma-backend","variants","python");if(ZU(r))Dd(N,{recursive:!0}),fD(r,N,{recursive:!0,force:!0}),Ed(l7(N,"stack.yaml"),`language: python
1642
1642
  framework: fastapi
1643
1643
  orm: sqlalchemy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-agent",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "description": "Portable multi-agent harness for .agents-based skills and workflows across Antigravity, Claude Code, Codex, OpenCode, and more",
5
5
  "type": "module",
6
6
  "bin": {