@chiendt/ack-cli 1.3.0-dev.6 → 1.3.0-dev.8
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/cli-manifest.json +2 -2
- package/dist/index.js +137 -107
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -63756,7 +63756,7 @@ var package_default;
|
|
|
63756
63756
|
var init_package = __esm(() => {
|
|
63757
63757
|
package_default = {
|
|
63758
63758
|
name: "@chiendt/ack-cli",
|
|
63759
|
-
version: "1.3.0-dev.
|
|
63759
|
+
version: "1.3.0-dev.8",
|
|
63760
63760
|
description: "ACK CLI - tool for bootstrapping and updating ACK kits (Claude Code agent kits)",
|
|
63761
63761
|
type: "module",
|
|
63762
63762
|
repository: {
|
|
@@ -72633,9 +72633,11 @@ var exports_npmrc_setup_step = {};
|
|
|
72633
72633
|
__export(exports_npmrc_setup_step, {
|
|
72634
72634
|
runNpmrcSetupStep: () => runNpmrcSetupStep
|
|
72635
72635
|
});
|
|
72636
|
+
import { execFile as execFile10 } from "node:child_process";
|
|
72636
72637
|
import { existsSync as existsSync66, readFileSync as readFileSync20 } from "node:fs";
|
|
72637
72638
|
import { homedir as homedir45 } from "node:os";
|
|
72638
72639
|
import { join as join96 } from "node:path";
|
|
72640
|
+
import { promisify as promisify12 } from "node:util";
|
|
72639
72641
|
function resolveTokenFromEnv() {
|
|
72640
72642
|
const fromProcess = process.env[TOKEN_ENV_KEY];
|
|
72641
72643
|
if (fromProcess && fromProcess.length > 0) {
|
|
@@ -72671,18 +72673,33 @@ function resolveTokenFromEnv() {
|
|
|
72671
72673
|
}
|
|
72672
72674
|
return null;
|
|
72673
72675
|
}
|
|
72676
|
+
async function smokeGitHubPackagesAuth() {
|
|
72677
|
+
try {
|
|
72678
|
+
const { stdout } = await execFileP("npm", ["view", "@chiendt1108/fqc-mcp-servers", "version"], {
|
|
72679
|
+
timeout: 15000
|
|
72680
|
+
});
|
|
72681
|
+
const version = stdout.trim();
|
|
72682
|
+
logger.info(import_picocolors19.default.green(`✓ GitHub Packages reachable — fqc-mcp-servers@${version}`));
|
|
72683
|
+
} catch (err) {
|
|
72684
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
72685
|
+
logger.info(import_picocolors19.default.yellow(`⚠ GitHub Packages smoke failed: ${msg.split(`
|
|
72686
|
+
`)[0]}
|
|
72687
|
+
Check token has 'read:packages' scope and is not expired.`));
|
|
72688
|
+
}
|
|
72689
|
+
}
|
|
72674
72690
|
async function writeNpmrcWithToken(pat, source) {
|
|
72675
72691
|
const npmrcPath = join96(homedir45(), ".npmrc");
|
|
72676
72692
|
try {
|
|
72677
72693
|
const result = await writeNpmrc(npmrcPath, buildGitHubPackagesEntries(pat));
|
|
72678
72694
|
if (result.noChange) {
|
|
72679
72695
|
logger.info(import_picocolors19.default.dim("~/.npmrc already up to date"));
|
|
72680
|
-
|
|
72696
|
+
} else {
|
|
72697
|
+
logger.info(import_picocolors19.default.green(`Wrote GitHub Packages config → ${npmrcPath}`));
|
|
72698
|
+
if (result.backupPath)
|
|
72699
|
+
logger.info(import_picocolors19.default.dim(` backup: ${result.backupPath}`));
|
|
72681
72700
|
}
|
|
72682
|
-
|
|
72683
|
-
|
|
72684
|
-
logger.info(import_picocolors19.default.dim(` backup: ${result.backupPath}`));
|
|
72685
|
-
return { status: "written", backupPath: result.backupPath, source };
|
|
72701
|
+
await smokeGitHubPackagesAuth();
|
|
72702
|
+
return result.noChange ? { status: "no-change", source } : { status: "written", backupPath: result.backupPath, source };
|
|
72686
72703
|
} catch (err) {
|
|
72687
72704
|
const msg = err instanceof Error ? err.message : String(err);
|
|
72688
72705
|
logger.error(`Failed to write ~/.npmrc: ${msg}`);
|
|
@@ -72717,6 +72734,14 @@ async function runNpmrcSetupStep(opts = {}) {
|
|
|
72717
72734
|
logger.info(import_picocolors19.default.yellow("--yes given — skipping interactive PAT prompt."));
|
|
72718
72735
|
return { status: "skipped-cancel" };
|
|
72719
72736
|
}
|
|
72737
|
+
const proceed = await se({
|
|
72738
|
+
message: "Set up GitHub Packages auth now?",
|
|
72739
|
+
initialValue: true
|
|
72740
|
+
});
|
|
72741
|
+
if (lD(proceed) || proceed === false) {
|
|
72742
|
+
logger.info(import_picocolors19.default.yellow("Skipped. Rerun with `ack fqc-qa-setup --npmrc-only` when ready."));
|
|
72743
|
+
return { status: "skipped-cancel" };
|
|
72744
|
+
}
|
|
72720
72745
|
const pat = await re({
|
|
72721
72746
|
message: "GitHub Personal Access Token (read:packages):",
|
|
72722
72747
|
validate: (value) => {
|
|
@@ -72734,12 +72759,13 @@ async function runNpmrcSetupStep(opts = {}) {
|
|
|
72734
72759
|
}
|
|
72735
72760
|
return writeNpmrcWithToken(pat, "prompt");
|
|
72736
72761
|
}
|
|
72737
|
-
var import_picocolors19, TOKEN_ENV_KEY = "FQC_GITHUB_PACKAGES_TOKEN";
|
|
72762
|
+
var import_picocolors19, execFileP, TOKEN_ENV_KEY = "FQC_GITHUB_PACKAGES_TOKEN";
|
|
72738
72763
|
var init_npmrc_setup_step = __esm(() => {
|
|
72739
72764
|
init_npmrc_bootstrap();
|
|
72740
72765
|
init_logger();
|
|
72741
72766
|
init_dist2();
|
|
72742
72767
|
import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
72768
|
+
execFileP = promisify12(execFile10);
|
|
72743
72769
|
});
|
|
72744
72770
|
|
|
72745
72771
|
// node_modules/picomatch/lib/constants.js
|
|
@@ -74847,8 +74873,8 @@ async function checkNeedsSudoPackages() {
|
|
|
74847
74873
|
return false;
|
|
74848
74874
|
}
|
|
74849
74875
|
const { exec: exec5 } = await import("node:child_process");
|
|
74850
|
-
const { promisify:
|
|
74851
|
-
const execAsync5 =
|
|
74876
|
+
const { promisify: promisify13 } = await import("node:util");
|
|
74877
|
+
const execAsync5 = promisify13(exec5);
|
|
74852
74878
|
try {
|
|
74853
74879
|
await Promise.all([
|
|
74854
74880
|
execAsync5("which ffmpeg", { timeout: WHICH_COMMAND_TIMEOUT_MS }),
|
|
@@ -77346,11 +77372,11 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
77346
77372
|
var { createWriteStream: createWriteStream3, promises: fs15 } = __require("fs");
|
|
77347
77373
|
var getStream = require_get_stream();
|
|
77348
77374
|
var path9 = __require("path");
|
|
77349
|
-
var { promisify:
|
|
77375
|
+
var { promisify: promisify13 } = __require("util");
|
|
77350
77376
|
var stream = __require("stream");
|
|
77351
77377
|
var yauzl = require_yauzl();
|
|
77352
|
-
var openZip =
|
|
77353
|
-
var pipeline =
|
|
77378
|
+
var openZip = promisify13(yauzl.open);
|
|
77379
|
+
var pipeline = promisify13(stream.pipeline);
|
|
77354
77380
|
|
|
77355
77381
|
class Extractor {
|
|
77356
77382
|
constructor(zipPath, opts) {
|
|
@@ -77435,7 +77461,7 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
77435
77461
|
if (isDir)
|
|
77436
77462
|
return;
|
|
77437
77463
|
debug("opening read stream", dest);
|
|
77438
|
-
const readStream = await
|
|
77464
|
+
const readStream = await promisify13(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
77439
77465
|
if (symlink4) {
|
|
77440
77466
|
const link = await getStream(readStream);
|
|
77441
77467
|
debug("creating symlink", link, dest);
|
|
@@ -91702,7 +91728,7 @@ init_logger();
|
|
|
91702
91728
|
|
|
91703
91729
|
// src/commands/fqc-qa/setup-pipeline.ts
|
|
91704
91730
|
init_logger();
|
|
91705
|
-
import { join as join93
|
|
91731
|
+
import { join as join93 } from "node:path";
|
|
91706
91732
|
|
|
91707
91733
|
// src/commands/fqc-qa/env-template-writer.ts
|
|
91708
91734
|
import { mkdirSync as mkdirSync4 } from "node:fs";
|
|
@@ -91809,19 +91835,42 @@ function runNpm(args, cwd2) {
|
|
|
91809
91835
|
});
|
|
91810
91836
|
}
|
|
91811
91837
|
|
|
91838
|
+
// src/commands/fqc-qa/mcp/mcp-spawn-helper.ts
|
|
91839
|
+
import { spawn as spawn6 } from "node:child_process";
|
|
91840
|
+
var MCP_PACKAGE_NAME = "@chiendt1108/fqc-mcp-servers";
|
|
91841
|
+
var MCP_PACKAGE_DIST_TAG = "latest";
|
|
91842
|
+
function spawnConnector(opts) {
|
|
91843
|
+
const env3 = { ...process.env, ...opts.env ?? {} };
|
|
91844
|
+
if (opts.useLocal) {
|
|
91845
|
+
return spawn6("fqc-mcp", [opts.connector, ...opts.args ?? []], {
|
|
91846
|
+
env: env3,
|
|
91847
|
+
stdio: ["pipe", "pipe", "inherit"]
|
|
91848
|
+
});
|
|
91849
|
+
}
|
|
91850
|
+
return spawn6("npx", [
|
|
91851
|
+
"-y",
|
|
91852
|
+
"-p",
|
|
91853
|
+
`${MCP_PACKAGE_NAME}@${MCP_PACKAGE_DIST_TAG}`,
|
|
91854
|
+
"fqc-mcp",
|
|
91855
|
+
opts.connector,
|
|
91856
|
+
...opts.args ?? []
|
|
91857
|
+
], { env: env3, stdio: ["pipe", "pipe", "inherit"] });
|
|
91858
|
+
}
|
|
91859
|
+
|
|
91812
91860
|
// src/commands/fqc-qa/mcp-entry-templates.ts
|
|
91813
|
-
var
|
|
91814
|
-
function mcpEntryTemplate(skillName
|
|
91861
|
+
var FQC_QA_PREFIX = "fqc-qa-";
|
|
91862
|
+
function mcpEntryTemplate(skillName) {
|
|
91815
91863
|
const env3 = ENV_FOR.get(skillName);
|
|
91816
91864
|
if (!env3)
|
|
91817
91865
|
return null;
|
|
91818
|
-
const
|
|
91819
|
-
|
|
91820
|
-
command: "
|
|
91821
|
-
args: [
|
|
91822
|
-
cwd: `${relPosix}/${skillName}/scripts`,
|
|
91823
|
-
env: env3
|
|
91866
|
+
const connector = skillName.slice(FQC_QA_PREFIX.length);
|
|
91867
|
+
const entry = {
|
|
91868
|
+
command: "npx",
|
|
91869
|
+
args: ["-y", "-p", `${MCP_PACKAGE_NAME}@${MCP_PACKAGE_DIST_TAG}`, "fqc-mcp", connector]
|
|
91824
91870
|
};
|
|
91871
|
+
if (Object.keys(env3).length > 0)
|
|
91872
|
+
entry.env = env3;
|
|
91873
|
+
return entry;
|
|
91825
91874
|
}
|
|
91826
91875
|
var ENV_FOR = new Map([
|
|
91827
91876
|
["fqc-qa-jira", { JIRA_BASE_URL: "${JIRA_BASE_URL}", JIRA_PAT: "${JIRA_PAT}" }],
|
|
@@ -91952,14 +92001,13 @@ async function runSetup(skills, ctx) {
|
|
|
91952
92001
|
results.push(r2);
|
|
91953
92002
|
}
|
|
91954
92003
|
const mcpSkills = skills.filter((s) => s.kind === "mcp" && !results.find((r2) => r2.skill === s)?.error);
|
|
91955
|
-
const skillsRelToProject = relative17(ctx.projectRoot, ctx.skillsRoot) || ".";
|
|
91956
92004
|
let mcpBackupPath = null;
|
|
91957
92005
|
if (mcpSkills.length > 0 && !ctx.dryRun) {
|
|
91958
92006
|
try {
|
|
91959
92007
|
const mutation = await withLockedMcpJson(ctx.mcpJsonPath, (parsed) => {
|
|
91960
92008
|
parsed.mcpServers ??= {};
|
|
91961
92009
|
for (const s of mcpSkills) {
|
|
91962
|
-
const entry = mcpEntryTemplate(s.name
|
|
92010
|
+
const entry = mcpEntryTemplate(s.name);
|
|
91963
92011
|
if (!entry) {
|
|
91964
92012
|
const r3 = results.find((x3) => x3.skill === s);
|
|
91965
92013
|
if (r3)
|
|
@@ -92005,7 +92053,7 @@ function defaultMcpJsonPath(projectRoot) {
|
|
|
92005
92053
|
var import_gray_matter12 = __toESM(require_gray_matter(), 1);
|
|
92006
92054
|
import { existsSync as existsSync63, readFileSync as readFileSync18, readdirSync as readdirSync7, statSync as statSync11 } from "node:fs";
|
|
92007
92055
|
import { basename as basename26, join as join94, resolve as resolve36 } from "node:path";
|
|
92008
|
-
var
|
|
92056
|
+
var FQC_QA_PREFIX2 = "fqc-qa-";
|
|
92009
92057
|
var VALID_KINDS = new Set(["mcp", "lib", "gate"]);
|
|
92010
92058
|
function deriveDirName(skillDir) {
|
|
92011
92059
|
return basename26(skillDir.replace(/\\/g, "/"));
|
|
@@ -92042,14 +92090,14 @@ function resolveSkillsRoot(opts = {}) {
|
|
|
92042
92090
|
}
|
|
92043
92091
|
function hasFqcQaChild(dir) {
|
|
92044
92092
|
try {
|
|
92045
|
-
return readdirSync7(dir).some((n) => n.startsWith(
|
|
92093
|
+
return readdirSync7(dir).some((n) => n.startsWith(FQC_QA_PREFIX2));
|
|
92046
92094
|
} catch {
|
|
92047
92095
|
return false;
|
|
92048
92096
|
}
|
|
92049
92097
|
}
|
|
92050
92098
|
function discoverSkills2(opts = {}) {
|
|
92051
92099
|
const root = resolveSkillsRoot(opts);
|
|
92052
|
-
const entries = readdirSync7(root).filter((n) => n.startsWith(
|
|
92100
|
+
const entries = readdirSync7(root).filter((n) => n.startsWith(FQC_QA_PREFIX2)).map((n) => join94(root, n)).filter((p) => {
|
|
92053
92101
|
try {
|
|
92054
92102
|
return statSync11(p).isDirectory();
|
|
92055
92103
|
} catch {
|
|
@@ -92069,7 +92117,7 @@ function discoverSkills2(opts = {}) {
|
|
|
92069
92117
|
}
|
|
92070
92118
|
const dirName = deriveDirName(skillDir);
|
|
92071
92119
|
const registeredName = String(fm.name ?? dirName);
|
|
92072
|
-
const shortName = dirName.replace(
|
|
92120
|
+
const shortName = dirName.replace(FQC_QA_PREFIX2, "");
|
|
92073
92121
|
const scriptsDir = join94(skillDir, "scripts");
|
|
92074
92122
|
const hasScripts2 = existsSync63(join94(scriptsDir, "package.json"));
|
|
92075
92123
|
const hasLockfile = existsSync63(join94(scriptsDir, "package-lock.json"));
|
|
@@ -92569,11 +92617,11 @@ var FQC_QA_CONNECTOR_NAMES = [
|
|
|
92569
92617
|
"akawork"
|
|
92570
92618
|
];
|
|
92571
92619
|
var FQC_QA_KEY_RE = /^fqc-qa-([a-z]+)$/i;
|
|
92572
|
-
var
|
|
92620
|
+
var MCP_PACKAGE_NAME2 = "@chiendt1108/fqc-mcp-servers";
|
|
92573
92621
|
function buildEntry(connector, distTag, existingEnv) {
|
|
92574
92622
|
const entry = {
|
|
92575
92623
|
command: "npx",
|
|
92576
|
-
args: ["-y", "-p", `${
|
|
92624
|
+
args: ["-y", "-p", `${MCP_PACKAGE_NAME2}@${distTag}`, "fqc-mcp", connector]
|
|
92577
92625
|
};
|
|
92578
92626
|
if (existingEnv && Object.keys(existingEnv).length > 0) {
|
|
92579
92627
|
entry.env = existingEnv;
|
|
@@ -92612,35 +92660,13 @@ function isAlreadyMigrated(input) {
|
|
|
92612
92660
|
if (!m2)
|
|
92613
92661
|
continue;
|
|
92614
92662
|
const cmd = entry.command;
|
|
92615
|
-
if (cmd !== "npx" || !entry.args?.some((a3) => typeof a3 === "string" && a3.startsWith(
|
|
92663
|
+
if (cmd !== "npx" || !entry.args?.some((a3) => typeof a3 === "string" && a3.startsWith(MCP_PACKAGE_NAME2))) {
|
|
92616
92664
|
return false;
|
|
92617
92665
|
}
|
|
92618
92666
|
}
|
|
92619
92667
|
return true;
|
|
92620
92668
|
}
|
|
92621
92669
|
|
|
92622
|
-
// src/commands/fqc-qa/mcp/mcp-spawn-helper.ts
|
|
92623
|
-
import { spawn as spawn6 } from "node:child_process";
|
|
92624
|
-
var MCP_PACKAGE_NAME2 = "@chiendt1108/fqc-mcp-servers";
|
|
92625
|
-
var MCP_PACKAGE_DIST_TAG = "latest";
|
|
92626
|
-
function spawnConnector(opts) {
|
|
92627
|
-
const env3 = { ...process.env, ...opts.env ?? {} };
|
|
92628
|
-
if (opts.useLocal) {
|
|
92629
|
-
return spawn6("fqc-mcp", [opts.connector, ...opts.args ?? []], {
|
|
92630
|
-
env: env3,
|
|
92631
|
-
stdio: ["pipe", "pipe", "inherit"]
|
|
92632
|
-
});
|
|
92633
|
-
}
|
|
92634
|
-
return spawn6("npx", [
|
|
92635
|
-
"-y",
|
|
92636
|
-
"-p",
|
|
92637
|
-
`${MCP_PACKAGE_NAME2}@${MCP_PACKAGE_DIST_TAG}`,
|
|
92638
|
-
"fqc-mcp",
|
|
92639
|
-
opts.connector,
|
|
92640
|
-
...opts.args ?? []
|
|
92641
|
-
], { env: env3, stdio: ["pipe", "pipe", "inherit"] });
|
|
92642
|
-
}
|
|
92643
|
-
|
|
92644
92670
|
// src/commands/fqc-qa/fqc-qa-migrate-mcp-command.ts
|
|
92645
92671
|
async function fqcQaMigrateMcpCommand(opts) {
|
|
92646
92672
|
const projectRoot = process.cwd();
|
|
@@ -92826,7 +92852,7 @@ async function fqcQaMcpGatewayCommand(opts) {
|
|
|
92826
92852
|
const args = ["gateway", "--port", port];
|
|
92827
92853
|
if (opts.only)
|
|
92828
92854
|
args.push("--only", opts.only);
|
|
92829
|
-
const child = opts.useLocal ? spawn7("fqc-mcp", args, { stdio: "inherit" }) : spawn7("npx", ["-y", "-p", `${
|
|
92855
|
+
const child = opts.useLocal ? spawn7("fqc-mcp", args, { stdio: "inherit" }) : spawn7("npx", ["-y", "-p", `${MCP_PACKAGE_NAME}@${MCP_PACKAGE_DIST_TAG}`, "fqc-mcp", ...args], {
|
|
92830
92856
|
stdio: "inherit"
|
|
92831
92857
|
});
|
|
92832
92858
|
const stop = () => {
|
|
@@ -92867,7 +92893,7 @@ async function fqcQaMcpServeCommand(opts) {
|
|
|
92867
92893
|
process.exitCode = 1;
|
|
92868
92894
|
return;
|
|
92869
92895
|
}
|
|
92870
|
-
const child = opts.useLocal ? spawn8("fqc-mcp", [connector], { stdio: "inherit" }) : spawn8("npx", ["-y", "-p", `${
|
|
92896
|
+
const child = opts.useLocal ? spawn8("fqc-mcp", [connector], { stdio: "inherit" }) : spawn8("npx", ["-y", "-p", `${MCP_PACKAGE_NAME}@${MCP_PACKAGE_DIST_TAG}`, "fqc-mcp", connector], {
|
|
92871
92897
|
stdio: "inherit"
|
|
92872
92898
|
});
|
|
92873
92899
|
await new Promise((resolve37, reject) => {
|
|
@@ -92891,13 +92917,13 @@ init_config_version_checker();
|
|
|
92891
92917
|
|
|
92892
92918
|
// src/domains/sync/sync-engine.ts
|
|
92893
92919
|
import { lstat as lstat6, readFile as readFile49, readlink as readlink2, realpath as realpath7, stat as stat14 } from "node:fs/promises";
|
|
92894
|
-
import { isAbsolute as isAbsolute10, join as join98, normalize as normalize8, relative as
|
|
92920
|
+
import { isAbsolute as isAbsolute10, join as join98, normalize as normalize8, relative as relative18 } from "node:path";
|
|
92895
92921
|
|
|
92896
92922
|
// src/services/file-operations/ownership-checker.ts
|
|
92897
92923
|
init_metadata_migration();
|
|
92898
92924
|
import { createHash as createHash7 } from "node:crypto";
|
|
92899
92925
|
import { readFile as readFile48, stat as stat13 } from "node:fs/promises";
|
|
92900
|
-
import { relative as
|
|
92926
|
+
import { relative as relative17 } from "node:path";
|
|
92901
92927
|
|
|
92902
92928
|
// src/shared/concurrent-file-ops.ts
|
|
92903
92929
|
init_p_limit();
|
|
@@ -92927,7 +92953,7 @@ class OwnershipChecker {
|
|
|
92927
92953
|
if (!metadata || allTrackedFiles.length === 0) {
|
|
92928
92954
|
return { path: filePath, ownership: "user", exists: true };
|
|
92929
92955
|
}
|
|
92930
|
-
const relativePath =
|
|
92956
|
+
const relativePath = relative17(claudeDir3, filePath).replace(/\\/g, "/");
|
|
92931
92957
|
const tracked = allTrackedFiles.find((f3) => f3.path.replace(/\\/g, "/") === relativePath);
|
|
92932
92958
|
if (!tracked) {
|
|
92933
92959
|
return { path: filePath, ownership: "user", exists: true };
|
|
@@ -93739,7 +93765,7 @@ async function validateSymlinkChain(path9, basePath, maxDepth = MAX_SYMLINK_DEPT
|
|
|
93739
93765
|
const target = await readlink2(current);
|
|
93740
93766
|
const resolvedTarget = isAbsolute10(target) ? target : join98(current, "..", target);
|
|
93741
93767
|
const normalizedTarget = normalize8(resolvedTarget);
|
|
93742
|
-
const rel =
|
|
93768
|
+
const rel = relative18(basePath, normalizedTarget);
|
|
93743
93769
|
if (rel.startsWith("..") || isAbsolute10(rel)) {
|
|
93744
93770
|
throw new Error(`Symlink chain escapes base directory at depth ${depth}: ${path9}`);
|
|
93745
93771
|
}
|
|
@@ -93774,7 +93800,7 @@ async function validateSyncPath(basePath, filePath) {
|
|
|
93774
93800
|
throw new Error(`Path traversal not allowed: ${filePath}`);
|
|
93775
93801
|
}
|
|
93776
93802
|
const fullPath = join98(basePath, normalized);
|
|
93777
|
-
const rel =
|
|
93803
|
+
const rel = relative18(basePath, fullPath);
|
|
93778
93804
|
if (rel.startsWith("..") || isAbsolute10(rel)) {
|
|
93779
93805
|
throw new Error(`Path escapes base directory: ${filePath}`);
|
|
93780
93806
|
}
|
|
@@ -93782,7 +93808,7 @@ async function validateSyncPath(basePath, filePath) {
|
|
|
93782
93808
|
try {
|
|
93783
93809
|
const resolvedBase = await realpath7(basePath);
|
|
93784
93810
|
const resolvedFull = await realpath7(fullPath);
|
|
93785
|
-
const resolvedRel =
|
|
93811
|
+
const resolvedRel = relative18(resolvedBase, resolvedFull);
|
|
93786
93812
|
if (resolvedRel.startsWith("..") || isAbsolute10(resolvedRel)) {
|
|
93787
93813
|
throw new Error(`Symlink escapes base directory: ${filePath}`);
|
|
93788
93814
|
}
|
|
@@ -93792,7 +93818,7 @@ async function validateSyncPath(basePath, filePath) {
|
|
|
93792
93818
|
try {
|
|
93793
93819
|
const resolvedBase = await realpath7(basePath);
|
|
93794
93820
|
const resolvedParent = await realpath7(parentPath);
|
|
93795
|
-
const resolvedRel =
|
|
93821
|
+
const resolvedRel = relative18(resolvedBase, resolvedParent);
|
|
93796
93822
|
if (resolvedRel.startsWith("..") || isAbsolute10(resolvedRel)) {
|
|
93797
93823
|
throw new Error(`Parent symlink escapes base directory: ${filePath}`);
|
|
93798
93824
|
}
|
|
@@ -95321,7 +95347,7 @@ init_types3();
|
|
|
95321
95347
|
// src/domains/installation/utils/path-security.ts
|
|
95322
95348
|
init_types3();
|
|
95323
95349
|
import { lstatSync as lstatSync2, realpathSync as realpathSync4 } from "node:fs";
|
|
95324
|
-
import { relative as
|
|
95350
|
+
import { relative as relative19, resolve as resolve39 } from "node:path";
|
|
95325
95351
|
var MAX_EXTRACTION_SIZE = 500 * 1024 * 1024;
|
|
95326
95352
|
function isPathSafe(basePath, targetPath) {
|
|
95327
95353
|
const resolvedBase = resolve39(basePath);
|
|
@@ -95335,7 +95361,7 @@ function isPathSafe(basePath, targetPath) {
|
|
|
95335
95361
|
}
|
|
95336
95362
|
} catch {}
|
|
95337
95363
|
const resolvedTarget = resolve39(targetPath);
|
|
95338
|
-
const relativePath =
|
|
95364
|
+
const relativePath = relative19(resolvedBase, resolvedTarget);
|
|
95339
95365
|
return !relativePath.startsWith("..") && !relativePath.startsWith("/") && resolvedTarget.startsWith(resolvedBase);
|
|
95340
95366
|
}
|
|
95341
95367
|
|
|
@@ -98806,7 +98832,7 @@ function decodeFilePath(path9) {
|
|
|
98806
98832
|
init_logger();
|
|
98807
98833
|
init_types3();
|
|
98808
98834
|
import { copyFile as copyFile4, lstat as lstat7, mkdir as mkdir27, readdir as readdir24, realpath as realpath8, rm as rm12 } from "node:fs/promises";
|
|
98809
|
-
import { join as join109, relative as
|
|
98835
|
+
import { join as join109, relative as relative20 } from "node:path";
|
|
98810
98836
|
async function withRetry(fn2, retries = 3) {
|
|
98811
98837
|
for (let i = 0;i < retries; i++) {
|
|
98812
98838
|
try {
|
|
@@ -98866,7 +98892,7 @@ async function moveDirectoryContents(sourceDir, destDir, shouldExclude, sizeTrac
|
|
|
98866
98892
|
for (const entry of entries) {
|
|
98867
98893
|
const sourcePath = join109(sourceDir, entry);
|
|
98868
98894
|
const destPath = join109(destDir, entry);
|
|
98869
|
-
const relativePath =
|
|
98895
|
+
const relativePath = relative20(sourceDir, sourcePath);
|
|
98870
98896
|
if (!isPathSafe(destDir, destPath)) {
|
|
98871
98897
|
logger.warning(`Skipping unsafe path: ${relativePath}`);
|
|
98872
98898
|
throw new ExtractionError(`Path traversal attempt detected: ${relativePath}`);
|
|
@@ -98894,7 +98920,7 @@ async function copyDirectory(sourceDir, destDir, shouldExclude, sizeTracker) {
|
|
|
98894
98920
|
for (const entry of entries) {
|
|
98895
98921
|
const sourcePath = join109(sourceDir, entry);
|
|
98896
98922
|
const destPath = join109(destDir, entry);
|
|
98897
|
-
const relativePath =
|
|
98923
|
+
const relativePath = relative20(sourceDir, sourcePath);
|
|
98898
98924
|
if (!isPathSafe(destDir, destPath)) {
|
|
98899
98925
|
logger.warning(`Skipping unsafe path: ${relativePath}`);
|
|
98900
98926
|
throw new ExtractionError(`Path traversal attempt detected: ${relativePath}`);
|
|
@@ -98993,10 +99019,10 @@ class TarExtractor {
|
|
|
98993
99019
|
// src/domains/installation/extraction/zip-extractor.ts
|
|
98994
99020
|
init_logger();
|
|
98995
99021
|
var import_extract_zip = __toESM(require_extract_zip(), 1);
|
|
98996
|
-
import { execFile as
|
|
99022
|
+
import { execFile as execFile11 } from "node:child_process";
|
|
98997
99023
|
import { copyFile as copyFile6, mkdir as mkdir29, readdir as readdir26, rm as rm14, stat as stat16 } from "node:fs/promises";
|
|
98998
99024
|
import { join as join111 } from "node:path";
|
|
98999
|
-
import { promisify as
|
|
99025
|
+
import { promisify as promisify13 } from "node:util";
|
|
99000
99026
|
|
|
99001
99027
|
// src/domains/installation/extraction/native-zip-commands.ts
|
|
99002
99028
|
var NATIVE_EXTRACT_TIMEOUT_MS = 120000;
|
|
@@ -99035,7 +99061,7 @@ function getNativeZipCommands(archivePath, destDir, platformName = process.platf
|
|
|
99035
99061
|
}
|
|
99036
99062
|
|
|
99037
99063
|
// src/domains/installation/extraction/zip-extractor.ts
|
|
99038
|
-
var execFileAsync7 =
|
|
99064
|
+
var execFileAsync7 = promisify13(execFile11);
|
|
99039
99065
|
|
|
99040
99066
|
class ZipExtractor {
|
|
99041
99067
|
async tryNativeExtraction(archivePath, destDir) {
|
|
@@ -99687,7 +99713,7 @@ import { join as join129 } from "node:path";
|
|
|
99687
99713
|
|
|
99688
99714
|
// src/domains/installation/deletion-handler.ts
|
|
99689
99715
|
import { existsSync as existsSync71, lstatSync as lstatSync3, readdirSync as readdirSync8, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync5 } from "node:fs";
|
|
99690
|
-
import { dirname as dirname36, join as join115, relative as
|
|
99716
|
+
import { dirname as dirname36, join as join115, relative as relative21, resolve as resolve41, sep as sep11 } from "node:path";
|
|
99691
99717
|
|
|
99692
99718
|
// src/services/file-operations/manifest/manifest-reader.ts
|
|
99693
99719
|
init_metadata_migration();
|
|
@@ -99883,7 +99909,7 @@ function collectFilesRecursively(dir, baseDir) {
|
|
|
99883
99909
|
const entries = readdirSync8(dir, { withFileTypes: true });
|
|
99884
99910
|
for (const entry of entries) {
|
|
99885
99911
|
const fullPath = join115(dir, entry.name);
|
|
99886
|
-
const relativePath =
|
|
99912
|
+
const relativePath = relative21(baseDir, fullPath);
|
|
99887
99913
|
if (entry.isDirectory()) {
|
|
99888
99914
|
results.push(...collectFilesRecursively(fullPath, baseDir));
|
|
99889
99915
|
} else {
|
|
@@ -100045,7 +100071,7 @@ init_logger();
|
|
|
100045
100071
|
init_types3();
|
|
100046
100072
|
var import_fs_extra15 = __toESM(require_lib(), 1);
|
|
100047
100073
|
var import_ignore3 = __toESM(require_ignore(), 1);
|
|
100048
|
-
import { dirname as dirname39, join as join119, relative as
|
|
100074
|
+
import { dirname as dirname39, join as join119, relative as relative23 } from "node:path";
|
|
100049
100075
|
|
|
100050
100076
|
// src/domains/installation/selective-merger.ts
|
|
100051
100077
|
import { stat as stat18 } from "node:fs/promises";
|
|
@@ -100223,7 +100249,7 @@ class SelectiveMerger {
|
|
|
100223
100249
|
init_logger();
|
|
100224
100250
|
var import_fs_extra13 = __toESM(require_lib(), 1);
|
|
100225
100251
|
var import_ignore2 = __toESM(require_ignore(), 1);
|
|
100226
|
-
import { relative as
|
|
100252
|
+
import { relative as relative22 } from "node:path";
|
|
100227
100253
|
import { join as join116 } from "node:path";
|
|
100228
100254
|
|
|
100229
100255
|
// node_modules/balanced-match/dist/esm/index.js
|
|
@@ -101926,7 +101952,7 @@ class FileScanner {
|
|
|
101926
101952
|
const entries = await import_fs_extra13.readdir(dir, { encoding: "utf8" });
|
|
101927
101953
|
for (const entry of entries) {
|
|
101928
101954
|
const fullPath = join116(dir, entry);
|
|
101929
|
-
const relativePath =
|
|
101955
|
+
const relativePath = relative22(baseDir, fullPath);
|
|
101930
101956
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
101931
101957
|
const stats = await import_fs_extra13.lstat(fullPath);
|
|
101932
101958
|
if (stats.isSymbolicLink()) {
|
|
@@ -102628,7 +102654,7 @@ class CopyExecutor {
|
|
|
102628
102654
|
const conflicts = [];
|
|
102629
102655
|
const files = await this.fileScanner.getFiles(sourceDir, sourceDir);
|
|
102630
102656
|
for (const file of files) {
|
|
102631
|
-
const relativePath =
|
|
102657
|
+
const relativePath = relative23(sourceDir, file);
|
|
102632
102658
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
102633
102659
|
const destPath = join119(destDir, relativePath);
|
|
102634
102660
|
if (await import_fs_extra15.pathExists(destPath)) {
|
|
@@ -102650,7 +102676,7 @@ class CopyExecutor {
|
|
|
102650
102676
|
let copiedCount = 0;
|
|
102651
102677
|
let skippedCount = 0;
|
|
102652
102678
|
for (const file of files) {
|
|
102653
|
-
const relativePath =
|
|
102679
|
+
const relativePath = relative23(sourceDir, file);
|
|
102654
102680
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
102655
102681
|
const destPath = join119(destDir, relativePath);
|
|
102656
102682
|
if (this.fileScanner.shouldNeverCopy(normalizedRelativePath)) {
|
|
@@ -102825,7 +102851,7 @@ class FileMerger {
|
|
|
102825
102851
|
|
|
102826
102852
|
// src/domains/migration/legacy-migration.ts
|
|
102827
102853
|
import { readdir as readdir28, stat as stat19 } from "node:fs/promises";
|
|
102828
|
-
import { join as join123, relative as
|
|
102854
|
+
import { join as join123, relative as relative24 } from "node:path";
|
|
102829
102855
|
// src/services/file-operations/manifest/manifest-tracker.ts
|
|
102830
102856
|
import { join as join122 } from "node:path";
|
|
102831
102857
|
|
|
@@ -103278,7 +103304,7 @@ class LegacyMigration {
|
|
|
103278
103304
|
static async classifyFiles(claudeDir3, manifest) {
|
|
103279
103305
|
const files = await LegacyMigration.scanFiles(claudeDir3);
|
|
103280
103306
|
const relevantFiles = files.filter((file) => {
|
|
103281
|
-
const relativePath =
|
|
103307
|
+
const relativePath = relative24(claudeDir3, file);
|
|
103282
103308
|
return !hasSkippedDirectorySegment(relativePath);
|
|
103283
103309
|
});
|
|
103284
103310
|
const skippedRuntimeArtifacts = files.length - relevantFiles.length;
|
|
@@ -103293,7 +103319,7 @@ class LegacyMigration {
|
|
|
103293
103319
|
};
|
|
103294
103320
|
const filesInManifest = [];
|
|
103295
103321
|
for (const file of relevantFiles) {
|
|
103296
|
-
const relativePath =
|
|
103322
|
+
const relativePath = relative24(claudeDir3, file).replace(/\\/g, "/");
|
|
103297
103323
|
const manifestEntry = ReleaseManifestLoader.findFile(manifest, relativePath);
|
|
103298
103324
|
if (!manifestEntry) {
|
|
103299
103325
|
preview.userCreated.push(relativePath);
|
|
@@ -103489,7 +103515,7 @@ function buildConflictSummary(fileConflicts, hookConflicts, mcpConflicts) {
|
|
|
103489
103515
|
init_logger();
|
|
103490
103516
|
init_skip_directories();
|
|
103491
103517
|
var import_fs_extra19 = __toESM(require_lib(), 1);
|
|
103492
|
-
import { join as join124, relative as
|
|
103518
|
+
import { join as join124, relative as relative25, resolve as resolve43 } from "node:path";
|
|
103493
103519
|
|
|
103494
103520
|
class FileScanner2 {
|
|
103495
103521
|
static async getFiles(dirPath, relativeTo) {
|
|
@@ -103528,7 +103554,7 @@ class FileScanner2 {
|
|
|
103528
103554
|
const subFiles = await FileScanner2.getFiles(fullPath, basePath);
|
|
103529
103555
|
files.push(...subFiles);
|
|
103530
103556
|
} else if (stats.isFile()) {
|
|
103531
|
-
const relativePath =
|
|
103557
|
+
const relativePath = relative25(basePath, fullPath);
|
|
103532
103558
|
files.push(FileScanner2.toPosixPath(relativePath));
|
|
103533
103559
|
}
|
|
103534
103560
|
}
|
|
@@ -104194,7 +104220,7 @@ init_types3();
|
|
|
104194
104220
|
var import_fs_extra24 = __toESM(require_lib(), 1);
|
|
104195
104221
|
import { createHash as createHash8 } from "node:crypto";
|
|
104196
104222
|
import { readFile as readFile59, readdir as readdir34, writeFile as writeFile32 } from "node:fs/promises";
|
|
104197
|
-
import { join as join130, relative as
|
|
104223
|
+
import { join as join130, relative as relative26 } from "node:path";
|
|
104198
104224
|
|
|
104199
104225
|
class SkillsManifestManager {
|
|
104200
104226
|
static MANIFEST_FILENAME = ".skills-manifest.json";
|
|
@@ -104298,7 +104324,7 @@ class SkillsManifestManager {
|
|
|
104298
104324
|
const files = await SkillsManifestManager.getAllFiles(dirPath);
|
|
104299
104325
|
files.sort();
|
|
104300
104326
|
for (const file of files) {
|
|
104301
|
-
const relativePath =
|
|
104327
|
+
const relativePath = relative26(dirPath, file);
|
|
104302
104328
|
const content = await readFile59(file);
|
|
104303
104329
|
hash.update(relativePath);
|
|
104304
104330
|
hash.update(content);
|
|
@@ -105033,14 +105059,14 @@ init_logger();
|
|
|
105033
105059
|
|
|
105034
105060
|
// src/domains/skills/customization/comparison-engine.ts
|
|
105035
105061
|
var import_fs_extra29 = __toESM(require_lib(), 1);
|
|
105036
|
-
import { relative as
|
|
105062
|
+
import { relative as relative28 } from "node:path";
|
|
105037
105063
|
|
|
105038
105064
|
// src/domains/skills/customization/hash-calculator.ts
|
|
105039
105065
|
init_skip_directories();
|
|
105040
105066
|
import { createHash as createHash9 } from "node:crypto";
|
|
105041
105067
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
105042
105068
|
import { readFile as readFile60, readdir as readdir38 } from "node:fs/promises";
|
|
105043
|
-
import { join as join134, relative as
|
|
105069
|
+
import { join as join134, relative as relative27 } from "node:path";
|
|
105044
105070
|
async function getAllFiles(dirPath) {
|
|
105045
105071
|
const files = [];
|
|
105046
105072
|
const entries = await readdir38(dirPath, { withFileTypes: true });
|
|
@@ -105077,7 +105103,7 @@ async function hashDirectory(dirPath) {
|
|
|
105077
105103
|
const files = await getAllFiles(dirPath);
|
|
105078
105104
|
files.sort();
|
|
105079
105105
|
for (const file of files) {
|
|
105080
|
-
const relativePath =
|
|
105106
|
+
const relativePath = relative27(dirPath, file);
|
|
105081
105107
|
const content = await readFile60(file);
|
|
105082
105108
|
hash.update(relativePath);
|
|
105083
105109
|
hash.update(content);
|
|
@@ -105111,8 +105137,8 @@ async function compareDirectories(dir1, dir2) {
|
|
|
105111
105137
|
if (files1.length !== files2.length) {
|
|
105112
105138
|
return true;
|
|
105113
105139
|
}
|
|
105114
|
-
const relFiles1 = files1.map((f4) =>
|
|
105115
|
-
const relFiles2 = files2.map((f4) =>
|
|
105140
|
+
const relFiles1 = files1.map((f4) => relative28(dir1, f4)).sort();
|
|
105141
|
+
const relFiles2 = files2.map((f4) => relative28(dir2, f4)).sort();
|
|
105116
105142
|
if (JSON.stringify(relFiles1) !== JSON.stringify(relFiles2)) {
|
|
105117
105143
|
return true;
|
|
105118
105144
|
}
|
|
@@ -105130,12 +105156,12 @@ async function detectFileChanges(currentSkillPath, baselineSkillPath) {
|
|
|
105130
105156
|
const currentFiles = await getAllFiles(currentSkillPath);
|
|
105131
105157
|
const baselineFiles = await import_fs_extra29.pathExists(baselineSkillPath) ? await getAllFiles(baselineSkillPath) : [];
|
|
105132
105158
|
const currentFileMap = new Map(await Promise.all(currentFiles.map(async (f4) => {
|
|
105133
|
-
const relPath =
|
|
105159
|
+
const relPath = relative28(currentSkillPath, f4);
|
|
105134
105160
|
const hash = await hashFile(f4);
|
|
105135
105161
|
return [relPath, hash];
|
|
105136
105162
|
})));
|
|
105137
105163
|
const baselineFileMap = new Map(await Promise.all(baselineFiles.map(async (f4) => {
|
|
105138
|
-
const relPath =
|
|
105164
|
+
const relPath = relative28(baselineSkillPath, f4);
|
|
105139
105165
|
const hash = await hashFile(f4);
|
|
105140
105166
|
return [relPath, hash];
|
|
105141
105167
|
})));
|
|
@@ -105788,8 +105814,8 @@ async function detectAccessibleKits() {
|
|
|
105788
105814
|
// src/domains/github/preflight-checker.ts
|
|
105789
105815
|
init_logger();
|
|
105790
105816
|
import { exec as exec5 } from "node:child_process";
|
|
105791
|
-
import { promisify as
|
|
105792
|
-
var execAsync5 =
|
|
105817
|
+
import { promisify as promisify14 } from "node:util";
|
|
105818
|
+
var execAsync5 = promisify14(exec5);
|
|
105793
105819
|
function createSuccessfulPreflightResult() {
|
|
105794
105820
|
return {
|
|
105795
105821
|
success: true,
|
|
@@ -107045,7 +107071,7 @@ init_logger();
|
|
|
107045
107071
|
init_types3();
|
|
107046
107072
|
var import_fs_extra38 = __toESM(require_lib(), 1);
|
|
107047
107073
|
import { rename as rename14, rm as rm19 } from "node:fs/promises";
|
|
107048
|
-
import { join as join145, relative as
|
|
107074
|
+
import { join as join145, relative as relative29 } from "node:path";
|
|
107049
107075
|
async function collectDirsToRename(extractDir, folders) {
|
|
107050
107076
|
const dirsToRename = [];
|
|
107051
107077
|
if (folders.docs !== DEFAULT_FOLDERS.docs) {
|
|
@@ -107099,11 +107125,11 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
107099
107125
|
let foldersRenamed = 0;
|
|
107100
107126
|
for (const { from, to: to2 } of dirsToRename) {
|
|
107101
107127
|
if (options2.dryRun) {
|
|
107102
|
-
logger.info(`[dry-run] Would rename: ${
|
|
107128
|
+
logger.info(`[dry-run] Would rename: ${relative29(extractDir, from)} -> ${relative29(extractDir, to2)}`);
|
|
107103
107129
|
} else {
|
|
107104
107130
|
try {
|
|
107105
107131
|
await moveAcrossDevices(from, to2);
|
|
107106
|
-
logger.debug(`Renamed: ${
|
|
107132
|
+
logger.debug(`Renamed: ${relative29(extractDir, from)} -> ${relative29(extractDir, to2)}`);
|
|
107107
107133
|
foldersRenamed++;
|
|
107108
107134
|
} catch (error) {
|
|
107109
107135
|
logger.warning(`Failed to rename ${from}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
@@ -107117,7 +107143,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
107117
107143
|
init_logger();
|
|
107118
107144
|
init_types3();
|
|
107119
107145
|
import { readFile as readFile63, readdir as readdir43, writeFile as writeFile36 } from "node:fs/promises";
|
|
107120
|
-
import { join as join146, relative as
|
|
107146
|
+
import { join as join146, relative as relative30 } from "node:path";
|
|
107121
107147
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
107122
107148
|
".md",
|
|
107123
107149
|
".txt",
|
|
@@ -107197,10 +107223,10 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
107197
107223
|
}
|
|
107198
107224
|
if (changeCount > 0) {
|
|
107199
107225
|
if (options2.dryRun) {
|
|
107200
|
-
logger.debug(`[dry-run] Would update ${
|
|
107226
|
+
logger.debug(`[dry-run] Would update ${relative30(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
107201
107227
|
} else {
|
|
107202
107228
|
await writeFile36(fullPath, newContent, "utf-8");
|
|
107203
|
-
logger.debug(`Updated ${
|
|
107229
|
+
logger.debug(`Updated ${relative30(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
107204
107230
|
}
|
|
107205
107231
|
filesChanged++;
|
|
107206
107232
|
replacementsCount += changeCount;
|
|
@@ -110510,6 +110536,10 @@ async function postSetup(resolvedDir, validOptions, isNonInteractive2, prompts)
|
|
|
110510
110536
|
withSudo: validOptions.withSudo
|
|
110511
110537
|
});
|
|
110512
110538
|
}
|
|
110539
|
+
if (validOptions.kit === "fqc-qa") {
|
|
110540
|
+
const { runNpmrcSetupStep: runNpmrcSetupStep2 } = await Promise.resolve().then(() => (init_npmrc_setup_step(), exports_npmrc_setup_step));
|
|
110541
|
+
await runNpmrcSetupStep2({ yes: isNonInteractive2 });
|
|
110542
|
+
}
|
|
110513
110543
|
const claudeDir3 = join154(resolvedDir, ".claude");
|
|
110514
110544
|
await promptSetupWizardIfNeeded({
|
|
110515
110545
|
envPath: join154(claudeDir3, ".env"),
|
|
@@ -110592,7 +110622,7 @@ init_logger();
|
|
|
110592
110622
|
init_output_manager();
|
|
110593
110623
|
var import_picocolors37 = __toESM(require_picocolors(), 1);
|
|
110594
110624
|
import { existsSync as existsSync76, statSync as statSync12 } from "node:fs";
|
|
110595
|
-
import { basename as basename31, dirname as dirname46, join as join156, relative as
|
|
110625
|
+
import { basename as basename31, dirname as dirname46, join as join156, relative as relative31, resolve as resolve53 } from "node:path";
|
|
110596
110626
|
|
|
110597
110627
|
// src/commands/plan/plan-dependencies.ts
|
|
110598
110628
|
init_config();
|
|
@@ -110687,7 +110717,7 @@ async function handleParse(target, options2) {
|
|
|
110687
110717
|
return;
|
|
110688
110718
|
}
|
|
110689
110719
|
if (isJsonOutput(options2)) {
|
|
110690
|
-
console.log(JSON.stringify({ file:
|
|
110720
|
+
console.log(JSON.stringify({ file: relative31(process.cwd(), planFile), frontmatter, phases }, null, 2));
|
|
110691
110721
|
return;
|
|
110692
110722
|
}
|
|
110693
110723
|
const title = typeof frontmatter.title === "string" ? frontmatter.title : basename31(dirname46(planFile));
|
|
@@ -110945,7 +110975,7 @@ init_plan_parser();
|
|
|
110945
110975
|
init_plans_registry();
|
|
110946
110976
|
init_output_manager();
|
|
110947
110977
|
var import_picocolors38 = __toESM(require_picocolors(), 1);
|
|
110948
|
-
import { basename as basename32, dirname as dirname47, relative as
|
|
110978
|
+
import { basename as basename32, dirname as dirname47, relative as relative32, resolve as resolve54 } from "node:path";
|
|
110949
110979
|
async function handleCreate(target, options2) {
|
|
110950
110980
|
if (!options2.title) {
|
|
110951
110981
|
output.error("[X] --title is required for create");
|
|
@@ -111011,8 +111041,8 @@ async function handleCreate(target, options2) {
|
|
|
111011
111041
|
if (isJsonOutput(options2)) {
|
|
111012
111042
|
const cwd2 = process.cwd();
|
|
111013
111043
|
console.log(JSON.stringify({
|
|
111014
|
-
planFile:
|
|
111015
|
-
phaseFiles: result.phaseFiles.map((f4) =>
|
|
111044
|
+
planFile: relative32(cwd2, result.planFile),
|
|
111045
|
+
phaseFiles: result.phaseFiles.map((f4) => relative32(cwd2, f4))
|
|
111016
111046
|
}, null, 2));
|
|
111017
111047
|
return;
|
|
111018
111048
|
}
|
|
@@ -111068,7 +111098,7 @@ async function handleCheck(target, options2) {
|
|
|
111068
111098
|
console.log(JSON.stringify({
|
|
111069
111099
|
phaseId: target,
|
|
111070
111100
|
status: newStatus,
|
|
111071
|
-
planFile:
|
|
111101
|
+
planFile: relative32(process.cwd(), planFile)
|
|
111072
111102
|
}));
|
|
111073
111103
|
return;
|
|
111074
111104
|
}
|
|
@@ -111112,7 +111142,7 @@ async function handleUncheck(target, options2) {
|
|
|
111112
111142
|
console.log(JSON.stringify({
|
|
111113
111143
|
phaseId: target,
|
|
111114
111144
|
status: "pending",
|
|
111115
|
-
planFile:
|
|
111145
|
+
planFile: relative32(process.cwd(), planFile)
|
|
111116
111146
|
}));
|
|
111117
111147
|
return;
|
|
111118
111148
|
}
|
|
@@ -111144,7 +111174,7 @@ async function handleAddPhase(target, options2) {
|
|
|
111144
111174
|
if (isJsonOutput(options2)) {
|
|
111145
111175
|
console.log(JSON.stringify({
|
|
111146
111176
|
phaseId: result.phaseId,
|
|
111147
|
-
phaseFile:
|
|
111177
|
+
phaseFile: relative32(process.cwd(), result.phaseFile)
|
|
111148
111178
|
}));
|
|
111149
111179
|
return;
|
|
111150
111180
|
}
|