claudekit-cli 3.41.2-dev.2 → 3.41.2-dev.3
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/index.js +374 -325
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10982,7 +10982,7 @@ __export(exports_provider_registry, {
|
|
|
10982
10982
|
detectInstalledProviders: () => detectInstalledProviders
|
|
10983
10983
|
});
|
|
10984
10984
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
10985
|
-
import { homedir } from "node:os";
|
|
10985
|
+
import { homedir, platform } from "node:os";
|
|
10986
10986
|
import { join } from "node:path";
|
|
10987
10987
|
function hasInstallSignal(path) {
|
|
10988
10988
|
if (!path || !existsSync(path)) {
|
|
@@ -11004,6 +11004,18 @@ function hasInstallSignal(path) {
|
|
|
11004
11004
|
function hasAnyInstallSignal(paths) {
|
|
11005
11005
|
return paths.some((path) => hasInstallSignal(path));
|
|
11006
11006
|
}
|
|
11007
|
+
function hasOpenCodeInstallSignal() {
|
|
11008
|
+
return hasAnyInstallSignal([
|
|
11009
|
+
join(cwd, "opencode.json"),
|
|
11010
|
+
join(cwd, "opencode.jsonc"),
|
|
11011
|
+
join(cwd, ".opencode/agents"),
|
|
11012
|
+
join(cwd, ".opencode/commands"),
|
|
11013
|
+
join(home, ".config/opencode/AGENTS.md"),
|
|
11014
|
+
join(home, ".config/opencode/agents"),
|
|
11015
|
+
join(home, ".config/opencode/commands"),
|
|
11016
|
+
join(home, ".opencode/bin", OPENCODE_BINARY_NAME)
|
|
11017
|
+
]);
|
|
11018
|
+
}
|
|
11007
11019
|
function getAllProviderTypes() {
|
|
11008
11020
|
return Object.keys(providers);
|
|
11009
11021
|
}
|
|
@@ -11065,10 +11077,11 @@ function detectProviderPathCollisions(selectedProviders, options2) {
|
|
|
11065
11077
|
}
|
|
11066
11078
|
return collisions;
|
|
11067
11079
|
}
|
|
11068
|
-
var home, cwd, providers;
|
|
11080
|
+
var home, cwd, OPENCODE_BINARY_NAME, providers;
|
|
11069
11081
|
var init_provider_registry = __esm(() => {
|
|
11070
11082
|
home = homedir();
|
|
11071
11083
|
cwd = process.cwd();
|
|
11084
|
+
OPENCODE_BINARY_NAME = platform() === "win32" ? "opencode.exe" : "opencode";
|
|
11072
11085
|
providers = {
|
|
11073
11086
|
"claude-code": {
|
|
11074
11087
|
name: "claude-code",
|
|
@@ -11154,8 +11167,8 @@ var init_provider_registry = __esm(() => {
|
|
|
11154
11167
|
fileExtension: ".md"
|
|
11155
11168
|
},
|
|
11156
11169
|
skills: {
|
|
11157
|
-
projectPath: ".
|
|
11158
|
-
globalPath: join(home, ".
|
|
11170
|
+
projectPath: ".claude/skills",
|
|
11171
|
+
globalPath: join(home, ".claude/skills"),
|
|
11159
11172
|
format: "direct-copy",
|
|
11160
11173
|
writeStrategy: "per-file",
|
|
11161
11174
|
fileExtension: ".md"
|
|
@@ -11176,17 +11189,7 @@ var init_provider_registry = __esm(() => {
|
|
|
11176
11189
|
},
|
|
11177
11190
|
hooks: null,
|
|
11178
11191
|
settingsJsonPath: null,
|
|
11179
|
-
detect: async () =>
|
|
11180
|
-
join(cwd, "opencode.json"),
|
|
11181
|
-
join(cwd, "opencode.jsonc"),
|
|
11182
|
-
join(cwd, ".opencode/agents"),
|
|
11183
|
-
join(cwd, ".opencode/commands"),
|
|
11184
|
-
join(cwd, ".opencode/skills"),
|
|
11185
|
-
join(home, ".config/opencode/AGENTS.md"),
|
|
11186
|
-
join(home, ".config/opencode/agents"),
|
|
11187
|
-
join(home, ".config/opencode/commands"),
|
|
11188
|
-
join(home, ".config/opencode/skills")
|
|
11189
|
-
])
|
|
11192
|
+
detect: async () => hasOpenCodeInstallSignal()
|
|
11190
11193
|
},
|
|
11191
11194
|
"github-copilot": {
|
|
11192
11195
|
name: "github-copilot",
|
|
@@ -18478,7 +18481,7 @@ var init_safe_spinner = __esm(() => {
|
|
|
18478
18481
|
|
|
18479
18482
|
// src/shared/path-resolver.ts
|
|
18480
18483
|
import { existsSync as existsSync8, readFileSync as readFileSync4 } from "node:fs";
|
|
18481
|
-
import { homedir as homedir9, platform } from "node:os";
|
|
18484
|
+
import { homedir as homedir9, platform as platform2 } from "node:os";
|
|
18482
18485
|
import { join as join11, normalize } from "node:path";
|
|
18483
18486
|
function getEnvVar(name) {
|
|
18484
18487
|
const val = process.env[name];
|
|
@@ -18545,7 +18548,7 @@ class PathResolver {
|
|
|
18545
18548
|
if (!global3) {
|
|
18546
18549
|
return join11(homedir9(), ".claudekit");
|
|
18547
18550
|
}
|
|
18548
|
-
const os2 =
|
|
18551
|
+
const os2 = platform2();
|
|
18549
18552
|
if (os2 === "win32") {
|
|
18550
18553
|
const localAppData = getEnvVar("LOCALAPPDATA") ?? join11(homedir9(), "AppData", "Local");
|
|
18551
18554
|
return join11(localAppData, "claude");
|
|
@@ -18567,7 +18570,7 @@ class PathResolver {
|
|
|
18567
18570
|
if (!global3) {
|
|
18568
18571
|
return join11(homedir9(), ".claudekit", "cache");
|
|
18569
18572
|
}
|
|
18570
|
-
const os2 =
|
|
18573
|
+
const os2 = platform2();
|
|
18571
18574
|
if (os2 === "win32") {
|
|
18572
18575
|
const localAppData = getEnvVar("LOCALAPPDATA") ?? join11(homedir9(), "AppData", "Local");
|
|
18573
18576
|
return join11(localAppData, "claude", "cache");
|
|
@@ -43957,16 +43960,16 @@ function detectArchBinary(binary) {
|
|
|
43957
43960
|
}
|
|
43958
43961
|
return archBinary;
|
|
43959
43962
|
}
|
|
43960
|
-
function detectPlatformBinary({ [
|
|
43963
|
+
function detectPlatformBinary({ [platform3]: platformBinary }, { wsl } = {}) {
|
|
43961
43964
|
if (wsl && is_wsl_default) {
|
|
43962
43965
|
return detectArchBinary(wsl);
|
|
43963
43966
|
}
|
|
43964
43967
|
if (!platformBinary) {
|
|
43965
|
-
throw new Error(`${
|
|
43968
|
+
throw new Error(`${platform3} is not supported`);
|
|
43966
43969
|
}
|
|
43967
43970
|
return detectArchBinary(platformBinary);
|
|
43968
43971
|
}
|
|
43969
|
-
var fallbackAttemptSymbol, __dirname2, localXdgOpenPath,
|
|
43972
|
+
var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform3, arch, tryEachApp = async (apps, opener) => {
|
|
43970
43973
|
if (apps.length === 0) {
|
|
43971
43974
|
return;
|
|
43972
43975
|
}
|
|
@@ -44060,7 +44063,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform2, arch, tryEac
|
|
|
44060
44063
|
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
44061
44064
|
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
44062
44065
|
}
|
|
44063
|
-
if (
|
|
44066
|
+
if (platform3 === "darwin") {
|
|
44064
44067
|
command = "open";
|
|
44065
44068
|
if (options2.wait) {
|
|
44066
44069
|
cliArguments.push("--wait-apps");
|
|
@@ -44074,7 +44077,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform2, arch, tryEac
|
|
|
44074
44077
|
if (app) {
|
|
44075
44078
|
cliArguments.push("-a", app);
|
|
44076
44079
|
}
|
|
44077
|
-
} else if (
|
|
44080
|
+
} else if (platform3 === "win32" || shouldUseWindowsInWsl) {
|
|
44078
44081
|
command = await powerShellPath2();
|
|
44079
44082
|
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
44080
44083
|
if (!is_wsl_default) {
|
|
@@ -44113,7 +44116,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform2, arch, tryEac
|
|
|
44113
44116
|
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
44114
44117
|
exeLocalXdgOpen = true;
|
|
44115
44118
|
} catch {}
|
|
44116
|
-
const useSystemXdgOpen = process16.versions.electron ?? (
|
|
44119
|
+
const useSystemXdgOpen = process16.versions.electron ?? (platform3 === "android" || isBundled || !exeLocalXdgOpen);
|
|
44117
44120
|
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
44118
44121
|
}
|
|
44119
44122
|
if (appArguments.length > 0) {
|
|
@@ -44124,7 +44127,7 @@ var fallbackAttemptSymbol, __dirname2, localXdgOpenPath, platform2, arch, tryEac
|
|
|
44124
44127
|
childProcessOptions.detached = true;
|
|
44125
44128
|
}
|
|
44126
44129
|
}
|
|
44127
|
-
if (
|
|
44130
|
+
if (platform3 === "darwin" && appArguments.length > 0) {
|
|
44128
44131
|
cliArguments.push("--args", ...appArguments);
|
|
44129
44132
|
}
|
|
44130
44133
|
if (options2.target) {
|
|
@@ -44200,7 +44203,7 @@ var init_open = __esm(() => {
|
|
|
44200
44203
|
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
44201
44204
|
__dirname2 = import.meta.url ? path2.dirname(fileURLToPath(import.meta.url)) : "";
|
|
44202
44205
|
localXdgOpenPath = path2.join(__dirname2, "xdg-open");
|
|
44203
|
-
({ platform:
|
|
44206
|
+
({ platform: platform3, arch } = process16);
|
|
44204
44207
|
apps = {
|
|
44205
44208
|
browser: "browser",
|
|
44206
44209
|
browserPrivate: "browserPrivate"
|
|
@@ -44249,7 +44252,7 @@ var init_open = __esm(() => {
|
|
|
44249
44252
|
import { existsSync as existsSync10 } from "node:fs";
|
|
44250
44253
|
import { mkdir as mkdir6, readFile as readFile7, rename as rename3, rm as rm3, writeFile as writeFile5 } from "node:fs/promises";
|
|
44251
44254
|
import { chmod } from "node:fs/promises";
|
|
44252
|
-
import { platform as
|
|
44255
|
+
import { platform as platform4 } from "node:os";
|
|
44253
44256
|
import { join as join18 } from "node:path";
|
|
44254
44257
|
|
|
44255
44258
|
class ConfigManager {
|
|
@@ -44291,12 +44294,12 @@ class ConfigManager {
|
|
|
44291
44294
|
const configFile = PathResolver.getConfigFile(ConfigManager.globalFlag);
|
|
44292
44295
|
if (!existsSync10(configDir)) {
|
|
44293
44296
|
await mkdir6(configDir, { recursive: true });
|
|
44294
|
-
if (
|
|
44297
|
+
if (platform4() !== "win32") {
|
|
44295
44298
|
await chmod(configDir, 448);
|
|
44296
44299
|
}
|
|
44297
44300
|
}
|
|
44298
44301
|
await writeFile5(configFile, JSON.stringify(validConfig, null, 2), "utf-8");
|
|
44299
|
-
if (
|
|
44302
|
+
if (platform4() !== "win32") {
|
|
44300
44303
|
await chmod(configFile, 384);
|
|
44301
44304
|
}
|
|
44302
44305
|
ConfigManager.config = validConfig;
|
|
@@ -55863,9 +55866,41 @@ var init_settings_routes = __esm(() => {
|
|
|
55863
55866
|
});
|
|
55864
55867
|
|
|
55865
55868
|
// src/commands/skills/agents.ts
|
|
55866
|
-
import { existsSync as existsSync30 } from "node:fs";
|
|
55867
|
-
import { homedir as homedir25 } from "node:os";
|
|
55869
|
+
import { existsSync as existsSync30, readdirSync as readdirSync4, statSync as statSync5 } from "node:fs";
|
|
55870
|
+
import { homedir as homedir25, platform as platform5 } from "node:os";
|
|
55868
55871
|
import { join as join44 } from "node:path";
|
|
55872
|
+
function hasInstallSignal2(path5) {
|
|
55873
|
+
if (!path5 || !existsSync30(path5)) {
|
|
55874
|
+
return false;
|
|
55875
|
+
}
|
|
55876
|
+
try {
|
|
55877
|
+
const stat8 = statSync5(path5);
|
|
55878
|
+
if (stat8.isDirectory()) {
|
|
55879
|
+
return readdirSync4(path5).length > 0;
|
|
55880
|
+
}
|
|
55881
|
+
if (stat8.isFile()) {
|
|
55882
|
+
return true;
|
|
55883
|
+
}
|
|
55884
|
+
return false;
|
|
55885
|
+
} catch {
|
|
55886
|
+
return false;
|
|
55887
|
+
}
|
|
55888
|
+
}
|
|
55889
|
+
function hasAnyInstallSignal2(paths) {
|
|
55890
|
+
return paths.some((path5) => hasInstallSignal2(path5));
|
|
55891
|
+
}
|
|
55892
|
+
function hasOpenCodeInstallSignal2() {
|
|
55893
|
+
return hasAnyInstallSignal2([
|
|
55894
|
+
join44(process.cwd(), "opencode.json"),
|
|
55895
|
+
join44(process.cwd(), "opencode.jsonc"),
|
|
55896
|
+
join44(process.cwd(), ".opencode/agents"),
|
|
55897
|
+
join44(process.cwd(), ".opencode/commands"),
|
|
55898
|
+
join44(home6, ".config/opencode/AGENTS.md"),
|
|
55899
|
+
join44(home6, ".config/opencode/agents"),
|
|
55900
|
+
join44(home6, ".config/opencode/commands"),
|
|
55901
|
+
join44(home6, ".opencode", "bin", OPENCODE_BINARY_NAME2)
|
|
55902
|
+
]);
|
|
55903
|
+
}
|
|
55869
55904
|
async function detectInstalledAgents() {
|
|
55870
55905
|
const installed = [];
|
|
55871
55906
|
for (const [type, config] of Object.entries(agents)) {
|
|
@@ -55887,9 +55922,10 @@ function isSkillInstalled(skillName, agent, options2) {
|
|
|
55887
55922
|
const installPath = getInstallPath(skillName, agent, options2);
|
|
55888
55923
|
return existsSync30(installPath);
|
|
55889
55924
|
}
|
|
55890
|
-
var home6, agents;
|
|
55925
|
+
var home6, OPENCODE_BINARY_NAME2, agents;
|
|
55891
55926
|
var init_agents = __esm(() => {
|
|
55892
55927
|
home6 = homedir25();
|
|
55928
|
+
OPENCODE_BINARY_NAME2 = platform5() === "win32" ? "opencode.exe" : "opencode";
|
|
55893
55929
|
agents = {
|
|
55894
55930
|
"claude-code": {
|
|
55895
55931
|
name: "claude-code",
|
|
@@ -55915,9 +55951,9 @@ var init_agents = __esm(() => {
|
|
|
55915
55951
|
opencode: {
|
|
55916
55952
|
name: "opencode",
|
|
55917
55953
|
displayName: "OpenCode",
|
|
55918
|
-
projectPath: ".
|
|
55919
|
-
globalPath: join44(home6, ".
|
|
55920
|
-
detect: async () =>
|
|
55954
|
+
projectPath: ".claude/skills",
|
|
55955
|
+
globalPath: join44(home6, ".claude/skills"),
|
|
55956
|
+
detect: async () => hasOpenCodeInstallSignal2()
|
|
55921
55957
|
},
|
|
55922
55958
|
goose: {
|
|
55923
55959
|
name: "goose",
|
|
@@ -56278,7 +56314,14 @@ var init_skills_installer = __esm(() => {
|
|
|
56278
56314
|
// src/commands/skills/skills-uninstaller.ts
|
|
56279
56315
|
import { existsSync as existsSync33 } from "node:fs";
|
|
56280
56316
|
import { rm as rm8 } from "node:fs/promises";
|
|
56281
|
-
import { join as join47 } from "node:path";
|
|
56317
|
+
import { join as join47, resolve as resolve16 } from "node:path";
|
|
56318
|
+
function isSamePath3(path1, path22) {
|
|
56319
|
+
try {
|
|
56320
|
+
return resolve16(path1) === resolve16(path22);
|
|
56321
|
+
} catch {
|
|
56322
|
+
return false;
|
|
56323
|
+
}
|
|
56324
|
+
}
|
|
56282
56325
|
async function uninstallSkillFromAgent(skill, agent, global3) {
|
|
56283
56326
|
const agentConfig = agents[agent];
|
|
56284
56327
|
const registry = await readRegistry();
|
|
@@ -56296,9 +56339,10 @@ async function uninstallSkillFromAgent(skill, agent, global3) {
|
|
|
56296
56339
|
}
|
|
56297
56340
|
const installation = installations[0];
|
|
56298
56341
|
const path5 = installation.path;
|
|
56342
|
+
const sharedInstallations = registry.installations.filter((i) => isSamePath3(i.path, path5) && !(i.skill === installation.skill && i.agent === installation.agent && i.global === installation.global));
|
|
56299
56343
|
const fileExists = existsSync33(path5);
|
|
56300
56344
|
try {
|
|
56301
|
-
if (fileExists) {
|
|
56345
|
+
if (fileExists && sharedInstallations.length === 0) {
|
|
56302
56346
|
await rm8(path5, { recursive: true, force: true });
|
|
56303
56347
|
}
|
|
56304
56348
|
await removeInstallation(skill, agent, global3);
|
|
@@ -56327,6 +56371,7 @@ async function forceUninstallSkill(skill, agent, global3) {
|
|
|
56327
56371
|
const agentConfig = agents[agent];
|
|
56328
56372
|
const basePath = global3 ? agentConfig.globalPath : agentConfig.projectPath;
|
|
56329
56373
|
const path5 = join47(basePath, skill);
|
|
56374
|
+
const registry = await readRegistry();
|
|
56330
56375
|
if (!existsSync33(path5)) {
|
|
56331
56376
|
return {
|
|
56332
56377
|
skill,
|
|
@@ -56339,7 +56384,10 @@ async function forceUninstallSkill(skill, agent, global3) {
|
|
|
56339
56384
|
};
|
|
56340
56385
|
}
|
|
56341
56386
|
try {
|
|
56342
|
-
|
|
56387
|
+
const sharedInstallations = registry.installations.filter((i) => isSamePath3(i.path, path5) && !(i.skill === skill && i.agent === agent && i.global === global3));
|
|
56388
|
+
if (sharedInstallations.length === 0) {
|
|
56389
|
+
await rm8(path5, { recursive: true, force: true });
|
|
56390
|
+
}
|
|
56343
56391
|
await removeInstallation(skill, agent, global3);
|
|
56344
56392
|
return {
|
|
56345
56393
|
skill,
|
|
@@ -56874,7 +56922,7 @@ var init_pnpm_detector = __esm(() => {
|
|
|
56874
56922
|
// src/domains/installation/package-managers/detection-core.ts
|
|
56875
56923
|
import { existsSync as existsSync34, realpathSync as realpathSync2 } from "node:fs";
|
|
56876
56924
|
import { chmod as chmod2, mkdir as mkdir13, readFile as readFile24, writeFile as writeFile12 } from "node:fs/promises";
|
|
56877
|
-
import { platform as
|
|
56925
|
+
import { platform as platform6 } from "node:os";
|
|
56878
56926
|
import { join as join48 } from "node:path";
|
|
56879
56927
|
function detectFromBinaryPath() {
|
|
56880
56928
|
const normalizePath2 = (pathValue) => pathValue.replace(/\\/g, "/").toLowerCase();
|
|
@@ -56986,7 +57034,7 @@ async function saveCachedPm(pm, getVersion) {
|
|
|
56986
57034
|
const cacheFile = join48(configDir, CACHE_FILE);
|
|
56987
57035
|
if (!existsSync34(configDir)) {
|
|
56988
57036
|
await mkdir13(configDir, { recursive: true });
|
|
56989
|
-
if (
|
|
57037
|
+
if (platform6() !== "win32") {
|
|
56990
57038
|
await chmod2(configDir, 448);
|
|
56991
57039
|
}
|
|
56992
57040
|
}
|
|
@@ -56997,7 +57045,7 @@ async function saveCachedPm(pm, getVersion) {
|
|
|
56997
57045
|
version: version ?? undefined
|
|
56998
57046
|
};
|
|
56999
57047
|
await writeFile12(cacheFile, JSON.stringify(data, null, 2), "utf-8");
|
|
57000
|
-
if (
|
|
57048
|
+
if (platform6() !== "win32") {
|
|
57001
57049
|
await chmod2(cacheFile, 384);
|
|
57002
57050
|
}
|
|
57003
57051
|
logger.debug(`Cached package manager: ${pm}`);
|
|
@@ -57207,7 +57255,7 @@ var package_default;
|
|
|
57207
57255
|
var init_package = __esm(() => {
|
|
57208
57256
|
package_default = {
|
|
57209
57257
|
name: "claudekit-cli",
|
|
57210
|
-
version: "3.41.2-dev.
|
|
57258
|
+
version: "3.41.2-dev.3",
|
|
57211
57259
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
57212
57260
|
type: "module",
|
|
57213
57261
|
repository: {
|
|
@@ -59287,12 +59335,12 @@ async function promptKitUpdate(beta, yes, deps) {
|
|
|
59287
59335
|
args.push("--beta");
|
|
59288
59336
|
const displayCmd = `ck ${args.join(" ")}`;
|
|
59289
59337
|
logger.info(`Running: ${displayCmd}`);
|
|
59290
|
-
const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((
|
|
59338
|
+
const spawnFn = deps?.spawnInitFn ?? ((spawnArgs) => new Promise((resolve17) => {
|
|
59291
59339
|
const child = spawn2("ck", spawnArgs, { stdio: "inherit", shell: true });
|
|
59292
|
-
child.on("close", (code) =>
|
|
59340
|
+
child.on("close", (code) => resolve17(code ?? 1));
|
|
59293
59341
|
child.on("error", (err) => {
|
|
59294
59342
|
logger.verbose(`Failed to spawn ck init: ${err.message}`);
|
|
59295
|
-
|
|
59343
|
+
resolve17(1);
|
|
59296
59344
|
});
|
|
59297
59345
|
}));
|
|
59298
59346
|
const exitCode = await spawnFn(args);
|
|
@@ -60190,7 +60238,7 @@ var init_routes = __esm(() => {
|
|
|
60190
60238
|
|
|
60191
60239
|
// src/domains/web-server/static-server.ts
|
|
60192
60240
|
import { existsSync as existsSync38 } from "node:fs";
|
|
60193
|
-
import { dirname as dirname19, join as join55, resolve as
|
|
60241
|
+
import { dirname as dirname19, join as join55, resolve as resolve17 } from "node:path";
|
|
60194
60242
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
60195
60243
|
function addRuntimeUiCandidate(candidates, runtimePath) {
|
|
60196
60244
|
if (!runtimePath) {
|
|
@@ -60200,7 +60248,7 @@ function addRuntimeUiCandidate(candidates, runtimePath) {
|
|
|
60200
60248
|
if (!looksLikePath) {
|
|
60201
60249
|
return;
|
|
60202
60250
|
}
|
|
60203
|
-
const entryDir = dirname19(
|
|
60251
|
+
const entryDir = dirname19(resolve17(runtimePath));
|
|
60204
60252
|
candidates.add(join55(entryDir, "ui"));
|
|
60205
60253
|
candidates.add(join55(entryDir, "..", "dist", "ui"));
|
|
60206
60254
|
}
|
|
@@ -63230,10 +63278,10 @@ async function createAppServer(options2 = {}) {
|
|
|
63230
63278
|
wsManager = new WebSocketManager(server);
|
|
63231
63279
|
fileWatcher = new FileWatcher({ wsManager });
|
|
63232
63280
|
fileWatcher.start();
|
|
63233
|
-
await new Promise((
|
|
63281
|
+
await new Promise((resolve18, reject) => {
|
|
63234
63282
|
const onListening = () => {
|
|
63235
63283
|
server.off("error", onError);
|
|
63236
|
-
|
|
63284
|
+
resolve18();
|
|
63237
63285
|
};
|
|
63238
63286
|
const onError = (error) => {
|
|
63239
63287
|
server.off("listening", onListening);
|
|
@@ -63270,16 +63318,16 @@ async function createAppServer(options2 = {}) {
|
|
|
63270
63318
|
};
|
|
63271
63319
|
}
|
|
63272
63320
|
async function closeHttpServer(server) {
|
|
63273
|
-
await new Promise((
|
|
63321
|
+
await new Promise((resolve18) => {
|
|
63274
63322
|
if (!server.listening) {
|
|
63275
|
-
|
|
63323
|
+
resolve18();
|
|
63276
63324
|
return;
|
|
63277
63325
|
}
|
|
63278
63326
|
server.close((err) => {
|
|
63279
63327
|
if (err) {
|
|
63280
63328
|
logger.debug(`Server close error: ${err.message}`);
|
|
63281
63329
|
}
|
|
63282
|
-
|
|
63330
|
+
resolve18();
|
|
63283
63331
|
});
|
|
63284
63332
|
});
|
|
63285
63333
|
}
|
|
@@ -63721,8 +63769,8 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
63721
63769
|
exports.toPosixSlashes = (str2) => str2.replace(REGEX_BACKSLASH, "/");
|
|
63722
63770
|
exports.isWindows = () => {
|
|
63723
63771
|
if (typeof navigator !== "undefined" && navigator.platform) {
|
|
63724
|
-
const
|
|
63725
|
-
return
|
|
63772
|
+
const platform9 = navigator.platform.toLowerCase();
|
|
63773
|
+
return platform9 === "win32" || platform9 === "windows";
|
|
63726
63774
|
}
|
|
63727
63775
|
if (typeof process !== "undefined" && process.platform) {
|
|
63728
63776
|
return process.platform === "win32";
|
|
@@ -65015,7 +65063,7 @@ var require_picomatch2 = __commonJS((exports, module) => {
|
|
|
65015
65063
|
import { exec as exec7, execFile as execFile7, spawn as spawn4 } from "node:child_process";
|
|
65016
65064
|
import { promisify as promisify13 } from "node:util";
|
|
65017
65065
|
function executeInteractiveScript(command, args, options2) {
|
|
65018
|
-
return new Promise((
|
|
65066
|
+
return new Promise((resolve20, reject) => {
|
|
65019
65067
|
const child = spawn4(command, args, {
|
|
65020
65068
|
stdio: ["ignore", "inherit", "inherit"],
|
|
65021
65069
|
cwd: options2?.cwd,
|
|
@@ -65036,7 +65084,7 @@ function executeInteractiveScript(command, args, options2) {
|
|
|
65036
65084
|
} else if (code !== 0) {
|
|
65037
65085
|
reject(new Error(`Command exited with code ${code}`));
|
|
65038
65086
|
} else {
|
|
65039
|
-
|
|
65087
|
+
resolve20();
|
|
65040
65088
|
}
|
|
65041
65089
|
});
|
|
65042
65090
|
child.on("error", (error) => {
|
|
@@ -65047,8 +65095,8 @@ function executeInteractiveScript(command, args, options2) {
|
|
|
65047
65095
|
});
|
|
65048
65096
|
}
|
|
65049
65097
|
function getNpmCommand() {
|
|
65050
|
-
const
|
|
65051
|
-
return
|
|
65098
|
+
const platform9 = process.platform;
|
|
65099
|
+
return platform9 === "win32" ? "npm.cmd" : "npm";
|
|
65052
65100
|
}
|
|
65053
65101
|
var execAsync7, execFileAsync5;
|
|
65054
65102
|
var init_process_executor = __esm(() => {
|
|
@@ -65057,7 +65105,7 @@ var init_process_executor = __esm(() => {
|
|
|
65057
65105
|
});
|
|
65058
65106
|
|
|
65059
65107
|
// src/services/package-installer/validators.ts
|
|
65060
|
-
import { resolve as
|
|
65108
|
+
import { resolve as resolve20 } from "node:path";
|
|
65061
65109
|
function validatePackageName(packageName) {
|
|
65062
65110
|
if (!packageName || typeof packageName !== "string") {
|
|
65063
65111
|
throw new Error("Package name must be a non-empty string");
|
|
@@ -65070,8 +65118,8 @@ function validatePackageName(packageName) {
|
|
|
65070
65118
|
}
|
|
65071
65119
|
}
|
|
65072
65120
|
function validateScriptPath(skillsDir2, scriptPath) {
|
|
65073
|
-
const skillsDirResolved =
|
|
65074
|
-
const scriptPathResolved =
|
|
65121
|
+
const skillsDirResolved = resolve20(skillsDir2);
|
|
65122
|
+
const scriptPathResolved = resolve20(scriptPath);
|
|
65075
65123
|
const skillsDirNormalized = isWindows() ? skillsDirResolved.toLowerCase() : skillsDirResolved;
|
|
65076
65124
|
const scriptPathNormalized = isWindows() ? scriptPathResolved.toLowerCase() : scriptPathResolved;
|
|
65077
65125
|
if (!scriptPathNormalized.startsWith(skillsDirNormalized)) {
|
|
@@ -65466,8 +65514,8 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65466
65514
|
try {
|
|
65467
65515
|
const { existsSync: existsSync50 } = await import("node:fs");
|
|
65468
65516
|
const clack = await Promise.resolve().then(() => (init_dist2(), exports_dist));
|
|
65469
|
-
const
|
|
65470
|
-
const scriptName =
|
|
65517
|
+
const platform9 = process.platform;
|
|
65518
|
+
const scriptName = platform9 === "win32" ? "install.ps1" : "install.sh";
|
|
65471
65519
|
const scriptPath = join75(skillsDir2, scriptName);
|
|
65472
65520
|
try {
|
|
65473
65521
|
validateScriptPath(skillsDir2, scriptPath);
|
|
@@ -65497,7 +65545,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65497
65545
|
}
|
|
65498
65546
|
logger.warning("Installation script will execute with user privileges");
|
|
65499
65547
|
logger.info(` Script: ${scriptPath}`);
|
|
65500
|
-
logger.info(` Platform: ${
|
|
65548
|
+
logger.info(` Platform: ${platform9 === "win32" ? "Windows (PowerShell)" : "Unix (bash)"}`);
|
|
65501
65549
|
if (logger.isVerbose()) {
|
|
65502
65550
|
try {
|
|
65503
65551
|
const { readFile: readFile37 } = await import("node:fs/promises");
|
|
@@ -65528,7 +65576,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65528
65576
|
logger.info("Installation cancelled by user");
|
|
65529
65577
|
logger.info("");
|
|
65530
65578
|
logger.info("\uD83D\uDCD6 Manual Installation Instructions:");
|
|
65531
|
-
logger.info(` ${
|
|
65579
|
+
logger.info(` ${platform9 === "win32" ? `powershell -File "${scriptPath}"` : `bash ${scriptPath}`}`);
|
|
65532
65580
|
logger.info("");
|
|
65533
65581
|
logger.info("Or see complete guide:");
|
|
65534
65582
|
logger.info(` ${join75(skillsDir2, "INSTALLATION.md")}`);
|
|
@@ -65556,7 +65604,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65556
65604
|
}
|
|
65557
65605
|
}
|
|
65558
65606
|
}
|
|
65559
|
-
if (
|
|
65607
|
+
if (platform9 === "linux") {
|
|
65560
65608
|
const needsSudo = await checkNeedsSudoPackages();
|
|
65561
65609
|
if (needsSudo) {
|
|
65562
65610
|
if (withSudo) {
|
|
@@ -65605,7 +65653,7 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
65605
65653
|
...process.env,
|
|
65606
65654
|
NON_INTERACTIVE: "1"
|
|
65607
65655
|
};
|
|
65608
|
-
if (
|
|
65656
|
+
if (platform9 === "win32") {
|
|
65609
65657
|
await executeInteractiveScript("powershell.exe", ["-NoLogo", "-ExecutionPolicy", "Bypass", "-File", scriptPath, "-Y"], {
|
|
65610
65658
|
timeout: 600000,
|
|
65611
65659
|
cwd: skillsDir2,
|
|
@@ -65901,10 +65949,10 @@ __export(exports_gemini_mcp_linker, {
|
|
|
65901
65949
|
checkExistingGeminiConfig: () => checkExistingGeminiConfig,
|
|
65902
65950
|
addGeminiToGitignore: () => addGeminiToGitignore
|
|
65903
65951
|
});
|
|
65904
|
-
import { resolve as
|
|
65952
|
+
import { resolve as resolve21 } from "node:path";
|
|
65905
65953
|
async function linkGeminiMcpConfig(projectDir, options2 = {}) {
|
|
65906
65954
|
const { skipGitignore = false, isGlobal = false } = options2;
|
|
65907
|
-
const resolvedProjectDir =
|
|
65955
|
+
const resolvedProjectDir = resolve21(projectDir);
|
|
65908
65956
|
const geminiSettingsPath = getGeminiSettingsPath(resolvedProjectDir, isGlobal);
|
|
65909
65957
|
const mcpConfigPath = findMcpConfigPath(resolvedProjectDir);
|
|
65910
65958
|
if (!mcpConfigPath) {
|
|
@@ -66552,7 +66600,7 @@ var require_get_stream = __commonJS((exports, module) => {
|
|
|
66552
66600
|
};
|
|
66553
66601
|
const { maxBuffer } = options2;
|
|
66554
66602
|
let stream;
|
|
66555
|
-
await new Promise((
|
|
66603
|
+
await new Promise((resolve23, reject) => {
|
|
66556
66604
|
const rejectPromise = (error) => {
|
|
66557
66605
|
if (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {
|
|
66558
66606
|
error.bufferedData = stream.getBufferedValue();
|
|
@@ -66564,7 +66612,7 @@ var require_get_stream = __commonJS((exports, module) => {
|
|
|
66564
66612
|
rejectPromise(error);
|
|
66565
66613
|
return;
|
|
66566
66614
|
}
|
|
66567
|
-
|
|
66615
|
+
resolve23();
|
|
66568
66616
|
});
|
|
66569
66617
|
stream.on("data", () => {
|
|
66570
66618
|
if (stream.getBufferedLength() > maxBuffer) {
|
|
@@ -67925,7 +67973,7 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
67925
67973
|
debug("opening", this.zipPath, "with opts", this.opts);
|
|
67926
67974
|
this.zipfile = await openZip(this.zipPath, { lazyEntries: true });
|
|
67927
67975
|
this.canceled = false;
|
|
67928
|
-
return new Promise((
|
|
67976
|
+
return new Promise((resolve23, reject) => {
|
|
67929
67977
|
this.zipfile.on("error", (err) => {
|
|
67930
67978
|
this.canceled = true;
|
|
67931
67979
|
reject(err);
|
|
@@ -67934,7 +67982,7 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
67934
67982
|
this.zipfile.on("close", () => {
|
|
67935
67983
|
if (!this.canceled) {
|
|
67936
67984
|
debug("zip extraction complete");
|
|
67937
|
-
|
|
67985
|
+
resolve23();
|
|
67938
67986
|
}
|
|
67939
67987
|
});
|
|
67940
67988
|
this.zipfile.on("entry", async (entry) => {
|
|
@@ -68253,7 +68301,7 @@ async function restoreOriginalBranch(branchName, cwd2, issueNumber) {
|
|
|
68253
68301
|
}
|
|
68254
68302
|
}
|
|
68255
68303
|
function spawnAndCollect(command, args, cwd2) {
|
|
68256
|
-
return new Promise((
|
|
68304
|
+
return new Promise((resolve36, reject) => {
|
|
68257
68305
|
const child = spawn5(command, args, { ...cwd2 && { cwd: cwd2 }, stdio: ["ignore", "pipe", "pipe"] });
|
|
68258
68306
|
const chunks = [];
|
|
68259
68307
|
const stderrChunks = [];
|
|
@@ -68266,7 +68314,7 @@ function spawnAndCollect(command, args, cwd2) {
|
|
|
68266
68314
|
reject(new Error(`${command} ${args[0] ?? ""} exited with code ${code2}: ${stderr}`));
|
|
68267
68315
|
return;
|
|
68268
68316
|
}
|
|
68269
|
-
|
|
68317
|
+
resolve36(Buffer.concat(chunks).toString("utf-8"));
|
|
68270
68318
|
});
|
|
68271
68319
|
});
|
|
68272
68320
|
}
|
|
@@ -68385,15 +68433,15 @@ function countTwitterChars(text) {
|
|
|
68385
68433
|
}
|
|
68386
68434
|
return count;
|
|
68387
68435
|
}
|
|
68388
|
-
function validateContent(content,
|
|
68436
|
+
function validateContent(content, platform16) {
|
|
68389
68437
|
const issues = [];
|
|
68390
68438
|
if (!content.text || content.text.trim().length === 0) {
|
|
68391
68439
|
issues.push("Content text is empty");
|
|
68392
68440
|
return { valid: false, issues };
|
|
68393
68441
|
}
|
|
68394
|
-
if (
|
|
68395
|
-
const limit =
|
|
68396
|
-
const charCount =
|
|
68442
|
+
if (platform16 !== "x_thread") {
|
|
68443
|
+
const limit = platform16 === "facebook" ? 500 : 280;
|
|
68444
|
+
const charCount = platform16 === "x" ? countTwitterChars(content.text) : content.text.length;
|
|
68397
68445
|
if (charCount > limit) {
|
|
68398
68446
|
issues.push(`Text exceeds ${limit} char limit (${charCount} weighted chars)`);
|
|
68399
68447
|
}
|
|
@@ -68416,7 +68464,7 @@ function validateContent(content, platform14) {
|
|
|
68416
68464
|
issues.push("Hook (first sentence) is too long (>25 words)");
|
|
68417
68465
|
}
|
|
68418
68466
|
const hashtagCount = content.hashtags?.length ?? 0;
|
|
68419
|
-
if (
|
|
68467
|
+
if (platform16 === "x" && hashtagCount > 5) {
|
|
68420
68468
|
issues.push("Too many hashtags for X (max 5)");
|
|
68421
68469
|
}
|
|
68422
68470
|
return { valid: issues.length === 0, issues };
|
|
@@ -68451,7 +68499,7 @@ var init_content_validator = __esm(() => {
|
|
|
68451
68499
|
|
|
68452
68500
|
// src/commands/content/phases/context-cache-manager.ts
|
|
68453
68501
|
import { createHash as createHash7 } from "node:crypto";
|
|
68454
|
-
import { existsSync as existsSync66, mkdirSync as mkdirSync4, readFileSync as readFileSync15, readdirSync as
|
|
68502
|
+
import { existsSync as existsSync66, mkdirSync as mkdirSync4, readFileSync as readFileSync15, readdirSync as readdirSync9, statSync as statSync11 } from "node:fs";
|
|
68455
68503
|
import { rename as rename10, writeFile as writeFile35 } from "node:fs/promises";
|
|
68456
68504
|
import { homedir as homedir33 } from "node:os";
|
|
68457
68505
|
import { basename as basename23, join as join136 } from "node:path";
|
|
@@ -68487,7 +68535,7 @@ function computeSourceHash(repoPath) {
|
|
|
68487
68535
|
const paths = getDocSourcePaths(repoPath);
|
|
68488
68536
|
for (const filePath of paths) {
|
|
68489
68537
|
try {
|
|
68490
|
-
const stat21 =
|
|
68538
|
+
const stat21 = statSync11(filePath);
|
|
68491
68539
|
hash.update(`${filePath}:${stat21.mtimeMs}`);
|
|
68492
68540
|
} catch {
|
|
68493
68541
|
hash.update(`${filePath}:0`);
|
|
@@ -68500,7 +68548,7 @@ function getDocSourcePaths(repoPath) {
|
|
|
68500
68548
|
const docsDir = join136(repoPath, "docs");
|
|
68501
68549
|
if (existsSync66(docsDir)) {
|
|
68502
68550
|
try {
|
|
68503
|
-
const files =
|
|
68551
|
+
const files = readdirSync9(docsDir);
|
|
68504
68552
|
for (const f3 of files) {
|
|
68505
68553
|
if (f3.endsWith(".md"))
|
|
68506
68554
|
paths.push(join136(docsDir, f3));
|
|
@@ -68513,7 +68561,7 @@ function getDocSourcePaths(repoPath) {
|
|
|
68513
68561
|
const stylesDir = join136(repoPath, "assets", "writing-styles");
|
|
68514
68562
|
if (existsSync66(stylesDir)) {
|
|
68515
68563
|
try {
|
|
68516
|
-
const files =
|
|
68564
|
+
const files = readdirSync9(stylesDir);
|
|
68517
68565
|
for (const f3 of files) {
|
|
68518
68566
|
paths.push(join136(stylesDir, f3));
|
|
68519
68567
|
}
|
|
@@ -68708,7 +68756,7 @@ function extractContentFromResponse(response) {
|
|
|
68708
68756
|
|
|
68709
68757
|
// src/commands/content/phases/docs-summarizer.ts
|
|
68710
68758
|
import { execSync as execSync6 } from "node:child_process";
|
|
68711
|
-
import { existsSync as existsSync67, readFileSync as readFileSync16, readdirSync as
|
|
68759
|
+
import { existsSync as existsSync67, readFileSync as readFileSync16, readdirSync as readdirSync10 } from "node:fs";
|
|
68712
68760
|
import { join as join137 } from "node:path";
|
|
68713
68761
|
async function summarizeProjectDocs(repoPath, contentLogger) {
|
|
68714
68762
|
const rawContent = collectRawDocs(repoPath);
|
|
@@ -68766,7 +68814,7 @@ function collectRawDocs(repoPath) {
|
|
|
68766
68814
|
const docsDir = join137(repoPath, "docs");
|
|
68767
68815
|
if (existsSync67(docsDir)) {
|
|
68768
68816
|
try {
|
|
68769
|
-
const files =
|
|
68817
|
+
const files = readdirSync10(docsDir).filter((f3) => f3.endsWith(".md")).sort();
|
|
68770
68818
|
for (const f3 of files) {
|
|
68771
68819
|
const content = readCapped(join137(docsDir, f3), 5000);
|
|
68772
68820
|
if (content) {
|
|
@@ -68790,7 +68838,7 @@ ${content}`);
|
|
|
68790
68838
|
const stylesDir = join137(repoPath, "assets", "writing-styles");
|
|
68791
68839
|
if (existsSync67(stylesDir)) {
|
|
68792
68840
|
try {
|
|
68793
|
-
const files =
|
|
68841
|
+
const files = readdirSync10(stylesDir).slice(0, 3);
|
|
68794
68842
|
styles3 = files.map((f3) => readCapped(join137(stylesDir, f3), 1000)).filter(Boolean).join(`
|
|
68795
68843
|
|
|
68796
68844
|
`);
|
|
@@ -68830,10 +68878,10 @@ var MAX_RAW_CONTENT_CHARS = 50000;
|
|
|
68830
68878
|
var init_docs_summarizer = () => {};
|
|
68831
68879
|
|
|
68832
68880
|
// src/commands/content/phases/context-builder.ts
|
|
68833
|
-
async function buildContentContext(event, repoPath, config, db,
|
|
68881
|
+
async function buildContentContext(event, repoPath, config, db, platform16, contentLogger) {
|
|
68834
68882
|
const cached = getCachedContext(repoPath);
|
|
68835
68883
|
if (cached) {
|
|
68836
|
-
return buildFromCache(cached, event, db,
|
|
68884
|
+
return buildFromCache(cached, event, db, platform16, config);
|
|
68837
68885
|
}
|
|
68838
68886
|
const noopLogger = { debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };
|
|
68839
68887
|
const log2 = contentLogger ?? noopLogger;
|
|
@@ -68848,16 +68896,16 @@ async function buildContentContext(event, repoPath, config, db, platform14, cont
|
|
|
68848
68896
|
sourceHash: hash
|
|
68849
68897
|
};
|
|
68850
68898
|
await saveCachedContext(repoPath, newCache);
|
|
68851
|
-
return buildFromCache(newCache, event, db,
|
|
68899
|
+
return buildFromCache(newCache, event, db, platform16, config);
|
|
68852
68900
|
}
|
|
68853
|
-
function buildFromCache(cache5, event, db,
|
|
68901
|
+
function buildFromCache(cache5, event, db, platform16, config) {
|
|
68854
68902
|
return {
|
|
68855
68903
|
brandGuidelines: cache5.brandSummary,
|
|
68856
68904
|
writingStyles: cache5.stylesSummary,
|
|
68857
68905
|
gitEventDetails: formatGitEvent(event),
|
|
68858
68906
|
recentContent: formatRecentContent(db),
|
|
68859
68907
|
topPerformingContent: "",
|
|
68860
|
-
platformRules: getPlatformRules(
|
|
68908
|
+
platformRules: getPlatformRules(platform16, config),
|
|
68861
68909
|
projectReadme: cache5.readmeSummary,
|
|
68862
68910
|
projectDocsSummary: cache5.docsSummary,
|
|
68863
68911
|
currentDateTime: new Date().toISOString()
|
|
@@ -68886,8 +68934,8 @@ function formatRecentContent(db) {
|
|
|
68886
68934
|
return recent.map((c2) => `[${c2.platform}] ${c2.textContent.slice(0, 100)}`).join(`
|
|
68887
68935
|
`);
|
|
68888
68936
|
}
|
|
68889
|
-
function getPlatformRules(
|
|
68890
|
-
switch (
|
|
68937
|
+
function getPlatformRules(platform16, config) {
|
|
68938
|
+
switch (platform16) {
|
|
68891
68939
|
case "x":
|
|
68892
68940
|
return [
|
|
68893
68941
|
"Platform: X (Twitter)",
|
|
@@ -68926,8 +68974,8 @@ var init_context_builder = __esm(() => {
|
|
|
68926
68974
|
});
|
|
68927
68975
|
|
|
68928
68976
|
// src/commands/content/phases/prompt-templates.ts
|
|
68929
|
-
function buildTextPrompt(context,
|
|
68930
|
-
const charLimit =
|
|
68977
|
+
function buildTextPrompt(context, platform16) {
|
|
68978
|
+
const charLimit = platform16 === "x" || platform16 === "x_thread" ? 280 : 500;
|
|
68931
68979
|
return `You are a social media content creator.
|
|
68932
68980
|
|
|
68933
68981
|
## Project Context
|
|
@@ -68942,14 +68990,14 @@ ${context.writingStyles}
|
|
|
68942
68990
|
## Content Source
|
|
68943
68991
|
${context.gitEventDetails}
|
|
68944
68992
|
|
|
68945
|
-
## Platform: ${
|
|
68993
|
+
## Platform: ${platform16}
|
|
68946
68994
|
${context.platformRules}
|
|
68947
68995
|
|
|
68948
68996
|
## Past Content (avoid repetition)
|
|
68949
68997
|
${context.recentContent}
|
|
68950
68998
|
|
|
68951
68999
|
## Instructions
|
|
68952
|
-
1. Create a ${
|
|
69000
|
+
1. Create a ${platform16} post about this development update
|
|
68953
69001
|
2. Start with a compelling hook that creates curiosity
|
|
68954
69002
|
3. Keep it conversational and authentic (avoid AI-sounding language)
|
|
68955
69003
|
4. No generic statements — be specific about what changed and why it matters
|
|
@@ -68959,8 +69007,8 @@ ${context.recentContent}
|
|
|
68959
69007
|
|
|
68960
69008
|
IMPORTANT: Output ONLY the JSON object, nothing else.`;
|
|
68961
69009
|
}
|
|
68962
|
-
function buildPhotoPrompt(context,
|
|
68963
|
-
const dimensions =
|
|
69010
|
+
function buildPhotoPrompt(context, platform16) {
|
|
69011
|
+
const dimensions = platform16 === "facebook" ? "1200x630" : "1200x675";
|
|
68964
69012
|
return `Generate an image for this social media post.
|
|
68965
69013
|
|
|
68966
69014
|
## Brand Guidelines
|
|
@@ -68981,16 +69029,16 @@ IMPORTANT: Generate the image and output the path as JSON: {"imagePath": "/path/
|
|
|
68981
69029
|
|
|
68982
69030
|
// src/commands/content/phases/photo-generator.ts
|
|
68983
69031
|
import { execSync as execSync7 } from "node:child_process";
|
|
68984
|
-
import { existsSync as existsSync68, mkdirSync as mkdirSync5, readdirSync as
|
|
69032
|
+
import { existsSync as existsSync68, mkdirSync as mkdirSync5, readdirSync as readdirSync11 } from "node:fs";
|
|
68985
69033
|
import { homedir as homedir34 } from "node:os";
|
|
68986
69034
|
import { join as join138 } from "node:path";
|
|
68987
|
-
async function generatePhoto(_content, context, config,
|
|
69035
|
+
async function generatePhoto(_content, context, config, platform16, contentId, contentLogger) {
|
|
68988
69036
|
const mediaDir = join138(config.contentDir.replace(/^~/, homedir34()), "media", String(contentId));
|
|
68989
69037
|
if (!existsSync68(mediaDir)) {
|
|
68990
69038
|
mkdirSync5(mediaDir, { recursive: true });
|
|
68991
69039
|
}
|
|
68992
|
-
const prompt = buildPhotoPrompt(context,
|
|
68993
|
-
const dimensions =
|
|
69040
|
+
const prompt = buildPhotoPrompt(context, platform16);
|
|
69041
|
+
const dimensions = platform16 === "facebook" ? { width: 1200, height: 630 } : { width: 1200, height: 675 };
|
|
68994
69042
|
try {
|
|
68995
69043
|
contentLogger.debug(`Generating photo for content ${contentId}...`);
|
|
68996
69044
|
const result = execSync7("claude -p --output-format text --max-turns 40", {
|
|
@@ -69006,7 +69054,7 @@ async function generatePhoto(_content, context, config, platform14, contentId, c
|
|
|
69006
69054
|
return { path: imagePath, ...dimensions, format: "png" };
|
|
69007
69055
|
}
|
|
69008
69056
|
}
|
|
69009
|
-
const files =
|
|
69057
|
+
const files = readdirSync11(mediaDir);
|
|
69010
69058
|
const imageFile = files.find((f3) => /\.(png|jpg|jpeg|webp)$/i.test(f3));
|
|
69011
69059
|
if (imageFile) {
|
|
69012
69060
|
const ext2 = imageFile.split(".").pop() ?? "png";
|
|
@@ -69028,14 +69076,14 @@ async function createContent(event, config, db, contentLogger, options2) {
|
|
|
69028
69076
|
const startTime = Date.now();
|
|
69029
69077
|
const items = [];
|
|
69030
69078
|
const platforms = resolveEnabledPlatforms(config);
|
|
69031
|
-
for (const
|
|
69079
|
+
for (const platform16 of platforms) {
|
|
69032
69080
|
try {
|
|
69033
|
-
const item = await createContentForPlatform(event,
|
|
69081
|
+
const item = await createContentForPlatform(event, platform16, config, db, contentLogger, options2);
|
|
69034
69082
|
if (item)
|
|
69035
69083
|
items.push(item);
|
|
69036
69084
|
} catch (err) {
|
|
69037
69085
|
const msg = err instanceof Error ? err.message : String(err);
|
|
69038
|
-
contentLogger.error(`Failed to create ${
|
|
69086
|
+
contentLogger.error(`Failed to create ${platform16} content: ${msg}`);
|
|
69039
69087
|
}
|
|
69040
69088
|
}
|
|
69041
69089
|
insertTaskLog(db, {
|
|
@@ -69054,10 +69102,10 @@ function resolveEnabledPlatforms(config) {
|
|
|
69054
69102
|
platforms.push("facebook");
|
|
69055
69103
|
return platforms;
|
|
69056
69104
|
}
|
|
69057
|
-
async function createContentForPlatform(event,
|
|
69058
|
-
const context = await buildContentContext(event, event.repoPath, config, db,
|
|
69059
|
-
const prompt = buildTextPrompt(context,
|
|
69060
|
-
contentLogger.debug(`Generating ${
|
|
69105
|
+
async function createContentForPlatform(event, platform16, config, db, contentLogger, options2) {
|
|
69106
|
+
const context = await buildContentContext(event, event.repoPath, config, db, platform16, contentLogger);
|
|
69107
|
+
const prompt = buildTextPrompt(context, platform16);
|
|
69108
|
+
contentLogger.debug(`Generating ${platform16} content for event ${event.id}...`);
|
|
69061
69109
|
const stdout2 = execSync8("claude -p --output-format text --max-turns 5", {
|
|
69062
69110
|
input: prompt,
|
|
69063
69111
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -69065,14 +69113,14 @@ async function createContentForPlatform(event, platform14, config, db, contentLo
|
|
|
69065
69113
|
}).toString();
|
|
69066
69114
|
const parsed = parseClaudeJsonOutput(stdout2);
|
|
69067
69115
|
const generated = extractContentFromResponse(parsed);
|
|
69068
|
-
const validation = validateContent(generated,
|
|
69116
|
+
const validation = validateContent(generated, platform16);
|
|
69069
69117
|
if (!validation.valid) {
|
|
69070
|
-
contentLogger.warn(`Content validation failed for ${
|
|
69118
|
+
contentLogger.warn(`Content validation failed for ${platform16}: ${validation.issues.join(", ")}`);
|
|
69071
69119
|
}
|
|
69072
69120
|
const status = validation.valid ? config.reviewMode === "auto" ? "scheduled" : "reviewing" : "draft";
|
|
69073
69121
|
const itemId = insertContentItem(db, {
|
|
69074
69122
|
gitEventId: event.id,
|
|
69075
|
-
platform:
|
|
69123
|
+
platform: platform16,
|
|
69076
69124
|
textContent: generated.text,
|
|
69077
69125
|
hashtags: JSON.stringify(generated.hashtags),
|
|
69078
69126
|
hookLine: generated.hook,
|
|
@@ -69082,12 +69130,12 @@ async function createContentForPlatform(event, platform14, config, db, contentLo
|
|
|
69082
69130
|
scheduledAt: null
|
|
69083
69131
|
});
|
|
69084
69132
|
if (!options2.dryRun && generated.mediaPrompt) {
|
|
69085
|
-
const photo = await generatePhoto(generated, context, config,
|
|
69133
|
+
const photo = await generatePhoto(generated, context, config, platform16, itemId, contentLogger);
|
|
69086
69134
|
if (photo) {
|
|
69087
69135
|
db.prepare("UPDATE content_items SET media_path = ? WHERE id = ?").run(photo.path, itemId);
|
|
69088
69136
|
}
|
|
69089
69137
|
}
|
|
69090
|
-
contentLogger.info(`Created ${
|
|
69138
|
+
contentLogger.info(`Created ${platform16} content (id: ${itemId}, status: ${status})`);
|
|
69091
69139
|
return getContentById(db, itemId);
|
|
69092
69140
|
}
|
|
69093
69141
|
var init_content_creator = __esm(() => {
|
|
@@ -69098,7 +69146,7 @@ var init_content_creator = __esm(() => {
|
|
|
69098
69146
|
});
|
|
69099
69147
|
|
|
69100
69148
|
// src/commands/content/phases/content-logger.ts
|
|
69101
|
-
import { createWriteStream as createWriteStream4, existsSync as existsSync69, mkdirSync as mkdirSync6, statSync as
|
|
69149
|
+
import { createWriteStream as createWriteStream4, existsSync as existsSync69, mkdirSync as mkdirSync6, statSync as statSync12 } from "node:fs";
|
|
69102
69150
|
import { homedir as homedir35 } from "node:os";
|
|
69103
69151
|
import { join as join139 } from "node:path";
|
|
69104
69152
|
|
|
@@ -69164,7 +69212,7 @@ class ContentLogger {
|
|
|
69164
69212
|
if (this.maxBytes > 0 && this.stream) {
|
|
69165
69213
|
const logPath = join139(this.logDir, `content-${this.currentDate}.log`);
|
|
69166
69214
|
try {
|
|
69167
|
-
const stat21 =
|
|
69215
|
+
const stat21 = statSync12(logPath);
|
|
69168
69216
|
if (stat21.size >= this.maxBytes) {
|
|
69169
69217
|
this.close();
|
|
69170
69218
|
const suffix = Date.now();
|
|
@@ -69393,7 +69441,7 @@ function isNoiseCommit(title, author) {
|
|
|
69393
69441
|
|
|
69394
69442
|
// src/commands/content/phases/change-detector.ts
|
|
69395
69443
|
import { execSync as execSync9 } from "node:child_process";
|
|
69396
|
-
import { existsSync as existsSync71, readFileSync as readFileSync17, readdirSync as
|
|
69444
|
+
import { existsSync as existsSync71, readFileSync as readFileSync17, readdirSync as readdirSync12, statSync as statSync13 } from "node:fs";
|
|
69397
69445
|
import { join as join140 } from "node:path";
|
|
69398
69446
|
function detectCommits(repo, since) {
|
|
69399
69447
|
try {
|
|
@@ -69498,7 +69546,7 @@ function detectCompletedPlans(repo, since) {
|
|
|
69498
69546
|
const sinceMs = new Date(since).getTime();
|
|
69499
69547
|
const events = [];
|
|
69500
69548
|
try {
|
|
69501
|
-
const entries =
|
|
69549
|
+
const entries = readdirSync12(plansDir, { withFileTypes: true });
|
|
69502
69550
|
for (const entry of entries) {
|
|
69503
69551
|
if (!entry.isDirectory())
|
|
69504
69552
|
continue;
|
|
@@ -69506,7 +69554,7 @@ function detectCompletedPlans(repo, since) {
|
|
|
69506
69554
|
if (!existsSync71(planFile))
|
|
69507
69555
|
continue;
|
|
69508
69556
|
try {
|
|
69509
|
-
const stat21 =
|
|
69557
|
+
const stat21 = statSync13(planFile);
|
|
69510
69558
|
if (stat21.mtimeMs < sinceMs)
|
|
69511
69559
|
continue;
|
|
69512
69560
|
const content = readFileSync17(planFile, "utf-8");
|
|
@@ -69579,7 +69627,7 @@ function classifyCommit(event) {
|
|
|
69579
69627
|
|
|
69580
69628
|
// src/commands/content/phases/repo-discoverer.ts
|
|
69581
69629
|
import { execSync as execSync10 } from "node:child_process";
|
|
69582
|
-
import { readdirSync as
|
|
69630
|
+
import { readdirSync as readdirSync13 } from "node:fs";
|
|
69583
69631
|
import { join as join141 } from "node:path";
|
|
69584
69632
|
function discoverRepos2(cwd2) {
|
|
69585
69633
|
const repos = [];
|
|
@@ -69589,7 +69637,7 @@ function discoverRepos2(cwd2) {
|
|
|
69589
69637
|
repos.push(info);
|
|
69590
69638
|
}
|
|
69591
69639
|
try {
|
|
69592
|
-
const entries =
|
|
69640
|
+
const entries = readdirSync13(cwd2, { withFileTypes: true });
|
|
69593
69641
|
for (const entry of entries) {
|
|
69594
69642
|
if (!entry.isDirectory() || entry.name.startsWith("."))
|
|
69595
69643
|
continue;
|
|
@@ -69962,15 +70010,15 @@ class RateLimiter {
|
|
|
69962
70010
|
this.state = state;
|
|
69963
70011
|
this.config = config;
|
|
69964
70012
|
}
|
|
69965
|
-
canPost(
|
|
69966
|
-
return this.getTodayCount(
|
|
70013
|
+
canPost(platform16) {
|
|
70014
|
+
return this.getTodayCount(platform16) < this.getMaxPerDay(platform16);
|
|
69967
70015
|
}
|
|
69968
|
-
recordPost(
|
|
69969
|
-
const key = this.dailyKey(
|
|
70016
|
+
recordPost(platform16) {
|
|
70017
|
+
const key = this.dailyKey(platform16);
|
|
69970
70018
|
this.state.dailyPostCounts[key] = (this.state.dailyPostCounts[key] ?? 0) + 1;
|
|
69971
70019
|
}
|
|
69972
|
-
getRemainingToday(
|
|
69973
|
-
return Math.max(0, this.getMaxPerDay(
|
|
70020
|
+
getRemainingToday(platform16) {
|
|
70021
|
+
return Math.max(0, this.getMaxPerDay(platform16) - this.getTodayCount(platform16));
|
|
69974
70022
|
}
|
|
69975
70023
|
isInQuietHours() {
|
|
69976
70024
|
const { timezone, quietHoursStart, quietHoursEnd } = this.config.schedule;
|
|
@@ -69990,19 +70038,19 @@ class RateLimiter {
|
|
|
69990
70038
|
return false;
|
|
69991
70039
|
}
|
|
69992
70040
|
}
|
|
69993
|
-
getMaxPerDay(
|
|
69994
|
-
if (
|
|
70041
|
+
getMaxPerDay(platform16) {
|
|
70042
|
+
if (platform16 === "x" || platform16 === "x_thread") {
|
|
69995
70043
|
return this.config.platforms.x.maxPostsPerDay;
|
|
69996
70044
|
}
|
|
69997
|
-
if (
|
|
70045
|
+
if (platform16 === "facebook") {
|
|
69998
70046
|
return this.config.platforms.facebook.maxPostsPerDay;
|
|
69999
70047
|
}
|
|
70000
70048
|
return this.config.maxContentPerDay;
|
|
70001
70049
|
}
|
|
70002
|
-
getTodayCount(
|
|
70003
|
-
return this.state.dailyPostCounts[this.dailyKey(
|
|
70050
|
+
getTodayCount(platform16) {
|
|
70051
|
+
return this.state.dailyPostCounts[this.dailyKey(platform16)] ?? 0;
|
|
70004
70052
|
}
|
|
70005
|
-
dailyKey(
|
|
70053
|
+
dailyKey(platform16) {
|
|
70006
70054
|
const { timezone } = this.config.schedule;
|
|
70007
70055
|
let dateStr;
|
|
70008
70056
|
try {
|
|
@@ -70016,7 +70064,7 @@ class RateLimiter {
|
|
|
70016
70064
|
} catch {
|
|
70017
70065
|
dateStr = new Date().toISOString().slice(0, 10);
|
|
70018
70066
|
}
|
|
70019
|
-
return `${
|
|
70067
|
+
return `${platform16}-${dateStr}`;
|
|
70020
70068
|
}
|
|
70021
70069
|
}
|
|
70022
70070
|
|
|
@@ -70133,8 +70181,8 @@ function previewContent(content) {
|
|
|
70133
70181
|
console.log(import_picocolors41.default.dim("─".repeat(60)));
|
|
70134
70182
|
console.log();
|
|
70135
70183
|
}
|
|
70136
|
-
function getPlatformBadge(
|
|
70137
|
-
switch (
|
|
70184
|
+
function getPlatformBadge(platform16) {
|
|
70185
|
+
switch (platform16) {
|
|
70138
70186
|
case "x":
|
|
70139
70187
|
return import_picocolors41.default.bgBlue(import_picocolors41.default.white(" X "));
|
|
70140
70188
|
case "x_thread":
|
|
@@ -70142,7 +70190,7 @@ function getPlatformBadge(platform14) {
|
|
|
70142
70190
|
case "facebook":
|
|
70143
70191
|
return import_picocolors41.default.bgCyan(import_picocolors41.default.white(" Facebook "));
|
|
70144
70192
|
default:
|
|
70145
|
-
return import_picocolors41.default.bgBlack(import_picocolors41.default.white(` ${
|
|
70193
|
+
return import_picocolors41.default.bgBlack(import_picocolors41.default.white(` ${platform16} `));
|
|
70146
70194
|
}
|
|
70147
70195
|
}
|
|
70148
70196
|
function getStatusColor(status) {
|
|
@@ -70422,15 +70470,15 @@ async function autoInstallFbcli(contentLogger) {
|
|
|
70422
70470
|
contentLogger.warn("go install failed or Go not available");
|
|
70423
70471
|
}
|
|
70424
70472
|
try {
|
|
70425
|
-
const { platform:
|
|
70473
|
+
const { platform: platform16, arch: arch3 } = process;
|
|
70426
70474
|
const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
70427
70475
|
const archMap = { arm64: "arm64", x64: "amd64" };
|
|
70428
|
-
const os6 = osMap[
|
|
70476
|
+
const os6 = osMap[platform16];
|
|
70429
70477
|
const cpu = archMap[arch3];
|
|
70430
70478
|
if (os6 && cpu) {
|
|
70431
|
-
const ext2 =
|
|
70479
|
+
const ext2 = platform16 === "win32" ? ".exe" : "";
|
|
70432
70480
|
const url = `https://github.com/mrgoonie/fbcli/releases/latest/download/fbcli_${os6}_${cpu}${ext2}`;
|
|
70433
|
-
const dest =
|
|
70481
|
+
const dest = platform16 === "win32" ? "fbcli.exe" : "/usr/local/bin/fbcli";
|
|
70434
70482
|
f2.warning(`Will download fbcli binary from: ${url}`);
|
|
70435
70483
|
f2.warning("Note: Binary integrity is not verified. Review the source at https://github.com/mrgoonie/fbcli");
|
|
70436
70484
|
const consent = await se({ message: `Download and install fbcli to ${dest}?` });
|
|
@@ -70514,15 +70562,15 @@ async function autoInstallXurl(contentLogger) {
|
|
|
70514
70562
|
contentLogger.warn("go install failed or Go not available");
|
|
70515
70563
|
}
|
|
70516
70564
|
try {
|
|
70517
|
-
const { platform:
|
|
70565
|
+
const { platform: platform16, arch: arch3 } = process;
|
|
70518
70566
|
const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
70519
70567
|
const archMap = { arm64: "arm64", x64: "amd64" };
|
|
70520
|
-
const os6 = osMap[
|
|
70568
|
+
const os6 = osMap[platform16];
|
|
70521
70569
|
const cpu = archMap[arch3];
|
|
70522
70570
|
if (os6 && cpu) {
|
|
70523
|
-
const ext2 =
|
|
70571
|
+
const ext2 = platform16 === "win32" ? ".exe" : "";
|
|
70524
70572
|
const url = `https://github.com/xdevplatform/xurl/releases/latest/download/xurl_${os6}_${cpu}${ext2}`;
|
|
70525
|
-
const dest =
|
|
70573
|
+
const dest = platform16 === "win32" ? "xurl.exe" : "/usr/local/bin/xurl";
|
|
70526
70574
|
f2.info(`Downloading xurl binary for ${os6}/${cpu}...`);
|
|
70527
70575
|
execSync13(`curl -fsSL "${url}" -o "${dest}" && chmod +x "${dest}"`, {
|
|
70528
70576
|
stdio: "inherit",
|
|
@@ -71056,8 +71104,8 @@ function shouldRunCleanup(lastAt) {
|
|
|
71056
71104
|
return Date.now() - new Date(lastAt).getTime() >= 86400000;
|
|
71057
71105
|
}
|
|
71058
71106
|
function sleep2(ms) {
|
|
71059
|
-
return new Promise((
|
|
71060
|
-
setTimeout(
|
|
71107
|
+
return new Promise((resolve36) => {
|
|
71108
|
+
setTimeout(resolve36, ms);
|
|
71061
71109
|
});
|
|
71062
71110
|
}
|
|
71063
71111
|
var LOCK_DIR2, LOCK_FILE, MAX_CREATION_RETRIES = 3, MAX_PUBLISH_RETRIES_PER_CYCLE = 3, PUBLISH_RETRY_WINDOW_HOURS = 24;
|
|
@@ -71727,8 +71775,9 @@ var init_skills_command_help = __esm(() => {
|
|
|
71727
71775
|
{
|
|
71728
71776
|
title: "Notes",
|
|
71729
71777
|
content: ` • Skills are installed from ~/.claude/skills (ClaudeKit Engineer source)
|
|
71778
|
+
• OpenCode reuses Claude-compatible skill roots (.claude/skills, ~/.claude/skills), so installs may be a no-op
|
|
71730
71779
|
• Registry stored at ~/.claudekit/skill-registry.json
|
|
71731
|
-
•
|
|
71780
|
+
• Target paths vary by agent; some agents intentionally share a common skills directory`
|
|
71732
71781
|
}
|
|
71733
71782
|
]
|
|
71734
71783
|
};
|
|
@@ -72196,12 +72245,12 @@ var init_migrate_command_help = __esm(() => {
|
|
|
72196
72245
|
usage: "ck migrate [options]",
|
|
72197
72246
|
examples: [
|
|
72198
72247
|
{
|
|
72199
|
-
command: "ck migrate --agent
|
|
72200
|
-
description: "Migrate
|
|
72248
|
+
command: "ck migrate --agent opencode",
|
|
72249
|
+
description: "Migrate OpenCode-native items while reusing Claude-compatible skill roots"
|
|
72201
72250
|
},
|
|
72202
72251
|
{
|
|
72203
|
-
command: "ck migrate --
|
|
72204
|
-
description: "Migrate
|
|
72252
|
+
command: "ck migrate --agent droid --agent codex",
|
|
72253
|
+
description: "Migrate to specific providers"
|
|
72205
72254
|
},
|
|
72206
72255
|
{
|
|
72207
72256
|
command: "ck migrate --dry-run",
|
|
@@ -72439,7 +72488,7 @@ function getPagerArgs(pagerCmd) {
|
|
|
72439
72488
|
return [];
|
|
72440
72489
|
}
|
|
72441
72490
|
async function trySystemPager(content) {
|
|
72442
|
-
return new Promise((
|
|
72491
|
+
return new Promise((resolve36) => {
|
|
72443
72492
|
const pagerCmd = process.env.PAGER || "less";
|
|
72444
72493
|
const pagerArgs = getPagerArgs(pagerCmd);
|
|
72445
72494
|
try {
|
|
@@ -72449,20 +72498,20 @@ async function trySystemPager(content) {
|
|
|
72449
72498
|
});
|
|
72450
72499
|
const timeout2 = setTimeout(() => {
|
|
72451
72500
|
pager.kill();
|
|
72452
|
-
|
|
72501
|
+
resolve36(false);
|
|
72453
72502
|
}, 30000);
|
|
72454
72503
|
pager.stdin.write(content);
|
|
72455
72504
|
pager.stdin.end();
|
|
72456
72505
|
pager.on("close", (code2) => {
|
|
72457
72506
|
clearTimeout(timeout2);
|
|
72458
|
-
|
|
72507
|
+
resolve36(code2 === 0);
|
|
72459
72508
|
});
|
|
72460
72509
|
pager.on("error", () => {
|
|
72461
72510
|
clearTimeout(timeout2);
|
|
72462
|
-
|
|
72511
|
+
resolve36(false);
|
|
72463
72512
|
});
|
|
72464
72513
|
} catch {
|
|
72465
|
-
|
|
72514
|
+
resolve36(false);
|
|
72466
72515
|
}
|
|
72467
72516
|
});
|
|
72468
72517
|
}
|
|
@@ -72489,16 +72538,16 @@ async function basicPager(content) {
|
|
|
72489
72538
|
break;
|
|
72490
72539
|
}
|
|
72491
72540
|
const remaining = lines.length - currentLine;
|
|
72492
|
-
await new Promise((
|
|
72541
|
+
await new Promise((resolve36) => {
|
|
72493
72542
|
rl.question(`-- More (${remaining} lines) [Enter/q] --`, (answer) => {
|
|
72494
72543
|
if (answer.toLowerCase() === "q") {
|
|
72495
72544
|
rl.close();
|
|
72496
72545
|
process.exitCode = 0;
|
|
72497
|
-
|
|
72546
|
+
resolve36();
|
|
72498
72547
|
return;
|
|
72499
72548
|
}
|
|
72500
72549
|
process.stdout.write("\x1B[1A\x1B[2K");
|
|
72501
|
-
|
|
72550
|
+
resolve36();
|
|
72502
72551
|
});
|
|
72503
72552
|
});
|
|
72504
72553
|
}
|
|
@@ -76740,12 +76789,12 @@ async function configUICommand(options2 = {}) {
|
|
|
76740
76789
|
console.log();
|
|
76741
76790
|
console.log(import_picocolors15.default.dim(" Press Ctrl+C to stop"));
|
|
76742
76791
|
console.log();
|
|
76743
|
-
await new Promise((
|
|
76792
|
+
await new Promise((resolve18) => {
|
|
76744
76793
|
const shutdown = async () => {
|
|
76745
76794
|
console.log();
|
|
76746
76795
|
logger.info("Shutting down...");
|
|
76747
76796
|
await server.close();
|
|
76748
|
-
|
|
76797
|
+
resolve18();
|
|
76749
76798
|
};
|
|
76750
76799
|
process.on("SIGINT", shutdown);
|
|
76751
76800
|
process.on("SIGTERM", shutdown);
|
|
@@ -76766,12 +76815,12 @@ async function configUICommand(options2 = {}) {
|
|
|
76766
76815
|
}
|
|
76767
76816
|
async function checkPort(port, host) {
|
|
76768
76817
|
const { createServer: createServer2 } = await import("node:net");
|
|
76769
|
-
return new Promise((
|
|
76818
|
+
return new Promise((resolve18) => {
|
|
76770
76819
|
const server = createServer2();
|
|
76771
|
-
server.once("error", () =>
|
|
76820
|
+
server.once("error", () => resolve18(false));
|
|
76772
76821
|
server.once("listening", () => {
|
|
76773
76822
|
server.close();
|
|
76774
|
-
|
|
76823
|
+
resolve18(true);
|
|
76775
76824
|
});
|
|
76776
76825
|
server.listen(port, host);
|
|
76777
76826
|
});
|
|
@@ -77183,7 +77232,7 @@ function shouldSkipExpensiveOperations2() {
|
|
|
77183
77232
|
return shouldSkipExpensiveOperations();
|
|
77184
77233
|
}
|
|
77185
77234
|
function getGhUpgradeInstructions(currentVersion) {
|
|
77186
|
-
const
|
|
77235
|
+
const platform7 = process.platform;
|
|
77187
77236
|
const wsl = isWSL2();
|
|
77188
77237
|
const lines = [];
|
|
77189
77238
|
lines.push(`✗ GitHub CLI v${currentVersion} is outdated`);
|
|
@@ -77194,10 +77243,10 @@ function getGhUpgradeInstructions(currentVersion) {
|
|
|
77194
77243
|
lines.push(" curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg");
|
|
77195
77244
|
lines.push(' echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null');
|
|
77196
77245
|
lines.push(" sudo apt update && sudo apt install gh");
|
|
77197
|
-
} else if (
|
|
77246
|
+
} else if (platform7 === "darwin") {
|
|
77198
77247
|
lines.push("Upgrade GitHub CLI:");
|
|
77199
77248
|
lines.push(" brew upgrade gh");
|
|
77200
|
-
} else if (
|
|
77249
|
+
} else if (platform7 === "win32") {
|
|
77201
77250
|
lines.push("Upgrade GitHub CLI:");
|
|
77202
77251
|
lines.push(" winget upgrade GitHub.cli");
|
|
77203
77252
|
} else {
|
|
@@ -77217,18 +77266,18 @@ import { exec as exec3 } from "node:child_process";
|
|
|
77217
77266
|
import { promisify as promisify9 } from "node:util";
|
|
77218
77267
|
var execAsync3 = promisify9(exec3);
|
|
77219
77268
|
function getOSInfo() {
|
|
77220
|
-
const
|
|
77269
|
+
const platform7 = process.platform;
|
|
77221
77270
|
const arch2 = process.arch;
|
|
77222
|
-
const isWindows3 =
|
|
77223
|
-
const isMacOS2 =
|
|
77224
|
-
const isLinux2 =
|
|
77271
|
+
const isWindows3 = platform7 === "win32";
|
|
77272
|
+
const isMacOS2 = platform7 === "darwin";
|
|
77273
|
+
const isLinux2 = platform7 === "linux";
|
|
77225
77274
|
const isWSL3 = isLinux2 && process.env.WSL_DISTRO_NAME !== undefined;
|
|
77226
|
-
let details = `${
|
|
77275
|
+
let details = `${platform7}-${arch2}`;
|
|
77227
77276
|
if (isWSL3) {
|
|
77228
77277
|
details += ` (WSL: ${process.env.WSL_DISTRO_NAME})`;
|
|
77229
77278
|
}
|
|
77230
77279
|
return {
|
|
77231
|
-
platform:
|
|
77280
|
+
platform: platform7,
|
|
77232
77281
|
arch: arch2,
|
|
77233
77282
|
isWindows: isWindows3,
|
|
77234
77283
|
isMacOS: isMacOS2,
|
|
@@ -77533,16 +77582,16 @@ import * as fs6 from "node:fs";
|
|
|
77533
77582
|
import { promisify as promisify10 } from "node:util";
|
|
77534
77583
|
var execAsync4 = promisify10(exec4);
|
|
77535
77584
|
async function detectOS() {
|
|
77536
|
-
const
|
|
77537
|
-
const info = { platform:
|
|
77538
|
-
if (
|
|
77585
|
+
const platform7 = process.platform;
|
|
77586
|
+
const info = { platform: platform7 };
|
|
77587
|
+
if (platform7 === "darwin") {
|
|
77539
77588
|
try {
|
|
77540
77589
|
await execAsync4("which brew");
|
|
77541
77590
|
info.hasHomebrew = true;
|
|
77542
77591
|
} catch {
|
|
77543
77592
|
info.hasHomebrew = false;
|
|
77544
77593
|
}
|
|
77545
|
-
} else if (
|
|
77594
|
+
} else if (platform7 === "linux") {
|
|
77546
77595
|
try {
|
|
77547
77596
|
if (fs6.existsSync("/etc/os-release")) {
|
|
77548
77597
|
const content = fs6.readFileSync("/etc/os-release", "utf-8");
|
|
@@ -77935,7 +77984,7 @@ async function checkCliInstallMethod() {
|
|
|
77935
77984
|
};
|
|
77936
77985
|
}
|
|
77937
77986
|
// src/domains/health-checks/checkers/claude-md-checker.ts
|
|
77938
|
-
import { existsSync as existsSync40, statSync as
|
|
77987
|
+
import { existsSync as existsSync40, statSync as statSync6 } from "node:fs";
|
|
77939
77988
|
import { join as join56 } from "node:path";
|
|
77940
77989
|
function checkClaudeMd(setup, projectDir) {
|
|
77941
77990
|
const results = [];
|
|
@@ -77961,7 +78010,7 @@ function checkClaudeMdFile(path5, name, id) {
|
|
|
77961
78010
|
};
|
|
77962
78011
|
}
|
|
77963
78012
|
try {
|
|
77964
|
-
const stat9 =
|
|
78013
|
+
const stat9 = statSync6(path5);
|
|
77965
78014
|
const sizeKB = (stat9.size / 1024).toFixed(1);
|
|
77966
78015
|
if (stat9.size === 0) {
|
|
77967
78016
|
return {
|
|
@@ -78059,8 +78108,8 @@ import { existsSync as existsSync42 } from "node:fs";
|
|
|
78059
78108
|
import { join as join58 } from "node:path";
|
|
78060
78109
|
function checkSkillsScripts(setup) {
|
|
78061
78110
|
const results = [];
|
|
78062
|
-
const
|
|
78063
|
-
const scriptName =
|
|
78111
|
+
const platform7 = process.platform;
|
|
78112
|
+
const scriptName = platform7 === "win32" ? "install.ps1" : "install.sh";
|
|
78064
78113
|
if (setup.global.path) {
|
|
78065
78114
|
const globalScriptPath = join58(setup.global.path, "skills", scriptName);
|
|
78066
78115
|
const hasGlobalScript = existsSync42(globalScriptPath);
|
|
@@ -78358,7 +78407,7 @@ init_path_resolver();
|
|
|
78358
78407
|
import { existsSync as existsSync45 } from "node:fs";
|
|
78359
78408
|
import { readFile as readFile32 } from "node:fs/promises";
|
|
78360
78409
|
import { homedir as homedir28 } from "node:os";
|
|
78361
|
-
import { dirname as dirname20, join as join62, normalize as normalize6, resolve as
|
|
78410
|
+
import { dirname as dirname20, join as join62, normalize as normalize6, resolve as resolve18 } from "node:path";
|
|
78362
78411
|
async function checkPathRefsValid(projectDir) {
|
|
78363
78412
|
const globalClaudeMd = join62(PathResolver.getGlobalKitDir(), "CLAUDE.md");
|
|
78364
78413
|
const projectClaudeMd = join62(projectDir, ".claude", "CLAUDE.md");
|
|
@@ -78405,7 +78454,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
78405
78454
|
} else if (/^[A-Za-z]:/.test(ref)) {
|
|
78406
78455
|
refPath = normalize6(ref);
|
|
78407
78456
|
} else {
|
|
78408
|
-
refPath =
|
|
78457
|
+
refPath = resolve18(baseDir, ref);
|
|
78409
78458
|
}
|
|
78410
78459
|
const normalizedPath = normalize6(refPath);
|
|
78411
78460
|
const isWithinHome = normalizedPath.startsWith(home8);
|
|
@@ -78827,16 +78876,16 @@ init_claudekit_constants();
|
|
|
78827
78876
|
init_logger();
|
|
78828
78877
|
init_path_resolver();
|
|
78829
78878
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
78830
|
-
import { existsSync as existsSync47, readFileSync as readFileSync12, statSync as
|
|
78879
|
+
import { existsSync as existsSync47, readFileSync as readFileSync12, statSync as statSync7, writeFileSync as writeFileSync4 } from "node:fs";
|
|
78831
78880
|
import { readdir as readdir14 } from "node:fs/promises";
|
|
78832
78881
|
import { tmpdir } from "node:os";
|
|
78833
|
-
import { join as join66, resolve as
|
|
78882
|
+
import { join as join66, resolve as resolve19 } from "node:path";
|
|
78834
78883
|
var HOOK_CHECK_TIMEOUT_MS = 5000;
|
|
78835
78884
|
var PYTHON_CHECK_TIMEOUT_MS = 3000;
|
|
78836
78885
|
var MAX_LOG_FILE_SIZE_BYTES = 10 * 1024 * 1024;
|
|
78837
78886
|
function getHooksDir(projectDir) {
|
|
78838
|
-
const projectHooksDir =
|
|
78839
|
-
const globalHooksDir =
|
|
78887
|
+
const projectHooksDir = resolve19(projectDir, ".claude", "hooks");
|
|
78888
|
+
const globalHooksDir = resolve19(PathResolver.getGlobalKitDir(), "hooks");
|
|
78840
78889
|
if (existsSync47(projectHooksDir))
|
|
78841
78890
|
return projectHooksDir;
|
|
78842
78891
|
if (existsSync47(globalHooksDir))
|
|
@@ -78844,7 +78893,7 @@ function getHooksDir(projectDir) {
|
|
|
78844
78893
|
return null;
|
|
78845
78894
|
}
|
|
78846
78895
|
function isPathWithin(filePath, parentDir) {
|
|
78847
|
-
return
|
|
78896
|
+
return resolve19(filePath).startsWith(resolve19(parentDir));
|
|
78848
78897
|
}
|
|
78849
78898
|
async function checkHookSyntax(projectDir) {
|
|
78850
78899
|
const hooksDir = getHooksDir(projectDir);
|
|
@@ -79295,7 +79344,7 @@ async function checkHookLogs(projectDir) {
|
|
|
79295
79344
|
};
|
|
79296
79345
|
}
|
|
79297
79346
|
try {
|
|
79298
|
-
const logStats =
|
|
79347
|
+
const logStats = statSync7(logPath);
|
|
79299
79348
|
if (logStats.size > MAX_LOG_FILE_SIZE_BYTES) {
|
|
79300
79349
|
return {
|
|
79301
79350
|
id: "hook-logs",
|
|
@@ -80013,19 +80062,19 @@ class AuthChecker {
|
|
|
80013
80062
|
}
|
|
80014
80063
|
}
|
|
80015
80064
|
// src/domains/health-checks/platform-checker.ts
|
|
80016
|
-
import { platform as
|
|
80065
|
+
import { platform as platform8 } from "node:os";
|
|
80017
80066
|
|
|
80018
80067
|
// src/domains/health-checks/platform/environment-checker.ts
|
|
80019
80068
|
init_environment();
|
|
80020
80069
|
init_path_resolver();
|
|
80021
80070
|
import { constants as constants3, access as access3, mkdir as mkdir16, readFile as readFile34, unlink as unlink8, writeFile as writeFile17 } from "node:fs/promises";
|
|
80022
|
-
import { arch as arch2, homedir as homedir29, platform as
|
|
80071
|
+
import { arch as arch2, homedir as homedir29, platform as platform7 } from "node:os";
|
|
80023
80072
|
import { join as join68, normalize as normalize7 } from "node:path";
|
|
80024
80073
|
function shouldSkipExpensiveOperations4() {
|
|
80025
80074
|
return shouldSkipExpensiveOperations();
|
|
80026
80075
|
}
|
|
80027
80076
|
async function checkPlatformDetect() {
|
|
80028
|
-
const os6 =
|
|
80077
|
+
const os6 = platform7();
|
|
80029
80078
|
const architecture = arch2();
|
|
80030
80079
|
const wslDistro = process.env.WSL_DISTRO_NAME;
|
|
80031
80080
|
let message = `${os6} (${architecture})`;
|
|
@@ -80043,7 +80092,7 @@ async function checkPlatformDetect() {
|
|
|
80043
80092
|
}
|
|
80044
80093
|
async function checkHomeDirResolution() {
|
|
80045
80094
|
const nodeHome = normalize7(homedir29());
|
|
80046
|
-
const rawEnvHome = getHomeDirectoryFromEnv(
|
|
80095
|
+
const rawEnvHome = getHomeDirectoryFromEnv(platform7());
|
|
80047
80096
|
const envHome = rawEnvHome ? normalize7(rawEnvHome) : "";
|
|
80048
80097
|
const match = nodeHome === envHome && envHome !== "";
|
|
80049
80098
|
return {
|
|
@@ -80278,7 +80327,7 @@ async function checkSymlinkSupport() {
|
|
|
80278
80327
|
}
|
|
80279
80328
|
|
|
80280
80329
|
// src/domains/health-checks/platform-checker.ts
|
|
80281
|
-
var IS_WINDOWS =
|
|
80330
|
+
var IS_WINDOWS = platform8() === "win32";
|
|
80282
80331
|
|
|
80283
80332
|
class PlatformChecker {
|
|
80284
80333
|
group = "platform";
|
|
@@ -81133,7 +81182,7 @@ class ConfigVersionChecker {
|
|
|
81133
81182
|
return null;
|
|
81134
81183
|
}
|
|
81135
81184
|
const delay = baseBackoff * 2 ** attempt;
|
|
81136
|
-
await new Promise((
|
|
81185
|
+
await new Promise((resolve20) => setTimeout(resolve20, delay));
|
|
81137
81186
|
}
|
|
81138
81187
|
}
|
|
81139
81188
|
return null;
|
|
@@ -81300,24 +81349,24 @@ function pLimit(concurrency) {
|
|
|
81300
81349
|
activeCount--;
|
|
81301
81350
|
resumeNext();
|
|
81302
81351
|
};
|
|
81303
|
-
const run = async (function_,
|
|
81352
|
+
const run = async (function_, resolve20, arguments_) => {
|
|
81304
81353
|
const result = (async () => function_(...arguments_))();
|
|
81305
|
-
|
|
81354
|
+
resolve20(result);
|
|
81306
81355
|
try {
|
|
81307
81356
|
await result;
|
|
81308
81357
|
} catch {}
|
|
81309
81358
|
next();
|
|
81310
81359
|
};
|
|
81311
|
-
const enqueue = (function_,
|
|
81360
|
+
const enqueue = (function_, resolve20, arguments_) => {
|
|
81312
81361
|
new Promise((internalResolve) => {
|
|
81313
81362
|
queue.enqueue(internalResolve);
|
|
81314
|
-
}).then(run.bind(undefined, function_,
|
|
81363
|
+
}).then(run.bind(undefined, function_, resolve20, arguments_));
|
|
81315
81364
|
if (activeCount < concurrency) {
|
|
81316
81365
|
resumeNext();
|
|
81317
81366
|
}
|
|
81318
81367
|
};
|
|
81319
|
-
const generator = (function_, ...arguments_) => new Promise((
|
|
81320
|
-
enqueue(function_,
|
|
81368
|
+
const generator = (function_, ...arguments_) => new Promise((resolve20) => {
|
|
81369
|
+
enqueue(function_, resolve20, arguments_);
|
|
81321
81370
|
});
|
|
81322
81371
|
Object.defineProperties(generator, {
|
|
81323
81372
|
activeCount: {
|
|
@@ -81368,12 +81417,12 @@ async function mapWithLimit(items, fn, concurrency = DEFAULT_CONCURRENCY) {
|
|
|
81368
81417
|
// src/services/file-operations/ownership-checker.ts
|
|
81369
81418
|
class OwnershipChecker {
|
|
81370
81419
|
static async calculateChecksum(filePath) {
|
|
81371
|
-
return new Promise((
|
|
81420
|
+
return new Promise((resolve20, reject) => {
|
|
81372
81421
|
const hash = createHash4("sha256");
|
|
81373
81422
|
const stream = createReadStream2(filePath);
|
|
81374
81423
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
81375
81424
|
stream.on("end", () => {
|
|
81376
|
-
|
|
81425
|
+
resolve20(hash.digest("hex"));
|
|
81377
81426
|
});
|
|
81378
81427
|
stream.on("error", (err) => {
|
|
81379
81428
|
stream.destroy();
|
|
@@ -83607,7 +83656,7 @@ async function promptFreshConfirmation(targetPath, analysis) {
|
|
|
83607
83656
|
// src/domains/ui/prompts/confirmation-prompts.ts
|
|
83608
83657
|
init_output_manager();
|
|
83609
83658
|
init_safe_prompts();
|
|
83610
|
-
import { platform as
|
|
83659
|
+
import { platform as platform9 } from "node:os";
|
|
83611
83660
|
|
|
83612
83661
|
// src/types/skills-dependencies.ts
|
|
83613
83662
|
var SKILLS_DEPENDENCIES = {
|
|
@@ -83669,7 +83718,7 @@ async function promptSkillsInstallation() {
|
|
|
83669
83718
|
if (output.isJson()) {
|
|
83670
83719
|
return false;
|
|
83671
83720
|
}
|
|
83672
|
-
const isWindows3 =
|
|
83721
|
+
const isWindows3 = platform9() === "win32";
|
|
83673
83722
|
const pythonDeps = formatDependencyList(SKILLS_DEPENDENCIES.python);
|
|
83674
83723
|
const systemDeps = formatDependencyList(SKILLS_DEPENDENCIES.system);
|
|
83675
83724
|
const nodeDeps = formatDependencyList(SKILLS_DEPENDENCIES.node);
|
|
@@ -84150,10 +84199,10 @@ init_types3();
|
|
|
84150
84199
|
// src/domains/installation/utils/path-security.ts
|
|
84151
84200
|
init_types3();
|
|
84152
84201
|
import { lstatSync as lstatSync2, realpathSync as realpathSync3 } from "node:fs";
|
|
84153
|
-
import { relative as relative9, resolve as
|
|
84202
|
+
import { relative as relative9, resolve as resolve22 } from "node:path";
|
|
84154
84203
|
var MAX_EXTRACTION_SIZE = 500 * 1024 * 1024;
|
|
84155
84204
|
function isPathSafe(basePath, targetPath) {
|
|
84156
|
-
const resolvedBase =
|
|
84205
|
+
const resolvedBase = resolve22(basePath);
|
|
84157
84206
|
try {
|
|
84158
84207
|
const stat11 = lstatSync2(targetPath);
|
|
84159
84208
|
if (stat11.isSymbolicLink()) {
|
|
@@ -84163,7 +84212,7 @@ function isPathSafe(basePath, targetPath) {
|
|
|
84163
84212
|
}
|
|
84164
84213
|
}
|
|
84165
84214
|
} catch {}
|
|
84166
|
-
const resolvedTarget =
|
|
84215
|
+
const resolvedTarget = resolve22(targetPath);
|
|
84167
84216
|
const relativePath = relative9(resolvedBase, resolvedTarget);
|
|
84168
84217
|
return !relativePath.startsWith("..") && !relativePath.startsWith("/") && resolvedTarget.startsWith(resolvedBase);
|
|
84169
84218
|
}
|
|
@@ -84251,7 +84300,7 @@ class FileDownloader {
|
|
|
84251
84300
|
}
|
|
84252
84301
|
if (downloadedSize !== totalSize) {
|
|
84253
84302
|
fileStream.end();
|
|
84254
|
-
await new Promise((
|
|
84303
|
+
await new Promise((resolve23) => fileStream.once("close", resolve23));
|
|
84255
84304
|
try {
|
|
84256
84305
|
rmSync2(destPath, { force: true });
|
|
84257
84306
|
} catch (cleanupError) {
|
|
@@ -84265,7 +84314,7 @@ class FileDownloader {
|
|
|
84265
84314
|
return destPath;
|
|
84266
84315
|
} catch (error) {
|
|
84267
84316
|
fileStream.end();
|
|
84268
|
-
await new Promise((
|
|
84317
|
+
await new Promise((resolve23) => fileStream.once("close", resolve23));
|
|
84269
84318
|
try {
|
|
84270
84319
|
rmSync2(destPath, { force: true });
|
|
84271
84320
|
} catch (cleanupError) {
|
|
@@ -84331,7 +84380,7 @@ class FileDownloader {
|
|
|
84331
84380
|
const expectedSize = Number(response.headers.get("content-length"));
|
|
84332
84381
|
if (expectedSize > 0 && downloadedSize !== expectedSize) {
|
|
84333
84382
|
fileStream.end();
|
|
84334
|
-
await new Promise((
|
|
84383
|
+
await new Promise((resolve23) => fileStream.once("close", resolve23));
|
|
84335
84384
|
try {
|
|
84336
84385
|
rmSync2(destPath, { force: true });
|
|
84337
84386
|
} catch (cleanupError) {
|
|
@@ -84349,7 +84398,7 @@ class FileDownloader {
|
|
|
84349
84398
|
return destPath;
|
|
84350
84399
|
} catch (error) {
|
|
84351
84400
|
fileStream.end();
|
|
84352
|
-
await new Promise((
|
|
84401
|
+
await new Promise((resolve23) => fileStream.once("close", resolve23));
|
|
84353
84402
|
try {
|
|
84354
84403
|
rmSync2(destPath, { force: true });
|
|
84355
84404
|
} catch (cleanupError) {
|
|
@@ -84948,10 +84997,10 @@ class Minipass extends EventEmitter3 {
|
|
|
84948
84997
|
return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
84949
84998
|
}
|
|
84950
84999
|
async promise() {
|
|
84951
|
-
return new Promise((
|
|
85000
|
+
return new Promise((resolve23, reject) => {
|
|
84952
85001
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
84953
85002
|
this.on("error", (er) => reject(er));
|
|
84954
|
-
this.on("end", () =>
|
|
85003
|
+
this.on("end", () => resolve23());
|
|
84955
85004
|
});
|
|
84956
85005
|
}
|
|
84957
85006
|
[Symbol.asyncIterator]() {
|
|
@@ -84970,7 +85019,7 @@ class Minipass extends EventEmitter3 {
|
|
|
84970
85019
|
return Promise.resolve({ done: false, value: res });
|
|
84971
85020
|
if (this[EOF])
|
|
84972
85021
|
return stop();
|
|
84973
|
-
let
|
|
85022
|
+
let resolve23;
|
|
84974
85023
|
let reject;
|
|
84975
85024
|
const onerr = (er) => {
|
|
84976
85025
|
this.off("data", ondata);
|
|
@@ -84984,19 +85033,19 @@ class Minipass extends EventEmitter3 {
|
|
|
84984
85033
|
this.off("end", onend);
|
|
84985
85034
|
this.off(DESTROYED, ondestroy);
|
|
84986
85035
|
this.pause();
|
|
84987
|
-
|
|
85036
|
+
resolve23({ value, done: !!this[EOF] });
|
|
84988
85037
|
};
|
|
84989
85038
|
const onend = () => {
|
|
84990
85039
|
this.off("error", onerr);
|
|
84991
85040
|
this.off("data", ondata);
|
|
84992
85041
|
this.off(DESTROYED, ondestroy);
|
|
84993
85042
|
stop();
|
|
84994
|
-
|
|
85043
|
+
resolve23({ done: true, value: undefined });
|
|
84995
85044
|
};
|
|
84996
85045
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
84997
85046
|
return new Promise((res2, rej) => {
|
|
84998
85047
|
reject = rej;
|
|
84999
|
-
|
|
85048
|
+
resolve23 = res2;
|
|
85000
85049
|
this.once(DESTROYED, ondestroy);
|
|
85001
85050
|
this.once("error", onerr);
|
|
85002
85051
|
this.once("end", onend);
|
|
@@ -86102,10 +86151,10 @@ class Minipass2 extends EventEmitter4 {
|
|
|
86102
86151
|
return this[ENCODING2] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
86103
86152
|
}
|
|
86104
86153
|
async promise() {
|
|
86105
|
-
return new Promise((
|
|
86154
|
+
return new Promise((resolve23, reject) => {
|
|
86106
86155
|
this.on(DESTROYED2, () => reject(new Error("stream destroyed")));
|
|
86107
86156
|
this.on("error", (er) => reject(er));
|
|
86108
|
-
this.on("end", () =>
|
|
86157
|
+
this.on("end", () => resolve23());
|
|
86109
86158
|
});
|
|
86110
86159
|
}
|
|
86111
86160
|
[Symbol.asyncIterator]() {
|
|
@@ -86124,7 +86173,7 @@ class Minipass2 extends EventEmitter4 {
|
|
|
86124
86173
|
return Promise.resolve({ done: false, value: res });
|
|
86125
86174
|
if (this[EOF2])
|
|
86126
86175
|
return stop();
|
|
86127
|
-
let
|
|
86176
|
+
let resolve23;
|
|
86128
86177
|
let reject;
|
|
86129
86178
|
const onerr = (er) => {
|
|
86130
86179
|
this.off("data", ondata);
|
|
@@ -86138,19 +86187,19 @@ class Minipass2 extends EventEmitter4 {
|
|
|
86138
86187
|
this.off("end", onend);
|
|
86139
86188
|
this.off(DESTROYED2, ondestroy);
|
|
86140
86189
|
this.pause();
|
|
86141
|
-
|
|
86190
|
+
resolve23({ value, done: !!this[EOF2] });
|
|
86142
86191
|
};
|
|
86143
86192
|
const onend = () => {
|
|
86144
86193
|
this.off("error", onerr);
|
|
86145
86194
|
this.off("data", ondata);
|
|
86146
86195
|
this.off(DESTROYED2, ondestroy);
|
|
86147
86196
|
stop();
|
|
86148
|
-
|
|
86197
|
+
resolve23({ done: true, value: undefined });
|
|
86149
86198
|
};
|
|
86150
86199
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
86151
86200
|
return new Promise((res2, rej) => {
|
|
86152
86201
|
reject = rej;
|
|
86153
|
-
|
|
86202
|
+
resolve23 = res2;
|
|
86154
86203
|
this.once(DESTROYED2, ondestroy);
|
|
86155
86204
|
this.once("error", onerr);
|
|
86156
86205
|
this.once("end", onend);
|
|
@@ -87578,10 +87627,10 @@ class Minipass3 extends EventEmitter5 {
|
|
|
87578
87627
|
return this[ENCODING3] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
87579
87628
|
}
|
|
87580
87629
|
async promise() {
|
|
87581
|
-
return new Promise((
|
|
87630
|
+
return new Promise((resolve23, reject) => {
|
|
87582
87631
|
this.on(DESTROYED3, () => reject(new Error("stream destroyed")));
|
|
87583
87632
|
this.on("error", (er) => reject(er));
|
|
87584
|
-
this.on("end", () =>
|
|
87633
|
+
this.on("end", () => resolve23());
|
|
87585
87634
|
});
|
|
87586
87635
|
}
|
|
87587
87636
|
[Symbol.asyncIterator]() {
|
|
@@ -87600,7 +87649,7 @@ class Minipass3 extends EventEmitter5 {
|
|
|
87600
87649
|
return Promise.resolve({ done: false, value: res });
|
|
87601
87650
|
if (this[EOF3])
|
|
87602
87651
|
return stop();
|
|
87603
|
-
let
|
|
87652
|
+
let resolve23;
|
|
87604
87653
|
let reject;
|
|
87605
87654
|
const onerr = (er) => {
|
|
87606
87655
|
this.off("data", ondata);
|
|
@@ -87614,19 +87663,19 @@ class Minipass3 extends EventEmitter5 {
|
|
|
87614
87663
|
this.off("end", onend);
|
|
87615
87664
|
this.off(DESTROYED3, ondestroy);
|
|
87616
87665
|
this.pause();
|
|
87617
|
-
|
|
87666
|
+
resolve23({ value, done: !!this[EOF3] });
|
|
87618
87667
|
};
|
|
87619
87668
|
const onend = () => {
|
|
87620
87669
|
this.off("error", onerr);
|
|
87621
87670
|
this.off("data", ondata);
|
|
87622
87671
|
this.off(DESTROYED3, ondestroy);
|
|
87623
87672
|
stop();
|
|
87624
|
-
|
|
87673
|
+
resolve23({ done: true, value: undefined });
|
|
87625
87674
|
};
|
|
87626
87675
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
87627
87676
|
return new Promise((res2, rej) => {
|
|
87628
87677
|
reject = rej;
|
|
87629
|
-
|
|
87678
|
+
resolve23 = res2;
|
|
87630
87679
|
this.once(DESTROYED3, ondestroy);
|
|
87631
87680
|
this.once("error", onerr);
|
|
87632
87681
|
this.once("end", onend);
|
|
@@ -87698,8 +87747,8 @@ class Minipass3 extends EventEmitter5 {
|
|
|
87698
87747
|
}
|
|
87699
87748
|
|
|
87700
87749
|
// node_modules/tar/dist/esm/normalize-windows-path.js
|
|
87701
|
-
var
|
|
87702
|
-
var normalizeWindowsPath =
|
|
87750
|
+
var platform10 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
87751
|
+
var normalizeWindowsPath = platform10 !== "win32" ? (p) => p : (p) => p && p.replace(/\\/g, "/");
|
|
87703
87752
|
|
|
87704
87753
|
// node_modules/tar/dist/esm/read-entry.js
|
|
87705
87754
|
class ReadEntry extends Minipass3 {
|
|
@@ -88397,9 +88446,9 @@ var listFile = (opt, _files) => {
|
|
|
88397
88446
|
const parse4 = new Parser(opt);
|
|
88398
88447
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
88399
88448
|
const file = opt.file;
|
|
88400
|
-
const p = new Promise((
|
|
88449
|
+
const p = new Promise((resolve23, reject) => {
|
|
88401
88450
|
parse4.on("error", reject);
|
|
88402
|
-
parse4.on("end",
|
|
88451
|
+
parse4.on("end", resolve23);
|
|
88403
88452
|
fs9.stat(file, (er, stat11) => {
|
|
88404
88453
|
if (er) {
|
|
88405
88454
|
reject(er);
|
|
@@ -89897,8 +89946,8 @@ import path11 from "node:path";
|
|
|
89897
89946
|
|
|
89898
89947
|
// node_modules/tar/dist/esm/get-write-flag.js
|
|
89899
89948
|
import fs12 from "fs";
|
|
89900
|
-
var
|
|
89901
|
-
var isWindows3 =
|
|
89949
|
+
var platform11 = process.env.__FAKE_PLATFORM__ || process.platform;
|
|
89950
|
+
var isWindows3 = platform11 === "win32";
|
|
89902
89951
|
var { O_CREAT, O_TRUNC, O_WRONLY } = fs12.constants;
|
|
89903
89952
|
var UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || fs12.constants.UV_FS_O_FILEMAP || 0;
|
|
89904
89953
|
var fMapEnabled = isWindows3 && !!UV_FS_O_FILEMAP;
|
|
@@ -90189,8 +90238,8 @@ var normalizeUnicode = (s) => {
|
|
|
90189
90238
|
};
|
|
90190
90239
|
|
|
90191
90240
|
// node_modules/tar/dist/esm/path-reservations.js
|
|
90192
|
-
var
|
|
90193
|
-
var isWindows4 =
|
|
90241
|
+
var platform12 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
90242
|
+
var isWindows4 = platform12 === "win32";
|
|
90194
90243
|
var getDirs = (path11) => {
|
|
90195
90244
|
const dirs = path11.split("/").slice(0, -1).reduce((set, path12) => {
|
|
90196
90245
|
const s = set[set.length - 1];
|
|
@@ -90336,8 +90385,8 @@ var DOCHOWN = Symbol("doChown");
|
|
|
90336
90385
|
var UID = Symbol("uid");
|
|
90337
90386
|
var GID = Symbol("gid");
|
|
90338
90387
|
var CHECKED_CWD = Symbol("checkedCwd");
|
|
90339
|
-
var
|
|
90340
|
-
var isWindows5 =
|
|
90388
|
+
var platform13 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
90389
|
+
var isWindows5 = platform13 === "win32";
|
|
90341
90390
|
var DEFAULT_MAX_DEPTH = 1024;
|
|
90342
90391
|
var unlinkFile = (path12, cb) => {
|
|
90343
90392
|
if (!isWindows5) {
|
|
@@ -90979,9 +91028,9 @@ var extractFile = (opt, _3) => {
|
|
|
90979
91028
|
const u = new Unpack(opt);
|
|
90980
91029
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
90981
91030
|
const file = opt.file;
|
|
90982
|
-
const p = new Promise((
|
|
91031
|
+
const p = new Promise((resolve23, reject) => {
|
|
90983
91032
|
u.on("error", reject);
|
|
90984
|
-
u.on("close",
|
|
91033
|
+
u.on("close", resolve23);
|
|
90985
91034
|
fs16.stat(file, (er, stat11) => {
|
|
90986
91035
|
if (er) {
|
|
90987
91036
|
reject(er);
|
|
@@ -91114,7 +91163,7 @@ var replaceAsync = (opt, files) => {
|
|
|
91114
91163
|
};
|
|
91115
91164
|
fs17.read(fd, headBuf, 0, 512, position, onread);
|
|
91116
91165
|
};
|
|
91117
|
-
const promise = new Promise((
|
|
91166
|
+
const promise = new Promise((resolve23, reject) => {
|
|
91118
91167
|
p.on("error", reject);
|
|
91119
91168
|
let flag = "r+";
|
|
91120
91169
|
const onopen = (er, fd) => {
|
|
@@ -91139,7 +91188,7 @@ var replaceAsync = (opt, files) => {
|
|
|
91139
91188
|
});
|
|
91140
91189
|
p.pipe(stream);
|
|
91141
91190
|
stream.on("error", reject);
|
|
91142
|
-
stream.on("close",
|
|
91191
|
+
stream.on("close", resolve23);
|
|
91143
91192
|
addFilesAsync2(p, files);
|
|
91144
91193
|
});
|
|
91145
91194
|
});
|
|
@@ -91413,20 +91462,20 @@ class ZipExtractor {
|
|
|
91413
91462
|
if (!isMacOS()) {
|
|
91414
91463
|
return false;
|
|
91415
91464
|
}
|
|
91416
|
-
return new Promise((
|
|
91465
|
+
return new Promise((resolve23) => {
|
|
91417
91466
|
mkdir25(destDir, { recursive: true }).then(() => {
|
|
91418
91467
|
execFile8("unzip", ["-o", "-q", archivePath, "-d", destDir], (error, _stdout, stderr) => {
|
|
91419
91468
|
if (error) {
|
|
91420
91469
|
logger.debug(`Native unzip failed: ${stderr || error.message}`);
|
|
91421
|
-
|
|
91470
|
+
resolve23(false);
|
|
91422
91471
|
return;
|
|
91423
91472
|
}
|
|
91424
91473
|
logger.debug("Native unzip succeeded");
|
|
91425
|
-
|
|
91474
|
+
resolve23(true);
|
|
91426
91475
|
});
|
|
91427
91476
|
}).catch((err) => {
|
|
91428
91477
|
logger.debug(`Failed to create directory for native unzip: ${err.message}`);
|
|
91429
|
-
|
|
91478
|
+
resolve23(false);
|
|
91430
91479
|
});
|
|
91431
91480
|
});
|
|
91432
91481
|
}
|
|
@@ -92010,8 +92059,8 @@ async function handleDownload(ctx) {
|
|
|
92010
92059
|
import { join as join103 } from "node:path";
|
|
92011
92060
|
|
|
92012
92061
|
// src/domains/installation/deletion-handler.ts
|
|
92013
|
-
import { existsSync as existsSync53, lstatSync as lstatSync3, readdirSync as
|
|
92014
|
-
import { dirname as dirname26, join as join90, relative as relative11, resolve as
|
|
92062
|
+
import { existsSync as existsSync53, lstatSync as lstatSync3, readdirSync as readdirSync5, rmSync as rmSync3, rmdirSync, unlinkSync as unlinkSync3 } from "node:fs";
|
|
92063
|
+
import { dirname as dirname26, join as join90, relative as relative11, resolve as resolve24, sep as sep8 } from "node:path";
|
|
92015
92064
|
|
|
92016
92065
|
// src/services/file-operations/manifest/manifest-reader.ts
|
|
92017
92066
|
init_metadata_migration();
|
|
@@ -92203,7 +92252,7 @@ function collectFilesRecursively(dir, baseDir) {
|
|
|
92203
92252
|
if (!existsSync53(dir))
|
|
92204
92253
|
return results;
|
|
92205
92254
|
try {
|
|
92206
|
-
const entries =
|
|
92255
|
+
const entries = readdirSync5(dir, { withFileTypes: true });
|
|
92207
92256
|
for (const entry of entries) {
|
|
92208
92257
|
const fullPath = join90(dir, entry.name);
|
|
92209
92258
|
const relativePath = relative11(baseDir, fullPath);
|
|
@@ -92235,17 +92284,17 @@ function expandGlobPatterns(patterns, claudeDir2) {
|
|
|
92235
92284
|
}
|
|
92236
92285
|
var MAX_CLEANUP_ITERATIONS = 50;
|
|
92237
92286
|
function cleanupEmptyDirectories(filePath, claudeDir2) {
|
|
92238
|
-
const normalizedClaudeDir =
|
|
92239
|
-
let currentDir =
|
|
92287
|
+
const normalizedClaudeDir = resolve24(claudeDir2);
|
|
92288
|
+
let currentDir = resolve24(dirname26(filePath));
|
|
92240
92289
|
let iterations = 0;
|
|
92241
92290
|
while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir) && iterations < MAX_CLEANUP_ITERATIONS) {
|
|
92242
92291
|
iterations++;
|
|
92243
92292
|
try {
|
|
92244
|
-
const entries =
|
|
92293
|
+
const entries = readdirSync5(currentDir);
|
|
92245
92294
|
if (entries.length === 0) {
|
|
92246
92295
|
rmdirSync(currentDir);
|
|
92247
92296
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
92248
|
-
currentDir =
|
|
92297
|
+
currentDir = resolve24(dirname26(currentDir));
|
|
92249
92298
|
} else {
|
|
92250
92299
|
break;
|
|
92251
92300
|
}
|
|
@@ -92255,8 +92304,8 @@ function cleanupEmptyDirectories(filePath, claudeDir2) {
|
|
|
92255
92304
|
}
|
|
92256
92305
|
}
|
|
92257
92306
|
function deletePath(fullPath, claudeDir2) {
|
|
92258
|
-
const normalizedPath =
|
|
92259
|
-
const normalizedClaudeDir =
|
|
92307
|
+
const normalizedPath = resolve24(fullPath);
|
|
92308
|
+
const normalizedClaudeDir = resolve24(claudeDir2);
|
|
92260
92309
|
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep8}`) && normalizedPath !== normalizedClaudeDir) {
|
|
92261
92310
|
throw new Error(`Path traversal detected: ${fullPath}`);
|
|
92262
92311
|
}
|
|
@@ -92329,8 +92378,8 @@ async function handleDeletions(sourceMetadata, claudeDir2, kitType) {
|
|
|
92329
92378
|
const result = { deletedPaths: [], preservedPaths: [], errors: [] };
|
|
92330
92379
|
for (const path14 of deletions) {
|
|
92331
92380
|
const fullPath = join90(claudeDir2, path14);
|
|
92332
|
-
const normalizedPath =
|
|
92333
|
-
const normalizedClaudeDir =
|
|
92381
|
+
const normalizedPath = resolve24(fullPath);
|
|
92382
|
+
const normalizedClaudeDir = resolve24(claudeDir2);
|
|
92334
92383
|
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep8}`)) {
|
|
92335
92384
|
logger.warning(`Skipping invalid path: ${path14}`);
|
|
92336
92385
|
result.errors.push(path14);
|
|
@@ -95450,7 +95499,7 @@ function buildConflictSummary(fileConflicts, hookConflicts, mcpConflicts) {
|
|
|
95450
95499
|
init_logger();
|
|
95451
95500
|
init_skip_directories();
|
|
95452
95501
|
var import_fs_extra19 = __toESM(require_lib(), 1);
|
|
95453
|
-
import { join as join98, relative as relative15, resolve as
|
|
95502
|
+
import { join as join98, relative as relative15, resolve as resolve25 } from "node:path";
|
|
95454
95503
|
|
|
95455
95504
|
class FileScanner2 {
|
|
95456
95505
|
static async getFiles(dirPath, relativeTo) {
|
|
@@ -95530,8 +95579,8 @@ class FileScanner2 {
|
|
|
95530
95579
|
return customFiles;
|
|
95531
95580
|
}
|
|
95532
95581
|
static isSafePath(basePath, targetPath) {
|
|
95533
|
-
const resolvedBase =
|
|
95534
|
-
const resolvedTarget =
|
|
95582
|
+
const resolvedBase = resolve25(basePath);
|
|
95583
|
+
const resolvedTarget = resolve25(targetPath);
|
|
95535
95584
|
return resolvedTarget.startsWith(resolvedBase);
|
|
95536
95585
|
}
|
|
95537
95586
|
static toPosixPath(path15) {
|
|
@@ -97020,12 +97069,12 @@ async function getAllFiles(dirPath) {
|
|
|
97020
97069
|
return files;
|
|
97021
97070
|
}
|
|
97022
97071
|
async function hashFile(filePath) {
|
|
97023
|
-
return new Promise((
|
|
97072
|
+
return new Promise((resolve26, reject) => {
|
|
97024
97073
|
const hash = createHash6("sha256");
|
|
97025
97074
|
const stream = createReadStream3(filePath);
|
|
97026
97075
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
97027
97076
|
stream.on("end", () => {
|
|
97028
|
-
|
|
97077
|
+
resolve26(hash.digest("hex"));
|
|
97029
97078
|
});
|
|
97030
97079
|
stream.on("error", (error) => {
|
|
97031
97080
|
stream.destroy();
|
|
@@ -97374,9 +97423,9 @@ import { join as join113 } from "node:path";
|
|
|
97374
97423
|
// src/services/transformers/opencode-path-transformer.ts
|
|
97375
97424
|
init_logger();
|
|
97376
97425
|
import { readFile as readFile48, readdir as readdir32, writeFile as writeFile28 } from "node:fs/promises";
|
|
97377
|
-
import { platform as
|
|
97426
|
+
import { platform as platform14 } from "node:os";
|
|
97378
97427
|
import { extname as extname5, join as join112 } from "node:path";
|
|
97379
|
-
var IS_WINDOWS2 =
|
|
97428
|
+
var IS_WINDOWS2 = platform14() === "win32";
|
|
97380
97429
|
function getOpenCodeGlobalPath() {
|
|
97381
97430
|
return "$HOME/.config/opencode/";
|
|
97382
97431
|
}
|
|
@@ -97674,7 +97723,7 @@ async function handlePostInstall(ctx) {
|
|
|
97674
97723
|
init_config_manager();
|
|
97675
97724
|
init_github_client();
|
|
97676
97725
|
import { mkdir as mkdir31 } from "node:fs/promises";
|
|
97677
|
-
import { join as join116, resolve as
|
|
97726
|
+
import { join as join116, resolve as resolve27 } from "node:path";
|
|
97678
97727
|
|
|
97679
97728
|
// src/domains/github/kit-access-checker.ts
|
|
97680
97729
|
init_logger();
|
|
@@ -97804,8 +97853,8 @@ async function runPreflightChecks() {
|
|
|
97804
97853
|
|
|
97805
97854
|
// src/domains/installation/fresh-installer.ts
|
|
97806
97855
|
init_metadata_migration();
|
|
97807
|
-
import { existsSync as existsSync55, readdirSync as
|
|
97808
|
-
import { basename as basename18, dirname as dirname29, join as join115, resolve as
|
|
97856
|
+
import { existsSync as existsSync55, readdirSync as readdirSync6, rmSync as rmSync4, rmdirSync as rmdirSync2, unlinkSync as unlinkSync4 } from "node:fs";
|
|
97857
|
+
import { basename as basename18, dirname as dirname29, join as join115, resolve as resolve26 } from "node:path";
|
|
97809
97858
|
init_logger();
|
|
97810
97859
|
init_safe_spinner();
|
|
97811
97860
|
var import_fs_extra34 = __toESM(require_lib(), 1);
|
|
@@ -97853,15 +97902,15 @@ async function analyzeFreshInstallation(claudeDir2) {
|
|
|
97853
97902
|
};
|
|
97854
97903
|
}
|
|
97855
97904
|
function cleanupEmptyDirectories2(filePath, claudeDir2) {
|
|
97856
|
-
const normalizedClaudeDir =
|
|
97857
|
-
let currentDir =
|
|
97905
|
+
const normalizedClaudeDir = resolve26(claudeDir2);
|
|
97906
|
+
let currentDir = resolve26(dirname29(filePath));
|
|
97858
97907
|
while (currentDir !== normalizedClaudeDir && currentDir.startsWith(normalizedClaudeDir)) {
|
|
97859
97908
|
try {
|
|
97860
|
-
const entries =
|
|
97909
|
+
const entries = readdirSync6(currentDir);
|
|
97861
97910
|
if (entries.length === 0) {
|
|
97862
97911
|
rmdirSync2(currentDir);
|
|
97863
97912
|
logger.debug(`Removed empty directory: ${currentDir}`);
|
|
97864
|
-
currentDir =
|
|
97913
|
+
currentDir = resolve26(dirname29(currentDir));
|
|
97865
97914
|
} else {
|
|
97866
97915
|
break;
|
|
97867
97916
|
}
|
|
@@ -98228,7 +98277,7 @@ async function handleSelection(ctx) {
|
|
|
98228
98277
|
}
|
|
98229
98278
|
}
|
|
98230
98279
|
}
|
|
98231
|
-
const resolvedDir =
|
|
98280
|
+
const resolvedDir = resolve27(targetDir);
|
|
98232
98281
|
logger.info(`Target directory: ${resolvedDir}`);
|
|
98233
98282
|
if (!ctx.options.global && PathResolver.isLocalSameAsGlobal(resolvedDir)) {
|
|
98234
98283
|
logger.warning("You're at HOME directory. Installing here modifies your GLOBAL ClaudeKit.");
|
|
@@ -98407,7 +98456,7 @@ async function handleSelection(ctx) {
|
|
|
98407
98456
|
}
|
|
98408
98457
|
// src/commands/init/phases/sync-handler.ts
|
|
98409
98458
|
import { copyFile as copyFile8, mkdir as mkdir32, open as open5, readFile as readFile50, rename as rename7, stat as stat18, unlink as unlink11, writeFile as writeFile30 } from "node:fs/promises";
|
|
98410
|
-
import { dirname as dirname30, join as join117, resolve as
|
|
98459
|
+
import { dirname as dirname30, join as join117, resolve as resolve28 } from "node:path";
|
|
98411
98460
|
init_logger();
|
|
98412
98461
|
init_path_resolver();
|
|
98413
98462
|
var import_fs_extra36 = __toESM(require_lib(), 1);
|
|
@@ -98416,7 +98465,7 @@ async function handleSync(ctx) {
|
|
|
98416
98465
|
if (!ctx.options.sync) {
|
|
98417
98466
|
return ctx;
|
|
98418
98467
|
}
|
|
98419
|
-
const resolvedDir = ctx.options.global ? PathResolver.getGlobalKitDir() :
|
|
98468
|
+
const resolvedDir = ctx.options.global ? PathResolver.getGlobalKitDir() : resolve28(ctx.options.dir || ".");
|
|
98420
98469
|
const claudeDir2 = ctx.options.global ? resolvedDir : join117(resolvedDir, ".claude");
|
|
98421
98470
|
if (!await import_fs_extra36.pathExists(claudeDir2)) {
|
|
98422
98471
|
logger.error("Cannot sync: no .claude directory found");
|
|
@@ -98550,7 +98599,7 @@ async function acquireSyncLock(global3) {
|
|
|
98550
98599
|
}
|
|
98551
98600
|
logger.debug(`Lock stat failed: ${statError}`);
|
|
98552
98601
|
}
|
|
98553
|
-
await new Promise((
|
|
98602
|
+
await new Promise((resolve29) => setTimeout(resolve29, 100));
|
|
98554
98603
|
continue;
|
|
98555
98604
|
}
|
|
98556
98605
|
throw err;
|
|
@@ -99062,9 +99111,9 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
99062
99111
|
// src/services/transformers/global-path-transformer.ts
|
|
99063
99112
|
init_logger();
|
|
99064
99113
|
import { readFile as readFile52, readdir as readdir35, writeFile as writeFile32 } from "node:fs/promises";
|
|
99065
|
-
import { platform as
|
|
99114
|
+
import { platform as platform15 } from "node:os";
|
|
99066
99115
|
import { extname as extname6, join as join120 } from "node:path";
|
|
99067
|
-
var IS_WINDOWS3 =
|
|
99116
|
+
var IS_WINDOWS3 = platform15() === "win32";
|
|
99068
99117
|
var HOME_PREFIX = IS_WINDOWS3 ? "%USERPROFILE%" : "$HOME";
|
|
99069
99118
|
function getHomeDirPrefix() {
|
|
99070
99119
|
return HOME_PREFIX;
|
|
@@ -99443,7 +99492,7 @@ var import_picocolors29 = __toESM(require_picocolors(), 1);
|
|
|
99443
99492
|
import { existsSync as existsSync56 } from "node:fs";
|
|
99444
99493
|
import { readFile as readFile53, rm as rm15, unlink as unlink12 } from "node:fs/promises";
|
|
99445
99494
|
import { homedir as homedir31 } from "node:os";
|
|
99446
|
-
import { basename as basename19, join as join122, resolve as
|
|
99495
|
+
import { basename as basename19, join as join122, resolve as resolve29 } from "node:path";
|
|
99447
99496
|
init_logger();
|
|
99448
99497
|
init_agents_discovery();
|
|
99449
99498
|
init_commands_discovery();
|
|
@@ -99841,7 +99890,7 @@ function shouldExecuteAction2(action) {
|
|
|
99841
99890
|
}
|
|
99842
99891
|
async function executeDeleteAction(action, options2) {
|
|
99843
99892
|
const preservePaths = options2?.preservePaths ?? new Set;
|
|
99844
|
-
const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(
|
|
99893
|
+
const shouldPreserveTarget = action.targetPath.length > 0 && preservePaths.has(resolve29(action.targetPath));
|
|
99845
99894
|
try {
|
|
99846
99895
|
if (!shouldPreserveTarget && action.targetPath && existsSync56(action.targetPath)) {
|
|
99847
99896
|
await rm15(action.targetPath, { recursive: true, force: true });
|
|
@@ -99868,7 +99917,7 @@ async function executeDeleteAction(action, options2) {
|
|
|
99868
99917
|
async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
99869
99918
|
if (!skillSourcePath)
|
|
99870
99919
|
return;
|
|
99871
|
-
const sourceMetadataPath = join122(
|
|
99920
|
+
const sourceMetadataPath = join122(resolve29(skillSourcePath, ".."), "metadata.json");
|
|
99872
99921
|
if (!existsSync56(sourceMetadataPath))
|
|
99873
99922
|
return;
|
|
99874
99923
|
let sourceMetadata;
|
|
@@ -100266,7 +100315,7 @@ async function migrateCommand(options2) {
|
|
|
100266
100315
|
}
|
|
100267
100316
|
}
|
|
100268
100317
|
await processMetadataDeletions(skillSource, installGlobally);
|
|
100269
|
-
const writtenPaths = new Set(allResults.filter((result) => result.success && !result.skipped && result.path.length > 0).map((result) =>
|
|
100318
|
+
const writtenPaths = new Set(allResults.filter((result) => result.success && !result.skipped && result.path.length > 0).map((result) => resolve29(result.path)));
|
|
100270
100319
|
for (const deleteAction of plannedDeleteActions) {
|
|
100271
100320
|
allResults.push(await executeDeleteAction(deleteAction, {
|
|
100272
100321
|
preservePaths: writtenPaths
|
|
@@ -100294,7 +100343,7 @@ async function migrateCommand(options2) {
|
|
|
100294
100343
|
}
|
|
100295
100344
|
}
|
|
100296
100345
|
try {
|
|
100297
|
-
const kitRoot = (agentSource ?
|
|
100346
|
+
const kitRoot = (agentSource ? resolve29(agentSource, "..") : null) ?? (commandSource ? resolve29(commandSource, "..") : null) ?? (skillSource ? resolve29(skillSource, "..") : null) ?? null;
|
|
100298
100347
|
const manifest = kitRoot ? await loadPortableManifest(kitRoot) : null;
|
|
100299
100348
|
if (manifest?.cliVersion) {
|
|
100300
100349
|
await updateAppliedManifestVersion(manifest.cliVersion);
|
|
@@ -100443,7 +100492,7 @@ var import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
|
100443
100492
|
|
|
100444
100493
|
// src/commands/new/phases/directory-setup.ts
|
|
100445
100494
|
init_config_manager();
|
|
100446
|
-
import { resolve as
|
|
100495
|
+
import { resolve as resolve30 } from "node:path";
|
|
100447
100496
|
init_logger();
|
|
100448
100497
|
init_path_resolver();
|
|
100449
100498
|
init_types3();
|
|
@@ -100528,7 +100577,7 @@ async function directorySetup(validOptions, prompts) {
|
|
|
100528
100577
|
targetDir = await prompts.getDirectory(targetDir);
|
|
100529
100578
|
}
|
|
100530
100579
|
}
|
|
100531
|
-
const resolvedDir =
|
|
100580
|
+
const resolvedDir = resolve30(targetDir);
|
|
100532
100581
|
logger.info(`Target directory: ${resolvedDir}`);
|
|
100533
100582
|
if (PathResolver.isLocalSameAsGlobal(resolvedDir)) {
|
|
100534
100583
|
logger.warning("You're creating a project at HOME directory.");
|
|
@@ -100861,16 +100910,16 @@ Please use only one download method.`);
|
|
|
100861
100910
|
}
|
|
100862
100911
|
// src/commands/plan/plan-command.ts
|
|
100863
100912
|
init_output_manager();
|
|
100864
|
-
import { existsSync as existsSync58, statSync as
|
|
100865
|
-
import { dirname as dirname32, join as join126, parse as parse6, resolve as
|
|
100913
|
+
import { existsSync as existsSync58, statSync as statSync9 } from "node:fs";
|
|
100914
|
+
import { dirname as dirname32, join as join126, parse as parse6, resolve as resolve33 } from "node:path";
|
|
100866
100915
|
|
|
100867
100916
|
// src/commands/plan/plan-read-handlers.ts
|
|
100868
100917
|
init_plan_parser();
|
|
100869
100918
|
init_logger();
|
|
100870
100919
|
init_output_manager();
|
|
100871
100920
|
var import_picocolors31 = __toESM(require_picocolors(), 1);
|
|
100872
|
-
import { existsSync as existsSync57, statSync as
|
|
100873
|
-
import { basename as basename20, dirname as dirname31, join as join125, relative as relative21, resolve as
|
|
100921
|
+
import { existsSync as existsSync57, statSync as statSync8 } from "node:fs";
|
|
100922
|
+
import { basename as basename20, dirname as dirname31, join as join125, relative as relative21, resolve as resolve31 } from "node:path";
|
|
100874
100923
|
async function handleParse(target, options2) {
|
|
100875
100924
|
const planFile = resolvePlanFile(target);
|
|
100876
100925
|
if (!planFile) {
|
|
@@ -100945,8 +100994,8 @@ async function handleValidate(target, options2) {
|
|
|
100945
100994
|
process.exitCode = 1;
|
|
100946
100995
|
}
|
|
100947
100996
|
async function handleStatus(target, options2) {
|
|
100948
|
-
const t = target ?
|
|
100949
|
-
const plansDir = t && existsSync57(t) &&
|
|
100997
|
+
const t = target ? resolve31(target) : null;
|
|
100998
|
+
const plansDir = t && existsSync57(t) && statSync8(t).isDirectory() && !existsSync57(join125(t, "plan.md")) ? t : null;
|
|
100950
100999
|
if (plansDir) {
|
|
100951
101000
|
const planFiles = scanPlanDir(plansDir);
|
|
100952
101001
|
if (planFiles.length === 0) {
|
|
@@ -101067,7 +101116,7 @@ async function handleKanban(target, options2) {
|
|
|
101067
101116
|
init_plan_parser();
|
|
101068
101117
|
init_output_manager();
|
|
101069
101118
|
var import_picocolors32 = __toESM(require_picocolors(), 1);
|
|
101070
|
-
import { basename as basename21, relative as relative22, resolve as
|
|
101119
|
+
import { basename as basename21, relative as relative22, resolve as resolve32 } from "node:path";
|
|
101071
101120
|
async function handleCreate(target, options2) {
|
|
101072
101121
|
if (!options2.title) {
|
|
101073
101122
|
output.error("[X] --title is required for create");
|
|
@@ -101101,7 +101150,7 @@ async function handleCreate(target, options2) {
|
|
|
101101
101150
|
const result = scaffoldPlan({
|
|
101102
101151
|
title: options2.title,
|
|
101103
101152
|
phases: phaseNames.map((name2) => ({ name: name2 })),
|
|
101104
|
-
dir:
|
|
101153
|
+
dir: resolve32(dir),
|
|
101105
101154
|
priority,
|
|
101106
101155
|
issue: options2.issue ? Number(options2.issue) : undefined
|
|
101107
101156
|
});
|
|
@@ -101115,7 +101164,7 @@ async function handleCreate(target, options2) {
|
|
|
101115
101164
|
}
|
|
101116
101165
|
console.log();
|
|
101117
101166
|
console.log(import_picocolors32.default.bold(` [OK] Plan created: ${options2.title}`));
|
|
101118
|
-
console.log(` Directory: ${
|
|
101167
|
+
console.log(` Directory: ${resolve32(dir)}`);
|
|
101119
101168
|
console.log(` Phases: ${result.phaseFiles.length}`);
|
|
101120
101169
|
for (const f3 of result.phaseFiles) {
|
|
101121
101170
|
console.log(` [ ] ${basename21(f3)}`);
|
|
@@ -101213,9 +101262,9 @@ async function handleAddPhase(target, options2) {
|
|
|
101213
101262
|
|
|
101214
101263
|
// src/commands/plan/plan-command.ts
|
|
101215
101264
|
function resolvePlanFile(target) {
|
|
101216
|
-
const t = target ?
|
|
101265
|
+
const t = target ? resolve33(target) : process.cwd();
|
|
101217
101266
|
if (existsSync58(t)) {
|
|
101218
|
-
const stat19 =
|
|
101267
|
+
const stat19 = statSync9(t);
|
|
101219
101268
|
if (stat19.isFile())
|
|
101220
101269
|
return t;
|
|
101221
101270
|
const candidate = join126(t, "plan.md");
|
|
@@ -101277,7 +101326,7 @@ async function planCommand(action, target, options2) {
|
|
|
101277
101326
|
let resolvedTarget = target;
|
|
101278
101327
|
if (resolvedAction && !knownActions.has(resolvedAction)) {
|
|
101279
101328
|
const looksLikePath = resolvedAction.includes("/") || resolvedAction.includes("\\") || resolvedAction.endsWith(".md") || resolvedAction === "." || resolvedAction === "..";
|
|
101280
|
-
const existsOnDisk = !looksLikePath && existsSync58(
|
|
101329
|
+
const existsOnDisk = !looksLikePath && existsSync58(resolve33(resolvedAction));
|
|
101281
101330
|
if (looksLikePath || existsOnDisk) {
|
|
101282
101331
|
resolvedTarget = resolvedAction;
|
|
101283
101332
|
resolvedAction = undefined;
|
|
@@ -101320,11 +101369,11 @@ init_logger();
|
|
|
101320
101369
|
init_safe_prompts();
|
|
101321
101370
|
var import_picocolors33 = __toESM(require_picocolors(), 1);
|
|
101322
101371
|
import { existsSync as existsSync59 } from "node:fs";
|
|
101323
|
-
import { resolve as
|
|
101372
|
+
import { resolve as resolve34 } from "node:path";
|
|
101324
101373
|
async function handleAdd(projectPath, options2) {
|
|
101325
101374
|
logger.debug(`Adding project: ${projectPath}, options: ${JSON.stringify(options2)}`);
|
|
101326
101375
|
intro("Add Project");
|
|
101327
|
-
const absolutePath =
|
|
101376
|
+
const absolutePath = resolve34(projectPath);
|
|
101328
101377
|
if (!existsSync59(absolutePath)) {
|
|
101329
101378
|
log.error(`Path does not exist: ${absolutePath}`);
|
|
101330
101379
|
process.exitCode = 1;
|
|
@@ -102253,8 +102302,8 @@ async function detectInstallations() {
|
|
|
102253
102302
|
}
|
|
102254
102303
|
|
|
102255
102304
|
// src/commands/uninstall/removal-handler.ts
|
|
102256
|
-
import { readdirSync as
|
|
102257
|
-
import { basename as basename22, join as join128, resolve as
|
|
102305
|
+
import { readdirSync as readdirSync8, rmSync as rmSync6 } from "node:fs";
|
|
102306
|
+
import { basename as basename22, join as join128, resolve as resolve35, sep as sep10 } from "node:path";
|
|
102258
102307
|
init_logger();
|
|
102259
102308
|
init_safe_prompts();
|
|
102260
102309
|
init_safe_spinner();
|
|
@@ -102262,7 +102311,7 @@ var import_fs_extra40 = __toESM(require_lib(), 1);
|
|
|
102262
102311
|
|
|
102263
102312
|
// src/commands/uninstall/analysis-handler.ts
|
|
102264
102313
|
init_metadata_migration();
|
|
102265
|
-
import { readdirSync as
|
|
102314
|
+
import { readdirSync as readdirSync7, rmSync as rmSync5 } from "node:fs";
|
|
102266
102315
|
import { dirname as dirname33, join as join127 } from "node:path";
|
|
102267
102316
|
init_logger();
|
|
102268
102317
|
init_safe_prompts();
|
|
@@ -102284,7 +102333,7 @@ async function cleanupEmptyDirectories3(filePath, installationRoot) {
|
|
|
102284
102333
|
let currentDir = dirname33(filePath);
|
|
102285
102334
|
while (currentDir !== installationRoot && currentDir.startsWith(installationRoot)) {
|
|
102286
102335
|
try {
|
|
102287
|
-
const entries =
|
|
102336
|
+
const entries = readdirSync7(currentDir);
|
|
102288
102337
|
if (entries.length === 0) {
|
|
102289
102338
|
rmSync5(currentDir, { recursive: true });
|
|
102290
102339
|
cleaned++;
|
|
@@ -102411,8 +102460,8 @@ async function restoreUninstallBackup(backup) {
|
|
|
102411
102460
|
}
|
|
102412
102461
|
async function isPathSafeToRemove(filePath, baseDir) {
|
|
102413
102462
|
try {
|
|
102414
|
-
const resolvedPath =
|
|
102415
|
-
const resolvedBase =
|
|
102463
|
+
const resolvedPath = resolve35(filePath);
|
|
102464
|
+
const resolvedBase = resolve35(baseDir);
|
|
102416
102465
|
if (!resolvedPath.startsWith(resolvedBase + sep10) && resolvedPath !== resolvedBase) {
|
|
102417
102466
|
logger.debug(`Path outside installation directory: ${filePath}`);
|
|
102418
102467
|
return false;
|
|
@@ -102420,7 +102469,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
|
|
|
102420
102469
|
const stats = await import_fs_extra40.lstat(filePath);
|
|
102421
102470
|
if (stats.isSymbolicLink()) {
|
|
102422
102471
|
const realPath = await import_fs_extra40.realpath(filePath);
|
|
102423
|
-
const resolvedReal =
|
|
102472
|
+
const resolvedReal = resolve35(realPath);
|
|
102424
102473
|
if (!resolvedReal.startsWith(resolvedBase + sep10) && resolvedReal !== resolvedBase) {
|
|
102425
102474
|
logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
|
|
102426
102475
|
return false;
|
|
@@ -102504,7 +102553,7 @@ async function removeInstallations(installations, options2) {
|
|
|
102504
102553
|
}
|
|
102505
102554
|
}
|
|
102506
102555
|
try {
|
|
102507
|
-
const remaining =
|
|
102556
|
+
const remaining = readdirSync8(installation.path);
|
|
102508
102557
|
if (remaining.length === 0) {
|
|
102509
102558
|
rmSync6(installation.path, { recursive: true });
|
|
102510
102559
|
logger.debug(`Removed empty installation directory: ${installation.path}`);
|
|
@@ -102867,7 +102916,7 @@ function getDisclaimerMarker() {
|
|
|
102867
102916
|
return AI_DISCLAIMER;
|
|
102868
102917
|
}
|
|
102869
102918
|
function spawnAndCollect2(command, args) {
|
|
102870
|
-
return new Promise((
|
|
102919
|
+
return new Promise((resolve36, reject) => {
|
|
102871
102920
|
const child = spawn6(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
102872
102921
|
const chunks = [];
|
|
102873
102922
|
const stderrChunks = [];
|
|
@@ -102880,7 +102929,7 @@ function spawnAndCollect2(command, args) {
|
|
|
102880
102929
|
reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
|
|
102881
102930
|
return;
|
|
102882
102931
|
}
|
|
102883
|
-
|
|
102932
|
+
resolve36(Buffer.concat(chunks).toString("utf-8"));
|
|
102884
102933
|
});
|
|
102885
102934
|
});
|
|
102886
102935
|
}
|
|
@@ -102988,7 +103037,7 @@ function formatResponse(content, showBranding) {
|
|
|
102988
103037
|
return disclaimer + formatted + branding;
|
|
102989
103038
|
}
|
|
102990
103039
|
async function postViaGh(owner, repo, issueNumber, body) {
|
|
102991
|
-
return new Promise((
|
|
103040
|
+
return new Promise((resolve36, reject) => {
|
|
102992
103041
|
const args = [
|
|
102993
103042
|
"issue",
|
|
102994
103043
|
"comment",
|
|
@@ -103010,7 +103059,7 @@ async function postViaGh(owner, repo, issueNumber, body) {
|
|
|
103010
103059
|
reject(new Error(`gh exited with code ${code2}: ${stderr}`));
|
|
103011
103060
|
return;
|
|
103012
103061
|
}
|
|
103013
|
-
|
|
103062
|
+
resolve36();
|
|
103014
103063
|
});
|
|
103015
103064
|
});
|
|
103016
103065
|
}
|
|
@@ -103128,7 +103177,7 @@ After completing the implementation:
|
|
|
103128
103177
|
"--allowedTools",
|
|
103129
103178
|
tools
|
|
103130
103179
|
];
|
|
103131
|
-
await new Promise((
|
|
103180
|
+
await new Promise((resolve36, reject) => {
|
|
103132
103181
|
const child = spawn8("claude", args, { cwd: cwd2, stdio: ["pipe", "pipe", "pipe"], detached: false });
|
|
103133
103182
|
child.stdin.write(prompt);
|
|
103134
103183
|
child.stdin.end();
|
|
@@ -103153,7 +103202,7 @@ After completing the implementation:
|
|
|
103153
103202
|
reject(new Error(`Claude exited ${code2}: ${stderr.slice(0, 500)}`));
|
|
103154
103203
|
return;
|
|
103155
103204
|
}
|
|
103156
|
-
|
|
103205
|
+
resolve36();
|
|
103157
103206
|
});
|
|
103158
103207
|
});
|
|
103159
103208
|
}
|
|
@@ -103297,7 +103346,7 @@ function checkRateLimit2(processedThisHour, maxPerHour) {
|
|
|
103297
103346
|
return processedThisHour < maxPerHour;
|
|
103298
103347
|
}
|
|
103299
103348
|
function spawnAndCollect3(command, args) {
|
|
103300
|
-
return new Promise((
|
|
103349
|
+
return new Promise((resolve36, reject) => {
|
|
103301
103350
|
const child = spawn9(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
103302
103351
|
const chunks = [];
|
|
103303
103352
|
const stderrChunks = [];
|
|
@@ -103310,7 +103359,7 @@ function spawnAndCollect3(command, args) {
|
|
|
103310
103359
|
reject(new Error(`${command} exited with code ${code2}: ${stderr}`));
|
|
103311
103360
|
return;
|
|
103312
103361
|
}
|
|
103313
|
-
|
|
103362
|
+
resolve36(Buffer.concat(chunks).toString("utf-8"));
|
|
103314
103363
|
});
|
|
103315
103364
|
});
|
|
103316
103365
|
}
|
|
@@ -103362,7 +103411,7 @@ async function invokeClaude(options2) {
|
|
|
103362
103411
|
return collectClaudeOutput(child, options2.timeoutSec, verbose);
|
|
103363
103412
|
}
|
|
103364
103413
|
function collectClaudeOutput(child, timeoutSec, verbose = false) {
|
|
103365
|
-
return new Promise((
|
|
103414
|
+
return new Promise((resolve36, reject) => {
|
|
103366
103415
|
const chunks = [];
|
|
103367
103416
|
const stderrChunks = [];
|
|
103368
103417
|
child.stdout?.on("data", (chunk) => {
|
|
@@ -103392,7 +103441,7 @@ function collectClaudeOutput(child, timeoutSec, verbose = false) {
|
|
|
103392
103441
|
reject(new Error(`Claude exited with code ${code2}: ${stderr}`));
|
|
103393
103442
|
return;
|
|
103394
103443
|
}
|
|
103395
|
-
|
|
103444
|
+
resolve36(verbose ? parseStreamJsonOutput(stdout2) : parseClaudeOutput(stdout2));
|
|
103396
103445
|
});
|
|
103397
103446
|
});
|
|
103398
103447
|
}
|
|
@@ -104342,7 +104391,7 @@ Run this command from a directory with a GitHub remote.`);
|
|
|
104342
104391
|
// src/commands/watch/phases/watch-logger.ts
|
|
104343
104392
|
init_logger();
|
|
104344
104393
|
init_path_resolver();
|
|
104345
|
-
import { createWriteStream as createWriteStream3, statSync as
|
|
104394
|
+
import { createWriteStream as createWriteStream3, statSync as statSync10 } from "node:fs";
|
|
104346
104395
|
import { existsSync as existsSync64 } from "node:fs";
|
|
104347
104396
|
import { mkdir as mkdir35, rename as rename9 } from "node:fs/promises";
|
|
104348
104397
|
import { join as join134 } from "node:path";
|
|
@@ -104410,7 +104459,7 @@ class WatchLogger {
|
|
|
104410
104459
|
return;
|
|
104411
104460
|
if (this.maxBytes > 0 && this.logPath) {
|
|
104412
104461
|
try {
|
|
104413
|
-
const stats =
|
|
104462
|
+
const stats = statSync10(this.logPath);
|
|
104414
104463
|
if (stats.size >= this.maxBytes) {
|
|
104415
104464
|
this.rotateLog();
|
|
104416
104465
|
}
|
|
@@ -104656,7 +104705,7 @@ function formatQueueInfo(state) {
|
|
|
104656
104705
|
return "idle";
|
|
104657
104706
|
}
|
|
104658
104707
|
function sleep(ms) {
|
|
104659
|
-
return new Promise((
|
|
104708
|
+
return new Promise((resolve36) => setTimeout(resolve36, ms));
|
|
104660
104709
|
}
|
|
104661
104710
|
// src/cli/command-registry.ts
|
|
104662
104711
|
init_logger();
|