zelari-code 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/main.bundled.js
CHANGED
|
@@ -24493,12 +24493,35 @@ __export(updater_exports, {
|
|
|
24493
24493
|
compareSemver: () => compareSemver,
|
|
24494
24494
|
fetchLatestVersion: () => fetchLatestVersion,
|
|
24495
24495
|
getCurrentVersion: () => getCurrentVersion,
|
|
24496
|
-
performUpdate: () => performUpdate
|
|
24496
|
+
performUpdate: () => performUpdate,
|
|
24497
|
+
resolveBundledNpmCli: () => resolveBundledNpmCli
|
|
24497
24498
|
});
|
|
24498
24499
|
import { createRequire } from "node:module";
|
|
24499
24500
|
import { spawn as spawn2 } from "node:child_process";
|
|
24501
|
+
import { existsSync as existsSync15 } from "node:fs";
|
|
24500
24502
|
import path15 from "node:path";
|
|
24501
24503
|
import { fileURLToPath } from "node:url";
|
|
24504
|
+
function resolveBundledNpmCli(execPath = process.execPath) {
|
|
24505
|
+
const dir = path15.dirname(execPath);
|
|
24506
|
+
const candidates = [
|
|
24507
|
+
// Windows: C:\...\node.exe → C:\...\node_modules\npm\bin\npm-cli.js
|
|
24508
|
+
path15.join(dir, "node_modules", "npm", "bin", "npm-cli.js"),
|
|
24509
|
+
// POSIX: <prefix>/bin/node → <prefix>/lib/node_modules/npm/bin/npm-cli.js
|
|
24510
|
+
path15.join(dir, "..", "lib", "node_modules", "npm", "bin", "npm-cli.js")
|
|
24511
|
+
];
|
|
24512
|
+
for (const candidate of candidates) {
|
|
24513
|
+
try {
|
|
24514
|
+
if (existsSync15(candidate)) return candidate;
|
|
24515
|
+
} catch {
|
|
24516
|
+
}
|
|
24517
|
+
}
|
|
24518
|
+
return null;
|
|
24519
|
+
}
|
|
24520
|
+
function looksLikeBrokenShim(exitCode, output) {
|
|
24521
|
+
if (exitCode === 127) return true;
|
|
24522
|
+
const h = output.toLowerCase();
|
|
24523
|
+
return h.includes("shim target not found") || h.includes("is not recognized");
|
|
24524
|
+
}
|
|
24502
24525
|
function getCurrentVersion() {
|
|
24503
24526
|
try {
|
|
24504
24527
|
const pkgPath = path15.resolve(__dirname2, "..", "..", "package.json");
|
|
@@ -24561,13 +24584,27 @@ async function checkForUpdate(fetcher = fetch, registryUrl) {
|
|
|
24561
24584
|
updateAvailable: cmp < 0
|
|
24562
24585
|
};
|
|
24563
24586
|
}
|
|
24564
|
-
async function performUpdate(packageName = "zelari-code", executor = spawn2) {
|
|
24587
|
+
async function performUpdate(packageName = "zelari-code", executor = spawn2, resolveNpmCli = resolveBundledNpmCli) {
|
|
24588
|
+
const args = ["install", "-g", `${packageName}@latest`];
|
|
24589
|
+
const primary = await runNpm(executor, args, "shim");
|
|
24590
|
+
if (primary.ok) return primary;
|
|
24591
|
+
const npmCli = resolveNpmCli();
|
|
24592
|
+
if (npmCli && looksLikeBrokenShim(primary.exitCode, primary.output)) {
|
|
24593
|
+
const fallback = await runNpm(executor, args, "bundled", npmCli);
|
|
24594
|
+
return {
|
|
24595
|
+
...fallback,
|
|
24596
|
+
output: `[update] npm shim failed (${primary.error ?? "exit " + primary.exitCode}); retried via bundled npm (${npmCli}).
|
|
24597
|
+
${fallback.output}`
|
|
24598
|
+
};
|
|
24599
|
+
}
|
|
24600
|
+
return primary;
|
|
24601
|
+
}
|
|
24602
|
+
function runNpm(executor, args, mode, npmCliPath) {
|
|
24565
24603
|
return new Promise((resolve) => {
|
|
24566
|
-
const args = ["install", "-g", `${packageName}@latest`];
|
|
24567
24604
|
let stdout = "";
|
|
24568
24605
|
let stderr = "";
|
|
24569
24606
|
const stdio = ["ignore", "pipe", "pipe"];
|
|
24570
|
-
const child = process.platform === "win32" ? executor(buildCmdLine("npm", args), { stdio, shell: true }) : executor("npm", args, { stdio });
|
|
24607
|
+
const child = mode === "bundled" && npmCliPath ? executor(process.execPath, [npmCliPath, ...args], { stdio }) : process.platform === "win32" ? executor(buildCmdLine("npm", args), { stdio, shell: true }) : executor("npm", args, { stdio });
|
|
24571
24608
|
child.stdout?.on("data", (chunk) => {
|
|
24572
24609
|
stdout += chunk.toString();
|
|
24573
24610
|
});
|
|
@@ -24780,7 +24817,7 @@ __export(mcpManager_exports, {
|
|
|
24780
24817
|
readMcpConfig: () => readMcpConfig,
|
|
24781
24818
|
registerMcpTools: () => registerMcpTools
|
|
24782
24819
|
});
|
|
24783
|
-
import { existsSync as
|
|
24820
|
+
import { existsSync as existsSync16, readFileSync as readFileSync15 } from "node:fs";
|
|
24784
24821
|
import { join as join15 } from "node:path";
|
|
24785
24822
|
import { homedir as homedir4 } from "node:os";
|
|
24786
24823
|
function readMcpConfig(projectRoot = process.cwd()) {
|
|
@@ -24791,7 +24828,7 @@ function readMcpConfig(projectRoot = process.cwd()) {
|
|
|
24791
24828
|
// later = higher precedence
|
|
24792
24829
|
];
|
|
24793
24830
|
for (const p3 of paths) {
|
|
24794
|
-
if (!
|
|
24831
|
+
if (!existsSync16(p3)) continue;
|
|
24795
24832
|
try {
|
|
24796
24833
|
const parsed = JSON.parse(readFileSync15(p3, "utf8"));
|
|
24797
24834
|
for (const [name, cfg] of Object.entries(parsed.mcpServers ?? {})) {
|
|
@@ -24925,11 +24962,11 @@ var planDetect_exports = {};
|
|
|
24925
24962
|
__export(planDetect_exports, {
|
|
24926
24963
|
hasWorkspacePlan: () => hasWorkspacePlan
|
|
24927
24964
|
});
|
|
24928
|
-
import { existsSync as
|
|
24965
|
+
import { existsSync as existsSync17, readFileSync as readFileSync16 } from "node:fs";
|
|
24929
24966
|
import { join as join16 } from "node:path";
|
|
24930
24967
|
function hasWorkspacePlan(projectRoot = process.cwd()) {
|
|
24931
24968
|
const planPath = join16(resolveWorkspaceRoot(projectRoot), "plan.json");
|
|
24932
|
-
if (!
|
|
24969
|
+
if (!existsSync17(planPath)) return false;
|
|
24933
24970
|
try {
|
|
24934
24971
|
const parsed = JSON.parse(readFileSync16(planPath, "utf8"));
|
|
24935
24972
|
return Array.isArray(parsed.phases) && parsed.phases.length > 0;
|
|
@@ -25028,13 +25065,13 @@ __export(agentsMd_exports, {
|
|
|
25028
25065
|
serializeAgentsMd: () => serializeAgentsMd,
|
|
25029
25066
|
updateAgentsMd: () => updateAgentsMd
|
|
25030
25067
|
});
|
|
25031
|
-
import { existsSync as
|
|
25068
|
+
import { existsSync as existsSync18, readFileSync as readFileSync17, writeFileSync as writeFileSync13 } from "node:fs";
|
|
25032
25069
|
import { createHash as createHash2 } from "node:crypto";
|
|
25033
25070
|
import { join as join17 } from "node:path";
|
|
25034
25071
|
import { readFile } from "node:fs/promises";
|
|
25035
25072
|
async function readPackageJson2(projectRoot) {
|
|
25036
25073
|
const path25 = join17(projectRoot, "package.json");
|
|
25037
|
-
if (!
|
|
25074
|
+
if (!existsSync18(path25)) return null;
|
|
25038
25075
|
try {
|
|
25039
25076
|
return JSON.parse(await readFile(path25, "utf8"));
|
|
25040
25077
|
} catch {
|
|
@@ -25059,7 +25096,7 @@ async function genTechStack(ctx) {
|
|
|
25059
25096
|
}
|
|
25060
25097
|
async function genDecisions(ctx) {
|
|
25061
25098
|
const decisionsDir = join17(ctx.rootDir, "decisions");
|
|
25062
|
-
if (!
|
|
25099
|
+
if (!existsSync18(decisionsDir)) return "_No ADRs yet._";
|
|
25063
25100
|
const files = ctx.storage.listMarkdown(decisionsDir).sort();
|
|
25064
25101
|
const accepted = [];
|
|
25065
25102
|
const proposed = [];
|
|
@@ -25085,7 +25122,7 @@ async function genDecisions(ctx) {
|
|
|
25085
25122
|
async function genConventions(ctx) {
|
|
25086
25123
|
const lines = [];
|
|
25087
25124
|
const claudeMd = join17(ctx.projectRoot, "CLAUDE.MD");
|
|
25088
|
-
if (
|
|
25125
|
+
if (existsSync18(claudeMd)) {
|
|
25089
25126
|
const content = readFileSync17(claudeMd, "utf8");
|
|
25090
25127
|
const match = content.match(/## Architecture rules[\s\S]+?(?=\n## |\n*$)/);
|
|
25091
25128
|
if (match) {
|
|
@@ -25119,7 +25156,7 @@ async function genBuild(ctx) {
|
|
|
25119
25156
|
}
|
|
25120
25157
|
async function genOpenQuestions(ctx) {
|
|
25121
25158
|
const path25 = join17(ctx.rootDir, "risks.md");
|
|
25122
|
-
if (!
|
|
25159
|
+
if (!existsSync18(path25)) return "_No open questions._";
|
|
25123
25160
|
const content = readFileSync17(path25, "utf8");
|
|
25124
25161
|
const lines = content.split("\n");
|
|
25125
25162
|
const questions = [];
|
|
@@ -25195,7 +25232,7 @@ function titleCase(id) {
|
|
|
25195
25232
|
}
|
|
25196
25233
|
async function updateAgentsMd(ctx, projectRoot) {
|
|
25197
25234
|
const agentsPath = join17(projectRoot, "AGENTS.MD");
|
|
25198
|
-
if (
|
|
25235
|
+
if (existsSync18(agentsPath)) {
|
|
25199
25236
|
const content = readFileSync17(agentsPath, "utf8");
|
|
25200
25237
|
const hasAnyMarker = AUTO_SECTIONS.some((id) => content.includes(MARKER_OPEN(id)));
|
|
25201
25238
|
if (!hasAnyMarker) {
|
|
@@ -25211,7 +25248,7 @@ async function updateAgentsMd(ctx, projectRoot) {
|
|
|
25211
25248
|
newSections.set(id, await GENERATORS[id](ctx));
|
|
25212
25249
|
}
|
|
25213
25250
|
let manualContent = "";
|
|
25214
|
-
if (
|
|
25251
|
+
if (existsSync18(agentsPath)) {
|
|
25215
25252
|
const { manualBlocks } = parseAgentsMd(readFileSync17(agentsPath, "utf8"));
|
|
25216
25253
|
manualContent = manualBlocks.after;
|
|
25217
25254
|
} else {
|
|
@@ -25228,7 +25265,7 @@ async function updateAgentsMd(ctx, projectRoot) {
|
|
|
25228
25265
|
""
|
|
25229
25266
|
].join("\n");
|
|
25230
25267
|
}
|
|
25231
|
-
const oldContent =
|
|
25268
|
+
const oldContent = existsSync18(agentsPath) ? readFileSync17(agentsPath, "utf8") : "";
|
|
25232
25269
|
const { sections: oldSections } = parseAgentsMd(oldContent);
|
|
25233
25270
|
const changedSections = [];
|
|
25234
25271
|
for (const id of AUTO_SECTIONS) {
|
|
@@ -25366,7 +25403,7 @@ var init_completeDesign = __esm({
|
|
|
25366
25403
|
|
|
25367
25404
|
// src/cli/workspace/projectSmoke.ts
|
|
25368
25405
|
import { spawn as spawn4 } from "node:child_process";
|
|
25369
|
-
import { existsSync as
|
|
25406
|
+
import { existsSync as existsSync19, readFileSync as readFileSync18 } from "node:fs";
|
|
25370
25407
|
import { join as join18 } from "node:path";
|
|
25371
25408
|
function pickSmokeScript(scripts) {
|
|
25372
25409
|
if (!scripts) return null;
|
|
@@ -25380,7 +25417,7 @@ async function runProjectSmoke(projectRoot, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
|
25380
25417
|
return { ran: false, reason: "ZELARI_SMOKE=0 (disabled)" };
|
|
25381
25418
|
}
|
|
25382
25419
|
const pkgPath = join18(projectRoot, "package.json");
|
|
25383
|
-
if (!
|
|
25420
|
+
if (!existsSync19(pkgPath)) {
|
|
25384
25421
|
return { ran: false, reason: "no package.json (skipped)" };
|
|
25385
25422
|
}
|
|
25386
25423
|
let scripts = {};
|
|
@@ -25469,7 +25506,7 @@ __export(postCouncilHook_exports, {
|
|
|
25469
25506
|
runPostCouncilHook: () => runPostCouncilHook
|
|
25470
25507
|
});
|
|
25471
25508
|
import { spawn as spawn5 } from "node:child_process";
|
|
25472
|
-
import { existsSync as
|
|
25509
|
+
import { existsSync as existsSync20, readFileSync as readFileSync19 } from "node:fs";
|
|
25473
25510
|
import { join as join19 } from "node:path";
|
|
25474
25511
|
async function runCompleteDesignPostProcessor(ctx, options) {
|
|
25475
25512
|
if (options?.runMode === "implementation") {
|
|
@@ -25483,7 +25520,7 @@ async function runCompleteDesignPostProcessor(ctx, options) {
|
|
|
25483
25520
|
}
|
|
25484
25521
|
const planJsonPath2 = join19(ctx.rootDir, "plan.json");
|
|
25485
25522
|
const scriptPath = join19(ctx.projectRoot, "complete-design.mjs");
|
|
25486
|
-
if (!
|
|
25523
|
+
if (!existsSync20(planJsonPath2)) {
|
|
25487
25524
|
return {
|
|
25488
25525
|
ran: false,
|
|
25489
25526
|
reason: ".zelari/plan.json missing (not design-phase)"
|
|
@@ -25499,7 +25536,7 @@ async function runCompleteDesignPostProcessor(ctx, options) {
|
|
|
25499
25536
|
if (phaseCount === 0) {
|
|
25500
25537
|
return { ran: false, reason: ".zelari/plan.json has no phases" };
|
|
25501
25538
|
}
|
|
25502
|
-
if (!
|
|
25539
|
+
if (!existsSync20(scriptPath)) {
|
|
25503
25540
|
try {
|
|
25504
25541
|
const builtin = await runBuiltinCompleteDesign(ctx);
|
|
25505
25542
|
return {
|
|
@@ -25720,12 +25757,12 @@ var buildLessonsSummary_exports = {};
|
|
|
25720
25757
|
__export(buildLessonsSummary_exports, {
|
|
25721
25758
|
buildLessonsSummary: () => buildLessonsSummary
|
|
25722
25759
|
});
|
|
25723
|
-
import { existsSync as
|
|
25760
|
+
import { existsSync as existsSync21 } from "node:fs";
|
|
25724
25761
|
import { join as join20 } from "node:path";
|
|
25725
25762
|
function buildLessonsSummary(projectRoot = process.cwd(), taskText) {
|
|
25726
25763
|
if (process.env["ZELARI_LESSONS"] === "0") return null;
|
|
25727
25764
|
const zelariRoot = resolveWorkspaceRoot(projectRoot);
|
|
25728
|
-
if (!
|
|
25765
|
+
if (!existsSync21(join20(zelariRoot, "lessons.jsonl"))) return null;
|
|
25729
25766
|
const lessons = recallLessons(zelariRoot, {
|
|
25730
25767
|
maxLessons: 5,
|
|
25731
25768
|
maxBytes: 2048,
|
|
@@ -25748,7 +25785,7 @@ __export(councilFeedback_exports, {
|
|
|
25748
25785
|
});
|
|
25749
25786
|
import {
|
|
25750
25787
|
promises as fs12,
|
|
25751
|
-
existsSync as
|
|
25788
|
+
existsSync as existsSync22,
|
|
25752
25789
|
readFileSync as readFileSync20,
|
|
25753
25790
|
writeFileSync as writeFileSync14,
|
|
25754
25791
|
mkdirSync as mkdirSync9
|
|
@@ -25857,7 +25894,7 @@ var init_councilFeedback = __esm({
|
|
|
25857
25894
|
}
|
|
25858
25895
|
// --- persistence ---------------------------------------------------------
|
|
25859
25896
|
load() {
|
|
25860
|
-
if (!
|
|
25897
|
+
if (!existsSync22(this.file)) return;
|
|
25861
25898
|
try {
|
|
25862
25899
|
const raw = readFileSync20(this.file, "utf-8");
|
|
25863
25900
|
const parsed = JSON.parse(raw);
|
|
@@ -26178,7 +26215,7 @@ __export(doctor_exports, {
|
|
|
26178
26215
|
runDoctor: () => runDoctor
|
|
26179
26216
|
});
|
|
26180
26217
|
import { execSync } from "node:child_process";
|
|
26181
|
-
import { existsSync as
|
|
26218
|
+
import { existsSync as existsSync27, readFileSync as readFileSync23, readlinkSync, statSync as statSync6 } from "node:fs";
|
|
26182
26219
|
import { createRequire as createRequire2 } from "node:module";
|
|
26183
26220
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
26184
26221
|
import path24 from "node:path";
|
|
@@ -26186,7 +26223,7 @@ function findPackageRoot(start) {
|
|
|
26186
26223
|
let dir = start;
|
|
26187
26224
|
for (let i = 0; i < 6; i += 1) {
|
|
26188
26225
|
const candidate = path24.join(dir, "package.json");
|
|
26189
|
-
if (
|
|
26226
|
+
if (existsSync27(candidate)) {
|
|
26190
26227
|
try {
|
|
26191
26228
|
const pkg = JSON.parse(readFileSync23(candidate, "utf8"));
|
|
26192
26229
|
if (pkg.name === "zelari-code") return dir;
|
|
@@ -26228,7 +26265,7 @@ function checkShim(pkgName) {
|
|
|
26228
26265
|
const isWin = process.platform === "win32";
|
|
26229
26266
|
const shimName = isWin ? "zelari-code.cmd" : "zelari-code";
|
|
26230
26267
|
const shimPath = path24.join(prefix, shimName);
|
|
26231
|
-
if (!
|
|
26268
|
+
if (!existsSync27(shimPath)) {
|
|
26232
26269
|
return FAIL(
|
|
26233
26270
|
`shim not found at ${shimPath}
|
|
26234
26271
|
fix: npm install -g ${pkgName}@latest --force`
|
|
@@ -26296,7 +26333,7 @@ function checkNode(pkg) {
|
|
|
26296
26333
|
}
|
|
26297
26334
|
function checkBundle() {
|
|
26298
26335
|
const bundle = path24.join(packageRoot, "dist", "cli", "main.bundled.js");
|
|
26299
|
-
if (!
|
|
26336
|
+
if (!existsSync27(bundle)) {
|
|
26300
26337
|
return FAIL(
|
|
26301
26338
|
`dist/cli/main.bundled.js missing at ${bundle}
|
|
26302
26339
|
fix: npm run build:cli (then reinstall or run via tsx)`
|
|
@@ -31960,6 +31997,9 @@ ${output}`.toLowerCase();
|
|
|
31960
31997
|
if (haystack.includes("eacces") || haystack.includes("eperm")) {
|
|
31961
31998
|
return "\u{1F4A1} hint: permission denied. On macOS/Linux, avoid sudo with npm:\n https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally\n On Windows, re-run the terminal as Administrator.";
|
|
31962
31999
|
}
|
|
32000
|
+
if (haystack.includes("shim target not found") || haystack.includes("is not recognized") || exitCode === 127) {
|
|
32001
|
+
return '\u{1F4A1} hint: `npm` could not be launched \u2014 its bin shim is broken.\n "Shim target not found: npm.cmd" / exit 127 means a Node version\n manager (Volta, nvm-windows, fnm) has a stale npm shim, so npm\n itself won\'t run until you repair it:\n \u2022 Volta: volta install node (reinstalls node + npm shims)\n \u2022 nvm-windows: nvm use <version> (re-links node + npm)\n \u2022 fnm: fnm use --install-if-missing\n Then verify with `npm --version`, and re-run `/update --yes`.\n (zelari-code retried automatically via the npm bundled with your\n Node; if you still see this, that bundled npm was unavailable too.)';
|
|
32002
|
+
}
|
|
31963
32003
|
if (haystack.includes("enoent") && haystack.includes("npm")) {
|
|
31964
32004
|
return '\u{1F4A1} hint: `npm` was not found on PATH for the spawned shell.\n Re-open the terminal so it picks up your current PATH, or set:\n export PATH="$(npm prefix -g)/bin:$PATH" (POSIX)\n $env:Path = "$(npm prefix -g);$env:Path" (PowerShell)';
|
|
31965
32005
|
}
|
|
@@ -31996,7 +32036,7 @@ async function handlePromoteMember(ctx, memberId) {
|
|
|
31996
32036
|
}
|
|
31997
32037
|
|
|
31998
32038
|
// src/cli/branchManager.ts
|
|
31999
|
-
import { promises as fs16, existsSync as
|
|
32039
|
+
import { promises as fs16, existsSync as existsSync23, readFileSync as readFileSync21, writeFileSync as writeFileSync15, mkdirSync as mkdirSync10, statSync as statSync4, rmSync } from "node:fs";
|
|
32000
32040
|
import path21 from "node:path";
|
|
32001
32041
|
import os9 from "node:os";
|
|
32002
32042
|
var META_FILENAME = "meta.json";
|
|
@@ -32018,7 +32058,7 @@ function sessionsPathFor(name, baseDir) {
|
|
|
32018
32058
|
}
|
|
32019
32059
|
function readBranchMeta(name, baseDir) {
|
|
32020
32060
|
const metaPath = metaPathFor(name, baseDir);
|
|
32021
|
-
if (!
|
|
32061
|
+
if (!existsSync23(metaPath)) {
|
|
32022
32062
|
throw new BranchNotFoundError(`Branch "${name}" not found`);
|
|
32023
32063
|
}
|
|
32024
32064
|
try {
|
|
@@ -32078,7 +32118,7 @@ var SessionNotFoundError = class extends Error {
|
|
|
32078
32118
|
};
|
|
32079
32119
|
function branchExists(name, baseDir = getBranchesBaseDir()) {
|
|
32080
32120
|
const bp = branchPathFor(name, baseDir);
|
|
32081
|
-
return
|
|
32121
|
+
return existsSync23(bp) && existsSync23(metaPathFor(name, baseDir));
|
|
32082
32122
|
}
|
|
32083
32123
|
async function createBranch(name, fromSessionId, baseDir = getBranchesBaseDir(), sessionsBaseDir = getSessionsBaseDir()) {
|
|
32084
32124
|
if (!name || name.trim().length === 0) {
|
|
@@ -32091,7 +32131,7 @@ async function createBranch(name, fromSessionId, baseDir = getBranchesBaseDir(),
|
|
|
32091
32131
|
throw new BranchAlreadyExistsError(name);
|
|
32092
32132
|
}
|
|
32093
32133
|
const sourcePath = path21.join(sessionsBaseDir, `${fromSessionId}.jsonl`);
|
|
32094
|
-
if (!
|
|
32134
|
+
if (!existsSync23(sourcePath)) {
|
|
32095
32135
|
throw new SessionNotFoundError(`Source session "${fromSessionId}" not found at ${sourcePath}`);
|
|
32096
32136
|
}
|
|
32097
32137
|
const branchPath = branchPathFor(name, baseDir);
|
|
@@ -32124,7 +32164,7 @@ async function listBranches(baseDir = getBranchesBaseDir()) {
|
|
|
32124
32164
|
const results = [];
|
|
32125
32165
|
for (const entry of entries) {
|
|
32126
32166
|
const metaPath = metaPathFor(entry, baseDir);
|
|
32127
|
-
if (!
|
|
32167
|
+
if (!existsSync23(metaPath)) continue;
|
|
32128
32168
|
try {
|
|
32129
32169
|
const meta3 = readBranchMeta(entry, baseDir);
|
|
32130
32170
|
const sessionCount = await countSessions(entry, baseDir);
|
|
@@ -32660,7 +32700,7 @@ import path23 from "node:path";
|
|
|
32660
32700
|
import os10 from "node:os";
|
|
32661
32701
|
|
|
32662
32702
|
// src/cli/skillHistory.ts
|
|
32663
|
-
import { promises as fs18, existsSync as
|
|
32703
|
+
import { promises as fs18, existsSync as existsSync24, statSync as statSync5, renameSync as renameSync4, appendFileSync as appendFileSync3, mkdirSync as mkdirSync11 } from "node:fs";
|
|
32664
32704
|
var SKILL_HISTORY_ROTATE_BYTES = 10 * 1024 * 1024;
|
|
32665
32705
|
async function readSkillHistory(file2) {
|
|
32666
32706
|
let raw = "";
|
|
@@ -33563,9 +33603,9 @@ function SplashGate({
|
|
|
33563
33603
|
init_providerConfig();
|
|
33564
33604
|
|
|
33565
33605
|
// src/cli/wizard/firstRun.ts
|
|
33566
|
-
import { existsSync as
|
|
33606
|
+
import { existsSync as existsSync25 } from "node:fs";
|
|
33567
33607
|
function shouldRunWizard(input) {
|
|
33568
|
-
const exists = input.exists ??
|
|
33608
|
+
const exists = input.exists ?? existsSync25;
|
|
33569
33609
|
if (input.hasResetConfigFlag) {
|
|
33570
33610
|
return { shouldRun: true, reason: "--reset-config flag forced wizard" };
|
|
33571
33611
|
}
|
|
@@ -34054,7 +34094,7 @@ async function runHeadlessCouncil(opts, provider, model, providerStream) {
|
|
|
34054
34094
|
|
|
34055
34095
|
// src/cli/skillsMd.ts
|
|
34056
34096
|
init_skills2();
|
|
34057
|
-
import { existsSync as
|
|
34097
|
+
import { existsSync as existsSync26, readdirSync as readdirSync4, readFileSync as readFileSync22 } from "node:fs";
|
|
34058
34098
|
import { join as join23 } from "node:path";
|
|
34059
34099
|
import { homedir as homedir5 } from "node:os";
|
|
34060
34100
|
var CODING_CATEGORIES = /* @__PURE__ */ new Set([
|
|
@@ -34132,7 +34172,7 @@ function loadSkillMdSkills(projectRoot = process.cwd(), options = {}) {
|
|
|
34132
34172
|
const summary = { loaded: [], skipped: [] };
|
|
34133
34173
|
const seen = new Set(options.existingIds ?? []);
|
|
34134
34174
|
for (const dir of skillMdSearchDirs(projectRoot)) {
|
|
34135
|
-
if (!
|
|
34175
|
+
if (!existsSync26(dir)) continue;
|
|
34136
34176
|
let entries;
|
|
34137
34177
|
try {
|
|
34138
34178
|
entries = readdirSync4(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
@@ -34141,7 +34181,7 @@ function loadSkillMdSkills(projectRoot = process.cwd(), options = {}) {
|
|
|
34141
34181
|
}
|
|
34142
34182
|
for (const entry of entries) {
|
|
34143
34183
|
const skillPath = join23(dir, entry, "SKILL.md");
|
|
34144
|
-
if (!
|
|
34184
|
+
if (!existsSync26(skillPath)) continue;
|
|
34145
34185
|
try {
|
|
34146
34186
|
const parsed = parseSkillMd(readFileSync22(skillPath, "utf8"), skillPath);
|
|
34147
34187
|
if (!parsed) {
|