claude-mem 12.1.6 → 12.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/npx-cli/index.js +136 -135
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/scripts/context-generator.cjs +52 -48
- package/plugin/scripts/mcp-server.cjs +21 -21
- package/plugin/scripts/worker-service.cjs +240 -209
- package/plugin/ui/viewer-bundle.js +3 -3
- package/plugin/ui/viewer.html +13 -0
- package/plugin/.claude-plugin/CLAUDE.md +0 -21
- package/plugin/CLAUDE.md +0 -9
- package/plugin/hooks/CLAUDE.md +0 -35
- package/plugin/scripts/CLAUDE.md +0 -125
- package/plugin/ui/CLAUDE.md +0 -60
package/dist/npx-cli/index.js
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`,"utf-8")}var X,
|
|
2
|
+
var zr=Object.create;var Ht=Object.defineProperty;var Zr=Object.getOwnPropertyDescriptor;var Qr=Object.getOwnPropertyNames;var es=Object.getPrototypeOf,ts=Object.prototype.hasOwnProperty;var ns=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var C=(t,e)=>()=>(t&&(e=t(t=0)),e);var Jn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K=(t,e)=>{for(var o in e)Ht(t,o,{get:e[o],enumerable:!0})},os=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qr(e))!ts.call(t,s)&&s!==o&&Ht(t,s,{get:()=>e[s],enumerable:!(r=Zr(e,s))||r.enumerable});return t};var ue=(t,e,o)=>(o=t!=null?zr(es(t)):{},os(e||!t||!t.__esModule?Ht(o,"default",{value:t,enumerable:!0}):o,t));var pe=Jn((ua,Jt)=>{var it=process||{},Kn=it.argv||[],st=it.env||{},rs=!(st.NO_COLOR||Kn.includes("--no-color"))&&(!!st.FORCE_COLOR||Kn.includes("--color")||it.platform==="win32"||(it.stdout||{}).isTTY&&st.TERM!=="dumb"||!!st.CI),ss=(t,e,o=t)=>r=>{let s=""+r,i=s.indexOf(e,t.length);return~i?t+is(s,e,o,i)+e:t+s+e},is=(t,e,o,r)=>{let s="",i=0;do s+=t.substring(i,r)+o,i=r+e.length,r=t.indexOf(e,i);while(~r);return s+t.substring(i)},Vn=(t=rs)=>{let e=t?ss:()=>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")}};Jt.exports=Vn();Jt.exports.createColors=Vn});import{existsSync as us,readFileSync as as}from"fs";function N(t,e){if(!us(t))return e;try{return JSON.parse(as(t,"utf-8"))}catch{throw new Error(`Corrupt JSON file, refusing to overwrite: ${t}`)}}var ke=C(()=>{"use strict"});import{existsSync as Ie,mkdirSync as cs,readFileSync as Yn,writeFileSync as ls}from"fs";import{homedir as Ds}from"os";import{dirname as Xn,join as k}from"path";import{fileURLToPath as ds}from"url";function Kt(){return process.env.CLAUDE_CONFIG_DIR||k(Ds(),".claude")}function b(){return k(Kt(),"plugins","marketplaces","thedotmack")}function ae(){return k(Kt(),"plugins")}function ge(){return k(ae(),"known_marketplaces.json")}function Ce(){return k(ae(),"installed_plugins.json")}function fe(){return k(Kt(),"settings.json")}function Vt(t){return k(ae(),"cache","thedotmack","claude-mem",t)}function ut(){let t=ds(import.meta.url),e=k(Xn(t),"..","..");if(!Ie(k(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 Yt(){return k(ut(),"plugin")}function Oe(){let t=k(Yt(),".claude-plugin","plugin.json");if(Ie(t))try{let o=JSON.parse(Yn(t,"utf-8"));if(o.version)return o.version}catch{}let e=k(ut(),"package.json");if(Ie(e))try{let o=JSON.parse(Yn(e,"utf-8"));if(o.version)return o.version}catch{}return"0.0.0"}function at(){let t=b();return Ie(k(t,"plugin",".claude-plugin","plugin.json"))}function Te(t){Ie(t)||cs(t,{recursive:!0})}function Z(t,e){Te(Xn(t)),ls(t,JSON.stringify(e,null,2)+`
|
|
3
|
+
`,"utf-8")}var X,ce=C(()=>{"use strict";ke();X=process.platform==="win32"});var qt=Jn((Ca,qn)=>{"use strict";var Xt={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let o="";return t<0?o+=`\x1B[${-t}D`:t>0&&(o+=`\x1B[${t}C`),e<0?o+=`\x1B[${-e}A`:e>0&&(o+=`\x1B[${e}B`),o},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"},ms={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},ps={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 o=0;o<t;o++)e+=this.line+(o<t-1?Xt.up():"");return t&&(e+=Xt.left),e}};qn.exports={cursor:Xt,scroll:ms,erase:ps,beep:"\x07"}});import{stdin as so,stdout as io}from"node:process";import*as Q from"node:readline";import zn from"node:readline";import{WriteStream as gs}from"node:tty";function Cs({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 uo(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(fs,"")}function ao(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Be(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=uo(t),t.length===0))return 0;t=t.replace(ys()," ");let o=e.ambiguousIsNarrow?1:2,r=0;for(let s of t){let i=s.codePointAt(0);if(!(i<=31||i>=127&&i<=159||i>=768&&i<=879))switch(Es.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=o;break;default:r+=1}}return r}function _s(){let t=new Map;for(let[e,o]of Object.entries(f)){for(let[r,s]of Object.entries(o))f[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},o[r]=f[r],t.set(s[0],s[1]);Object.defineProperty(f,e,{value:o,enumerable:!1})}return Object.defineProperty(f,"codes",{value:t,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",f.color.ansi=Zn(),f.color.ansi256=Qn(),f.color.ansi16m=eo(),f.bgColor.ansi=Zn(zt),f.bgColor.ansi256=Qn(zt),f.bgColor.ansi16m=eo(zt),Object.defineProperties(f,{rgbToAnsi256:{value:(e,o,r)=>e===o&&o===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(o/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:e=>{let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!o)return[0,0,0];let[r]=o;r.length===3&&(r=[...r].map(i=>i+i).join(""));let s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>f.rgbToAnsi256(...f.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let o,r,s;if(e>=232)o=((e-232)*10+8)/255,r=o,s=o;else{e-=16;let u=e%36;o=Math.floor(e/36)/5,r=Math.floor(u/6)/5,s=u%6/5}let i=Math.max(o,r,s)*2;if(i===0)return 30;let n=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(o));return i===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(e,o,r)=>f.ansi256ToAnsi(f.rgbToAnsi256(e,o,r)),enumerable:!1},hexToAnsi:{value:e=>f.ansi256ToAnsi(f.hexToAnsi256(e)),enumerable:!1}}),f}function oo(t,e,o){return String(t).normalize().replace(/\r\n/g,`
|
|
4
4
|
`).split(`
|
|
5
|
-
`).map(r
|
|
6
|
-
`)}function
|
|
5
|
+
`).map(r=>Ms(r,e,o)).join(`
|
|
6
|
+
`)}function nn(t,e){if(typeof t=="string")return lt.aliases.get(t)===e;for(let o of t)if(o!==void 0&&nn(o,e))return!0;return!1}function Is(t,e){if(t===e)return;let o=t.split(`
|
|
7
7
|
`),r=e.split(`
|
|
8
|
-
`),s=[];for(let i=0;i<Math.max(o.length,r.length);i++)o[i]!==r[i]&&s.push(i);return s}function ee(t){return t===Zt}function ct(t,e){let o=t;o.isTTY&&o.setRawMode(e)}function co({input:t=no,output:e=oo,overwrite:o=!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=(n,{name:u,sequence:c})=>{let D=String(n);if(tn([D,u,c],"cancel")){r&&e.write(S.cursor.show),process.exit(0);return}if(!o)return;Q.moveCursor(e,u==="return"?0:-1,u==="return"?-1:0,()=>{Q.clearLine(e,1,()=>{t.once("keypress",i)})})};return r&&e.write(S.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),r&&e.write(S.cursor.show),t.isTTY&&!Is&&t.setRawMode(!1),s.terminal=!1,s.close()}}var S,Cs,io,fs,hs,Es,Fs,qt,Xn,qn,zn,f,ys,xs,_s,mt,Ss,Qt,uo,As,ao,en,Zn,Qn,ws,zt,bs,$s,Ms,lt,Is,Zt,Os,Ts,I,Dt,dt,Bs,Rs,to,lo,nn=C(()=>{S=se(Xt(),1);Cs=gs();io={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,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(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function o(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var s=o(r),i=0,n=0;n<s.length;n++)i=i+this.characterLength(s[n]);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 n="",u=0,c=o(r),D=0;D<c.length;D++){var d=c[D],l=e.length(d);if(u>=s-(l==2?1:0))if(u+l<=i)n+=d;else break;u+=l}return n}})(io);fs=io.exports,hs=so(fs),Es=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},Fs=so(Es);qt=10,Xn=(t=0)=>e=>`\x1B[${e+t}m`,qn=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,zn=(t=0)=>(e,o,r)=>`\x1B[${38+t};2;${e};${o};${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);ys=Object.keys(f.color),xs=Object.keys(f.bgColor);[...ys,...xs];_s=vs(),mt=new Set(["\x1B","\x9B"]),Ss=39,Qt="\x07",uo="[",As="]",ao="m",en=`${As}8;;`,Zn=t=>`${mt.values().next().value}${uo}${t}${ao}`,Qn=t=>`${mt.values().next().value}${en}${t}${Qt}`,ws=t=>t.split(" ").map(e=>Te(e)),zt=(t,e,o)=>{let r=[...e],s=!1,i=!1,n=Te(ro(t[t.length-1]));for(let[u,c]of r.entries()){let D=Te(c);if(n+D<=o?t[t.length-1]+=c:(t.push(c),n=0),mt.has(c)&&(s=!0,i=r.slice(u+1).join("").startsWith(en)),s){i?c===Qt&&(s=!1,i=!1):c===ao&&(s=!1);continue}n+=D,n===o&&u<r.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},bs=t=>{let e=t.split(" "),o=e.length;for(;o>0&&!(Te(e[o-1])>0);)o--;return o===e.length?t:e.slice(0,o).join(" ")+e.slice(o).join("")},$s=(t,e,o={})=>{if(o.trim!==!1&&t.trim()==="")return"";let r="",s,i,n=ws(t),u=[""];for(let[D,d]of t.split(" ").entries()){o.trim!==!1&&(u[u.length-1]=u[u.length-1].trimStart());let l=Te(u[u.length-1]);if(D!==0&&(l>=e&&(o.wordWrap===!1||o.trim===!1)&&(u.push(""),l=0),(l>0||o.trim===!1)&&(u[u.length-1]+=" ",l++)),o.hard&&n[D]>e){let x=e-l,_=1+Math.floor((n[D]-x-1)/e);Math.floor((n[D]-1)/e)<_&&u.push(""),zt(u,d,e);continue}if(l+n[D]>e&&l>0&&n[D]>0){if(o.wordWrap===!1&&l<e){zt(u,d,e);continue}u.push("")}if(l+n[D]>e&&o.wordWrap===!1){zt(u,d,e);continue}u[u.length-1]+=d}o.trim!==!1&&(u=u.map(D=>bs(D)));let c=[...u.join(`
|
|
9
|
-
`)];for(let[D,d]of c.entries()){if(r+=d,mt.has(d)){let{groups:x}=new RegExp(`(?:\\${
|
|
10
|
-
`?(i&&(r+=
|
|
11
|
-
`&&(s&&l&&(r+=
|
|
12
|
-
`),ct(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=
|
|
13
|
-
`).length-1;this.output.write(S.cursor.move(-999,e*-1))}render(){let e=
|
|
8
|
+
`),s=[];for(let i=0;i<Math.max(o.length,r.length);i++)o[i]!==r[i]&&s.push(i);return s}function ee(t){return t===Qt}function ct(t,e){let o=t;o.isTTY&&o.setRawMode(e)}function mo({input:t=so,output:e=io,overwrite:o=!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=(n,{name:u,sequence:c})=>{let D=String(n);if(nn([D,u,c],"cancel")){r&&e.write(S.cursor.show),process.exit(0);return}if(!o)return;Q.moveCursor(e,u==="return"?0:-1,u==="return"?-1:0,()=>{Q.clearLine(e,1,()=>{t.once("keypress",i)})})};return r&&e.write(S.cursor.hide),t.once("keypress",i),()=>{t.off("keypress",i),r&&e.write(S.cursor.show),t.isTTY&&!Os&&t.setRawMode(!1),s.terminal=!1,s.close()}}var S,fs,co,hs,Es,Fs,ys,zt,Zn,Qn,eo,f,xs,vs,Ss,mt,As,en,lo,ws,Do,tn,to,no,bs,Zt,$s,Ms,ks,lt,Os,Qt,Ts,Bs,I,Dt,dt,Rs,Ps,ro,po,on=C(()=>{S=ue(qt(),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,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(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function o(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var s=o(r),i=0,n=0;n<s.length;n++)i=i+this.characterLength(s[n]);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 n="",u=0,c=o(r),D=0;D<c.length;D++){var d=c[D],l=e.length(d);if(u>=s-(l==2?1:0))if(u+l<=i)n+=d;else break;u+=l}return n}})(co);hs=co.exports,Es=ao(hs),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);zt=10,Zn=(t=0)=>e=>`\x1B[${e+t}m`,Qn=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,eo=(t=0)=>(e,o,r)=>`\x1B[${38+t};2;${e};${o};${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),vs=Object.keys(f.bgColor);[...xs,...vs];Ss=_s(),mt=new Set(["\x1B","\x9B"]),As=39,en="\x07",lo="[",ws="]",Do="m",tn=`${ws}8;;`,to=t=>`${mt.values().next().value}${lo}${t}${Do}`,no=t=>`${mt.values().next().value}${tn}${t}${en}`,bs=t=>t.split(" ").map(e=>Be(e)),Zt=(t,e,o)=>{let r=[...e],s=!1,i=!1,n=Be(uo(t[t.length-1]));for(let[u,c]of r.entries()){let D=Be(c);if(n+D<=o?t[t.length-1]+=c:(t.push(c),n=0),mt.has(c)&&(s=!0,i=r.slice(u+1).join("").startsWith(tn)),s){i?c===en&&(s=!1,i=!1):c===Do&&(s=!1);continue}n+=D,n===o&&u<r.length-1&&(t.push(""),n=0)}!n&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},$s=t=>{let e=t.split(" "),o=e.length;for(;o>0&&!(Be(e[o-1])>0);)o--;return o===e.length?t:e.slice(0,o).join(" ")+e.slice(o).join("")},Ms=(t,e,o={})=>{if(o.trim!==!1&&t.trim()==="")return"";let r="",s,i,n=bs(t),u=[""];for(let[D,d]of t.split(" ").entries()){o.trim!==!1&&(u[u.length-1]=u[u.length-1].trimStart());let l=Be(u[u.length-1]);if(D!==0&&(l>=e&&(o.wordWrap===!1||o.trim===!1)&&(u.push(""),l=0),(l>0||o.trim===!1)&&(u[u.length-1]+=" ",l++)),o.hard&&n[D]>e){let x=e-l,_=1+Math.floor((n[D]-x-1)/e);Math.floor((n[D]-1)/e)<_&&u.push(""),Zt(u,d,e);continue}if(l+n[D]>e&&l>0&&n[D]>0){if(o.wordWrap===!1&&l<e){Zt(u,d,e);continue}u.push("")}if(l+n[D]>e&&o.wordWrap===!1){Zt(u,d,e);continue}u[u.length-1]+=d}o.trim!==!1&&(u=u.map(D=>$s(D)));let c=[...u.join(`
|
|
9
|
+
`)];for(let[D,d]of c.entries()){if(r+=d,mt.has(d)){let{groups:x}=new RegExp(`(?:\\${lo}(?<code>\\d+)m|\\${tn}(?<uri>.*)${en})`).exec(c.slice(D).join(""))||{groups:{}};if(x.code!==void 0){let _=Number.parseFloat(x.code);s=_===As?void 0:_}else x.uri!==void 0&&(i=x.uri.length===0?void 0:x.uri)}let l=Ss.codes.get(Number(s));c[D+1]===`
|
|
10
|
+
`?(i&&(r+=no("")),s&&l&&(r+=to(l))):d===`
|
|
11
|
+
`&&(s&&l&&(r+=to(s)),i&&(r+=no(i)))}return r};ks=["up","down","left","right","space","enter","cancel"],lt={actions:new Set(ks),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};Os=globalThis.process.platform.startsWith("win"),Qt=Symbol("clack:cancel");Ts=Object.defineProperty,Bs=(t,e,o)=>e in t?Ts(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,I=(t,e,o)=>(Bs(t,typeof e!="symbol"?e+"":e,o),o),Dt=class{constructor(e,o=!0){I(this,"input"),I(this,"output"),I(this,"_abortSignal"),I(this,"rl"),I(this,"opts"),I(this,"_render"),I(this,"_track",!1),I(this,"_prevFrame",""),I(this,"_subscribers",new Map),I(this,"_cursor",0),I(this,"state","initial"),I(this,"error",""),I(this,"value");let{input:r=so,output:s=io,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=o,this._abortSignal=n,this.input=r,this.output=s}unsubscribe(){this._subscribers.clear()}setSubscriber(e,o){let r=this._subscribers.get(e)??[];r.push(o),this._subscribers.set(e,r)}on(e,o){this.setSubscriber(e,{cb:o})}once(e,o){this.setSubscriber(e,{cb:o,once:!0})}emit(e,...o){let r=this._subscribers.get(e)??[],s=[];for(let i of r)i.cb(...o),i.once&&s.push(()=>r.splice(r.indexOf(i),1));for(let i of s)i()}prompt(){return new Promise((e,o)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(Qt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let r=new gs(0);r._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(r),this.rl=zn.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),zn.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),ct(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),ct(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(S.cursor.show),this.output.off("resize",this.render),ct(this.input,!1),e(Qt)})})}onKeypress(e,o){if(this.state==="error"&&(this.state="active"),o?.name&&(!this._track&<.aliases.has(o.name)&&this.emit("cursor",lt.aliases.get(o.name)),lt.actions.has(o.name)&&this.emit("cursor",o.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()),o?.name==="return"){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}nn([e,o?.name,o?.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
|
+
`),ct(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=oo(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
13
|
+
`).length-1;this.output.write(S.cursor.move(-999,e*-1))}render(){let e=oo(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(S.cursor.hide);else{let o=Is(this._prevFrame,e);if(this.restoreCursor(),o&&o?.length===1){let r=o[0];this.output.write(S.cursor.move(0,r)),this.output.write(S.erase.lines(1));let s=e.split(`
|
|
14
14
|
`);this.output.write(s[r]),this._prevFrame=e,this.output.write(S.cursor.move(0,s.length-r-1));return}if(o&&o?.length>1){let r=o[0];this.output.write(S.cursor.move(0,r)),this.output.write(S.erase.down());let s=e.split(`
|
|
15
15
|
`).slice(r);this.output.write(s.join(`
|
|
16
|
-
`)),this._prevFrame=e;return}this.output.write(S.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},dt=class extends Dt{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",o=>{this.output.write(S.cursor.move(0,-1)),this.value=o,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},
|
|
17
|
-
${
|
|
18
|
-
`,s=this.value?e:o;switch(this.state){case"submit":return`${r}${a.default.gray(
|
|
19
|
-
${a.default.gray(
|
|
20
|
-
${a.default.cyan(
|
|
21
|
-
`}}}).prompt()},
|
|
22
|
-
${a.default.reset(a.default.dim(`Press ${a.default.gray(a.default.bgWhite(a.default.inverse(" space ")))} to select, ${a.default.gray(a.default.bgWhite(a.default.inverse(" enter ")))} to submit`))}`},render(){let o=`${a.default.gray(
|
|
23
|
-
${
|
|
24
|
-
`,r=(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`${o}${a.default.gray(
|
|
25
|
-
${a.default.gray(
|
|
26
|
-
`).map((i,n)=>n===0?`${a.default.yellow(
|
|
27
|
-
`);return`${o+a.default.yellow(
|
|
28
|
-
${a.default.yellow(
|
|
16
|
+
`)),this._prevFrame=e;return}this.output.write(S.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}},dt=class extends Dt{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",o=>{this.output.write(S.cursor.move(0,-1)),this.value=o,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},Rs=Object.defineProperty,Ps=(t,e,o)=>e in t?Rs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,ro=(t,e,o)=>(Ps(t,typeof e!="symbol"?e+"":e,o),o),po=class extends Dt{constructor(t){super(t,!1),ro(this,"options"),ro(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 rn}from"node:util";import U from"node:process";function Ls(){return U.platform!=="win32"?U.env.TERM!=="linux":!!U.env.CI||!!U.env.WT_SESSION||!!U.env.TERMINUS_SUBLIME||U.env.ConEmuTask==="{cmd::Cmder}"||U.env.TERM_PROGRAM==="Terminus-Sublime"||U.env.TERM_PROGRAM==="vscode"||U.env.TERM==="xterm-256color"||U.env.TERM==="alacritty"||U.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var a,pt,sn,y,js,Fo,yo,gt,Ns,F,Re,go,Co,Us,fo,Gs,ka,ho,Ws,Hs,Js,Ks,Vs,Ys,Xs,xo,Eo,Pe,vo,Le,je,Ct,le,$,qs,ft,un=C(()=>{on();on();a=ue(pe(),1),pt=ue(qt(),1);sn=Ls(),y=(t,e)=>sn?t:e,js=y("\u25C6","*"),Fo=y("\u25A0","x"),yo=y("\u25B2","x"),gt=y("\u25C7","o"),Ns=y("\u250C","T"),F=y("\u2502","|"),Re=y("\u2514","\u2014"),go=y("\u25CF",">"),Co=y("\u25CB"," "),Us=y("\u25FB","[\u2022]"),fo=y("\u25FC","[+]"),Gs=y("\u25FB","[ ]"),ka=y("\u25AA","\u2022"),ho=y("\u2500","-"),Ws=y("\u256E","+"),Hs=y("\u251C","+"),Js=y("\u256F","+"),Ks=y("\u25CF","\u2022"),Vs=y("\u25C6","*"),Ys=y("\u25B2","!"),Xs=y("\u25A0","x"),xo=t=>{switch(t){case"initial":case"active":return a.default.cyan(js);case"cancel":return a.default.red(Fo);case"error":return a.default.yellow(yo);case"submit":return a.default.green(gt)}},Eo=t=>{let{cursor:e,options:o,style:r}=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,o.length-n),0):e<u+2&&(u=Math.max(e-2,0));let c=n<o.length&&u>0,D=n<o.length&&u+n<o.length;return o.slice(u,u+n).map((d,l,x)=>{let _=l===0&&c,me=l===x.length-1&&D;return _||me?a.default.dim("..."):r(d,l+u===e)})},Pe=t=>{let e=t.active??"Yes",o=t.inactive??"No";return new dt({active:e,inactive:o,initialValue:t.initialValue??!0,render(){let r=`${a.default.gray(F)}
|
|
17
|
+
${xo(this.state)} ${t.message}
|
|
18
|
+
`,s=this.value?e:o;switch(this.state){case"submit":return`${r}${a.default.gray(F)} ${a.default.dim(s)}`;case"cancel":return`${r}${a.default.gray(F)} ${a.default.strikethrough(a.default.dim(s))}
|
|
19
|
+
${a.default.gray(F)}`;default:return`${r}${a.default.cyan(F)} ${this.value?`${a.default.green(go)} ${e}`:`${a.default.dim(Co)} ${a.default.dim(e)}`} ${a.default.dim("/")} ${this.value?`${a.default.dim(Co)} ${a.default.dim(o)}`:`${a.default.green(go)} ${o}`}
|
|
20
|
+
${a.default.cyan(Re)}
|
|
21
|
+
`}}}).prompt()},vo=t=>{let e=(o,r)=>{let s=o.label??String(o.value);return r==="active"?`${a.default.cyan(Us)} ${s} ${o.hint?a.default.dim(`(${o.hint})`):""}`:r==="selected"?`${a.default.green(fo)} ${a.default.dim(s)}`:r==="cancelled"?`${a.default.strikethrough(a.default.dim(s))}`:r==="active-selected"?`${a.default.green(fo)} ${s} ${o.hint?a.default.dim(`(${o.hint})`):""}`:r==="submitted"?`${a.default.dim(s)}`:`${a.default.dim(Gs)} ${a.default.dim(s)}`};return new po({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(o){if(this.required&&o.length===0)return`Please select at least one option.
|
|
22
|
+
${a.default.reset(a.default.dim(`Press ${a.default.gray(a.default.bgWhite(a.default.inverse(" space ")))} to select, ${a.default.gray(a.default.bgWhite(a.default.inverse(" enter ")))} to submit`))}`},render(){let o=`${a.default.gray(F)}
|
|
23
|
+
${xo(this.state)} ${t.message}
|
|
24
|
+
`,r=(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`${o}${a.default.gray(F)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>e(s,"submitted")).join(a.default.dim(", "))||a.default.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>e(i,"cancelled")).join(a.default.dim(", "));return`${o}${a.default.gray(F)} ${s.trim()?`${s}
|
|
25
|
+
${a.default.gray(F)}`:""}`}case"error":{let s=this.error.split(`
|
|
26
|
+
`).map((i,n)=>n===0?`${a.default.yellow(Re)} ${a.default.yellow(i)}`:` ${i}`).join(`
|
|
27
|
+
`);return`${o+a.default.yellow(F)} ${Eo({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
28
|
+
${a.default.yellow(F)} `)}
|
|
29
29
|
${s}
|
|
30
|
-
`}default:return`${o}${a.default.cyan(
|
|
31
|
-
${a.default.cyan(
|
|
32
|
-
${a.default.cyan(
|
|
33
|
-
`}}}).prompt()},
|
|
30
|
+
`}default:return`${o}${a.default.cyan(F)} ${Eo({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
|
|
31
|
+
${a.default.cyan(F)} `)}
|
|
32
|
+
${a.default.cyan(Re)}
|
|
33
|
+
`}}}).prompt()},Le=(t="",e="")=>{let o=`
|
|
34
34
|
${t}
|
|
35
35
|
`.split(`
|
|
36
|
-
`),r=
|
|
37
|
-
`);process.stdout.write(`${a.default.gray(
|
|
38
|
-
${a.default.green(gt)} ${a.default.reset(e)} ${a.default.gray(
|
|
36
|
+
`),r=rn(e).length,s=Math.max(o.reduce((n,u)=>{let c=rn(u);return c.length>n?c.length:n},0),r)+2,i=o.map(n=>`${a.default.gray(F)} ${a.default.dim(n)}${" ".repeat(s-rn(n).length)}${a.default.gray(F)}`).join(`
|
|
37
|
+
`);process.stdout.write(`${a.default.gray(F)}
|
|
38
|
+
${a.default.green(gt)} ${a.default.reset(e)} ${a.default.gray(ho.repeat(Math.max(s-r-1,1))+Ws)}
|
|
39
39
|
${i}
|
|
40
|
-
${a.default.gray(
|
|
41
|
-
`)},
|
|
40
|
+
${a.default.gray(Hs+ho.repeat(s+2)+Js)}
|
|
41
|
+
`)},je=(t="")=>{process.stdout.write(`${a.default.gray(Re)} ${a.default.red(t)}
|
|
42
42
|
|
|
43
|
-
`)},Ct=(t="")=>{process.stdout.write(`${a.default.gray(
|
|
44
|
-
`)},
|
|
45
|
-
${a.default.gray(
|
|
43
|
+
`)},Ct=(t="")=>{process.stdout.write(`${a.default.gray(Ns)} ${t}
|
|
44
|
+
`)},le=(t="")=>{process.stdout.write(`${a.default.gray(F)}
|
|
45
|
+
${a.default.gray(Re)} ${t}
|
|
46
46
|
|
|
47
|
-
`)}
|
|
48
|
-
`);o.push(`${e} ${r}`,...s.map(i=>`${a.default.gray(
|
|
47
|
+
`)},$={message:(t="",{symbol:e=a.default.gray(F)}={})=>{let o=[`${a.default.gray(F)}`];if(t){let[r,...s]=t.split(`
|
|
48
|
+
`);o.push(`${e} ${r}`,...s.map(i=>`${a.default.gray(F)} ${i}`))}process.stdout.write(`${o.join(`
|
|
49
49
|
`)}
|
|
50
|
-
`)},info:t=>{
|
|
51
|
-
`);let
|
|
52
|
-
`);process.stdout.write(pt.cursor.move(-999,
|
|
53
|
-
`);let j=0,z=0;l(),s=setInterval(()=>{if(o&&n===u)return;_(),u=n;let
|
|
54
|
-
`),x(),r()};return{start:
|
|
55
|
-
${e.stack}`:e.message;if(Array.isArray(e))return`[${e.length} items]`;let o=Object.keys(e);return o.length===0?"{}":o.length<=3?JSON.stringify(e):`{${o.length} keys: ${o.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,o){if(!o)return e;let r=o;if(typeof o=="string")try{r=JSON.parse(o)}catch{r=o}if(e==="Bash"&&r.command)return`${e}(${r.command})`;if(r.file_path)return`${e}(${r.file_path})`;if(r.notebook_path)return`${e}(${r.notebook_path})`;if(e==="Glob"&&r.pattern)return`${e}(${r.pattern})`;if(e==="Grep"&&r.pattern)return`${e}(${r.pattern})`;if(r.url)return`${e}(${r.url})`;if(r.query)return`${e}(${r.query})`;if(e==="Task"){if(r.subagent_type)return`${e}(${r.subagent_type})`;if(r.description)return`${e}(${r.description})`}return e==="Skill"&&r.skill?`${e}(${r.skill})`:e==="LSP"&&r.operation?`${e}(${r.operation})`:e}formatTimestamp(e){let o=e.getFullYear(),r=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`${o}-${r}-${s} ${i}:${n}:${u}.${c}`}log(e,o,r,s,i){if(e<this.getLevel())return;this.ensureLogFileInitialized();let n=this.formatTimestamp(new Date),u=
|
|
50
|
+
`)},info:t=>{$.message(t,{symbol:a.default.blue(Ks)})},success:t=>{$.message(t,{symbol:a.default.green(Vs)})},step:t=>{$.message(t,{symbol:a.default.green(gt)})},warn:t=>{$.message(t,{symbol:a.default.yellow(Ys)})},warning:t=>{$.warn(t)},error:t=>{$.message(t,{symbol:a.default.red(Xs)})}},qs=()=>{let t=sn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=sn?80:120,o=process.env.CI==="true",r,s,i=!1,n="",u,c=M=>{let j=M>1?"Something went wrong":"Canceled";i&&Me(j,M)},D=()=>c(2),d=()=>c(1),l=()=>{process.on("uncaughtExceptionMonitor",D),process.on("unhandledRejection",D),process.on("SIGINT",d),process.on("SIGTERM",d),process.on("exit",c)},x=()=>{process.removeListener("uncaughtExceptionMonitor",D),process.removeListener("unhandledRejection",D),process.removeListener("SIGINT",d),process.removeListener("SIGTERM",d),process.removeListener("exit",c)},_=()=>{if(u===void 0)return;o&&process.stdout.write(`
|
|
51
|
+
`);let M=u.split(`
|
|
52
|
+
`);process.stdout.write(pt.cursor.move(-999,M.length-1)),process.stdout.write(pt.erase.down(M.length))},me=M=>M.replace(/\.+$/,""),Hn=(M="")=>{i=!0,r=mo(),n=me(M),process.stdout.write(`${a.default.gray(F)}
|
|
53
|
+
`);let j=0,z=0;l(),s=setInterval(()=>{if(o&&n===u)return;_(),u=n;let Xr=a.default.magenta(t[j]),qr=o?"...":".".repeat(Math.floor(z)).slice(0,3);process.stdout.write(`${Xr} ${n}${qr}`),j=j+1<t.length?j+1:0,z=z<t.length?z+.125:0},e)},Me=(M="",j=0)=>{i=!1,clearInterval(s),_();let z=j===0?a.default.green(gt):j===1?a.default.red(Fo):a.default.red(yo);n=me(M??n),process.stdout.write(`${z} ${n}
|
|
54
|
+
`),x(),r()};return{start:Hn,stop:Me,message:(M="")=>{n=me(M??n)}}},ft=async t=>{for(let e of t){if(e.enabled===!1)continue;let o=qs();o.start(e.title);let r=await e.task(o.message);o.stop(r||e.title)}}});import{execSync as zs}from"child_process";import{existsSync as G,readdirSync as Zs}from"fs";import{homedir as So}from"os";import{join as W}from"path";function Ne(t){try{return zs(`${X?"where":"which"} ${t}`,{stdio:"pipe"}),!0}catch{return!1}}function Qs(t){let e=W(So(),".vscode","extensions");if(!G(e))return!1;try{return Zs(e).some(r=>r.toLowerCase().includes(t.toLowerCase()))}catch{return!1}}function Ue(){let t=So();return[{id:"claude-code",label:"Claude Code",detected:G(W(t,".claude")),supported:!0,hint:"recommended"},{id:"gemini-cli",label:"Gemini CLI",detected:G(W(t,".gemini")),supported:!0},{id:"opencode",label:"OpenCode",detected:G(W(t,".config","opencode"))||Ne("opencode"),supported:!0,hint:"plugin-based integration"},{id:"openclaw",label:"OpenClaw",detected:G(W(t,".openclaw")),supported:!0,hint:"plugin-based integration"},{id:"windsurf",label:"Windsurf",detected:G(W(t,".codeium","windsurf")),supported:!0},{id:"codex-cli",label:"Codex CLI",detected:G(W(t,".codex")),supported:!0,hint:"transcript-based integration"},{id:"cursor",label:"Cursor",detected:G(W(t,".cursor")),supported:!0,hint:"hooks + MCP integration"},{id:"copilot-cli",label:"Copilot CLI",detected:Ne("copilot"),supported:!0,hint:"MCP-based integration"},{id:"antigravity",label:"Antigravity",detected:G(W(t,".gemini","antigravity")),supported:!0,hint:"MCP-based integration"},{id:"goose",label:"Goose",detected:G(W(t,".config","goose"))||Ne("goose"),supported:!0,hint:"MCP-based integration"},{id:"crush",label:"Crush",detected:Ne("crush"),supported:!0,hint:"MCP-based integration"},{id:"roo-code",label:"Roo Code",detected:Qs("roo-code"),supported:!0,hint:"MCP-based integration"},{id:"warp",label:"Warp",detected:G(W(t,".warp"))||Ne("warp"),supported:!0,hint:"MCP-based integration"}]}var Ao=C(()=>{"use strict";ce()});import{appendFileSync as ei,existsSync as wo,mkdirSync as ti,readFileSync as ni}from"fs";import{join as ht}from"path";import{homedir as oi}from"os";var an,bo,cn,m,q=C(()=>{"use strict";an=(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))(an||{}),bo=ht(oi(),".claude-mem"),cn=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=ht(bo,"logs");wo(e)||ti(e,{recursive:!0});let o=new Date().toISOString().split("T")[0];this.logFilePath=ht(e,`claude-mem-${o}.log`)}catch(e){console.error("[LOGGER] Failed to initialize log file:",e),this.logFilePath=null}}}getLevel(){if(this.level===null)try{let e=ht(bo,"settings.json");if(wo(e)){let o=ni(e,"utf-8"),s=(JSON.parse(o).CLAUDE_MEM_LOG_LEVEL||"INFO").toUpperCase();this.level=an[s]??1}else this.level=1}catch{this.level=1}return this.level}correlationId(e,o){return`obs-${e}-${o}`}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 o=Object.keys(e);return o.length===0?"{}":o.length<=3?JSON.stringify(e):`{${o.length} keys: ${o.slice(0,3).join(", ")}...}`}return String(e)}formatTool(e,o){if(!o)return e;let r=o;if(typeof o=="string")try{r=JSON.parse(o)}catch{r=o}if(e==="Bash"&&r.command)return`${e}(${r.command})`;if(r.file_path)return`${e}(${r.file_path})`;if(r.notebook_path)return`${e}(${r.notebook_path})`;if(e==="Glob"&&r.pattern)return`${e}(${r.pattern})`;if(e==="Grep"&&r.pattern)return`${e}(${r.pattern})`;if(r.url)return`${e}(${r.url})`;if(r.query)return`${e}(${r.query})`;if(e==="Task"){if(r.subagent_type)return`${e}(${r.subagent_type})`;if(r.description)return`${e}(${r.description})`}return e==="Skill"&&r.skill?`${e}(${r.skill})`:e==="LSP"&&r.operation?`${e}(${r.operation})`:e}formatTimestamp(e){let o=e.getFullYear(),r=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`${o}-${r}-${s} ${i}:${n}:${u}.${c}`}log(e,o,r,s,i){if(e<this.getLevel())return;this.ensureLogFileInitialized();let n=this.formatTimestamp(new Date),u=an[e].padEnd(5),c=o.padEnd(6),D="";s?.correlationId?D=`[${s.correlationId}] `:s?.sessionId&&(D=`[session-${s.sessionId}] `);let d="";i!=null&&(i instanceof Error?d=this.getLevel()===0?`
|
|
56
56
|
${i.message}
|
|
57
57
|
${i.stack}`:` ${i.message}`:this.getLevel()===0&&typeof i=="object"?d=`
|
|
58
|
-
`+JSON.stringify(i,null,2):d=" "+this.formatData(i));let l="";if(s){let{sessionId:_,memorySessionId:me,correlationId:
|
|
58
|
+
`+JSON.stringify(i,null,2):d=" "+this.formatData(i));let l="";if(s){let{sessionId:_,memorySessionId:me,correlationId:Hn,...Me}=s;Object.keys(Me).length>0&&(l=` {${Object.entries(Me).map(([j,z])=>`${j}=${z}`).join(", ")}}`)}let x=`[${n}] [${u}] [${c}] ${D}${r}${l}${d}`;if(this.logFilePath)try{ei(this.logFilePath,x+`
|
|
59
59
|
`,"utf8")}catch(_){process.stderr.write(`[LOGGER] Failed to write to log file: ${_}
|
|
60
60
|
`)}else process.stderr.write(x+`
|
|
61
61
|
`)}debug(e,o,r,s){this.log(0,e,o,r,s)}info(e,o,r,s){this.log(1,e,o,r,s)}warn(e,o,r,s){this.log(2,e,o,r,s)}error(e,o,r,s){this.log(3,e,o,r,s)}dataIn(e,o,r,s){this.info(e,`\u2192 ${o}`,r,s)}dataOut(e,o,r,s){this.info(e,`\u2190 ${o}`,r,s)}success(e,o,r,s){this.info(e,`\u2713 ${o}`,r,s)}failure(e,o,r,s){this.error(e,`\u2717 ${o}`,r,s)}timing(e,o,r,s){this.info(e,`\u23F1 ${o}`,s,{duration:`${r}ms`})}happyPathError(e,o,r,s,i=""){let D=((new Error().stack||"").split(`
|
|
62
|
-
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),d=D?`${D[1].split("/").pop()}:${D[2]}`:"unknown",l={...r,location:d};return this.warn(e,`[HAPPY-PATH] ${o}`,l,s),i}},m=new
|
|
62
|
+
`)[2]||"").match(/at\s+(?:.*\s+)?\(?([^:]+):(\d+):(\d+)\)?/),d=D?`${D[1].split("/").pop()}:${D[2]}`:"unknown",l={...r,location:d};return this.warn(e,`[HAPPY-PATH] ${o}`,l,s),i}},m=new cn});function $o(t){return process.platform==="win32"?Math.round(t*ln.WINDOWS_MULTIPLIER):t}var ln,Mo=C(()=>{"use strict";ln={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 ko,existsSync as Io,mkdirSync as si}from"fs";import{join as Oo,dirname as ii}from"path";import{homedir as To}from"os";var De,Bo=C(()=>{"use strict";De=class{static DEFAULTS={CLAUDE_MEM_MODEL:"claude-sonnet-4-6",CLAUDE_MEM_CONTEXT_OBSERVATIONS:"50",CLAUDE_MEM_WORKER_PORT:"37777",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(To(),".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(To(),".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"};static getAllDefaults(){return{...this.DEFAULTS}}static get(e){return process.env[e]??this.DEFAULTS[e]}static getInt(e){let o=this.get(e);return parseInt(o,10)}static getBool(e){let o=this.get(e);return o==="true"||o===!0}static applyEnvOverrides(e){let o={...e};for(let r of Object.keys(this.DEFAULTS))process.env[r]!==void 0&&(o[r]=process.env[r]);return o}static loadFromFile(e){try{if(!Io(e)){let n=this.getAllDefaults();try{let u=ii(e);Io(u)||si(u,{recursive:!0}),ko(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)}return this.applyEnvOverrides(n)}let o=ri(e,"utf-8"),r=JSON.parse(o),s=r;if(r.env&&typeof r.env=="object"){s=r.env;try{ko(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)}}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(o){return console.warn("[SETTINGS] Failed to load settings, using defaults:",e,o),this.applyEnvOverrides(this.getAllDefaults())}}}});import{join as A,dirname as ui,basename as ai}from"path";import{homedir as Ro}from"os";import{existsSync as ci,mkdirSync as Za}from"fs";import{execSync as ec}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=A(Ro(),".claude-mem"),e=A(t,"settings.json");try{if(ci(e)){let{readFileSync:o}=ns("fs"),r=JSON.parse(o(e,"utf-8")),s=r.env??r;if(s.CLAUDE_MEM_DATA_DIR)return s.CLAUDE_MEM_DATA_DIR}}catch{}return t}var oc,O,he,Et,rc,sc,ic,uc,ac,cc,lc,Dc,mi,dc,mc,pc,gc,Ft=C(()=>{"use strict";q();oc=Di();O=di(),he=process.env.CLAUDE_CONFIG_DIR||A(Ro(),".claude"),Et=A(he,"plugins","marketplaces","thedotmack"),rc=A(O,"archives"),sc=A(O,"logs"),ic=A(O,"trash"),uc=A(O,"backups"),ac=A(O,"modes"),cc=A(O,"settings.json"),lc=A(O,"claude-mem.db"),Dc=A(O,"vector-db"),mi=A(O,"observer-sessions"),dc=ai(mi),mc=A(he,"settings.json"),pc=A(he,"commands"),gc=A(he,"CLAUDE.md")});import Po from"path";import{readFileSync as Ec}from"fs";function gi(t,e={},o){return new Promise((r,s)=>{let i=setTimeout(()=>s(new Error(`Request timed out after ${o}ms`)),o);fetch(t,e).then(n=>{clearTimeout(i),r(n)},n=>{clearTimeout(i),s(n)})})}function Ge(){if(yt!==null)return yt;let t=Po.join(De.get("CLAUDE_MEM_DATA_DIR"),"settings.json"),e=De.loadFromFile(t);return yt=parseInt(e.CLAUDE_MEM_WORKER_PORT,10),yt}function Ci(){if(xt!==null)return xt;let t=Po.join(De.get("CLAUDE_MEM_DATA_DIR"),"settings.json");return xt=De.loadFromFile(t).CLAUDE_MEM_WORKER_HOST,xt}function fi(t){return`http://${Ci()}:${Ge()}${t}`}function vt(t,e={}){let o=e.method??"GET",r=e.timeoutMs??pi,s=fi(t),i={method:o};return e.headers&&(i.headers=e.headers),e.body&&(i.body=e.body),r>0?gi(s,i,r):fetch(s,i)}var pi,yt,xt,_t=C(()=>{"use strict";q();Mo();Bo();Ft();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;m.warn("SYSTEM","Invalid CLAUDE_MEM_HEALTH_TIMEOUT_MS, using default",{value:t,min:500,max:3e5})}return $o(ln.HEALTH_CHECK)})();yt=null,xt=null});import{existsSync as hi,readFileSync as Ei,writeFileSync as Lo,mkdirSync as jo,renameSync as Fi}from"fs";import{join as Dn,basename as wc}from"path";function No(t){try{return hi(t)?JSON.parse(Ei(t,"utf-8")):{}}catch(e){return m.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 o=Dn(t,"..");jo(o,{recursive:!0}),Lo(t,JSON.stringify(e,null,2))}function dn(t,e){let o=Dn(t,".cursor","rules"),r=Dn(o,"claude-mem-context.mdc"),s=`${r}.tmp`;jo(o,{recursive:!0});let i=`---
|
|
63
63
|
alwaysApply: true
|
|
64
64
|
description: "Claude-mem context from past sessions (auto-updated)"
|
|
65
65
|
---
|
|
@@ -72,9 +72,9 @@ ${e}
|
|
|
72
72
|
|
|
73
73
|
---
|
|
74
74
|
*Updated after last session. Use claude-mem's MCP search tools for more detailed queries.*
|
|
75
|
-
`;
|
|
75
|
+
`;Lo(s,i),Fi(s,r)}var Go=C(()=>{"use strict";q()});var zo={};K(zo,{checkCursorHooksStatus:()=>qo,configureCursorMcp:()=>Ai,detectClaudeCode:()=>bi,detectPlatform:()=>Jo,findBunPath:()=>Fe,findMcpServerPath:()=>We,findWorkerServicePath:()=>Ee,getScriptExtension:()=>_i,getTargetDir:()=>wt,handleCursorCommand:()=>$i,installCursorHooks:()=>Yo,readCursorRegistry:()=>At,registerCursorProject:()=>Ko,uninstallCursorHooks:()=>Xo,unregisterCursorProject:()=>Vo,updateCursorContextForProject:()=>Si,writeCursorRegistry:()=>Cn});import p from"path";import{homedir as St}from"os";import{existsSync as B,readFileSync as Wo,writeFileSync as pn,unlinkSync as mn,mkdirSync as gn}from"fs";import{exec as yi}from"child_process";import{promisify as xi}from"util";function Jo(){return process.platform==="win32"?"windows":"unix"}function _i(){return Jo()==="windows"?".ps1":".sh"}function At(){return No(Ho)}function Cn(t){Uo(Ho,t)}function Ko(t,e){let o=At();o[t]={workspacePath:e,installedAt:new Date().toISOString()},Cn(o),m.info("CURSOR","Registered project for auto-context updates",{projectName:t,workspacePath:e})}function Vo(t){let e=At();e[t]&&(delete e[t],Cn(e),m.info("CURSOR","Unregistered project",{projectName:t}))}async function Si(t,e){let r=At()[t];if(r)try{let s=await vt(`/api/context/inject?project=${encodeURIComponent(t)}`);if(!s.ok)return;let i=await s.text();if(!i||!i.trim())return;dn(r.workspacePath,i),m.debug("CURSOR","Updated context file",{projectName:t,workspacePath:r.workspacePath})}catch(s){m.error("CURSOR","Failed to update context file",{projectName:t},s)}}function We(){let t=[p.join(Et,"plugin","scripts","mcp-server.cjs"),p.join(process.cwd(),"plugin","scripts","mcp-server.cjs")];for(let e of t)if(B(e))return e;return null}function Ee(){let t=[p.join(Et,"plugin","scripts","worker-service.cjs"),p.join(process.cwd(),"plugin","scripts","worker-service.cjs")];for(let e of t)if(B(e))return e;return null}function Fe(){let t=[p.join(St(),".bun","bin","bun"),"/usr/local/bin/bun","/usr/bin/bun",...process.platform==="win32"?[p.join(St(),".bun","bin","bun.exe"),p.join(process.env.LOCALAPPDATA||"","bun","bun.exe")]:[]];for(let e of t)if(e&&B(e))return e;return"bun"}function wt(t){switch(t){case"project":return p.join(process.cwd(),".cursor");case"user":return p.join(St(),".cursor");case"enterprise":return process.platform==="darwin"?"/Library/Application Support/Cursor":process.platform==="linux"?"/etc/cursor":process.platform==="win32"?p.join(process.env.ProgramData||"C:\\ProgramData","Cursor"):null;default:return null}}function Ai(t){let e=We();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 o=wt(t);if(!o)return console.error(`Invalid target: ${t}. Use: project or user`),1;let r=p.join(o,"mcp.json");try{gn(o,{recursive:!0});let s={mcpServers:{}};if(B(r))try{s=JSON.parse(Wo(r,"utf-8")),s.mcpServers||(s.mcpServers={})}catch(i){m.error("SYSTEM","Corrupt mcp.json, creating new config",{path:r},i),s={mcpServers:{}}}return s.mcpServers["claude-mem"]={command:"node",args:[e]},pn(r,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 Yo(t){console.log(`
|
|
76
76
|
Installing Claude-Mem Cursor hooks (${t} level)...
|
|
77
|
-
`);let e=wt(t);if(!e)return console.error(`Invalid target: ${t}. Use: project, user, or enterprise`),1;let o=Ee();if(!o)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let r=process.cwd();try{
|
|
77
|
+
`);let e=wt(t);if(!e)return console.error(`Invalid target: ${t}. Use: project, user, or enterprise`),1;let o=Ee();if(!o)return console.error("Could not find worker-service.cjs"),console.error(" Expected at: ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/worker-service.cjs"),1;let r=process.cwd();try{gn(e,{recursive:!0});let s=p.join(e,"hooks.json"),i=Fe(),n=i.replace(/\\/g,"\\\\"),u=o.replace(/\\/g,"\\\\"),c=d=>`"${n}" "${u}" hook cursor ${d}`;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")}]}};return pn(s,JSON.stringify(D,null,2)),console.log(" Created hooks.json (unified CLI mode)"),console.log(` Worker service: ${o}`),t==="project"&&await wi(e,r),console.log(`
|
|
78
78
|
Installation complete!
|
|
79
79
|
|
|
80
80
|
Hooks installed to: ${e}/hooks.json
|
|
@@ -89,7 +89,7 @@ Context Injection:
|
|
|
89
89
|
Context from past sessions is stored in .cursor/rules/claude-mem-context.mdc
|
|
90
90
|
and automatically included in every chat. It updates after each session ends.
|
|
91
91
|
`),0}catch(s){return console.error(`
|
|
92
|
-
Installation failed: ${s.message}`),t==="enterprise"&&console.error(" Tip: Enterprise installation may require sudo/admin privileges"),1}}async function
|
|
92
|
+
Installation failed: ${s.message}`),t==="enterprise"&&console.error(" Tip: Enterprise installation may require sudo/admin privileges"),1}}async function wi(t,e){let o=p.join(t,"rules");gn(o,{recursive:!0});let r=p.basename(e),s=!1;console.log(" Generating initial context...");try{if((await vt("/api/readiness")).ok){let n=await vt(`/api/context/inject?project=${encodeURIComponent(r)}`);if(n.ok){let u=await n.text();u&&u.trim()&&(dn(e,u),s=!0,console.log(" Generated initial context from existing memory"))}}}catch(i){m.debug("CURSOR","Worker not running during install",{},i)}if(!s){let i=p.join(o,"claude-mem-context.mdc");pn(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)")}Ko(r,e),console.log(" Registered for auto-context updates")}function Xo(t){console.log(`
|
|
103
103
|
Uninstalling Claude-Mem Cursor hooks (${t} level)...
|
|
104
|
-
`);let e=wt(t);if(!e)return console.error(`Invalid target: ${t}`),1;try{let o=p.join(e,"hooks"),r=p.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];for(let u of n){let c=p.join(o,u);B(c)&&(
|
|
104
|
+
`);let e=wt(t);if(!e)return console.error(`Invalid target: ${t}`),1;try{let o=p.join(e,"hooks"),r=p.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];for(let u of n){let c=p.join(o,u);B(c)&&(mn(c),console.log(` Removed legacy script: ${u}`))}if(B(r)&&(mn(r),console.log(" Removed hooks.json")),t==="project"){let u=p.join(e,"rules","claude-mem-context.mdc");B(u)&&(mn(u),console.log(" Removed context file"));let c=p.basename(process.cwd());Vo(c),console.log(" Unregistered from auto-context updates")}return console.log(`
|
|
105
105
|
Uninstallation complete!
|
|
106
106
|
`),console.log("Restart Cursor to apply changes."),0}catch(o){return console.error(`
|
|
107
|
-
Uninstallation failed: ${o.message}`),1}}function
|
|
107
|
+
Uninstallation failed: ${o.message}`),1}}function qo(){console.log(`
|
|
108
108
|
Claude-Mem Cursor Hooks Status
|
|
109
|
-
`);let t=[{name:"Project",dir:p.join(process.cwd(),".cursor")},{name:"User",dir:p.join(St(),".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 o of t){let r=p.join(o.dir,"hooks.json"),s=p.join(o.dir,"hooks");if(B(r)){e=!0,console.log(`${o.name}: Installed`),console.log(` Config: ${r}`);try{let n=JSON.parse(
|
|
110
|
-
`),0}async function
|
|
109
|
+
`);let t=[{name:"Project",dir:p.join(process.cwd(),".cursor")},{name:"User",dir:p.join(St(),".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 o of t){let r=p.join(o.dir,"hooks.json"),s=p.join(o.dir,"hooks");if(B(r)){e=!0,console.log(`${o.name}: Installed`),console.log(` Config: ${r}`);try{let n=JSON.parse(Wo(r,"utf-8"))?.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(l=>B(p.join(s,l))),d=c.some(l=>B(p.join(s,l)));D||d?(console.log(" Mode: Legacy shell scripts (consider reinstalling for unified CLI)"),D&&d?console.log(" Platform: Both (bash + PowerShell)"):D?console.log(" Platform: Unix (bash)"):d&&console.log(" Platform: Windows (PowerShell)")):console.log(" Mode: Unknown configuration")}}catch{console.log(" Mode: Unable to parse hooks.json")}if(o.name==="Project"){let i=p.join(o.dir,"rules","claude-mem-context.mdc");B(i)?console.log(" Context: Active"):console.log(" Context: Not yet generated (will be created on first prompt)")}}else console.log(`${o.name}: Not installed`);console.log("")}return e||console.log(`No hooks installed. Run: claude-mem cursor install
|
|
110
|
+
`),0}async function bi(){try{let{stdout:e}=await vi("which claude || where claude",{timeout:5e3});if(e.trim())return!0}catch(e){m.debug("SYSTEM","Claude CLI not in PATH",{},e)}let t=p.join(he,"plugins");return!!B(t)}async function $i(t,e){switch(t){case"install":{let o=e[0]||"project";return Yo(o)}case"uninstall":{let o=e[0]||"project";return Xo(o)}case"status":return qo();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,8 +131,8 @@ 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 vi,Ho,He=C(()=>{"use strict";q();_t();Ft();Go();vi=xi(yi),Ho=p.join(O,"cursor-projects.json")});var Fn={};K(Fn,{checkGeminiCliHooksStatus:()=>nr,handleGeminiCliCommand:()=>Ri,installGeminiCliHooks:()=>er,uninstallGeminiCliHooks:()=>tr});import fn from"path";import{homedir as Mi}from"os";import{existsSync as xe,readFileSync as bt,writeFileSync as hn,mkdirSync as Zo}from"fs";function Ii(t,e,o){let r=ye[o];if(!r)throw new Error(`Unknown Gemini CLI event: ${o}`);let s=t.replace(/\\/g,"\\\\"),i=e.replace(/\\/g,"\\\\");return`"${s}" "${i}" hook gemini-cli ${r}`}function Oi(t){return{matcher:"*",hooks:[{name:Je,type:"command",command:t,timeout:ki}]}}function En(){if(!xe(J))return{};let t=bt(J,"utf-8");try{return JSON.parse(t)}catch{throw new Error(`Corrupt JSON in ${J}, refusing to overwrite user settings`)}}function Qo(t){Zo($t,{recursive:!0}),hn(J,JSON.stringify(t,null,2)+`
|
|
135
|
+
`)}function Ti(t,e){let o={...t};o.hooks||(o.hooks={});for(let[r,s]of Object.entries(e)){let i=o.hooks[r]??[];for(let n of s){let u=i.findIndex(c=>c.hooks.some(D=>D.name===Je));if(u>=0){let c=i[u],D=c.hooks.findIndex(d=>d.name===Je);D>=0?c.hooks[D]=n.hooks[0]:c.hooks.push(n.hooks[0])}else i.push(n)}o.hooks[r]=i}return o}function Bi(){let t="<claude-mem-context>",o=`${t}
|
|
136
136
|
# Memory Context from Past Sessions
|
|
137
137
|
|
|
138
138
|
*No context yet. Complete your first session and context will appear here.*
|
|
@@ -141,9 +141,9 @@ For more info: https://docs.claude-mem.ai/cursor
|
|
|
141
141
|
|
|
142
142
|
`:r.length>0?`
|
|
143
143
|
`:"",i=r+s+o+`
|
|
144
|
-
`;
|
|
144
|
+
`;Zo($t,{recursive:!0}),hn(H,i)}async function er(){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=Fe();console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`);try{let o={};for(let n of Object.keys(ye)){let u
|
|
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=Fe();console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`);try{let o={};for(let n of Object.keys(ye)){let u=Ii(e,t,n);o[n]=[Oi(u)]}let r=En(),s=Ti(r,o);Qo(s),console.log(` Merged hooks into ${J}`),Bi(),console.log(` Setup context injection in ${H}`);let i=Object.keys(ye);console.log(` Registered ${i.length} hook events:`);for(let n of i){let u=ye[n];console.log(` ${n} \u2192 ${u}`)}return console.log(`
|
|
147
147
|
Installation complete!
|
|
148
148
|
|
|
149
149
|
Hooks installed to: ${J}
|
|
@@ -158,21 +158,21 @@ Context Injection:
|
|
|
158
158
|
Context from past sessions is injected via ~/.gemini/GEMINI.md
|
|
159
159
|
and automatically included in Gemini CLI conversations.
|
|
160
160
|
`),0}catch(o){return console.error(`
|
|
161
|
-
Installation failed: ${o.message}`),1}}function
|
|
161
|
+
Installation failed: ${o.message}`),1}}function tr(){console.log(`
|
|
162
162
|
Uninstalling Claude-Mem Gemini CLI hooks...
|
|
163
|
-
`);try{if(!xe(J))return console.log(" No Gemini CLI settings found \u2014 nothing to uninstall."),0;let t=
|
|
163
|
+
`);try{if(!xe(J))return console.log(" No Gemini CLI settings found \u2014 nothing to uninstall."),0;let t=En();if(!t.hooks)return console.log(" No hooks found in Gemini CLI settings \u2014 nothing to uninstall."),0;let e=0;for(let[o,r]of Object.entries(t.hooks)){let s=r.map(i=>{let n=i.hooks.filter(u=>u.name!==Je);return e+=i.hooks.length-n.length,{...i,hooks:n}}).filter(i=>i.hooks.length>0);s.length>0?t.hooks[o]=s:delete t.hooks[o]}if(Object.keys(t.hooks).length===0&&delete t.hooks,Qo(t),console.log(` Removed ${e} claude-mem hook(s) from ${J}`),xe(H)){let o=bt(H,"utf-8"),r=/\n?<claude-mem-context>[\s\S]*?<\/claude-mem-context>\n?/;r.test(o)&&(o=o.replace(r,""),hn(H,o),console.log(` Removed context section from ${H}`))}return console.log(`
|
|
164
164
|
Uninstallation complete!
|
|
165
165
|
`),console.log("Restart Gemini CLI to apply changes."),0}catch(t){return console.error(`
|
|
166
|
-
Uninstallation failed: ${t.message}`),1}}function
|
|
166
|
+
Uninstallation failed: ${t.message}`),1}}function nr(){if(console.log(`
|
|
167
167
|
Claude-Mem Gemini CLI Hooks Status
|
|
168
168
|
`),!xe(J))return console.log("Gemini CLI settings: Not found"),console.log(` Expected at: ${J}
|
|
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=En()}catch(o){return console.log(`Gemini CLI settings: ${o.message}
|
|
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[o,r]of Object.entries(t.hooks))r.some(i=>i.hooks.some(n=>n.name===
|
|
173
|
+
`),0;let e=[];for(let[o,r]of Object.entries(t.hooks))r.some(i=>i.hooks.some(n=>n.name===Je))&&e.push(o);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: ${J}`),console.log("Mode: Unified CLI (bun worker-service.cjs hook gemini-cli)"),console.log(`Events: ${e.length} of ${Object.keys(ye).length} mapped`);for(let o of e){let r=ye[o]??"unknown";console.log(` ${o} \u2192 ${r}`)}return xe(H)?bt(H,"utf-8").includes("<claude-mem-context>")?console.log(`Context: Active (${H})`):console.log("Context: GEMINI.md exists but missing claude-mem section"):console.log("Context: No GEMINI.md found"),console.log(""),0}async function
|
|
175
|
+
`),0;console.log(`Settings: ${J}`),console.log("Mode: Unified CLI (bun worker-service.cjs hook gemini-cli)"),console.log(`Events: ${e.length} of ${Object.keys(ye).length} mapped`);for(let o of e){let r=ye[o]??"unknown";console.log(` ${o} \u2192 ${r}`)}return xe(H)?bt(H,"utf-8").includes("<claude-mem-context>")?console.log(`Context: Active (${H})`):console.log("Context: GEMINI.md exists but missing claude-mem section"):console.log("Context: No GEMINI.md found"),console.log(""),0}async function Ri(t,e){switch(t){case"install":return er();case"uninstall":return tr();case"status":return nr();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 $t,J,H,
|
|
191
|
+
`),0}}var $t,J,H,Je,ki,ye,yn=C(()=>{"use strict";He();$t=fn.join(Mi(),".gemini"),J=fn.join($t,"settings.json"),H=fn.join($t,"GEMINI.md"),Je="claude-mem",ki=1e4,ye={SessionStart:"context",BeforeAgent:"session-init",AfterAgent:"observation",BeforeTool:"observation",AfterTool:"observation",PreCompress:"summarize",Notification:"observation",SessionEnd:"session-complete"}});import Pi from"path";import{existsSync as Li,readFileSync as ji,writeFileSync as xn,mkdirSync as Ni}from"fs";function Mt(t,e,o){let r=Pi.dirname(t);Ni(r,{recursive:!0});let s=`${Ke}
|
|
192
192
|
${e}
|
|
193
|
-
${ve}`;if(
|
|
193
|
+
${ve}`;if(Li(t)){let i=ji(t,"utf-8"),n=i.indexOf(Ke),u=i.indexOf(ve);n!==-1&&u!==-1?i=i.slice(0,n)+s+i.slice(u+ve.length):i=i.trimEnd()+`
|
|
194
194
|
|
|
195
195
|
`+s+`
|
|
196
|
-
`,
|
|
196
|
+
`,xn(t,i,"utf-8")}else o?xn(t,`${o}
|
|
197
197
|
|
|
198
198
|
${s}
|
|
199
|
-
`,"utf-8"):
|
|
200
|
-
`,"utf-8")}var
|
|
201
|
-
`+r.slice(i+ve.length).trimStart();let n=r.trim();n.length===0||n==="# Claude-Mem Memory Context"?(
|
|
202
|
-
`,"utf-8"),console.log(" Cleaned context from AGENTS.md"))}}catch(r){let s=r instanceof Error?r.message:String(r);console.error(` Failed to clean AGENTS.md: ${s}`),t=!0}return t?1:0}function
|
|
199
|
+
`,"utf-8"):xn(t,s+`
|
|
200
|
+
`,"utf-8")}var Ke,ve,vn=C(()=>{"use strict";Ke="<claude-mem-context>",ve="</claude-mem-context>"});var Sn={};K(Sn,{checkOpenCodeStatus:()=>Vi,findBuiltPluginPath:()=>ir,getInstalledPluginPath:()=>Ye,getOpenCodeAgentsMdPath:()=>Ve,getOpenCodeConfigDirectory:()=>kt,getOpenCodePluginsDirectory:()=>_n,injectContextIntoAgentsMd:()=>de,installOpenCodeIntegration:()=>Yi,installOpenCodePlugin:()=>ur,syncContextToAgentsMd:()=>Ji,uninstallOpenCodePlugin:()=>Ki});import te from"path";import{homedir as rr}from"os";import{fileURLToPath as Ui}from"url";import{existsSync as _e,readFileSync as sr,writeFileSync as Gi,mkdirSync as Wi,copyFileSync as Hi,unlinkSync as or}from"fs";function kt(){return process.env.OPENCODE_CONFIG_DIR?process.env.OPENCODE_CONFIG_DIR:te.join(rr(),".config","opencode")}function _n(){return te.join(kt(),"plugins")}function Ve(){return te.join(kt(),"AGENTS.md")}function Ye(){return te.join(_n(),"claude-mem.js")}function ir(){let t=[te.join(process.env.CLAUDE_CONFIG_DIR||te.join(rr(),".claude"),"plugins","marketplaces","thedotmack","dist","opencode-plugin","index.js"),te.join(te.dirname(Ui(import.meta.url)),"..","..","..","dist","opencode-plugin","index.js")];for(let e of t)if(_e(e))return e;return null}function ur(){let t=ir();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=_n(),o=Ye();try{return Wi(e,{recursive:!0}),Hi(t,o),console.log(` Plugin installed to: ${o}`),m.info("OPENCODE","Plugin installed",{destination:o}),0}catch(r){let s=r instanceof Error?r.message:String(r);return console.error(`Failed to install OpenCode plugin: ${s}`),1}}function de(t){let e=Ve();try{return Mt(e,t,"# Claude-Mem Memory Context"),m.info("OPENCODE","Context injected into AGENTS.md",{path:e}),0}catch(o){let r=o instanceof Error?o.message:String(o);return console.error(`Failed to inject context into AGENTS.md: ${r}`),1}}async function Ji(t,e){try{let o=await fetch(`http://127.0.0.1:${t}/api/context/inject?project=${encodeURIComponent(e)}`);if(!o.ok)return;let r=await o.text();r&&r.trim()&&de(r)!==0&&m.warn("OPENCODE","Failed to inject context into AGENTS.md during sync")}catch{}}function Ki(){let t=!1,e=Ye();if(_e(e))try{or(e),console.log(` Removed plugin: ${e}`)}catch(r){let s=r instanceof Error?r.message:String(r);console.error(` Failed to remove plugin: ${s}`),t=!0}let o=Ve();if(_e(o))try{let r=sr(o,"utf-8"),s=r.indexOf(Ke),i=r.indexOf(ve);if(s!==-1&&i!==-1){r=r.slice(0,s).trimEnd()+`
|
|
201
|
+
`+r.slice(i+ve.length).trimStart();let n=r.trim();n.length===0||n==="# Claude-Mem Memory Context"?(or(o),console.log(" Removed empty AGENTS.md")):(Gi(o,n+`
|
|
202
|
+
`,"utf-8"),console.log(" Cleaned context from AGENTS.md"))}}catch(r){let s=r instanceof Error?r.message:String(r);console.error(` Failed to clean AGENTS.md: ${s}`),t=!0}return t?1:0}function Vi(){console.log(`
|
|
203
203
|
Claude-Mem OpenCode Integration Status
|
|
204
|
-
`);let t=kt(),e=
|
|
204
|
+
`);let t=kt(),e=Ye(),o=Ve();if(console.log(`Config directory: ${t}`),console.log(` Exists: ${_e(t)?"yes":"no"}`),console.log(""),console.log(`Plugin: ${e}`),console.log(` Installed: ${_e(e)?"yes":"no"}`),console.log(""),console.log(`Context (AGENTS.md): ${o}`),_e(o)){let s=sr(o,"utf-8").includes(Ke);console.log(" Exists: yes"),console.log(` Has claude-mem context: ${s?"yes":"no"}`)}else console.log(" Exists: no");return console.log(""),0}async function Yi(){console.log(`
|
|
205
205
|
Installing Claude-Mem for OpenCode...
|
|
206
|
-
`);let t=
|
|
206
|
+
`);let t=ur();if(t!==0)return t;let e=`# 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.`;try{let o=
|
|
210
|
+
Use claude-mem search tools for manual memory queries.`;try{let o=Ge();if((await fetch(`http://127.0.0.1:${o}/api/readiness`)).ok){let s=await fetch(`http://127.0.0.1:${o}/api/context/inject?project=opencode`);if(s.ok){let i=await s.text();i&&i.trim()?de(i)!==0?m.warn("OPENCODE","Failed to inject real context into AGENTS.md during install"):console.log(" Context injected from existing memory"):de(e)!==0?m.warn("OPENCODE","Failed to inject placeholder context into AGENTS.md during install"):console.log(" Placeholder context created (will populate after first session)")}else de(e)!==0&&m.warn("OPENCODE","Failed to inject placeholder context into AGENTS.md during install")}else de(e)!==0?m.warn("OPENCODE","Failed to inject placeholder context into AGENTS.md during install"):console.log(" Placeholder context created (worker not running)")}catch{de(e)!==0?m.warn("OPENCODE","Failed to inject placeholder context into AGENTS.md during install"):console.log(" Placeholder context created (worker not running)")}return console.log(`
|
|
211
211
|
Installation complete!
|
|
212
212
|
|
|
213
|
-
Plugin installed to: ${
|
|
214
|
-
Context file: ${
|
|
213
|
+
Plugin installed to: ${Ye()}
|
|
214
|
+
Context file: ${Ve()}
|
|
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 An=C(()=>{"use strict";q();vn();_t()});var $n={};K($n,{checkWindsurfHooksStatus:()=>gr,handleWindsurfCommand:()=>tu,installWindsurfHooks:()=>mr,readWindsurfRegistry:()=>Bt,registerWindsurfProject:()=>Dr,uninstallWindsurfHooks:()=>pr,unregisterWindsurfProject:()=>dr,updateWindsurfContextForProject:()=>zi,writeWindsurfContextFile:()=>bn,writeWindsurfRegistry:()=>wn});import P from"path";import{homedir as Xi}from"os";import{existsSync as Se,readFileSync as Ot,writeFileSync as qe,unlinkSync as ar,mkdirSync as Tt,renameSync as qi}from"fs";function Bt(){try{return Se(Xe)?JSON.parse(Ot(Xe,"utf-8")):{}}catch(t){return m.error("WINDSURF","Failed to read registry, using empty",{file:Xe},t),{}}}function wn(t){let e=P.dirname(Xe);Tt(e,{recursive:!0}),qe(Xe,JSON.stringify(t,null,2))}function Dr(t){let e=Bt();e[t]={installedAt:new Date().toISOString()},wn(e),m.info("WINDSURF","Registered project for auto-context updates",{workspacePath:t})}function dr(t){let e=Bt();e[t]&&(delete e[t],wn(e),m.info("WINDSURF","Unregistered project",{workspacePath:t}))}async function zi(t,e,o){if(Bt()[e])try{let i=await fetch(`http://127.0.0.1:${o}/api/context/inject?project=${encodeURIComponent(t)}`);if(!i.ok)return;let n=await i.text();if(!n||!n.trim())return;bn(e,n),m.debug("WINDSURF","Updated context file",{projectName:t,workspacePath:e})}catch(i){m.error("WINDSURF","Failed to update context file",{projectName:t,workspacePath:e},i)}}function bn(t,e){let o=P.join(t,".windsurf","rules"),r=P.join(o,"claude-mem-context.md"),s=`${r}.tmp`;Tt(o,{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,12 +225,12 @@ ${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>cr&&(i=i.slice(0,cr-50)+`
|
|
229
229
|
|
|
230
230
|
*[Truncated \u2014 use MCP search for full history]*
|
|
231
|
-
`),
|
|
231
|
+
`),qe(s,i),qi(s,r)}function Zi(t,e,o){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"}[o]??"observation";return`"${t}" "${e}" hook windsurf ${s}`}function Qi(t,e,o){Tt(lr,{recursive:!0});let r={hooks:{}};if(Se(R))try{r=JSON.parse(Ot(R,"utf-8")),r.hooks||(r.hooks={})}catch{throw new Error(`Corrupt hooks.json at ${R}, refusing to overwrite`)}for(let s of It){let n={command:Zi(t,e,s),show_output:!1,working_directory:o},u=(r.hooks[s]??[]).filter(c=>!c.command.includes("worker-service")||!c.command.includes("windsurf"));r.hooks[s]=[...u,n]}qe(R,JSON.stringify(r,null,2))}async function mr(){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=Fe();if(!e)return console.error("Could not find Bun runtime"),console.error(" Install Bun: curl -fsSL https://bun.sh/install | bash"),1;let o=P.dirname(t);try{console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`),
|
|
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=Fe();if(!e)return console.error("Could not find Bun runtime"),console.error(" Install Bun: curl -fsSL https://bun.sh/install | bash"),1;let o=P.dirname(t);try{console.log(` Using Bun runtime: ${e}`),console.log(` Worker service: ${t}`),Qi(e,t,o),console.log(" Created/merged hooks.json");let r=process.cwd();return await eu(r),console.log(`
|
|
234
234
|
Installation complete!
|
|
235
235
|
|
|
236
236
|
Hooks installed to: ${R}
|
|
@@ -248,21 +248,21 @@ Next steps:
|
|
|
248
248
|
2. Restart Windsurf to load the hooks
|
|
249
249
|
3. Context is injected via .windsurf/rules/claude-mem-context.md (workspace-level)
|
|
250
250
|
`),0}catch(r){return console.error(`
|
|
251
|
-
Installation failed: ${r.message}`),1}}async function
|
|
251
|
+
Installation failed: ${r.message}`),1}}async function eu(t){let e=Ge(),o=P.basename(t),r=!1;console.log(" Generating initial context...");try{if((await fetch(`http://127.0.0.1:${e}/api/readiness`)).ok){let i=await fetch(`http://127.0.0.1:${e}/api/context/inject?project=${encodeURIComponent(o)}`);if(i.ok){let n=await i.text();n&&n.trim()&&(bn(t,n),r=!0,console.log(" Generated initial context from existing memory"))}}}catch(s){m.debug("WINDSURF","Worker not running during install",{},s)}if(!r){let s=P.join(t,".windsurf","rules");Tt(s,{recursive:!0});let i=P.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)")}Dr(t),console.log(" Registered for auto-context updates")}function pr(){console.log(`
|
|
257
257
|
Uninstalling Claude-Mem Windsurf hooks...
|
|
258
|
-
`);try{if(Se(R))try{let o=JSON.parse(Ot(R,"utf-8"));for(let r of It)o.hooks[r]&&(o.hooks[r]=o.hooks[r].filter(s=>!s.command.includes("worker-service")||!s.command.includes("windsurf")),o.hooks[r].length===0&&delete o.hooks[r]);Object.keys(o.hooks).length===0?(
|
|
258
|
+
`);try{if(Se(R))try{let o=JSON.parse(Ot(R,"utf-8"));for(let r of It)o.hooks[r]&&(o.hooks[r]=o.hooks[r].filter(s=>!s.command.includes("worker-service")||!s.command.includes("windsurf")),o.hooks[r].length===0&&delete o.hooks[r]);Object.keys(o.hooks).length===0?(ar(R),console.log(" Removed hooks.json (no hooks remaining)")):(qe(R,JSON.stringify(o,null,2)),console.log(" Removed claude-mem entries from hooks.json (other hooks preserved)"))}catch{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(),e=P.join(t,".windsurf","rules","claude-mem-context.md");return Se(e)&&(ar(e),console.log(" Removed context file")),dr(t),console.log(" Unregistered from auto-context updates"),console.log(`
|
|
259
259
|
Uninstallation complete!
|
|
260
260
|
`),console.log("Restart Windsurf to apply changes."),0}catch(t){return console.error(`
|
|
261
|
-
Uninstallation failed: ${t.message}`),1}}function
|
|
261
|
+
Uninstallation failed: ${t.message}`),1}}function gr(){if(console.log(`
|
|
262
262
|
Claude-Mem Windsurf Hooks Status
|
|
263
263
|
`),Se(R)){console.log("User-level: Installed"),console.log(` Config: ${R}`);try{let e=JSON.parse(Ot(R,"utf-8")),o=It.filter(r=>e.hooks[r]?.some(s=>s.command.includes("worker-service")&&s.command.includes("windsurf")));console.log(` Events: ${o.length}/${It.length} registered`);for(let r of o)console.log(` - ${r}`)}catch{console.log(" Mode: Unable to parse hooks.json")}let t=P.join(process.cwd(),".windsurf","rules","claude-mem-context.md");Se(t)?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 tu(t,e){switch(t){case"install":return mr();case"uninstall":return pr();case"status":return gr();default:return console.log(`
|
|
266
266
|
Claude-Mem Windsurf Integration
|
|
267
267
|
|
|
268
268
|
Usage: claude-mem windsurf <command>
|
|
@@ -278,13 +278,13 @@ 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 lr,R,cr,Xe,It,Mn=C(()=>{"use strict";q();_t();Ft();He();lr=P.join(Xi(),".codeium","windsurf"),R=P.join(lr,"hooks.json"),cr=6e3,Xe=P.join(O,"windsurf-projects.json"),It=["pre_user_prompt","post_write_code","post_run_command","post_mcp_tool_use","post_cascade_response"]});var On={};K(On,{checkOpenClawStatus:()=>uu,findPluginManifestPath:()=>Fr,findPluginSkillsDirectory:()=>yr,findPreBuiltPluginDirectory:()=>Er,getOpenClawClaudeMemExtensionDirectory:()=>Ze,getOpenClawConfigDirectory:()=>ze,getOpenClawConfigFilePath:()=>Ae,getOpenClawExtensionsDirectory:()=>hr,installOpenClawIntegration:()=>au,installOpenClawPlugin:()=>vr,uninstallOpenClawPlugin:()=>iu});import v from"path";import{homedir as Rt}from"os";import{existsSync as V,readFileSync as nu,writeFileSync as Cr,mkdirSync as fr,cpSync as kn,rmSync as ou}from"fs";function ze(){return v.join(Rt(),".openclaw")}function hr(){return v.join(ze(),"extensions")}function Ze(){return v.join(hr(),"claude-mem")}function Ae(){return v.join(ze(),"openclaw.json")}function Er(){let t=[v.join(process.env.CLAUDE_CONFIG_DIR||v.join(Rt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let o=v.join(e,"openclaw","dist"),r=v.join(o,"index.js");if(V(r))return o}return null}function Fr(){let t=[v.join(process.env.CLAUDE_CONFIG_DIR||v.join(Rt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let o=v.join(e,"openclaw","openclaw.plugin.json");if(V(o))return o}return null}function yr(){let t=[v.join(process.env.CLAUDE_CONFIG_DIR||v.join(Rt(),".claude"),"plugins","marketplaces","thedotmack"),process.cwd()];for(let e of t){let o=v.join(e,"openclaw","skills");if(V(o))return o}return null}function In(){let t=Ae();if(!V(t))return{};try{return JSON.parse(nu(t,"utf-8"))}catch{return{}}}function xr(t){let e=ze();fr(e,{recursive:!0}),Cr(Ae(),JSON.stringify(t,null,2)+`
|
|
282
|
+
`,"utf-8")}function ru(t=37777,e="openclaw",o=!0){let r=In();if(r.plugins||(r.plugins={}),r.plugins.slots||(r.plugins.slots={}),r.plugins.entries||(r.plugins.entries={}),r.plugins.slots.memory="claude-mem",!r.plugins.entries["claude-mem"])r.plugins.entries["claude-mem"]={enabled:!0,config:{workerPort:t,project:e,syncMemoryFile:o}};else{r.plugins.entries["claude-mem"].enabled=!0,r.plugins.entries["claude-mem"].config||(r.plugins.entries["claude-mem"].config={});let s=r.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=o)}xr(r)}function su(){let t=Ae();if(!V(t))return;let e=In();e.plugins?.entries?.["claude-mem"]&&delete e.plugins.entries["claude-mem"],e.plugins?.slots?.memory==="claude-mem"&&delete e.plugins.slots.memory,xr(e)}function vr(){let t=Er();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=Ze(),o=v.join(e,"dist");try{fr(o,{recursive:!0}),kn(t,o,{recursive:!0,force:!0}),console.log(` Plugin dist copied to: ${o}`);let r=Fr();if(r){let n=v.join(e,"openclaw.plugin.json");kn(r,n,{force:!0}),console.log(` Plugin manifest copied to: ${n}`)}let s=yr();if(s){let n=v.join(e,"skills");kn(s,n,{recursive:!0,force:!0}),console.log(` Skills copied to: ${n}`)}let i={name:"claude-mem",version:"1.0.0",type:"module",main:"dist/index.js",openclaw:{extensions:["./dist/index.js"]}};return Cr(v.join(e,"package.json"),JSON.stringify(i,null,2)+`
|
|
283
|
+
`,"utf-8"),ru(),console.log(" Registered in openclaw.json"),m.info("OPENCLAW","Plugin installed",{destination:e}),0}catch(r){let s=r instanceof Error?r.message:String(r);return console.error(`Failed to install OpenClaw plugin: ${s}`),1}}function iu(){let t=!1,e=Ze();if(V(e))try{ou(e,{recursive:!0,force:!0}),console.log(` Removed extension: ${e}`)}catch(o){let r=o instanceof Error?o.message:String(o);console.error(` Failed to remove extension directory: ${r}`),t=!0}try{su(),console.log(" Unregistered from openclaw.json")}catch(o){let r=o instanceof Error?o.message:String(o);console.error(` Failed to update openclaw.json: ${r}`),t=!0}return t?1:0}function uu(){console.log(`
|
|
284
284
|
Claude-Mem OpenClaw Integration Status
|
|
285
|
-
`);let t=
|
|
285
|
+
`);let t=ze(),e=Ze(),o=Ae(),r=v.join(e,"dist","index.js");if(console.log(`Config directory: ${t}`),console.log(` Exists: ${V(t)?"yes":"no"}`),console.log(""),console.log(`Extension directory: ${e}`),console.log(` Exists: ${V(e)?"yes":"no"}`),console.log(` Plugin entry: ${V(r)?"yes":"no"}`),console.log(""),console.log(`Config (openclaw.json): ${o}`),V(o)){let s=In(),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 au(){console.log(`
|
|
286
286
|
Installing Claude-Mem for OpenClaw...
|
|
287
|
-
`);let t=
|
|
287
|
+
`);let t=vr();if(t!==0)return t;let e=Ze();return console.log(`
|
|
288
288
|
Installation complete!
|
|
289
289
|
|
|
290
290
|
Plugin installed to: ${e}
|
|
@@ -294,13 +294,13 @@ 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 Tn=C(()=>{"use strict";q()});import{existsSync as ml,readFileSync as pl,writeFileSync as gl,mkdirSync as Cl}from"fs";import{homedir as _r}from"os";import{join as Sr,dirname as El}from"path";var Y,Qe,cu,Pt,Ar=C(()=>{"use strict";Y=Sr(_r(),".claude-mem","transcript-watch.json"),Qe=Sr(_r(),".claude-mem","transcript-watch-state.json"),cu={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"}]},Pt={version:1,schemas:{codex:cu},watches:[{name:"codex",path:"~/.codex/sessions/**/*.jsonl",schema:"codex",startAtEnd:!0,context:{mode:"agents",updateOn:["session_start","session_end"]}}],stateFile:Qe}});var Rn={};K(Rn,{checkCodexCliStatus:()=>Cu,installCodexCli:()=>pu,uninstallCodexCli:()=>gu});import Nt from"path";import{homedir as wr}from"os";import{existsSync as we,readFileSync as Lt,writeFileSync as jt,mkdirSync as lu}from"fs";function Bn(){let t=Y;if(!we(t))return{version:1,schemas:{},watches:[],stateFile:Qe};try{let e=Lt(t,"utf-8"),o=JSON.parse(e);return o.version||(o.version=1),o.watches||(o.watches=[]),o.schemas||(o.schemas={}),o.stateFile||(o.stateFile=Qe),o}catch(e){m.error("SYSTEM","Corrupt transcript-watch.json, creating backup",{path:t},e);let o=`${t}.backup.${Date.now()}`;return jt(o,Lt(t)),console.warn(` Backed up corrupt transcript-watch.json to ${o}`),{version:1,schemas:{},watches:[],stateFile:Qe}}}function du(t){let e={...t};e.schemas={...e.schemas};let o=Pt.schemas?.[oe];o&&(e.schemas[oe]=o);let r=Pt.watches.find(s=>s.name===oe);if(r){let s=e.watches.findIndex(i=>i.name===oe);s!==-1?e.watches[s]=r:e.watches.push(r)}return e}function $r(t){lu(Du,{recursive:!0}),jt(Y,JSON.stringify(t,null,2)+`
|
|
298
|
+
`)}function mu(){try{if(!we(ne))return;let t=Lt(ne,"utf-8"),e="<claude-mem-context>",o="</claude-mem-context>",r=t.indexOf(e),s=t.indexOf(o);if(r===-1||s===-1)return;let i=t.substring(0,r).replace(/\n+$/,""),n=t.substring(s+o.length).replace(/^\n+/,""),u=(i+(n?`
|
|
299
299
|
|
|
300
300
|
`+n:"")).trim();u?jt(ne,u+`
|
|
301
|
-
`):jt(ne,""),console.log(` Removed legacy global context from ${ne}`)}catch(t){m.warn("SYSTEM","Failed to clean AGENTS.md context",{error:t.message})}}async function
|
|
301
|
+
`):jt(ne,""),console.log(` Removed legacy global context from ${ne}`)}catch(t){m.warn("SYSTEM","Failed to clean AGENTS.md context",{error:t.message})}}async function pu(){console.log(`
|
|
302
302
|
Installing Claude-Mem for Codex CLI (transcript watching)...
|
|
303
|
-
`);try{let t=
|
|
303
|
+
`);try{let t=Bn(),e=du(t);return $r(e),console.log(` Updated ${Y}`),console.log(" Watch path: ~/.codex/sessions/**/*.jsonl"),console.log(` Schema: codex (v${Pt.schemas?.codex?.version??"?"})`),Mr(),console.log(`
|
|
304
304
|
Installation complete!
|
|
305
305
|
|
|
306
306
|
Transcript watch config: ${Y}
|
|
@@ -315,35 +315,35 @@ Next steps:
|
|
|
315
315
|
1. Start claude-mem worker: npx claude-mem start
|
|
316
316
|
2. Use Codex CLI as usual -- memory capture is automatic!
|
|
317
317
|
`),0}catch(t){return console.error(`
|
|
318
|
-
Installation failed: ${t.message}`),1}}function
|
|
318
|
+
Installation failed: ${t.message}`),1}}function gu(){console.log(`
|
|
319
319
|
Uninstalling Claude-Mem Codex CLI integration...
|
|
320
|
-
`);try{if(we(Y)){let t=
|
|
320
|
+
`);try{if(we(Y)){let t=Bn();t.watches=t.watches.filter(e=>e.name!==oe),t.schemas&&delete t.schemas[oe],$r(t),console.log(` Removed codex watch from ${Y}`)}else console.log(" No transcript-watch.json found -- nothing to remove.");return Mr(),console.log(`
|
|
321
321
|
Uninstallation complete!`),console.log(`Restart claude-mem worker to apply changes.
|
|
322
322
|
`),0}catch(t){return console.error(`
|
|
323
|
-
Uninstallation failed: ${t.message}`),1}}function
|
|
323
|
+
Uninstallation failed: ${t.message}`),1}}function Cu(){if(console.log(`
|
|
324
324
|
Claude-Mem Codex CLI Integration Status
|
|
325
325
|
`),!we(Y))return console.log("Status: Not installed"),console.log(` No transcript watch config at ${Y}`),console.log(`
|
|
326
326
|
Run: npx claude-mem install --ide codex-cli
|
|
327
|
-
`),0;try{let t=
|
|
327
|
+
`),0;try{let t=Bn(),e=t.watches.find(s=>s.name===oe),o=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
328
|
Run: npx claude-mem install --ide codex-cli
|
|
329
|
-
`),0;console.log("Status: Installed"),console.log(` Config: ${Y}`),console.log(` Watch path: ${e.path}`),console.log(` Schema: ${o?`codex (v${o.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"}`)),we(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=Nt.join(
|
|
330
|
-
`)}function
|
|
329
|
+
`),0;console.log("Status: Installed"),console.log(` Config: ${Y}`),console.log(` Watch path: ${e.path}`),console.log(` Schema: ${o?`codex (v${o.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"}`)),we(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=Nt.join(br,"sessions");we(r)?console.log(" Sessions directory: exists"):console.log(" Sessions directory: not yet created (use Codex CLI to generate sessions)")}catch{console.log("Status: Unknown"),console.log(" Could not parse transcript-watch.json.")}return console.log(""),0}var br,ne,Du,oe,Mr,Pn=C(()=>{"use strict";q();Ar();br=Nt.join(wr(),".codex"),ne=Nt.join(br,"AGENTS.md"),Du=Nt.join(wr(),".claude-mem"),oe="codex";Mr=mu});var Rr={};K(Rr,{MCP_IDE_INSTALLERS:()=>bu,installGooseMcpIntegration:()=>Br});import T from"path";import{homedir as nt}from"os";import{existsSync as Or,readFileSync as fu,writeFileSync as tt,mkdirSync as Tr}from"fs";function Eu(t){return{command:process.execPath,args:[t]}}function Fu(t,e,o="mcpServers"){let r=T.dirname(t);Tr(r,{recursive:!0});let s=N(t,{});s[o]||(s[o]={}),s[o]["claude-mem"]=Eu(e),tt(t,JSON.stringify(s,null,2)+`
|
|
330
|
+
`)}function et(t){return async()=>{console.log(`
|
|
331
331
|
Installing Claude-Mem MCP integration for ${t.ideLabel}...
|
|
332
|
-
`);let e=
|
|
332
|
+
`);let e=We();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;try{let o=t.configPath;t.ideId==="warp"&&!Or(T.dirname(o))?console.log(" Note: ~/.warp/ not found. MCP may need to be configured via Warp Drive UI."):(Fu(o,e,t.configKey),console.log(` MCP config written to: ${o}`));let r;t.contextFile&&(r=t.contextFile.path,Mt(r,hu),console.log(` Context placeholder written to: ${r}`));let s=[`
|
|
333
333
|
Installation complete!
|
|
334
334
|
`];return s.push(`MCP config: ${o}`),r&&s.push(`Context: ${r}`),s.push(""),s.push("Note: This is an MCP-only integration providing search tools and context."),s.push(`Transcript capture is not available for ${t.ideLabel}.`),t.ideId==="warp"&&s.push("If MCP config via file is not supported, configure MCP through Warp Drive UI."),s.push(""),s.push("Next steps:"),s.push(" 1. Start claude-mem worker: npx claude-mem start"),s.push(` 2. Restart ${t.ideLabel} to pick up the MCP server`),s.push(""),console.log(s.join(`
|
|
335
335
|
`)),0}catch(o){return console.error(`
|
|
336
|
-
Installation failed: ${o.message}`),1}}}function
|
|
337
|
-
`)}function
|
|
338
|
-
`)}async function
|
|
336
|
+
Installation failed: ${o.message}`),1}}}function Au(){return T.join(nt(),".config","goose","config.yaml")}function wu(t){return t.includes("claude-mem:")&&t.includes("mcpServers:")}function kr(t){return["mcpServers:"," claude-mem:",` command: ${process.execPath}`," args:",` - ${t}`].join(`
|
|
337
|
+
`)}function Ir(t){return[" claude-mem:",` command: ${process.execPath}`," args:",` - ${t}`].join(`
|
|
338
|
+
`)}async function Br(){console.log(`
|
|
339
339
|
Installing Claude-Mem MCP integration for Goose...
|
|
340
|
-
`);let t=
|
|
341
|
-
`;s.test(r)&&(r=r.replace(s,i)),
|
|
342
|
-
|
|
343
|
-
`+
|
|
340
|
+
`);let t=We();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;try{let e=Au(),o=T.dirname(e);if(Tr(o,{recursive:!0}),Or(e)){let r=fu(e,"utf-8");if(wu(r)){let s=/( {2}claude-mem:\n(?:.*\n)*?(?= {2}\S|\n\n|^\S|$))/m,i=Ir(t)+`
|
|
341
|
+
`;s.test(r)&&(r=r.replace(s,i)),tt(e,r),console.log(` Updated existing claude-mem entry in: ${e}`)}else if(r.includes("mcpServers:")){let i=r.indexOf("mcpServers:")+11,n=`
|
|
342
|
+
`+Ir(t);r=r.slice(0,i)+n+r.slice(i),tt(e,r),console.log(` Added claude-mem to existing mcpServers in: ${e}`)}else{let s=`
|
|
343
|
+
`+kr(t)+`
|
|
344
344
|
`;r=r.trimEnd()+`
|
|
345
|
-
`+s,
|
|
346
|
-
`;
|
|
345
|
+
`+s,tt(e,r),console.log(` Appended mcpServers section to: ${e}`)}}else{let r=kr(t)+`
|
|
346
|
+
`;tt(e,r),console.log(` Created config with MCP server: ${e}`)}return console.log(`
|
|
347
347
|
Installation complete!
|
|
348
348
|
|
|
349
349
|
MCP config: ${e}
|
|
@@ -355,38 +355,39 @@ Next steps:
|
|
|
355
355
|
1. Start claude-mem worker: npx claude-mem start
|
|
356
356
|
2. Restart Goose to pick up the MCP server
|
|
357
357
|
`),0}catch(e){return console.error(`
|
|
358
|
-
Installation failed: ${e.message}`),1}}var
|
|
358
|
+
Installation failed: ${e.message}`),1}}var hu,yu,xu,vu,_u,Su,bu,Pr=C(()=>{"use strict";He();ke();vn();hu=`# claude-mem: Cross-Session Memory
|
|
359
359
|
|
|
360
360
|
*No context yet. Complete your first session and context will appear here.*
|
|
361
361
|
|
|
362
|
-
Use claude-mem's MCP search tools for manual memory queries.`;
|
|
362
|
+
Use claude-mem's MCP search tools for manual memory queries.`;yu={ideId:"copilot-cli",ideLabel:"Copilot CLI",configPath:T.join(nt(),".github","copilot","mcp.json"),configKey:"servers",contextFile:{path:T.join(process.cwd(),".github","copilot-instructions.md"),isWorkspaceRelative:!0}},xu={ideId:"antigravity",ideLabel:"Antigravity",configPath:T.join(nt(),".gemini","antigravity","mcp_config.json"),configKey:"mcpServers",contextFile:{path:T.join(process.cwd(),".agent","rules","claude-mem-context.md"),isWorkspaceRelative:!0}},vu={ideId:"crush",ideLabel:"Crush",configPath:T.join(nt(),".config","crush","mcp.json"),configKey:"mcpServers"},_u={ideId:"roo-code",ideLabel:"Roo Code",configPath:T.join(process.cwd(),".roo","mcp.json"),configKey:"mcpServers",contextFile:{path:T.join(process.cwd(),".roo","rules","claude-mem-context.md"),isWorkspaceRelative:!0}},Su={ideId:"warp",ideLabel:"Warp",configPath:T.join(nt(),".warp","mcp.json"),configKey:"mcpServers",contextFile:{path:T.join(process.cwd(),"WARP.md"),isWorkspaceRelative:!0}};bu={"copilot-cli":et(yu),antigravity:et(xu),goose:Br,crush:et(vu),"roo-code":et(_u),warp:et(Su)}});var Ut={};K(Ut,{runInstallCommand:()=>Nu});import{execSync as Ln}from"child_process";import{cpSync as Lr,existsSync as ot,readFileSync as $u,rmSync as jr}from"fs";import{join as be}from"path";async function Mu(t){if(re)await ft(t);else for(let e of t){let o=await e.task(r=>console.log(` ${r}`));console.log(` ${o}`)}}function ku(){let t=N(ge(),{});t.thedotmack={source:{source:"github",repo:"thedotmack/claude-mem"},installLocation:b(),lastUpdated:new Date().toISOString(),autoUpdate:!0},Te(ae()),Z(ge(),t)}function Iu(t){let e=N(Ce(),{});e.version||(e.version=2),e.plugins||(e.plugins={});let o=Vt(t),r=new Date().toISOString();e.plugins["claude-mem@thedotmack"]=[{scope:"user",installPath:o,version:t,installedAt:r,lastUpdated:r}],Z(Ce(),e)}function Ou(){let t=N(fe(),{});t.enabledPlugins||(t.enabledPlugins={}),t.enabledPlugins["claude-mem@thedotmack"]=!0,Z(fe(),t)}async function Tu(t){let e=[];for(let o of t)switch(o){case"claude-code":{try{Ln("claude plugin marketplace add thedotmack/claude-mem && claude plugin install claude-mem",{stdio:"inherit"}),g.success("Claude Code: plugin installed via CLI.")}catch{g.error("Claude Code: plugin install failed. Is `claude` CLI on your PATH?"),e.push(o)}break}case"cursor":{let{installCursorHooks:r,configureCursorMcp:s}=await Promise.resolve().then(()=>(He(),zo));await r("user")===0?s("user")===0?g.success("Cursor: hooks + MCP installed."):g.success("Cursor: hooks installed (MCP setup failed \u2014 run `npx claude-mem cursor mcp` to retry)."):(g.error("Cursor: hook installation failed."),e.push(o));break}case"gemini-cli":{let{installGeminiCliHooks:r}=await Promise.resolve().then(()=>(yn(),Fn));await r()===0?g.success("Gemini CLI: hooks installed."):(g.error("Gemini CLI: hook installation failed."),e.push(o));break}case"opencode":{let{installOpenCodeIntegration:r}=await Promise.resolve().then(()=>(An(),Sn));await r()===0?g.success("OpenCode: plugin installed."):(g.error("OpenCode: plugin installation failed."),e.push(o));break}case"windsurf":{let{installWindsurfHooks:r}=await Promise.resolve().then(()=>(Mn(),$n));await r()===0?g.success("Windsurf: hooks installed."):(g.error("Windsurf: hook installation failed."),e.push(o));break}case"openclaw":{let{installOpenClawIntegration:r}=await Promise.resolve().then(()=>(Tn(),On));await r()===0?g.success("OpenClaw: plugin installed."):(g.error("OpenClaw: plugin installation failed."),e.push(o));break}case"codex-cli":{let{installCodexCli:r}=await Promise.resolve().then(()=>(Pn(),Rn));await r()===0?g.success("Codex CLI: transcript watching configured."):(g.error("Codex CLI: integration setup failed."),e.push(o));break}case"copilot-cli":case"antigravity":case"goose":case"crush":case"roo-code":case"warp":{let{MCP_IDE_INSTALLERS:r}=await Promise.resolve().then(()=>(Pr(),Rr)),s=r[o];if(s){let i=await s(),c=Ue().find(D=>D.id===o)?.label??o;i===0?g.success(`${c}: MCP integration installed.`):(g.error(`${c}: MCP integration failed.`),e.push(o))}break}default:{let s=Ue().find(i=>i.id===o);s&&!s.supported&&g.warn(`Support for ${s.label} coming soon.`);break}}return e}async function Bu(){let e=Ue().filter(s=>s.detected);if(e.length===0)return g.warn("No supported IDEs detected. Installing for Claude Code by default."),["claude-code"];let o=e.map(s=>({value:s.id,label:s.label,hint:s.supported?s.hint:"coming soon"})),r=await vo({message:"Which IDEs do you use?",options:o,initialValues:e.filter(s=>s.supported).map(s=>s.id),required:!0});return ee(r)&&(je("Installation cancelled."),process.exit(0)),r}function Ru(){let t=b(),e=ut();Te(t);let o=["plugin","package.json","package-lock.json","node_modules","openclaw","dist","LICENSE","README.md","CHANGELOG.md"];for(let r of o){let s=be(e,r),i=be(t,r);ot(s)&&(ot(i)&&jr(i,{recursive:!0,force:!0}),Lr(s,i,{recursive:!0,force:!0}))}}function Pu(t){let e=Yt(),o=Vt(t);jr(o,{recursive:!0,force:!0}),Te(o),Lr(e,o,{recursive:!0,force:!0})}function Lu(){let t=b(),e=be(t,"package.json");ot(e)&&Ln("npm install --production",{cwd:t,stdio:"pipe",...X?{shell:!0}:{}})}function ju(){let t=be(b(),"plugin","scripts","smart-install.js");if(!ot(t))return g.warn("smart-install.js not found \u2014 skipping Bun/uv auto-install."),!1;try{return Ln(`node "${t}"`,{stdio:"inherit",...X?{shell:!0}:{}}),!0}catch{return g.warn("smart-install encountered an issue. You may need to install Bun/uv manually."),!1}}async function Nu(t={}){let e=Oe();re?Ct(h.default.bgCyan(h.default.black(" claude-mem install "))):console.log("claude-mem install"),g.info(`Version: ${h.default.cyan(e)}`),g.info(`Platform: ${process.platform} (${process.arch})`);let o=b();if(ot(be(o,"plugin",".claude-plugin","plugin.json"))){try{let l=JSON.parse($u(be(o,"plugin",".claude-plugin","plugin.json"),"utf-8"));g.warn(`Existing installation detected (v${l.version??"unknown"}).`)}catch{g.warn("Existing installation detected.")}if(process.stdin.isTTY){let l=await Pe({message:"Overwrite existing installation?",initialValue:!0});(ee(l)||!l)&&(je("Installation cancelled."),process.exit(0))}}let s;if(t.ide){s=[t.ide];let l=Ue(),x=l.find(_=>_.id===t.ide);x&&!x.supported&&(g.error(`Support for ${x.label} coming soon.`),process.exit(1)),x||(g.error(`Unknown IDE: ${t.ide}`),g.info(`Available IDEs: ${l.map(_=>_.id).join(", ")}`),process.exit(1))}else process.stdin.isTTY?s=await Bu():s=["claude-code"];s.some(l=>l!=="claude-code")&&await Mu([{title:"Copying plugin files",task:async l=>(l("Copying to marketplace directory..."),Ru(),`Plugin files copied ${h.default.green("OK")}`)},{title:"Caching plugin version",task:async l=>(l(`Caching v${e}...`),Pu(e),`Plugin cached (v${e}) ${h.default.green("OK")}`)},{title:"Registering marketplace",task:async()=>(ku(),`Marketplace registered ${h.default.green("OK")}`)},{title:"Registering plugin",task:async()=>(Iu(e),`Plugin registered ${h.default.green("OK")}`)},{title:"Enabling plugin in Claude settings",task:async()=>(Ou(),`Plugin enabled ${h.default.green("OK")}`)},{title:"Installing dependencies",task:async l=>{l("Running npm install...");try{return Lu(),`Dependencies installed ${h.default.green("OK")}`}catch{return`Dependencies may need manual install ${h.default.yellow("!")}`}}},{title:"Setting up Bun and uv",task:async l=>(l("Running smart-install..."),ju()?`Runtime dependencies ready ${h.default.green("OK")}`:`Runtime setup may need attention ${h.default.yellow("!")}`)}]);let n=await Tu(s),u=n.length>0?"Installation Partial":"Installation Complete",c=[`Version: ${h.default.cyan(e)}`,`Plugin dir: ${h.default.cyan(o)}`,`IDEs: ${h.default.cyan(s.join(", "))}`];n.length>0&&c.push(`Failed: ${h.default.red(n.join(", "))}`),re?Le(c.join(`
|
|
363
363
|
`),u):(console.log(`
|
|
364
|
-
${u}`),c.forEach(l=>console.log(` ${l}`)));let D=process.env.CLAUDE_MEM_WORKER_PORT||"37777",d=["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")}`];re?(
|
|
365
|
-
`),"Next Steps"),n.length>0?
|
|
364
|
+
${u}`),c.forEach(l=>console.log(` ${l}`)));let D=process.env.CLAUDE_MEM_WORKER_PORT||"37777",d=["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")}`];re?(Le(d.join(`
|
|
365
|
+
`),"Next Steps"),n.length>0?le(h.default.yellow("claude-mem installed with some IDE setup failures.")):le(h.default.green("claude-mem installed successfully!"))):(console.log(`
|
|
366
366
|
Next Steps`),d.forEach(l=>console.log(` ${l}`)),n.length>0?(console.log(`
|
|
367
367
|
claude-mem installed with some IDE setup failures.`),process.exitCode=1):console.log(`
|
|
368
|
-
claude-mem installed successfully!`))}var h,re,g,Gt=C(()=>{"use strict";
|
|
369
|
-
`),"Note"),
|
|
370
|
-
${
|
|
371
|
-
|
|
372
|
-
${
|
|
373
|
-
${
|
|
374
|
-
${
|
|
375
|
-
${
|
|
376
|
-
${
|
|
377
|
-
${
|
|
378
|
-
${
|
|
379
|
-
|
|
380
|
-
${
|
|
381
|
-
${
|
|
382
|
-
${
|
|
383
|
-
${
|
|
384
|
-
${
|
|
385
|
-
${
|
|
386
|
-
${
|
|
387
|
-
|
|
388
|
-
|
|
368
|
+
claude-mem installed successfully!`))}var h,re,g,Gt=C(()=>{"use strict";un();h=ue(pe(),1);ce();ke();Ao();re=process.stdin.isTTY===!0;g={info:t=>re?$.info(t):console.log(` ${t}`),success:t=>re?$.success(t):console.log(` ${t}`),warn:t=>re?$.warn(t):console.warn(` ${t}`),error:t=>re?$.error(t):console.error(` ${t}`)}});var Gr={};K(Gr,{runUninstallCommand:()=>Vu});import{existsSync as Nr,rmSync as Ur}from"fs";import{join as Uu}from"path";function Gu(){let t=b();return Nr(t)?(Ur(t,{recursive:!0,force:!0}),!0):!1}function Wu(){let t=Uu(ae(),"cache","thedotmack","claude-mem");return Nr(t)?(Ur(t,{recursive:!0,force:!0}),!0):!1}function Hu(){let t=N(ge(),{});t.thedotmack&&(delete t.thedotmack,Z(ge(),t))}function Ju(){let t=N(Ce(),{});t.plugins?.["claude-mem@thedotmack"]&&(delete t.plugins["claude-mem@thedotmack"],Z(Ce(),t))}function Ku(){let t=N(fe(),{});t.enabledPlugins?.["claude-mem@thedotmack"]!==void 0&&(delete t.enabledPlugins["claude-mem@thedotmack"],Z(fe(),t))}async function Vu(){if(Ct(L.default.bgRed(L.default.white(" claude-mem uninstall "))),at()){if(process.stdin.isTTY){let o=await Pe({message:"Are you sure you want to uninstall claude-mem?",initialValue:!1});if(ee(o)||!o){je("Uninstall cancelled.");return}}}else if($.warn("claude-mem does not appear to be installed."),process.stdin.isTTY){let o=await Pe({message:"Clean up any remaining registration data anyway?",initialValue:!1});if(ee(o)||!o){le("Nothing to do.");return}}else{le("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 o=0;o<20;o++){await new Promise(r=>setTimeout(r,500));try{await fetch(`http://127.0.0.1:${t}/api/health`,{signal:AbortSignal.timeout(1e3)})}catch{break}}$.info("Worker service stopped.")}catch{}await ft([{title:"Removing marketplace directory",task:async()=>Gu()?`Marketplace directory removed ${L.default.green("OK")}`:`Marketplace directory not found ${L.default.dim("skipped")}`},{title:"Removing cache directory",task:async()=>Wu()?`Cache directory removed ${L.default.green("OK")}`:`Cache directory not found ${L.default.dim("skipped")}`},{title:"Removing marketplace registration",task:async()=>(Hu(),`Marketplace registration removed ${L.default.green("OK")}`)},{title:"Removing plugin registration",task:async()=>(Ju(),`Plugin registration removed ${L.default.green("OK")}`)},{title:"Removing from Claude settings",task:async()=>(Ku(),`Claude settings updated ${L.default.green("OK")}`)}]);let e=[{label:"Gemini CLI hooks",fn:async()=>{let{uninstallGeminiCliHooks:o}=await Promise.resolve().then(()=>(yn(),Fn));return o()}},{label:"Windsurf hooks",fn:async()=>{let{uninstallWindsurfHooks:o}=await Promise.resolve().then(()=>(Mn(),$n));return o()}},{label:"OpenCode plugin",fn:async()=>{let{uninstallOpenCodePlugin:o}=await Promise.resolve().then(()=>(An(),Sn));return o()}},{label:"OpenClaw plugin",fn:async()=>{let{uninstallOpenClawPlugin:o}=await Promise.resolve().then(()=>(Tn(),On));return o()}},{label:"Codex CLI",fn:async()=>{let{uninstallCodexCli:o}=await Promise.resolve().then(()=>(Pn(),Rn));return o()}}];for(let{label:o,fn:r}of e)try{await r()===0&&$.info(`${o}: removed.`)}catch{}Le([`Your data directory at ${L.default.cyan("~/.claude-mem")} was preserved.`,"To remove it manually: rm -rf ~/.claude-mem"].join(`
|
|
369
|
+
`),"Note"),le(L.default.green("claude-mem has been uninstalled."))}var L,Wr=C(()=>{"use strict";un();L=ue(pe(),1);ce();ke()});import{spawnSync as Yu}from"child_process";import{existsSync as Xu}from"fs";import{homedir as jn}from"os";import{join as Nn}from"path";function qu(){return X?[Nn(jn(),".bun","bin","bun.exe"),Nn(process.env.USERPROFILE||jn(),".bun","bin","bun.exe")]:[Nn(jn(),".bun","bin","bun"),"/usr/local/bin/bun","/opt/homebrew/bin/bun","/home/linuxbrew/.linuxbrew/bin/bun"]}function Hr(){let e=Yu(X?"where":"which",["bun"],{encoding:"utf-8",stdio:["pipe","pipe","pipe"],shell:X});if(e.status===0&&e.stdout.trim())return"bun";for(let o of qu())if(Xu(o))return o;return null}var Jr=C(()=>{"use strict";ce()});var se={};K(se,{runAdoptCommand:()=>ta,runRestartCommand:()=>Qu,runSearchCommand:()=>na,runStartCommand:()=>zu,runStatusCommand:()=>ea,runStopCommand:()=>Zu,runTranscriptWatchCommand:()=>oa});import{spawn as Un}from"child_process";import{existsSync as Gn}from"fs";import{join as Kr}from"path";function Wt(){at()||(console.error(w.default.red("claude-mem is not installed.")),console.error(`Run: ${w.default.bold("npx claude-mem install")}`),process.exit(1))}function Wn(){let t=Hr();return t||(console.error(w.default.red("Bun not found.")),console.error("Install Bun: https://bun.sh"),console.error("After installation, restart your terminal."),process.exit(1)),t}function Vr(){return Kr(b(),"plugin","scripts","worker-service.cjs")}function rt(t,e=[]){Wt();let o=Wn(),r=Vr();Gn(r)||(console.error(w.default.red(`Worker script not found at: ${r}`)),console.error("The installation may be corrupted. Try: npx claude-mem install"),process.exit(1));let s=[r,t,...e],i=Un(o,s,{stdio:"inherit",cwd:b(),env:process.env});i.on("error",n=>{console.error(w.default.red(`Failed to start Bun: ${n.message}`)),process.exit(1)}),i.on("close",n=>{process.exit(n??0)})}function zu(){rt("start")}function Zu(){rt("stop")}function Qu(){rt("restart")}function ea(){rt("status")}function ta(t=[]){Wt();let e=Wn(),o=Vr();Gn(o)||(console.error(w.default.red(`Worker script not found at: ${o}`)),console.error("The installation may be corrupted. Try: npx claude-mem install"),process.exit(1));let r=process.cwd(),s=[o,"adopt","--cwd",r,...t],i=Un(e,s,{stdio:"inherit",cwd:b(),env:process.env});i.on("error",n=>{console.error(w.default.red(`Failed to start Bun: ${n.message}`)),process.exit(1)}),i.on("close",n=>{process.exit(n??0)})}async function na(t){Wt();let e=t.join(" ").trim();e||(console.error(w.default.red("Usage: npx claude-mem search <query>")),process.exit(1));let r=`http://127.0.0.1:${process.env.CLAUDE_MEM_WORKER_PORT||"37777"}/api/search?query=${encodeURIComponent(e)}`;try{let s=await fetch(r);s.ok||(s.status===404&&(console.error(w.default.red("Search endpoint not found. Is the worker running?")),console.error(`Try: ${w.default.bold("npx claude-mem start")}`),process.exit(1)),console.error(w.default.red(`Search failed: HTTP ${s.status}`)),process.exit(1));let i=await s.json();console.log(typeof i=="object"&&i!==null?JSON.stringify(i,null,2):i)}catch(s){(s?.cause?.code==="ECONNREFUSED"||s?.message?.includes("ECONNREFUSED"))&&(console.error(w.default.red("Worker is not running.")),console.error(`Start it with: ${w.default.bold("npx claude-mem start")}`),process.exit(1)),console.error(w.default.red(`Search failed: ${s.message}`)),process.exit(1)}}function oa(){Wt();let t=Wn(),e=Kr(b(),"plugin","scripts","transcript-watcher.cjs");if(!Gn(e)){rt("transcript",["watch"]);return}let o=Un(t,[e,"watch"],{stdio:"inherit",cwd:b(),env:process.env});o.on("error",r=>{console.error(w.default.red(`Failed to start transcript watcher: ${r.message}`)),process.exit(1)}),o.on("close",r=>{process.exit(r??0)})}var w,ie=C(()=>{"use strict";w=ue(pe(),1);Jr();ce()});var E=ue(pe(),1);ce();var $e=process.argv.slice(2),Yr=$e[0]?.toLowerCase()??"";function ra(){let t=Oe();console.log(`
|
|
370
|
+
${E.default.bold("claude-mem")} v${t} \u2014 persistent memory for AI coding assistants
|
|
371
|
+
|
|
372
|
+
${E.default.bold("Install Commands")} (no Bun required):
|
|
373
|
+
${E.default.cyan("npx claude-mem")} Interactive install
|
|
374
|
+
${E.default.cyan("npx claude-mem install")} Interactive install
|
|
375
|
+
${E.default.cyan("npx claude-mem install --ide <id>")} Install for specific IDE
|
|
376
|
+
${E.default.cyan("npx claude-mem update")} Update to latest version
|
|
377
|
+
${E.default.cyan("npx claude-mem uninstall")} Remove plugin and configs
|
|
378
|
+
${E.default.cyan("npx claude-mem version")} Print version
|
|
379
|
+
|
|
380
|
+
${E.default.bold("Runtime Commands")} (requires Bun, delegates to installed plugin):
|
|
381
|
+
${E.default.cyan("npx claude-mem start")} Start worker service
|
|
382
|
+
${E.default.cyan("npx claude-mem stop")} Stop worker service
|
|
383
|
+
${E.default.cyan("npx claude-mem restart")} Restart worker service
|
|
384
|
+
${E.default.cyan("npx claude-mem status")} Show worker status
|
|
385
|
+
${E.default.cyan("npx claude-mem search <query>")} Search observations
|
|
386
|
+
${E.default.cyan("npx claude-mem adopt [--dry-run] [--branch <name>]")} Stamp merged worktrees into parent project
|
|
387
|
+
${E.default.cyan("npx claude-mem transcript watch")} Start transcript watcher
|
|
388
|
+
|
|
389
|
+
${E.default.bold("IDE Identifiers")}:
|
|
389
390
|
claude-code, cursor, gemini-cli, opencode, openclaw,
|
|
390
391
|
windsurf, codex-cli, copilot-cli, antigravity, goose,
|
|
391
392
|
crush, roo-code, warp
|
|
392
|
-
`)}async function
|
|
393
|
+
`)}async function sa(){switch(Yr){case"":{let{runInstallCommand:t}=await Promise.resolve().then(()=>(Gt(),Ut));await t();break}case"install":{let t=$e.indexOf("--ide"),e=t!==-1?$e[t+1]:void 0,{runInstallCommand:o}=await Promise.resolve().then(()=>(Gt(),Ut));await o({ide:e});break}case"update":case"upgrade":{let{runInstallCommand:t}=await Promise.resolve().then(()=>(Gt(),Ut));await t();break}case"uninstall":case"remove":{let{runUninstallCommand:t}=await Promise.resolve().then(()=>(Wr(),Gr));await t();break}case"version":case"--version":case"-v":{console.log(Oe());break}case"help":case"--help":case"-h":{ra();break}case"start":{let{runStartCommand:t}=await Promise.resolve().then(()=>(ie(),se));t();break}case"stop":{let{runStopCommand:t}=await Promise.resolve().then(()=>(ie(),se));t();break}case"restart":{let{runRestartCommand:t}=await Promise.resolve().then(()=>(ie(),se));t();break}case"status":{let{runStatusCommand:t}=await Promise.resolve().then(()=>(ie(),se));t();break}case"search":{let{runSearchCommand:t}=await Promise.resolve().then(()=>(ie(),se));await t($e.slice(1));break}case"adopt":{let{runAdoptCommand:t}=await Promise.resolve().then(()=>(ie(),se));t($e.slice(1));break}case"transcript":{let t=$e[1]?.toLowerCase();if(t==="watch"){let{runTranscriptWatchCommand:e}=await Promise.resolve().then(()=>(ie(),se));e()}else console.error(E.default.red(`Unknown transcript subcommand: ${t??"(none)"}`)),console.error("Usage: npx claude-mem transcript watch"),process.exit(1);break}default:console.error(E.default.red(`Unknown command: ${Yr}`)),console.error(`Run ${E.default.bold("npx claude-mem --help")} for usage information.`),process.exit(1)}}sa().catch(t=>{console.error(E.default.red("Fatal error:"),t.message||t),process.exit(1)});
|