claude-mem 12.3.9 → 12.4.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/npx-cli/index.js +140 -146
- package/openclaw/package.json +2 -2
- package/package.json +29 -23
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +3 -3
- package/plugin/package.json +1 -1
- package/plugin/scripts/context-generator.cjs +70 -56
- package/plugin/scripts/mcp-server.cjs +40 -47
- package/plugin/scripts/worker-service.cjs +252 -309
- package/plugin/skills/pathfinder/SKILL.md +111 -0
- package/plugin/skills/version-bump/SKILL.md +3 -2
package/dist/npx-cli/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`,"utf-8")}var
|
|
2
|
+
var ys=Object.create;var Jt=Object.defineProperty;var ws=Object.getOwnPropertyDescriptor;var vs=Object.getOwnPropertyNames;var _s=Object.getPrototypeOf,xs=Object.prototype.hasOwnProperty;var ks=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var m=(t,e)=>()=>(t&&(e=t(t=0)),e);var Qr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Y=(t,e)=>{for(var r in e)Jt(t,r,{get:e[r],enumerable:!0})},As=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of vs(e))!xs.call(t,s)&&s!==r&&Jt(t,s,{get:()=>e[s],enumerable:!(o=ws(e,s))||o.enumerable});return t};var ie=(t,e,r)=>(r=t!=null?ys(_s(t)):{},As(e||!t||!t.__esModule?Jt(r,"default",{value:t,enumerable:!0}):r,t));var de=Qr((hc,Yt)=>{var at=process||{},en=at.argv||[],ut=at.env||{},bs=!(ut.NO_COLOR||en.includes("--no-color"))&&(!!ut.FORCE_COLOR||en.includes("--color")||at.platform==="win32"||(at.stdout||{}).isTTY&&ut.TERM!=="dumb"||!!ut.CI),Ms=(t,e,r=t)=>o=>{let s=""+o,i=s.indexOf(e,t.length);return~i?t+Is(s,e,r,i)+e:t+s+e},Is=(t,e,r,o)=>{let s="",i=0;do s+=t.substring(i,o)+r,i=o+e.length,o=t.indexOf(e,i);while(~o);return s+t.substring(i)},tn=(t=bs)=>{let e=t?Ms:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Yt.exports=tn();Yt.exports.createColors=tn});import{existsSync as $s,readFileSync as Ts}from"fs";function G(t,e){if(!$s(t))return e;try{return JSON.parse(Ts(t,"utf-8"))}catch(r){throw new Error(`Corrupt JSON file, refusing to overwrite: ${t}: ${r instanceof Error?r.message:String(r)}`)}}var Ie=m(()=>{"use strict"});import{existsSync as $e,mkdirSync as Rs,readFileSync as rn,writeFileSync as Ps}from"fs";import{homedir as Os}from"os";import{dirname as nn,join as P}from"path";import{fileURLToPath as Ls}from"url";function Vt(){return process.env.CLAUDE_CONFIG_DIR||P(Os(),".claude")}function b(){return P(Vt(),"plugins","marketplaces","thedotmack")}function ue(){return P(Vt(),"plugins")}function pe(){return P(ue(),"known_marketplaces.json")}function me(){return P(ue(),"installed_plugins.json")}function ge(){return P(Vt(),"settings.json")}function Xt(t){return P(ue(),"cache","thedotmack","claude-mem",t)}function ct(){let t=Ls(import.meta.url),e=P(nn(t),"..","..");if(!$e(P(e,"package.json")))throw new Error(`npmPackageRootDirectory: expected package.json at ${e}. Bundle structure may have changed \u2014 update the path walk.`);return e}function zt(){return P(ct(),"plugin")}function Te(){let t=P(zt(),".claude-plugin","plugin.json");if($e(t))try{let r=JSON.parse(rn(t,"utf-8"));if(r.version)return r.version}catch{}let e=P(ct(),"package.json");if($e(e))try{let r=JSON.parse(rn(e,"utf-8"));if(r.version)return r.version}catch{}return"0.0.0"}function lt(){let t=b();return $e(P(t,"plugin",".claude-plugin","plugin.json"))}function Re(t){$e(t)||Rs(t,{recursive:!0})}function Z(t,e){Re(nn(t)),Ps(t,JSON.stringify(e,null,2)+`
|
|
3
|
+
`,"utf-8")}var z,ae=m(()=>{"use strict";Ie();z=process.platform==="win32"});var Zt=Qr((Ac,on)=>{"use strict";var qt={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Bs={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Ns={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?qt.up():"");return t&&(e+=qt.left),e}};on.exports={cursor:qt,scroll:Bs,erase:Ns,beep:"\x07"}});import{stdin as mn,stdout as gn}from"node:process";import*as Q from"node:readline";import sn from"node:readline";import{WriteStream as js}from"node:tty";function Us({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}function fn(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Gs,"")}function Cn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Pe(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=fn(t),t.length===0))return 0;t=t.replace(Js()," ");let r=e.ambiguousIsNarrow?1:2,o=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(Hs.eastAsianWidth(s)){case"F":case"W":o+=2;break;case"A":o+=r;break;default:o+=1}}return o}function Xs(){let t=new Map;for(let[e,r]of Object.entries(C)){for(let[o,s]of Object.entries(r))C[o]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[o]=C[o],t.set(s[0],s[1]);Object.defineProperty(C,e,{value:r,enumerable:!1})}return Object.defineProperty(C,"codes",{value:t,enumerable:!1}),C.color.close="\x1B[39m",C.bgColor.close="\x1B[49m",C.color.ansi=un(),C.color.ansi256=an(),C.color.ansi16m=cn(),C.bgColor.ansi=un(Qt),C.bgColor.ansi256=an(Qt),C.bgColor.ansi16m=cn(Qt),Object.defineProperties(C,{rgbToAnsi256:{value:(e,r,o)=>e===r&&r===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[o]=r;o.length===3&&(o=[...o].map(i=>i+i).join(""));let s=Number.parseInt(o,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>C.rgbToAnsi256(...C.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,o,s;if(e>=232)r=((e-232)*10+8)/255,o=r,s=r;else{e-=16;let u=e%36;r=Math.floor(e/36)/5,o=Math.floor(u/6)/5,s=u%6/5}let i=Math.max(r,o,s)*2;if(i===0)return 30;let n=30+(Math.round(s)<<2|Math.round(o)<<1|Math.round(r));return i===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(e,r,o)=>C.ansi256ToAnsi(C.rgbToAnsi256(e,r,o)),enumerable:!1},hexToAnsi:{value:e=>C.ansi256ToAnsi(C.hexToAnsi256(e)),enumerable:!1}}),C}function dn(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
4
4
|
`).split(`
|
|
5
|
-
`).map(
|
|
6
|
-
`)}function
|
|
7
|
-
`),
|
|
8
|
-
`),s=[];for(let i=0;i<Math.max(n.length,r.length);i++)n[i]!==r[i]&&s.push(i);return s}function ee(t){return t===Zt}function at(t,e){let n=t;n.isTTY&&n.setRawMode(e)}function mo({input:t=so,output:e=io,overwrite:n=!0,hideCursor:r=!0}={}){let s=Q.createInterface({input:t,output:e,prompt:"",tabSize:1});Q.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(o,{name:u,sequence:c})=>{let d=String(o);if(tn([d,u,c],"cancel")){r&&e.write(A.cursor.show),process.exit(0);return}if(!n)return;Q.moveCursor(e,u==="return"?0:-1,u==="return"?-1:0,()=>{Q.clearLine(e,1,()=>{t.once("keypress",i)})})};return r&&e.write(A.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),r&&e.write(A.cursor.show),t.isTTY&&!Os&&t.setRawMode(!1),s.terminal=!1,s.close()}}var A,fs,co,Es,hs,Fs,ys,qt,Zn,Qn,eo,f,xs,Ss,_s,dt,ws,Qt,lo,As,Do,en,to,no,bs,zt,ks,$s,Ms,ct,Os,Zt,Rs,Ts,R,lt,Dt,Bs,Ls,ro,po,nn=C(()=>{A=ue(Xt(),1);fs=Cs();co={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(r){var s=r.charCodeAt(0),i=r.length==2?r.charCodeAt(1):0,o=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,o=s<<10|i,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function n(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var s=n(r),i=0,o=0;o<s.length;o++)i=i+this.characterLength(s[o]);return i},e.slice=function(r,s,i){textLen=e.length(r),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var o="",u=0,c=n(r),d=0;d<c.length;d++){var m=c[d],l=e.length(m);if(u>=s-(l==2?1:0))if(u+l<=i)o+=m;else break;u+=l}return o}})(co);Es=co.exports,hs=ao(Es),Fs=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},ys=ao(Fs);qt=10,Zn=(t=0)=>e=>`\x1B[${e+t}m`,Qn=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,eo=(t=0)=>(e,n,r)=>`\x1B[${38+t};2;${e};${n};${r}m`,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(f.modifier);xs=Object.keys(f.color),Ss=Object.keys(f.bgColor);[...xs,...Ss];_s=vs(),dt=new Set(["\x1B","\x9B"]),ws=39,Qt="\x07",lo="[",As="]",Do="m",en=`${As}8;;`,to=t=>`${dt.values().next().value}${lo}${t}${Do}`,no=t=>`${dt.values().next().value}${en}${t}${Qt}`,bs=t=>t.split(" ").map(e=>Te(e)),zt=(t,e,n)=>{let r=[...e],s=!1,i=!1,o=Te(uo(t[t.length-1]));for(let[u,c]of r.entries()){let d=Te(c);if(o+d<=n?t[t.length-1]+=c:(t.push(c),o=0),dt.has(c)&&(s=!0,i=r.slice(u+1).join("").startsWith(en)),s){i?c===Qt&&(s=!1,i=!1):c===Do&&(s=!1);continue}o+=d,o===n&&u<r.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},ks=t=>{let e=t.split(" "),n=e.length;for(;n>0&&!(Te(e[n-1])>0);)n--;return n===e.length?t:e.slice(0,n).join(" ")+e.slice(n).join("")},$s=(t,e,n={})=>{if(n.trim!==!1&&t.trim()==="")return"";let r="",s,i,o=bs(t),u=[""];for(let[d,m]of t.split(" ").entries()){n.trim!==!1&&(u[u.length-1]=u[u.length-1].trimStart());let l=Te(u[u.length-1]);if(d!==0&&(l>=e&&(n.wordWrap===!1||n.trim===!1)&&(u.push(""),l=0),(l>0||n.trim===!1)&&(u[u.length-1]+=" ",l++)),n.hard&&o[d]>e){let E=e-l,v=1+Math.floor((o[d]-E-1)/e);Math.floor((o[d]-1)/e)<v&&u.push(""),zt(u,m,e);continue}if(l+o[d]>e&&l>0&&o[d]>0){if(n.wordWrap===!1&&l<e){zt(u,m,e);continue}u.push("")}if(l+o[d]>e&&n.wordWrap===!1){zt(u,m,e);continue}u[u.length-1]+=m}n.trim!==!1&&(u=u.map(d=>ks(d)));let c=[...u.join(`
|
|
9
|
-
`)];for(let[d,
|
|
10
|
-
`?(i&&(
|
|
11
|
-
`&&(s&&
|
|
12
|
-
`),
|
|
13
|
-
`).length-1;this.output.write(
|
|
14
|
-
`);this.output.write(s[
|
|
15
|
-
`).slice(
|
|
16
|
-
`)),this._prevFrame=e;return}this.output.write(
|
|
17
|
-
${
|
|
18
|
-
`,s=this.value?e:
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
`}}}).prompt()},
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
`,
|
|
25
|
-
${
|
|
26
|
-
`).map((i,
|
|
27
|
-
`);return`${
|
|
28
|
-
${
|
|
5
|
+
`).map(o=>ti(o,e,r)).join(`
|
|
6
|
+
`)}function or(t,e){if(typeof t=="string")return dt.aliases.get(t)===e;for(let r of t)if(r!==void 0&&or(r,e))return!0;return!1}function ni(t,e){if(t===e)return;let r=t.split(`
|
|
7
|
+
`),o=e.split(`
|
|
8
|
+
`),s=[];for(let i=0;i<Math.max(r.length,o.length);i++)r[i]!==o[i]&&s.push(i);return s}function ee(t){return t===tr}function Dt(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function Sn({input:t=mn,output:e=gn,overwrite:r=!0,hideCursor:o=!0}={}){let s=Q.createInterface({input:t,output:e,prompt:"",tabSize:1});Q.emitKeypressEvents(t,s),t.isTTY&&t.setRawMode(!0);let i=(n,{name:u,sequence:c})=>{let d=String(n);if(or([d,u,c],"cancel")){o&&e.write(k.cursor.show),process.exit(0);return}if(!r)return;Q.moveCursor(e,u==="return"?0:-1,u==="return"?-1:0,()=>{Q.clearLine(e,1,()=>{t.once("keypress",i)})})};return o&&e.write(k.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),o&&e.write(k.cursor.show),t.isTTY&&!oi&&t.setRawMode(!1),s.terminal=!1,s.close()}}var k,Gs,En,Ws,Hs,Ks,Js,Qt,un,an,cn,C,Ys,Vs,zs,gt,qs,rr,hn,Zs,Fn,nr,ln,Dn,Qs,er,ei,ti,ri,dt,oi,tr,si,ii,O,pt,mt,ui,ai,pn,yn,sr=m(()=>{k=ie(Zt(),1);Gs=Us();En={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(o){var s=o.charCodeAt(0),i=o.length==2?o.charCodeAt(1):0,n=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,n=s<<10|i,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},e.characterLength=function(o){var s=this.eastAsianWidth(o);return s=="F"||s=="W"||s=="A"?2:1};function r(o){return o.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(o){for(var s=r(o),i=0,n=0;n<s.length;n++)i=i+this.characterLength(s[n]);return i},e.slice=function(o,s,i){textLen=e.length(o),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var n="",u=0,c=r(o),d=0;d<c.length;d++){var p=c[d],D=e.length(p);if(u>=s-(D==2?1:0))if(u+D<=i)n+=p;else break;u+=D}return n}})(En);Ws=En.exports,Hs=Cn(Ws),Ks=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Js=Cn(Ks);Qt=10,un=(t=0)=>e=>`\x1B[${e+t}m`,an=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,cn=(t=0)=>(e,r,o)=>`\x1B[${38+t};2;${e};${r};${o}m`,C={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(C.modifier);Ys=Object.keys(C.color),Vs=Object.keys(C.bgColor);[...Ys,...Vs];zs=Xs(),gt=new Set(["\x1B","\x9B"]),qs=39,rr="\x07",hn="[",Zs="]",Fn="m",nr=`${Zs}8;;`,ln=t=>`${gt.values().next().value}${hn}${t}${Fn}`,Dn=t=>`${gt.values().next().value}${nr}${t}${rr}`,Qs=t=>t.split(" ").map(e=>Pe(e)),er=(t,e,r)=>{let o=[...e],s=!1,i=!1,n=Pe(fn(t[t.length-1]));for(let[u,c]of o.entries()){let d=Pe(c);if(n+d<=r?t[t.length-1]+=c:(t.push(c),n=0),gt.has(c)&&(s=!0,i=o.slice(u+1).join("").startsWith(nr)),s){i?c===rr&&(s=!1,i=!1):c===Fn&&(s=!1);continue}n+=d,n===r&&u<o.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},ei=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(Pe(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},ti=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let o="",s,i,n=Qs(t),u=[""];for(let[d,p]of t.split(" ").entries()){r.trim!==!1&&(u[u.length-1]=u[u.length-1].trimStart());let D=Pe(u[u.length-1]);if(d!==0&&(D>=e&&(r.wordWrap===!1||r.trim===!1)&&(u.push(""),D=0),(D>0||r.trim===!1)&&(u[u.length-1]+=" ",D++)),r.hard&&n[d]>e){let E=e-D,v=1+Math.floor((n[d]-E-1)/e);Math.floor((n[d]-1)/e)<v&&u.push(""),er(u,p,e);continue}if(D+n[d]>e&&D>0&&n[d]>0){if(r.wordWrap===!1&&D<e){er(u,p,e);continue}u.push("")}if(D+n[d]>e&&r.wordWrap===!1){er(u,p,e);continue}u[u.length-1]+=p}r.trim!==!1&&(u=u.map(d=>ei(d)));let c=[...u.join(`
|
|
9
|
+
`)];for(let[d,p]of c.entries()){if(o+=p,gt.has(p)){let{groups:E}=new RegExp(`(?:\\${hn}(?<code>\\d+)m|\\${nr}(?<uri>.*)${rr})`).exec(c.slice(d).join(""))||{groups:{}};if(E.code!==void 0){let v=Number.parseFloat(E.code);s=v===qs?void 0:v}else E.uri!==void 0&&(i=E.uri.length===0?void 0:E.uri)}let D=zs.codes.get(Number(s));c[d+1]===`
|
|
10
|
+
`?(i&&(o+=Dn("")),s&&D&&(o+=ln(D))):p===`
|
|
11
|
+
`&&(s&&D&&(o+=ln(s)),i&&(o+=Dn(i)))}return o};ri=["up","down","left","right","space","enter","cancel"],dt={actions:new Set(ri),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};oi=globalThis.process.platform.startsWith("win"),tr=Symbol("clack:cancel");si=Object.defineProperty,ii=(t,e,r)=>e in t?si(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O=(t,e,r)=>(ii(t,typeof e!="symbol"?e+"":e,r),r),pt=class{constructor(e,r=!0){O(this,"input"),O(this,"output"),O(this,"_abortSignal"),O(this,"rl"),O(this,"opts"),O(this,"_render"),O(this,"_track",!1),O(this,"_prevFrame",""),O(this,"_subscribers",new Map),O(this,"_cursor",0),O(this,"state","initial"),O(this,"error",""),O(this,"value");let{input:o=mn,output:s=gn,render:i,signal:n,...u}=e;this.opts=u,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=r,this._abortSignal=n,this.input=o,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let o=this._subscribers.get(e)??[];o.push(r),this._subscribers.set(e,o)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let o=this._subscribers.get(e)??[],s=[];for(let i of o)i.cb(...r),i.once&&s.push(()=>o.splice(o.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(tr);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let o=new js(0);o._write=(s,i,n)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),n()},this.input.pipe(o),this.rl=sn.createInterface({input:this.input,output:o,tabSize:2,prompt:"",escapeCodeTimeout:50}),sn.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Dt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(k.cursor.show),this.output.off("resize",this.render),Dt(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(k.cursor.show),this.output.off("resize",this.render),Dt(this.input,!1),e(tr)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&dt.aliases.has(r.name)&&this.emit("cursor",dt.aliases.get(r.name)),dt.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(this.opts.validate){let o=this.opts.validate(this.value);o&&(this.error=o instanceof Error?o.message:o,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}or([e,r?.name,r?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
12
|
+
`),Dt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=dn(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
13
|
+
`).length-1;this.output.write(k.cursor.move(-999,e*-1))}render(){let e=dn(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(k.cursor.hide);else{let r=ni(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let o=r[0];this.output.write(k.cursor.move(0,o)),this.output.write(k.erase.lines(1));let s=e.split(`
|
|
14
|
+
`);this.output.write(s[o]),this._prevFrame=e,this.output.write(k.cursor.move(0,s.length-o-1));return}if(r&&r?.length>1){let o=r[0];this.output.write(k.cursor.move(0,o)),this.output.write(k.erase.down());let s=e.split(`
|
|
15
|
+
`).slice(o);this.output.write(s.join(`
|
|
16
|
+
`)),this._prevFrame=e;return}this.output.write(k.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},mt=class extends pt{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(k.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},ui=Object.defineProperty,ai=(t,e,r)=>e in t?ui(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pn=(t,e,r)=>(ai(t,typeof e!="symbol"?e+"":e,r),r),yn=class extends pt{constructor(t){super(t,!1),pn(this,"options"),pn(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:e})=>e===t.cursorAt),0),this.on("key",e=>{e==="a"&&this.toggleAll()}),this.on("cursor",e=>{switch(e){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(e=>e.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(e=>e!==this._value):[...this.value,this._value]}}});import{stripVTControlCharacters as ir}from"node:util";import W from"node:process";function ci(){return W.platform!=="win32"?W.env.TERM!=="linux":!!W.env.CI||!!W.env.WT_SESSION||!!W.env.TERMINUS_SUBLIME||W.env.ConEmuTask==="{cmd::Cmder}"||W.env.TERM_PROGRAM==="Terminus-Sublime"||W.env.TERM_PROGRAM==="vscode"||W.env.TERM==="xterm-256color"||W.env.TERM==="alacritty"||W.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var l,ft,ur,y,li,An,bn,Ct,Di,S,Oe,wn,vn,di,_n,pi,Wc,xn,mi,gi,fi,Ci,Ei,hi,Fi,Mn,kn,Le,In,Be,Ne,Et,ce,M,Si,ht,ar=m(()=>{sr();sr();l=ie(de(),1),ft=ie(Zt(),1);ur=ci(),y=(t,e)=>ur?t:e,li=y("\u25C6","*"),An=y("\u25A0","x"),bn=y("\u25B2","x"),Ct=y("\u25C7","o"),Di=y("\u250C","T"),S=y("\u2502","|"),Oe=y("\u2514","\u2014"),wn=y("\u25CF",">"),vn=y("\u25CB"," "),di=y("\u25FB","[\u2022]"),_n=y("\u25FC","[+]"),pi=y("\u25FB","[ ]"),Wc=y("\u25AA","\u2022"),xn=y("\u2500","-"),mi=y("\u256E","+"),gi=y("\u251C","+"),fi=y("\u256F","+"),Ci=y("\u25CF","\u2022"),Ei=y("\u25C6","*"),hi=y("\u25B2","!"),Fi=y("\u25A0","x"),Mn=t=>{switch(t){case"initial":case"active":return l.default.cyan(li);case"cancel":return l.default.red(An);case"error":return l.default.yellow(bn);case"submit":return l.default.green(Ct)}},kn=t=>{let{cursor:e,options:r,style:o}=t,s=t.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),n=Math.min(i,Math.max(s,5)),u=0;e>=u+n-3?u=Math.max(Math.min(e-n+3,r.length-n),0):e<u+2&&(u=Math.max(e-2,0));let c=n<r.length&&u>0,d=n<r.length&&u+n<r.length;return r.slice(u,u+n).map((p,D,E)=>{let v=D===0&&c,De=D===E.length-1&&d;return v||De?l.default.dim("..."):o(p,D+u===e)})},Le=t=>{let e=t.active??"Yes",r=t.inactive??"No";return new mt({active:e,inactive:r,initialValue:t.initialValue??!0,render(){let o=`${l.default.gray(S)}
|
|
17
|
+
${Mn(this.state)} ${t.message}
|
|
18
|
+
`,s=this.value?e:r;switch(this.state){case"submit":return`${o}${l.default.gray(S)} ${l.default.dim(s)}`;case"cancel":return`${o}${l.default.gray(S)} ${l.default.strikethrough(l.default.dim(s))}
|
|
19
|
+
${l.default.gray(S)}`;default:return`${o}${l.default.cyan(S)} ${this.value?`${l.default.green(wn)} ${e}`:`${l.default.dim(vn)} ${l.default.dim(e)}`} ${l.default.dim("/")} ${this.value?`${l.default.dim(vn)} ${l.default.dim(r)}`:`${l.default.green(wn)} ${r}`}
|
|
20
|
+
${l.default.cyan(Oe)}
|
|
21
|
+
`}}}).prompt()},In=t=>{let e=(r,o)=>{let s=r.label??String(r.value);return o==="active"?`${l.default.cyan(di)} ${s} ${r.hint?l.default.dim(`(${r.hint})`):""}`:o==="selected"?`${l.default.green(_n)} ${l.default.dim(s)}`:o==="cancelled"?`${l.default.strikethrough(l.default.dim(s))}`:o==="active-selected"?`${l.default.green(_n)} ${s} ${r.hint?l.default.dim(`(${r.hint})`):""}`:o==="submitted"?`${l.default.dim(s)}`:`${l.default.dim(pi)} ${l.default.dim(s)}`};return new yn({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
|
|
22
|
+
${l.default.reset(l.default.dim(`Press ${l.default.gray(l.default.bgWhite(l.default.inverse(" space ")))} to select, ${l.default.gray(l.default.bgWhite(l.default.inverse(" enter ")))} to submit`))}`},render(){let r=`${l.default.gray(S)}
|
|
23
|
+
${Mn(this.state)} ${t.message}
|
|
24
|
+
`,o=(s,i)=>{let n=this.value.includes(s.value);return i&&n?e(s,"active-selected"):n?e(s,"selected"):e(s,i?"active":"inactive")};switch(this.state){case"submit":return`${r}${l.default.gray(S)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(l.default.dim(", "))||l.default.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(l.default.dim(", "));return`${r}${l.default.gray(S)} ${s.trim()?`${s}
|
|
25
|
+
${l.default.gray(S)}`:""}`}case"error":{let s=this.error.split(`
|
|
26
|
+
`).map((i,n)=>n===0?`${l.default.yellow(Oe)} ${l.default.yellow(i)}`:` ${i}`).join(`
|
|
27
|
+
`);return`${r+l.default.yellow(S)} ${kn({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:o}).join(`
|
|
28
|
+
${l.default.yellow(S)} `)}
|
|
29
29
|
${s}
|
|
30
|
-
`}default:return`${
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
`}}}).prompt()},
|
|
30
|
+
`}default:return`${r}${l.default.cyan(S)} ${kn({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:o}).join(`
|
|
31
|
+
${l.default.cyan(S)} `)}
|
|
32
|
+
${l.default.cyan(Oe)}
|
|
33
|
+
`}}}).prompt()},Be=(t="",e="")=>{let r=`
|
|
34
34
|
${t}
|
|
35
35
|
`.split(`
|
|
36
|
-
`),
|
|
37
|
-
`);process.stdout.write(`${
|
|
38
|
-
${
|
|
36
|
+
`),o=ir(e).length,s=Math.max(r.reduce((n,u)=>{let c=ir(u);return c.length>n?c.length:n},0),o)+2,i=r.map(n=>`${l.default.gray(S)} ${l.default.dim(n)}${" ".repeat(s-ir(n).length)}${l.default.gray(S)}`).join(`
|
|
37
|
+
`);process.stdout.write(`${l.default.gray(S)}
|
|
38
|
+
${l.default.green(Ct)} ${l.default.reset(e)} ${l.default.gray(xn.repeat(Math.max(s-o-1,1))+mi)}
|
|
39
39
|
${i}
|
|
40
|
-
${
|
|
41
|
-
`)},
|
|
40
|
+
${l.default.gray(gi+xn.repeat(s+2)+fi)}
|
|
41
|
+
`)},Ne=(t="")=>{process.stdout.write(`${l.default.gray(Oe)} ${l.default.red(t)}
|
|
42
42
|
|
|
43
|
-
`)},
|
|
44
|
-
`)},
|
|
45
|
-
${
|
|
43
|
+
`)},Et=(t="")=>{process.stdout.write(`${l.default.gray(Di)} ${t}
|
|
44
|
+
`)},ce=(t="")=>{process.stdout.write(`${l.default.gray(S)}
|
|
45
|
+
${l.default.gray(Oe)} ${t}
|
|
46
46
|
|
|
47
|
-
`)}
|
|
48
|
-
`);
|
|
47
|
+
`)},M={message:(t="",{symbol:e=l.default.gray(S)}={})=>{let r=[`${l.default.gray(S)}`];if(t){let[o,...s]=t.split(`
|
|
48
|
+
`);r.push(`${e} ${o}`,...s.map(i=>`${l.default.gray(S)} ${i}`))}process.stdout.write(`${r.join(`
|
|
49
49
|
`)}
|
|
50
|
-
`)},info:t=>{
|
|
51
|
-
`);let
|
|
52
|
-
`);process.stdout.write(
|
|
53
|
-
`);let U=0,
|
|
54
|
-
`),E(),
|
|
55
|
-
${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let
|
|
50
|
+
`)},info:t=>{M.message(t,{symbol:l.default.blue(Ci)})},success:t=>{M.message(t,{symbol:l.default.green(Ei)})},step:t=>{M.message(t,{symbol:l.default.green(Ct)})},warn:t=>{M.message(t,{symbol:l.default.yellow(hi)})},warning:t=>{M.warn(t)},error:t=>{M.message(t,{symbol:l.default.red(Fi)})}},Si=()=>{let t=ur?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=ur?80:120,r=process.env.CI==="true",o,s,i=!1,n="",u,c=$=>{let U=$>1?"Something went wrong":"Canceled";i&&Me(U,$)},d=()=>c(2),p=()=>c(1),D=()=>{process.on("uncaughtExceptionMonitor",d),process.on("unhandledRejection",d),process.on("SIGINT",p),process.on("SIGTERM",p),process.on("exit",c)},E=()=>{process.removeListener("uncaughtExceptionMonitor",d),process.removeListener("unhandledRejection",d),process.removeListener("SIGINT",p),process.removeListener("SIGTERM",p),process.removeListener("exit",c)},v=()=>{if(u===void 0)return;r&&process.stdout.write(`
|
|
51
|
+
`);let $=u.split(`
|
|
52
|
+
`);process.stdout.write(ft.cursor.move(-999,$.length-1)),process.stdout.write(ft.erase.down($.length))},De=$=>$.replace(/\.+$/,""),Zr=($="")=>{i=!0,o=Sn(),n=De($),process.stdout.write(`${l.default.gray(S)}
|
|
53
|
+
`);let U=0,q=0;D(),s=setInterval(()=>{if(r&&n===u)return;v(),u=n;let Fs=l.default.magenta(t[U]),Ss=r?"...":".".repeat(Math.floor(q)).slice(0,3);process.stdout.write(`${Fs} ${n}${Ss}`),U=U+1<t.length?U+1:0,q=q<t.length?q+.125:0},e)},Me=($="",U=0)=>{i=!1,clearInterval(s),v();let q=U===0?l.default.green(Ct):U===1?l.default.red(An):l.default.red(bn);n=De($??n),process.stdout.write(`${q} ${n}
|
|
54
|
+
`),E(),o()};return{start:Zr,stop:Me,message:($="")=>{n=De($??n)}}},ht=async t=>{for(let e of t){if(e.enabled===!1)continue;let r=Si();r.start(e.title);let o=await e.task(r.message);r.stop(o||e.title)}}});import{execSync as yi}from"child_process";import{existsSync as H,readdirSync as wi}from"fs";import{homedir as Tn}from"os";import{join as K}from"path";function je(t){try{return yi(`${z?"where":"which"} ${t}`,{stdio:"pipe"}),!0}catch(e){return process.env.DEBUG&&console.error(`[ide-detection] ${t} not in PATH:`,e instanceof Error?e.message:String(e)),!1}}function vi(t){let e=K(Tn(),".vscode","extensions");if(!H(e))return!1;try{return wi(e).some(o=>o.toLowerCase().includes(t.toLowerCase()))}catch(r){return console.warn("[ide-detection] Failed to read VS Code extensions directory:",r instanceof Error?r.message:String(r)),!1}}function Ue(){let t=Tn();return[{id:"claude-code",label:"Claude Code",detected:H(K(t,".claude")),supported:!0,hint:"recommended"},{id:"gemini-cli",label:"Gemini CLI",detected:H(K(t,".gemini")),supported:!0},{id:"opencode",label:"OpenCode",detected:H(K(t,".config","opencode"))||je("opencode"),supported:!0,hint:"plugin-based integration"},{id:"openclaw",label:"OpenClaw",detected:H(K(t,".openclaw")),supported:!0,hint:"plugin-based integration"},{id:"windsurf",label:"Windsurf",detected:H(K(t,".codeium","windsurf")),supported:!0},{id:"codex-cli",label:"Codex CLI",detected:H(K(t,".codex")),supported:!0,hint:"transcript-based integration"},{id:"cursor",label:"Cursor",detected:H(K(t,".cursor")),supported:!0,hint:"hooks + MCP integration"},{id:"copilot-cli",label:"Copilot CLI",detected:je("copilot"),supported:!0,hint:"MCP-based integration"},{id:"antigravity",label:"Antigravity",detected:H(K(t,".gemini","antigravity")),supported:!0,hint:"MCP-based integration"},{id:"goose",label:"Goose",detected:H(K(t,".config","goose"))||je("goose"),supported:!0,hint:"MCP-based integration"},{id:"crush",label:"Crush",detected:je("crush"),supported:!0,hint:"MCP-based integration"},{id:"roo-code",label:"Roo Code",detected:vi("roo-code"),supported:!0,hint:"MCP-based integration"},{id:"warp",label:"Warp",detected:H(K(t,".warp"))||je("warp"),supported:!0,hint:"MCP-based integration"}]}var Rn=m(()=>{"use strict";ae()});import{appendFileSync as _i,existsSync as Pn,mkdirSync as xi,readFileSync as ki}from"fs";import{join as Ft}from"path";import{homedir as Ai}from"os";var cr,On,lr,a,T=m(()=>{"use strict";cr=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(cr||{}),On=Ft(Ai(),".claude-mem"),lr=class{level=null;useColor;logFilePath=null;logFileInitialized=!1;constructor(){this.useColor=process.stdout.isTTY??!1}ensureLogFileInitialized(){if(!this.logFileInitialized){this.logFileInitialized=!0;try{let e=Ft(On,"logs");Pn(e)||xi(e,{recursive:!0});let r=new Date().toISOString().split("T")[0];this.logFilePath=Ft(e,`claude-mem-${r}.log`)}catch(e){console.error("[LOGGER] Failed to initialize log file:",e instanceof Error?e.message:String(e)),this.logFilePath=null}}}getLevel(){if(this.level===null)try{let e=Ft(On,"settings.json");if(Pn(e)){let r=ki(e,"utf-8"),s=(JSON.parse(r).CLAUDE_MEM_LOG_LEVEL||"INFO").toUpperCase();this.level=cr[s]??1}else this.level=1}catch(e){console.error("[LOGGER] Failed to load log level from settings:",e instanceof Error?e.message:String(e)),this.level=1}return this.level}correlationId(e,r){return`obs-${e}-${r}`}sessionId(e){return`session-${e}`}formatData(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(typeof e=="object"){if(e instanceof Error)return this.getLevel()===0?`${e.message}
|
|
55
|
+
${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let r=Object.keys(e);return r.length===0?"{}":r.length<=3?JSON.stringify(e):`{${r.length} keys: ${r.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,r){if(!r)return e;let o=r;if(typeof r=="string")try{o=JSON.parse(r)}catch{o=r}if(e==="Bash"&&o.command)return`${e}(${o.command})`;if(o.file_path)return`${e}(${o.file_path})`;if(o.notebook_path)return`${e}(${o.notebook_path})`;if(e==="Glob"&&o.pattern)return`${e}(${o.pattern})`;if(e==="Grep"&&o.pattern)return`${e}(${o.pattern})`;if(o.url)return`${e}(${o.url})`;if(o.query)return`${e}(${o.query})`;if(e==="Task"){if(o.subagent_type)return`${e}(${o.subagent_type})`;if(o.description)return`${e}(${o.description})`}return e==="Skill"&&o.skill?`${e}(${o.skill})`:e==="LSP"&&o.operation?`${e}(${o.operation})`:e}formatTimestamp(e){let r=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0"),i=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),u=String(e.getSeconds()).padStart(2,"0"),c=String(e.getMilliseconds()).padStart(3,"0");return`${r}-${o}-${s} ${i}:${n}:${u}.${c}`}log(e,r,o,s,i){if(e<this.getLevel())return;this.ensureLogFileInitialized();let n=this.formatTimestamp(new Date),u=cr[e].padEnd(5),c=r.padEnd(6),d="";s?.correlationId?d=`[${s.correlationId}] `:s?.sessionId&&(d=`[session-${s.sessionId}] `);let p="";i!=null&&(i instanceof Error?p=this.getLevel()===0?`
|
|
56
56
|
${i.message}
|
|
57
|
-
${i.stack}`:` ${i.message}`:this.getLevel()===0&&typeof i=="object"?
|
|
58
|
-
`+JSON.stringify(i,null,2):
|
|
57
|
+
${i.stack}`:` ${i.message}`:this.getLevel()===0&&typeof i=="object"?p=`
|
|
58
|
+
`+JSON.stringify(i,null,2):p=" "+this.formatData(i));let D="";if(s){let{sessionId:v,memorySessionId:De,correlationId:Zr,...Me}=s;Object.keys(Me).length>0&&(D=` {${Object.entries(Me).map(([U,q])=>`${U}=${q}`).join(", ")}}`)}let E=`[${n}] [${u}] [${c}] ${d}${o}${D}${p}`;if(this.logFilePath)try{_i(this.logFilePath,E+`
|
|
59
59
|
`,"utf8")}catch(v){process.stderr.write(`[LOGGER] Failed to write to log file: ${v instanceof Error?v.message:String(v)}
|
|
60
60
|
`)}else process.stderr.write(E+`
|
|
61
|
-
`)}debug(e,
|
|
62
|
-
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),m=d?`${d[1].split("/").pop()}:${d[2]}`:"unknown",l={...r,location:m};return this.warn(e,`[HAPPY-PATH] ${n}`,l,s),i}},D=new an});function ko(t){return process.platform==="win32"?Math.round(t*cn.WINDOWS_MULTIPLIER):t}var cn,$o=C(()=>{"use strict";cn={DEFAULT:3e5,HEALTH_CHECK:3e3,POST_SPAWN_WAIT:15e3,READINESS_WAIT:3e4,PORT_IN_USE_WAIT:3e3,WORKER_STARTUP_WAIT:1e3,PRE_RESTART_SETTLE_DELAY:2e3,POWERSHELL_COMMAND:1e4,WINDOWS_MULTIPLIER:1.5}});import{readFileSync as ri,writeFileSync as Mo,existsSync as Io,mkdirSync as si}from"fs";import{join as Oo,dirname as ii}from"path";import{homedir as Ro}from"os";var De,To=C(()=>{"use strict";De=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-6",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:String(37700+(process.getuid?.()??77)%100),CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_PROVIDER:"claude",CLAUDE_MEM_CLAUDE_AUTH_METHOD:"cli",CLAUDE_MEM_GEMINI_API_KEY:"",CLAUDE_MEM_GEMINI_MODEL:"gemini-2.5-flash-lite",CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED:"true",CLAUDE_MEM_GEMINI_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_GEMINI_MAX_TOKENS:"100000",CLAUDE_MEM_OPENROUTER_API_KEY:"",CLAUDE_MEM_OPENROUTER_MODEL:"xiaomi/mimo-v2-flash:free",CLAUDE_MEM_OPENROUTER_SITE_URL:"",CLAUDE_MEM_OPENROUTER_APP_NAME:"claude-mem",CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_OPENROUTER_MAX_TOKENS:"100000",CLAUDE_MEM_DATA_DIR:Oo(Ro(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_MODE:"code",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_FULL_COUNT:"0",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false",CLAUDE_MEM_CONTEXT_SHOW_TERMINAL_OUTPUT:"true",CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED:"false",CLAUDE_MEM_FOLDER_USE_LOCAL_MD:"false",CLAUDE_MEM_TRANSCRIPTS_ENABLED:"true",CLAUDE_MEM_TRANSCRIPTS_CONFIG_PATH:Oo(Ro(),".claude-mem","transcript-watch.json"),CLAUDE_MEM_MAX_CONCURRENT_AGENTS:"2",CLAUDE_MEM_EXCLUDED_PROJECTS:"",CLAUDE_MEM_FOLDER_MD_EXCLUDE:"[]",CLAUDE_MEM_SEMANTIC_INJECT:"false",CLAUDE_MEM_SEMANTIC_INJECT_LIMIT:"5",CLAUDE_MEM_TIER_ROUTING_ENABLED:"true",CLAUDE_MEM_TIER_SIMPLE_MODEL:"haiku",CLAUDE_MEM_TIER_SUMMARY_MODEL:"",CLAUDE_MEM_CHROMA_ENABLED:"true",CLAUDE_MEM_CHROMA_MODE:"local",CLAUDE_MEM_CHROMA_HOST:"127.0.0.1",CLAUDE_MEM_CHROMA_PORT:"8000",CLAUDE_MEM_CHROMA_SSL:"false",CLAUDE_MEM_CHROMA_API_KEY:"",CLAUDE_MEM_CHROMA_TENANT:"default_tenant",CLAUDE_MEM_CHROMA_DATABASE:"default_database",CLAUDE_MEM_TELEGRAM_ENABLED:"true",CLAUDE_MEM_TELEGRAM_BOT_TOKEN:"",CLAUDE_MEM_TELEGRAM_CHAT_ID:"",CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES:"security_alert",CLAUDE_MEM_TELEGRAM_TRIGGER_CONCEPTS:""};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return process.env[e]??this.DEFAULTS[e]}static getInt(e){let n=this.get(e);return parseInt(n,10)}static getBool(e){let n=this.get(e);return n==="true"||n===!0}static applyEnvOverrides(e){let n={...e};for(let r of Object.keys(this.DEFAULTS))process.env[r]!==void 0&&(n[r]=process.env[r]);return n}static loadFromFile(e){try{if(!Io(e)){let o=this.getAllDefaults();try{let u=ii(e);Io(u)||si(u,{recursive:!0}),Mo(e,JSON.stringify(o,null,2),"utf-8"),console.log("[SETTINGS] Created settings file with defaults:",e)}catch(u){console.warn("[SETTINGS] Failed to create settings file, using in-memory defaults:",e,u instanceof Error?u.message:String(u))}return this.applyEnvOverrides(o)}let n=ri(e,"utf-8"),r=JSON.parse(n),s=r;if(r.env&&typeof r.env=="object"){s=r.env;try{Mo(e,JSON.stringify(s,null,2),"utf-8"),console.log("[SETTINGS] Migrated settings file from nested to flat schema:",e)}catch(o){console.warn("[SETTINGS] Failed to auto-migrate settings file:",e,o instanceof Error?o.message:String(o))}}let i={...this.DEFAULTS};for(let o of Object.keys(this.DEFAULTS))s[o]!==void 0&&(i[o]=s[o]);return this.applyEnvOverrides(i)}catch(n){return console.warn("[SETTINGS] Failed to load settings, using defaults:",e,n instanceof Error?n.message:String(n)),this.applyEnvOverrides(this.getAllDefaults())}}}});import{join as b,dirname as ui,basename as ai}from"path";import{homedir as Bo}from"os";import{existsSync as ci,mkdirSync as gc}from"fs";import{execSync as fc}from"child_process";import{fileURLToPath as li}from"url";function Di(){return typeof __dirname<"u"?__dirname:ui(li(import.meta.url))}function di(){if(process.env.CLAUDE_MEM_DATA_DIR)return process.env.CLAUDE_MEM_DATA_DIR;let t=b(Bo(),".claude-mem"),e=b(t,"settings.json");try{if(ci(e)){let{readFileSync:n}=ns("fs"),r=JSON.parse(n(e,"utf-8")),s=r.env??r;if(s.CLAUDE_MEM_DATA_DIR)return s.CLAUDE_MEM_DATA_DIR}}catch{}return t}var Fc,T,fe,Et,yc,xc,Sc,vc,_c,wc,Ac,bc,mi,kc,$c,Mc,Ic,ht=C(()=>{"use strict";Y();Fc=Di();T=di(),fe=process.env.CLAUDE_CONFIG_DIR||b(Bo(),".claude"),Et=b(fe,"plugins","marketplaces","thedotmack"),yc=b(T,"archives"),xc=b(T,"logs"),Sc=b(T,"trash"),vc=b(T,"backups"),_c=b(T,"modes"),wc=b(T,"settings.json"),Ac=b(T,"claude-mem.db"),bc=b(T,"vector-db"),mi=b(T,"observer-sessions"),kc=ai(mi),$c=b(fe,"settings.json"),Mc=b(fe,"commands"),Ic=b(fe,"CLAUDE.md")});import Lo from"path";import{readFileSync as Bc}from"fs";function gi(t,e={},n){return new Promise((r,s)=>{let i=setTimeout(()=>s(new Error(`Request timed out after ${n}ms`)),n);fetch(t,e).then(o=>{clearTimeout(i),r(o)},o=>{clearTimeout(i),s(o)})})}function We(){if(Ft!==null)return Ft;let t=Lo.join(De.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=De.loadFromFile(t);return Ft=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),Ft}function Ci(){if(yt!==null)return yt;let t=Lo.join(De.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return yt=De.loadFromFile(t).CLAUDE_MEM_WORKER_HOST,yt}function fi(t){return`http://${Ci()}:${We()}${t}`}function xt(t,e={}){let n=e.method??"GET",r=e.timeoutMs??pi,s=fi(t),i={method:n};return e.headers&&(i.headers=e.headers),e.body&&(i.body=e.body),r>0?gi(s,i,r):fetch(s,i)}var pi,Ft,yt,St=C(()=>{"use strict";Y();$o();To();ht();pi=(()=>{let t=process.env.CLAUDE_MEM_HEALTH_TIMEOUT_MS;if(t){let e=parseInt(t,10);if(Number.isFinite(e)&&e>=500&&e<=3e5)return e;D.warn("SYSTEM","Invalid CLAUDE_MEM_HEALTH_TIMEOUT_MS, using default",{value:t,min:500,max:3e5})}return ko(cn.HEALTH_CHECK)})();Ft=null,yt=null});import{existsSync as Ei,readFileSync as hi,writeFileSync as Po,mkdirSync as jo,renameSync as Fi}from"fs";import{join as ln,basename as Hc}from"path";function No(t){try{return Ei(t)?JSON.parse(hi(t,"utf-8")):{}}catch(e){return D.error("CONFIG","Failed to read Cursor registry, using empty registry",{file:t,error:e instanceof Error?e.message:String(e)}),{}}}function Uo(t,e){let n=ln(t,"..");jo(n,{recursive:!0}),Po(t,JSON.stringify(e,null,2))}function Dn(t,e){let n=ln(t,".cursor","rules"),r=ln(n,"claude-mem-context.mdc"),s=`${r}.tmp`;jo(n,{recursive:!0});let i=`---
|
|
61
|
+
`)}debug(e,r,o,s){this.log(0,e,r,o,s)}info(e,r,o,s){this.log(1,e,r,o,s)}warn(e,r,o,s){this.log(2,e,r,o,s)}error(e,r,o,s){this.log(3,e,r,o,s)}dataIn(e,r,o,s){this.info(e,`\u2192 ${r}`,o,s)}dataOut(e,r,o,s){this.info(e,`\u2190 ${r}`,o,s)}success(e,r,o,s){this.info(e,`\u2713 ${r}`,o,s)}failure(e,r,o,s){this.error(e,`\u2717 ${r}`,o,s)}timing(e,r,o,s){this.info(e,`\u23F1 ${r}`,s,{duration:`${o}ms`})}happyPathError(e,r,o,s,i=""){let d=((new Error().stack||"").split(`
|
|
62
|
+
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),p=d?`${d[1].split("/").pop()}:${d[2]}`:"unknown",D={...o,location:p};return this.warn(e,`[HAPPY-PATH] ${r}`,D,s),i}},a=new lr});function Ln(t){return process.platform==="win32"?Math.round(t*Ge.WINDOWS_MULTIPLIER):t}var Ge,Dr=m(()=>{"use strict";Ge={DEFAULT:3e5,HEALTH_CHECK:3e3,POST_SPAWN_WAIT:15e3,READINESS_WAIT:3e4,PORT_IN_USE_WAIT:3e3,WORKER_STARTUP_WAIT:1e3,PRE_RESTART_SETTLE_DELAY:2e3,POWERSHELL_COMMAND:1e4,WINDOWS_MULTIPLIER:1.5}});import{readFileSync as bi,writeFileSync as Bn,existsSync as Nn,mkdirSync as Mi}from"fs";import{join as jn,dirname as Ii}from"path";import{homedir as Un}from"os";var te,dr=m(()=>{"use strict";te=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-6",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:String(37700+(process.getuid?.()??77)%100),CLAUDE_MEM_WORKER_HOST:"127.0.0.1",CLAUDE_MEM_SKIP_TOOLS:"ListMcpResourcesTool,SlashCommand,Skill,TodoWrite,AskUserQuestion",CLAUDE_MEM_PROVIDER:"claude",CLAUDE_MEM_CLAUDE_AUTH_METHOD:"cli",CLAUDE_MEM_GEMINI_API_KEY:"",CLAUDE_MEM_GEMINI_MODEL:"gemini-2.5-flash-lite",CLAUDE_MEM_GEMINI_RATE_LIMITING_ENABLED:"true",CLAUDE_MEM_GEMINI_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_GEMINI_MAX_TOKENS:"100000",CLAUDE_MEM_OPENROUTER_API_KEY:"",CLAUDE_MEM_OPENROUTER_MODEL:"xiaomi/mimo-v2-flash:free",CLAUDE_MEM_OPENROUTER_SITE_URL:"",CLAUDE_MEM_OPENROUTER_APP_NAME:"claude-mem",CLAUDE_MEM_OPENROUTER_MAX_CONTEXT_MESSAGES:"20",CLAUDE_MEM_OPENROUTER_MAX_TOKENS:"100000",CLAUDE_MEM_DATA_DIR:jn(Un(),".claude-mem"),CLAUDE_MEM_LOG_LEVEL:"INFO",CLAUDE_MEM_PYTHON_VERSION:"3.13",CLAUDE_CODE_PATH:"",CLAUDE_MEM_MODE:"code",CLAUDE_MEM_CONTEXT_SHOW_READ_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_WORK_TOKENS:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_AMOUNT:"false",CLAUDE_MEM_CONTEXT_SHOW_SAVINGS_PERCENT:"true",CLAUDE_MEM_CONTEXT_FULL_COUNT:"0",CLAUDE_MEM_CONTEXT_FULL_FIELD:"narrative",CLAUDE_MEM_CONTEXT_SESSION_COUNT:"10",CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY:"true",CLAUDE_MEM_CONTEXT_SHOW_LAST_MESSAGE:"false",CLAUDE_MEM_CONTEXT_SHOW_TERMINAL_OUTPUT:"true",CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED:"false",CLAUDE_MEM_FOLDER_USE_LOCAL_MD:"false",CLAUDE_MEM_TRANSCRIPTS_ENABLED:"true",CLAUDE_MEM_TRANSCRIPTS_CONFIG_PATH:jn(Un(),".claude-mem","transcript-watch.json"),CLAUDE_MEM_MAX_CONCURRENT_AGENTS:"2",CLAUDE_MEM_HOOK_FAIL_LOUD_THRESHOLD:"3",CLAUDE_MEM_EXCLUDED_PROJECTS:"",CLAUDE_MEM_FOLDER_MD_EXCLUDE:"[]",CLAUDE_MEM_SEMANTIC_INJECT:"false",CLAUDE_MEM_SEMANTIC_INJECT_LIMIT:"5",CLAUDE_MEM_TIER_ROUTING_ENABLED:"true",CLAUDE_MEM_TIER_SIMPLE_MODEL:"haiku",CLAUDE_MEM_TIER_SUMMARY_MODEL:"",CLAUDE_MEM_CHROMA_ENABLED:"true",CLAUDE_MEM_CHROMA_MODE:"local",CLAUDE_MEM_CHROMA_HOST:"127.0.0.1",CLAUDE_MEM_CHROMA_PORT:"8000",CLAUDE_MEM_CHROMA_SSL:"false",CLAUDE_MEM_CHROMA_API_KEY:"",CLAUDE_MEM_CHROMA_TENANT:"default_tenant",CLAUDE_MEM_CHROMA_DATABASE:"default_database",CLAUDE_MEM_TELEGRAM_ENABLED:"true",CLAUDE_MEM_TELEGRAM_BOT_TOKEN:"",CLAUDE_MEM_TELEGRAM_CHAT_ID:"",CLAUDE_MEM_TELEGRAM_TRIGGER_TYPES:"security_alert",CLAUDE_MEM_TELEGRAM_TRIGGER_CONCEPTS:""};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return process.env[e]??this.DEFAULTS[e]}static getInt(e){let r=this.get(e);return parseInt(r,10)}static getBool(e){let r=this.get(e);return r==="true"||r===!0}static applyEnvOverrides(e){let r={...e};for(let o of Object.keys(this.DEFAULTS))process.env[o]!==void 0&&(r[o]=process.env[o]);return r}static loadFromFile(e){try{if(!Nn(e)){let n=this.getAllDefaults();try{let u=Ii(e);Nn(u)||Mi(u,{recursive:!0}),Bn(e,JSON.stringify(n,null,2),"utf-8"),console.log("[SETTINGS] Created settings file with defaults:",e)}catch(u){console.warn("[SETTINGS] Failed to create settings file, using in-memory defaults:",e,u instanceof Error?u.message:String(u))}return this.applyEnvOverrides(n)}let r=bi(e,"utf-8"),o=JSON.parse(r),s=o;if(o.env&&typeof o.env=="object"){s=o.env;try{Bn(e,JSON.stringify(s,null,2),"utf-8"),console.log("[SETTINGS] Migrated settings file from nested to flat schema:",e)}catch(n){console.warn("[SETTINGS] Failed to auto-migrate settings file:",e,n instanceof Error?n.message:String(n))}}let i={...this.DEFAULTS};for(let n of Object.keys(this.DEFAULTS))s[n]!==void 0&&(i[n]=s[n]);return this.applyEnvOverrides(i)}catch(r){return console.warn("[SETTINGS] Failed to load settings, using defaults:",e,r instanceof Error?r.message:String(r)),this.applyEnvOverrides(this.getAllDefaults())}}}});import{join as A,dirname as $i,basename as Ti}from"path";import{homedir as Gn}from"os";import{existsSync as Ri,mkdirSync as ll}from"fs";import{execSync as dl}from"child_process";import{fileURLToPath as Pi}from"url";function Oi(){return typeof __dirname<"u"?__dirname:$i(Pi(import.meta.url))}function Li(){if(process.env.CLAUDE_MEM_DATA_DIR)return process.env.CLAUDE_MEM_DATA_DIR;let t=A(Gn(),".claude-mem"),e=A(t,"settings.json");try{if(Ri(e)){let{readFileSync:r}=ks("fs"),o=JSON.parse(r(e,"utf-8")),s=o.env??o;if(s.CLAUDE_MEM_DATA_DIR)return s.CLAUDE_MEM_DATA_DIR}}catch{}return t}var gl,R,fe,St,fl,Cl,El,hl,Fl,Bi,Sl,yl,Ni,wl,vl,_l,xl,We=m(()=>{"use strict";T();gl=Oi();R=Li(),fe=process.env.CLAUDE_CONFIG_DIR||A(Gn(),".claude"),St=A(fe,"plugins","marketplaces","thedotmack"),fl=A(R,"archives"),Cl=A(R,"logs"),El=A(R,"trash"),hl=A(R,"backups"),Fl=A(R,"modes"),Bi=A(R,"settings.json"),Sl=A(R,"claude-mem.db"),yl=A(R,"vector-db"),Ni=A(R,"observer-sessions"),wl=Ti(Ni),vl=A(fe,"settings.json"),_l=A(fe,"commands"),xl=A(fe,"CLAUDE.md")});var Wn=m(()=>{"use strict";dr();We()});var Hn=m(()=>{"use strict"});import{spawn as Pl,spawnSync as ji}from"child_process";import{existsSync as Ui,mkdirSync as Kn,readFileSync as Jn,writeFileSync as Gi}from"fs";import{homedir as Wi}from"os";import yt from"path";function V(t){if(!Number.isInteger(t)||t<0||t===0)return!1;try{return process.kill(t,0),!0}catch(e){if(e instanceof Error){let r=e.code;return r==="EPERM"?!0:(a.debug("SYSTEM","PID check failed",{pid:t,code:r}),!1)}return a.warn("SYSTEM","PID check threw non-Error",{pid:t,error:String(e)}),!1}}function Vi(t){if(!Number.isInteger(t)||t<=0)return null;if(process.platform==="linux")try{let e=Jn(`/proc/${t}/stat`,"utf-8"),r=e.lastIndexOf(") ");if(r<0)return null;let s=e.slice(r+2).split(" ")[19];return s&&/^\d+$/.test(s)?s:null}catch(e){return a.debug("SYSTEM","captureProcessStartToken: /proc read failed",{pid:t,error:e instanceof Error?e.message:String(e)}),null}if(process.platform==="win32")return null;try{let e=ji("ps",["-p",String(t),"-o","lstart="],{encoding:"utf-8",timeout:2e3,env:{...process.env,LC_ALL:"C",LANG:"C"}});if(e.status!==0)return null;let r=e.stdout.trim();return r.length>0?r:null}catch(e){return a.debug("SYSTEM","captureProcessStartToken: ps exec failed",{pid:t,error:e instanceof Error?e.message:String(e)}),null}}function Yn(t){if(!t||!V(t.pid))return!1;if(!t.startToken)return!0;let e=Vi(t.pid);if(e===null)return!0;let r=e===t.startToken;return r||a.debug("SYSTEM","verifyPidFileOwnership: start-token mismatch (PID reused)",{pid:t.pid,stored:t.startToken,current:e}),r}function wt(){return pr||(pr=new mr),pr}var Hi,Ki,Ji,Yi,mr,pr,vt=m(()=>{"use strict";T();Hn();Hi=5e3,Ki=1e3,Ji=yt.join(Wi(),".claude-mem"),Yi=yt.join(Ji,"supervisor.json");mr=class{registryPath;entries=new Map;runtimeProcesses=new Map;initialized=!1;constructor(e=Yi){this.registryPath=e}initialize(){if(this.initialized)return;if(this.initialized=!0,Kn(yt.dirname(this.registryPath),{recursive:!0}),!Ui(this.registryPath)){this.persist();return}try{let o=JSON.parse(Jn(this.registryPath,"utf-8")).processes??{};for(let[s,i]of Object.entries(o))this.entries.set(s,i)}catch(r){r instanceof Error?a.warn("SYSTEM","Failed to parse supervisor registry, rebuilding",{path:this.registryPath},r):a.warn("SYSTEM","Failed to parse supervisor registry, rebuilding",{path:this.registryPath,error:String(r)}),this.entries.clear()}let e=this.pruneDeadEntries();e>0&&a.info("SYSTEM","Removed dead processes from supervisor registry",{removed:e}),this.persist()}register(e,r,o){this.initialize(),this.entries.set(e,r),o&&this.runtimeProcesses.set(e,o),this.persist()}unregister(e){this.initialize(),this.entries.delete(e),this.runtimeProcesses.delete(e),this.persist()}clear(){this.entries.clear(),this.runtimeProcesses.clear(),this.persist()}getAll(){return this.initialize(),Array.from(this.entries.entries()).map(([e,r])=>({id:e,...r})).sort((e,r)=>{let o=Date.parse(e.startedAt),s=Date.parse(r.startedAt);return(Number.isNaN(o)?0:o)-(Number.isNaN(s)?0:s)})}getBySession(e){let r=String(e);return this.getAll().filter(o=>o.sessionId!==void 0&&String(o.sessionId)===r)}getRuntimeProcess(e){return this.runtimeProcesses.get(e)}getByPid(e){return this.getAll().filter(r=>r.pid===e)}pruneDeadEntries(){this.initialize();let e=0;for(let[r,o]of this.entries)V(o.pid)||(this.entries.delete(r),this.runtimeProcesses.delete(r),e+=1);return e>0&&this.persist(),e}async reapSession(e){this.initialize();let r=this.getBySession(e);if(r.length===0)return 0;let o=typeof e=="number"?e:Number(e)||void 0;a.info("SYSTEM",`Reaping ${r.length} process(es) for session ${e}`,{sessionId:o,pids:r.map(u=>u.pid)});let s=r.filter(u=>V(u.pid));for(let u of s)try{typeof u.pgid=="number"&&process.platform!=="win32"?process.kill(-u.pgid,"SIGTERM"):process.kill(u.pid,"SIGTERM")}catch(c){c instanceof Error?c.code!=="ESRCH"&&a.debug("SYSTEM",`Failed to SIGTERM session process PID ${u.pid}`,{pid:u.pid,pgid:u.pgid},c):a.warn("SYSTEM",`Failed to SIGTERM session process PID ${u.pid} (non-Error)`,{pid:u.pid,pgid:u.pgid,error:String(c)})}let i=Date.now()+Hi;for(;Date.now()<i&&s.filter(c=>V(c.pid)).length!==0;)await new Promise(c=>setTimeout(c,100));let n=s.filter(u=>V(u.pid));for(let u of n){a.warn("SYSTEM",`Session process PID ${u.pid} did not exit after SIGTERM, sending SIGKILL`,{pid:u.pid,pgid:u.pgid,sessionId:o});try{typeof u.pgid=="number"&&process.platform!=="win32"?process.kill(-u.pgid,"SIGKILL"):process.kill(u.pid,"SIGKILL")}catch(c){c instanceof Error?c.code!=="ESRCH"&&a.debug("SYSTEM",`Failed to SIGKILL session process PID ${u.pid}`,{pid:u.pid,pgid:u.pgid},c):a.warn("SYSTEM",`Failed to SIGKILL session process PID ${u.pid} (non-Error)`,{pid:u.pid,pgid:u.pgid,error:String(c)})}}if(n.length>0){let u=Date.now()+Ki;for(;Date.now()<u&&n.filter(d=>V(d.pid)).length!==0;)await new Promise(d=>setTimeout(d,100))}for(let u of r)this.entries.delete(u.id),this.runtimeProcesses.delete(u.id);return this.persist(),a.info("SYSTEM",`Reaped ${r.length} process(es) for session ${e}`,{sessionId:o,reaped:r.length}),r.length}persist(){let e={processes:Object.fromEntries(this.entries.entries())};Kn(yt.dirname(this.registryPath),{recursive:!0}),Gi(this.registryPath,JSON.stringify(e,null,2))}},pr=null});import{execFile as Xi}from"child_process";import{rmSync as zi}from"fs";import{homedir as qi}from"os";import zn from"path";import{promisify as Zi}from"util";async function qn(t){let e=t.currentPid??process.pid,r=t.pidFilePath??tu,o=t.registry.getAll(),s=[...o].filter(n=>n.pid!==e).sort((n,u)=>Date.parse(u.startedAt)-Date.parse(n.startedAt));for(let n of s){if(!V(n.pid)){t.registry.unregister(n.id);continue}try{await Xn(n,"SIGTERM")}catch(u){u instanceof Error?a.debug("SYSTEM","Failed to send SIGTERM to child process",{pid:n.pid,pgid:n.pgid,type:n.type},u):a.warn("SYSTEM","Failed to send SIGTERM to child process (non-Error)",{pid:n.pid,pgid:n.pgid,type:n.type,error:String(u)})}}await Vn(s,5e3);let i=s.filter(n=>V(n.pid));for(let n of i)try{await Xn(n,"SIGKILL")}catch(u){u instanceof Error?a.debug("SYSTEM","Failed to force kill child process",{pid:n.pid,pgid:n.pgid,type:n.type},u):a.warn("SYSTEM","Failed to force kill child process (non-Error)",{pid:n.pid,pgid:n.pgid,type:n.type,error:String(u)})}await Vn(i,1e3);for(let n of s)t.registry.unregister(n.id);for(let n of o.filter(u=>u.pid===e))t.registry.unregister(n.id);try{zi(r,{force:!0})}catch(n){n instanceof Error?a.debug("SYSTEM","Failed to remove PID file during shutdown",{pidFilePath:r},n):a.warn("SYSTEM","Failed to remove PID file during shutdown (non-Error)",{pidFilePath:r,error:String(n)})}t.registry.pruneDeadEntries()}async function Vn(t,e){let r=Date.now()+e;for(;Date.now()<r;){if(t.filter(s=>V(s.pid)).length===0)return;await new Promise(s=>setTimeout(s,100))}}async function Xn(t,e){let{pid:r,pgid:o}=t;if(process.platform!=="win32"){try{typeof o=="number"?process.kill(-o,e):process.kill(r,e)}catch(n){if(n instanceof Error&&n.code==="ESRCH")return;throw n}return}if(e==="SIGTERM"){try{process.kill(r,e)}catch(n){if(n instanceof Error&&n.code==="ESRCH")return;throw n}return}let s=await ru();if(s){await new Promise((n,u)=>{s(r,e,c=>{if(!c){n();return}if(c.code==="ESRCH"){n();return}u(c)})});return}let i=["/PID",String(r),"/T"];e==="SIGKILL"&&i.push("/F"),await Qi("taskkill",i,{timeout:Ge.POWERSHELL_COMMAND,windowsHide:!0})}async function ru(){let t="tree-kill";try{let e=await import(t);return e.default??e}catch(e){return a.debug("SYSTEM","tree-kill module not available, using fallback",{},e instanceof Error?e:void 0),null}}var Qi,eu,tu,Zn=m(()=>{"use strict";T();Dr();vt();Qi=Zi(Xi),eu=zn.join(qi(),".claude-mem"),tu=zn.join(eu,"worker.pid")});function nu(){let e=wt().pruneDeadEntries();e>0&&a.info("SYSTEM",`Health check: pruned ${e} dead process(es) from registry`)}function eo(){Ce===null&&(Ce=setInterval(nu,Qn),Ce.unref(),a.debug("SYSTEM","Health checker started",{intervalMs:Qn}))}function to(){Ce!==null&&(clearInterval(Ce),Ce=null,a.debug("SYSTEM","Health checker stopped"))}var Qn,Ce,ro=m(()=>{"use strict";T();vt();Qn=3e4,Ce=null});import{existsSync as ou,readFileSync as su,rmSync as no}from"fs";import{homedir as iu}from"os";import oo from"path";function so(t={}){let e=t.pidFilePath??au;if(!ou(e))return"missing";let r=null;try{r=JSON.parse(su(e,"utf-8"))}catch(s){return s instanceof Error?a.warn("SYSTEM","Failed to parse worker PID file, removing it",{path:e},s):a.warn("SYSTEM","Failed to parse worker PID file, removing it",{path:e,error:String(s)}),no(e,{force:!0}),"invalid"}return Yn(r)&&r?((t.logAlive??!0)&&a.info("SYSTEM","Worker already running (PID alive)",{existingPid:r.pid,existingPort:r.port,startedAt:r.startedAt}),"alive"):(a.info("SYSTEM","Removing stale PID file (worker process is dead or PID has been reused)",{pid:r?.pid,port:r?.port,startedAt:r?.startedAt}),no(e,{force:!0}),"stale")}var uu,au,gr,uD,io=m(()=>{"use strict";T();vt();Zn();ro();uu=oo.join(iu(),".claude-mem"),au=oo.join(uu,"worker.pid"),gr=class{registry;started=!1;stopPromise=null;signalHandlersRegistered=!1;shutdownInitiated=!1;shutdownHandler=null;constructor(e){this.registry=e}async start(){if(this.started)return;if(this.registry.initialize(),so({logAlive:!1})==="alive")throw new Error("Worker already running");this.started=!0,eo()}configureSignalHandlers(e){if(this.shutdownHandler=e,this.signalHandlersRegistered)return;this.signalHandlersRegistered=!0;let r=async o=>{if(this.shutdownInitiated){a.warn("SYSTEM",`Received ${o} but shutdown already in progress`);return}this.shutdownInitiated=!0,a.info("SYSTEM",`Received ${o}, shutting down...`);try{this.shutdownHandler?await this.shutdownHandler():await this.stop()}catch(s){s instanceof Error?a.error("SYSTEM","Error during shutdown",{},s):a.error("SYSTEM","Error during shutdown (non-Error)",{error:String(s)});try{await this.stop()}catch(i){i instanceof Error?a.debug("SYSTEM","Supervisor shutdown fallback failed",{},i):a.debug("SYSTEM","Supervisor shutdown fallback failed",{error:String(i)})}}process.exit(0)};process.on("SIGTERM",()=>{r("SIGTERM")}),process.on("SIGINT",()=>{r("SIGINT")}),process.platform!=="win32"&&(process.argv.includes("--daemon")?process.on("SIGHUP",()=>{a.debug("SYSTEM","Ignoring SIGHUP in daemon mode")}):process.on("SIGHUP",()=>{r("SIGHUP")}))}async stop(){if(this.stopPromise){await this.stopPromise;return}to(),this.stopPromise=qn({registry:this.registry,currentPid:process.pid}).finally(()=>{this.started=!1,this.stopPromise=null}),await this.stopPromise}assertCanSpawn(e){if(this.stopPromise!==null)throw new Error(`Supervisor is shutting down, refusing to spawn ${e}`)}registerProcess(e,r,o){this.registry.register(e,r,o)}unregisterProcess(e){this.registry.unregister(e)}getRegistry(){return this.registry}},uD=new gr(wt())});import uo from"path";import{readFileSync as pD,existsSync as mD,writeFileSync as gD,renameSync as fD,mkdirSync as CD}from"fs";import{spawn as hD,execSync as FD}from"child_process";function lu(t,e={},r){return new Promise((o,s)=>{let i=setTimeout(()=>s(new Error(`Request timed out after ${r}ms`)),r);fetch(t,e).then(n=>{clearTimeout(i),o(n)},n=>{clearTimeout(i),s(n)})})}function He(){if(_t!==null)return _t;let t=uo.join(te.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=te.loadFromFile(t);return _t=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),_t}function Du(){if(xt!==null)return xt;let t=uo.join(te.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return xt=te.loadFromFile(t).CLAUDE_MEM_WORKER_HOST,xt}function du(t){return`http://${Du()}:${He()}${t}`}function kt(t,e={}){let r=e.method??"GET",o=e.timeoutMs??cu,s=du(t),i={method:r};return e.headers&&(i.headers=e.headers),e.body&&(i.body=e.body),o>0?lu(s,i,o):fetch(s,i)}var cu,_t,xt,At=m(()=>{"use strict";T();Dr();dr();We();Wn();io();cu=(()=>{let t=process.env.CLAUDE_MEM_HEALTH_TIMEOUT_MS;if(t){let e=parseInt(t,10);if(Number.isFinite(e)&&e>=500&&e<=3e5)return e;a.warn("SYSTEM","Invalid CLAUDE_MEM_HEALTH_TIMEOUT_MS, using default",{value:t,min:500,max:3e5})}return Ln(Ge.HEALTH_CHECK)})();_t=null,xt=null});import{existsSync as pu,readFileSync as mu,writeFileSync as ao,mkdirSync as co,renameSync as gu}from"fs";import{join as fr,basename as MD}from"path";function lo(t){try{return pu(t)?JSON.parse(mu(t,"utf-8")):{}}catch(e){return a.error("CONFIG","Failed to read Cursor registry, using empty registry",{file:t,error:e instanceof Error?e.message:String(e)}),{}}}function Do(t,e){let r=fr(t,"..");co(r,{recursive:!0}),ao(t,JSON.stringify(e,null,2))}function Cr(t,e){let r=fr(t,".cursor","rules"),o=fr(r,"claude-mem-context.mdc"),s=`${o}.tmp`;co(r,{recursive:!0});let i=`---
|
|
63
63
|
alwaysApply: true
|
|
64
64
|
description: "Claude-mem context from past sessions (auto-updated)"
|
|
65
65
|
---
|
|
@@ -72,10 +72,10 @@ ${e}
|
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
*Updated after last session. Use claude-mem's MCP search tools for more detailed queries.*
|
|
75
|
-
`;
|
|
75
|
+
`;ao(s,i),gu(s,o)}var po=m(()=>{"use strict";T()});var yo={};Y(yo,{checkCursorHooksStatus:()=>So,configureCursorMcp:()=>Su,detectClaudeCode:()=>xu,detectPlatform:()=>fo,findBunPath:()=>he,findMcpServerPath:()=>Ke,findWorkerServicePath:()=>Ee,getScriptExtension:()=>hu,getTargetDir:()=>It,handleCursorCommand:()=>ku,installCursorHooks:()=>ho,readCursorRegistry:()=>Mt,registerCursorProject:()=>Co,uninstallCursorHooks:()=>Fo,unregisterCursorProject:()=>Eo,updateCursorContextForProject:()=>Fu,writeCursorRegistry:()=>Sr});import g from"path";import{homedir as bt}from"os";import{existsSync as B,readFileSync as mo,writeFileSync as hr,unlinkSync as Er,mkdirSync as Fr}from"fs";import{exec as fu}from"child_process";import{promisify as Cu}from"util";function fo(){return process.platform==="win32"?"windows":"unix"}function hu(){return fo()==="windows"?".ps1":".sh"}function Mt(){return lo(go)}function Sr(t){Do(go,t)}function Co(t,e){let r=Mt();r[t]={workspacePath:e,installedAt:new Date().toISOString()},Sr(r),a.info("CURSOR","Registered project for auto-context updates",{projectName:t,workspacePath:e})}function Eo(t){let e=Mt();e[t]&&(delete e[t],Sr(e),a.info("CURSOR","Unregistered project",{projectName:t}))}async function Fu(t,e){let o=Mt()[t];if(o)try{let s=await kt(`/api/context/inject?project=${encodeURIComponent(t)}`);if(!s.ok)return;let i=await s.text();if(!i||!i.trim())return;Cr(o.workspacePath,i),a.debug("CURSOR","Updated context file",{projectName:t,workspacePath:o.workspacePath})}catch(s){s instanceof Error?a.error("WORKER","Failed to update context file",{projectName:t},s):a.error("WORKER","Failed to update context file",{projectName:t},new Error(String(s)))}}function Ke(){let t=[g.join(St,"plugin","scripts","mcp-server.cjs"),g.join(process.cwd(),"plugin","scripts","mcp-server.cjs")];for(let e of t)if(B(e))return e;return null}function Ee(){let t=[g.join(St,"plugin","scripts","worker-service.cjs"),g.join(process.cwd(),"plugin","scripts","worker-service.cjs")];for(let e of t)if(B(e))return e;return null}function he(){let t=[g.join(bt(),".bun","bin","bun"),"/usr/local/bin/bun","/usr/bin/bun",...process.platform==="win32"?[g.join(bt(),".bun","bin","bun.exe"),g.join(process.env.LOCALAPPDATA||"","bun","bun.exe")]:[]];for(let e of t)if(e&&B(e))return e;return"bun"}function It(t){switch(t){case"project":return g.join(process.cwd(),".cursor");case"user":return g.join(bt(),".cursor");case"enterprise":return process.platform==="darwin"?"/Library/Application Support/Cursor":process.platform==="linux"?"/etc/cursor":process.platform==="win32"?g.join(process.env.ProgramData||"C:\\ProgramData","Cursor"):null;default:return null}}function Su(t){let e=Ke();if(!e)return console.error("Could not find MCP server script"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/mcp-server.cjs"),1;let r=It(t);if(!r)return console.error(`Invalid target: ${t}. Use: project or user`),1;let o=g.join(r,"mcp.json");try{Fr(r,{recursive:!0});let s={mcpServers:{}};if(B(o))try{s=JSON.parse(mo(o,"utf-8")),s.mcpServers||(s.mcpServers={})}catch(i){i instanceof Error?a.error("WORKER","Corrupt mcp.json, creating new config",{path:o},i):a.error("WORKER","Corrupt mcp.json, creating new config",{path:o},new Error(String(i))),s={mcpServers:{}}}return s.mcpServers["claude-mem"]={command:"node",args:[e]},hr(o,JSON.stringify(s,null,2)),console.log(` Configured MCP server in ${t==="user"?"~/.cursor":".cursor"}/mcp.json`),console.log(` Server path: ${e}`),0}catch(s){return console.error(`Failed to configure MCP: ${s.message}`),1}}async function ho(t){console.log(`
|
|
76
76
|
Installing Claude-Mem Cursor hooks (${t} level)...
|
|
77
|
-
`);let e=
|
|
78
|
-
Installation failed: ${
|
|
77
|
+
`);let e=It(t);if(!e)return console.error(`Invalid target: ${t}. Use: project, user, or enterprise`),1;let r=Ee();if(!r)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let o=process.cwd(),s=g.join(e,"hooks.json"),i=he(),n=i.replace(/\\/g,"\\\\"),u=r.replace(/\\/g,"\\\\"),c=p=>`"${n}" "${u}" hook cursor ${p}`;console.log(` Using Bun runtime: ${i}`);let d={version:1,hooks:{beforeSubmitPrompt:[{command:c("session-init")},{command:c("context")}],afterMCPExecution:[{command:c("observation")}],afterShellExecution:[{command:c("observation")}],afterFileEdit:[{command:c("file-edit")}],stop:[{command:c("summarize")}]}};try{return Fr(e,{recursive:!0}),await yu(s,d,r,t,e,o),0}catch(p){let D=p instanceof Error?p.message:String(p);return console.error(`
|
|
78
|
+
Installation failed: ${D}`),t==="enterprise"&&console.error(" Tip: Enterprise installation may require sudo/admin privileges"),1}}async function yu(t,e,r,o,s,i){hr(t,JSON.stringify(e,null,2)),console.log(" Created hooks.json (unified CLI mode)"),console.log(` Worker service: ${r}`),o==="project"&&await wu(s,i),console.log(`
|
|
79
79
|
Installation complete!
|
|
80
80
|
|
|
81
81
|
Hooks installed to: ${s}/hooks.json
|
|
@@ -89,7 +89,7 @@ Next steps:
|
|
|
89
89
|
Context Injection:
|
|
90
90
|
Context from past sessions is stored in .cursor/rules/claude-mem-context.mdc
|
|
91
91
|
and automatically included in every chat. It updates after each session ends.
|
|
92
|
-
`)}async function
|
|
92
|
+
`)}async function wu(t,e){let r=g.join(t,"rules");Fr(r,{recursive:!0});let o=g.basename(e),s=!1;console.log(" Generating initial context...");try{s=await vu(o,e)}catch(i){i instanceof Error?a.debug("WORKER","Worker not running during install",{},i):a.debug("WORKER","Worker not running during install",{},new Error(String(i)))}if(!s){let i=g.join(r,"claude-mem-context.mdc");hr(i,`---
|
|
93
93
|
alwaysApply: true
|
|
94
94
|
description: "Claude-mem context from past sessions (auto-updated)"
|
|
95
95
|
---
|
|
@@ -99,15 +99,15 @@ description: "Claude-mem context from past sessions (auto-updated)"
|
|
|
99
99
|
*No context yet. Complete your first session and context will appear here.*
|
|
100
100
|
|
|
101
101
|
Use claude-mem's MCP search tools for manual memory queries.
|
|
102
|
-
`),console.log(" Created placeholder context file (will populate after first session)")}
|
|
102
|
+
`),console.log(" Created placeholder context file (will populate after first session)")}Co(o,e),console.log(" Registered for auto-context updates")}async function vu(t,e){if(!(await kt("/api/readiness")).ok)return!1;let o=await kt(`/api/context/inject?project=${encodeURIComponent(t)}`);if(!o.ok)return!1;let s=await o.text();return s&&s.trim()?(Cr(e,s),console.log(" Generated initial context from existing memory"),!0):!1}function Fo(t){console.log(`
|
|
103
103
|
Uninstalling Claude-Mem Cursor hooks (${t} level)...
|
|
104
|
-
`);let e=
|
|
105
|
-
Uninstallation failed: ${c}`),1}}function
|
|
104
|
+
`);let e=It(t);if(!e)return console.error(`Invalid target: ${t}`),1;let r=g.join(e,"hooks"),o=g.join(e,"hooks.json"),s=["common.sh","session-init.sh","context-inject.sh","save-observation.sh","save-file-edit.sh","session-summary.sh"],i=["common.ps1","session-init.ps1","context-inject.ps1","save-observation.ps1","save-file-edit.ps1","session-summary.ps1"],n=[...s,...i];try{return _u(r,n,o,t,e),0}catch(u){let c=u instanceof Error?u.message:String(u);return console.error(`
|
|
105
|
+
Uninstallation failed: ${c}`),1}}function _u(t,e,r,o,s){for(let i of e){let n=g.join(t,i);B(n)&&(Er(n),console.log(` Removed legacy script: ${i}`))}if(B(r)&&(Er(r),console.log(" Removed hooks.json")),o==="project"){let i=g.join(s,"rules","claude-mem-context.mdc");B(i)&&(Er(i),console.log(" Removed context file"));let n=g.basename(process.cwd());Eo(n),console.log(" Unregistered from auto-context updates")}console.log(`
|
|
106
106
|
Uninstallation complete!
|
|
107
|
-
`),console.log("Restart Cursor to apply changes.")}function
|
|
107
|
+
`),console.log("Restart Cursor to apply changes.")}function So(){console.log(`
|
|
108
108
|
Claude-Mem Cursor Hooks Status
|
|
109
|
-
`);let t=[{name:"Project",dir:
|
|
110
|
-
`),0}async function
|
|
109
|
+
`);let t=[{name:"Project",dir:g.join(process.cwd(),".cursor")},{name:"User",dir:g.join(bt(),".cursor")}];process.platform==="darwin"?t.push({name:"Enterprise",dir:"/Library/Application Support/Cursor"}):process.platform==="linux"&&t.push({name:"Enterprise",dir:"/etc/cursor"});let e=!1;for(let r of t){let o=g.join(r.dir,"hooks.json"),s=g.join(r.dir,"hooks");if(B(o)){e=!0,console.log(`${r.name}: Installed`),console.log(` Config: ${o}`);let i=null;try{i=JSON.parse(mo(o,"utf-8"))}catch(n){n instanceof Error?a.error("WORKER","Unable to parse hooks.json",{path:o},n):a.error("WORKER","Unable to parse hooks.json",{path:o},new Error(String(n))),console.log(" Mode: Unable to parse hooks.json")}if(i){let n=i?.hooks?.beforeSubmitPrompt?.[0]?.command||"";if(n.includes("worker-service.cjs")&&n.includes("hook cursor"))console.log(" Mode: Unified CLI (bun worker-service.cjs)");else{let u=["session-init.sh","context-inject.sh","save-observation.sh"],c=["session-init.ps1","context-inject.ps1","save-observation.ps1"],d=u.some(D=>B(g.join(s,D))),p=c.some(D=>B(g.join(s,D)));d||p?(console.log(" Mode: Legacy shell scripts (consider reinstalling for unified CLI)"),d&&p?console.log(" Platform: Both (bash + PowerShell)"):d?console.log(" Platform: Unix (bash)"):p&&console.log(" Platform: Windows (PowerShell)")):console.log(" Mode: Unknown configuration")}}if(r.name==="Project"){let n=g.join(r.dir,"rules","claude-mem-context.mdc");B(n)?console.log(" Context: Active"):console.log(" Context: Not yet generated (will be created on first prompt)")}}else console.log(`${r.name}: Not installed`);console.log("")}return e||console.log(`No hooks installed. Run: claude-mem cursor install
|
|
110
|
+
`),0}async function xu(){try{let{stdout:e}=await Eu("which claude || where claude",{timeout:5e3});if(e.trim())return!0}catch(e){e instanceof Error?a.debug("WORKER","Claude CLI not in PATH",{},e):a.debug("WORKER","Claude CLI not in PATH",{},new Error(String(e)))}let t=g.join(fe,"plugins");return!!B(t)}async function ku(t,e){switch(t){case"install":{let r=e[0]||"project";return ho(r)}case"uninstall":{let r=e[0]||"project";return Fo(r)}case"status":return So();case"setup":return console.log("Use the main entry point for setup"),0;default:return console.log(`
|
|
111
111
|
Claude-Mem Cursor Integration
|
|
112
112
|
|
|
113
113
|
Usage: claude-mem cursor <command> [options]
|
|
@@ -131,23 +131,23 @@ Examples:
|
|
|
131
131
|
claude-mem cursor status # Check if hooks are installed
|
|
132
132
|
|
|
133
133
|
For more info: https://docs.claude-mem.ai/cursor
|
|
134
|
-
`),0}}var
|
|
135
|
-
`)}function
|
|
134
|
+
`),0}}var Eu,go,Je=m(()=>{"use strict";T();At();We();po();Eu=Cu(fu),go=g.join(R,"cursor-projects.json")});var _r={};Y(_r,{checkGeminiCliHooksStatus:()=>ko,handleGeminiCliCommand:()=>Ou,installGeminiCliHooks:()=>_o,uninstallGeminiCliHooks:()=>xo});import yr from"path";import{homedir as Au}from"os";import{existsSync as Fe,readFileSync as $t,writeFileSync as wr,mkdirSync as wo}from"fs";function Mu(t,e,r){let o=Se[r];if(!o)throw new Error(`Unknown Gemini CLI event: ${r}`);let s=t.replace(/\\/g,"\\\\"),i=e.replace(/\\/g,"\\\\");return`"${s}" "${i}" hook gemini-cli ${o}`}function Iu(t){return{matcher:"*",hooks:[{name:Ye,type:"command",command:t,timeout:bu}]}}function vr(){if(!Fe(I))return{};let t=$t(I,"utf-8");try{return JSON.parse(t)}catch(e){throw e instanceof Error?a.error("WORKER","Corrupt JSON in Gemini settings",{path:I},e):a.error("WORKER","Corrupt JSON in Gemini settings",{path:I},new Error(String(e))),new Error(`Corrupt JSON in ${I}, refusing to overwrite user settings`)}}function vo(t){wo(Tt,{recursive:!0}),wr(I,JSON.stringify(t,null,2)+`
|
|
135
|
+
`)}function $u(t,e){let r={...t};r.hooks||(r.hooks={});for(let[o,s]of Object.entries(e)){let i=r.hooks[o]??[];for(let n of s){let u=i.findIndex(c=>c.hooks.some(d=>d.name===Ye));if(u>=0){let c=i[u],d=c.hooks.findIndex(p=>p.name===Ye);d>=0?c.hooks[d]=n.hooks[0]:c.hooks.push(n.hooks[0])}else i.push(n)}r.hooks[o]=i}return r}function Tu(){let t="<claude-mem-context>",r=`${t}
|
|
136
136
|
# Memory Context from Past Sessions
|
|
137
137
|
|
|
138
138
|
*No context yet. Complete your first session and context will appear here.*
|
|
139
|
-
</claude-mem-context>`,
|
|
139
|
+
</claude-mem-context>`,o="";if(Fe(J)&&(o=$t(J,"utf-8")),o.includes(t))return;let s=o.length>0&&!o.endsWith(`
|
|
140
140
|
`)?`
|
|
141
141
|
|
|
142
|
-
`:
|
|
143
|
-
`:"",i=
|
|
144
|
-
`;
|
|
142
|
+
`:o.length>0?`
|
|
143
|
+
`:"",i=o+s+r+`
|
|
144
|
+
`;wo(Tt,{recursive:!0}),wr(J,i)}async function _o(){console.log(`
|
|
145
145
|
Installing Claude-Mem Gemini CLI hooks...
|
|
146
|
-
`);let t=Ee();if(!t)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let e=he();console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`);try{let
|
|
147
|
-
Installation failed: ${
|
|
146
|
+
`);let t=Ee();if(!t)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let e=he();console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`);try{let r={};for(let i of Object.keys(Se)){let n=Mu(e,t,i);r[i]=[Iu(n)]}let o=vr(),s=$u(o,r);return Ru(s),0}catch(r){let o=r instanceof Error?r.message:String(r);return console.error(`
|
|
147
|
+
Installation failed: ${o}`),1}}function Ru(t){vo(t),console.log(` Merged hooks into ${I}`),Tu(),console.log(` Setup context injection in ${J}`);let e=Object.keys(Se);console.log(` Registered ${e.length} hook events:`);for(let r of e){let o=Se[r];console.log(` ${r} \u2192 ${o}`)}console.log(`
|
|
148
148
|
Installation complete!
|
|
149
149
|
|
|
150
|
-
Hooks installed to: ${
|
|
150
|
+
Hooks installed to: ${I}
|
|
151
151
|
Using unified CLI: bun worker-service.cjs hook gemini-cli <event>
|
|
152
152
|
|
|
153
153
|
Next steps:
|
|
@@ -158,21 +158,21 @@ Next steps:
|
|
|
158
158
|
Context Injection:
|
|
159
159
|
Context from past sessions is injected via ~/.gemini/GEMINI.md
|
|
160
160
|
and automatically included in Gemini CLI conversations.
|
|
161
|
-
`)}function
|
|
161
|
+
`)}function xo(){if(console.log(`
|
|
162
162
|
Uninstalling Claude-Mem Gemini CLI hooks...
|
|
163
|
-
`),!Fe(
|
|
164
|
-
Uninstallation failed: ${e}`),1}}function
|
|
163
|
+
`),!Fe(I))return console.log(" No Gemini CLI settings found \u2014 nothing to uninstall."),0;try{let t=vr();if(!t.hooks)return console.log(" No hooks found in Gemini CLI settings \u2014 nothing to uninstall."),0;let e=0;for(let[r,o]of Object.entries(t.hooks)){let s=o.map(i=>{let n=i.hooks.filter(u=>u.name!==Ye);return e+=i.hooks.length-n.length,{...i,hooks:n}}).filter(i=>i.hooks.length>0);s.length>0?t.hooks[r]=s:delete t.hooks[r]}return Object.keys(t.hooks).length===0&&delete t.hooks,Pu(t,e),0}catch(t){let e=t instanceof Error?t.message:String(t);return console.error(`
|
|
164
|
+
Uninstallation failed: ${e}`),1}}function Pu(t,e){if(vo(t),console.log(` Removed ${e} claude-mem hook(s) from ${I}`),Fe(J)){let r=$t(J,"utf-8"),o=/\n?<claude-mem-context>[\s\S]*?<\/claude-mem-context>\n?/;o.test(r)&&(r=r.replace(o,""),wr(J,r),console.log(` Removed context section from ${J}`))}console.log(`
|
|
165
165
|
Uninstallation complete!
|
|
166
|
-
`),console.log("Restart Gemini CLI to apply changes.")}function
|
|
166
|
+
`),console.log("Restart Gemini CLI to apply changes.")}function ko(){if(console.log(`
|
|
167
167
|
Claude-Mem Gemini CLI Hooks Status
|
|
168
|
-
`),!Fe(
|
|
168
|
+
`),!Fe(I))return console.log("Gemini CLI settings: Not found"),console.log(` Expected at: ${I}
|
|
169
169
|
`),console.log(`No hooks installed. Run: claude-mem install --ide gemini-cli
|
|
170
|
-
`),0;let t;try{t=
|
|
170
|
+
`),0;let t;try{t=vr()}catch(r){let o=r instanceof Error?r.message:String(r);return r instanceof Error?a.error("WORKER","Failed to read Gemini CLI settings",{path:I},r):a.error("WORKER","Failed to read Gemini CLI settings",{path:I},new Error(String(r))),console.log(`Gemini CLI settings: ${o}
|
|
171
171
|
`),0}if(!t.hooks)return console.log(`Gemini CLI settings: Found, but no hooks configured
|
|
172
172
|
`),console.log(`No hooks installed. Run: claude-mem install --ide gemini-cli
|
|
173
|
-
`),0;let e=[];for(let[
|
|
173
|
+
`),0;let e=[];for(let[r,o]of Object.entries(t.hooks))o.some(i=>i.hooks.some(n=>n.name===Ye))&&e.push(r);if(e.length===0)return console.log(`Gemini CLI settings: Found, but no claude-mem hooks
|
|
174
174
|
`),console.log(`Run: claude-mem install --ide gemini-cli
|
|
175
|
-
`),0;console.log(`Settings: ${
|
|
175
|
+
`),0;console.log(`Settings: ${I}`),console.log("Mode: Unified CLI (bun worker-service.cjs hook gemini-cli)"),console.log(`Events: ${e.length} of ${Object.keys(Se).length} mapped`);for(let r of e){let o=Se[r]??"unknown";console.log(` ${r} \u2192 ${o}`)}return Fe(J)?$t(J,"utf-8").includes("<claude-mem-context>")?console.log(`Context: Active (${J})`):console.log("Context: GEMINI.md exists but missing claude-mem section"):console.log("Context: No GEMINI.md found"),console.log(""),0}async function Ou(t,e){switch(t){case"install":return _o();case"uninstall":return xo();case"status":return ko();default:return console.log(`
|
|
176
176
|
Claude-Mem Gemini CLI Integration
|
|
177
177
|
|
|
178
178
|
Usage: claude-mem gemini-cli <command>
|
|
@@ -188,36 +188,36 @@ Examples:
|
|
|
188
188
|
claude-mem gemini-cli uninstall # Remove hooks
|
|
189
189
|
|
|
190
190
|
For more info: https://docs.claude-mem.ai/usage/gemini-provider
|
|
191
|
-
`),0}}var
|
|
191
|
+
`),0}}var Tt,I,J,Ye,bu,Se,xr=m(()=>{"use strict";T();Je();Tt=yr.join(Au(),".gemini"),I=yr.join(Tt,"settings.json"),J=yr.join(Tt,"GEMINI.md"),Ye="claude-mem",bu=1e4,Se={SessionStart:"context",BeforeAgent:"session-init",AfterAgent:"observation",BeforeTool:"observation",AfterTool:"observation",PreCompress:"summarize",Notification:"observation",SessionEnd:"session-complete"}});import Lu from"path";import{existsSync as Bu,readFileSync as Nu,writeFileSync as kr,mkdirSync as ju}from"fs";function Rt(t,e,r){let o=Lu.dirname(t);ju(o,{recursive:!0});let s=`${Ve}
|
|
192
192
|
${e}
|
|
193
|
-
${
|
|
193
|
+
${ye}`;if(Bu(t)){let i=Nu(t,"utf-8"),n=i.indexOf(Ve),u=i.indexOf(ye);n!==-1&&u!==-1?i=i.slice(0,n)+s+i.slice(u+ye.length):i=i.trimEnd()+`
|
|
194
194
|
|
|
195
195
|
`+s+`
|
|
196
|
-
`,
|
|
196
|
+
`,kr(t,i,"utf-8")}else r?kr(t,`${r}
|
|
197
197
|
|
|
198
198
|
${s}
|
|
199
|
-
`,"utf-8"):
|
|
200
|
-
`,"utf-8")}var
|
|
201
|
-
`,"utf-8"),console.log(" Cleaned context from AGENTS.md"))}function
|
|
202
|
-
`+
|
|
199
|
+
`,"utf-8"):kr(t,s+`
|
|
200
|
+
`,"utf-8")}var Ve,ye,Ar=m(()=>{"use strict";Ve="<claude-mem-context>",ye="</claude-mem-context>"});var Ir={};Y(Ir,{checkOpenCodeStatus:()=>zu,findBuiltPluginPath:()=>Io,getInstalledPluginPath:()=>ze,getOpenCodeAgentsMdPath:()=>Xe,getOpenCodeConfigDirectory:()=>Pt,getOpenCodePluginsDirectory:()=>br,injectContextIntoAgentsMd:()=>Mr,installOpenCodeIntegration:()=>qu,installOpenCodePlugin:()=>$o,syncContextToAgentsMd:()=>Ku,uninstallOpenCodePlugin:()=>Xu});import re from"path";import{homedir as Ao}from"os";import{fileURLToPath as Uu}from"url";import{existsSync as we,readFileSync as bo,writeFileSync as Gu,mkdirSync as Wu,copyFileSync as Hu,unlinkSync as Mo}from"fs";function Pt(){return process.env.OPENCODE_CONFIG_DIR?process.env.OPENCODE_CONFIG_DIR:re.join(Ao(),".config","opencode")}function br(){return re.join(Pt(),"plugins")}function Xe(){return re.join(Pt(),"AGENTS.md")}function ze(){return re.join(br(),"claude-mem.js")}function Io(){let t=[re.join(process.env.CLAUDE_CONFIG_DIR||re.join(Ao(),".claude"),"plugins","marketplaces","thedotmack","dist","opencode-plugin","index.js"),re.join(re.dirname(Uu(import.meta.url)),"..","..","..","dist","opencode-plugin","index.js")];for(let e of t)if(we(e))return e;return null}function $o(){let t=Io();if(!t)return console.error("Could not find built OpenCode plugin bundle."),console.error(" Expected at: dist/opencode-plugin/index.js"),console.error(" Run the build first: npm run build"),1;let e=br(),r=ze();try{return Wu(e,{recursive:!0}),Hu(t,r),console.log(` Plugin installed to: ${r}`),a.info("OPENCODE","Plugin installed",{destination:r}),0}catch(o){let s=o instanceof Error?o.message:String(o);return console.error(`Failed to install OpenCode plugin: ${s}`),1}}function Mr(t){let e=Xe();try{return Rt(e,t,"# Claude-Mem Memory Context"),a.info("OPENCODE","Context injected into AGENTS.md",{path:e}),0}catch(r){let o=r instanceof Error?r.message:String(r);return console.error(`Failed to inject context into AGENTS.md: ${o}`),1}}async function Ku(t,e){try{await Yu(t,e)}catch(r){r instanceof Error?a.debug("WORKER","Worker not available during context sync",{},r):a.debug("WORKER","Worker not available during context sync",{},new Error(String(r)))}}async function Ju(){let t=He();if(!(await fetch(`http://127.0.0.1:${t}/api/readiness`)).ok)return null;let r=await fetch(`http://127.0.0.1:${t}/api/context/inject?project=opencode`);if(!r.ok)return null;let o=await r.text();return o&&o.trim()?o:null}async function Yu(t,e){let r=await fetch(`http://127.0.0.1:${t}/api/context/inject?project=${encodeURIComponent(e)}`);if(!r.ok)return;let o=await r.text();o&&o.trim()&&Mr(o)!==0&&a.warn("OPENCODE","Failed to inject context into AGENTS.md during sync")}function Vu(t,e){e.length===0||e==="# Claude-Mem Memory Context"?(Mo(t),console.log(" Removed empty AGENTS.md")):(Gu(t,e+`
|
|
201
|
+
`,"utf-8"),console.log(" Cleaned context from AGENTS.md"))}function Xu(){let t=!1,e=ze();if(we(e))try{Mo(e),console.log(` Removed plugin: ${e}`)}catch(o){let s=o instanceof Error?o.message:String(o);console.error(` Failed to remove plugin: ${s}`),t=!0}let r=Xe();if(we(r)){let o;try{o=bo(r,"utf-8")}catch(n){let u=n instanceof Error?n.message:String(n);console.error(` Failed to read AGENTS.md: ${u}`),t=!0,o=""}let s=o.indexOf(Ve),i=o.indexOf(ye);if(s!==-1&&i!==-1){o=o.slice(0,s).trimEnd()+`
|
|
202
|
+
`+o.slice(i+ye.length).trimStart();let n=o.trim();try{Vu(r,n)}catch(u){let c=u instanceof Error?u.message:String(u);console.error(` Failed to clean AGENTS.md: ${c}`),t=!0}}}return t?1:0}function zu(){console.log(`
|
|
203
203
|
Claude-Mem OpenCode Integration Status
|
|
204
|
-
`);let t
|
|
204
|
+
`);let t=Pt(),e=ze(),r=Xe();if(console.log(`Config directory: ${t}`),console.log(` Exists: ${we(t)?"yes":"no"}`),console.log(""),console.log(`Plugin: ${e}`),console.log(` Installed: ${we(e)?"yes":"no"}`),console.log(""),console.log(`Context (AGENTS.md): ${r}`),we(r)){let s=bo(r,"utf-8").includes(Ve);console.log(" Exists: yes"),console.log(` Has claude-mem context: ${s?"yes":"no"}`)}else console.log(" Exists: no");return console.log(""),0}async function qu(){console.log(`
|
|
205
205
|
Installing Claude-Mem for OpenCode...
|
|
206
|
-
`);let t
|
|
206
|
+
`);let t=$o();if(t!==0)return t;let r=`# Memory Context from Past Sessions
|
|
207
207
|
|
|
208
208
|
*No context yet. Complete your first session and context will appear here.*
|
|
209
209
|
|
|
210
|
-
Use claude-mem search tools for manual memory queries.`,
|
|
210
|
+
Use claude-mem search tools for manual memory queries.`,o="placeholder";try{let i=await Ju();i&&(r=i,o="existing memory")}catch(i){i instanceof Error?a.debug("WORKER","Worker not available during OpenCode install",{},i):a.debug("WORKER","Worker not available during OpenCode install",{},new Error(String(i)))}return Mr(r)!==0?a.warn("OPENCODE",`Failed to inject ${o} context into AGENTS.md during install`):console.log(o==="existing memory"?" Context injected from existing memory":" Placeholder context created (worker not running)"),console.log(`
|
|
211
211
|
Installation complete!
|
|
212
212
|
|
|
213
|
-
Plugin installed to: ${
|
|
214
|
-
Context file: ${
|
|
213
|
+
Plugin installed to: ${ze()}
|
|
214
|
+
Context file: ${Xe()}
|
|
215
215
|
|
|
216
216
|
Next steps:
|
|
217
217
|
1. Start claude-mem worker: npx claude-mem start
|
|
218
218
|
2. Restart OpenCode to load the plugin
|
|
219
219
|
3. Memory capture is automatic from then on
|
|
220
|
-
`),0}var
|
|
220
|
+
`),0}var $r=m(()=>{"use strict";T();Ar();At()});var Pr={};Y(Pr,{checkWindsurfHooksStatus:()=>jo,handleWindsurfCommand:()=>aa,installWindsurfHooks:()=>Bo,readWindsurfRegistry:()=>Nt,registerWindsurfProject:()=>Oo,uninstallWindsurfHooks:()=>No,unregisterWindsurfProject:()=>Lo,updateWindsurfContextForProject:()=>ea,writeWindsurfContextFile:()=>Rr,writeWindsurfRegistry:()=>Tr});import N from"path";import{homedir as Zu}from"os";import{existsSync as _e,readFileSync as Lt,writeFileSync as qe,unlinkSync as Ro,mkdirSync as Bt,renameSync as Qu}from"fs";function Nt(){try{return _e(ve)?JSON.parse(Lt(ve,"utf-8")):{}}catch(t){return t instanceof Error?a.error("WORKER","Failed to read registry, using empty",{file:ve},t):a.error("WORKER","Failed to read registry, using empty",{file:ve},new Error(String(t))),{}}}function Tr(t){let e=N.dirname(ve);Bt(e,{recursive:!0}),qe(ve,JSON.stringify(t,null,2))}function Oo(t){let e=Nt();e[t]={installedAt:new Date().toISOString()},Tr(e),a.info("WINDSURF","Registered project for auto-context updates",{workspacePath:t})}function Lo(t){let e=Nt();e[t]&&(delete e[t],Tr(e),a.info("WINDSURF","Unregistered project",{workspacePath:t}))}async function ea(t,e,r){if(Nt()[e])try{let i=await fetch(`http://127.0.0.1:${r}/api/context/inject?project=${encodeURIComponent(t)}`);if(!i.ok)return;let n=await i.text();if(!n||!n.trim())return;Rr(e,n),a.debug("WINDSURF","Updated context file",{projectName:t,workspacePath:e})}catch(i){i instanceof Error?a.error("WORKER","Failed to update context file",{projectName:t,workspacePath:e},i):a.error("WORKER","Failed to update context file",{projectName:t,workspacePath:e},new Error(String(i)))}}function Rr(t,e){let r=N.join(t,".windsurf","rules"),o=N.join(r,"claude-mem-context.md"),s=`${o}.tmp`;Bt(r,{recursive:!0});let i=`# Memory Context from Past Sessions
|
|
221
221
|
|
|
222
222
|
The following context is from claude-mem, a persistent memory system that tracks your coding sessions.
|
|
223
223
|
|
|
@@ -225,13 +225,13 @@ ${e}
|
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
*Auto-updated by claude-mem after each session. Use MCP search tools for detailed queries.*
|
|
228
|
-
`;i.length>
|
|
228
|
+
`;i.length>To&&(i=i.slice(0,To-50)+`
|
|
229
229
|
|
|
230
230
|
*[Truncated \u2014 use MCP search for full history]*
|
|
231
|
-
`),
|
|
231
|
+
`),qe(s,i),Qu(s,o)}function ta(t,e,r){let s={pre_user_prompt:"session-init",post_write_code:"file-edit",post_run_command:"observation",post_mcp_tool_use:"observation",post_cascade_response:"observation"}[r]??"observation";return`"${t}" "${e}" hook windsurf ${s}`}function ra(t,e,r){Bt(Po,{recursive:!0});let o={hooks:{}};if(_e(_))try{o=JSON.parse(Lt(_,"utf-8")),o.hooks||(o.hooks={})}catch(s){throw s instanceof Error?a.error("WORKER","Corrupt hooks.json, refusing to overwrite",{path:_},s):a.error("WORKER","Corrupt hooks.json, refusing to overwrite",{path:_},new Error(String(s))),new Error(`Corrupt hooks.json at ${_}, refusing to overwrite`)}for(let s of Ot){let n={command:ta(t,e,s),show_output:!1,working_directory:r},u=(o.hooks[s]??[]).filter(c=>!c.command.includes("worker-service")||!c.command.includes("windsurf"));o.hooks[s]=[...u,n]}qe(_,JSON.stringify(o,null,2))}async function Bo(){console.log(`
|
|
232
232
|
Installing Claude-Mem Windsurf hooks (user level)...
|
|
233
|
-
`);let t=Ee();if(!t)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let e=he();if(!e)return console.error("Could not find Bun runtime"),console.error(" Install Bun: curl -fsSL https://bun.sh/install | bash"),1;let
|
|
234
|
-
Installation failed: ${i}`),1}}async function
|
|
233
|
+
`);let t=Ee();if(!t)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let e=he();if(!e)return console.error("Could not find Bun runtime"),console.error(" Install Bun: curl -fsSL https://bun.sh/install | bash"),1;let r=N.dirname(t);console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`);let o=process.cwd();try{return await na(e,t,r,o),0}catch(s){let i=s instanceof Error?s.message:String(s);return console.error(`
|
|
234
|
+
Installation failed: ${i}`),1}}async function na(t,e,r,o){ra(t,e,r),console.log(" Created/merged hooks.json"),await oa(o),console.log(`
|
|
235
235
|
Installation complete!
|
|
236
236
|
|
|
237
237
|
Hooks installed to: ${_}
|
|
@@ -248,21 +248,21 @@ Next steps:
|
|
|
248
248
|
1. Start claude-mem worker: claude-mem start
|
|
249
249
|
2. Restart Windsurf to load the hooks
|
|
250
250
|
3. Context is injected via .windsurf/rules/claude-mem-context.md (workspace-level)
|
|
251
|
-
`)}async function
|
|
251
|
+
`)}async function oa(t){let e=He(),r=N.basename(t),o=!1;console.log(" Generating initial context...");try{o=await sa(e,r,t)}catch(s){s instanceof Error?a.debug("WORKER","Worker not running during install",{},s):a.debug("WORKER","Worker not running during install",{},new Error(String(s)))}if(!o){let s=N.join(t,".windsurf","rules");Bt(s,{recursive:!0});let i=N.join(s,"claude-mem-context.md");qe(i,`# Memory Context from Past Sessions
|
|
252
252
|
|
|
253
253
|
*No context yet. Complete your first session and context will appear here.*
|
|
254
254
|
|
|
255
255
|
Use claude-mem's MCP search tools for manual memory queries.
|
|
256
|
-
`),console.log(" Created placeholder context file (will populate after first session)")}
|
|
256
|
+
`),console.log(" Created placeholder context file (will populate after first session)")}Oo(t),console.log(" Registered for auto-context updates")}async function sa(t,e,r){if(!(await fetch(`http://127.0.0.1:${t}/api/readiness`)).ok)return!1;let s=await fetch(`http://127.0.0.1:${t}/api/context/inject?project=${encodeURIComponent(e)}`);if(!s.ok)return!1;let i=await s.text();return i&&i.trim()?(Rr(r,i),console.log(" Generated initial context from existing memory"),!0):!1}function No(){if(console.log(`
|
|
257
257
|
Uninstalling Claude-Mem Windsurf hooks...
|
|
258
|
-
`),_e(_))try{
|
|
259
|
-
Uninstallation failed: ${
|
|
258
|
+
`),_e(_))try{ia()}catch(e){e instanceof Error?a.error("WORKER","Could not parse hooks.json during uninstall",{path:_},e):a.error("WORKER","Could not parse hooks.json during uninstall",{path:_},new Error(String(e))),console.log(" Warning: could not parse hooks.json \u2014 leaving file intact to preserve other hooks")}else console.log(" No hooks.json found");let t=process.cwd();try{return ua(t),0}catch(e){let r=e instanceof Error?e.message:String(e);return console.error(`
|
|
259
|
+
Uninstallation failed: ${r}`),1}}function ia(){let e={hooks:JSON.parse(Lt(_,"utf-8")).hooks??{}};for(let r of Ot){let o=e.hooks[r]??[];o.length>0&&(e.hooks[r]=o.filter(s=>!s.command.includes("worker-service")||!s.command.includes("windsurf")),e.hooks[r].length===0&&delete e.hooks[r])}Object.keys(e.hooks).length===0?(Ro(_),console.log(" Removed hooks.json (no hooks remaining)")):(qe(_,JSON.stringify(e,null,2)),console.log(" Removed claude-mem entries from hooks.json (other hooks preserved)"))}function ua(t){let e=N.join(t,".windsurf","rules","claude-mem-context.md");_e(e)&&(Ro(e),console.log(" Removed context file")),Lo(t),console.log(" Unregistered from auto-context updates"),console.log(`
|
|
260
260
|
Uninstallation complete!
|
|
261
|
-
`),console.log("Restart Windsurf to apply changes.")}function
|
|
261
|
+
`),console.log("Restart Windsurf to apply changes.")}function jo(){if(console.log(`
|
|
262
262
|
Claude-Mem Windsurf Hooks Status
|
|
263
|
-
`),_e(_)){console.log("User-level: Installed"),console.log(` Config: ${_}`);let t=null;try{t=JSON.parse(
|
|
263
|
+
`),_e(_)){console.log("User-level: Installed"),console.log(` Config: ${_}`);let t=null;try{t=JSON.parse(Lt(_,"utf-8"))}catch(r){let o=r instanceof Error?r:new Error(String(r));a.error("WORKER","Unable to parse hooks.json",{path:_},o),console.log(" Mode: Unable to parse hooks.json")}if(t){let r=Ot.filter(o=>(t?.hooks?.[o]??[]).some(s=>s.command.includes("worker-service")&&s.command.includes("windsurf")));console.log(` Events: ${r.length}/${Ot.length} registered`);for(let o of r)console.log(` - ${o}`)}let e=N.join(process.cwd(),".windsurf","rules","claude-mem-context.md");_e(e)?console.log(" Context: Active (current workspace)"):console.log(" Context: Not yet generated for this workspace")}else console.log("User-level: Not installed"),console.log(`
|
|
264
264
|
No hooks installed. Run: claude-mem windsurf install
|
|
265
|
-
`);return console.log(""),0}async function
|
|
265
|
+
`);return console.log(""),0}async function aa(t,e){switch(t){case"install":return Bo();case"uninstall":return No();case"status":return jo();default:return console.log(`
|
|
266
266
|
Claude-Mem Windsurf Integration
|
|
267
267
|
|
|
268
268
|
Usage: claude-mem windsurf <command>
|
|
@@ -278,33 +278,33 @@ Examples:
|
|
|
278
278
|
claude-mem windsurf status # Check if hooks are installed
|
|
279
279
|
|
|
280
280
|
For more info: https://docs.claude-mem.ai/windsurf
|
|
281
|
-
`),0}}var
|
|
282
|
-
`,"utf-8")}function
|
|
283
|
-
`,"utf-8"),
|
|
281
|
+
`),0}}var Po,_,To,ve,Ot,Or=m(()=>{"use strict";T();At();We();Je();Po=N.join(Zu(),".codeium","windsurf"),_=N.join(Po,"hooks.json"),To=6e3,ve=N.join(R,"windsurf-projects.json"),Ot=["pre_user_prompt","post_write_code","post_run_command","post_mcp_tool_use","post_cascade_response"]});var Nr={};Y(Nr,{checkOpenClawStatus:()=>ga,findPluginManifestPath:()=>Ko,findPluginSkillsDirectory:()=>Jo,findPreBuiltPluginDirectory:()=>Ho,getOpenClawClaudeMemExtensionDirectory:()=>Qe,getOpenClawConfigDirectory:()=>Ze,getOpenClawConfigFilePath:()=>xe,getOpenClawExtensionsDirectory:()=>Wo,installOpenClawIntegration:()=>fa,installOpenClawPlugin:()=>Vo,uninstallOpenClawPlugin:()=>ma});import w from"path";import{homedir as jt}from"os";import{existsSync as X,readFileSync as ca,writeFileSync as Uo,mkdirSync as Go,cpSync as Lr,rmSync as la}from"fs";function Ze(){return w.join(jt(),".openclaw")}function Wo(){return w.join(Ze(),"extensions")}function Qe(){return w.join(Wo(),"claude-mem")}function xe(){return w.join(Ze(),"openclaw.json")}function Ho(){let t=[w.join(process.env.CLAUDE_CONFIG_DIR||w.join(jt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let r=w.join(e,"openclaw","dist"),o=w.join(r,"index.js");if(X(o))return r}return null}function Ko(){let t=[w.join(process.env.CLAUDE_CONFIG_DIR||w.join(jt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let r=w.join(e,"openclaw","openclaw.plugin.json");if(X(r))return r}return null}function Jo(){let t=[w.join(process.env.CLAUDE_CONFIG_DIR||w.join(jt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let r=w.join(e,"openclaw","skills");if(X(r))return r}return null}function Br(){let t=xe();if(!X(t))return{};try{return JSON.parse(ca(t,"utf-8"))}catch(e){let r=e instanceof Error?e:new Error(String(e));throw a.error("WORKER","Failed to parse openclaw.json",{path:t},r),r}}function Yo(t){let e=Ze();Go(e,{recursive:!0}),Uo(xe(),JSON.stringify(t,null,2)+`
|
|
282
|
+
`,"utf-8")}function Da(t=37777,e="openclaw",r=!0){let o=Br();if(o.plugins||(o.plugins={}),o.plugins.slots||(o.plugins.slots={}),o.plugins.entries||(o.plugins.entries={}),o.plugins.slots.memory="claude-mem",!o.plugins.entries["claude-mem"])o.plugins.entries["claude-mem"]={enabled:!0,config:{workerPort:t,project:e,syncMemoryFile:r}};else{o.plugins.entries["claude-mem"].enabled=!0,o.plugins.entries["claude-mem"].config||(o.plugins.entries["claude-mem"].config={});let s=o.plugins.entries["claude-mem"].config;s.workerPort===void 0&&(s.workerPort=t),s.project===void 0&&(s.project=e),s.syncMemoryFile===void 0&&(s.syncMemoryFile=r)}Yo(o)}function da(){let t=xe();if(!X(t))return;let e=Br();e.plugins?.entries?.["claude-mem"]&&delete e.plugins.entries["claude-mem"],e.plugins?.slots?.memory==="claude-mem"&&delete e.plugins.slots.memory,Yo(e)}function Vo(){let t=Ho();if(!t)return console.error("Could not find pre-built OpenClaw plugin bundle."),console.error(" Expected at: openclaw/dist/index.js"),console.error(" Ensure the npm package includes the openclaw directory."),1;let e=Qe(),r=w.join(e,"dist"),o=Ko(),s=Jo(),i={name:"claude-mem",version:"1.0.0",type:"module",main:"dist/index.js",openclaw:{extensions:["./dist/index.js"]}};try{return Go(r,{recursive:!0}),pa(t,r,e,o,s,i),0}catch(n){let u=n instanceof Error?n.message:String(n);return console.error(`Failed to install OpenClaw plugin: ${u}`),1}}function pa(t,e,r,o,s,i){if(Lr(t,e,{recursive:!0,force:!0}),console.log(` Plugin dist copied to: ${e}`),o){let n=w.join(r,"openclaw.plugin.json");Lr(o,n,{force:!0}),console.log(` Plugin manifest copied to: ${n}`)}if(s){let n=w.join(r,"skills");Lr(s,n,{recursive:!0,force:!0}),console.log(` Skills copied to: ${n}`)}Uo(w.join(r,"package.json"),JSON.stringify(i,null,2)+`
|
|
283
|
+
`,"utf-8"),Da(),console.log(" Registered in openclaw.json"),a.info("OPENCLAW","Plugin installed",{destination:r})}function ma(){let t=!1,e=Qe();if(X(e))try{la(e,{recursive:!0,force:!0}),console.log(` Removed extension: ${e}`)}catch(r){let o=r instanceof Error?r.message:String(r);console.error(` Failed to remove extension directory: ${o}`),t=!0}try{da(),console.log(" Unregistered from openclaw.json")}catch(r){let o=r instanceof Error?r.message:String(r);console.error(` Failed to update openclaw.json: ${o}`),t=!0}return t?1:0}function ga(){console.log(`
|
|
284
284
|
Claude-Mem OpenClaw Integration Status
|
|
285
|
-
`);let t=
|
|
285
|
+
`);let t=Ze(),e=Qe(),r=xe(),o=w.join(e,"dist","index.js");if(console.log(`Config directory: ${t}`),console.log(` Exists: ${X(t)?"yes":"no"}`),console.log(""),console.log(`Extension directory: ${e}`),console.log(` Exists: ${X(e)?"yes":"no"}`),console.log(` Plugin entry: ${X(o)?"yes":"no"}`),console.log(""),console.log(`Config (openclaw.json): ${r}`),X(r)){let s=Br(),i=s.plugins?.entries?.["claude-mem"]!==void 0,n=s.plugins?.entries?.["claude-mem"]?.enabled===!0,u=s.plugins?.slots?.memory==="claude-mem";if(console.log(" Exists: yes"),console.log(` Registered: ${i?"yes":"no"}`),console.log(` Enabled: ${n?"yes":"no"}`),console.log(` Memory slot: ${u?"yes":"no"}`),i){let c=s.plugins.entries["claude-mem"].config;c&&(console.log(` Worker port: ${c.workerPort??"default"}`),console.log(` Project: ${c.project??"default"}`),console.log(` Sync MEMORY.md: ${c.syncMemoryFile??"default"}`))}}else console.log(" Exists: no");return console.log(""),0}async function fa(){console.log(`
|
|
286
286
|
Installing Claude-Mem for OpenClaw...
|
|
287
|
-
`);let t=
|
|
287
|
+
`);let t=Vo();if(t!==0)return t;let e=Qe();return console.log(`
|
|
288
288
|
Installation complete!
|
|
289
289
|
|
|
290
290
|
Plugin installed to: ${e}
|
|
291
|
-
Config updated: ${
|
|
291
|
+
Config updated: ${xe()}
|
|
292
292
|
|
|
293
293
|
Next steps:
|
|
294
294
|
1. Start claude-mem worker: npx claude-mem start
|
|
295
295
|
2. Restart OpenClaw to load the plugin
|
|
296
296
|
3. Memory capture is automatic from then on
|
|
297
|
-
`),0}var
|
|
298
|
-
`)}function
|
|
297
|
+
`),0}var jr=m(()=>{"use strict";T()});import{existsSync as Cd,readFileSync as Ed,writeFileSync as hd,mkdirSync as Fd}from"fs";import{homedir as Xo}from"os";import{join as zo,dirname as wd}from"path";var le,et,Ca,Ut,qo=m(()=>{"use strict";le=zo(Xo(),".claude-mem","transcript-watch.json"),et=zo(Xo(),".claude-mem","transcript-watch-state.json"),Ca={name:"codex",version:"0.3",description:"Schema for Codex session JSONL files under ~/.codex/sessions.",events:[{name:"session-meta",match:{path:"type",equals:"session_meta"},action:"session_context",fields:{sessionId:"payload.id",cwd:"payload.cwd"}},{name:"turn-context",match:{path:"type",equals:"turn_context"},action:"session_context",fields:{cwd:"payload.cwd"}},{name:"user-message",match:{path:"payload.type",equals:"user_message"},action:"session_init",fields:{prompt:"payload.message"}},{name:"assistant-message",match:{path:"payload.type",equals:"agent_message"},action:"assistant_message",fields:{message:"payload.message"}},{name:"tool-use",match:{path:"payload.type",in:["function_call","custom_tool_call","web_search_call","exec_command"]},action:"tool_use",fields:{toolId:"payload.call_id",toolName:{coalesce:["payload.name","payload.type",{value:"web_search"}]},toolInput:{coalesce:["payload.arguments","payload.input","payload.command","payload.action"]}}},{name:"tool-result",match:{path:"payload.type",in:["function_call_output","custom_tool_call_output","exec_command_output"]},action:"tool_result",fields:{toolId:"payload.call_id",toolResponse:"payload.output"}},{name:"session-end",match:{path:"payload.type",in:["turn_aborted","turn_completed"]},action:"session_end"}]},Ut={version:1,schemas:{codex:Ca},watches:[{name:"codex",path:"~/.codex/sessions/**/*.jsonl",schema:"codex",startAtEnd:!0,context:{mode:"agents",updateOn:["session_start","session_end"]}}],stateFile:et}});var Hr={};Y(Hr,{installCodexCli:()=>va,uninstallCodexCli:()=>xa});import Gr from"path";import{homedir as Zo}from"os";import{existsSync as Wr,readFileSync as Ur,writeFileSync as Gt,mkdirSync as Ea}from"fs";function Qo(){let t=le;if(!Wr(t))return{version:1,schemas:{},watches:[],stateFile:et};try{let e=Ur(t,"utf-8"),r=JSON.parse(e);return r.version||(r.version=1),r.watches||(r.watches=[]),r.schemas||(r.schemas={}),r.stateFile||(r.stateFile=et),r}catch(e){e instanceof Error?a.error("WORKER","Corrupt transcript-watch.json, creating backup",{path:t},e):a.error("WORKER","Corrupt transcript-watch.json, creating backup",{path:t},new Error(String(e)));let r=`${t}.backup.${Date.now()}`;return Gt(r,Ur(t)),console.warn(` Backed up corrupt transcript-watch.json to ${r}`),{version:1,schemas:{},watches:[],stateFile:et}}}function Sa(t){let e={...t};e.schemas={...e.schemas};let r=Ut.schemas?.[ke];r&&(e.schemas[ke]=r);let o=Ut.watches.find(s=>s.name===ke);if(o){let s=e.watches.findIndex(i=>i.name===ke);s!==-1?e.watches[s]=o:e.watches.push(o)}return e}function es(t){Ea(Fa,{recursive:!0}),Gt(le,JSON.stringify(t,null,2)+`
|
|
298
|
+
`)}function ya(){if(!Wr(tt))return;let t="<claude-mem-context>",e="</claude-mem-context>";try{wa(t,e)}catch(r){let o=r instanceof Error?r.message:String(r);a.warn("WORKER","Failed to clean AGENTS.md context",{error:o})}}function wa(t,e){let r=Ur(tt,"utf-8"),o=r.indexOf(t),s=r.indexOf(e);if(o===-1||s===-1)return;let i=r.substring(0,o).replace(/\n+$/,""),n=r.substring(s+e.length).replace(/^\n+/,""),u=(i+(n?`
|
|
299
299
|
|
|
300
|
-
`+
|
|
301
|
-
`):
|
|
300
|
+
`+n:"")).trim();u?Gt(tt,u+`
|
|
301
|
+
`):Gt(tt,""),console.log(` Removed legacy global context from ${tt}`)}async function va(){console.log(`
|
|
302
302
|
Installing Claude-Mem for Codex CLI (transcript watching)...
|
|
303
|
-
`);let t=
|
|
304
|
-
Installation failed: ${
|
|
303
|
+
`);let t=Qo(),e=Sa(t);try{return _a(e),0}catch(r){let o=r instanceof Error?r.message:String(r);return console.error(`
|
|
304
|
+
Installation failed: ${o}`),1}}function _a(t){es(t),console.log(` Updated ${le}`),console.log(" Watch path: ~/.codex/sessions/**/*.jsonl"),console.log(` Schema: codex (v${Ut.schemas?.codex?.version??"?"})`),ts(),console.log(`
|
|
305
305
|
Installation complete!
|
|
306
306
|
|
|
307
|
-
Transcript watch config: ${
|
|
307
|
+
Transcript watch config: ${le}
|
|
308
308
|
Context files: <workspace>/AGENTS.md
|
|
309
309
|
|
|
310
310
|
How it works:
|
|
@@ -315,36 +315,30 @@ How it works:
|
|
|
315
315
|
Next steps:
|
|
316
316
|
1. Start claude-mem worker: npx claude-mem start
|
|
317
317
|
2. Use Codex CLI as usual -- memory capture is automatic!
|
|
318
|
-
`)}function
|
|
318
|
+
`)}function xa(){if(console.log(`
|
|
319
319
|
Uninstalling Claude-Mem Codex CLI integration...
|
|
320
|
-
`),
|
|
321
|
-
Uninstallation failed: ${
|
|
320
|
+
`),Wr(le)){let t=Qo();t.watches=t.watches.filter(e=>e.name!==ke),t.schemas&&delete t.schemas[ke];try{es(t),console.log(` Removed codex watch from ${le}`)}catch(e){let r=e instanceof Error?e.message:String(e);return console.error(`
|
|
321
|
+
Uninstallation failed: ${r}`),1}}else console.log(" No transcript-watch.json found -- nothing to remove.");return ts(),console.log(`
|
|
322
322
|
Uninstallation complete!`),console.log(`Restart claude-mem worker to apply changes.
|
|
323
|
-
`),0}function
|
|
324
|
-
|
|
325
|
-
`),!Ae(j))return console.log("Status: Not installed"),console.log(` No transcript watch config at ${j}`),console.log(`
|
|
326
|
-
Run: npx claude-mem install --ide codex-cli
|
|
327
|
-
`),0;let t;try{t=Tn()}catch(s){return s instanceof Error?D.error("WORKER","Could not parse transcript-watch.json",{path:j},s):D.error("WORKER","Could not parse transcript-watch.json",{path:j},new Error(String(s))),console.log("Status: Unknown"),console.log(" Could not parse transcript-watch.json."),console.log(""),0}let e=t.watches.find(s=>s.name===oe),n=t.schemas?.[oe];if(!e)return console.log("Status: Not installed"),console.log(" transcript-watch.json exists but no codex watch configured."),console.log(`
|
|
328
|
-
Run: npx claude-mem install --ide codex-cli
|
|
329
|
-
`),0;console.log("Status: Installed"),console.log(` Config: ${j}`),console.log(` Watch path: ${e.path}`),console.log(` Schema: ${n?`codex (v${n.version??"?"})`:"missing"}`),console.log(` Start at end: ${e.startAtEnd??!1}`),e.context&&(console.log(` Context mode: ${e.context.mode}`),console.log(` Context path: ${e.context.path??"<workspace>/AGENTS.md (default)"}`),console.log(` Context updates on: ${e.context.updateOn?.join(", ")??"none"}`)),Ae(ne)?Lt(ne,"utf-8").includes("<claude-mem-context>")?console.log(` Legacy global context: Present (${ne})`):console.log(" Legacy global context: Not active"):console.log(" Legacy global context: None");let r=jt.join(br,"sessions");return Ae(r)?console.log(" Sessions directory: exists"):console.log(" Sessions directory: not yet created (use Codex CLI to generate sessions)"),console.log(""),0}var br,ne,vu,oe,$r,Ln=C(()=>{"use strict";Y();wr();br=jt.join(Ar(),".codex"),ne=jt.join(br,"AGENTS.md"),vu=jt.join(Ar(),".claude-mem"),oe="codex";$r=wu});var Br={};V(Br,{MCP_IDE_INSTALLERS:()=>Ku,installGooseMcpIntegration:()=>Tr});import B from"path";import{homedir as tt}from"os";import{existsSync as Or,readFileSync as Iu,writeFileSync as et,mkdirSync as Rr}from"fs";function Ru(t){return{command:process.execPath,args:[t]}}function Tu(t,e,n="mcpServers"){let r=B.dirname(t);Rr(r,{recursive:!0});let s=W(t,{});s[n]||(s[n]={}),s[n]["claude-mem"]=Ru(e),et(t,JSON.stringify(s,null,2)+`
|
|
330
|
-
`)}function Qe(t){return async()=>{console.log(`
|
|
323
|
+
`),0}var ha,tt,Fa,ke,ts,Kr=m(()=>{"use strict";T();qo();ha=Gr.join(Zo(),".codex"),tt=Gr.join(ha,"AGENTS.md"),Fa=Gr.join(Zo(),".claude-mem"),ke="codex";ts=ya});var us={};Y(us,{MCP_IDE_INSTALLERS:()=>ja,installGooseMcpIntegration:()=>is});import L from"path";import{homedir as ot}from"os";import{existsSync as os,readFileSync as ka,writeFileSync as nt,mkdirSync as ss}from"fs";function ba(t){return{command:process.execPath,args:[t]}}function Ma(t,e,r="mcpServers"){let o=L.dirname(t);ss(o,{recursive:!0});let s=G(t,{});s[r]||(s[r]={}),s[r]["claude-mem"]=ba(e),nt(t,JSON.stringify(s,null,2)+`
|
|
324
|
+
`)}function rt(t){return async()=>{console.log(`
|
|
331
325
|
Installing Claude-Mem MCP integration for ${t.ideLabel}...
|
|
332
|
-
`);let e=
|
|
333
|
-
Installation failed: ${
|
|
326
|
+
`);let e=Ke();if(!e)return console.error("Could not find MCP server script"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/mcp-server.cjs"),1;let r=t.configPath,o=t.ideId==="warp"&&!os(L.dirname(r)),s;t.contextFile&&(s=t.contextFile.path);try{return Ia(t,r,e,o,s),0}catch(i){let n=i instanceof Error?i.message:String(i);return console.error(`
|
|
327
|
+
Installation failed: ${n}`),1}}}function Ia(t,e,r,o,s){o?console.log(" Note: ~/.warp/ not found. MCP may need to be configured via Warp Drive UI."):(Ma(e,r,t.configKey),console.log(` MCP config written to: ${e}`)),s&&(Rt(s,Aa),console.log(` Context placeholder written to: ${s}`));let i=[`
|
|
334
328
|
Installation complete!
|
|
335
329
|
`];i.push(`MCP config: ${e}`),s&&i.push(`Context: ${s}`),i.push(""),i.push("Note: This is an MCP-only integration providing search tools and context."),i.push(`Transcript capture is not available for ${t.ideLabel}.`),t.ideId==="warp"&&i.push("If MCP config via file is not supported, configure MCP through Warp Drive UI."),i.push(""),i.push("Next steps:"),i.push(" 1. Start claude-mem worker: npx claude-mem start"),i.push(` 2. Restart ${t.ideLabel} to pick up the MCP server`),i.push(""),console.log(i.join(`
|
|
336
|
-
`))}function
|
|
337
|
-
`)}function
|
|
338
|
-
`)}async function
|
|
330
|
+
`))}function La(){return L.join(ot(),".config","goose","config.yaml")}function Ba(t){return t.includes("claude-mem:")&&t.includes("mcpServers:")}function rs(t){return["mcpServers:"," claude-mem:",` command: ${process.execPath}`," args:",` - ${t}`].join(`
|
|
331
|
+
`)}function ns(t){return[" claude-mem:",` command: ${process.execPath}`," args:",` - ${t}`].join(`
|
|
332
|
+
`)}async function is(){console.log(`
|
|
339
333
|
Installing Claude-Mem MCP integration for Goose...
|
|
340
|
-
`);let t=
|
|
341
|
-
Installation failed: ${s}`),1}}function
|
|
342
|
-
`;if(!
|
|
343
|
-
`+
|
|
344
|
-
`+
|
|
345
|
-
`;
|
|
346
|
-
`+
|
|
347
|
-
`;
|
|
334
|
+
`);let t=Ke();if(!t)return console.error("Could not find MCP server script"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/mcp-server.cjs"),1;let e=La(),r=L.dirname(e);try{return ss(r,{recursive:!0}),Na(e,t),0}catch(o){let s=o instanceof Error?o.message:String(o);return console.error(`
|
|
335
|
+
Installation failed: ${s}`),1}}function Na(t,e){if(os(t)){let r=ka(t,"utf-8");if(Ba(r)){let o=/( {2}claude-mem:\n(?:.*\n)*?(?= {2}\S|\n\n|^\S|$))/m,s=ns(e)+`
|
|
336
|
+
`;if(!o.test(r))throw new Error("Found mcpServers/claude-mem markers but could not locate a replaceable claude-mem block");r=r.replace(o,s),nt(t,r),console.log(` Updated existing claude-mem entry in: ${t}`)}else if(r.includes("mcpServers:")){let s=r.indexOf("mcpServers:")+11,i=`
|
|
337
|
+
`+ns(e);r=r.slice(0,s)+i+r.slice(s),nt(t,r),console.log(` Added claude-mem to existing mcpServers in: ${t}`)}else{let o=`
|
|
338
|
+
`+rs(e)+`
|
|
339
|
+
`;r=r.trimEnd()+`
|
|
340
|
+
`+o,nt(t,r),console.log(` Appended mcpServers section to: ${t}`)}}else{let r=rs(e)+`
|
|
341
|
+
`;nt(t,r),console.log(` Created config with MCP server: ${t}`)}console.log(`
|
|
348
342
|
Installation complete!
|
|
349
343
|
|
|
350
344
|
MCP config: ${t}
|
|
@@ -355,18 +349,18 @@ Transcript capture is not available for Goose.
|
|
|
355
349
|
Next steps:
|
|
356
350
|
1. Start claude-mem worker: npx claude-mem start
|
|
357
351
|
2. Restart Goose to pick up the MCP server
|
|
358
|
-
`)}var
|
|
352
|
+
`)}var Aa,$a,Ta,Ra,Pa,Oa,ja,as=m(()=>{"use strict";Je();Ie();Ar();Aa=`# claude-mem: Cross-Session Memory
|
|
359
353
|
|
|
360
354
|
*No context yet. Complete your first session and context will appear here.*
|
|
361
355
|
|
|
362
|
-
Use claude-mem's MCP search tools for manual memory queries
|
|
356
|
+
Use claude-mem's MCP search tools for manual memory queries.`;$a={ideId:"copilot-cli",ideLabel:"Copilot CLI",configPath:L.join(ot(),".github","copilot","mcp.json"),configKey:"servers",contextFile:{path:L.join(process.cwd(),".github","copilot-instructions.md"),isWorkspaceRelative:!0}},Ta={ideId:"antigravity",ideLabel:"Antigravity",configPath:L.join(ot(),".gemini","antigravity","mcp_config.json"),configKey:"mcpServers",contextFile:{path:L.join(process.cwd(),".agent","rules","claude-mem-context.md"),isWorkspaceRelative:!0}},Ra={ideId:"crush",ideLabel:"Crush",configPath:L.join(ot(),".config","crush","mcp.json"),configKey:"mcpServers"},Pa={ideId:"roo-code",ideLabel:"Roo Code",configPath:L.join(process.cwd(),".roo","mcp.json"),configKey:"mcpServers",contextFile:{path:L.join(process.cwd(),".roo","rules","claude-mem-context.md"),isWorkspaceRelative:!0}},Oa={ideId:"warp",ideLabel:"Warp",configPath:L.join(ot(),".warp","mcp.json"),configKey:"mcpServers",contextFile:{path:L.join(process.cwd(),"WARP.md"),isWorkspaceRelative:!0}};ja={"copilot-cli":rt($a),antigravity:rt(Ta),goose:is,crush:rt(Ra),"roo-code":rt(Pa),warp:rt(Oa)}});var Wt={};Y(Wt,{runInstallCommand:()=>Za});import{execSync as Jr}from"child_process";import{cpSync as cs,existsSync as st,readFileSync as Ua,rmSync as ls}from"fs";import{join as Ae}from"path";async function Ga(t){if(ne)await ht(t);else for(let e of t){let r=await e.task(o=>console.log(` ${o}`));console.log(` ${r}`)}}function Wa(){let t=G(pe(),{});t.thedotmack={source:{source:"github",repo:"thedotmack/claude-mem"},installLocation:b(),lastUpdated:new Date().toISOString(),autoUpdate:!0},Re(ue()),Z(pe(),t)}function Ha(t){let e=G(me(),{});e.version||(e.version=2),e.plugins||(e.plugins={});let r=Xt(t),o=new Date().toISOString();e.plugins["claude-mem@thedotmack"]=[{scope:"user",installPath:r,version:t,installedAt:o,lastUpdated:o}],Z(me(),e)}function Ka(){let t=G(ge(),{});t.enabledPlugins||(t.enabledPlugins={}),t.enabledPlugins["claude-mem@thedotmack"]=!0,Z(ge(),t)}async function Ja(t){let e=[];for(let r of t)switch(r){case"claude-code":{try{Jr("claude plugin marketplace add thedotmack/claude-mem && claude plugin install claude-mem",{stdio:"inherit"}),f.success("Claude Code: plugin installed via CLI.")}catch(o){console.error("[install] Claude Code plugin install error:",o instanceof Error?o.message:String(o)),f.error("Claude Code: plugin install failed. Is `claude` CLI on your PATH?"),e.push(r)}break}case"cursor":{let{installCursorHooks:o,configureCursorMcp:s}=await Promise.resolve().then(()=>(Je(),yo));await o("user")===0?s("user")===0?f.success("Cursor: hooks + MCP installed."):f.success("Cursor: hooks installed (MCP setup failed \u2014 run `npx claude-mem cursor mcp` to retry)."):(f.error("Cursor: hook installation failed."),e.push(r));break}case"gemini-cli":{let{installGeminiCliHooks:o}=await Promise.resolve().then(()=>(xr(),_r));await o()===0?f.success("Gemini CLI: hooks installed."):(f.error("Gemini CLI: hook installation failed."),e.push(r));break}case"opencode":{let{installOpenCodeIntegration:o}=await Promise.resolve().then(()=>($r(),Ir));await o()===0?f.success("OpenCode: plugin installed."):(f.error("OpenCode: plugin installation failed."),e.push(r));break}case"windsurf":{let{installWindsurfHooks:o}=await Promise.resolve().then(()=>(Or(),Pr));await o()===0?f.success("Windsurf: hooks installed."):(f.error("Windsurf: hook installation failed."),e.push(r));break}case"openclaw":{let{installOpenClawIntegration:o}=await Promise.resolve().then(()=>(jr(),Nr));await o()===0?f.success("OpenClaw: plugin installed."):(f.error("OpenClaw: plugin installation failed."),e.push(r));break}case"codex-cli":{let{installCodexCli:o}=await Promise.resolve().then(()=>(Kr(),Hr));await o()===0?f.success("Codex CLI: transcript watching configured."):(f.error("Codex CLI: integration setup failed."),e.push(r));break}case"copilot-cli":case"antigravity":case"goose":case"crush":case"roo-code":case"warp":{let{MCP_IDE_INSTALLERS:o}=await Promise.resolve().then(()=>(as(),us)),s=o[r];if(s){let i=await s(),c=Ue().find(d=>d.id===r)?.label??r;i===0?f.success(`${c}: MCP integration installed.`):(f.error(`${c}: MCP integration failed.`),e.push(r))}break}default:{let s=Ue().find(i=>i.id===r);s&&!s.supported&&f.warn(`Support for ${s.label} coming soon.`);break}}return e}async function Ya(){let e=Ue().filter(s=>s.detected);if(e.length===0)return f.warn("No supported IDEs detected. Installing for Claude Code by default."),["claude-code"];let r=e.map(s=>({value:s.id,label:s.label,hint:s.supported?s.hint:"coming soon"})),o=await In({message:"Which IDEs do you use?",options:r,initialValues:e.filter(s=>s.supported).map(s=>s.id),required:!0});return ee(o)&&(Ne("Installation cancelled."),process.exit(0)),o}function Va(){let t=b(),e=ct();Re(t);let r=["plugin","package.json","package-lock.json","node_modules","openclaw","dist","LICENSE","README.md","CHANGELOG.md"];for(let o of r){let s=Ae(e,o),i=Ae(t,o);st(s)&&(st(i)&&ls(i,{recursive:!0,force:!0}),cs(s,i,{recursive:!0,force:!0}))}}function Xa(t){let e=zt(),r=Xt(t);ls(r,{recursive:!0,force:!0}),Re(r),cs(e,r,{recursive:!0,force:!0})}function za(){let t=b(),e=Ae(t,"package.json");st(e)&&Jr("npm install --production",{cwd:t,stdio:"pipe",encoding:"utf8",...z?{shell:process.env.ComSpec??"cmd.exe"}:{}})}function qa(){let t=Ae(b(),"plugin","scripts","smart-install.js");if(!st(t))return f.warn("smart-install.js not found \u2014 skipping Bun/uv auto-install."),!1;try{return Jr(`node "${t}"`,{stdio:"inherit",encoding:"utf8",...z?{shell:process.env.ComSpec??"cmd.exe"}:{}}),!0}catch(e){return console.warn("[install] smart-install error:",e instanceof Error?e.message:String(e)),f.warn("smart-install encountered an issue. You may need to install Bun/uv manually."),!1}}async function Za(t={}){let e=Te();ne?Et(h.default.bgCyan(h.default.black(" claude-mem install "))):console.log("claude-mem install"),f.info(`Version: ${h.default.cyan(e)}`),f.info(`Platform: ${process.platform} (${process.arch})`);let r=b();if(st(Ae(r,"plugin",".claude-plugin","plugin.json"))){try{let D=JSON.parse(Ua(Ae(r,"plugin",".claude-plugin","plugin.json"),"utf-8"));f.warn(`Existing installation detected (v${D.version??"unknown"}).`)}catch(D){console.warn("[install] Failed to read existing plugin version:",D instanceof Error?D.message:String(D)),f.warn("Existing installation detected.")}if(process.stdin.isTTY){let D=await Le({message:"Overwrite existing installation?",initialValue:!0});(ee(D)||!D)&&(Ne("Installation cancelled."),process.exit(0))}}let s;if(t.ide){s=[t.ide];let D=Ue(),E=D.find(v=>v.id===t.ide);E&&!E.supported&&(f.error(`Support for ${E.label} coming soon.`),process.exit(1)),E||(f.error(`Unknown IDE: ${t.ide}`),f.info(`Available IDEs: ${D.map(v=>v.id).join(", ")}`),process.exit(1))}else process.stdin.isTTY?s=await Ya():s=["claude-code"];s.some(D=>D!=="claude-code")&&await Ga([{title:"Copying plugin files",task:async D=>(D("Copying to marketplace directory..."),Va(),`Plugin files copied ${h.default.green("OK")}`)},{title:"Caching plugin version",task:async D=>(D(`Caching v${e}...`),Xa(e),`Plugin cached (v${e}) ${h.default.green("OK")}`)},{title:"Registering marketplace",task:async()=>(Wa(),`Marketplace registered ${h.default.green("OK")}`)},{title:"Registering plugin",task:async()=>(Ha(e),`Plugin registered ${h.default.green("OK")}`)},{title:"Enabling plugin in Claude settings",task:async()=>(Ka(),`Plugin enabled ${h.default.green("OK")}`)},{title:"Installing dependencies",task:async D=>{D("Running npm install...");try{return za(),`Dependencies installed ${h.default.green("OK")}`}catch(E){return console.warn("[install] npm install error:",E instanceof Error?E.message:String(E)),`Dependencies may need manual install ${h.default.yellow("!")}`}}},{title:"Setting up Bun and uv",task:async D=>(D("Running smart-install..."),qa()?`Runtime dependencies ready ${h.default.green("OK")}`:`Runtime setup may need attention ${h.default.yellow("!")}`)}]);let n=await Ja(s),u=n.length>0?"Installation Partial":"Installation Complete",c=[`Version: ${h.default.cyan(e)}`,`Plugin dir: ${h.default.cyan(r)}`,`IDEs: ${h.default.cyan(s.join(", "))}`];n.length>0&&c.push(`Failed: ${h.default.red(n.join(", "))}`),ne?Be(c.join(`
|
|
363
357
|
`),u):(console.log(`
|
|
364
|
-
${u}`),c.forEach(
|
|
365
|
-
`),"Next Steps"),
|
|
366
|
-
Next Steps`),
|
|
358
|
+
${u}`),c.forEach(D=>console.log(` ${D}`)));let d=process.env.CLAUDE_MEM_WORKER_PORT||"37777",p=["Open Claude Code and start a conversation -- memory is automatic!",`View your memories: ${h.default.underline(`http://localhost:${d}`)}`,`Search past work: use ${h.default.bold("/mem-search")} in Claude Code`,`Start worker: ${h.default.bold("npx claude-mem start")}`];ne?(Be(p.join(`
|
|
359
|
+
`),"Next Steps"),n.length>0?ce(h.default.yellow("claude-mem installed with some IDE setup failures.")):ce(h.default.green("claude-mem installed successfully!"))):(console.log(`
|
|
360
|
+
Next Steps`),p.forEach(D=>console.log(` ${D}`)),n.length>0?(console.log(`
|
|
367
361
|
claude-mem installed with some IDE setup failures.`),process.exitCode=1):console.log(`
|
|
368
|
-
claude-mem installed successfully!`))}var h,
|
|
369
|
-
`),"Note"),
|
|
362
|
+
claude-mem installed successfully!`))}var h,ne,f,Ht=m(()=>{"use strict";ar();h=ie(de(),1);ae();Ie();Rn();ne=process.stdin.isTTY===!0;f={info:t=>ne?M.info(t):console.log(` ${t}`),success:t=>ne?M.success(t):console.log(` ${t}`),warn:t=>ne?M.warn(t):console.warn(` ${t}`),error:t=>ne?M.error(t):console.error(` ${t}`)}});var ps={};Y(ps,{runUninstallCommand:()=>sc});import{existsSync as Ds,rmSync as ds}from"fs";import{join as Qa}from"path";function ec(){let t=b();return Ds(t)?(ds(t,{recursive:!0,force:!0}),!0):!1}function tc(){let t=Qa(ue(),"cache","thedotmack","claude-mem");return Ds(t)?(ds(t,{recursive:!0,force:!0}),!0):!1}function rc(){let t=G(pe(),{});t.thedotmack&&(delete t.thedotmack,Z(pe(),t))}function nc(){let t=G(me(),{});t.plugins?.["claude-mem@thedotmack"]&&(delete t.plugins["claude-mem@thedotmack"],Z(me(),t))}function oc(){let t=G(ge(),{});t.enabledPlugins?.["claude-mem@thedotmack"]!==void 0&&(delete t.enabledPlugins["claude-mem@thedotmack"],Z(ge(),t))}async function sc(){if(Et(j.default.bgRed(j.default.white(" claude-mem uninstall "))),lt()){if(process.stdin.isTTY){let r=await Le({message:"Are you sure you want to uninstall claude-mem?",initialValue:!1});if(ee(r)||!r){Ne("Uninstall cancelled.");return}}}else if(M.warn("claude-mem does not appear to be installed."),process.stdin.isTTY){let r=await Le({message:"Clean up any remaining registration data anyway?",initialValue:!1});if(ee(r)||!r){ce("Nothing to do.");return}}else{ce("Nothing to do.");return}let t=process.env.CLAUDE_MEM_WORKER_PORT||"37777";try{await fetch(`http://127.0.0.1:${t}/api/admin/shutdown`,{method:"POST",signal:AbortSignal.timeout(5e3)});for(let r=0;r<20;r++){await new Promise(o=>setTimeout(o,500));try{await fetch(`http://127.0.0.1:${t}/api/health`,{signal:AbortSignal.timeout(1e3)})}catch(o){console.error("[uninstall] Worker health check failed (worker stopped):",o instanceof Error?o.message:String(o));break}}M.info("Worker service stopped.")}catch{}await ht([{title:"Removing marketplace directory",task:async()=>ec()?`Marketplace directory removed ${j.default.green("OK")}`:`Marketplace directory not found ${j.default.dim("skipped")}`},{title:"Removing cache directory",task:async()=>tc()?`Cache directory removed ${j.default.green("OK")}`:`Cache directory not found ${j.default.dim("skipped")}`},{title:"Removing marketplace registration",task:async()=>(rc(),`Marketplace registration removed ${j.default.green("OK")}`)},{title:"Removing plugin registration",task:async()=>(nc(),`Plugin registration removed ${j.default.green("OK")}`)},{title:"Removing from Claude settings",task:async()=>(oc(),`Claude settings updated ${j.default.green("OK")}`)}]);let e=[{label:"Gemini CLI hooks",fn:async()=>{let{uninstallGeminiCliHooks:r}=await Promise.resolve().then(()=>(xr(),_r));return r()}},{label:"Windsurf hooks",fn:async()=>{let{uninstallWindsurfHooks:r}=await Promise.resolve().then(()=>(Or(),Pr));return r()}},{label:"OpenCode plugin",fn:async()=>{let{uninstallOpenCodePlugin:r}=await Promise.resolve().then(()=>($r(),Ir));return r()}},{label:"OpenClaw plugin",fn:async()=>{let{uninstallOpenClawPlugin:r}=await Promise.resolve().then(()=>(jr(),Nr));return r()}},{label:"Codex CLI",fn:async()=>{let{uninstallCodexCli:r}=await Promise.resolve().then(()=>(Kr(),Hr));return r()}}];for(let{label:r,fn:o}of e)try{await o()===0&&M.info(`${r}: removed.`)}catch(s){console.warn(`[uninstall] ${r} cleanup failed:`,s instanceof Error?s.message:String(s))}Be([`Your data directory at ${j.default.cyan("~/.claude-mem")} was preserved.`,"To remove it manually: rm -rf ~/.claude-mem"].join(`
|
|
363
|
+
`),"Note"),ce(j.default.green("claude-mem has been uninstalled."))}var j,ms=m(()=>{"use strict";ar();j=ie(de(),1);ae();Ie()});import{spawnSync as ic}from"child_process";import{existsSync as uc}from"fs";import{homedir as Yr}from"os";import{join as Vr}from"path";function ac(){return z?[Vr(Yr(),".bun","bin","bun.exe"),Vr(process.env.USERPROFILE||Yr(),".bun","bin","bun.exe")]:[Vr(Yr(),".bun","bin","bun"),"/usr/local/bin/bun","/opt/homebrew/bin/bun","/home/linuxbrew/.linuxbrew/bin/bun"]}function gs(){let e=ic(z?"where":"which",["bun"],{encoding:"utf-8",stdio:["pipe","pipe","pipe"],shell:z});if(e.status===0&&e.stdout.trim())return"bun";for(let r of ac())if(uc(r))return r;return null}var fs=m(()=>{"use strict";ae()});var oe={};Y(oe,{runAdoptCommand:()=>pc,runRestartCommand:()=>Dc,runSearchCommand:()=>mc,runStartCommand:()=>cc,runStatusCommand:()=>dc,runStopCommand:()=>lc,runTranscriptWatchCommand:()=>gc});import{spawn as Xr}from"child_process";import{existsSync as zr}from"fs";import{join as Cs}from"path";function Kt(){lt()||(console.error(x.default.red("claude-mem is not installed.")),console.error(`Run: ${x.default.bold("npx claude-mem install")}`),process.exit(1))}function qr(){let t=gs();return t||(console.error(x.default.red("Bun not found.")),console.error("Install Bun: https://bun.sh"),console.error("After installation, restart your terminal."),process.exit(1)),t}function Es(){return Cs(b(),"plugin","scripts","worker-service.cjs")}function it(t,e=[]){Kt();let r=qr(),o=Es();zr(o)||(console.error(x.default.red(`Worker script not found at: ${o}`)),console.error("The installation may be corrupted. Try: npx claude-mem install"),process.exit(1));let s=[o,t,...e],i=Xr(r,s,{stdio:"inherit",cwd:b(),env:process.env});i.on("error",n=>{console.error(x.default.red(`Failed to start Bun: ${n.message}`)),process.exit(1)}),i.on("close",n=>{process.exit(n??0)})}function cc(){it("start")}function lc(){it("stop")}function Dc(){it("restart")}function dc(){it("status")}function pc(t=[]){Kt();let e=qr(),r=Es();zr(r)||(console.error(x.default.red(`Worker script not found at: ${r}`)),console.error("The installation may be corrupted. Try: npx claude-mem install"),process.exit(1));let o=process.cwd(),s=[r,"adopt","--cwd",o,...t],i=Xr(e,s,{stdio:"inherit",cwd:b(),env:process.env});i.on("error",n=>{console.error(x.default.red(`Failed to start Bun: ${n.message}`)),process.exit(1)}),i.on("close",n=>{process.exit(n??0)})}async function mc(t){Kt();let e=t.join(" ").trim();e||(console.error(x.default.red("Usage: npx claude-mem search <query>")),process.exit(1));let o=`http://127.0.0.1:${process.env.CLAUDE_MEM_WORKER_PORT||"37777"}/api/search?query=${encodeURIComponent(e)}`,s;try{s=await fetch(o)}catch(n){let u=n instanceof Error?n.message:String(n);((n instanceof Error?n.cause:void 0)?.code==="ECONNREFUSED"||u.includes("ECONNREFUSED"))&&(console.error(x.default.red("Worker is not running.")),console.error(`Start it with: ${x.default.bold("npx claude-mem start")}`),process.exit(1)),console.error(x.default.red(`Search failed: ${u}`)),process.exit(1)}s.ok||(s.status===404&&(console.error(x.default.red("Search endpoint not found. Is the worker running?")),console.error(`Try: ${x.default.bold("npx claude-mem start")}`),process.exit(1)),console.error(x.default.red(`Search failed: HTTP ${s.status}`)),process.exit(1));let i;try{i=await s.json()}catch(n){let u=n instanceof Error?n.message:String(n);console.error(x.default.red(`Search failed: invalid JSON response (${u})`)),process.exit(1)}console.log(typeof i=="object"&&i!==null?JSON.stringify(i,null,2):i)}function gc(){Kt();let t=qr(),e=Cs(b(),"plugin","scripts","transcript-watcher.cjs");if(!zr(e)){it("transcript",["watch"]);return}let r=Xr(t,[e,"watch"],{stdio:"inherit",cwd:b(),env:process.env});r.on("error",o=>{console.error(x.default.red(`Failed to start transcript watcher: ${o.message}`)),process.exit(1)}),r.on("close",o=>{process.exit(o??0)})}var x,se=m(()=>{"use strict";x=ie(de(),1);fs();ae()});var F=ie(de(),1);ae();var be=process.argv.slice(2),hs=be[0]?.toLowerCase()??"";function fc(){let t=Te();console.log(`
|
|
370
364
|
${F.default.bold("claude-mem")} v${t} \u2014 persistent memory for AI coding assistants
|
|
371
365
|
|
|
372
366
|
${F.default.bold("Install Commands")} (no Bun required):
|
|
@@ -390,4 +384,4 @@ ${F.default.bold("IDE Identifiers")}:
|
|
|
390
384
|
claude-code, cursor, gemini-cli, opencode, openclaw,
|
|
391
385
|
windsurf, codex-cli, copilot-cli, antigravity, goose,
|
|
392
386
|
crush, roo-code, warp
|
|
393
|
-
`)}async function
|
|
387
|
+
`)}async function Cc(){switch(hs){case"":{let{runInstallCommand:t}=await Promise.resolve().then(()=>(Ht(),Wt));await t();break}case"install":{let t=be.indexOf("--ide"),e=t!==-1?be[t+1]:void 0,{runInstallCommand:r}=await Promise.resolve().then(()=>(Ht(),Wt));await r({ide:e});break}case"update":case"upgrade":{let{runInstallCommand:t}=await Promise.resolve().then(()=>(Ht(),Wt));await t();break}case"uninstall":case"remove":{let{runUninstallCommand:t}=await Promise.resolve().then(()=>(ms(),ps));await t();break}case"version":case"--version":case"-v":{console.log(Te());break}case"help":case"--help":case"-h":{fc();break}case"start":{let{runStartCommand:t}=await Promise.resolve().then(()=>(se(),oe));t();break}case"stop":{let{runStopCommand:t}=await Promise.resolve().then(()=>(se(),oe));t();break}case"restart":{let{runRestartCommand:t}=await Promise.resolve().then(()=>(se(),oe));t();break}case"status":{let{runStatusCommand:t}=await Promise.resolve().then(()=>(se(),oe));t();break}case"search":{let{runSearchCommand:t}=await Promise.resolve().then(()=>(se(),oe));await t(be.slice(1));break}case"adopt":{let{runAdoptCommand:t}=await Promise.resolve().then(()=>(se(),oe));t(be.slice(1));break}case"transcript":{let t=be[1]?.toLowerCase();if(t==="watch"){let{runTranscriptWatchCommand:e}=await Promise.resolve().then(()=>(se(),oe));e()}else console.error(F.default.red(`Unknown transcript subcommand: ${t??"(none)"}`)),console.error("Usage: npx claude-mem transcript watch"),process.exit(1);break}default:console.error(F.default.red(`Unknown command: ${hs}`)),console.error(`Run ${F.default.bold("npx claude-mem --help")} for usage information.`),process.exit(1)}}Cc().catch(t=>{console.error(F.default.red("Fatal error:"),t.message||t),process.exit(1)});
|