@truenine/memory-sync-cli 0.0.1 → 0.0.4
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/README.md +59 -42
- package/dist/index.mjs +152 -20
- package/package.json +6 -6
- package/dist/chunk-YV1pC1vC.mjs +0 -1
- package/dist/dist-Dmqu6eEt.mjs +0 -99
- package/dist/frontMatter-Xmvgjkyh.mjs +0 -6
- package/dist/log-ck-k4XJ5.mjs +0 -1
- package/dist/logger-CST5WaQ3.mjs +0 -1
- package/dist/picocolors-cXP5_ufZ.mjs +0 -1
- package/dist/plugins.config-BWHDEGjS.mjs +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truenine/memory-sync-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"description": "TrueNine Life CLI Tools",
|
|
6
6
|
"author": "TrueNine",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -45,18 +45,18 @@
|
|
|
45
45
|
"yaml": "^2.8.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@truenine/eslint9-config": "^1.0.
|
|
48
|
+
"@truenine/eslint9-config": "^1.0.20",
|
|
49
49
|
"@types/fs-extra": "^11.0.4",
|
|
50
50
|
"@types/mdast": "^4.0.4",
|
|
51
|
-
"@types/node": "^25.0.
|
|
51
|
+
"@types/node": "^25.0.2",
|
|
52
52
|
"@types/picomatch": "^4.0.2",
|
|
53
53
|
"@vitest/coverage-v8": "4.0.15",
|
|
54
|
-
"eslint": "^9.39.
|
|
54
|
+
"eslint": "^9.39.2",
|
|
55
55
|
"fast-check": "^4.4.0",
|
|
56
|
-
"tsdown": "0.
|
|
56
|
+
"tsdown": "0.18.0",
|
|
57
57
|
"tsx": "^4.21.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
|
-
"vite": "^7.
|
|
59
|
+
"vite": "^7.3.0",
|
|
60
60
|
"vitest": "^4.0.15"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
package/dist/chunk-YV1pC1vC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=e=>t=>l(t.default,e),d=e(import.meta.url);export{l as i,d as n,u as r,s as t};
|
package/dist/dist-Dmqu6eEt.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./chunk-YV1pC1vC.mjs";import{t as n}from"./picocolors-cXP5_ufZ.mjs";import r,{stdin as i,stdout as a}from"node:process";import{stripVTControlCharacters as o}from"node:util";import*as s from"node:readline";import c from"node:readline";import{Writable as l}from"node:stream";var u=t(((e,t)=>{let n={to(e,t){return t?`[${t+1};${e+1}H`:`[${e+1}G`},move(e,t){let n=``;return e<0?n+=`[${-e}D`:e>0&&(n+=`[${e}C`),t<0?n+=`[${-t}A`:t>0&&(n+=`[${t}B`),n},up:(e=1)=>`[${e}A`,down:(e=1)=>`[${e}B`,forward:(e=1)=>`[${e}C`,backward:(e=1)=>`[${e}D`,nextLine:(e=1)=>`\x1B[E`.repeat(e),prevLine:(e=1)=>`\x1B[F`.repeat(e),left:`\x1B[G`,hide:`\x1B[?25l`,show:`\x1B[?25h`,save:`\x1B7`,restore:`\x1B8`};t.exports={cursor:n,scroll:{up:(e=1)=>`\x1B[S`.repeat(e),down:(e=1)=>`\x1B[T`.repeat(e)},erase:{screen:`\x1B[2J`,up:(e=1)=>`\x1B[1J`.repeat(e),down:(e=1)=>`\x1B[J`.repeat(e),line:`\x1B[2K`,lineEnd:`\x1B[K`,lineStart:`\x1B[1K`,lines(e){let t=``;for(let r=0;r<e;r++)t+=this.line+(r<e-1?n.up():``);return e&&(t+=n.left),t}},beep:`\x07`}})),d=u(),f=e(n(),1);function ee({onlyFirst:e=!1}={}){let t=[`[\\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(t,e?void 0:`g`)}const p=ee();function m(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(p,``)}function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var g={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(e){var t=e.charCodeAt(0),n=e.length==2?e.charCodeAt(1):0,r=t;return 55296<=t&&t<=56319&&56320<=n&&n<=57343&&(t&=1023,n&=1023,r=t<<10|n,r+=65536),r==12288||65281<=r&&r<=65376||65504<=r&&r<=65510?`F`:r==8361||65377<=r&&r<=65470||65474<=r&&r<=65479||65482<=r&&r<=65487||65490<=r&&r<=65495||65498<=r&&r<=65500||65512<=r&&r<=65518?`H`:4352<=r&&r<=4447||4515<=r&&r<=4519||4602<=r&&r<=4607||9001<=r&&r<=9002||11904<=r&&r<=11929||11931<=r&&r<=12019||12032<=r&&r<=12245||12272<=r&&r<=12283||12289<=r&&r<=12350||12353<=r&&r<=12438||12441<=r&&r<=12543||12549<=r&&r<=12589||12593<=r&&r<=12686||12688<=r&&r<=12730||12736<=r&&r<=12771||12784<=r&&r<=12830||12832<=r&&r<=12871||12880<=r&&r<=13054||13056<=r&&r<=19903||19968<=r&&r<=42124||42128<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||55216<=r&&r<=55238||55243<=r&&r<=55291||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65106||65108<=r&&r<=65126||65128<=r&&r<=65131||110592<=r&&r<=110593||127488<=r&&r<=127490||127504<=r&&r<=127546||127552<=r&&r<=127560||127568<=r&&r<=127569||131072<=r&&r<=194367||177984<=r&&r<=196605||196608<=r&&r<=262141?`W`:32<=r&&r<=126||162<=r&&r<=163||165<=r&&r<=166||r==172||r==175||10214<=r&&r<=10221||10629<=r&&r<=10630?`Na`:r==161||r==164||167<=r&&r<=168||r==170||173<=r&&r<=174||176<=r&&r<=180||182<=r&&r<=186||188<=r&&r<=191||r==198||r==208||215<=r&&r<=216||222<=r&&r<=225||r==230||232<=r&&r<=234||236<=r&&r<=237||r==240||242<=r&&r<=243||247<=r&&r<=250||r==252||r==254||r==257||r==273||r==275||r==283||294<=r&&r<=295||r==299||305<=r&&r<=307||r==312||319<=r&&r<=322||r==324||328<=r&&r<=331||r==333||338<=r&&r<=339||358<=r&&r<=359||r==363||r==462||r==464||r==466||r==468||r==470||r==472||r==474||r==476||r==593||r==609||r==708||r==711||713<=r&&r<=715||r==717||r==720||728<=r&&r<=731||r==733||r==735||768<=r&&r<=879||913<=r&&r<=929||931<=r&&r<=937||945<=r&&r<=961||963<=r&&r<=969||r==1025||1040<=r&&r<=1103||r==1105||r==8208||8211<=r&&r<=8214||8216<=r&&r<=8217||8220<=r&&r<=8221||8224<=r&&r<=8226||8228<=r&&r<=8231||r==8240||8242<=r&&r<=8243||r==8245||r==8251||r==8254||r==8308||r==8319||8321<=r&&r<=8324||r==8364||r==8451||r==8453||r==8457||r==8467||r==8470||8481<=r&&r<=8482||r==8486||r==8491||8531<=r&&r<=8532||8539<=r&&r<=8542||8544<=r&&r<=8555||8560<=r&&r<=8569||r==8585||8592<=r&&r<=8601||8632<=r&&r<=8633||r==8658||r==8660||r==8679||r==8704||8706<=r&&r<=8707||8711<=r&&r<=8712||r==8715||r==8719||r==8721||r==8725||r==8730||8733<=r&&r<=8736||r==8739||r==8741||8743<=r&&r<=8748||r==8750||8756<=r&&r<=8759||8764<=r&&r<=8765||r==8776||r==8780||r==8786||8800<=r&&r<=8801||8804<=r&&r<=8807||8810<=r&&r<=8811||8814<=r&&r<=8815||8834<=r&&r<=8835||8838<=r&&r<=8839||r==8853||r==8857||r==8869||r==8895||r==8978||9312<=r&&r<=9449||9451<=r&&r<=9547||9552<=r&&r<=9587||9600<=r&&r<=9615||9618<=r&&r<=9621||9632<=r&&r<=9633||9635<=r&&r<=9641||9650<=r&&r<=9651||9654<=r&&r<=9655||9660<=r&&r<=9661||9664<=r&&r<=9665||9670<=r&&r<=9672||r==9675||9678<=r&&r<=9681||9698<=r&&r<=9701||r==9711||9733<=r&&r<=9734||r==9737||9742<=r&&r<=9743||9748<=r&&r<=9749||r==9756||r==9758||r==9792||r==9794||9824<=r&&r<=9825||9827<=r&&r<=9829||9831<=r&&r<=9834||9836<=r&&r<=9837||r==9839||9886<=r&&r<=9887||9918<=r&&r<=9919||9924<=r&&r<=9933||9935<=r&&r<=9953||r==9955||9960<=r&&r<=9983||r==10045||r==10071||10102<=r&&r<=10111||11093<=r&&r<=11097||12872<=r&&r<=12879||57344<=r&&r<=63743||65024<=r&&r<=65039||r==65533||127232<=r&&r<=127242||127248<=r&&r<=127277||127280<=r&&r<=127337||127344<=r&&r<=127386||917760<=r&&r<=917999||983040<=r&&r<=1048573||1048576<=r&&r<=1114109?`A`:`N`},t.characterLength=function(e){var t=this.eastAsianWidth(e);return t==`F`||t==`W`||t==`A`?2:1};function n(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(e){for(var t=n(e),r=0,i=0;i<t.length;i++)r+=this.characterLength(t[i]);return r},t.slice=function(e,r,i){textLen=t.length(e),r||=0,i||=1,r<0&&(r=textLen+r),i<0&&(i=textLen+i);for(var a=``,o=0,s=n(e),c=0;c<s.length;c++){var l=s[c],u=t.length(l);if(o>=r-(u==2?1:0))if(o+u<=i)a+=l;else break;o+=u}return a}})(g);var _=g.exports;const v=h(_),te=h(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});function y(e,t={}){if(typeof e!=`string`||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=m(e),e.length===0))return 0;e=e.replace(te(),` `);let n=t.ambiguousIsNarrow?1:2,r=0;for(let t of e){let e=t.codePointAt(0);if(!(e<=31||e>=127&&e<=159||e>=768&&e<=879))switch(v.eastAsianWidth(t)){case`F`:case`W`:r+=2;break;case`A`:r+=n;break;default:r+=1}}return r}const ne=(e=0)=>t=>`\x1B[${t+e}m`,re=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,ie=(e=0)=>(t,n,r)=>`\x1B[${38+e};2;${t};${n};${r}m`,b={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(b.modifier);const ae=Object.keys(b.color),oe=Object.keys(b.bgColor);[...ae,...oe];function se(){let e=new Map;for(let[t,n]of Object.entries(b)){for(let[t,r]of Object.entries(n))b[t]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[t]=b[t],e.set(r[0],r[1]);Object.defineProperty(b,t,{value:n,enumerable:!1})}return Object.defineProperty(b,`codes`,{value:e,enumerable:!1}),b.color.close=`\x1B[39m`,b.bgColor.close=`\x1B[49m`,b.color.ansi=ne(),b.color.ansi256=re(),b.color.ansi16m=ie(),b.bgColor.ansi=ne(10),b.bgColor.ansi256=re(10),b.bgColor.ansi16m=ie(10),Object.defineProperties(b,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(e=>e+e).join(``));let r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:e=>b.rgbToAnsi256(...b.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,r;if(e>=232)t=((e-232)*10+8)/255,n=t,r=t;else{e-=16;let i=e%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}let i=Math.max(t,n,r)*2;if(i===0)return 30;let a=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return i===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>b.ansi256ToAnsi(b.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>b.ansi256ToAnsi(b.hexToAnsi256(e)),enumerable:!1}}),b}const ce=se(),x=new Set([`\x1B`,``]),S=`]8;;`,C=e=>`${x.values().next().value}[${e}m`,le=e=>`${x.values().next().value}${S}${e}`,ue=e=>e.split(` `).map(e=>y(e)),w=(e,t,n)=>{let r=[...t],i=!1,a=!1,o=y(m(e[e.length-1]));for(let[t,s]of r.entries()){let c=y(s);if(o+c<=n?e[e.length-1]+=s:(e.push(s),o=0),x.has(s)&&(i=!0,a=r.slice(t+1).join(``).startsWith(S)),i){a?s===`\x07`&&(i=!1,a=!1):s===`m`&&(i=!1);continue}o+=c,o===n&&t<r.length-1&&(e.push(``),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},de=e=>{let t=e.split(` `),n=t.length;for(;n>0&&!(y(t[n-1])>0);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},fe=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=ue(e),s=[``];for(let[r,i]of e.split(` `).entries()){n.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let e=y(s[s.length-1]);if(r!==0&&(e>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),e=0),(e>0||n.trim===!1)&&(s[s.length-1]+=` `,e++)),n.hard&&o[r]>t){let n=t-e,a=1+Math.floor((o[r]-n-1)/t);Math.floor((o[r]-1)/t)<a&&s.push(``),w(s,i,t);continue}if(e+o[r]>t&&e>0&&o[r]>0){if(n.wordWrap===!1&&e<t){w(s,i,t);continue}s.push(``)}if(e+o[r]>t&&n.wordWrap===!1){w(s,i,t);continue}s[s.length-1]+=i}n.trim!==!1&&(s=s.map(e=>de(e)));let c=[...s.join(`
|
|
2
|
-
`)];for(let[e,t]of c.entries()){if(r+=t,x.has(t)){let{groups:t}=RegExp(`(?:\\[(?<code>\\d+)m|\\${S}(?<uri>.*))`).exec(c.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}let n=ce.codes.get(Number(i));c[e+1]===`
|
|
3
|
-
`?(a&&(r+=le(``)),i&&n&&(r+=C(n))):t===`
|
|
4
|
-
`&&(i&&n&&(r+=C(i)),a&&(r+=le(a)))}return r};function pe(e,t,n){return String(e).normalize().replace(/\r\n/g,`
|
|
5
|
-
`).split(`
|
|
6
|
-
`).map(e=>fe(e,t,n)).join(`
|
|
7
|
-
`)}const T={actions:new Set([`up`,`down`,`left`,`right`,`space`,`enter`,`cancel`]),aliases:new Map([[`k`,`up`],[`j`,`down`],[`h`,`left`],[`l`,`right`],[``,`cancel`],[`escape`,`cancel`]])};function me(e){for(let t in e){let n=t;if(!Object.hasOwn(e,n))continue;let r=e[n];switch(n){case`aliases`:for(let e in r)Object.hasOwn(r,e)&&(T.aliases.has(e)||T.aliases.set(e,r[e]));break}}}function E(e,t){if(typeof e==`string`)return T.aliases.get(e)===t;for(let n of e)if(n!==void 0&&E(n,t))return!0;return!1}function he(e,t){if(e===t)return;let n=e.split(`
|
|
8
|
-
`),r=t.split(`
|
|
9
|
-
`),i=[];for(let e=0;e<Math.max(n.length,r.length);e++)n[e]!==r[e]&&i.push(e);return i}const ge=globalThis.process.platform.startsWith(`win`),D=Symbol(`clack:cancel`);function _e(e){return e===D}function O(e,t){let n=e;n.isTTY&&n.setRawMode(t)}function ve({input:e=i,output:t=a,overwrite:n=!0,hideCursor:r=!0}={}){let o=s.createInterface({input:e,output:t,prompt:``,tabSize:1});s.emitKeypressEvents(e,o),e.isTTY&&e.setRawMode(!0);let c=(i,{name:a,sequence:o})=>{if(E([String(i),a,o],`cancel`)){r&&t.write(d.cursor.show),process.exit(0);return}if(!n)return;let l=a===`return`?0:-1,u=a===`return`?-1:0;s.moveCursor(t,l,u,()=>{s.clearLine(t,1,()=>{e.once(`keypress`,c)})})};return r&&t.write(d.cursor.hide),e.once(`keypress`,c),()=>{e.off(`keypress`,c),r&&t.write(d.cursor.show),e.isTTY&&!ge&&e.setRawMode(!1),o.terminal=!1,o.close()}}var ye=Object.defineProperty,be=(e,t,n)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t,n)=>(be(e,typeof t==`symbol`?t:t+``,n),n),A=class{constructor(e,t=!0){k(this,`input`),k(this,`output`),k(this,`_abortSignal`),k(this,`rl`),k(this,`opts`),k(this,`_render`),k(this,`_track`,!1),k(this,`_prevFrame`,``),k(this,`_subscribers`,new Map),k(this,`_cursor`,0),k(this,`state`,`initial`),k(this,`error`,``),k(this,`value`);let{input:n=i,output:r=a,render:o,signal:s,...c}=e;this.opts=c,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=s,this.input=n,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let n=this._subscribers.get(e)??[];n.push(t),this._subscribers.set(e,n)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let n=this._subscribers.get(e)??[],r=[];for(let e of n)e.cb(...t),e.once&&r.push(()=>n.splice(n.indexOf(e),1));for(let e of r)e()}prompt(){return new Promise((e,t)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state=`cancel`,this.close(),e(D);this._abortSignal.addEventListener(`abort`,()=>{this.state=`cancel`,this.close()},{once:!0})}let n=new l;n._write=(e,t,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(n),this.rl=c.createInterface({input:this.input,output:n,tabSize:2,prompt:``,escapeCodeTimeout:50,terminal:!0}),c.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),O(this.input,!0),this.output.on(`resize`,this.render),this.render(),this.once(`submit`,()=>{this.output.write(d.cursor.show),this.output.off(`resize`,this.render),O(this.input,!1),e(this.value)}),this.once(`cancel`,()=>{this.output.write(d.cursor.show),this.output.off(`resize`,this.render),O(this.input,!1),e(D)})})}onKeypress(e,t){if(this.state===`error`&&(this.state=`active`),t?.name&&(!this._track&&T.aliases.has(t.name)&&this.emit(`cursor`,T.aliases.get(t.name)),T.actions.has(t.name)&&this.emit(`cursor`,t.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()),t?.name===`return`){if(this.opts.validate){let e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state=`error`,this.rl?.write(this.value))}this.state!==`error`&&(this.state=`submit`)}E([e,t?.name,t?.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(`
|
|
10
|
-
`),O(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=pe(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
11
|
-
`).length-1;this.output.write(d.cursor.move(-999,e*-1))}render(){let e=pe(this._render(this)??``,process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state===`initial`)this.output.write(d.cursor.hide);else{let t=he(this._prevFrame,e);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(d.cursor.move(0,n)),this.output.write(d.erase.lines(1));let r=e.split(`
|
|
12
|
-
`);this.output.write(r[n]),this._prevFrame=e,this.output.write(d.cursor.move(0,r.length-n-1));return}if(t&&t?.length>1){let n=t[0];this.output.write(d.cursor.move(0,n)),this.output.write(d.erase.down());let r=e.split(`
|
|
13
|
-
`).slice(n);this.output.write(r.join(`
|
|
14
|
-
`)),this._prevFrame=e;return}this.output.write(d.erase.down())}this.output.write(e),this.state===`initial`&&(this.state=`active`),this._prevFrame=e}}},xe=class extends A{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`,e=>{this.output.write(d.cursor.move(0,-1)),this.value=e,this.state=`submit`,this.close()}),this.on(`cursor`,()=>{this.value=!this.value})}},Se=Object.defineProperty,Ce=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t,n)=>(Ce(e,typeof t==`symbol`?t:t+``,n),n),M=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},N=(e,t,n)=>(M(e,t,`read from private field`),n?n.call(e):t.get(e)),we=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Te=(e,t,n,r)=>(M(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),P;let Ee=class extends A{constructor(e){super(e,!1),j(this,`options`),j(this,`cursor`,0),we(this,P,void 0);let{options:t}=e;Te(this,P,e.selectableGroups!==!1),this.options=Object.entries(t).flatMap(([e,t])=>[{value:e,group:!0,label:e},...t.map(t=>({...t,group:e}))]),this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.cursorAt),N(this,P)?0:1),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let e=this.options[this.cursor]?.group===!0;!N(this,P)&&e&&(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;let e=this.options[this.cursor]?.group===!0;!N(this,P)&&e&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case`space`:this.toggleValue();break}})}getGroupItems(e){return this.options.filter(t=>t.group===e)}isGroupSelected(e){return this.getGroupItems(e).every(e=>this.value.includes(e.value))}toggleValue(){let e=this.options[this.cursor];if(e.group===!0){let t=e.value,n=this.getGroupItems(t);this.isGroupSelected(t)?this.value=this.value.filter(e=>n.findIndex(t=>t.value===e)===-1):this.value=[...this.value,...n.map(e=>e.value)],this.value=Array.from(new Set(this.value))}else this.value=this.value.includes(e.value)?this.value.filter(t=>t!==e.value):[...this.value,e.value]}};P=new WeakMap;var De=Object.defineProperty,Oe=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,F=(e,t,n)=>(Oe(e,typeof t==`symbol`?t:t+``,n),n);let ke=class extends A{constructor(e){super(e,!1),F(this,`options`),F(this,`cursor`,0),this.options=e.options,this.value=[...e.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:t})=>t===e.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(){this.value=this.value.length===this.options.length?[]:this.options.map(e=>e.value)}toggleValue(){this.value=this.value.includes(this._value)?this.value.filter(e=>e!==this._value):[...this.value,this._value]}};var Ae=Object.defineProperty,je=(e,t,n)=>t in e?Ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,I=(e,t,n)=>(je(e,typeof t==`symbol`?t:t+``,n),n),Me=class extends A{constructor({mask:e,...t}){super(t),I(this,`valueWithCursor`,``),I(this,`_mask`,`•`),this._mask=e??`•`,this.on(`finalize`,()=>{this.valueWithCursor=this.masked}),this.on(`value`,()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${f.default.inverse(f.default.hidden(`_`))}`;else{let e=this.masked.slice(0,this.cursor),t=this.masked.slice(this.cursor);this.valueWithCursor=`${e}${f.default.inverse(t[0])}${t.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},Ne=Object.defineProperty,Pe=(e,t,n)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t,n)=>(Pe(e,typeof t==`symbol`?t:t+``,n),n),Fe=class extends A{constructor(e){super(e,!1),L(this,`options`),L(this,`cursor`,0),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),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}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}},Ie=Object.defineProperty,Le=(e,t,n)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R=(e,t,n)=>(Le(e,typeof t==`symbol`?t:t+``,n),n),Re=class extends A{constructor(e){super(e,!1),R(this,`options`),R(this,`cursor`,0),this.options=e.options;let t=this.options.map(({value:[e]})=>e?.toLowerCase());this.cursor=Math.max(t.indexOf(e.initialValue),0),this.on(`key`,e=>{if(!t.includes(e))return;let n=this.options.find(({value:[t]})=>t?.toLowerCase()===e);n&&(this.value=n.value,this.state=`submit`,this.emit(`submit`))})}},ze=class extends A{get valueWithCursor(){if(this.state===`submit`)return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[t,...n]=this.value.slice(this.cursor);return`${e}${f.default.inverse(t)}${n.join(``)}`}get cursor(){return this._cursor}constructor(e){super(e),this.on(`finalize`,()=>{this.value||=e.defaultValue})}},z=e(n(),1),B=u();function Be(){return r.platform===`win32`?!!r.env.CI||!!r.env.WT_SESSION||!!r.env.TERMINUS_SUBLIME||r.env.ConEmuTask===`{cmd::Cmder}`||r.env.TERM_PROGRAM===`Terminus-Sublime`||r.env.TERM_PROGRAM===`vscode`||r.env.TERM===`xterm-256color`||r.env.TERM===`alacritty`||r.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:r.env.TERM!==`linux`}const V=Be(),H=(e,t)=>V?e:t,Ve=H(`◆`,`*`),He=H(`■`,`x`),Ue=H(`▲`,`x`),U=H(`◇`,`o`),We=H(`┌`,`T`),W=H(`│`,`|`),G=H(`└`,`—`),K=H(`●`,`>`),q=H(`○`,` `),J=H(`◻`,`[•]`),Y=H(`◼`,`[+]`),Ge=H(`◻`,`[ ]`),Ke=H(`▪`,`•`),qe=H(`─`,`-`),Je=H(`╮`,`+`),Ye=H(`├`,`+`),Xe=H(`╯`,`+`),Ze=H(`●`,`•`),Qe=H(`◆`,`*`),$e=H(`▲`,`!`),et=H(`■`,`x`),X=e=>{switch(e){case`initial`:case`active`:return z.default.cyan(Ve);case`cancel`:return z.default.red(He);case`error`:return z.default.yellow(Ue);case`submit`:return z.default.green(U)}},Z=e=>{let{cursor:t,options:n,style:r}=e,i=e.maxItems??1/0,a=Math.max(process.stdout.rows-4,0),o=Math.min(a,Math.max(i,5)),s=0;t>=s+o-3?s=Math.max(Math.min(t-o+3,n.length-o),0):t<s+2&&(s=Math.max(t-2,0));let c=o<n.length&&s>0,l=o<n.length&&s+o<n.length;return n.slice(s,s+o).map((e,n,i)=>{let a=n===0&&c,o=n===i.length-1&&l;return a||o?z.default.dim(`...`):r(e,n+s===t)})},tt=e=>new ze({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,render(){let t=`${z.default.gray(W)}
|
|
15
|
-
${X(this.state)} ${e.message}
|
|
16
|
-
`,n=e.placeholder?z.default.inverse(e.placeholder[0])+z.default.dim(e.placeholder.slice(1)):z.default.inverse(z.default.hidden(`_`)),r=this.value?this.valueWithCursor:n;switch(this.state){case`error`:return`${t.trim()}
|
|
17
|
-
${z.default.yellow(W)} ${r}
|
|
18
|
-
${z.default.yellow(G)} ${z.default.yellow(this.error)}
|
|
19
|
-
`;case`submit`:return`${t}${z.default.gray(W)} ${z.default.dim(this.value||e.placeholder)}`;case`cancel`:return`${t}${z.default.gray(W)} ${z.default.strikethrough(z.default.dim(this.value??``))}${this.value?.trim()?`
|
|
20
|
-
${z.default.gray(W)}`:``}`;default:return`${t}${z.default.cyan(W)} ${r}
|
|
21
|
-
${z.default.cyan(G)}
|
|
22
|
-
`}}}).prompt(),nt=e=>new Me({validate:e.validate,mask:e.mask??Ke,render(){let t=`${z.default.gray(W)}
|
|
23
|
-
${X(this.state)} ${e.message}
|
|
24
|
-
`,n=this.valueWithCursor,r=this.masked;switch(this.state){case`error`:return`${t.trim()}
|
|
25
|
-
${z.default.yellow(W)} ${r}
|
|
26
|
-
${z.default.yellow(G)} ${z.default.yellow(this.error)}
|
|
27
|
-
`;case`submit`:return`${t}${z.default.gray(W)} ${z.default.dim(r)}`;case`cancel`:return`${t}${z.default.gray(W)} ${z.default.strikethrough(z.default.dim(r??``))}${r?`
|
|
28
|
-
${z.default.gray(W)}`:``}`;default:return`${t}${z.default.cyan(W)} ${n}
|
|
29
|
-
${z.default.cyan(G)}
|
|
30
|
-
`}}}).prompt(),rt=e=>{let t=e.active??`Yes`,n=e.inactive??`No`;return new xe({active:t,inactive:n,initialValue:e.initialValue??!0,render(){let r=`${z.default.gray(W)}
|
|
31
|
-
${X(this.state)} ${e.message}
|
|
32
|
-
`,i=this.value?t:n;switch(this.state){case`submit`:return`${r}${z.default.gray(W)} ${z.default.dim(i)}`;case`cancel`:return`${r}${z.default.gray(W)} ${z.default.strikethrough(z.default.dim(i))}
|
|
33
|
-
${z.default.gray(W)}`;default:return`${r}${z.default.cyan(W)} ${this.value?`${z.default.green(K)} ${t}`:`${z.default.dim(q)} ${z.default.dim(t)}`} ${z.default.dim(`/`)} ${this.value?`${z.default.dim(q)} ${z.default.dim(n)}`:`${z.default.green(K)} ${n}`}
|
|
34
|
-
${z.default.cyan(G)}
|
|
35
|
-
`}}}).prompt()},it=e=>{let t=(e,t)=>{let n=e.label??String(e.value);switch(t){case`selected`:return`${z.default.dim(n)}`;case`active`:return`${z.default.green(K)} ${n} ${e.hint?z.default.dim(`(${e.hint})`):``}`;case`cancelled`:return`${z.default.strikethrough(z.default.dim(n))}`;default:return`${z.default.dim(q)} ${z.default.dim(n)}`}};return new Fe({options:e.options,initialValue:e.initialValue,render(){let n=`${z.default.gray(W)}
|
|
36
|
-
${X(this.state)} ${e.message}
|
|
37
|
-
`;switch(this.state){case`submit`:return`${n}${z.default.gray(W)} ${t(this.options[this.cursor],`selected`)}`;case`cancel`:return`${n}${z.default.gray(W)} ${t(this.options[this.cursor],`cancelled`)}
|
|
38
|
-
${z.default.gray(W)}`;default:return`${n}${z.default.cyan(W)} ${Z({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(e,n)=>t(e,n?`active`:`inactive`)}).join(`
|
|
39
|
-
${z.default.cyan(W)} `)}
|
|
40
|
-
${z.default.cyan(G)}
|
|
41
|
-
`}}}).prompt()},at=e=>{let t=(e,t=`inactive`)=>{let n=e.label??String(e.value);return t===`selected`?`${z.default.dim(n)}`:t===`cancelled`?`${z.default.strikethrough(z.default.dim(n))}`:t===`active`?`${z.default.bgCyan(z.default.gray(` ${e.value} `))} ${n} ${e.hint?z.default.dim(`(${e.hint})`):``}`:`${z.default.gray(z.default.bgWhite(z.default.inverse(` ${e.value} `)))} ${n} ${e.hint?z.default.dim(`(${e.hint})`):``}`};return new Re({options:e.options,initialValue:e.initialValue,render(){let n=`${z.default.gray(W)}
|
|
42
|
-
${X(this.state)} ${e.message}
|
|
43
|
-
`;switch(this.state){case`submit`:return`${n}${z.default.gray(W)} ${t(this.options.find(e=>e.value===this.value)??e.options[0],`selected`)}`;case`cancel`:return`${n}${z.default.gray(W)} ${t(this.options[0],`cancelled`)}
|
|
44
|
-
${z.default.gray(W)}`;default:return`${n}${z.default.cyan(W)} ${this.options.map((e,n)=>t(e,n===this.cursor?`active`:`inactive`)).join(`
|
|
45
|
-
${z.default.cyan(W)} `)}
|
|
46
|
-
${z.default.cyan(G)}
|
|
47
|
-
`}}}).prompt()},ot=e=>{let t=(e,t)=>{let n=e.label??String(e.value);return t===`active`?`${z.default.cyan(J)} ${n} ${e.hint?z.default.dim(`(${e.hint})`):``}`:t===`selected`?`${z.default.green(Y)} ${z.default.dim(n)} ${e.hint?z.default.dim(`(${e.hint})`):``}`:t===`cancelled`?`${z.default.strikethrough(z.default.dim(n))}`:t===`active-selected`?`${z.default.green(Y)} ${n} ${e.hint?z.default.dim(`(${e.hint})`):``}`:t===`submitted`?`${z.default.dim(n)}`:`${z.default.dim(Ge)} ${z.default.dim(n)}`};return new ke({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
48
|
-
${z.default.reset(z.default.dim(`Press ${z.default.gray(z.default.bgWhite(z.default.inverse(` space `)))} to select, ${z.default.gray(z.default.bgWhite(z.default.inverse(` enter `)))} to submit`))}`},render(){let n=`${z.default.gray(W)}
|
|
49
|
-
${X(this.state)} ${e.message}
|
|
50
|
-
`,r=(e,n)=>{let r=this.value.includes(e.value);return n&&r?t(e,`active-selected`):r?t(e,`selected`):t(e,n?`active`:`inactive`)};switch(this.state){case`submit`:return`${n}${z.default.gray(W)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`submitted`)).join(z.default.dim(`, `))||z.default.dim(`none`)}`;case`cancel`:{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>t(e,`cancelled`)).join(z.default.dim(`, `));return`${n}${z.default.gray(W)} ${e.trim()?`${e}
|
|
51
|
-
${z.default.gray(W)}`:``}`}case`error`:{let t=this.error.split(`
|
|
52
|
-
`).map((e,t)=>t===0?`${z.default.yellow(G)} ${z.default.yellow(e)}`:` ${e}`).join(`
|
|
53
|
-
`);return`${n+z.default.yellow(W)} ${Z({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
54
|
-
${z.default.yellow(W)} `)}
|
|
55
|
-
${t}
|
|
56
|
-
`}default:return`${n}${z.default.cyan(W)} ${Z({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:r}).join(`
|
|
57
|
-
${z.default.cyan(W)} `)}
|
|
58
|
-
${z.default.cyan(G)}
|
|
59
|
-
`}}}).prompt()},st=e=>{let{selectableGroups:t=!0}=e,n=(e,n,r=[])=>{let i=e.label??String(e.value),a=typeof e.group==`string`,o=a&&(r[r.indexOf(e)+1]??{group:!0}),s=a&&o.group===!0,c=a?t?`${s?G:W} `:` `:``;if(n===`active`)return`${z.default.dim(c)}${z.default.cyan(J)} ${i} ${e.hint?z.default.dim(`(${e.hint})`):``}`;if(n===`group-active`)return`${c}${z.default.cyan(J)} ${z.default.dim(i)}`;if(n===`group-active-selected`)return`${c}${z.default.green(Y)} ${z.default.dim(i)}`;if(n===`selected`){let n=a||t?z.default.green(Y):``;return`${z.default.dim(c)}${n} ${z.default.dim(i)} ${e.hint?z.default.dim(`(${e.hint})`):``}`}if(n===`cancelled`)return`${z.default.strikethrough(z.default.dim(i))}`;if(n===`active-selected`)return`${z.default.dim(c)}${z.default.green(Y)} ${i} ${e.hint?z.default.dim(`(${e.hint})`):``}`;if(n===`submitted`)return`${z.default.dim(i)}`;let l=a||t?z.default.dim(Ge):``;return`${z.default.dim(c)}${l} ${z.default.dim(i)}`};return new Ee({options:e.options,initialValues:e.initialValues,required:e.required??!0,cursorAt:e.cursorAt,selectableGroups:t,validate(e){if(this.required&&e.length===0)return`Please select at least one option.
|
|
60
|
-
${z.default.reset(z.default.dim(`Press ${z.default.gray(z.default.bgWhite(z.default.inverse(` space `)))} to select, ${z.default.gray(z.default.bgWhite(z.default.inverse(` enter `)))} to submit`))}`},render(){let t=`${z.default.gray(W)}
|
|
61
|
-
${X(this.state)} ${e.message}
|
|
62
|
-
`;switch(this.state){case`submit`:return`${t}${z.default.gray(W)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>n(e,`submitted`)).join(z.default.dim(`, `))}`;case`cancel`:{let e=this.options.filter(({value:e})=>this.value.includes(e)).map(e=>n(e,`cancelled`)).join(z.default.dim(`, `));return`${t}${z.default.gray(W)} ${e.trim()?`${e}
|
|
63
|
-
${z.default.gray(W)}`:``}`}case`error`:{let e=this.error.split(`
|
|
64
|
-
`).map((e,t)=>t===0?`${z.default.yellow(G)} ${z.default.yellow(e)}`:` ${e}`).join(`
|
|
65
|
-
`);return`${t}${z.default.yellow(W)} ${this.options.map((e,t,r)=>{let i=this.value.includes(e.value)||e.group===!0&&this.isGroupSelected(`${e.value}`),a=t===this.cursor;return!a&&typeof e.group==`string`&&this.options[this.cursor].value===e.group?n(e,i?`group-active-selected`:`group-active`,r):a&&i?n(e,`active-selected`,r):i?n(e,`selected`,r):n(e,a?`active`:`inactive`,r)}).join(`
|
|
66
|
-
${z.default.yellow(W)} `)}
|
|
67
|
-
${e}
|
|
68
|
-
`}default:return`${t}${z.default.cyan(W)} ${this.options.map((e,t,r)=>{let i=this.value.includes(e.value)||e.group===!0&&this.isGroupSelected(`${e.value}`),a=t===this.cursor;return!a&&typeof e.group==`string`&&this.options[this.cursor].value===e.group?n(e,i?`group-active-selected`:`group-active`,r):a&&i?n(e,`active-selected`,r):i?n(e,`selected`,r):n(e,a?`active`:`inactive`,r)}).join(`
|
|
69
|
-
${z.default.cyan(W)} `)}
|
|
70
|
-
${z.default.cyan(G)}
|
|
71
|
-
`}}}).prompt()},ct=(e=``,t=``)=>{let n=`
|
|
72
|
-
${e}
|
|
73
|
-
`.split(`
|
|
74
|
-
`),r=o(t).length,i=Math.max(n.reduce((e,t)=>{let n=o(t);return n.length>e?n.length:e},0),r)+2,a=n.map(e=>`${z.default.gray(W)} ${z.default.dim(e)}${` `.repeat(i-o(e).length)}${z.default.gray(W)}`).join(`
|
|
75
|
-
`);process.stdout.write(`${z.default.gray(W)}
|
|
76
|
-
${z.default.green(U)} ${z.default.reset(t)} ${z.default.gray(qe.repeat(Math.max(i-r-1,1))+Je)}
|
|
77
|
-
${a}
|
|
78
|
-
${z.default.gray(Ye+qe.repeat(i+2)+Xe)}
|
|
79
|
-
`)},lt=(e=``)=>{process.stdout.write(`${z.default.gray(G)} ${z.default.red(e)}
|
|
80
|
-
|
|
81
|
-
`)},ut=(e=``)=>{process.stdout.write(`${z.default.gray(We)} ${e}
|
|
82
|
-
`)},dt=(e=``)=>{process.stdout.write(`${z.default.gray(W)}
|
|
83
|
-
${z.default.gray(G)} ${e}
|
|
84
|
-
|
|
85
|
-
`)},Q={message:(e=``,{symbol:t=z.default.gray(W)}={})=>{let n=[`${z.default.gray(W)}`];if(e){let[r,...i]=e.split(`
|
|
86
|
-
`);n.push(`${t} ${r}`,...i.map(e=>`${z.default.gray(W)} ${e}`))}process.stdout.write(`${n.join(`
|
|
87
|
-
`)}
|
|
88
|
-
`)},info:e=>{Q.message(e,{symbol:z.default.blue(Ze)})},success:e=>{Q.message(e,{symbol:z.default.green(Qe)})},step:e=>{Q.message(e,{symbol:z.default.green(U)})},warn:e=>{Q.message(e,{symbol:z.default.yellow($e)})},warning:e=>{Q.warn(e)},error:e=>{Q.message(e,{symbol:z.default.red(et)})}},ft=`${z.default.gray(W)} `,$={message:async(e,{symbol:t=z.default.gray(W)}={})=>{process.stdout.write(`${z.default.gray(W)}
|
|
89
|
-
${t} `);let n=3;for await(let t of e){t=t.replace(/\n/g,`
|
|
90
|
-
${ft}`),t.includes(`
|
|
91
|
-
`)&&(n=3+o(t.slice(t.lastIndexOf(`
|
|
92
|
-
`))).length);let e=o(t).length;n+e<process.stdout.columns?(n+=e,process.stdout.write(t)):(process.stdout.write(`
|
|
93
|
-
${ft}${t.trimStart()}`),n=3+o(t.trimStart()).length)}process.stdout.write(`
|
|
94
|
-
`)},info:e=>$.message(e,{symbol:z.default.blue(Ze)}),success:e=>$.message(e,{symbol:z.default.green(Qe)}),step:e=>$.message(e,{symbol:z.default.green(U)}),warn:e=>$.message(e,{symbol:z.default.yellow($e)}),warning:e=>$.warn(e),error:e=>$.message(e,{symbol:z.default.red(et)})},pt=({indicator:e=`dots`}={})=>{let t=V?[`◒`,`◐`,`◓`,`◑`]:[`•`,`o`,`O`,`0`],n=V?80:120,r=process.env.CI===`true`,i,a,o=!1,s=``,c,l=performance.now(),u=e=>{o&&v(e>1?`Something went wrong`:`Canceled`,e)},d=()=>u(2),f=()=>u(1),ee=()=>{process.on(`uncaughtExceptionMonitor`,d),process.on(`unhandledRejection`,d),process.on(`SIGINT`,f),process.on(`SIGTERM`,f),process.on(`exit`,u)},p=()=>{process.removeListener(`uncaughtExceptionMonitor`,d),process.removeListener(`unhandledRejection`,d),process.removeListener(`SIGINT`,f),process.removeListener(`SIGTERM`,f),process.removeListener(`exit`,u)},m=()=>{if(c===void 0)return;r&&process.stdout.write(`
|
|
95
|
-
`);let e=c.split(`
|
|
96
|
-
`);process.stdout.write(B.cursor.move(-999,e.length-1)),process.stdout.write(B.erase.down(e.length))},h=e=>e.replace(/\.+$/,``),g=e=>{let t=(performance.now()-e)/1e3,n=Math.floor(t/60),r=Math.floor(t%60);return n>0?`[${n}m ${r}s]`:`[${r}s]`},_=(u=``)=>{o=!0,i=ve(),s=h(u),l=performance.now(),process.stdout.write(`${z.default.gray(W)}
|
|
97
|
-
`);let d=0,f=0;ee(),a=setInterval(()=>{if(r&&s===c)return;m(),c=s;let n=z.default.magenta(t[d]);if(r)process.stdout.write(`${n} ${s}...`);else if(e===`timer`)process.stdout.write(`${n} ${s} ${g(l)}`);else{let e=`.`.repeat(Math.floor(f)).slice(0,3);process.stdout.write(`${n} ${s}${e}`)}d=d+1<t.length?d+1:0,f=f<t.length?f+.125:0},n)},v=(t=``,n=0)=>{o=!1,clearInterval(a),m();let r=n===0?z.default.green(U):n===1?z.default.red(He):z.default.red(Ue);s=h(t??s),e===`timer`?process.stdout.write(`${r} ${s} ${g(l)}
|
|
98
|
-
`):process.stdout.write(`${r} ${s}
|
|
99
|
-
`),p(),i()};return{start:_,stop:v,message:(e=``)=>{s=h(e??s)}}},mt=async(e,t)=>{let n={},r=Object.keys(e);for(let i of r){let r=e[i],a=await r({results:n})?.catch(e=>{throw e});if(typeof t?.onCancel==`function`&&_e(a)){n[i]=`canceled`,t.onCancel({results:n});continue}n[i]=a}return n},ht=async e=>{for(let t of e){if(t.enabled===!1)continue;let e=pt();e.start(t.title);let n=await t.task(e.message);e.stop(n||t.title)}};export{lt as cancel,rt as confirm,mt as group,st as groupMultiselect,ut as intro,_e as isCancel,Q as log,ot as multiselect,ct as note,dt as outro,nt as password,it as select,at as selectKey,pt as spinner,$ as stream,ht as tasks,tt as text,me as updateSettings};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import e from"node:process";import t from"node:os";import n from"node:path";import r from"remark-frontmatter";import i from"remark-gfm";import a from"remark-parse";import o from"remark-stringify";import{unified as s}from"unified";import{parse as c,stringify as l}from"yaml";const u=e.platform===`win32`?t.homedir().replace(/\\/g,`/`):t.homedir(),d=n.join(u,`project`);var f=class e{config;constructor(e){this.config=e}root(){return this.config.root}dist(){return n.join(this.config.root,`dist`)}ref(){return n.join(this.config.root,`ref`)}claude(){return new p(this.config.root)}factory(){return new m(this.config.root)}kiro(){return new h(this.config.root)}qoder(){return new g(this.config.root)}codebuddy(){return new _(this.config.root)}agent(){return new v(this.config.root)}resolve(...e){return n.join(this.config.root,...e)}static forProject(t){return new e({root:n.join(d,t)})}static fromPath(t){return new e({root:t})}},p=class{baseDir;constructor(e){this.baseDir=n.join(e,`.claude`)}root(){return this.baseDir}skills(){return n.join(this.baseDir,`skills`)}commands(){return n.join(this.baseDir,`commands`)}agents(){return n.join(this.baseDir,`agents`)}},m=class{baseDir;constructor(e){this.baseDir=n.join(e,`.factory`)}root(){return this.baseDir}skills(){return n.join(this.baseDir,`skills`)}commands(){return n.join(this.baseDir,`commands`)}},h=class{baseDir;constructor(e){this.baseDir=n.join(e,`.kiro`)}root(){return this.baseDir}steering(){return n.join(this.baseDir,`steering`)}static globalSteering(){return n.join(u,`.kiro`,`steering`)}},g=class{baseDir;constructor(e){this.baseDir=n.join(e,`.qoder`)}root(){return this.baseDir}rules(){return n.join(this.baseDir,`rules`)}},_=class{baseDir;constructor(e){this.baseDir=n.join(e,`.codebuddy`)}root(){return this.baseDir}rules(){return n.join(this.baseDir,`.rules`)}},v=class{baseDir;constructor(e){this.baseDir=n.join(e,`.agent`)}root(){return this.baseDir}rules(){return n.join(this.baseDir,`rules`)}};function y(e){return e.type===`yaml`}function b(e){try{return c(e)}catch{return null}}function x(e){let t=s().use(a).use(r,[`yaml`]).use(i).parse(e).children,n=null,o=null,c=[];for(let e of t)y(e)?(o=e.value,n=b(e.value)):c.push(e);return{frontmatter:n,rawFrontmatter:o,ast:{type:`root`,children:c},content:c}}function S(e){let t=s().use(o).use(r,[`yaml`]).use(i);return String(t.stringify(e))}function C(e,t=[]){let n=[];if(e!=null){let t=l(e).trim();n.push(`---\n${t}\n---\n`)}if(typeof t==`string`)n.push(t);else if(t.length>0){let e={type:`root`,children:t};n.push(S(e))}return n.join(`
|
|
2
|
-
`)}function w(e){return`---
|
|
3
|
-
${l(e).trim()}
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`}function T(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);return t?.[1]==null?null:b(t[1])}function E(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/,``)}let D=function(e){return e.MEMORY_PROMPT=`memoryPrompt`,e.GLOBAL_PROMPT=`globalPrompt`,e.SUB_AGENT=`subAgentAgenticConfig`,e.FAST_COMMAND=`fastCommandAgenticConfig`,e.SKILL=`skillAgenticConfig`,e.CONFIG_FILE=`configFile`,e}({}),O=function(e){return e.KIRO_ALWAYS=`kiro-always`,e.KIRO_FILE_MATCH=`kiro-file-match`,e.QODER_ALWAYS=`qoder-always`,e.QODER_GLOB=`qoder-glob`,e.ANTIGRAVITY_ALWAYS=`antigravity-always`,e.ANTIGRAVITY_GLOB=`antigravity-glob`,e.WORKFLOW_AUTO=`workflow-auto`,e}({});var k=class extends Error{pluginName;hookName;cause;constructor(e,t,n,r){super(e),this.name=`PluginError`,this.pluginName=t,this.hookName=n,this.cause=r}},A=class extends Error{field;constructor(e,t){super(e),this.name=`ValidationError`,this.field=t}};function j(e){return e.charCodeAt(0)===65279?e.slice(1):e}function M(e){let t=j(e),n=T(t),r=E(t);return{frontMatter:n??{},body:r}}function N(e,t){return Object.keys(e).length===0?t:C(e,t)}function P(e,t){return{...t,...e}}function F(e,t){let n={},r=t?.filePattern;switch(e){case O.KIRO_ALWAYS:n.inclusion=`always`;break;case O.KIRO_FILE_MATCH:if(typeof r!=`string`||r===``)throw Error(`Pattern is required for KIRO_FILE_MATCH type`);n.inclusion=`fileMatch`,n.fileMatchPattern=r;break;case O.QODER_ALWAYS:n.trigger=`always_on`,n.alwaysApply=!0;break;case O.QODER_GLOB:if(typeof r!=`string`||r===``)throw Error(`Pattern is required for QODER_GLOB type`);n.trigger=`glob`,n.glob=r;break;case O.ANTIGRAVITY_ALWAYS:n.trigger=`always_on`;break;case O.ANTIGRAVITY_GLOB:if(typeof r!=`string`||r===``)throw Error(`Pattern is required for ANTIGRAVITY_GLOB type`);n.trigger=`glob`,n.globs=r;break;case O.WORKFLOW_AUTO:n.auto_execution_mode=`automatic`;break;default:throw Error(`Unknown front matter type: ${String(e)}`)}return t?.additionalProps?{...n,...t.additionalProps}:n}function I(e,t){return t+j(e)}function L(e,t,n,r){let i={type:t};return n!=null&&(i.filePattern=n),r!=null&&(i.additionalProps=r),I(e,w(F(t,i)))}function R(){return{parse:M,serialize:N,merge:P,generateByType:F}}function z(){return{parse:e=>{let t=j(e),n=x(t);return{frontmatter:n.frontmatter,rawFrontmatter:n.rawFrontmatter,ast:n.ast,content:n.content,raw:t}},stringify:e=>S(e),build:(e,t)=>C(e,t),transformFrontmatter:(e,t,n)=>P(e,F(t,n)),stripFrontmatter:e=>E(j(e)),extractFrontmatter:e=>T(j(e))}}export{M as a,D as c,f as d,d as f,F as i,k as l,R as n,N as o,z as r,O as s,L as t,A as u};
|
package/dist/log-ck-k4XJ5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./logger-CST5WaQ3.mjs";let t=null,n=!1;new class{id;constructor(e){this.id=e}formatMessage(e,...t){let n=e;return t.forEach(e=>{n=n.replace(`{}`,String(e))}),n.trim()}canLog(){return!n}trace(t,...n){this.canLog()&&e.log(`trace`,this.formatMessage(t,...n),{id:this.id})}debug(t,...n){this.canLog()&&e.log(`debug`,this.formatMessage(t,...n),{id:this.id})}info(t,...n){this.canLog()&&e.log(`info`,this.formatMessage(t,...n),{id:this.id})}warn(t,...n){this.canLog()&&e.log(`warn`,this.formatMessage(t,...n),{id:this.id})}error(t,...n){this.canLog()&&e.log(`error`,this.formatMessage(t,...n),{id:this.id})}}(`default`);async function r(){if(!n){if(t!=null){await t;return}t=(async()=>{try{n=!0,await new Promise(e=>{setTimeout(e,100)}),await new Promise((t,n)=>{let r=setTimeout(()=>{n(Error(`Logger shutdown timeout`))},5e3);e.on(`finish`,()=>{clearTimeout(r),t()}),e.end()})}catch{n=!0}})(),await t}}export{r as shutdownLogger};
|
package/dist/logger-CST5WaQ3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"node:process";import t from"winston";const n={error:0,warn:1,fatal:2,info:3,debug:4,trace:5};function r(){return e.env.NODE_ENV===`test`||e.env.VITEST===`true`||e.env.JEST_WORKER_ID!=null}function i(){let t=e.env.DEBUG===`true`||e.env.DEBUG===`1`,n=e.argv.includes(`--debug`);return t||n}function a(){return r()?!i():!1}const o=t.format(e=>{let{timestamp:t,level:n,message:r,stack:i,...a}=e,o={...a},s={ts:typeof t==`string`?Number.isNaN(Date.parse(t))?Date.now():new Date(t).valueOf():Date.now(),lvl:n,msg:typeof r==`string`?r:JSON.stringify(r)},c=o.id;typeof c==`string`&&c.length>0&&(s.id=c,delete o.id),typeof i==`string`&&i.length>0&&(s.stack=i);let l=Object.entries(o);return l.length>0&&(s.meta=Object.fromEntries(l)),e[Symbol.for(`message`)]=JSON.stringify(s),e});var s=t.createLogger({levels:n,level:`trace`,format:t.format.combine(t.format.timestamp(),t.format.errors({stack:!0}),o()),transports:[new t.transports.Console({level:`trace`})],silent:a(),exitOnError:!1});export{s as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./chunk-YV1pC1vC.mjs";var t=e(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}));export default t();export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,i as r,s as i,t as a}from"./frontMatter-Xmvgjkyh.mjs";import o from"node:os";import s from"node:path";import c from"picomatch";import l from"fs-extra";const u=[{id:`workspace-root`,category:`ide`,tool:`agents`,targetType:`workspace`,path:``,enabled:!0}];function d(t,n=`AGENTS.md`){let r={type:`asset`,fileName:n,source:t.content,targetType:`workspace`,inputType:e.MEMORY_PROMPT};return t.frontMatter&&(r.frontMatter=t.frontMatter),r}function f(e,t){let n=t.path.dirname(e.path);return n===`.`?``:n}function p(t={}){let{cleanTarget:n=!1,outputFilename:r=`AGENTS.md`,emitFiles:i=!0}=t,a=[];return{name:`agentsMd`,priority:100,inputTypes:[e.MEMORY_PROMPT],outputs:u,buildStart(e,t){a=[],e.log.debug(`AgentsMdPlugin: Starting build`)},async generateBundle(t,n){let o=t.getInputBundles(e.MEMORY_PROMPT);if(o.length===0){t.log.debug(`AgentsMdPlugin: No MemoryPrompt bundles found`);return}t.log.debug(`AgentsMdPlugin: Processing ${o.length} MemoryPrompt bundle(s)`);for(let e of o){let n=d(e,r);i&&t.emitFile(n),a.push(e)}t.registry.set(`agentsMd`,`processedBundles`,a),t.registry.set(`agentsMd`,`outputFilename`,r)},async writeBundle(t,o){if(!i){t.log.debug(`AgentsMdPlugin: File emission disabled`);return}let{files:s}=o,c=s.filter(t=>t.inputType===e.MEMORY_PROMPT&&t.fileName===r);if(c.length===0){t.log.debug(`AgentsMdPlugin: No files to write`);return}n&&t.log.debug(`AgentsMdPlugin: Cleaning target directories`);let l=0;for(let e of c)try{let n=a.find(t=>t.content===e.source);if(n){let r=f(n,t),i=r?t.paths.resolve(r,e.fileName):t.paths.resolve(e.fileName),a=t.path.dirname(i);await t.fs.ensureDir(a),await t.fs.writeFile(i,e.source),l++,t.log.debug(`AgentsMdPlugin: Wrote ${i}`)}}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`AgentsMdPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`AgentsMdPlugin: Wrote ${l} AGENTS.md file(s)`)}}}function m(e,t){if(t.length===0)return!1;let n=e.replace(/\\/g,`/`);for(let e of t){let t=c(e.replace(/\\/g,`/`),{dot:!0});if(t(n))return!0;let r=n.split(`/`);for(let e=1;e<=r.length;e++)if(t(r.slice(0,e).join(`/`)))return!0}return!1}const h=[`node_modules`,`.git`];function ee(t){let{distDir:n,excludePatterns:r=h}=t;return{name:`aindexInput`,priority:30,async scan(t){let i=[],a=t.config.options?.excludePatterns??[],o=[...new Set([...r,...a])];if(!await t.fs.exists(n))return t.log.warn(`Aindex dist directory not found: ${n}`),t.registry.set(`aindexInput`,`distInfo`,null),i;t.log.debug(`Scanning aindex dist directory: ${n}`);let s={distPath:n,hasGlobalMd:!1,commandFiles:[],agentFiles:[],skillDirs:[]};try{let r=t.path.join(n,`GLOBAL.md`);if(await t.fs.exists(r)){s.hasGlobalMd=!0;let n=await v(t,r,e.CONFIG_FILE);n!=null&&i.push(n)}let a=t.path.join(n,`commands`);if(await t.fs.exists(a)){let n=await g(t,a,e.CONFIG_FILE,o);i.push(...n),s.commandFiles=n.map(e=>e.path)}let c=t.path.join(n,`agents`);if(await t.fs.exists(c)){let n=await g(t,c,e.CONFIG_FILE,o);i.push(...n),s.agentFiles=n.map(e=>e.path)}let l=t.path.join(n,`skills`);if(await t.fs.exists(l)){let e=await _(t,l,o);i.push(...e),s.skillDirs=e.map(e=>t.path.dirname(e.path))}}catch(e){let n=e instanceof Error?e.message:String(e);t.log.error(`Failed to scan aindex dist directory: ${n}`)}return t.registry.set(`aindexInput`,`distInfo`,s),t.log.info(`Discovered ${i.length} file(s) from aindex dist: ${s.hasGlobalMd?`1 GLOBAL.md, `:``}${s.commandFiles.length} command(s), ${s.agentFiles.length} agent(s), ${s.skillDirs.length} skill(s)`),i}}}async function g(e,t,n,r){let i=[];try{let a=await e.fs.readdir(t,{withFileTypes:!0});for(let o of a){if(typeof o==`string`||r.includes(o.name))continue;let a=e.path.join(t,o.name);if(m(o.name,r)){e.log.debug(`Skipping excluded path: ${o.name}`);continue}if(o.isDirectory()){let t=await g(e,a,n,r);i.push(...t)}else if(o.name.endsWith(`.md`)){let t=await v(e,a,n);t!=null&&i.push(t)}}}catch(n){e.log.debug(`Failed to scan directory ${t}: ${n instanceof Error?n.message:String(n)}`)}return i}async function _(t,n,r){let i=[];try{let a=await t.fs.readdir(n,{withFileTypes:!0});for(let o of a)if(typeof o!=`string`&&!r.includes(o.name)&&o.isDirectory()){let r=t.path.join(n,o.name),a=await t.fs.readdir(r);for(let n of a)if(typeof n==`string`&&n.endsWith(`.md`)){let a=await v(t,t.path.join(r,n),e.CONFIG_FILE);a!=null&&i.push(a)}}}catch(e){t.log.debug(`Failed to scan skills directory ${n}: ${e instanceof Error?e.message:String(e)}`)}return i}async function v(e,t,n){try{let r=await e.fs.readFile(t),i;t.endsWith(`.md`)&&(i=e.capabilities.frontMatter.parse(r).frontMatter);let a={type:n,path:t,content:r,sourceProject:`aindex`};return i!=null&&Object.keys(i).length>0&&(a.frontMatter=i),a}catch(n){return e.log.debug(`Failed to read file ${t}: ${n instanceof Error?n.message:String(n)}`),null}}const te=[{id:`workspace-workflows`,category:`ide`,tool:`windsurf`,targetType:`workspace`,path:`.windsurf/workflows`,enabled:!0}],ne=[e.FAST_COMMAND];function y(e,t){return t.path.basename(e.path)}function b(e=3){return{auto_execution_mode:e}}function x(t,n,r=3){let o=y(t,n),s=a(t.content,i.WORKFLOW_AUTO,``,{auto_execution_mode:r}),c=b(r);return n.log.debug(`WindsurfIDEPlugin: Processing FastCommand ${t.path}`),{type:`asset`,fileName:o,source:s,targetType:`workspace`,inputType:e.FAST_COMMAND,frontMatter:c}}function re(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.windsurf/workflows`,autoExecutionMode:a=3}=t,o=[],s=[];return{name:`windsurfIde`,priority:100,inputTypes:ne,outputs:te,buildStart(e,t){o=[],s=[],e.log.debug(`WindsurfIDEPlugin: Starting build`)},async generateBundle(t,n){let c=t.getInputBundles(e.FAST_COMMAND);if(c.length>0){t.log.debug(`WindsurfIDEPlugin: Processing ${c.length} FastCommand bundle(s)`);for(let e of c){let n=x(e,t,a);r&&(t.emitFile(n),s.push(n)),o.push(e)}}t.registry.set(`windsurfIde`,`fastCommandBundles`,o),t.registry.set(`windsurfIde`,`emittedFiles`,s),t.registry.set(`windsurfIde`,`targetDir`,i),t.registry.set(`windsurfIde`,`autoExecutionMode`,a)},async writeBundle(t,a){if(!r){t.log.debug(`WindsurfIDEPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.FAST_COMMAND);if(s.length===0){t.log.debug(`WindsurfIDEPlugin: No files to write`);return}let c=t.paths.resolve(i);if(n){t.log.debug(`WindsurfIDEPlugin: Cleaning target directory`);try{await t.fs.cleanDir(c)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`WindsurfIDEPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(c);let l=0;for(let e of s)try{let n=t.path.join(c,e.fileName),r=t.path.dirname(n);await t.fs.ensureDir(r),await t.fs.writeFile(n,e.source),l++,t.log.debug(`WindsurfIDEPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`WindsurfIDEPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`WindsurfIDEPlugin: Wrote ${l} file(s) to Windsurf workflows`)}}}const ie=[{id:`workspace-workflows`,category:`ide`,tool:`antigravity`,targetType:`workspace`,path:`.agent/workflows`,enabled:!0},{id:`workspace-rules`,category:`ide`,tool:`antigravity`,targetType:`workspace`,path:`.agent/rules`,enabled:!0}],ae=[e.FAST_COMMAND,e.MEMORY_PROMPT];function S(e,t){return t.path.basename(e.path)}function oe(t,n,r=3){let o=S(t,n),s=a(t.content,i.WORKFLOW_AUTO,``,{auto_execution_mode:r}),c=b(r);return n.log.debug(`AntigravityIDEPlugin: Processing FastCommand ${t.path}`),{type:`asset`,fileName:o,source:s,targetType:`workspace`,inputType:e.FAST_COMMAND,frontMatter:c}}function se(t,n){let r=S(t,n);return n.log.debug(`AntigravityIDEPlugin: Processing MemoryPrompt ${t.path}`),{type:`asset`,fileName:r,source:t.content,targetType:`workspace`,inputType:e.MEMORY_PROMPT}}function ce(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,workflowsDir:i=`.agent/workflows`,rulesDir:a=`.agent/rules`,autoExecutionMode:o=3}=t,s=[],c=[],l=[],u=[];return{name:`antigravityIde`,priority:100,extends:`windsurfIde`,inputTypes:ae,outputs:ie,buildStart(e,t){s=[],c=[],l=[],u=[],e.log.debug(`AntigravityIDEPlugin: Starting build`)},async generateBundle(t,n){let d=t.getInputBundles(e.FAST_COMMAND);if(d.length>0){t.log.debug(`AntigravityIDEPlugin: Processing ${d.length} FastCommand bundle(s)`);for(let e of d){let n=oe(e,t,o);r&&(t.emitFile(n),l.push(n)),s.push(e)}}let f=t.getInputBundles(e.MEMORY_PROMPT);if(f.length>0){t.log.debug(`AntigravityIDEPlugin: Processing ${f.length} MemoryPrompt bundle(s)`);for(let e of f){let n=se(e,t);r&&(t.emitFile(n),u.push(n)),c.push(e)}}t.registry.set(`antigravityIde`,`fastCommandBundles`,s),t.registry.set(`antigravityIde`,`memoryPromptBundles`,c),t.registry.set(`antigravityIde`,`workflowEmittedFiles`,l),t.registry.set(`antigravityIde`,`rulesEmittedFiles`,u),t.registry.set(`antigravityIde`,`workflowsDir`,i),t.registry.set(`antigravityIde`,`rulesDir`,a),t.registry.set(`antigravityIde`,`autoExecutionMode`,o)},async writeBundle(t,o){if(!r){t.log.debug(`AntigravityIDEPlugin: File emission disabled`);return}let{files:s}=o,c=s.filter(t=>t.inputType===e.FAST_COMMAND||t.inputType===e.MEMORY_PROMPT);if(c.length===0){t.log.debug(`AntigravityIDEPlugin: No files to write`);return}let l=t.paths.resolve(i),u=t.paths.resolve(a);if(n){t.log.debug(`AntigravityIDEPlugin: Cleaning target directories`);try{await t.fs.cleanDir(l)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`AntigravityIDEPlugin: Failed to clean workflows directory: ${n}`)}try{await t.fs.cleanDir(u)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`AntigravityIDEPlugin: Failed to clean rules directory: ${n}`)}}await t.fs.ensureDir(l),await t.fs.ensureDir(u);let d=0,f=0;for(let n of c)try{if(n.inputType===e.FAST_COMMAND){let e=t.path.join(l,n.fileName),r=t.path.dirname(e);await t.fs.ensureDir(r),await t.fs.writeFile(e,n.source),d++,t.log.debug(`AntigravityIDEPlugin: Wrote workflow ${e}`)}else if(n.inputType===e.MEMORY_PROMPT){let e=t.path.join(u,n.fileName),r=t.path.dirname(e);await t.fs.ensureDir(r),await t.fs.writeFile(e,n.source),f++,t.log.debug(`AntigravityIDEPlugin: Wrote rule ${e}`)}}catch(e){let r=e instanceof Error?e.message:String(e);t.log.error(`AntigravityIDEPlugin: Failed to write ${n.fileName}: ${r}`)}let p=d+f;p>0&&t.log.info(`AntigravityIDEPlugin: Wrote ${p} file(s) (${d} workflows, ${f} rules)`)}}}const C=[{id:`global-config`,category:`cli`,tool:`claude`,targetType:`globalConfig`,path:`$USER_HOME/.claude`,enabled:!0},{id:`workspace-config`,category:`cli`,tool:`claude`,targetType:`workspace`,path:`.claude`,enabled:!0}],w=[e.GLOBAL_PROMPT,e.SUB_AGENT,e.FAST_COMMAND,e.SKILL];function le(t){switch(t){case e.GLOBAL_PROMPT:return``;case e.SUB_AGENT:return`agents`;case e.FAST_COMMAND:return`commands`;case e.SKILL:return`skills`;case e.MEMORY_PROMPT:case e.CONFIG_FILE:return``}}function T(t,n){return t===e.GLOBAL_PROMPT?`CLAUDE.md`:n}function E(e,t){let n=t.path.basename(e.path);return T(e.type,n)}function D(e,t,n){let r=le(e.type),i=E(e,n),a={type:`asset`,fileName:r?n.path.join(r,i):i,source:e.content,targetType:t,inputType:e.type};return e.frontMatter&&(a.frontMatter=e.frontMatter),a}function O(e={}){let{cleanTarget:t=!1,emitFiles:n=!0,emitGlobal:r=!0,emitWorkspace:i=!0,globalConfigPath:a,workspaceConfigPath:o=`.claude`}=e,s=[],c=[],l=[],u=``,d=``;return{name:`claudeCodeCli`,priority:100,inputTypes:w,outputs:C,buildStart(e,t){s=[],c=[],l=[];let n=e.resolveOutputPaths(C);u=o?e.paths.resolve(o):n.workspacePath??e.paths.resolve(`.claude`),d=a??n.globalConfigPath??e.path.join(e.paths.userHome,`.claude`),e.log.debug(`ClaudeCodeCLIPlugin: Starting build`),e.log.debug(`ClaudeCodeCLIPlugin: Workspace path: ${u}`),e.log.debug(`ClaudeCodeCLIPlugin: Global path: ${d}`)},async generateBundle(e,t){let a=[];for(let t of w){let n=e.getInputBundles(t);a.push(...n)}if(a.length===0){e.log.debug(`ClaudeCodeCLIPlugin: No input bundles found`);return}e.log.debug(`ClaudeCodeCLIPlugin: Processing ${a.length} input bundle(s)`);for(let t of a){if(r){let r=D(t,`globalConfig`,e);c.push(r),n&&e.emitFile(r)}if(i){let r=D(t,`workspace`,e);l.push(r),n&&e.emitFile(r)}s.push(t)}e.registry.set(`claudeCodeCli`,`processedBundles`,s),e.registry.set(`claudeCodeCli`,`globalEmittedFiles`,c),e.registry.set(`claudeCodeCli`,`workspaceEmittedFiles`,l)},async writeBundle(e,a){if(!n){e.log.debug(`ClaudeCodeCLIPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(e=>w.includes(e.inputType));if(s.length===0){e.log.debug(`ClaudeCodeCLIPlugin: No files to write`);return}if(t){if(e.log.debug(`ClaudeCodeCLIPlugin: Cleaning target directories`),r)try{await e.fs.cleanDir(d)}catch(t){let n=t instanceof Error?t.message:String(t);e.log.warn(`ClaudeCodeCLIPlugin: Failed to clean global directory: ${n}`)}if(i)try{await e.fs.cleanDir(u)}catch(t){let n=t instanceof Error?t.message:String(t);e.log.warn(`ClaudeCodeCLIPlugin: Failed to clean workspace directory: ${n}`)}}let c=0,l=0;for(let t of s)try{if(t.targetType===`globalConfig`&&r){let n=e.path.join(d,t.fileName),r=e.path.dirname(n);await e.fs.ensureDir(r),await e.fs.writeFile(n,t.source),c++,e.log.debug(`ClaudeCodeCLIPlugin: Wrote global ${n}`)}else if(t.targetType===`workspace`&&i){let n=e.path.join(u,t.fileName),r=e.path.dirname(n);await e.fs.ensureDir(r),await e.fs.writeFile(n,t.source),l++,e.log.debug(`ClaudeCodeCLIPlugin: Wrote workspace ${n}`)}}catch(n){let r=n instanceof Error?n.message:String(n);e.log.error(`ClaudeCodeCLIPlugin: Failed to write ${t.fileName}: ${r}`)}let f=c+l;f>0&&e.log.info(`ClaudeCodeCLIPlugin: Wrote ${f} file(s) (${c} global, ${l} workspace)`)}}}const k=[{id:`workspace-rules`,category:`ide`,tool:`cursor`,targetType:`workspace`,path:`.cursor/rules`,enabled:!0}],A=[e.MEMORY_PROMPT],j=[{pattern:/\.md$/,replacement:`.mdc`,tools:[`cursor`]}];function M(e){return e.replace(/\.md$/,`.mdc`)}function N(e,t){let n=t.path.dirname(e.path).replace(/[\\/]/g,`_`).replace(/^_+|_+$/g,``);return n===``||n===`.`?`_root.mdc`:`${n}.mdc`}function P(t,n){let r=N(t,n);n.log.debug(`CursorIDEPlugin: Processing MemoryPrompt ${t.path} -> ${r}`);let i={type:`asset`,fileName:r,source:t.content,targetType:`workspace`,inputType:e.MEMORY_PROMPT};return t.frontMatter&&(i.frontMatter=t.frontMatter),i}function F(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.cursor/rules`}=t,a=[],o=[];return{name:`cursorIde`,priority:100,inputTypes:A,outputs:k,filenameTransform:j,buildStart(e,t){a=[],o=[],e.log.debug(`CursorIDEPlugin: Starting build`)},transformFilename(e,t){return e.endsWith(`.md`)?M(e):null},async generateBundle(t,n){let s=t.getInputBundles(e.MEMORY_PROMPT);if(s.length>0){t.log.debug(`CursorIDEPlugin: Processing ${s.length} MemoryPrompt bundle(s)`);for(let e of s){let n=P(e,t);r&&(t.emitFile(n),o.push(n)),a.push(e)}}t.registry.set(`cursorIde`,`memoryPromptBundles`,a),t.registry.set(`cursorIde`,`emittedFiles`,o),t.registry.set(`cursorIde`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`CursorIDEPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.MEMORY_PROMPT&&t.fileName.endsWith(`.mdc`));if(s.length===0){t.log.debug(`CursorIDEPlugin: No files to write`);return}let c=t.paths.resolve(i);if(n){t.log.debug(`CursorIDEPlugin: Cleaning target directory`);try{await t.fs.cleanDir(c)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`CursorIDEPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(c);let l=0;for(let e of s)try{let n=t.path.join(c,e.fileName),r=t.path.dirname(n);await t.fs.ensureDir(r),await t.fs.writeFile(n,e.source),l++,t.log.debug(`CursorIDEPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`CursorIDEPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`CursorIDEPlugin: Wrote ${l} file(s) to Cursor rules`)}}}const I=[{id:`workspace-rules`,category:`ide`,tool:`codebuddy`,targetType:`workspace`,path:`.codebuddy/.rules`,enabled:!0}],L=[e.MEMORY_PROMPT],R=[{pattern:/\.md$/,replacement:`.mdc`,tools:[`codebuddy`]}];function z(e,t){return N(e,t)}function B(t,n){let r=z(t,n);n.log.debug(`CodeBuddyIDEPlugin: Processing MemoryPrompt ${t.path} -> ${r}`);let i={type:`asset`,fileName:r,source:t.content,targetType:`workspace`,inputType:e.MEMORY_PROMPT};return t.frontMatter&&(i.frontMatter=t.frontMatter),i}function V(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.codebuddy/.rules`}=t,a=[],o=[];return{name:`codeBuddyIde`,priority:100,extends:`cursorIde`,inputTypes:L,outputs:I,filenameTransform:R,buildStart(e,t){a=[],o=[],e.log.debug(`CodeBuddyIDEPlugin: Starting build`)},transformFilename(e,t){return e.endsWith(`.md`)?M(e):null},async generateBundle(t,n){let s=t.getInputBundles(e.MEMORY_PROMPT);if(s.length>0){t.log.debug(`CodeBuddyIDEPlugin: Processing ${s.length} MemoryPrompt bundle(s)`);for(let e of s){let n=B(e,t);r&&(t.emitFile(n),o.push(n)),a.push(e)}}t.registry.set(`codeBuddyIde`,`memoryPromptBundles`,a),t.registry.set(`codeBuddyIde`,`emittedFiles`,o),t.registry.set(`codeBuddyIde`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`CodeBuddyIDEPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.MEMORY_PROMPT&&t.fileName.endsWith(`.mdc`));if(s.length===0){t.log.debug(`CodeBuddyIDEPlugin: No files to write`);return}let c=t.paths.resolve(i);if(n){t.log.debug(`CodeBuddyIDEPlugin: Cleaning target directory`);try{await t.fs.cleanDir(c)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`CodeBuddyIDEPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(c);let l=0;for(let e of s)try{let n=t.path.join(c,e.fileName),r=t.path.dirname(n);await t.fs.ensureDir(r),await t.fs.writeFile(n,e.source),l++,t.log.debug(`CodeBuddyIDEPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`CodeBuddyIDEPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`CodeBuddyIDEPlugin: Wrote ${l} file(s) to CodeBuddy rules`)}}}const H=[{id:`global-config`,category:`cli`,tool:`codex`,targetType:`globalConfig`,path:`$USER_HOME/.codex`,enabled:!0}],U=[e.GLOBAL_PROMPT,e.FAST_COMMAND];function W(t){switch(t){case e.GLOBAL_PROMPT:return``;case e.FAST_COMMAND:return`commands`;case e.MEMORY_PROMPT:case e.SUB_AGENT:case e.SKILL:case e.CONFIG_FILE:return``}}function ue(e,t){return t.path.basename(e.path)}function G(e,t){let n=W(e.type),r=ue(e,t),i={type:`asset`,fileName:n?t.path.join(n,r):r,source:e.content,targetType:`globalConfig`,inputType:e.type};return e.frontMatter&&(i.frontMatter=e.frontMatter),i}function de(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,globalConfigPath:i}=t,a=[],s=[],c=[];return{name:`codexCli`,priority:100,extends:`agentsMd`,inputTypes:U,outputs:H,buildStart(e,t){a=[],s=[],c=[],e.log.debug(`CodexCLIPlugin: Starting build`)},async generateBundle(t,n){let i=t.getInputBundles(e.GLOBAL_PROMPT);if(i.length>0){t.log.debug(`CodexCLIPlugin: Processing ${i.length} GlobalPrompt bundle(s)`);for(let e of i){let n=G(e,t);r&&(t.emitFile(n),c.push(n)),a.push(e)}}let o=t.getInputBundles(e.FAST_COMMAND);if(o.length>0){t.log.debug(`CodexCLIPlugin: Processing ${o.length} FastCommand bundle(s)`);for(let e of o){let n=G(e,t);r&&(t.emitFile(n),c.push(n)),s.push(e)}}t.registry.set(`codexCli`,`globalPromptBundles`,a),t.registry.set(`codexCli`,`fastCommandBundles`,s),t.registry.set(`codexCli`,`globalEmittedFiles`,c)},async writeBundle(t,a){if(!r){t.log.debug(`CodexCLIPlugin: File emission disabled`);return}let{files:s}=a,c=s.filter(t=>t.targetType===`globalConfig`&&(t.inputType===e.GLOBAL_PROMPT||t.inputType===e.FAST_COMMAND));if(c.length===0){t.log.debug(`CodexCLIPlugin: No files to write`);return}if(n){t.log.debug(`CodexCLIPlugin: Cleaning target directory`);try{let e=i??o.homedir()+(o.platform()===`win32`?`\\.codex`:`/.codex`);await t.fs.cleanDir(e)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`CodexCLIPlugin: Failed to clean global directory: ${n}`)}}let l=0;for(let e of c)try{let n=i??o.homedir()+(o.platform()===`win32`?`\\.codex`:`/.codex`),r=t.path.join(n,e.fileName),a=t.path.dirname(r);await t.fs.ensureDir(a),await t.fs.writeFile(r,e.source),l++,t.log.debug(`CodexCLIPlugin: Wrote global ${r}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`CodexCLIPlugin: Failed to write ${e.fileName}: ${r}`)}try{let e=i??o.homedir()+(o.platform()===`win32`?`\\.codex`:`/.codex`),n=t.path.join(e,`AGENTS.md`);await t.fs.exists(n)&&t.log.info(`CodexCLIPlugin: Registered global prompt file at ${n}`)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`CodexCLIPlugin: Failed to register global prompt file: ${n}`)}l>0&&t.log.info(`CodexCLIPlugin: Wrote ${l} file(s) to global config`)}}}const fe=[{id:`workspace-editorconfig`,category:`config`,tool:`editorconfig`,targetType:`workspace`,path:`.editorconfig`,enabled:!0}],pe=[e.CONFIG_FILE];function me(t,n=`.editorconfig`,r){if(t.type!==e.CONFIG_FILE)return!1;let i=t.path.replace(/\\/g,`/`);return r.path.basename(i)===n}function he(e,t,n=`.editorconfig`){return e.filter(e=>me(e,n,t))}function ge(t,n,r=`.editorconfig`){return t.content===``?(n.log.debug(`EditorconfigConfigPlugin: Skipping empty bundle ${t.path}`),null):(n.log.debug(`EditorconfigConfigPlugin: Processing ${t.path}`),{type:`asset`,fileName:r,source:t.content,targetType:`workspace`,inputType:e.CONFIG_FILE})}function _e(t={}){let{emitFiles:n=!0,targetFilename:r=`.editorconfig`,sourcePattern:i=`.editorconfig`}=t,a=[],o=[];return{name:`editorconfigConfig`,priority:200,inputTypes:pe,outputs:fe,buildStart(e,t){a=[],o=[],e.log.debug(`EditorconfigConfigPlugin: Starting build`)},async generateBundle(t,s){let c=he(t.getInputBundles(e.CONFIG_FILE),t,i);if(c.length===0){t.log.debug(`EditorconfigConfigPlugin: No editorconfig files found`);return}t.log.debug(`EditorconfigConfigPlugin: Processing ${c.length} editorconfig bundle(s)`);for(let e of c){let i=ge(e,t,r);i!=null&&n&&(t.emitFile(i),o.push(i)),a.push(e)}t.registry.set(`editorconfigConfig`,`configBundles`,a),t.registry.set(`editorconfigConfig`,`emittedFiles`,o),t.registry.set(`editorconfigConfig`,`targetFilename`,r)},async writeBundle(t,i){if(!n){t.log.debug(`EditorconfigConfigPlugin: File emission disabled`);return}let{files:a}=i,o=a.filter(t=>t.inputType===e.CONFIG_FILE&&t.fileName===r);if(o.length===0){t.log.debug(`EditorconfigConfigPlugin: No editorconfig files to write`);return}let s=0;for(let e of o)try{let n=t.paths.resolve(e.fileName);await t.fs.writeFile(n,e.source),s++,t.log.debug(`EditorconfigConfigPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`EditorconfigConfigPlugin: Failed to write ${e.fileName}: ${r}`)}s>0&&t.log.info(`EditorconfigConfigPlugin: Wrote ${s} .editorconfig file(s)`)}}}const K=[{id:`global-config`,category:`cli`,tool:`factory`,targetType:`globalConfig`,path:`.factory`,enabled:!0},{id:`workspace-config`,category:`cli`,tool:`factory`,targetType:`workspace`,path:`.factory`,enabled:!0}],q=[e.GLOBAL_PROMPT,e.SUB_AGENT,e.FAST_COMMAND,e.SKILL];function ve(e={}){let{cleanTarget:t=!1,emitFiles:n=!0,emitGlobal:r=!0,emitWorkspace:i=!0,globalConfigPath:a,workspaceConfigPath:o=`.factory`}=e,s=[],c=[],l=[],u=``,d=``;return{name:`factoryDroidCli`,priority:100,extends:`claudeCodeCli`,inputTypes:q,outputs:K,buildStart(e,t){s=[],c=[],l=[];let n=e.resolveOutputPaths(K);u=o?e.paths.resolve(o):n.workspacePath??e.paths.resolve(`.factory`),d=a??n.globalConfigPath??e.path.join(e.paths.userHome,`.factory`),e.log.debug(`FactoryDroidCLIPlugin: Starting build`),e.log.debug(`FactoryDroidCLIPlugin: Workspace path: ${u}`),e.log.debug(`FactoryDroidCLIPlugin: Global path: ${d}`)},async generateBundle(e,t){let a=[];for(let t of q){let n=e.getInputBundles(t);a.push(...n)}if(a.length===0){e.log.debug(`FactoryDroidCLIPlugin: No input bundles found`);return}e.log.debug(`FactoryDroidCLIPlugin: Processing ${a.length} input bundle(s)`);for(let t of a){if(r){let r=D(t,`globalConfig`,e);c.push(r),n&&e.emitFile(r)}if(i){let r=D(t,`workspace`,e);l.push(r),n&&e.emitFile(r)}s.push(t)}e.registry.set(`factoryDroidCli`,`processedBundles`,s),e.registry.set(`factoryDroidCli`,`globalEmittedFiles`,c),e.registry.set(`factoryDroidCli`,`workspaceEmittedFiles`,l)},async writeBundle(e,a){if(!n){e.log.debug(`FactoryDroidCLIPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(e=>q.includes(e.inputType));if(s.length===0){e.log.debug(`FactoryDroidCLIPlugin: No files to write`);return}if(t){if(e.log.debug(`FactoryDroidCLIPlugin: Cleaning target directories`),r)try{await e.fs.cleanDir(d)}catch(t){let n=t instanceof Error?t.message:String(t);e.log.warn(`FactoryDroidCLIPlugin: Failed to clean global directory: ${n}`)}if(i)try{await e.fs.cleanDir(u)}catch(t){let n=t instanceof Error?t.message:String(t);e.log.warn(`FactoryDroidCLIPlugin: Failed to clean workspace directory: ${n}`)}}let c=0,l=0;for(let t of s)try{if(t.targetType===`globalConfig`&&r){let n=e.path.join(d,t.fileName),r=e.path.dirname(n);await e.fs.ensureDir(r),await e.fs.writeFile(n,t.source),c++,e.log.debug(`FactoryDroidCLIPlugin: Wrote global ${n}`)}else if(t.targetType===`workspace`&&i){let n=e.path.join(u,t.fileName),r=e.path.dirname(n);await e.fs.ensureDir(r),await e.fs.writeFile(n,t.source),l++,e.log.debug(`FactoryDroidCLIPlugin: Wrote workspace ${n}`)}}catch(n){let r=n instanceof Error?n.message:String(n);e.log.error(`FactoryDroidCLIPlugin: Failed to write ${t.fileName}: ${r}`)}let f=c+l;f>0&&e.log.info(`FactoryDroidCLIPlugin: Wrote ${f} file(s) (${c} global, ${l} workspace)`)}}}function ye(e,t){let n=t.path.dirname(e.path);return n===`.`?``:n}const be=[{id:`workspace-gemini`,category:`cli`,tool:`gemini`,targetType:`workspace`,path:`GEMINI.md`,enabled:!0},{id:`global-config`,category:`cli`,tool:`gemini`,targetType:`globalConfig`,path:`.gemini`,enabled:!0}],xe=[e.MEMORY_PROMPT,e.GLOBAL_PROMPT];function Se(e,t){return t.path.basename(e.path)}function Ce(t,n,r){let i={type:`asset`,fileName:Se(t,r),source:t.content,targetType:n,inputType:e.GLOBAL_PROMPT};return t.frontMatter&&(i.frontMatter=t.frontMatter),i}function we(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,emitGlobal:i=!0,emitWorkspace:a=!0,globalConfigPath:s,outputFilename:c=`GEMINI.md`}=t,l=[],u=[],f=[],p=[];return{name:`geminiCli`,priority:100,extends:`agentsMd`,inputTypes:xe,outputs:be,buildStart(e,t){l=[],u=[],f=[],p=[],e.log.debug(`GeminiCLIPlugin: Starting build`)},async generateBundle(t,n){let o=t.getInputBundles(e.MEMORY_PROMPT);if(o.length>0){t.log.debug(`GeminiCLIPlugin: Processing ${o.length} MemoryPrompt bundle(s)`);for(let e of o){let n=d(e,c);r&&a&&(t.emitFile(n),f.push(n)),l.push(e)}}let s=t.getInputBundles(e.GLOBAL_PROMPT);if(s.length>0){t.log.debug(`GeminiCLIPlugin: Processing ${s.length} GlobalPrompt bundle(s)`);for(let e of s){if(i){let n=Ce(e,`globalConfig`,t);r&&(t.emitFile(n),p.push(n))}u.push(e)}}t.registry.set(`geminiCli`,`memoryPromptBundles`,l),t.registry.set(`geminiCli`,`globalPromptBundles`,u),t.registry.set(`geminiCli`,`workspaceEmittedFiles`,f),t.registry.set(`geminiCli`,`globalEmittedFiles`,p),t.registry.set(`geminiCli`,`outputFilename`,c)},async writeBundle(t,u){if(!r){t.log.debug(`GeminiCLIPlugin: File emission disabled`);return}let{files:d}=u,f=d.filter(t=>t.inputType===e.MEMORY_PROMPT&&t.fileName===c||t.inputType===e.GLOBAL_PROMPT);if(f.length===0){t.log.debug(`GeminiCLIPlugin: No files to write`);return}if(n&&(t.log.debug(`GeminiCLIPlugin: Cleaning target directories`),i))try{let e=s??o.homedir()+(o.platform()===`win32`?`\\.gemini`:`/.gemini`);await t.fs.cleanDir(e)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`GeminiCLIPlugin: Failed to clean global directory: ${n}`)}let p=0,m=0;for(let n of f)try{if(n.inputType===e.MEMORY_PROMPT&&a){let e=l.find(e=>e.content===n.source);if(e){let r=ye(e,t),i=r?t.paths.resolve(r,n.fileName):t.paths.resolve(n.fileName),a=t.path.dirname(i);await t.fs.ensureDir(a),await t.fs.writeFile(i,n.source),p++,t.log.debug(`GeminiCLIPlugin: Wrote workspace ${i}`)}}else if(n.inputType===e.GLOBAL_PROMPT&&i){let e=s??o.homedir()+(o.platform()===`win32`?`\\.gemini`:`/.gemini`),r=t.path.join(e,n.fileName),i=t.path.dirname(r);await t.fs.ensureDir(i),await t.fs.writeFile(r,n.source),m++,t.log.debug(`GeminiCLIPlugin: Wrote global ${r}`)}}catch(e){let r=e instanceof Error?e.message:String(e);t.log.error(`GeminiCLIPlugin: Failed to write ${n.fileName}: ${r}`)}let h=p+m;h>0&&t.log.info(`GeminiCLIPlugin: Wrote ${h} file(s) (${p} workspace, ${m} global)`)}}}const Te=[{id:`workspace-idea`,category:`config`,tool:`jetbrains`,targetType:`workspace`,path:`.idea`,enabled:!0}],Ee=[e.CONFIG_FILE];function De(t,n=`.idea`){if(t.type!==e.CONFIG_FILE)return!1;let r=t.path.replace(/\\/g,`/`);return r.includes(`/${n}`)||r.endsWith(n)}function Oe(e,t=`.idea`){return e.filter(e=>De(e,t))}function ke(t,n){if(t.content===``)return n.log.debug(`JetBrainsIDEConfigPlugin: Skipping directory ${t.path}`),null;let r=t.path.replace(/\\/g,`/`),i=r.lastIndexOf(`.idea`);if(i===-1)return n.log.warn(`JetBrainsIDEConfigPlugin: Invalid path ${t.path}`),null;let a=r.substring(i);return n.log.debug(`JetBrainsIDEConfigPlugin: Processing ${a}`),{type:`asset`,fileName:a,source:t.content,targetType:`workspace`,inputType:e.CONFIG_FILE}}async function J(e,t,n){let r=0;try{let i=await e.fs.readdir(t,{withFileTypes:!0});for(let a of i){if(typeof a==`string`)continue;let i=e.path.join(t,a.name),o=e.path.join(n,a.name);a.isDirectory()?(await e.fs.ensureDir(o),r+=await J(e,i,o)):(await e.fs.copy(i,o),r++,e.log.debug(`JetBrainsIDEConfigPlugin: Copied ${a.name}`))}}catch(t){let n=t instanceof Error?t.message:String(t);e.log.error(`JetBrainsIDEConfigPlugin: Failed to copy directory: ${n}`)}return r}function Ae(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.idea`,sourcePattern:a=`.idea`}=t,o=[],s=[],c=[];return{name:`jetBrainsIdeConfig`,priority:200,inputTypes:Ee,outputs:Te,buildStart(e,t){o=[],s=[],c=[],e.log.debug(`JetBrainsIDEConfigPlugin: Starting build`)},async generateBundle(t,n){let l=Oe(t.getInputBundles(e.CONFIG_FILE),a);if(l.length===0){t.log.debug(`JetBrainsIDEConfigPlugin: No JetBrains config files found`);return}t.log.debug(`JetBrainsIDEConfigPlugin: Processing ${l.length} config bundle(s)`);for(let e of l){if(e.content===``){c.push(e);continue}let n=ke(e,t);n!=null&&r&&(t.emitFile(n),s.push(n)),o.push(e)}t.registry.set(`jetBrainsIdeConfig`,`configBundles`,o),t.registry.set(`jetBrainsIdeConfig`,`directoryBundles`,c),t.registry.set(`jetBrainsIdeConfig`,`emittedFiles`,s),t.registry.set(`jetBrainsIdeConfig`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`JetBrainsIDEConfigPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.CONFIG_FILE&&t.fileName.includes(`.idea`)),l=t.paths.resolve(i);if(n){t.log.debug(`JetBrainsIDEConfigPlugin: Cleaning target directory`);try{await t.fs.cleanDir(l)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`JetBrainsIDEConfigPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(l);let u=0;for(let e of c)try{let n=e.path,r=l;t.log.debug(`JetBrainsIDEConfigPlugin: Copying directory ${n} to ${r}`);let i=await J(t,n,r);u+=i}catch(e){let n=e instanceof Error?e.message:String(e);t.log.error(`JetBrainsIDEConfigPlugin: Failed to copy directory: ${n}`)}for(let e of s)try{let n=e.fileName.replace(/^\.idea[\\/]?/,``),r=t.path.join(l,n),i=t.path.dirname(r);await t.fs.ensureDir(i),await t.fs.writeFile(r,e.source),u++,t.log.debug(`JetBrainsIDEConfigPlugin: Wrote ${r}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`JetBrainsIDEConfigPlugin: Failed to write ${e.fileName}: ${r}`)}u>0&&t.log.info(`JetBrainsIDEConfigPlugin: Wrote ${u} file(s) to .idea/`)}}}const je=[{id:`workspace-steering`,category:`ide`,tool:`kiro`,targetType:`workspace`,path:`.kiro/steering`,enabled:!0}],Me=[e.MEMORY_PROMPT,e.GLOBAL_PROMPT];function Ne(e,t){let n=t.path.dirname(e.path).replace(/\\/g,`/`);return n===`.`||n===``?`**/*`:`**/${n}/**`}function Pe(e,t){let n=t.path.dirname(e.path).replace(/[\\/]/g,`_`).replace(/^_+|_+$/g,``);return n===``||n===`.`?`_root.md`:`${n}.md`}function Fe(t,n){let o=Ne(t,n),s=Pe(t,n),c=a(t.content,i.KIRO_FILE_MATCH,o),l=r(i.KIRO_FILE_MATCH,{type:i.KIRO_FILE_MATCH,filePattern:o});return n.log.debug(`KiroIDEPlugin: Generated pattern "${o}" for ${t.path}`),{type:`asset`,fileName:s,source:c,targetType:`workspace`,inputType:e.MEMORY_PROMPT,frontMatter:l}}function Ie(t,n){let o=n.path.basename(t.path),s=a(t.content,i.KIRO_ALWAYS),c=r(i.KIRO_ALWAYS,{type:i.KIRO_ALWAYS});return n.log.debug(`KiroIDEPlugin: Processing GlobalPrompt ${t.path}`),{type:`asset`,fileName:o,source:s,targetType:`workspace`,inputType:e.GLOBAL_PROMPT,frontMatter:c}}function Le(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.kiro/steering`}=t,a=[],o=[],s=[];return{name:`kiroIde`,priority:100,inputTypes:Me,outputs:je,buildStart(e,t){a=[],o=[],s=[],e.log.debug(`KiroIDEPlugin: Starting build`)},async generateBundle(t,n){let c=t.getInputBundles(e.MEMORY_PROMPT);if(c.length>0){t.log.debug(`KiroIDEPlugin: Processing ${c.length} MemoryPrompt bundle(s)`);for(let e of c){let n=Fe(e,t);r&&(t.emitFile(n),s.push(n)),a.push(e)}}let l=t.getInputBundles(e.GLOBAL_PROMPT);if(l.length>0){t.log.debug(`KiroIDEPlugin: Processing ${l.length} GlobalPrompt bundle(s)`);for(let e of l){let n=Ie(e,t);r&&(t.emitFile(n),s.push(n)),o.push(e)}}t.registry.set(`kiroIde`,`memoryPromptBundles`,a),t.registry.set(`kiroIde`,`globalPromptBundles`,o),t.registry.set(`kiroIde`,`emittedFiles`,s),t.registry.set(`kiroIde`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`KiroIDEPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.MEMORY_PROMPT||t.inputType===e.GLOBAL_PROMPT);if(s.length===0){t.log.debug(`KiroIDEPlugin: No files to write`);return}let c=t.paths.resolve(i);if(n){t.log.debug(`KiroIDEPlugin: Cleaning target directory`);try{await t.fs.cleanDir(c)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`KiroIDEPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(c);let l=0;for(let e of s)try{let n=t.path.join(c,e.fileName),r=t.path.dirname(n);await t.fs.ensureDir(r),await t.fs.writeFile(n,e.source),l++,t.log.debug(`KiroIDEPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`KiroIDEPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`KiroIDEPlugin: Wrote ${l} file(s) to Kiro steering`)}}}const Re=[{id:`workspace-rules`,category:`ide`,tool:`qoder`,targetType:`workspace`,path:`.qoder/rules`,enabled:!0}],ze=[e.MEMORY_PROMPT];function Be(e,t){let n=t.path.dirname(e.path).replace(/\\/g,`/`);return n===`.`||n===``?`**/*`:`**/${n}/**`}function Ve(e,t){let n=t.path.dirname(e.path).replace(/[\\/]/g,`_`).replace(/^_+|_+$/g,``);return n===``||n===`.`?`_root.mdc`:`${n}.mdc`}function He(t,n){let o=Be(t,n),s=Ve(t,n),c=a(t.content,i.QODER_GLOB,o),l=r(i.QODER_GLOB,{type:i.QODER_GLOB,filePattern:o});return n.log.debug(`QoderIDEPlugin: Generated pattern "${o}" for ${t.path}`),{type:`asset`,fileName:s,source:c,targetType:`workspace`,inputType:e.MEMORY_PROMPT,frontMatter:l}}function Ue(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.qoder/rules`}=t,a=[],o=[];return{name:`qoderIde`,priority:100,inputTypes:ze,outputs:Re,buildStart(e,t){a=[],o=[],e.log.debug(`QoderIDEPlugin: Starting build`)},async generateBundle(t,n){let s=t.getInputBundles(e.MEMORY_PROMPT);if(s.length>0){t.log.debug(`QoderIDEPlugin: Processing ${s.length} MemoryPrompt bundle(s)`);for(let e of s){let n=He(e,t);r&&(t.emitFile(n),o.push(n)),a.push(e)}}t.registry.set(`qoderIde`,`memoryPromptBundles`,a),t.registry.set(`qoderIde`,`emittedFiles`,o),t.registry.set(`qoderIde`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`QoderIDEPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.MEMORY_PROMPT&&t.fileName.endsWith(`.mdc`));if(s.length===0){t.log.debug(`QoderIDEPlugin: No files to write`);return}let c=t.paths.resolve(i);if(n){t.log.debug(`QoderIDEPlugin: Cleaning target directory`);try{await t.fs.cleanDir(c)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`QoderIDEPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(c);let l=0;for(let e of s)try{let n=t.path.join(c,e.fileName),r=t.path.dirname(n);await t.fs.ensureDir(r),await t.fs.writeFile(n,e.source),l++,t.log.debug(`QoderIDEPlugin: Wrote ${n}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`QoderIDEPlugin: Failed to write ${e.fileName}: ${r}`)}l>0&&t.log.info(`QoderIDEPlugin: Wrote ${l} file(s) to Qoder rules`)}}}const We=[`node_modules`,`.git`];function Ge(e){let{refDir:t,excludePatterns:n=We,distDirName:r=`dist`}=e;return{name:`refInput`,priority:20,async scan(e){let i=[],a=[],o=e.config.options?.excludePatterns??[],s=[...new Set([...n,...o])];if(!await e.fs.exists(t))return e.log.warn(`Ref directory not found: ${t}`),e.registry.set(`refInput`,`projects`,[]),i;e.log.debug(`Scanning ref directory: ${t}`);try{let n=await e.fs.readdir(t,{withFileTypes:!0});for(let o of n){if(typeof o==`string`||!o.isDirectory()||s.includes(o.name))continue;if(m(`ref/${o.name}`,s)){e.log.debug(`Skipping excluded ref project: ${o.name}`);continue}let n=e.path.join(t,o.name),c=e.path.join(n,r);if(!await e.fs.exists(c)){e.log.debug(`No dist directory found for ref project: ${o.name}`);continue}let l=await Ke(e,o.name,n,c);if(l!=null){a.push(l);let t=await qe(e,l);i.push(...t)}}}catch(t){let n=t instanceof Error?t.message:String(t);e.log.error(`Failed to scan ref directory: ${n}`)}return e.registry.set(`refInput`,`projects`,a),e.log.info(`Discovered ${a.length} ref project(s) with ${i.length} file(s)`),i}}}async function Ke(e,t,n,r){try{let i=[];return await Y(e,r,i),{name:t,path:n,distPath:r,files:i}}catch(n){return e.log.debug(`Failed to scan ref project ${t}: ${n instanceof Error?n.message:String(n)}`),null}}async function Y(e,t,n){let r=await e.fs.readdir(t,{withFileTypes:!0});for(let i of r){if(typeof i==`string`)continue;let r=e.path.join(t,i.name);i.isDirectory()?await Y(e,r,n):n.push(r)}}async function qe(e,t){let n=[];for(let r of t.files){let i=await Je(e,r,t);i!=null&&n.push(i)}return n}async function Je(t,n,r){try{let i=await t.fs.readFile(n),a=t.path.basename(n),o;a.endsWith(`.md`)&&(o=t.capabilities.frontMatter.parse(i).frontMatter);let s={type:e.CONFIG_FILE,path:n,content:i,sourceProject:r.name};return o!=null&&(s.frontMatter=o),s}catch(e){return t.log.debug(`Failed to read file ${n}: ${e instanceof Error?e.message:String(e)}`),null}}const Ye=[{id:`workspace-vscode`,category:`config`,tool:`vscode`,targetType:`workspace`,path:`.vscode`,enabled:!0}],Xe=[e.CONFIG_FILE];function Ze(t,n=`.vscode`){if(t.type!==e.CONFIG_FILE)return!1;let r=t.path.replace(/\\/g,`/`);return r.includes(`/${n}`)||r.endsWith(n)}function X(e,t=`.vscode`){return e.filter(e=>Ze(e,t))}function Qe(t,n){if(t.content===``)return n.log.debug(`VSCodeIDEConfigPlugin: Skipping directory ${t.path}`),null;let r=t.path.replace(/\\/g,`/`),i=r.lastIndexOf(`.vscode`);if(i===-1)return n.log.warn(`VSCodeIDEConfigPlugin: Invalid path ${t.path}`),null;let a=r.substring(i);return n.log.debug(`VSCodeIDEConfigPlugin: Processing ${a}`),{type:`asset`,fileName:a,source:t.content,targetType:`workspace`,inputType:e.CONFIG_FILE}}async function Z(e,t,n){let r=0;try{let i=await e.fs.readdir(t,{withFileTypes:!0});for(let a of i){if(typeof a==`string`)continue;let i=e.path.join(t,a.name),o=e.path.join(n,a.name);a.isDirectory()?(await e.fs.ensureDir(o),r+=await Z(e,i,o)):(await e.fs.copy(i,o),r++,e.log.debug(`VSCodeIDEConfigPlugin: Copied ${a.name}`))}}catch(t){let n=t instanceof Error?t.message:String(t);e.log.error(`VSCodeIDEConfigPlugin: Failed to copy directory: ${n}`)}return r}function $e(t={}){let{cleanTarget:n=!1,emitFiles:r=!0,targetDir:i=`.vscode`,sourcePattern:a=`.vscode`}=t,o=[],s=[],c=[];return{name:`vscodeIdeConfig`,priority:200,inputTypes:Xe,outputs:Ye,buildStart(e,t){o=[],s=[],c=[],e.log.debug(`VSCodeIDEConfigPlugin: Starting build`)},async generateBundle(t,n){let l=X(t.getInputBundles(e.CONFIG_FILE),a);if(l.length===0){t.log.debug(`VSCodeIDEConfigPlugin: No VSCode config files found`);return}t.log.debug(`VSCodeIDEConfigPlugin: Processing ${l.length} config bundle(s)`);for(let e of l){if(e.content===``){c.push(e);continue}let n=Qe(e,t);n!=null&&r&&(t.emitFile(n),s.push(n)),o.push(e)}t.registry.set(`vscodeIdeConfig`,`configBundles`,o),t.registry.set(`vscodeIdeConfig`,`directoryBundles`,c),t.registry.set(`vscodeIdeConfig`,`emittedFiles`,s),t.registry.set(`vscodeIdeConfig`,`targetDir`,i)},async writeBundle(t,a){if(!r){t.log.debug(`VSCodeIDEConfigPlugin: File emission disabled`);return}let{files:o}=a,s=o.filter(t=>t.inputType===e.CONFIG_FILE&&t.fileName.includes(`.vscode`)),l=t.paths.resolve(i);if(n){t.log.debug(`VSCodeIDEConfigPlugin: Cleaning target directory`);try{await t.fs.cleanDir(l)}catch(e){let n=e instanceof Error?e.message:String(e);t.log.warn(`VSCodeIDEConfigPlugin: Failed to clean target directory: ${n}`)}}await t.fs.ensureDir(l);let u=0;for(let e of c)try{let n=e.path,r=l;t.log.debug(`VSCodeIDEConfigPlugin: Copying directory ${n} to ${r}`);let i=await Z(t,n,r);u+=i}catch(e){let n=e instanceof Error?e.message:String(e);t.log.error(`VSCodeIDEConfigPlugin: Failed to copy directory: ${n}`)}for(let e of s)try{let n=e.fileName.replace(/^\.vscode[\\/]?/,``),r=t.path.join(l,n),i=t.path.dirname(r);await t.fs.ensureDir(i),await t.fs.writeFile(r,e.source),u++,t.log.debug(`VSCodeIDEConfigPlugin: Wrote ${r}`)}catch(n){let r=n instanceof Error?n.message:String(n);t.log.error(`VSCodeIDEConfigPlugin: Failed to write ${e.fileName}: ${r}`)}u>0&&t.log.info(`VSCodeIDEConfigPlugin: Wrote ${u} file(s) to .vscode/`)}}}const et=[`node_modules`,`.git`,`dist`,`build`,`.cache`,`coverage`],tt=[`.editorconfig`,`.vscode/settings.json`,`.idea`];function nt(e={}){let{workspaceGroupDir:t=n,excludePatterns:r=et,configFilePatterns:i=tt}=e;return{name:`workspaceGroupInput`,priority:10,async scan(e){let n=[],a=[],o=e.config.options?.excludePatterns??[],s=[...new Set([...r,...o])];if(!await e.fs.exists(t))return e.log.warn(`Workspace group directory not found: ${t}`),e.registry.set(`workspaceGroupInput`,`workspaces`,[]),n;e.log.debug(`Scanning workspace group: ${t}`);try{let r=await e.fs.readdir(t,{withFileTypes:!0});for(let o of r){if(typeof o==`string`||!o.isDirectory()||s.includes(o.name))continue;if(m(o.name,s)){e.log.debug(`Skipping excluded path: ${o.name}`);continue}let r=e.paths.resolve(t,o.name),c=await rt(e,o.name,r,i);if(c!=null){if(a.push(c),c.hasAgentsMd){let t=await it(e,e.path.join(r,`AGENTS.md`),o.name);t!=null&&n.push(t)}for(let t of c.configFiles){let r=await at(e,t,o.name);r!=null&&n.push(r)}}}}catch(t){let n=t instanceof Error?t.message:String(t);e.log.error(`Failed to scan workspace group: ${n}`)}return e.registry.set(`workspaceGroupInput`,`workspaces`,a),e.log.info(`Discovered ${a.length} workspace(s) in ${t}`),n}}}async function rt(e,t,n,r){try{if(!(await e.fs.stat(n)).isDirectory())return null;let i=e.path.join(n,`AGENTS.md`),a=await e.fs.exists(i),o=[];for(let t of r){let r=e.path.join(n,t);!t.includes(`/`)&&!t.includes(`.`)?await e.fs.exists(r)&&(await e.fs.stat(r)).isDirectory()&&o.push(r):await e.fs.exists(r)&&o.push(r)}return{name:t,path:n,hasAgentsMd:a,configFiles:o}}catch(n){return e.log.debug(`Failed to scan workspace ${t}: ${n instanceof Error?n.message:String(n)}`),null}}async function it(t,n,r){try{let i=await t.fs.readFile(n),{frontMatter:a}=t.capabilities.frontMatter.parse(i);return{type:e.MEMORY_PROMPT,path:n,content:i,frontMatter:a,sourceProject:r}}catch(e){return t.log.debug(`Failed to read AGENTS.md from ${r}: ${e instanceof Error?e.message:String(e)}`),null}}async function at(t,n,r){try{if((await t.fs.stat(n)).isDirectory())return{type:e.CONFIG_FILE,path:n,content:``,sourceProject:r};let i=await t.fs.readFile(n);return{type:e.CONFIG_FILE,path:n,content:i,sourceProject:r}}catch(e){return t.log.debug(`Failed to read config file ${n}: ${e instanceof Error?e.message:String(e)}`),null}}const Q=t.forProject(`aindex`),$={aindexDistDir:Q.dist(),refDir:Q.ref(),excludePatterns:[`ref/*/dist`],workspaceGroupsDir:n};function ot(e){let t={...$,...e};return[nt(),Ge({refDir:t.refDir,excludePatterns:t.excludePatterns}),ee({distDir:t.aindexDistDir,excludePatterns:t.excludePatterns})]}const st=ot(),ct=[p(),O(),we(),de(),ve(),Le(),Ue(),re(),ce(),F(),V(),Ae(),$e(),_e()];var lt={plugins:[],options:{parallel:!1,onError:`continue`,logLevel:`info`,excludePatterns:$.excludePatterns}};export{lt as default,st as inputPlugins,ct as outputPlugins};
|