ccjk 12.0.0 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/agent-teams.mjs +17 -18
- package/dist/chunks/agent.mjs +105 -102
- package/dist/chunks/agents.mjs +87 -77
- package/dist/chunks/api-cli.mjs +41 -27
- package/dist/chunks/api-providers.mjs +2 -4
- package/dist/chunks/api.mjs +22 -11
- package/dist/chunks/auto-bootstrap.mjs +3 -5
- package/dist/chunks/auto-init.mjs +3 -4
- package/dist/chunks/auto-updater.mjs +103 -91
- package/dist/chunks/banner.mjs +41 -42
- package/dist/chunks/boost.mjs +30 -31
- package/dist/chunks/ccjk-agents.mjs +6 -9
- package/dist/chunks/ccjk-all.mjs +703 -85
- package/dist/chunks/ccjk-config.mjs +6 -6
- package/dist/chunks/ccjk-hooks.mjs +20 -9
- package/dist/chunks/ccjk-mcp.mjs +64 -52
- package/dist/chunks/ccjk-setup.mjs +35 -25
- package/dist/chunks/ccjk-skills.mjs +51 -41
- package/dist/chunks/ccr.mjs +42 -32
- package/dist/chunks/ccu.mjs +16 -12
- package/dist/chunks/check-updates.mjs +30 -19
- package/dist/chunks/claude-code-config-manager.mjs +25 -10
- package/dist/chunks/claude-code-incremental-manager.mjs +65 -51
- package/dist/chunks/claude-config.mjs +2 -2
- package/dist/chunks/claude-wrapper.mjs +9 -6
- package/dist/chunks/cleanup-migration.mjs +1 -1
- package/dist/chunks/cli-hook.mjs +10 -3
- package/dist/chunks/cloud-sync.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +58 -45
- package/dist/chunks/codex-provider-manager.mjs +29 -16
- package/dist/chunks/codex-uninstaller.mjs +5 -6
- package/dist/chunks/codex.mjs +89 -89
- package/dist/chunks/commands.mjs +28 -29
- package/dist/chunks/commands2.mjs +4 -3
- package/dist/chunks/commit.mjs +42 -23
- package/dist/chunks/completion.mjs +46 -47
- package/dist/chunks/config-consolidator.mjs +12 -13
- package/dist/chunks/config-switch.mjs +66 -53
- package/dist/chunks/config.mjs +10 -10
- package/dist/chunks/config2.mjs +53 -42
- package/dist/chunks/config3.mjs +107 -93
- package/dist/chunks/constants.mjs +2 -4
- package/dist/chunks/context-loader.mjs +5 -4
- package/dist/chunks/context.mjs +77 -76
- package/dist/chunks/convoy-manager.mjs +4 -4
- package/dist/chunks/dashboard.mjs +28 -29
- package/dist/chunks/doctor.mjs +68 -54
- package/dist/chunks/evolution.mjs +37 -38
- package/dist/chunks/features.mjs +103 -92
- package/dist/chunks/fs-operations.mjs +1 -1
- package/dist/chunks/health-alerts.mjs +1 -1
- package/dist/chunks/health-check.mjs +1 -1
- package/dist/chunks/help.mjs +117 -116
- package/dist/chunks/hook-installer.mjs +3 -2
- package/dist/chunks/index.mjs +20 -6
- package/dist/chunks/index10.mjs +1171 -0
- package/dist/chunks/index11.mjs +1008 -0
- package/dist/chunks/index12.mjs +193 -0
- package/dist/chunks/index13.mjs +218 -0
- package/dist/chunks/index14.mjs +663 -0
- package/dist/chunks/index2.mjs +19 -10
- package/dist/chunks/index3.mjs +19079 -164
- package/dist/chunks/index4.mjs +8 -1171
- package/dist/chunks/index5.mjs +7479 -884
- package/dist/chunks/index6.mjs +160 -184
- package/dist/chunks/index7.mjs +3573 -653
- package/dist/chunks/index8.mjs +19 -0
- package/dist/chunks/index9.mjs +616 -0
- package/dist/chunks/init.mjs +173 -173
- package/dist/chunks/installer.mjs +92 -82
- package/dist/chunks/installer2.mjs +3 -2
- package/dist/chunks/interview.mjs +118 -107
- package/dist/chunks/json-config.mjs +3 -2
- package/dist/chunks/linux.mjs +3863 -0
- package/dist/chunks/macos.mjs +69 -0
- package/dist/chunks/main.mjs +635 -0
- package/dist/chunks/marketplace.mjs +69 -66
- package/dist/chunks/mcp-cli.mjs +61 -48
- package/dist/chunks/mcp.mjs +140 -127
- package/dist/chunks/menu.mjs +85 -85
- package/dist/chunks/metrics-display.mjs +41 -40
- package/dist/chunks/migrator.mjs +4 -5
- package/dist/chunks/monitor.mjs +95 -95
- package/dist/chunks/notification.mjs +151 -141
- package/dist/chunks/onboarding.mjs +26 -15
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/paradigm.mjs +24 -23
- package/dist/chunks/permission-manager.mjs +10 -11
- package/dist/chunks/permissions.mjs +72 -57
- package/dist/chunks/persistence-manager.mjs +97 -84
- package/dist/chunks/persistence.mjs +1 -1
- package/dist/chunks/platform.mjs +29 -29
- package/dist/chunks/plugin.mjs +104 -105
- package/dist/chunks/prompts.mjs +36 -25
- package/dist/chunks/providers.mjs +68 -69
- package/dist/chunks/quick-actions.mjs +71 -72
- package/dist/chunks/quick-provider.mjs +56 -40
- package/dist/chunks/quick-setup.mjs +71 -60
- package/dist/chunks/remote.mjs +21 -12
- package/dist/chunks/session.mjs +116 -103
- package/dist/chunks/sessions.mjs +29 -28
- package/dist/chunks/silent-updater.mjs +8 -10
- package/dist/chunks/simple-config.mjs +13 -10
- package/dist/chunks/skill.mjs +8560 -103
- package/dist/chunks/skills-sync.mjs +5212 -79
- package/dist/chunks/skills.mjs +105 -94
- package/dist/chunks/slash-commands.mjs +36 -37
- package/dist/chunks/smart-defaults.mjs +7 -3
- package/dist/chunks/smart-guide.mjs +1 -1
- package/dist/chunks/startup.mjs +2 -4
- package/dist/chunks/stats.mjs +41 -42
- package/dist/chunks/status.mjs +49 -50
- package/dist/chunks/team.mjs +24 -12
- package/dist/chunks/thinking.mjs +74 -63
- package/dist/chunks/trace.mjs +20 -19
- package/dist/chunks/uninstall.mjs +69 -56
- package/dist/chunks/update.mjs +39 -28
- package/dist/chunks/upgrade-manager.mjs +24 -18
- package/dist/chunks/version-checker.mjs +45 -41
- package/dist/chunks/vim.mjs +81 -69
- package/dist/chunks/windows.mjs +14 -0
- package/dist/chunks/workflows.mjs +15 -15
- package/dist/chunks/wsl.mjs +129 -0
- package/dist/chunks/zero-config.mjs +45 -34
- package/dist/cli.mjs +20 -20
- package/dist/index.mjs +41 -31
- package/dist/shared/ccjk.BAGoDD49.mjs +36 -0
- package/dist/shared/ccjk.BBtCGd_g.mjs +899 -0
- package/dist/shared/{ccjk.CGcy7cNM.mjs → ccjk.BDKUdmLk.mjs} +1 -1
- package/dist/shared/{ccjk.DtMBiwVG.mjs → ccjk.BFxsJM0k.mjs} +1 -1
- package/dist/shared/{ccjk.j4uut26D.mjs → ccjk.BIxuVL3_.mjs} +5 -5
- package/dist/shared/ccjk.BRZ9ww8S.mjs +142 -0
- package/dist/shared/{ccjk.CN0edl87.mjs → ccjk.BSYWk9ML.mjs} +1 -1
- package/dist/shared/{ccjk.Dk1HDseQ.mjs → ccjk.BnpWvs9V.mjs} +75 -75
- package/dist/shared/ccjk.BoApaI4j.mjs +28 -0
- package/dist/shared/{ccjk.DKojSRzw.mjs → ccjk.BrPUmTqm.mjs} +1 -1
- package/dist/shared/{ccjk.C10pepYx.mjs → ccjk.BxSmJ8B7.mjs} +1 -1
- package/dist/shared/ccjk.Bx_rmYfN.mjs +69 -0
- package/dist/shared/ccjk.COweQ1RR.mjs +5 -0
- package/dist/shared/{ccjk.BN90X6oc.mjs → ccjk.CePkJq2S.mjs} +17 -17
- package/dist/shared/{ccjk.Bvoex4TZ.mjs → ccjk.CfKKcvWy.mjs} +1 -1
- package/dist/shared/ccjk.Cjgrln_h.mjs +297 -0
- package/dist/shared/ccjk.CxpGa6MC.mjs +2724 -0
- package/dist/shared/{ccjk.DfwJOEok.mjs → ccjk.D5MFQT7w.mjs} +1 -1
- package/dist/shared/{ccjk.cChAaGgT.mjs → ccjk.DG_o24cZ.mjs} +6 -6
- package/dist/shared/{ccjk.bhFAMRyc.mjs → ccjk.DLLw-h4Y.mjs} +32 -32
- package/dist/shared/ccjk.DOwtZMk8.mjs +4019 -0
- package/dist/shared/{ccjk.BsXQugfY.mjs → ccjk.DTdjs-qK.mjs} +13 -13
- package/dist/shared/{ccjk.Bdhyg3X-.mjs → ccjk.DsYaCCx4.mjs} +1 -1
- package/dist/shared/ccjk.KfSWcGlE.mjs +38 -0
- package/dist/shared/ccjk.RyizuzOI.mjs +21 -0
- package/dist/shared/{ccjk.h7_W-wTs.mjs → ccjk.SPoXMvZD.mjs} +1 -1
- package/dist/shared/ccjk.T_cX87dY.mjs +15 -0
- package/dist/shared/{ccjk.CrB6OYHv.mjs → ccjk._dESH4Rk.mjs} +2 -2
- package/dist/shared/ccjk.bQ7Dh1g4.mjs +249 -0
- package/dist/shared/{ccjk.CBhIZiPz.mjs → ccjk.hoqrwWdN.mjs} +1 -1
- package/dist/shared/{ccjk.BNwRnWYx.mjs → ccjk.s7OCVzdd.mjs} +1230 -33
- package/dist/shared/{ccjk.BOIUTf5z.mjs → ccjk.waa2ikKJ.mjs} +8 -9
- package/package.json +31 -30
- package/dist/shared/ccjk.DHbrGcgg.mjs +0 -13
- package/dist/shared/ccjk.DntgA8fQ.mjs +0 -42
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, rmSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { tmpdir, homedir } from 'node:os';
|
|
3
|
-
import {
|
|
4
|
-
import { x } from 'tinyexec';
|
|
3
|
+
import { x as K } from '../chunks/main.mjs';
|
|
5
4
|
import { CCJK_PLUGINS_DIR, CCJK_SKILLS_DIR, CLAUDE_AGENTS_DIR, CCJK_CONFIG_DIR } from '../chunks/constants.mjs';
|
|
6
|
-
import { w as writeAgentFile, g as getAgentsDir } from './ccjk.
|
|
5
|
+
import { w as writeAgentFile, g as getAgentsDir } from './ccjk.CfKKcvWy.mjs';
|
|
6
|
+
import { j as join, d as dirname } from './ccjk.bQ7Dh1g4.mjs';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
|
-
import { g as getSkillParser } from './ccjk.
|
|
8
|
+
import { g as getSkillParser } from './ccjk.DsYaCCx4.mjs';
|
|
9
9
|
|
|
10
10
|
const DEFAULT_MIN_CONFIDENCE = 0.6;
|
|
11
11
|
const PATTERN_WEIGHT = 0.4;
|
|
@@ -130,13 +130,13 @@ class IntentEngine {
|
|
|
130
130
|
return { isRepo: false, hasChanges: false, hasStaged: false };
|
|
131
131
|
}
|
|
132
132
|
try {
|
|
133
|
-
const statusResult = await
|
|
133
|
+
const statusResult = await K("git", ["status", "--porcelain"], { nodeOptions: { cwd } });
|
|
134
134
|
const hasChanges = statusResult.stdout.trim().length > 0;
|
|
135
|
-
const stagedResult = await
|
|
135
|
+
const stagedResult = await K("git", ["diff", "--cached", "--name-only"], { nodeOptions: { cwd } });
|
|
136
136
|
const hasStaged = stagedResult.stdout.trim().length > 0;
|
|
137
|
-
const branchResult = await
|
|
137
|
+
const branchResult = await K("git", ["branch", "--show-current"], { nodeOptions: { cwd } });
|
|
138
138
|
const branch = branchResult.stdout.trim();
|
|
139
|
-
const remoteResult = await
|
|
139
|
+
const remoteResult = await K("git", ["remote", "get-url", "origin"], { nodeOptions: { cwd } });
|
|
140
140
|
const remote = remoteResult.stdout.trim() || void 0;
|
|
141
141
|
return { isRepo, hasChanges, hasStaged, branch, remote };
|
|
142
142
|
} catch {
|
|
@@ -941,7 +941,7 @@ class PluginManager {
|
|
|
941
941
|
}
|
|
942
942
|
try {
|
|
943
943
|
const cloneUrl = `https://github.com/${owner}/${repoName}.git`;
|
|
944
|
-
await
|
|
944
|
+
await K("git", ["clone", "--depth", "1", ...ref ? ["--branch", ref] : [], cloneUrl, targetDir]);
|
|
945
945
|
if (subPath) {
|
|
946
946
|
const subDir = join(targetDir, subPath);
|
|
947
947
|
if (!existsSync(subDir)) {
|
|
@@ -949,9 +949,9 @@ class PluginManager {
|
|
|
949
949
|
return { success: false, pluginId: "", error: `Path ${subPath} not found in repo` };
|
|
950
950
|
}
|
|
951
951
|
const tempDir = `${targetDir}-temp`;
|
|
952
|
-
await
|
|
952
|
+
await K("mv", [subDir, tempDir]);
|
|
953
953
|
rmSync(targetDir, { recursive: true });
|
|
954
|
-
await
|
|
954
|
+
await K("mv", [tempDir, targetDir]);
|
|
955
955
|
}
|
|
956
956
|
const plugin = await this.loadPluginFromDirectory(targetDir);
|
|
957
957
|
if (!plugin) {
|
|
@@ -993,7 +993,7 @@ class PluginManager {
|
|
|
993
993
|
if (existsSync(targetDir) && !options.force) {
|
|
994
994
|
return { success: false, pluginId: "", error: "Plugin already installed. Use --force to reinstall." };
|
|
995
995
|
}
|
|
996
|
-
await
|
|
996
|
+
await K("cp", ["-r", path, targetDir]);
|
|
997
997
|
this.plugins.set(plugin.manifest.id, { ...plugin, source: { type: "local", path: targetDir } });
|
|
998
998
|
this.registerPluginIntents(plugin);
|
|
999
999
|
this.saveConfig();
|
|
@@ -1016,7 +1016,7 @@ class PluginManager {
|
|
|
1016
1016
|
async installFromNpm(packageName, _options = {}) {
|
|
1017
1017
|
const targetDir = join(PLUGINS_DIR, packageName.replace(/\//g, "-"));
|
|
1018
1018
|
try {
|
|
1019
|
-
await
|
|
1019
|
+
await K("npm", ["pack", packageName, "--pack-destination", targetDir]);
|
|
1020
1020
|
return { success: false, pluginId: "", error: "NPM installation not yet fully implemented" };
|
|
1021
1021
|
} catch (error) {
|
|
1022
1022
|
return {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function chunkify(iterable, chunkSize) {
|
|
2
|
+
if (typeof iterable[Symbol.iterator] !== 'function') {
|
|
3
|
+
throw new TypeError('Expected an `Iterable` in the first argument');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
if (!(Number.isSafeInteger(chunkSize) && chunkSize > 0)) {
|
|
7
|
+
throw new TypeError(`Expected \`chunkSize\` to be an integer from 1 and up, got \`${chunkSize}\``);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
* [Symbol.iterator]() {
|
|
12
|
+
if (Array.isArray(iterable)) {
|
|
13
|
+
for (let index = 0; index < iterable.length; index += chunkSize) {
|
|
14
|
+
yield iterable.slice(index, index + chunkSize);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let chunk = [];
|
|
21
|
+
|
|
22
|
+
for (const value of iterable) {
|
|
23
|
+
chunk.push(value);
|
|
24
|
+
|
|
25
|
+
if (chunk.length === chunkSize) {
|
|
26
|
+
yield chunk;
|
|
27
|
+
chunk = [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (chunk.length > 0) {
|
|
32
|
+
yield chunk;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { chunkify as c };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { g as getDefaultExportFromCjs } from './ccjk.BAGoDD49.mjs';
|
|
2
|
+
|
|
3
|
+
var dayjs_min$1 = {exports: {}};
|
|
4
|
+
|
|
5
|
+
var dayjs_min = dayjs_min$1.exports;
|
|
6
|
+
|
|
7
|
+
var hasRequiredDayjs_min;
|
|
8
|
+
|
|
9
|
+
function requireDayjs_min () {
|
|
10
|
+
if (hasRequiredDayjs_min) return dayjs_min$1.exports;
|
|
11
|
+
hasRequiredDayjs_min = 1;
|
|
12
|
+
(function (module, exports) {
|
|
13
|
+
!function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
|
|
14
|
+
} (dayjs_min$1));
|
|
15
|
+
return dayjs_min$1.exports;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var dayjs_minExports = requireDayjs_min();
|
|
19
|
+
const dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
|
|
20
|
+
|
|
21
|
+
export { dayjs as d };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { promisify } from 'node:util';
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { c as chunkify } from './ccjk.KfSWcGlE.mjs';
|
|
5
|
+
|
|
6
|
+
const pExecFile = promisify(execFile);
|
|
7
|
+
|
|
8
|
+
async function chunkedExec(binary, paths, maxPaths) {
|
|
9
|
+
for (const chunk of chunkify(paths, maxPaths)) {
|
|
10
|
+
// eslint-disable-next-line no-await-in-loop
|
|
11
|
+
await pExecFile(fileURLToPath(binary), chunk);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { chunkedExec as c };
|
|
@@ -3,8 +3,8 @@ import { existsSync } from 'node:fs';
|
|
|
3
3
|
import { readFile } from 'node:fs/promises';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
5
|
import { promisify } from 'node:util';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { i18n } from '../chunks/index5.mjs';
|
|
7
|
+
import { j as join } from './ccjk.bQ7Dh1g4.mjs';
|
|
8
8
|
|
|
9
9
|
const execAsync = promisify(exec);
|
|
10
10
|
function getClaudePluginDir() {
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
let _lazyMatch = () => { var __lib__=(()=>{var m=Object.defineProperty,V=Object.getOwnPropertyDescriptor,G=Object.getOwnPropertyNames,T=Object.prototype.hasOwnProperty,q=(r,e)=>{for(var n in e)m(r,n,{get:e[n],enumerable:true});},H=(r,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of G(e))!T.call(r,t)&&t!==n&&m(r,t,{get:()=>e[t],enumerable:!(a=V(e,t))||a.enumerable});return r},J=r=>H(m({},"__esModule",{value:true}),r),w={};q(w,{default:()=>re});var A=r=>Array.isArray(r),d=r=>typeof r=="function",Q=r=>r.length===0,W=r=>typeof r=="number",K=r=>typeof r=="object"&&r!==null,X=r=>r instanceof RegExp,b=r=>typeof r=="string",h=r=>r===void 0,Y=r=>{const e=new Map;return n=>{const a=e.get(n);if(a)return a;const t=r(n);return e.set(n,t),t}},rr=(r,e,n={})=>{const a={cache:{},input:r,index:0,indexMax:0,options:n,output:[]};if(v(e)(a)&&a.index===r.length)return a.output;throw new Error(`Failed to parse at index ${a.indexMax}`)},i=(r,e)=>A(r)?er(r,e):b(r)?ar(r,e):nr(r,e),er=(r,e)=>{const n={};for(const a of r){if(a.length!==1)throw new Error(`Invalid character: "${a}"`);const t=a.charCodeAt(0);n[t]=true;}return a=>{const t=a.index,o=a.input;for(;a.index<o.length&&o.charCodeAt(a.index)in n;)a.index+=1;const u=a.index;if(u>t){if(!h(e)&&!a.options.silent){const s=a.input.slice(t,u),c=d(e)?e(s,o,String(t)):e;h(c)||a.output.push(c);}a.indexMax=Math.max(a.indexMax,a.index);}return true}},nr=(r,e)=>{const n=r.source,a=r.flags.replace(/y|$/,"y"),t=new RegExp(n,a);return g(o=>{t.lastIndex=o.index;const u=t.exec(o.input);if(u){if(!h(e)&&!o.options.silent){const s=d(e)?e(...u,o.input,String(o.index)):e;h(s)||o.output.push(s);}return o.index+=u[0].length,o.indexMax=Math.max(o.indexMax,o.index),true}else return false})},ar=(r,e)=>n=>{if(n.input.startsWith(r,n.index)){if(!h(e)&&!n.options.silent){const t=d(e)?e(r,n.input,String(n.index)):e;h(t)||n.output.push(t);}return n.index+=r.length,n.indexMax=Math.max(n.indexMax,n.index),true}else return false},C=(r,e,n,a)=>{const t=v(r);return g(_(M(o=>{let u=0;for(;u<n;){const s=o.index;if(!t(o)||(u+=1,o.index===s))break}return u>=e})))},tr=(r,e)=>C(r,0,1),f=(r,e)=>C(r,0,1/0),x=(r,e)=>{const n=r.map(v);return g(_(M(a=>{for(let t=0,o=n.length;t<o;t++)if(!n[t](a))return false;return true})))},l=(r,e)=>{const n=r.map(v);return g(_(a=>{for(let t=0,o=n.length;t<o;t++)if(n[t](a))return true;return false}))},M=(r,e=false)=>{const n=v(r);return a=>{const t=a.index,o=a.output.length,u=n(a);return (!u||e)&&(a.index=t,a.output.length!==o&&(a.output.length=o)),u}},_=(r,e)=>{const n=v(r);return n},g=(()=>{let r=0;return e=>{const n=v(e),a=r+=1;return t=>{var o;if(t.options.memoization===false)return n(t);const u=t.index,s=(o=t.cache)[a]||(o[a]=new Map),c=s.get(u);if(c===false)return false;if(W(c))return t.index=c,true;if(c)return t.index=c.index,c.output?.length&&t.output.push(...c.output),true;{const Z=t.output.length;if(n(t)){const D=t.index,U=t.output.length;if(U>Z){const ee=t.output.slice(Z,U);s.set(u,{index:D,output:ee});}else s.set(u,D);return true}else return s.set(u,false),false}}}})(),E=r=>{let e;return n=>(e||(e=v(r())),e(n))},v=Y(r=>{if(d(r))return Q(r)?E(r):r;if(b(r)||X(r))return i(r);if(A(r))return x(r);if(K(r))return l(Object.values(r));throw new Error("Invalid rule")}),P="abcdefghijklmnopqrstuvwxyz",ir=r=>{let e="";for(;r>0;){const n=(r-1)%26;e=P[n]+e,r=Math.floor((r-1)/26);}return e},O=r=>{let e=0;for(let n=0,a=r.length;n<a;n++)e=e*26+P.indexOf(r[n])+1;return e},S=(r,e)=>{if(e<r)return S(e,r);const n=[];for(;r<=e;)n.push(r++);return n},or=(r,e,n)=>S(r,e).map(a=>String(a).padStart(n,"0")),R=(r,e)=>S(O(r),O(e)).map(ir),p=r=>r,z=r=>ur(e=>rr(e,r,{memoization:false}).join("")),ur=r=>{const e={};return n=>e[n]??(e[n]=r(n))},sr=i(/^\*\*\/\*$/,".*"),cr=i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(r,e,n)=>`.*${e?"":"(?:^|/)"}${n.replaceAll(".","\\.")}`),lr=i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(r,e,n,a)=>`.*${e?"":"(?:^|/)"}${n.replaceAll(".","\\.")}(?:${a.replaceAll(",","|").replaceAll(".","\\.")})`),y=i(/\\./,p),pr=i(/[$.*+?^(){}[\]\|]/,r=>`\\${r}`),vr=i(/./,p),hr=i(/^(?:!!)*!(.*)$/,(r,e)=>`(?!^${L(e)}$).*?`),dr=i(/^(!!)+/,""),fr=l([hr,dr]),xr=i(/\/(\*\*\/)+/,"(?:/.+/|/)"),gr=i(/^(\*\*\/)+/,"(?:^|.*/)"),mr=i(/\/(\*\*)$/,"(?:/.*|$)"),_r=i(/\*\*/,".*"),j=l([xr,gr,mr,_r]),Sr=i(/\*\/(?!\*\*\/)/,"[^/]*/"),yr=i(/\*/,"[^/]*"),N=l([Sr,yr]),k=i("?","[^/]"),$r=i("[",p),wr=i("]",p),Ar=i(/[!^]/,"^/"),br=i(/[a-z]-[a-z]|[0-9]-[0-9]/i,p),Cr=i(/[$.*+?^(){}[\|]/,r=>`\\${r}`),Mr=i(/[^\]]/,p),Er=l([y,Cr,br,Mr]),B=x([$r,tr(Ar),f(Er),wr]),Pr=i("{","(?:"),Or=i("}",")"),Rr=i(/(\d+)\.\.(\d+)/,(r,e,n)=>or(+e,+n,Math.min(e.length,n.length)).join("|")),zr=i(/([a-z]+)\.\.([a-z]+)/,(r,e,n)=>R(e,n).join("|")),jr=i(/([A-Z]+)\.\.([A-Z]+)/,(r,e,n)=>R(e.toLowerCase(),n.toLowerCase()).join("|").toUpperCase()),Nr=l([Rr,zr,jr]),I=x([Pr,Nr,Or]),kr=i("{","(?:"),Br=i("}",")"),Ir=i(",","|"),Fr=i(/[$.*+?^(){[\]\|]/,r=>`\\${r}`),Lr=i(/[^}]/,p),Zr=E(()=>F),Dr=l([j,N,k,B,I,Zr,y,Fr,Ir,Lr]),F=x([kr,f(Dr),Br]),Ur=f(l([sr,cr,lr,fr,j,N,k,B,I,F,y,pr,vr])),Vr=Ur,Gr=z(Vr),L=Gr,Tr=i(/\\./,p),qr=i(/./,p),Hr=i(/\*\*\*+/,"*"),Jr=i(/([^/{[(!])\*\*/,(r,e)=>`${e}*`),Qr=i(/(^|.)\*\*(?=[^*/)\]}])/,(r,e)=>`${e}*`),Wr=f(l([Tr,Hr,Jr,Qr,qr])),Kr=Wr,Xr=z(Kr),Yr=Xr,$=(r,e)=>{const n=Array.isArray(r)?r:[r];if(!n.length)return false;const a=n.map($.compile),t=n.every(s=>/(\/(?:\*\*)?|\[\/\])$/.test(s)),o=e.replace(/[\\\/]+/g,"/").replace(/\/$/,t?"/":"");return a.some(s=>s.test(o))};$.compile=r=>new RegExp(`^${L(Yr(r))}$`,"s");var re=$;return J(w)})();
|
|
2
|
+
return __lib__.default || __lib__; };
|
|
3
|
+
let _match;
|
|
4
|
+
const zeptomatch = (path, pattern) => {
|
|
5
|
+
if (!_match) {
|
|
6
|
+
_match = _lazyMatch();
|
|
7
|
+
_lazyMatch = null;
|
|
8
|
+
}
|
|
9
|
+
return _match(path, pattern);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
13
|
+
function normalizeWindowsPath(input = "") {
|
|
14
|
+
if (!input) {
|
|
15
|
+
return input;
|
|
16
|
+
}
|
|
17
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const _UNC_REGEX = /^[/\\]{2}/;
|
|
21
|
+
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
22
|
+
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
23
|
+
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
24
|
+
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
25
|
+
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
26
|
+
const sep = "/";
|
|
27
|
+
const normalize = function(path) {
|
|
28
|
+
if (path.length === 0) {
|
|
29
|
+
return ".";
|
|
30
|
+
}
|
|
31
|
+
path = normalizeWindowsPath(path);
|
|
32
|
+
const isUNCPath = path.match(_UNC_REGEX);
|
|
33
|
+
const isPathAbsolute = isAbsolute(path);
|
|
34
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
35
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
36
|
+
if (path.length === 0) {
|
|
37
|
+
if (isPathAbsolute) {
|
|
38
|
+
return "/";
|
|
39
|
+
}
|
|
40
|
+
return trailingSeparator ? "./" : ".";
|
|
41
|
+
}
|
|
42
|
+
if (trailingSeparator) {
|
|
43
|
+
path += "/";
|
|
44
|
+
}
|
|
45
|
+
if (_DRIVE_LETTER_RE.test(path)) {
|
|
46
|
+
path += "/";
|
|
47
|
+
}
|
|
48
|
+
if (isUNCPath) {
|
|
49
|
+
if (!isPathAbsolute) {
|
|
50
|
+
return `//./${path}`;
|
|
51
|
+
}
|
|
52
|
+
return `//${path}`;
|
|
53
|
+
}
|
|
54
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
55
|
+
};
|
|
56
|
+
const join = function(...segments) {
|
|
57
|
+
let path = "";
|
|
58
|
+
for (const seg of segments) {
|
|
59
|
+
if (!seg) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (path.length > 0) {
|
|
63
|
+
const pathTrailing = path[path.length - 1] === "/";
|
|
64
|
+
const segLeading = seg[0] === "/";
|
|
65
|
+
const both = pathTrailing && segLeading;
|
|
66
|
+
if (both) {
|
|
67
|
+
path += seg.slice(1);
|
|
68
|
+
} else {
|
|
69
|
+
path += pathTrailing || segLeading ? seg : `/${seg}`;
|
|
70
|
+
}
|
|
71
|
+
} else {
|
|
72
|
+
path += seg;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return normalize(path);
|
|
76
|
+
};
|
|
77
|
+
function cwd() {
|
|
78
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
79
|
+
return process.cwd().replace(/\\/g, "/");
|
|
80
|
+
}
|
|
81
|
+
return "/";
|
|
82
|
+
}
|
|
83
|
+
const resolve = function(...arguments_) {
|
|
84
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
85
|
+
let resolvedPath = "";
|
|
86
|
+
let resolvedAbsolute = false;
|
|
87
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
88
|
+
const path = index >= 0 ? arguments_[index] : cwd();
|
|
89
|
+
if (!path || path.length === 0) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
resolvedPath = `${path}/${resolvedPath}`;
|
|
93
|
+
resolvedAbsolute = isAbsolute(path);
|
|
94
|
+
}
|
|
95
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
96
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
97
|
+
return `/${resolvedPath}`;
|
|
98
|
+
}
|
|
99
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
100
|
+
};
|
|
101
|
+
function normalizeString(path, allowAboveRoot) {
|
|
102
|
+
let res = "";
|
|
103
|
+
let lastSegmentLength = 0;
|
|
104
|
+
let lastSlash = -1;
|
|
105
|
+
let dots = 0;
|
|
106
|
+
let char = null;
|
|
107
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
108
|
+
if (index < path.length) {
|
|
109
|
+
char = path[index];
|
|
110
|
+
} else if (char === "/") {
|
|
111
|
+
break;
|
|
112
|
+
} else {
|
|
113
|
+
char = "/";
|
|
114
|
+
}
|
|
115
|
+
if (char === "/") {
|
|
116
|
+
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
|
117
|
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
118
|
+
if (res.length > 2) {
|
|
119
|
+
const lastSlashIndex = res.lastIndexOf("/");
|
|
120
|
+
if (lastSlashIndex === -1) {
|
|
121
|
+
res = "";
|
|
122
|
+
lastSegmentLength = 0;
|
|
123
|
+
} else {
|
|
124
|
+
res = res.slice(0, lastSlashIndex);
|
|
125
|
+
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
126
|
+
}
|
|
127
|
+
lastSlash = index;
|
|
128
|
+
dots = 0;
|
|
129
|
+
continue;
|
|
130
|
+
} else if (res.length > 0) {
|
|
131
|
+
res = "";
|
|
132
|
+
lastSegmentLength = 0;
|
|
133
|
+
lastSlash = index;
|
|
134
|
+
dots = 0;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (allowAboveRoot) {
|
|
139
|
+
res += res.length > 0 ? "/.." : "..";
|
|
140
|
+
lastSegmentLength = 2;
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
if (res.length > 0) {
|
|
144
|
+
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
145
|
+
} else {
|
|
146
|
+
res = path.slice(lastSlash + 1, index);
|
|
147
|
+
}
|
|
148
|
+
lastSegmentLength = index - lastSlash - 1;
|
|
149
|
+
}
|
|
150
|
+
lastSlash = index;
|
|
151
|
+
dots = 0;
|
|
152
|
+
} else if (char === "." && dots !== -1) {
|
|
153
|
+
++dots;
|
|
154
|
+
} else {
|
|
155
|
+
dots = -1;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return res;
|
|
159
|
+
}
|
|
160
|
+
const isAbsolute = function(p) {
|
|
161
|
+
return _IS_ABSOLUTE_RE.test(p);
|
|
162
|
+
};
|
|
163
|
+
const toNamespacedPath = function(p) {
|
|
164
|
+
return normalizeWindowsPath(p);
|
|
165
|
+
};
|
|
166
|
+
const extname = function(p) {
|
|
167
|
+
if (p === "..") return "";
|
|
168
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
169
|
+
return match && match[1] || "";
|
|
170
|
+
};
|
|
171
|
+
const relative = function(from, to) {
|
|
172
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
173
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
174
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
175
|
+
return _to.join("/");
|
|
176
|
+
}
|
|
177
|
+
const _fromCopy = [..._from];
|
|
178
|
+
for (const segment of _fromCopy) {
|
|
179
|
+
if (_to[0] !== segment) {
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
_from.shift();
|
|
183
|
+
_to.shift();
|
|
184
|
+
}
|
|
185
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
186
|
+
};
|
|
187
|
+
const dirname = function(p) {
|
|
188
|
+
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
189
|
+
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
190
|
+
segments[0] += "/";
|
|
191
|
+
}
|
|
192
|
+
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
193
|
+
};
|
|
194
|
+
const format = function(p) {
|
|
195
|
+
const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
|
|
196
|
+
const segments = [p.root, p.dir, p.base ?? (p.name ?? "") + ext].filter(
|
|
197
|
+
Boolean
|
|
198
|
+
);
|
|
199
|
+
return normalizeWindowsPath(
|
|
200
|
+
p.root ? resolve(...segments) : segments.join("/")
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
const basename = function(p, extension) {
|
|
204
|
+
const segments = normalizeWindowsPath(p).split("/");
|
|
205
|
+
let lastSegment = "";
|
|
206
|
+
for (let i = segments.length - 1; i >= 0; i--) {
|
|
207
|
+
const val = segments[i];
|
|
208
|
+
if (val) {
|
|
209
|
+
lastSegment = val;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
214
|
+
};
|
|
215
|
+
const parse = function(p) {
|
|
216
|
+
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
217
|
+
const base = basename(p);
|
|
218
|
+
const extension = extname(base);
|
|
219
|
+
return {
|
|
220
|
+
root,
|
|
221
|
+
dir: dirname(p),
|
|
222
|
+
base,
|
|
223
|
+
ext: extension,
|
|
224
|
+
name: base.slice(0, base.length - extension.length)
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
const matchesGlob = (path, pattern) => {
|
|
228
|
+
return zeptomatch(pattern, normalize(path));
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
const _path = {
|
|
232
|
+
__proto__: null,
|
|
233
|
+
basename: basename,
|
|
234
|
+
dirname: dirname,
|
|
235
|
+
extname: extname,
|
|
236
|
+
format: format,
|
|
237
|
+
isAbsolute: isAbsolute,
|
|
238
|
+
join: join,
|
|
239
|
+
matchesGlob: matchesGlob,
|
|
240
|
+
normalize: normalize,
|
|
241
|
+
normalizeString: normalizeString,
|
|
242
|
+
parse: parse,
|
|
243
|
+
relative: relative,
|
|
244
|
+
resolve: resolve,
|
|
245
|
+
sep: sep,
|
|
246
|
+
toNamespacedPath: toNamespacedPath
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export { _path as _, normalizeString as a, basename as b, resolve as c, dirname as d, extname as e, format as f, isAbsolute as i, join as j, matchesGlob as m, normalize as n, parse as p, relative as r, sep as s, toNamespacedPath as t };
|