claudekit-cli 4.4.0-dev.12 → 4.4.0-dev.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli-manifest.json +5 -5
- package/dist/index.js +583 -259
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10774,7 +10774,33 @@ var init_hook_migration_compatibility = __esm(() => {
|
|
|
10774
10774
|
// src/commands/portable/converters/direct-copy.ts
|
|
10775
10775
|
import { readFileSync } from "node:fs";
|
|
10776
10776
|
import { extname } from "node:path";
|
|
10777
|
-
function
|
|
10777
|
+
function rewriteKiroPaths(content) {
|
|
10778
|
+
return content.replace(/\.claude\/skills\//g, ".kiro/skills/").replace(/\.claude\/agents\//g, ".kiro/agents/").replace(/\.claude\/rules\//g, ".kiro/steering/").replace(/\.claude\/commands\//g, "Claude Code commands/").replace(/\.claude\/hooks\//g, "Claude Code hooks/");
|
|
10779
|
+
}
|
|
10780
|
+
function splitTrailingPunctuation(pathSuffix) {
|
|
10781
|
+
const match = pathSuffix.match(/^(.+?)([.,;:!?]+)?$/);
|
|
10782
|
+
return {
|
|
10783
|
+
itemPath: match?.[1] ?? pathSuffix,
|
|
10784
|
+
punctuation: match?.[2] ?? ""
|
|
10785
|
+
};
|
|
10786
|
+
}
|
|
10787
|
+
function rewriteAntigravityCommandRefSuffix(suffix) {
|
|
10788
|
+
const { itemPath, punctuation } = splitTrailingPunctuation(suffix);
|
|
10789
|
+
const extIdx = itemPath.lastIndexOf(".");
|
|
10790
|
+
const ext = extIdx >= 0 ? itemPath.substring(extIdx) : "";
|
|
10791
|
+
const nameWithoutExt = extIdx >= 0 ? itemPath.substring(0, extIdx) : itemPath;
|
|
10792
|
+
return `${nameWithoutExt.replace(/[\\/]+/g, "-")}${ext}${punctuation}`;
|
|
10793
|
+
}
|
|
10794
|
+
function rewriteAntigravityPaths(content, options2 = {}) {
|
|
10795
|
+
const skillsBase = options2.global ? "~/.gemini/config/skills/" : ".agents/skills/";
|
|
10796
|
+
return content.replace(/\.claude\/agents\/([a-zA-Z0-9_./-]+)/g, (_matched, suffix) => {
|
|
10797
|
+
const { punctuation } = splitTrailingPunctuation(suffix);
|
|
10798
|
+
return `.agents/agents.md${punctuation}`;
|
|
10799
|
+
}).replace(/\.claude\/commands\/([a-zA-Z0-9_./-]+)/g, (_matched, suffix) => {
|
|
10800
|
+
return `.agents/workflows/${rewriteAntigravityCommandRefSuffix(suffix)}`;
|
|
10801
|
+
}).replace(/\.claude\/skills\//g, skillsBase).replace(/\.claude\/rules\//g, ".agents/rules/").replace(/\.claude\/agents\//g, ".agents/agents.md").replace(/\.claude\/commands\//g, ".agents/workflows/").replace(/\.claude\/hooks\//g, "Claude Code hooks/");
|
|
10802
|
+
}
|
|
10803
|
+
function convertDirectCopy(item, provider, options2 = {}) {
|
|
10778
10804
|
let content;
|
|
10779
10805
|
try {
|
|
10780
10806
|
content = readFileSync(item.sourcePath, "utf-8");
|
|
@@ -10786,9 +10812,15 @@ function convertDirectCopy(item, provider) {
|
|
|
10786
10812
|
}
|
|
10787
10813
|
}
|
|
10788
10814
|
if (provider && provider !== "claude-code") {
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10815
|
+
if (provider === "kiro") {
|
|
10816
|
+
content = rewriteKiroPaths(content);
|
|
10817
|
+
} else if (provider === "antigravity") {
|
|
10818
|
+
content = rewriteAntigravityPaths(content, options2);
|
|
10819
|
+
} else {
|
|
10820
|
+
const targetDir = PROVIDER_CONFIG_DIR[provider];
|
|
10821
|
+
if (targetDir) {
|
|
10822
|
+
content = content.replace(/\.claude\//g, targetDir);
|
|
10823
|
+
}
|
|
10792
10824
|
}
|
|
10793
10825
|
}
|
|
10794
10826
|
if (provider === "codex" && item.type === "hooks") {
|
|
@@ -10816,7 +10848,6 @@ var init_direct_copy = __esm(() => {
|
|
|
10816
10848
|
opencode: ".opencode/",
|
|
10817
10849
|
droid: ".factory/",
|
|
10818
10850
|
windsurf: ".windsurf/",
|
|
10819
|
-
antigravity: ".agent/",
|
|
10820
10851
|
cursor: ".cursor/",
|
|
10821
10852
|
roo: ".roo/",
|
|
10822
10853
|
kilo: ".kilocode/",
|
|
@@ -11380,44 +11411,48 @@ var init_provider_registry = __esm(() => {
|
|
|
11380
11411
|
kiro: {
|
|
11381
11412
|
name: "kiro",
|
|
11382
11413
|
displayName: "Kiro IDE",
|
|
11383
|
-
subagents: "
|
|
11414
|
+
subagents: "full",
|
|
11384
11415
|
agents: {
|
|
11385
|
-
projectPath: ".kiro/
|
|
11386
|
-
globalPath:
|
|
11387
|
-
format: "
|
|
11416
|
+
projectPath: ".kiro/agents",
|
|
11417
|
+
globalPath: join(home, ".kiro/agents"),
|
|
11418
|
+
format: "fm-to-fm",
|
|
11388
11419
|
writeStrategy: "per-file",
|
|
11389
11420
|
fileExtension: ".md"
|
|
11390
11421
|
},
|
|
11391
11422
|
commands: null,
|
|
11392
11423
|
skills: {
|
|
11393
11424
|
projectPath: ".kiro/skills",
|
|
11394
|
-
globalPath:
|
|
11425
|
+
globalPath: join(home, ".kiro/skills"),
|
|
11395
11426
|
format: "direct-copy",
|
|
11396
11427
|
writeStrategy: "per-file",
|
|
11397
11428
|
fileExtension: ".md"
|
|
11398
11429
|
},
|
|
11399
11430
|
config: {
|
|
11400
11431
|
projectPath: ".kiro/steering/project.md",
|
|
11401
|
-
globalPath:
|
|
11432
|
+
globalPath: join(home, ".kiro/steering/project.md"),
|
|
11402
11433
|
format: "md-to-kiro-steering",
|
|
11403
11434
|
writeStrategy: "single-file",
|
|
11404
11435
|
fileExtension: ".md"
|
|
11405
11436
|
},
|
|
11406
11437
|
rules: {
|
|
11407
11438
|
projectPath: ".kiro/steering",
|
|
11408
|
-
globalPath:
|
|
11439
|
+
globalPath: join(home, ".kiro/steering"),
|
|
11409
11440
|
format: "md-to-kiro-steering",
|
|
11410
11441
|
writeStrategy: "per-file",
|
|
11411
11442
|
fileExtension: ".md"
|
|
11412
11443
|
},
|
|
11413
11444
|
hooks: null,
|
|
11414
11445
|
settingsJsonPath: null,
|
|
11415
|
-
detect: async () => hasAnyInstallSignal([
|
|
11446
|
+
detect: async () => hasBinaryInPath("kiro") || hasAnyInstallSignal([
|
|
11416
11447
|
join(cwd, ".kiro/steering"),
|
|
11417
11448
|
join(cwd, ".kiro/skills"),
|
|
11418
11449
|
join(cwd, ".kiro/hooks"),
|
|
11419
11450
|
join(cwd, ".kiro/agents"),
|
|
11420
|
-
join(cwd, ".kiro/settings/mcp.json")
|
|
11451
|
+
join(cwd, ".kiro/settings/mcp.json"),
|
|
11452
|
+
join(home, ".kiro/steering"),
|
|
11453
|
+
join(home, ".kiro/skills"),
|
|
11454
|
+
join(home, ".kiro/agents"),
|
|
11455
|
+
join(home, ".kiro/settings/mcp.json")
|
|
11421
11456
|
])
|
|
11422
11457
|
},
|
|
11423
11458
|
windsurf: {
|
|
@@ -11618,9 +11653,15 @@ var init_provider_registry = __esm(() => {
|
|
|
11618
11653
|
name: "antigravity",
|
|
11619
11654
|
displayName: "Antigravity",
|
|
11620
11655
|
subagents: "full",
|
|
11621
|
-
agents:
|
|
11656
|
+
agents: {
|
|
11657
|
+
projectPath: ".agents/agents.md",
|
|
11658
|
+
globalPath: null,
|
|
11659
|
+
format: "fm-strip",
|
|
11660
|
+
writeStrategy: "merge-single",
|
|
11661
|
+
fileExtension: ".md"
|
|
11662
|
+
},
|
|
11622
11663
|
commands: {
|
|
11623
|
-
projectPath: ".
|
|
11664
|
+
projectPath: ".agents/workflows",
|
|
11624
11665
|
globalPath: null,
|
|
11625
11666
|
format: "direct-copy",
|
|
11626
11667
|
writeStrategy: "per-file",
|
|
@@ -11628,8 +11669,8 @@ var init_provider_registry = __esm(() => {
|
|
|
11628
11669
|
nestedCommands: false
|
|
11629
11670
|
},
|
|
11630
11671
|
skills: {
|
|
11631
|
-
projectPath: ".
|
|
11632
|
-
globalPath: join(home, ".gemini/
|
|
11672
|
+
projectPath: ".agents/skills",
|
|
11673
|
+
globalPath: join(home, ".gemini/config/skills"),
|
|
11633
11674
|
format: "direct-copy",
|
|
11634
11675
|
writeStrategy: "per-file",
|
|
11635
11676
|
fileExtension: ".md"
|
|
@@ -11642,7 +11683,7 @@ var init_provider_registry = __esm(() => {
|
|
|
11642
11683
|
fileExtension: ".md"
|
|
11643
11684
|
},
|
|
11644
11685
|
rules: {
|
|
11645
|
-
projectPath: ".
|
|
11686
|
+
projectPath: ".agents/rules",
|
|
11646
11687
|
globalPath: null,
|
|
11647
11688
|
format: "md-strip",
|
|
11648
11689
|
writeStrategy: "per-file",
|
|
@@ -11651,10 +11692,18 @@ var init_provider_registry = __esm(() => {
|
|
|
11651
11692
|
hooks: null,
|
|
11652
11693
|
settingsJsonPath: null,
|
|
11653
11694
|
detect: async () => hasBinaryInPath("agy") || hasBinaryInPath("antigravity") || hasAnyInstallSignal([
|
|
11695
|
+
join(cwd, ".agents/rules"),
|
|
11696
|
+
join(cwd, ".agents/agents.md"),
|
|
11697
|
+
join(cwd, ".agents/skills"),
|
|
11698
|
+
join(cwd, ".agents/workflows"),
|
|
11699
|
+
join(cwd, ".agents/plugins"),
|
|
11654
11700
|
join(cwd, ".agent/rules"),
|
|
11655
11701
|
join(cwd, ".agent/skills"),
|
|
11656
11702
|
join(cwd, ".agent/workflows"),
|
|
11657
11703
|
join(cwd, "GEMINI.md"),
|
|
11704
|
+
join(home, ".gemini/config"),
|
|
11705
|
+
join(home, ".gemini/config/skills"),
|
|
11706
|
+
join(home, ".gemini/config/plugins"),
|
|
11658
11707
|
join(home, ".gemini/antigravity"),
|
|
11659
11708
|
join(home, ".gemini/antigravity/skills")
|
|
11660
11709
|
])
|
|
@@ -11754,7 +11803,7 @@ function normalizeProjectPath(path2) {
|
|
|
11754
11803
|
const home2 = homedir2().replace(/\\/g, "/");
|
|
11755
11804
|
return normalized.startsWith(home2) ? normalized.replace(home2, "~") : normalized;
|
|
11756
11805
|
}
|
|
11757
|
-
function
|
|
11806
|
+
function splitTrailingPunctuation2(pathSuffix) {
|
|
11758
11807
|
const match = pathSuffix.match(/^(.+?)([.,;:!?]+)?$/);
|
|
11759
11808
|
return {
|
|
11760
11809
|
itemPath: match?.[1] ?? pathSuffix,
|
|
@@ -11777,7 +11826,7 @@ function getProviderPathTarget(provider, type, global2 = false) {
|
|
|
11777
11826
|
return {
|
|
11778
11827
|
path: isDirectory && !normalized.endsWith("/") ? `${normalized}/` : normalized,
|
|
11779
11828
|
isDirectory,
|
|
11780
|
-
rewriteSuffix: provider === "codex" && type === "commands" ? getCodexCommandSkillFilenameFromCommandPath : undefined
|
|
11829
|
+
rewriteSuffix: provider === "codex" && type === "commands" ? getCodexCommandSkillFilenameFromCommandPath : provider === "antigravity" && type === "commands" ? rewriteAntigravityCommandRefSuffix : undefined
|
|
11781
11830
|
};
|
|
11782
11831
|
}
|
|
11783
11832
|
function rewriteClaudeDirectoryRefs(input, sourceDir, target, fallbackPrefix, isInCodeBlock) {
|
|
@@ -11787,7 +11836,7 @@ function rewriteClaudeDirectoryRefs(input, sourceDir, target, fallbackPrefix, is
|
|
|
11787
11836
|
const offset = args[args.length - 2];
|
|
11788
11837
|
if (isInCodeBlock(offset))
|
|
11789
11838
|
return matched;
|
|
11790
|
-
const { itemPath, punctuation } =
|
|
11839
|
+
const { itemPath, punctuation } = splitTrailingPunctuation2(suffix);
|
|
11791
11840
|
if (!target)
|
|
11792
11841
|
return `${fallbackPrefix}${itemPath}${punctuation}`;
|
|
11793
11842
|
const rewrittenSuffix = target.rewriteSuffix ? target.rewriteSuffix(itemPath) : itemPath;
|
|
@@ -12040,13 +12089,14 @@ function convertMdStrip(item, provider, options2 = {}) {
|
|
|
12040
12089
|
var MAX_CONTENT_SIZE = 512000;
|
|
12041
12090
|
var init_md_strip = __esm(() => {
|
|
12042
12091
|
init_provider_registry();
|
|
12092
|
+
init_direct_copy();
|
|
12043
12093
|
});
|
|
12044
12094
|
|
|
12045
12095
|
// src/commands/portable/converters/fm-strip.ts
|
|
12046
12096
|
function convertFmStrip(item, provider) {
|
|
12047
12097
|
const warnings = [];
|
|
12048
12098
|
const heading = item.frontmatter.name || item.name;
|
|
12049
|
-
const isMergeProvider = ["goose", "gemini-cli", "amp"].includes(provider);
|
|
12099
|
+
const isMergeProvider = ["goose", "gemini-cli", "amp", "antigravity"].includes(provider);
|
|
12050
12100
|
let body = item.body;
|
|
12051
12101
|
if (PROVIDERS_WITH_BODY_REWRITING.includes(provider)) {
|
|
12052
12102
|
const stripped = stripClaudeRefs(body, { provider });
|
|
@@ -12095,7 +12145,7 @@ function buildMergedAgentsMd(sections, providerName) {
|
|
|
12095
12145
|
var PROVIDERS_WITH_BODY_REWRITING;
|
|
12096
12146
|
var init_fm_strip = __esm(() => {
|
|
12097
12147
|
init_md_strip();
|
|
12098
|
-
PROVIDERS_WITH_BODY_REWRITING = ["gemini-cli"];
|
|
12148
|
+
PROVIDERS_WITH_BODY_REWRITING = ["gemini-cli", "antigravity"];
|
|
12099
12149
|
});
|
|
12100
12150
|
|
|
12101
12151
|
// src/commands/portable/converters/fm-to-fm.ts
|
|
@@ -12167,6 +12217,68 @@ ${item.body}
|
|
|
12167
12217
|
warnings: []
|
|
12168
12218
|
};
|
|
12169
12219
|
}
|
|
12220
|
+
function mapKiroTools(toolsStr) {
|
|
12221
|
+
const warnings = [];
|
|
12222
|
+
if (!toolsStr || toolsStr.trim().length === 0) {
|
|
12223
|
+
return {
|
|
12224
|
+
tools: ["@builtin"],
|
|
12225
|
+
warnings: ["No Claude tools declared; granting Kiro built-in tools by default"]
|
|
12226
|
+
};
|
|
12227
|
+
}
|
|
12228
|
+
const tools = new Set;
|
|
12229
|
+
const unmapped = [];
|
|
12230
|
+
for (const rawTool of toolsStr.split(",")) {
|
|
12231
|
+
const tool = rawTool.trim();
|
|
12232
|
+
if (!tool)
|
|
12233
|
+
continue;
|
|
12234
|
+
const mapped = KIRO_TOOL_MAP[tool];
|
|
12235
|
+
if (mapped) {
|
|
12236
|
+
tools.add(mapped);
|
|
12237
|
+
continue;
|
|
12238
|
+
}
|
|
12239
|
+
const mcpMatch = /^mcp__(.+?)__(.+)$/.exec(tool);
|
|
12240
|
+
if (mcpMatch) {
|
|
12241
|
+
tools.add(`@${mcpMatch[1]}/${mcpMatch[2]}`);
|
|
12242
|
+
continue;
|
|
12243
|
+
}
|
|
12244
|
+
unmapped.push(tool);
|
|
12245
|
+
}
|
|
12246
|
+
if (unmapped.length > 0) {
|
|
12247
|
+
warnings.push(`Claude tools not mapped to Kiro custom subagent tools: ${unmapped.join(", ")}`);
|
|
12248
|
+
}
|
|
12249
|
+
if (tools.size === 0) {
|
|
12250
|
+
tools.add("@builtin");
|
|
12251
|
+
warnings.push("No mapped Kiro tools remained; granting Kiro built-in tools by default");
|
|
12252
|
+
}
|
|
12253
|
+
return { tools: Array.from(tools), warnings };
|
|
12254
|
+
}
|
|
12255
|
+
function pushYamlString(lines, key, value) {
|
|
12256
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
12257
|
+
lines.push(`${key}: ${JSON.stringify(value.trim())}`);
|
|
12258
|
+
}
|
|
12259
|
+
}
|
|
12260
|
+
function convertKiroAgent(item) {
|
|
12261
|
+
const mappedTools = mapKiroTools(item.frontmatter.tools);
|
|
12262
|
+
const stripped = stripClaudeRefs(item.body, { provider: "kiro" });
|
|
12263
|
+
const warnings = [...mappedTools.warnings, ...stripped.warnings];
|
|
12264
|
+
const name = item.name;
|
|
12265
|
+
const description = item.description || `Custom subagent: ${name}`;
|
|
12266
|
+
const fmLines = ["---"];
|
|
12267
|
+
pushYamlString(fmLines, "name", name);
|
|
12268
|
+
pushYamlString(fmLines, "description", description);
|
|
12269
|
+
fmLines.push(`tools: ${JSON.stringify(mappedTools.tools)}`);
|
|
12270
|
+
pushYamlString(fmLines, "model", typeof item.frontmatter.model === "string" ? item.frontmatter.model : "");
|
|
12271
|
+
fmLines.push("---");
|
|
12272
|
+
return {
|
|
12273
|
+
content: `${fmLines.join(`
|
|
12274
|
+
`)}
|
|
12275
|
+
|
|
12276
|
+
${stripped.content}
|
|
12277
|
+
`,
|
|
12278
|
+
filename: `${item.name}.md`,
|
|
12279
|
+
warnings
|
|
12280
|
+
};
|
|
12281
|
+
}
|
|
12170
12282
|
function replaceClaudePathsForOpenCode(content) {
|
|
12171
12283
|
return content.replace(/\.claude\//g, ".opencode/");
|
|
12172
12284
|
}
|
|
@@ -12241,6 +12353,8 @@ function convertFmToFm(item, provider) {
|
|
|
12241
12353
|
return convertForCopilot(item);
|
|
12242
12354
|
case "cursor":
|
|
12243
12355
|
return convertForCursor(item);
|
|
12356
|
+
case "kiro":
|
|
12357
|
+
return convertKiroAgent(item);
|
|
12244
12358
|
case "opencode":
|
|
12245
12359
|
if (item.type === "command")
|
|
12246
12360
|
return convertOpenCodeCommand(item);
|
|
@@ -12253,8 +12367,9 @@ function convertFmToFm(item, provider) {
|
|
|
12253
12367
|
};
|
|
12254
12368
|
}
|
|
12255
12369
|
}
|
|
12256
|
-
var COPILOT_TOOL_MAP, OPENCODE_TOOL_MAP;
|
|
12370
|
+
var COPILOT_TOOL_MAP, KIRO_TOOL_MAP, OPENCODE_TOOL_MAP;
|
|
12257
12371
|
var init_fm_to_fm = __esm(() => {
|
|
12372
|
+
init_md_strip();
|
|
12258
12373
|
COPILOT_TOOL_MAP = {
|
|
12259
12374
|
Read: "read",
|
|
12260
12375
|
Glob: "search",
|
|
@@ -12266,6 +12381,19 @@ var init_fm_to_fm = __esm(() => {
|
|
|
12266
12381
|
WebFetch: "fetch",
|
|
12267
12382
|
WebSearch: "fetch"
|
|
12268
12383
|
};
|
|
12384
|
+
KIRO_TOOL_MAP = {
|
|
12385
|
+
Read: "read",
|
|
12386
|
+
Glob: "read",
|
|
12387
|
+
Grep: "read",
|
|
12388
|
+
LS: "read",
|
|
12389
|
+
Edit: "write",
|
|
12390
|
+
Write: "write",
|
|
12391
|
+
MultiEdit: "write",
|
|
12392
|
+
NotebookEdit: "write",
|
|
12393
|
+
Bash: "shell",
|
|
12394
|
+
WebFetch: "web",
|
|
12395
|
+
WebSearch: "web"
|
|
12396
|
+
};
|
|
12269
12397
|
OPENCODE_TOOL_MAP = {
|
|
12270
12398
|
Read: "read",
|
|
12271
12399
|
Glob: "glob",
|
|
@@ -12419,48 +12547,37 @@ function detectLanguageGlob(itemName) {
|
|
|
12419
12547
|
function determineInclusionMode(item) {
|
|
12420
12548
|
const languageGlob = detectLanguageGlob(item.name);
|
|
12421
12549
|
if (languageGlob) {
|
|
12422
|
-
return { mode: "fileMatch",
|
|
12550
|
+
return { mode: "fileMatch", fileMatchPattern: languageGlob };
|
|
12423
12551
|
}
|
|
12424
12552
|
const fmDescription = String(item.frontmatter.description || "").toLowerCase();
|
|
12425
12553
|
const sortedLangs = Object.keys(LANGUAGE_GLOB_MAP).sort((a3, b3) => b3.length - a3.length);
|
|
12426
12554
|
for (const lang of sortedLangs) {
|
|
12427
12555
|
if (fmDescription.includes(` ${lang} `) || fmDescription.startsWith(`${lang} `) || fmDescription.endsWith(` ${lang}`)) {
|
|
12428
|
-
return { mode: "fileMatch",
|
|
12556
|
+
return { mode: "fileMatch", fileMatchPattern: LANGUAGE_GLOB_MAP[lang] };
|
|
12429
12557
|
}
|
|
12430
12558
|
}
|
|
12431
12559
|
return { mode: "always" };
|
|
12432
12560
|
}
|
|
12433
|
-
function buildSteeringFrontmatter(mode,
|
|
12561
|
+
function buildSteeringFrontmatter(mode, fileMatchPattern) {
|
|
12434
12562
|
const lines = ["---"];
|
|
12435
12563
|
lines.push(`inclusion: ${mode}`);
|
|
12436
|
-
if (mode === "fileMatch" &&
|
|
12437
|
-
lines.push(`
|
|
12564
|
+
if (mode === "fileMatch" && fileMatchPattern) {
|
|
12565
|
+
lines.push(`fileMatchPattern: "${fileMatchPattern}"`);
|
|
12438
12566
|
}
|
|
12439
12567
|
lines.push("---");
|
|
12440
12568
|
return lines.join(`
|
|
12441
12569
|
`);
|
|
12442
12570
|
}
|
|
12443
|
-
function checkUnsupportedFields(item) {
|
|
12444
|
-
const warnings = [];
|
|
12445
|
-
const presentFields = UNSUPPORTED_AGENT_FIELDS.filter((field) => item.frontmatter[field] !== undefined);
|
|
12446
|
-
if (presentFields.length > 0) {
|
|
12447
|
-
warnings.push(`Agent metadata not supported by Kiro (dropped): ${presentFields.join(", ")}`);
|
|
12448
|
-
}
|
|
12449
|
-
return warnings;
|
|
12450
|
-
}
|
|
12451
12571
|
function bodyStartsWithHeading(body) {
|
|
12452
12572
|
const trimmed = body.trimStart();
|
|
12453
12573
|
return /^#{1,6}\s+/.test(trimmed);
|
|
12454
12574
|
}
|
|
12455
12575
|
function convertMdToKiroSteering(item, provider) {
|
|
12456
12576
|
const warnings = [];
|
|
12457
|
-
if (item.type === "agent") {
|
|
12458
|
-
warnings.push(...checkUnsupportedFields(item));
|
|
12459
|
-
}
|
|
12460
12577
|
const stripped = stripClaudeRefs(item.body, { provider });
|
|
12461
12578
|
warnings.push(...stripped.warnings);
|
|
12462
|
-
const { mode,
|
|
12463
|
-
const frontmatter = buildSteeringFrontmatter(mode,
|
|
12579
|
+
const { mode, fileMatchPattern } = determineInclusionMode(item);
|
|
12580
|
+
const frontmatter = buildSteeringFrontmatter(mode, fileMatchPattern);
|
|
12464
12581
|
const heading = item.frontmatter.name || item.name;
|
|
12465
12582
|
const hasExistingHeading = bodyStartsWithHeading(stripped.content);
|
|
12466
12583
|
let content;
|
|
@@ -12477,8 +12594,8 @@ ${stripped.content}
|
|
|
12477
12594
|
${stripped.content}
|
|
12478
12595
|
`;
|
|
12479
12596
|
}
|
|
12480
|
-
if (mode === "fileMatch" &&
|
|
12481
|
-
warnings.push(`Using fileMatch mode with pattern: ${
|
|
12597
|
+
if (mode === "fileMatch" && fileMatchPattern) {
|
|
12598
|
+
warnings.push(`Using fileMatch mode with pattern: ${fileMatchPattern}`);
|
|
12482
12599
|
}
|
|
12483
12600
|
return {
|
|
12484
12601
|
content,
|
|
@@ -12486,7 +12603,7 @@ ${stripped.content}
|
|
|
12486
12603
|
warnings
|
|
12487
12604
|
};
|
|
12488
12605
|
}
|
|
12489
|
-
var LANGUAGE_GLOB_MAP
|
|
12606
|
+
var LANGUAGE_GLOB_MAP;
|
|
12490
12607
|
var init_md_to_kiro_steering = __esm(() => {
|
|
12491
12608
|
init_md_strip();
|
|
12492
12609
|
LANGUAGE_GLOB_MAP = {
|
|
@@ -12510,7 +12627,6 @@ var init_md_to_kiro_steering = __esm(() => {
|
|
|
12510
12627
|
vue: "**/*.vue",
|
|
12511
12628
|
svelte: "**/*.svelte"
|
|
12512
12629
|
};
|
|
12513
|
-
UNSUPPORTED_AGENT_FIELDS = ["model", "tools", "memory", "argumentHint"];
|
|
12514
12630
|
});
|
|
12515
12631
|
|
|
12516
12632
|
// src/commands/portable/converters/md-to-mdc.ts
|
|
@@ -12541,14 +12657,15 @@ var init_md_to_mdc = __esm(() => {
|
|
|
12541
12657
|
});
|
|
12542
12658
|
|
|
12543
12659
|
// src/commands/portable/converters/skill-md.ts
|
|
12544
|
-
function convertToSkillMd(item) {
|
|
12660
|
+
function convertToSkillMd(item, provider, options2 = {}) {
|
|
12545
12661
|
const fm = {
|
|
12546
12662
|
name: item.frontmatter.name || item.name,
|
|
12547
12663
|
description: item.description || ""
|
|
12548
12664
|
};
|
|
12665
|
+
const itemBody = provider === "antigravity" ? rewriteAntigravityPaths(item.body, options2) : item.body;
|
|
12549
12666
|
const body = `# ${fm.name}
|
|
12550
12667
|
|
|
12551
|
-
${
|
|
12668
|
+
${itemBody}`;
|
|
12552
12669
|
const content = import_gray_matter2.default.stringify(body, fm);
|
|
12553
12670
|
return {
|
|
12554
12671
|
content,
|
|
@@ -12558,6 +12675,7 @@ ${item.body}`;
|
|
|
12558
12675
|
}
|
|
12559
12676
|
var import_gray_matter2;
|
|
12560
12677
|
var init_skill_md = __esm(() => {
|
|
12678
|
+
init_direct_copy();
|
|
12561
12679
|
import_gray_matter2 = __toESM(require_gray_matter(), 1);
|
|
12562
12680
|
});
|
|
12563
12681
|
|
|
@@ -12566,7 +12684,7 @@ function convertItem(item, format, provider, options2 = {}) {
|
|
|
12566
12684
|
try {
|
|
12567
12685
|
switch (format) {
|
|
12568
12686
|
case "direct-copy":
|
|
12569
|
-
return convertDirectCopy(item, provider);
|
|
12687
|
+
return convertDirectCopy(item, provider, { global: options2.global });
|
|
12570
12688
|
case "command-to-codex-skill":
|
|
12571
12689
|
return convertCommandToCodexSkill(item);
|
|
12572
12690
|
case "fm-to-fm":
|
|
@@ -12580,7 +12698,7 @@ function convertItem(item, format, provider, options2 = {}) {
|
|
|
12580
12698
|
case "md-to-toml":
|
|
12581
12699
|
return convertMdToToml(item);
|
|
12582
12700
|
case "skill-md":
|
|
12583
|
-
return convertToSkillMd(item);
|
|
12701
|
+
return convertToSkillMd(item, provider, { global: options2.global });
|
|
12584
12702
|
case "md-strip":
|
|
12585
12703
|
return convertMdStrip(item, provider, { global: options2.global });
|
|
12586
12704
|
case "md-to-mdc":
|
|
@@ -51912,7 +52030,7 @@ var init_migrate_provider_scopes = __esm(() => {
|
|
|
51912
52030
|
|
|
51913
52031
|
// src/commands/migrate/skill-directory-installer.ts
|
|
51914
52032
|
import { existsSync as existsSync22 } from "node:fs";
|
|
51915
|
-
import { cp, mkdir as mkdir10, realpath as realpath6, rename as rename6, rm as rm5 } from "node:fs/promises";
|
|
52033
|
+
import { cp, mkdir as mkdir10, readFile as readFile19, realpath as realpath6, rename as rename6, rm as rm5, writeFile as writeFile11 } from "node:fs/promises";
|
|
51916
52034
|
import { dirname as dirname11, join as join40, resolve as resolve15 } from "node:path";
|
|
51917
52035
|
async function canonicalize(path4) {
|
|
51918
52036
|
try {
|
|
@@ -51933,6 +52051,18 @@ async function canonicalize(path4) {
|
|
|
51933
52051
|
}
|
|
51934
52052
|
}
|
|
51935
52053
|
}
|
|
52054
|
+
async function rewriteInstalledSkillMd(targetDir, provider, options2) {
|
|
52055
|
+
if (provider !== "antigravity")
|
|
52056
|
+
return;
|
|
52057
|
+
const skillMdPath = join40(targetDir, "SKILL.md");
|
|
52058
|
+
if (!existsSync22(skillMdPath))
|
|
52059
|
+
return;
|
|
52060
|
+
const content = await readFile19(skillMdPath, "utf-8");
|
|
52061
|
+
const rewritten = rewriteAntigravityPaths(content, { global: options2.global });
|
|
52062
|
+
if (rewritten !== content) {
|
|
52063
|
+
await writeFile11(skillMdPath, rewritten, "utf-8");
|
|
52064
|
+
}
|
|
52065
|
+
}
|
|
51936
52066
|
async function installSkillDirectories(skills, targetProviders, options2) {
|
|
51937
52067
|
const results = [];
|
|
51938
52068
|
for (const provider of targetProviders) {
|
|
@@ -52004,6 +52134,7 @@ async function installSkillDirectories(skills, targetProviders, options2) {
|
|
|
52004
52134
|
try {
|
|
52005
52135
|
await cp(skill.path, targetDir, { recursive: true, force: true });
|
|
52006
52136
|
copied = true;
|
|
52137
|
+
await rewriteInstalledSkillMd(targetDir, provider, options2);
|
|
52007
52138
|
await addPortableInstallation(skill.name, "skill", provider, options2.global, targetDir, skill.path);
|
|
52008
52139
|
} catch (error) {
|
|
52009
52140
|
try {
|
|
@@ -52048,13 +52179,14 @@ async function installSkillDirectories(skills, targetProviders, options2) {
|
|
|
52048
52179
|
return results;
|
|
52049
52180
|
}
|
|
52050
52181
|
var init_skill_directory_installer = __esm(() => {
|
|
52182
|
+
init_direct_copy();
|
|
52051
52183
|
init_portable_registry();
|
|
52052
52184
|
init_provider_registry();
|
|
52053
52185
|
});
|
|
52054
52186
|
|
|
52055
52187
|
// src/commands/portable/config-discovery.ts
|
|
52056
52188
|
import { existsSync as existsSync23, readFileSync as readFileSync6 } from "node:fs";
|
|
52057
|
-
import { cp as cp2, mkdir as mkdir11, readFile as
|
|
52189
|
+
import { cp as cp2, mkdir as mkdir11, readFile as readFile20, readdir as readdir12, stat as stat8 } from "node:fs/promises";
|
|
52058
52190
|
import { homedir as homedir23 } from "node:os";
|
|
52059
52191
|
import { basename as basename13, dirname as dirname12, extname as extname3, join as join41, relative as relative9, resolve as resolve16, sep as sep6 } from "node:path";
|
|
52060
52192
|
async function copyHooksCompanionDirs(sourceDir, targetDir) {
|
|
@@ -52172,7 +52304,7 @@ async function discoverConfig(sourcePath) {
|
|
|
52172
52304
|
if (!existsSync23(path4)) {
|
|
52173
52305
|
return null;
|
|
52174
52306
|
}
|
|
52175
|
-
const content = await
|
|
52307
|
+
const content = await readFile20(path4, "utf-8");
|
|
52176
52308
|
return {
|
|
52177
52309
|
name: "CLAUDE",
|
|
52178
52310
|
description: "Project configuration",
|
|
@@ -52229,7 +52361,7 @@ async function discoverHooks(sourcePath) {
|
|
|
52229
52361
|
continue;
|
|
52230
52362
|
}
|
|
52231
52363
|
try {
|
|
52232
|
-
const content = await
|
|
52364
|
+
const content = await readFile20(file.fullPath, "utf-8");
|
|
52233
52365
|
items.push({
|
|
52234
52366
|
name: file.name,
|
|
52235
52367
|
segments: file.name.split("/"),
|
|
@@ -52258,7 +52390,7 @@ async function readHooksNearHooksDir(hooksDir) {
|
|
|
52258
52390
|
if (!existsSync23(settingsPath))
|
|
52259
52391
|
return null;
|
|
52260
52392
|
try {
|
|
52261
|
-
const parsed = JSON.parse(await
|
|
52393
|
+
const parsed = JSON.parse(await readFile20(settingsPath, "utf-8"));
|
|
52262
52394
|
return parsed.hooks && typeof parsed.hooks === "object" ? parsed.hooks : null;
|
|
52263
52395
|
} catch {
|
|
52264
52396
|
return null;
|
|
@@ -52396,7 +52528,7 @@ async function discoverPortableFiles(dir, baseDir, options2) {
|
|
|
52396
52528
|
const normalizedPath = relPath.split(/[/\\]/).join("/");
|
|
52397
52529
|
const name = options2.stripExtension ? normalizedPath.replace(/\.[^.]+$/, "") : normalizedPath;
|
|
52398
52530
|
try {
|
|
52399
|
-
const content = await
|
|
52531
|
+
const content = await readFile20(fullPath, "utf-8");
|
|
52400
52532
|
items.push({
|
|
52401
52533
|
name,
|
|
52402
52534
|
description: `${options2.descriptionPrefix}: ${name}`,
|
|
@@ -54407,7 +54539,7 @@ var init_codex_path_safety = __esm(() => {
|
|
|
54407
54539
|
|
|
54408
54540
|
// src/commands/portable/codex-features-flag.ts
|
|
54409
54541
|
import { existsSync as existsSync25 } from "node:fs";
|
|
54410
|
-
import { readFile as
|
|
54542
|
+
import { readFile as readFile21, rename as rename7, unlink as unlink6, writeFile as writeFile12 } from "node:fs/promises";
|
|
54411
54543
|
import { dirname as dirname14, resolve as resolve18 } from "node:path";
|
|
54412
54544
|
async function ensureCodexHooksFeatureFlag(configTomlPath, isGlobal = false) {
|
|
54413
54545
|
const boundary = isGlobal ? getCodexGlobalBoundary() : dirname14(resolve18(configTomlPath));
|
|
@@ -54424,7 +54556,7 @@ async function _ensureFeatureFlagLocked(configTomlPath) {
|
|
|
54424
54556
|
let existing = "";
|
|
54425
54557
|
if (existsSync25(configTomlPath)) {
|
|
54426
54558
|
try {
|
|
54427
|
-
existing = await
|
|
54559
|
+
existing = await readFile21(configTomlPath, "utf8");
|
|
54428
54560
|
} catch (err) {
|
|
54429
54561
|
return {
|
|
54430
54562
|
status: "failed",
|
|
@@ -54556,7 +54688,7 @@ function stripAllManagedBlocks(content) {
|
|
|
54556
54688
|
async function atomicWrite(filePath, content) {
|
|
54557
54689
|
const tempPath = `${filePath}.ck-tmp`;
|
|
54558
54690
|
try {
|
|
54559
|
-
await
|
|
54691
|
+
await writeFile12(tempPath, content, "utf8");
|
|
54560
54692
|
await rename7(tempPath, filePath);
|
|
54561
54693
|
} catch (err) {
|
|
54562
54694
|
try {
|
|
@@ -55004,7 +55136,7 @@ var init_gemini_hook_event_map = __esm(() => {
|
|
|
55004
55136
|
|
|
55005
55137
|
// src/commands/portable/hooks-settings-merger.ts
|
|
55006
55138
|
import { existsSync as existsSync26 } from "node:fs";
|
|
55007
|
-
import { mkdir as mkdir13, readFile as
|
|
55139
|
+
import { mkdir as mkdir13, readFile as readFile22, rename as rename8, rm as rm6, writeFile as writeFile13 } from "node:fs/promises";
|
|
55008
55140
|
import { homedir as homedir26 } from "node:os";
|
|
55009
55141
|
import { basename as basename14, dirname as dirname16, extname as extname4, join as join44, resolve as resolve20 } from "node:path";
|
|
55010
55142
|
function isCodexWrappableHookPath(filePath) {
|
|
@@ -55047,7 +55179,7 @@ async function inspectHooksSettings(settingsPath) {
|
|
|
55047
55179
|
if (!existsSync26(settingsPath)) {
|
|
55048
55180
|
return { status: "missing-file" };
|
|
55049
55181
|
}
|
|
55050
|
-
const raw = await
|
|
55182
|
+
const raw = await readFile22(settingsPath, "utf8");
|
|
55051
55183
|
const parsed = JSON.parse(raw);
|
|
55052
55184
|
if (!parsed.hooks || typeof parsed.hooks !== "object") {
|
|
55053
55185
|
return { status: "missing-hooks" };
|
|
@@ -55160,7 +55292,7 @@ async function mergeHooksIntoSettings(targetSettingsPath, newHooks, options2 = {
|
|
|
55160
55292
|
let existingSettings = {};
|
|
55161
55293
|
let backupPath = null;
|
|
55162
55294
|
if (existsSync26(targetSettingsPath)) {
|
|
55163
|
-
const raw = await
|
|
55295
|
+
const raw = await readFile22(targetSettingsPath, "utf8");
|
|
55164
55296
|
try {
|
|
55165
55297
|
existingSettings = JSON.parse(raw);
|
|
55166
55298
|
} catch {
|
|
@@ -55169,7 +55301,7 @@ async function mergeHooksIntoSettings(targetSettingsPath, newHooks, options2 = {
|
|
|
55169
55301
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
55170
55302
|
backupPath = `${targetSettingsPath}.${timestamp}.bak`;
|
|
55171
55303
|
try {
|
|
55172
|
-
await
|
|
55304
|
+
await writeFile13(backupPath, raw, "utf8");
|
|
55173
55305
|
} catch {
|
|
55174
55306
|
backupPath = null;
|
|
55175
55307
|
}
|
|
@@ -55186,7 +55318,7 @@ async function mergeHooksIntoSettings(targetSettingsPath, newHooks, options2 = {
|
|
|
55186
55318
|
await mkdir13(dir, { recursive: true });
|
|
55187
55319
|
const tempPath = `${targetSettingsPath}.tmp`;
|
|
55188
55320
|
try {
|
|
55189
|
-
await
|
|
55321
|
+
await writeFile13(tempPath, JSON.stringify(existingSettings, null, 2), "utf8");
|
|
55190
55322
|
await rename8(tempPath, targetSettingsPath);
|
|
55191
55323
|
} catch (err) {
|
|
55192
55324
|
await rm6(tempPath, { force: true });
|
|
@@ -55740,7 +55872,7 @@ var init_generated_context_hooks = __esm(() => {
|
|
|
55740
55872
|
|
|
55741
55873
|
// src/commands/portable/migrated-hook-settings-cleanup.ts
|
|
55742
55874
|
import { existsSync as existsSync27, realpathSync } from "node:fs";
|
|
55743
|
-
import { readFile as
|
|
55875
|
+
import { readFile as readFile23, rename as rename9, rm as rm7, unlink as unlink7, writeFile as writeFile14 } from "node:fs/promises";
|
|
55744
55876
|
import { basename as basename16, isAbsolute as isAbsolute6, relative as relative10, resolve as resolve21 } from "node:path";
|
|
55745
55877
|
async function pruneSettingsHooks(settingsPath, hooksDir) {
|
|
55746
55878
|
const filesToRemove = new Set;
|
|
@@ -55749,7 +55881,7 @@ async function pruneSettingsHooks(settingsPath, hooksDir) {
|
|
|
55749
55881
|
return { hooksPruned: 0, filesToRemove, warnings };
|
|
55750
55882
|
let parsed;
|
|
55751
55883
|
try {
|
|
55752
|
-
parsed = JSON.parse(await
|
|
55884
|
+
parsed = JSON.parse(await readFile23(settingsPath, "utf8"));
|
|
55753
55885
|
} catch (error) {
|
|
55754
55886
|
warnings.push(`Could not parse ${settingsPath}; hook cleanup skipped (${error instanceof Error ? error.message : String(error)})`);
|
|
55755
55887
|
return { hooksPruned: 0, filesToRemove, warnings };
|
|
@@ -55851,7 +55983,7 @@ function resolvePathForContainment(pathValue) {
|
|
|
55851
55983
|
async function atomicWrite2(filePath, content) {
|
|
55852
55984
|
const tempPath = `${filePath}.ck-tmp`;
|
|
55853
55985
|
try {
|
|
55854
|
-
await
|
|
55986
|
+
await writeFile14(tempPath, `${content}
|
|
55855
55987
|
`, "utf8");
|
|
55856
55988
|
await rename9(tempPath, filePath);
|
|
55857
55989
|
} catch (error) {
|
|
@@ -55938,7 +56070,7 @@ var init_migrated_hooks_cleanup = __esm(() => {
|
|
|
55938
56070
|
|
|
55939
56071
|
// src/commands/portable/portable-manifest.ts
|
|
55940
56072
|
import { existsSync as existsSync28 } from "node:fs";
|
|
55941
|
-
import { readFile as
|
|
56073
|
+
import { readFile as readFile24 } from "node:fs/promises";
|
|
55942
56074
|
import path4 from "node:path";
|
|
55943
56075
|
async function loadPortableManifest(kitPath) {
|
|
55944
56076
|
const manifestPath = path4.join(kitPath, "portable-manifest.json");
|
|
@@ -55947,7 +56079,7 @@ async function loadPortableManifest(kitPath) {
|
|
|
55947
56079
|
logger.verbose("No portable-manifest.json found — no evolution tracking");
|
|
55948
56080
|
return null;
|
|
55949
56081
|
}
|
|
55950
|
-
const raw = await
|
|
56082
|
+
const raw = await readFile24(manifestPath, "utf-8");
|
|
55951
56083
|
let parsed;
|
|
55952
56084
|
try {
|
|
55953
56085
|
parsed = JSON.parse(raw);
|
|
@@ -56059,7 +56191,7 @@ var init_reconcile_registry_backfill = __esm(() => {
|
|
|
56059
56191
|
|
|
56060
56192
|
// src/commands/portable/reconcile-state-builders.ts
|
|
56061
56193
|
import { existsSync as existsSync29, readdirSync as readdirSync3, statSync as statSync5 } from "node:fs";
|
|
56062
|
-
import { readFile as
|
|
56194
|
+
import { readFile as readFile25 } from "node:fs/promises";
|
|
56063
56195
|
function getProviderPathKeyForPortableType2(type) {
|
|
56064
56196
|
switch (type) {
|
|
56065
56197
|
case "agent":
|
|
@@ -56260,7 +56392,7 @@ async function buildTargetStates(entries, options2) {
|
|
|
56260
56392
|
const state = { path: entryPath, exists };
|
|
56261
56393
|
if (exists) {
|
|
56262
56394
|
try {
|
|
56263
|
-
const content = await
|
|
56395
|
+
const content = await readFile25(entryPath, "utf-8");
|
|
56264
56396
|
state.currentChecksum = computeContentChecksum(content);
|
|
56265
56397
|
if (groupedEntries.some((entry) => usesMergeSingleChecksums(entry))) {
|
|
56266
56398
|
state.sectionChecksums = computeManagedSectionChecksums(content);
|
|
@@ -56881,7 +57013,7 @@ function detectPathMigrations(input) {
|
|
|
56881
57013
|
const actions = [];
|
|
56882
57014
|
const activeProviderConfigs = dedupeProviderConfigs(input.providerConfigs);
|
|
56883
57015
|
for (const migration of migrations) {
|
|
56884
|
-
const affectedEntries = input.registry.installations.filter((e2) => e2.provider === migration.provider && e2.type === migration.type && pathContainsSegments(e2.path, migration.from) && providerConfigIsActiveForEntry(activeProviderConfigs, e2, { emptyMeansAll: true }));
|
|
57016
|
+
const affectedEntries = input.registry.installations.filter((e2) => e2.provider === migration.provider && e2.type === migration.type && e2.installSource !== "manual" && pathContainsSegments(e2.path, migration.from) && providerConfigIsActiveForEntry(activeProviderConfigs, e2, { emptyMeansAll: true }));
|
|
56885
57017
|
for (const entry of affectedEntries) {
|
|
56886
57018
|
const code = "path-migrated-cleanup";
|
|
56887
57019
|
actions.push({
|
|
@@ -56926,6 +57058,36 @@ var init_reconciler = __esm(() => {
|
|
|
56926
57058
|
type: "command",
|
|
56927
57059
|
from: ".codex/prompts",
|
|
56928
57060
|
to: ".agents/skills"
|
|
57061
|
+
},
|
|
57062
|
+
{
|
|
57063
|
+
provider: "antigravity",
|
|
57064
|
+
type: "command",
|
|
57065
|
+
from: ".agent/workflows",
|
|
57066
|
+
to: ".agents/workflows"
|
|
57067
|
+
},
|
|
57068
|
+
{
|
|
57069
|
+
provider: "antigravity",
|
|
57070
|
+
type: "skill",
|
|
57071
|
+
from: ".agent/skills",
|
|
57072
|
+
to: ".agents/skills"
|
|
57073
|
+
},
|
|
57074
|
+
{
|
|
57075
|
+
provider: "antigravity",
|
|
57076
|
+
type: "agent",
|
|
57077
|
+
from: ".agent/skills",
|
|
57078
|
+
to: ".agents/agents.md"
|
|
57079
|
+
},
|
|
57080
|
+
{
|
|
57081
|
+
provider: "antigravity",
|
|
57082
|
+
type: "skill",
|
|
57083
|
+
from: ".gemini/antigravity/skills",
|
|
57084
|
+
to: ".gemini/config/skills"
|
|
57085
|
+
},
|
|
57086
|
+
{
|
|
57087
|
+
provider: "antigravity",
|
|
57088
|
+
type: "rules",
|
|
57089
|
+
from: ".agent/rules",
|
|
57090
|
+
to: ".agents/rules"
|
|
56929
57091
|
}
|
|
56930
57092
|
];
|
|
56931
57093
|
});
|
|
@@ -57087,7 +57249,7 @@ __export(exports_skills_discovery, {
|
|
|
57087
57249
|
discoverSkillsEnriched: () => discoverSkillsEnriched,
|
|
57088
57250
|
discoverSkills: () => discoverSkills
|
|
57089
57251
|
});
|
|
57090
|
-
import { readFile as
|
|
57252
|
+
import { readFile as readFile26, readdir as readdir13, stat as stat9 } from "node:fs/promises";
|
|
57091
57253
|
import { homedir as homedir27 } from "node:os";
|
|
57092
57254
|
import { dirname as dirname17, join as join45 } from "node:path";
|
|
57093
57255
|
function getSkillSourcePath(globalOnly = false) {
|
|
@@ -57114,7 +57276,7 @@ async function hasSkillMd(dir) {
|
|
|
57114
57276
|
}
|
|
57115
57277
|
async function parseSkillMd(skillMdPath) {
|
|
57116
57278
|
try {
|
|
57117
|
-
const content = await
|
|
57279
|
+
const content = await readFile26(skillMdPath, "utf-8");
|
|
57118
57280
|
const { data } = import_gray_matter5.default(content, { engines: { javascript: { parse: () => ({}) } } });
|
|
57119
57281
|
const skillDir = dirname17(skillMdPath);
|
|
57120
57282
|
const dirName = skillDir.split(/[/\\]/).pop() || "";
|
|
@@ -57187,7 +57349,7 @@ async function discoverSkillsEnriched(sourcePath) {
|
|
|
57187
57349
|
for (const skill of base) {
|
|
57188
57350
|
const skillMdPath = join45(skill.path, "SKILL.md");
|
|
57189
57351
|
try {
|
|
57190
|
-
const content = await
|
|
57352
|
+
const content = await readFile26(skillMdPath, "utf-8");
|
|
57191
57353
|
const { data, content: body } = import_gray_matter5.default(content, {
|
|
57192
57354
|
engines: { javascript: { parse: () => ({}) } }
|
|
57193
57355
|
});
|
|
@@ -57331,7 +57493,7 @@ var init_migration_result_utils = __esm(() => {
|
|
|
57331
57493
|
|
|
57332
57494
|
// src/domains/web-server/routes/migration-routes.ts
|
|
57333
57495
|
import { existsSync as existsSync30 } from "node:fs";
|
|
57334
|
-
import { readFile as
|
|
57496
|
+
import { readFile as readFile27, rm as rm8 } from "node:fs/promises";
|
|
57335
57497
|
import { homedir as homedir28 } from "node:os";
|
|
57336
57498
|
import { basename as basename17, join as join46, resolve as resolve23 } from "node:path";
|
|
57337
57499
|
function resolveRegistryDeps(deps) {
|
|
@@ -57593,6 +57755,40 @@ async function executePlanDeleteAction(action, options2) {
|
|
|
57593
57755
|
};
|
|
57594
57756
|
}
|
|
57595
57757
|
}
|
|
57758
|
+
function hasSuccessfulReplacementWriteForDelete(action, results) {
|
|
57759
|
+
return results.some((result) => result.success && !result.skipped && result.provider === action.provider && replacementTypeMatchesForDelete(action.type, result.portableType) && replacementItemMatchesForDelete(action, result) && result.path.length > 0 && resolve23(result.path) !== resolve23(action.targetPath));
|
|
57760
|
+
}
|
|
57761
|
+
function replacementTypeMatchesForDelete(actionType, resultType) {
|
|
57762
|
+
return resultType === actionType || actionType === "command" && resultType === "skill";
|
|
57763
|
+
}
|
|
57764
|
+
function replacementItemMatchesForDelete(action, result) {
|
|
57765
|
+
if (result.itemName === action.item || result.itemName === undefined)
|
|
57766
|
+
return true;
|
|
57767
|
+
const parts = result.path.replace(/\\/g, "/").split("/");
|
|
57768
|
+
const leaf = parts.at(-1) ?? "";
|
|
57769
|
+
const parent = parts.at(-2) ?? "";
|
|
57770
|
+
const leafName = leaf.replace(/\.[^.]+$/, "");
|
|
57771
|
+
return leafName === action.item || parent === action.item || action.type === "command" && parent === `source-command-${action.item}`;
|
|
57772
|
+
}
|
|
57773
|
+
function shouldRunPlanDeleteAction(action, results) {
|
|
57774
|
+
if (action.reasonCode !== "path-migrated-cleanup")
|
|
57775
|
+
return true;
|
|
57776
|
+
return hasSuccessfulReplacementWriteForDelete(action, results);
|
|
57777
|
+
}
|
|
57778
|
+
function createSkippedPathMigrationCleanupResult(action) {
|
|
57779
|
+
const provider = action.provider;
|
|
57780
|
+
return {
|
|
57781
|
+
operation: "delete",
|
|
57782
|
+
portableType: action.type,
|
|
57783
|
+
itemName: action.item,
|
|
57784
|
+
provider,
|
|
57785
|
+
providerDisplayName: providers[provider]?.displayName || action.provider,
|
|
57786
|
+
success: true,
|
|
57787
|
+
path: action.targetPath,
|
|
57788
|
+
skipped: true,
|
|
57789
|
+
skipReason: "Legacy path cleanup skipped because no successful replacement write was recorded"
|
|
57790
|
+
};
|
|
57791
|
+
}
|
|
57596
57792
|
function countEnabledTypes(include) {
|
|
57597
57793
|
return MIGRATION_TYPES.filter((type) => include[type]).length;
|
|
57598
57794
|
}
|
|
@@ -58131,9 +58327,9 @@ function registerMigrationRoutes(app, deps) {
|
|
|
58131
58327
|
const readmePath = `${skill.path}/README.md`;
|
|
58132
58328
|
let content;
|
|
58133
58329
|
if (existsSync30(skillMdPath)) {
|
|
58134
|
-
content = await
|
|
58330
|
+
content = await readFile27(skillMdPath, "utf-8");
|
|
58135
58331
|
} else if (existsSync30(readmePath)) {
|
|
58136
|
-
content = await
|
|
58332
|
+
content = await readFile27(readmePath, "utf-8");
|
|
58137
58333
|
} else {
|
|
58138
58334
|
console.warn(`[migrate] Skill "${sanitizeUntrusted(skill.name, 80)}" has neither SKILL.md nor README.md, skipping`);
|
|
58139
58335
|
continue;
|
|
@@ -58559,6 +58755,16 @@ function registerMigrationRoutes(app, deps) {
|
|
|
58559
58755
|
}
|
|
58560
58756
|
const writtenPaths = new Set(allResults.filter((r2) => r2.success && !r2.skipped && r2.path.length > 0).map((r2) => resolve23(r2.path)));
|
|
58561
58757
|
for (const deleteAction of deleteActions) {
|
|
58758
|
+
if (!shouldRunPlanDeleteAction(deleteAction, allResults)) {
|
|
58759
|
+
const skippedDelete = createSkippedPathMigrationCleanupResult({
|
|
58760
|
+
item: deleteAction.item,
|
|
58761
|
+
type: deleteAction.type,
|
|
58762
|
+
provider: deleteAction.provider,
|
|
58763
|
+
targetPath: deleteAction.targetPath
|
|
58764
|
+
});
|
|
58765
|
+
allResults.push(skippedDelete);
|
|
58766
|
+
continue;
|
|
58767
|
+
}
|
|
58562
58768
|
const deleteResult = await executePlanDeleteAction(deleteAction, {
|
|
58563
58769
|
preservePaths: writtenPaths,
|
|
58564
58770
|
removePortableInstallation: registryDeps.removePortableInstallation
|
|
@@ -61314,7 +61520,7 @@ var init_project_plan_data = __esm(() => {
|
|
|
61314
61520
|
|
|
61315
61521
|
// src/domains/web-server/routes/project-routes.ts
|
|
61316
61522
|
import { existsSync as existsSync37 } from "node:fs";
|
|
61317
|
-
import { readFile as
|
|
61523
|
+
import { readFile as readFile28 } from "node:fs/promises";
|
|
61318
61524
|
import { homedir as homedir31 } from "node:os";
|
|
61319
61525
|
import { basename as basename21, join as join55, resolve as resolve28 } from "node:path";
|
|
61320
61526
|
function registerProjectRoutes(app) {
|
|
@@ -61557,7 +61763,7 @@ async function buildProjectInfoFromRegistry(registered, cachedSettings, cachedSk
|
|
|
61557
61763
|
let metadata = {};
|
|
61558
61764
|
try {
|
|
61559
61765
|
if (hasClaudeDir && existsSync37(metadataPath)) {
|
|
61560
|
-
const content = await
|
|
61766
|
+
const content = await readFile28(metadataPath, "utf-8");
|
|
61561
61767
|
try {
|
|
61562
61768
|
metadata = JSON.parse(content);
|
|
61563
61769
|
} catch {}
|
|
@@ -61599,7 +61805,7 @@ async function detectAndBuildProjectInfo(path6, id, cachedSettings, cachedSkills
|
|
|
61599
61805
|
let metadata = {};
|
|
61600
61806
|
try {
|
|
61601
61807
|
if (existsSync37(metadataPath)) {
|
|
61602
|
-
const content = await
|
|
61808
|
+
const content = await readFile28(metadataPath, "utf-8");
|
|
61603
61809
|
try {
|
|
61604
61810
|
metadata = JSON.parse(content);
|
|
61605
61811
|
} catch {}
|
|
@@ -61655,7 +61861,7 @@ var init_project_routes = __esm(() => {
|
|
|
61655
61861
|
|
|
61656
61862
|
// src/domains/web-server/routes/session-routes.ts
|
|
61657
61863
|
import { existsSync as existsSync38 } from "node:fs";
|
|
61658
|
-
import { readFile as
|
|
61864
|
+
import { readFile as readFile29, readdir as readdir14, stat as stat10 } from "node:fs/promises";
|
|
61659
61865
|
import { homedir as homedir32 } from "node:os";
|
|
61660
61866
|
import { basename as basename22, join as join56 } from "node:path";
|
|
61661
61867
|
function toDateStr(d3) {
|
|
@@ -61814,7 +62020,7 @@ async function parseSessionDetail(filePath, limit, offset) {
|
|
|
61814
62020
|
summary: { messageCount: 0, toolCallCount: 0 }
|
|
61815
62021
|
};
|
|
61816
62022
|
}
|
|
61817
|
-
const raw = await
|
|
62023
|
+
const raw = await readFile29(filePath, "utf-8");
|
|
61818
62024
|
const lines = raw.split(`
|
|
61819
62025
|
`).filter((l2) => l2.trim());
|
|
61820
62026
|
const toolResultsMap = new Map;
|
|
@@ -62132,7 +62338,7 @@ var init_settings_routes = __esm(() => {
|
|
|
62132
62338
|
});
|
|
62133
62339
|
|
|
62134
62340
|
// src/domains/skills/skill-catalog-generator.ts
|
|
62135
|
-
import { mkdir as mkdir14, readFile as
|
|
62341
|
+
import { mkdir as mkdir14, readFile as readFile30, readdir as readdir15, rename as rename10, stat as stat11, writeFile as writeFile15 } from "node:fs/promises";
|
|
62136
62342
|
import { homedir as homedir34 } from "node:os";
|
|
62137
62343
|
import { dirname as dirname25, join as join57, relative as relative15 } from "node:path";
|
|
62138
62344
|
async function hasScripts(skillPath) {
|
|
@@ -62203,13 +62409,13 @@ class SkillCatalogGenerator {
|
|
|
62203
62409
|
await mkdir14(dirname25(CATALOG_PATH), { recursive: true });
|
|
62204
62410
|
const tmpPath = `${CATALOG_PATH}.tmp`;
|
|
62205
62411
|
const json = JSON.stringify(catalog, null, 2);
|
|
62206
|
-
await
|
|
62412
|
+
await writeFile15(tmpPath, json, "utf-8");
|
|
62207
62413
|
await rename10(tmpPath, CATALOG_PATH);
|
|
62208
62414
|
logger.verbose(`Catalog written: ${catalog.skillCount} skills`);
|
|
62209
62415
|
}
|
|
62210
62416
|
async read() {
|
|
62211
62417
|
try {
|
|
62212
|
-
const content = await
|
|
62418
|
+
const content = await readFile30(CATALOG_PATH, "utf-8");
|
|
62213
62419
|
const parsed = JSON.parse(content);
|
|
62214
62420
|
if (parsed.version !== CATALOG_VERSION) {
|
|
62215
62421
|
logger.verbose(`Catalog version mismatch (${parsed.version} vs ${CATALOG_VERSION})`);
|
|
@@ -62671,9 +62877,18 @@ var init_agents = __esm(() => {
|
|
|
62671
62877
|
antigravity: {
|
|
62672
62878
|
name: "antigravity",
|
|
62673
62879
|
displayName: "Antigravity",
|
|
62674
|
-
projectPath: ".
|
|
62675
|
-
globalPath: join59(home3, ".gemini/
|
|
62676
|
-
detect: async () =>
|
|
62880
|
+
projectPath: ".agents/skills",
|
|
62881
|
+
globalPath: join59(home3, ".gemini/config/skills"),
|
|
62882
|
+
detect: async () => hasAnyInstallSignal2([
|
|
62883
|
+
join59(process.cwd(), ".agents/skills"),
|
|
62884
|
+
join59(process.cwd(), ".agents/rules"),
|
|
62885
|
+
join59(process.cwd(), ".agents/plugins"),
|
|
62886
|
+
join59(process.cwd(), ".agent/skills"),
|
|
62887
|
+
join59(process.cwd(), ".agent/rules"),
|
|
62888
|
+
join59(home3, ".gemini/config/skills"),
|
|
62889
|
+
join59(home3, ".gemini/config/plugins"),
|
|
62890
|
+
join59(home3, ".gemini/antigravity/skills")
|
|
62891
|
+
])
|
|
62677
62892
|
},
|
|
62678
62893
|
"github-copilot": {
|
|
62679
62894
|
name: "github-copilot",
|
|
@@ -62696,6 +62911,22 @@ var init_agents = __esm(() => {
|
|
|
62696
62911
|
globalPath: join59(home3, ".kilocode/skills"),
|
|
62697
62912
|
detect: async () => existsSync39(join59(home3, ".kilocode"))
|
|
62698
62913
|
},
|
|
62914
|
+
kiro: {
|
|
62915
|
+
name: "kiro",
|
|
62916
|
+
displayName: "Kiro",
|
|
62917
|
+
projectPath: ".kiro/skills",
|
|
62918
|
+
globalPath: join59(home3, ".kiro/skills"),
|
|
62919
|
+
detect: async () => hasAnyInstallSignal2([
|
|
62920
|
+
join59(process.cwd(), ".kiro/skills"),
|
|
62921
|
+
join59(process.cwd(), ".kiro/steering"),
|
|
62922
|
+
join59(process.cwd(), ".kiro/agents"),
|
|
62923
|
+
join59(process.cwd(), ".kiro/settings/mcp.json"),
|
|
62924
|
+
join59(home3, ".kiro/skills"),
|
|
62925
|
+
join59(home3, ".kiro/steering"),
|
|
62926
|
+
join59(home3, ".kiro/agents"),
|
|
62927
|
+
join59(home3, ".kiro/settings/mcp.json")
|
|
62928
|
+
])
|
|
62929
|
+
},
|
|
62699
62930
|
roo: {
|
|
62700
62931
|
name: "roo",
|
|
62701
62932
|
displayName: "Roo Code",
|
|
@@ -62729,9 +62960,9 @@ var init_agents = __esm(() => {
|
|
|
62729
62960
|
|
|
62730
62961
|
// src/commands/skills/skills-registry.ts
|
|
62731
62962
|
import { existsSync as existsSync40 } from "node:fs";
|
|
62732
|
-
import { mkdir as mkdir15, readFile as
|
|
62963
|
+
import { mkdir as mkdir15, readFile as readFile32, writeFile as writeFile16 } from "node:fs/promises";
|
|
62733
62964
|
import { homedir as homedir37 } from "node:os";
|
|
62734
|
-
import { dirname as dirname26, join as join60
|
|
62965
|
+
import { dirname as dirname26, join as join60 } from "node:path";
|
|
62735
62966
|
function getCliVersion3() {
|
|
62736
62967
|
try {
|
|
62737
62968
|
if (process.env.npm_package_version) {
|
|
@@ -62748,12 +62979,40 @@ function getCliVersion3() {
|
|
|
62748
62979
|
return "unknown";
|
|
62749
62980
|
}
|
|
62750
62981
|
}
|
|
62982
|
+
function migratePathBySegments(pathValue, oldPath, newPath) {
|
|
62983
|
+
const usesBackslash = pathValue.includes("\\") && !pathValue.includes("/");
|
|
62984
|
+
const separator = usesBackslash ? "\\" : "/";
|
|
62985
|
+
const normalized = pathValue.replace(/\\/g, "/");
|
|
62986
|
+
const oldSegments = oldPath.split("/").filter(Boolean);
|
|
62987
|
+
const newSegments = newPath.split("/").filter(Boolean);
|
|
62988
|
+
const segments = normalized.split("/").filter((segment, index) => index > 0 || segment !== "");
|
|
62989
|
+
for (let i = 0;i <= segments.length - oldSegments.length; i++) {
|
|
62990
|
+
let matches = true;
|
|
62991
|
+
for (let j2 = 0;j2 < oldSegments.length; j2++) {
|
|
62992
|
+
if (segments[i + j2] !== oldSegments[j2]) {
|
|
62993
|
+
matches = false;
|
|
62994
|
+
break;
|
|
62995
|
+
}
|
|
62996
|
+
}
|
|
62997
|
+
if (!matches)
|
|
62998
|
+
continue;
|
|
62999
|
+
const migratedSegments = [
|
|
63000
|
+
...segments.slice(0, i),
|
|
63001
|
+
...newSegments,
|
|
63002
|
+
...segments.slice(i + oldSegments.length)
|
|
63003
|
+
];
|
|
63004
|
+
const prefix = normalized.startsWith("/") ? separator : "";
|
|
63005
|
+
return `${prefix}${migratedSegments.join(separator)}`;
|
|
63006
|
+
}
|
|
63007
|
+
return null;
|
|
63008
|
+
}
|
|
62751
63009
|
function migrateRegistryPaths(registry) {
|
|
62752
63010
|
let changed = false;
|
|
62753
63011
|
for (const entry of registry.installations) {
|
|
62754
63012
|
for (const migration of REGISTRY_PATH_MIGRATIONS) {
|
|
62755
|
-
|
|
62756
|
-
|
|
63013
|
+
const migratedPath = entry.agent === migration.agent ? migratePathBySegments(entry.path, migration.oldPath, migration.newPath) : null;
|
|
63014
|
+
if (migratedPath) {
|
|
63015
|
+
entry.path = migratedPath;
|
|
62757
63016
|
changed = true;
|
|
62758
63017
|
break;
|
|
62759
63018
|
}
|
|
@@ -62766,12 +63025,12 @@ async function readRegistry2() {
|
|
|
62766
63025
|
if (!existsSync40(REGISTRY_PATH)) {
|
|
62767
63026
|
return { version: "1.0", installations: [] };
|
|
62768
63027
|
}
|
|
62769
|
-
const content = await
|
|
63028
|
+
const content = await readFile32(REGISTRY_PATH, "utf-8");
|
|
62770
63029
|
const data = JSON.parse(content);
|
|
62771
63030
|
const registry = SkillRegistrySchema.parse(data);
|
|
62772
63031
|
if (migrateRegistryPaths(registry)) {
|
|
62773
63032
|
try {
|
|
62774
|
-
await
|
|
63033
|
+
await writeFile16(REGISTRY_PATH, JSON.stringify(registry, null, 2), "utf-8");
|
|
62775
63034
|
} catch {}
|
|
62776
63035
|
}
|
|
62777
63036
|
return registry;
|
|
@@ -62787,7 +63046,7 @@ async function writeRegistry2(registry) {
|
|
|
62787
63046
|
if (!existsSync40(dir)) {
|
|
62788
63047
|
await mkdir15(dir, { recursive: true });
|
|
62789
63048
|
}
|
|
62790
|
-
await
|
|
63049
|
+
await writeFile16(REGISTRY_PATH, JSON.stringify(registry, null, 2), "utf-8");
|
|
62791
63050
|
}
|
|
62792
63051
|
async function addInstallation(skill, agent, global3, path7, sourcePath) {
|
|
62793
63052
|
const registry = await readRegistry2();
|
|
@@ -62860,20 +63119,25 @@ var init_skills_registry = __esm(() => {
|
|
|
62860
63119
|
REGISTRY_PATH_MIGRATIONS = [
|
|
62861
63120
|
{
|
|
62862
63121
|
agent: "gemini-cli",
|
|
62863
|
-
|
|
62864
|
-
|
|
63122
|
+
oldPath: ".gemini/skills",
|
|
63123
|
+
newPath: ".agents/skills"
|
|
62865
63124
|
},
|
|
62866
63125
|
{
|
|
62867
|
-
agent: "
|
|
62868
|
-
|
|
62869
|
-
|
|
63126
|
+
agent: "antigravity",
|
|
63127
|
+
oldPath: ".agent/skills",
|
|
63128
|
+
newPath: ".agents/skills"
|
|
63129
|
+
},
|
|
63130
|
+
{
|
|
63131
|
+
agent: "antigravity",
|
|
63132
|
+
oldPath: ".gemini/antigravity/skills",
|
|
63133
|
+
newPath: ".gemini/config/skills"
|
|
62870
63134
|
}
|
|
62871
63135
|
];
|
|
62872
63136
|
});
|
|
62873
63137
|
|
|
62874
63138
|
// src/commands/skills/skills-installer.ts
|
|
62875
63139
|
import { existsSync as existsSync41 } from "node:fs";
|
|
62876
|
-
import { cp as cp3, mkdir as mkdir16, rm as rm9, stat as stat12 } from "node:fs/promises";
|
|
63140
|
+
import { cp as cp3, mkdir as mkdir16, readFile as readFile33, rm as rm9, stat as stat12, writeFile as writeFile17 } from "node:fs/promises";
|
|
62877
63141
|
import { homedir as homedir38 } from "node:os";
|
|
62878
63142
|
import { dirname as dirname27, join as join61, resolve as resolve30 } from "node:path";
|
|
62879
63143
|
function isSamePath2(path1, path22) {
|
|
@@ -62926,6 +63190,18 @@ async function cleanupLegacySkillPath(skillName, agent, global3) {
|
|
|
62926
63190
|
await writeRegistry2(registry);
|
|
62927
63191
|
}
|
|
62928
63192
|
}
|
|
63193
|
+
async function rewriteInstalledSkillMd2(targetPath, agent, options2) {
|
|
63194
|
+
if (agent !== "antigravity")
|
|
63195
|
+
return;
|
|
63196
|
+
const skillMdPath = join61(targetPath, "SKILL.md");
|
|
63197
|
+
if (!existsSync41(skillMdPath))
|
|
63198
|
+
return;
|
|
63199
|
+
const content = await readFile33(skillMdPath, "utf-8");
|
|
63200
|
+
const rewritten = rewriteAntigravityPaths(content, { global: options2.global });
|
|
63201
|
+
if (rewritten !== content) {
|
|
63202
|
+
await writeFile17(skillMdPath, rewritten, "utf-8");
|
|
63203
|
+
}
|
|
63204
|
+
}
|
|
62929
63205
|
async function installSkillForAgent(skill, agent, options2) {
|
|
62930
63206
|
const agentConfig = agents[agent];
|
|
62931
63207
|
const targetPath = getInstallPath(skill.name, agent, options2);
|
|
@@ -62964,6 +63240,7 @@ async function installSkillForAgent(skill, agent, options2) {
|
|
|
62964
63240
|
recursive: true,
|
|
62965
63241
|
force: true
|
|
62966
63242
|
});
|
|
63243
|
+
await rewriteInstalledSkillMd2(targetPath, agent, options2);
|
|
62967
63244
|
await addInstallation(skill.name, agent, options2.global, targetPath, skill.path);
|
|
62968
63245
|
return {
|
|
62969
63246
|
agent,
|
|
@@ -63000,12 +63277,17 @@ function getInstallPreview(skill, targetAgents, options2) {
|
|
|
63000
63277
|
}
|
|
63001
63278
|
var LEGACY_SKILL_PATHS;
|
|
63002
63279
|
var init_skills_installer = __esm(() => {
|
|
63280
|
+
init_direct_copy();
|
|
63003
63281
|
init_agents();
|
|
63004
63282
|
init_skills_registry();
|
|
63005
63283
|
LEGACY_SKILL_PATHS = {
|
|
63006
63284
|
"gemini-cli": {
|
|
63007
63285
|
project: ".gemini/skills",
|
|
63008
63286
|
global: join61(homedir38(), ".gemini/skills")
|
|
63287
|
+
},
|
|
63288
|
+
antigravity: {
|
|
63289
|
+
project: ".agent/skills",
|
|
63290
|
+
global: join61(homedir38(), ".gemini/antigravity/skills")
|
|
63009
63291
|
}
|
|
63010
63292
|
};
|
|
63011
63293
|
});
|
|
@@ -63620,7 +63902,7 @@ var init_pnpm_detector = __esm(() => {
|
|
|
63620
63902
|
|
|
63621
63903
|
// src/domains/installation/package-managers/detection-core.ts
|
|
63622
63904
|
import { existsSync as existsSync43, realpathSync as realpathSync3 } from "node:fs";
|
|
63623
|
-
import { chmod as chmod2, mkdir as mkdir17, readFile as
|
|
63905
|
+
import { chmod as chmod2, mkdir as mkdir17, readFile as readFile34, writeFile as writeFile18 } from "node:fs/promises";
|
|
63624
63906
|
import { platform as platform6 } from "node:os";
|
|
63625
63907
|
import { join as join63 } from "node:path";
|
|
63626
63908
|
function detectFromBinaryPath() {
|
|
@@ -63703,7 +63985,7 @@ async function readCachedPm() {
|
|
|
63703
63985
|
if (!existsSync43(cacheFile)) {
|
|
63704
63986
|
return null;
|
|
63705
63987
|
}
|
|
63706
|
-
const content = await
|
|
63988
|
+
const content = await readFile34(cacheFile, "utf-8");
|
|
63707
63989
|
const data = JSON.parse(content);
|
|
63708
63990
|
if (!data.packageManager || !data.detectedAt) {
|
|
63709
63991
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -63743,7 +64025,7 @@ async function saveCachedPm(pm, getVersion) {
|
|
|
63743
64025
|
detectedAt: Date.now(),
|
|
63744
64026
|
version: version ?? undefined
|
|
63745
64027
|
};
|
|
63746
|
-
await
|
|
64028
|
+
await writeFile18(cacheFile, JSON.stringify(data, null, 2), "utf-8");
|
|
63747
64029
|
if (platform6() !== "win32") {
|
|
63748
64030
|
await chmod2(cacheFile, 384);
|
|
63749
64031
|
}
|
|
@@ -63954,7 +64236,7 @@ var package_default;
|
|
|
63954
64236
|
var init_package = __esm(() => {
|
|
63955
64237
|
package_default = {
|
|
63956
64238
|
name: "claudekit-cli",
|
|
63957
|
-
version: "4.4.0-dev.
|
|
64239
|
+
version: "4.4.0-dev.14",
|
|
63958
64240
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
63959
64241
|
type: "module",
|
|
63960
64242
|
repository: {
|
|
@@ -64456,7 +64738,7 @@ var init_package_manager_runner = __esm(() => {
|
|
|
64456
64738
|
// src/domains/installation/merger/zombie-wirings-pruner.ts
|
|
64457
64739
|
import { existsSync as existsSync44, readdirSync as readdirSync7 } from "node:fs";
|
|
64458
64740
|
import { homedir as homedir39 } from "node:os";
|
|
64459
|
-
import { basename as basename23, dirname as dirname28, isAbsolute as isAbsolute10, resolve as resolve32, sep as
|
|
64741
|
+
import { basename as basename23, dirname as dirname28, isAbsolute as isAbsolute10, resolve as resolve32, sep as sep10 } from "node:path";
|
|
64460
64742
|
function pruneZombieEngineerWirings(settings, hookDir, preserveCommands = new Set) {
|
|
64461
64743
|
const pruned = [];
|
|
64462
64744
|
const normalizedPreserveCommands = new Set(Array.from(preserveCommands).map((command) => normalizeCommand(command)));
|
|
@@ -64555,7 +64837,7 @@ function extractHookFilePath(command, hookDir) {
|
|
|
64555
64837
|
if (bashMatch) {
|
|
64556
64838
|
const rawPath = bashMatch[1].replace(/\\/g, "/");
|
|
64557
64839
|
const resolved = isAbsolute10(rawPath) || /^[A-Za-z]:[\\/]/.test(rawPath) ? rawPath : resolve32(hookDir, rawPath);
|
|
64558
|
-
return process.platform === "win32" ? resolved.replace(/\//g,
|
|
64840
|
+
return process.platform === "win32" ? resolved.replace(/\//g, sep10) : resolved;
|
|
64559
64841
|
}
|
|
64560
64842
|
return null;
|
|
64561
64843
|
}
|
|
@@ -64565,7 +64847,7 @@ function extractHookFilePath(command, hookDir) {
|
|
|
64565
64847
|
if (varOnlyQuoted) {
|
|
64566
64848
|
const [, envVar, rest] = varOnlyQuoted;
|
|
64567
64849
|
const resolved = resolveEnvPath(envVar, rest);
|
|
64568
|
-
return process.platform === "win32" ? resolved.replace(/\//g,
|
|
64850
|
+
return process.platform === "win32" ? resolved.replace(/\//g, sep10) : resolved;
|
|
64569
64851
|
}
|
|
64570
64852
|
const quotedMatch = command.match(/(?:^|\s)node\s+["']([^"']+)["']/);
|
|
64571
64853
|
if (quotedMatch) {
|
|
@@ -64573,11 +64855,11 @@ function extractHookFilePath(command, hookDir) {
|
|
|
64573
64855
|
const envPrefixMatch = rawArg.match(/^(\$HOME|\$\{HOME\}|%USERPROFILE%|\$CLAUDE_PROJECT_DIR|%CLAUDE_PROJECT_DIR%)[/\\](.*)/);
|
|
64574
64856
|
if (envPrefixMatch) {
|
|
64575
64857
|
const resolved = resolveEnvPath(envPrefixMatch[1], envPrefixMatch[2]);
|
|
64576
|
-
return process.platform === "win32" ? resolved.replace(/\//g,
|
|
64858
|
+
return process.platform === "win32" ? resolved.replace(/\//g, sep10) : resolved;
|
|
64577
64859
|
}
|
|
64578
64860
|
const tildeResolved = rawArg.replace(/^~(?=\/)/, home5);
|
|
64579
64861
|
if (isAbsolute10(tildeResolved) || /^[A-Za-z]:[\\/]/.test(tildeResolved)) {
|
|
64580
|
-
return process.platform === "win32" ? tildeResolved.replace(/\//g,
|
|
64862
|
+
return process.platform === "win32" ? tildeResolved.replace(/\//g, sep10) : tildeResolved;
|
|
64581
64863
|
}
|
|
64582
64864
|
return resolve32(hookDir, tildeResolved);
|
|
64583
64865
|
}
|
|
@@ -64587,11 +64869,11 @@ function extractHookFilePath(command, hookDir) {
|
|
|
64587
64869
|
const envPrefixMatch = rawArg.match(/^(\$HOME|\$\{HOME\}|%USERPROFILE%|\$CLAUDE_PROJECT_DIR|%CLAUDE_PROJECT_DIR%)[/\\](.*)/);
|
|
64588
64870
|
if (envPrefixMatch) {
|
|
64589
64871
|
const resolved = resolveEnvPath(envPrefixMatch[1], envPrefixMatch[2]);
|
|
64590
|
-
return process.platform === "win32" ? resolved.replace(/\//g,
|
|
64872
|
+
return process.platform === "win32" ? resolved.replace(/\//g, sep10) : resolved;
|
|
64591
64873
|
}
|
|
64592
64874
|
const tildeResolved = rawArg.replace(/^~(?=\/)/, home5);
|
|
64593
64875
|
if (isAbsolute10(tildeResolved) || /^[A-Za-z]:[\\/]/.test(tildeResolved)) {
|
|
64594
|
-
return process.platform === "win32" ? tildeResolved.replace(/\//g,
|
|
64876
|
+
return process.platform === "win32" ? tildeResolved.replace(/\//g, sep10) : tildeResolved;
|
|
64595
64877
|
}
|
|
64596
64878
|
return resolve32(hookDir, tildeResolved);
|
|
64597
64879
|
}
|
|
@@ -67081,7 +67363,7 @@ var init_error_handler2 = __esm(() => {
|
|
|
67081
67363
|
|
|
67082
67364
|
// src/domains/versioning/release-cache.ts
|
|
67083
67365
|
import { existsSync as existsSync46 } from "node:fs";
|
|
67084
|
-
import { mkdir as mkdir18, readFile as
|
|
67366
|
+
import { mkdir as mkdir18, readFile as readFile37, unlink as unlink8, writeFile as writeFile20 } from "node:fs/promises";
|
|
67085
67367
|
import { join as join67 } from "node:path";
|
|
67086
67368
|
var ReleaseCacheEntrySchema, ReleaseCache;
|
|
67087
67369
|
var init_release_cache = __esm(() => {
|
|
@@ -67106,7 +67388,7 @@ var init_release_cache = __esm(() => {
|
|
|
67106
67388
|
logger.debug(`Release cache not found for key: ${key}`);
|
|
67107
67389
|
return null;
|
|
67108
67390
|
}
|
|
67109
|
-
const content = await
|
|
67391
|
+
const content = await readFile37(cacheFile, "utf-8");
|
|
67110
67392
|
const parsed = JSON.parse(content);
|
|
67111
67393
|
const cacheEntry = ReleaseCacheEntrySchema.parse(parsed);
|
|
67112
67394
|
if (this.isExpired(cacheEntry.timestamp)) {
|
|
@@ -67132,7 +67414,7 @@ var init_release_cache = __esm(() => {
|
|
|
67132
67414
|
timestamp: Date.now(),
|
|
67133
67415
|
releases
|
|
67134
67416
|
};
|
|
67135
|
-
await
|
|
67417
|
+
await writeFile20(cacheFile, JSON.stringify(cacheEntry, null, 2), "utf-8");
|
|
67136
67418
|
logger.debug(`Release cache set for key: ${key}, cached ${releases.length} releases`);
|
|
67137
67419
|
} catch (error) {
|
|
67138
67420
|
logger.debug(`Failed to set release cache for key ${key}: ${error}`);
|
|
@@ -68508,7 +68790,7 @@ var init_update_cli = __esm(() => {
|
|
|
68508
68790
|
});
|
|
68509
68791
|
|
|
68510
68792
|
// src/domains/sync/config-version-checker.ts
|
|
68511
|
-
import { mkdir as mkdir19, readFile as
|
|
68793
|
+
import { mkdir as mkdir19, readFile as readFile39, unlink as unlink9, writeFile as writeFile21 } from "node:fs/promises";
|
|
68512
68794
|
import { join as join69 } from "node:path";
|
|
68513
68795
|
function parseCacheTtl() {
|
|
68514
68796
|
const envValue = process.env.CK_SYNC_CACHE_TTL;
|
|
@@ -68593,7 +68875,7 @@ class ConfigVersionChecker {
|
|
|
68593
68875
|
}
|
|
68594
68876
|
for (const cachePath of cachePaths) {
|
|
68595
68877
|
try {
|
|
68596
|
-
const data = await
|
|
68878
|
+
const data = await readFile39(cachePath, "utf8");
|
|
68597
68879
|
const parsed = JSON.parse(data);
|
|
68598
68880
|
if (typeof parsed !== "object" || parsed === null || typeof parsed.lastCheck !== "number" || typeof parsed.latestVersion !== "string" || !parsed.latestVersion || parsed.lastCheck < 0 || parsed.lastCheck > Date.now() + 7 * 24 * 60 * 60 * 1000) {
|
|
68599
68881
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -68611,7 +68893,7 @@ class ConfigVersionChecker {
|
|
|
68611
68893
|
const cachePath = ConfigVersionChecker.getCacheFilePath(kitType, global3, channel);
|
|
68612
68894
|
const cacheDir = PathResolver.getCacheDir(global3);
|
|
68613
68895
|
await mkdir19(cacheDir, { recursive: true });
|
|
68614
|
-
await
|
|
68896
|
+
await writeFile21(cachePath, JSON.stringify(cache3, null, 2));
|
|
68615
68897
|
} catch (error) {
|
|
68616
68898
|
logger.debug(`Cache write failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
68617
68899
|
}
|
|
@@ -68773,7 +69055,7 @@ var init_config_version_checker = __esm(() => {
|
|
|
68773
69055
|
import { spawn as spawn3 } from "node:child_process";
|
|
68774
69056
|
import { execFile as execFile8 } from "node:child_process";
|
|
68775
69057
|
import { existsSync as existsSync48 } from "node:fs";
|
|
68776
|
-
import { readFile as
|
|
69058
|
+
import { readFile as readFile40 } from "node:fs/promises";
|
|
68777
69059
|
import { cpus, homedir as homedir42, totalmem } from "node:os";
|
|
68778
69060
|
import { join as join70 } from "node:path";
|
|
68779
69061
|
function runCommand(cmd, args, fallback2) {
|
|
@@ -69064,7 +69346,7 @@ async function getKitMetadata2(kitName) {
|
|
|
69064
69346
|
const metadataPath = join70(PathResolver.getGlobalKitDir(), "metadata.json");
|
|
69065
69347
|
if (!existsSync48(metadataPath))
|
|
69066
69348
|
return null;
|
|
69067
|
-
const content = await
|
|
69349
|
+
const content = await readFile40(metadataPath, "utf-8");
|
|
69068
69350
|
const metadata = JSON.parse(content);
|
|
69069
69351
|
if (typeof metadata.kits?.[kitName]?.version === "string" && metadata.kits[kitName].version.trim()) {
|
|
69070
69352
|
return { version: metadata.kits[kitName].version };
|
|
@@ -74602,8 +74884,8 @@ async function installSkillsDependencies(skillsDir2, options2 = {}) {
|
|
|
74602
74884
|
logger.info(` Platform: ${platform10 === "win32" ? "Windows (PowerShell)" : "Unix (bash)"}`);
|
|
74603
74885
|
if (logger.isVerbose()) {
|
|
74604
74886
|
try {
|
|
74605
|
-
const { readFile:
|
|
74606
|
-
const scriptContent = await
|
|
74887
|
+
const { readFile: readFile49 } = await import("node:fs/promises");
|
|
74888
|
+
const scriptContent = await readFile49(scriptPath, "utf-8");
|
|
74607
74889
|
const previewLines = scriptContent.split(`
|
|
74608
74890
|
`).slice(0, 20);
|
|
74609
74891
|
logger.verbose("Script preview (first 20 lines):");
|
|
@@ -74799,11 +75081,11 @@ var init_skills_installer2 = __esm(() => {
|
|
|
74799
75081
|
|
|
74800
75082
|
// src/services/package-installer/gemini-mcp/config-manager.ts
|
|
74801
75083
|
import { existsSync as existsSync62 } from "node:fs";
|
|
74802
|
-
import { mkdir as mkdir23, readFile as
|
|
75084
|
+
import { mkdir as mkdir23, readFile as readFile49, writeFile as writeFile25 } from "node:fs/promises";
|
|
74803
75085
|
import { dirname as dirname33, join as join92 } from "node:path";
|
|
74804
75086
|
async function readJsonFile(filePath) {
|
|
74805
75087
|
try {
|
|
74806
|
-
const content = await
|
|
75088
|
+
const content = await readFile49(filePath, "utf-8");
|
|
74807
75089
|
return JSON.parse(content);
|
|
74808
75090
|
} catch (error) {
|
|
74809
75091
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
@@ -74817,7 +75099,7 @@ async function addGeminiToGitignore(projectDir) {
|
|
|
74817
75099
|
try {
|
|
74818
75100
|
let content = "";
|
|
74819
75101
|
if (existsSync62(gitignorePath)) {
|
|
74820
|
-
content = await
|
|
75102
|
+
content = await readFile49(gitignorePath, "utf-8");
|
|
74821
75103
|
const lines = content.split(`
|
|
74822
75104
|
`).map((line) => line.trim()).filter((line) => !line.startsWith("#"));
|
|
74823
75105
|
const geminiPatterns = [".gemini/", ".gemini", "/.gemini/", "/.gemini"];
|
|
@@ -74830,7 +75112,7 @@ async function addGeminiToGitignore(projectDir) {
|
|
|
74830
75112
|
`) || content === "" ? "" : `
|
|
74831
75113
|
`;
|
|
74832
75114
|
const comment = "# Gemini CLI settings (contains user-specific config)";
|
|
74833
|
-
await
|
|
75115
|
+
await writeFile25(gitignorePath, `${content}${newLine}${comment}
|
|
74834
75116
|
${geminiPattern}
|
|
74835
75117
|
`, "utf-8");
|
|
74836
75118
|
logger.debug(`Added ${geminiPattern} to .gitignore`);
|
|
@@ -74855,7 +75137,7 @@ async function createNewSettingsWithMerge(geminiSettingsPath, mcpConfigPath) {
|
|
|
74855
75137
|
}
|
|
74856
75138
|
const newSettings = { mcpServers };
|
|
74857
75139
|
try {
|
|
74858
|
-
await
|
|
75140
|
+
await writeFile25(geminiSettingsPath, JSON.stringify(newSettings, null, 2), "utf-8");
|
|
74859
75141
|
logger.debug(`Created new Gemini settings with mcpServers: ${geminiSettingsPath}`);
|
|
74860
75142
|
return { success: true, method: "merge", targetPath: mcpConfigPath };
|
|
74861
75143
|
} catch (error) {
|
|
@@ -74885,7 +75167,7 @@ async function mergeGeminiSettings(geminiSettingsPath, mcpConfigPath) {
|
|
|
74885
75167
|
mcpServers
|
|
74886
75168
|
};
|
|
74887
75169
|
try {
|
|
74888
|
-
await
|
|
75170
|
+
await writeFile25(geminiSettingsPath, JSON.stringify(mergedSettings, null, 2), "utf-8");
|
|
74889
75171
|
logger.debug(`Merged mcpServers into: ${geminiSettingsPath}`);
|
|
74890
75172
|
return { success: true, method: "merge", targetPath: mcpConfigPath };
|
|
74891
75173
|
} catch (error) {
|
|
@@ -77386,7 +77668,7 @@ __export(exports_worktree_manager, {
|
|
|
77386
77668
|
cleanupAllWorktrees: () => cleanupAllWorktrees
|
|
77387
77669
|
});
|
|
77388
77670
|
import { existsSync as existsSync73 } from "node:fs";
|
|
77389
|
-
import { readFile as
|
|
77671
|
+
import { readFile as readFile69, writeFile as writeFile40 } from "node:fs/promises";
|
|
77390
77672
|
import { join as join154 } from "node:path";
|
|
77391
77673
|
async function createWorktree(projectDir, issueNumber, baseBranch) {
|
|
77392
77674
|
const worktreePath = join154(projectDir, WORKTREE_DIR, `issue-${issueNumber}`);
|
|
@@ -77451,14 +77733,14 @@ async function cleanupAllWorktrees(projectDir) {
|
|
|
77451
77733
|
async function ensureGitignore(projectDir) {
|
|
77452
77734
|
const gitignorePath = join154(projectDir, ".gitignore");
|
|
77453
77735
|
try {
|
|
77454
|
-
const content = existsSync73(gitignorePath) ? await
|
|
77736
|
+
const content = existsSync73(gitignorePath) ? await readFile69(gitignorePath, "utf-8") : "";
|
|
77455
77737
|
if (!content.includes(".worktrees")) {
|
|
77456
77738
|
const newContent = content.endsWith(`
|
|
77457
77739
|
`) ? `${content}.worktrees/
|
|
77458
77740
|
` : `${content}
|
|
77459
77741
|
.worktrees/
|
|
77460
77742
|
`;
|
|
77461
|
-
await
|
|
77743
|
+
await writeFile40(gitignorePath, newContent, "utf-8");
|
|
77462
77744
|
logger.info("[worktree] Added .worktrees/ to .gitignore");
|
|
77463
77745
|
}
|
|
77464
77746
|
} catch (err) {
|
|
@@ -77554,7 +77836,7 @@ var init_content_validator = __esm(() => {
|
|
|
77554
77836
|
// src/commands/content/phases/context-cache-manager.ts
|
|
77555
77837
|
import { createHash as createHash9 } from "node:crypto";
|
|
77556
77838
|
import { existsSync as existsSync79, mkdirSync as mkdirSync5, readFileSync as readFileSync19, readdirSync as readdirSync13, statSync as statSync14 } from "node:fs";
|
|
77557
|
-
import { rename as rename16, writeFile as
|
|
77839
|
+
import { rename as rename16, writeFile as writeFile42 } from "node:fs/promises";
|
|
77558
77840
|
import { homedir as homedir54 } from "node:os";
|
|
77559
77841
|
import { basename as basename34, join as join161 } from "node:path";
|
|
77560
77842
|
function getCachedContext(repoPath) {
|
|
@@ -77581,7 +77863,7 @@ async function saveCachedContext(repoPath, cache5) {
|
|
|
77581
77863
|
}
|
|
77582
77864
|
const cachePath = getCacheFilePath(repoPath);
|
|
77583
77865
|
const tmpPath = `${cachePath}.tmp`;
|
|
77584
|
-
await
|
|
77866
|
+
await writeFile42(tmpPath, JSON.stringify(cache5, null, 2), "utf-8");
|
|
77585
77867
|
await rename16(tmpPath, cachePath);
|
|
77586
77868
|
}
|
|
77587
77869
|
function computeSourceHash(repoPath) {
|
|
@@ -79418,12 +79700,12 @@ var init_types6 = __esm(() => {
|
|
|
79418
79700
|
});
|
|
79419
79701
|
|
|
79420
79702
|
// src/commands/content/phases/state-manager.ts
|
|
79421
|
-
import { readFile as
|
|
79703
|
+
import { readFile as readFile71, rename as rename17, writeFile as writeFile43 } from "node:fs/promises";
|
|
79422
79704
|
import { join as join167 } from "node:path";
|
|
79423
79705
|
async function loadContentConfig(projectDir) {
|
|
79424
79706
|
const configPath = join167(projectDir, CK_CONFIG_FILE2);
|
|
79425
79707
|
try {
|
|
79426
|
-
const raw2 = await
|
|
79708
|
+
const raw2 = await readFile71(configPath, "utf-8");
|
|
79427
79709
|
const json = JSON.parse(raw2);
|
|
79428
79710
|
return ContentConfigSchema.parse(json.content ?? {});
|
|
79429
79711
|
} catch {
|
|
@@ -79439,7 +79721,7 @@ async function saveContentConfig(projectDir, config) {
|
|
|
79439
79721
|
async function loadContentState(projectDir) {
|
|
79440
79722
|
const configPath = join167(projectDir, CK_CONFIG_FILE2);
|
|
79441
79723
|
try {
|
|
79442
|
-
const raw2 = await
|
|
79724
|
+
const raw2 = await readFile71(configPath, "utf-8");
|
|
79443
79725
|
const json = JSON.parse(raw2);
|
|
79444
79726
|
const contentBlock = json.content ?? {};
|
|
79445
79727
|
return ContentStateSchema.parse(contentBlock.state ?? {});
|
|
@@ -79466,7 +79748,7 @@ async function saveContentState(projectDir, state) {
|
|
|
79466
79748
|
}
|
|
79467
79749
|
async function readJsonSafe(filePath) {
|
|
79468
79750
|
try {
|
|
79469
|
-
const raw2 = await
|
|
79751
|
+
const raw2 = await readFile71(filePath, "utf-8");
|
|
79470
79752
|
return JSON.parse(raw2);
|
|
79471
79753
|
} catch {
|
|
79472
79754
|
return {};
|
|
@@ -79474,7 +79756,7 @@ async function readJsonSafe(filePath) {
|
|
|
79474
79756
|
}
|
|
79475
79757
|
async function atomicWrite3(filePath, data) {
|
|
79476
79758
|
const tmpPath = `${filePath}.tmp`;
|
|
79477
|
-
await
|
|
79759
|
+
await writeFile43(tmpPath, JSON.stringify(data, null, 2), "utf-8");
|
|
79478
79760
|
await rename17(tmpPath, filePath);
|
|
79479
79761
|
}
|
|
79480
79762
|
var CK_CONFIG_FILE2 = ".ck.json";
|
|
@@ -81546,7 +81828,9 @@ var init_migrate_command_help = __esm(() => {
|
|
|
81546
81828
|
" Default mode is smart-detected: no/stale registry → install, valid registry → reconcile",
|
|
81547
81829
|
" --respect-deletions disables the auto-reinstall heuristic for empty directories",
|
|
81548
81830
|
" --force overrides skip decisions per item; --reinstall-empty-dirs is a per-directory heuristic",
|
|
81549
|
-
" Codex commands migrate as skills: project scope writes .agents/skills, global scope writes ~/.agents/skills"
|
|
81831
|
+
" Codex commands migrate as skills: project scope writes .agents/skills, global scope writes ~/.agents/skills",
|
|
81832
|
+
" Antigravity 2.0 agents migrate to .agents/agents.md; skills remain .agents/skills/<name>/SKILL.md",
|
|
81833
|
+
" Kiro agents migrate as custom subagents; rules/config migrate as steering files; skills copy to .kiro/skills; commands/hooks are skipped"
|
|
81550
81834
|
].join(`
|
|
81551
81835
|
`)
|
|
81552
81836
|
}
|
|
@@ -82019,7 +82303,7 @@ var init_skills_command_help = __esm(() => {
|
|
|
82019
82303
|
},
|
|
82020
82304
|
{
|
|
82021
82305
|
flags: "-a, --agent <agent>",
|
|
82022
|
-
description: "Target agent(s) - can be specified multiple times. Valid: claude-code, cursor, codex, opencode, goose, gemini-cli, antigravity, github-copilot, amp, kilo, roo, windsurf, cline, openhands"
|
|
82306
|
+
description: "Target agent(s) - can be specified multiple times. Valid: claude-code, cursor, codex, opencode, goose, gemini-cli, antigravity, github-copilot, amp, kilo, kiro, roo, windsurf, cline, openhands"
|
|
82023
82307
|
},
|
|
82024
82308
|
{
|
|
82025
82309
|
flags: "-g, --global",
|
|
@@ -82087,6 +82371,7 @@ var init_skills_command_help = __esm(() => {
|
|
|
82087
82371
|
github-copilot GitHub Copilot
|
|
82088
82372
|
amp Amp
|
|
82089
82373
|
kilo Kilo Code
|
|
82374
|
+
kiro Kiro
|
|
82090
82375
|
roo Roo Code
|
|
82091
82376
|
windsurf Windsurf IDE
|
|
82092
82377
|
cline Cline
|
|
@@ -88369,7 +88654,7 @@ import { join as join76, resolve as resolve36 } from "node:path";
|
|
|
88369
88654
|
// src/domains/health-checks/checkers/skill-budget-scanner.ts
|
|
88370
88655
|
var import_gray_matter11 = __toESM(require_gray_matter(), 1);
|
|
88371
88656
|
import { existsSync as existsSync54 } from "node:fs";
|
|
88372
|
-
import { readFile as
|
|
88657
|
+
import { readFile as readFile41, readdir as readdir20 } from "node:fs/promises";
|
|
88373
88658
|
import { basename as basename25, join as join75, relative as relative16 } from "node:path";
|
|
88374
88659
|
var SKIP_DIRS5 = new Set([".git", ".venv", "__pycache__", "node_modules", "scripts", "common"]);
|
|
88375
88660
|
async function scanSkills2(skillsDir2) {
|
|
@@ -88380,7 +88665,7 @@ async function scanSkills2(skillsDir2) {
|
|
|
88380
88665
|
for (const dir of skillDirs) {
|
|
88381
88666
|
const file = join75(dir, "SKILL.md");
|
|
88382
88667
|
try {
|
|
88383
|
-
const content = await
|
|
88668
|
+
const content = await readFile41(file, "utf8");
|
|
88384
88669
|
const { data } = import_gray_matter11.default(content, { engines: { javascript: { parse: () => ({}) } } });
|
|
88385
88670
|
const rawName = typeof data.name === "string" ? data.name : "";
|
|
88386
88671
|
const fallbackId = relative16(skillsDir2, dir).replace(/\\/g, "/") || basename25(dir);
|
|
@@ -88424,7 +88709,7 @@ function normalizeSkillId(rawName, fallbackId) {
|
|
|
88424
88709
|
// src/domains/health-checks/checkers/skill-budget-settings.ts
|
|
88425
88710
|
init_settings_merger();
|
|
88426
88711
|
import { existsSync as existsSync55 } from "node:fs";
|
|
88427
|
-
import { mkdir as mkdir20, readFile as
|
|
88712
|
+
import { mkdir as mkdir20, readFile as readFile42 } from "node:fs/promises";
|
|
88428
88713
|
var CONTEXT_FLOOR_TOKENS = 200000;
|
|
88429
88714
|
var CHARS_PER_TOKEN = 4;
|
|
88430
88715
|
var DEFAULT_BUDGET_FRACTION = 0.03;
|
|
@@ -88435,7 +88720,7 @@ async function readProjectSettings(settingsPath) {
|
|
|
88435
88720
|
if (!existsSync55(settingsPath))
|
|
88436
88721
|
return { exists: false, settings: null };
|
|
88437
88722
|
try {
|
|
88438
|
-
const parsed = JSON.parse(await
|
|
88723
|
+
const parsed = JSON.parse(await readFile42(settingsPath, "utf8"));
|
|
88439
88724
|
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
88440
88725
|
return { exists: true, settings: null, error: "settings.json must contain a JSON object" };
|
|
88441
88726
|
}
|
|
@@ -88649,7 +88934,7 @@ function warn(id, name, message, skills, suggestion) {
|
|
|
88649
88934
|
init_logger();
|
|
88650
88935
|
init_path_resolver();
|
|
88651
88936
|
init_shared2();
|
|
88652
|
-
import { constants as constants2, access as access3, unlink as unlink10, writeFile as
|
|
88937
|
+
import { constants as constants2, access as access3, unlink as unlink10, writeFile as writeFile22 } from "node:fs/promises";
|
|
88653
88938
|
import { join as join77 } from "node:path";
|
|
88654
88939
|
async function checkGlobalDirReadable() {
|
|
88655
88940
|
const globalDir = PathResolver.getGlobalKitDir();
|
|
@@ -88709,7 +88994,7 @@ async function checkGlobalDirWritable() {
|
|
|
88709
88994
|
const random = Math.random().toString(36).substring(2);
|
|
88710
88995
|
const testFile = join77(globalDir, `.ck-write-test-${timestamp}-${random}`);
|
|
88711
88996
|
try {
|
|
88712
|
-
await
|
|
88997
|
+
await writeFile22(testFile, "test", { encoding: "utf-8", flag: "wx" });
|
|
88713
88998
|
} catch (error) {
|
|
88714
88999
|
return {
|
|
88715
89000
|
id: "ck-global-dir-writable",
|
|
@@ -88807,7 +89092,7 @@ async function checkHooksExist(projectDir) {
|
|
|
88807
89092
|
init_logger();
|
|
88808
89093
|
init_path_resolver();
|
|
88809
89094
|
import { existsSync as existsSync57 } from "node:fs";
|
|
88810
|
-
import { readFile as
|
|
89095
|
+
import { readFile as readFile43 } from "node:fs/promises";
|
|
88811
89096
|
import { join as join79 } from "node:path";
|
|
88812
89097
|
async function checkSettingsValid(projectDir) {
|
|
88813
89098
|
const globalSettings = join79(PathResolver.getGlobalKitDir(), "settings.json");
|
|
@@ -88825,7 +89110,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
88825
89110
|
};
|
|
88826
89111
|
}
|
|
88827
89112
|
try {
|
|
88828
|
-
const content = await
|
|
89113
|
+
const content = await readFile43(settingsPath, "utf-8");
|
|
88829
89114
|
JSON.parse(content);
|
|
88830
89115
|
return {
|
|
88831
89116
|
id: "ck-settings-valid",
|
|
@@ -88882,7 +89167,7 @@ async function checkSettingsValid(projectDir) {
|
|
|
88882
89167
|
init_logger();
|
|
88883
89168
|
init_path_resolver();
|
|
88884
89169
|
import { existsSync as existsSync58 } from "node:fs";
|
|
88885
|
-
import { readFile as
|
|
89170
|
+
import { readFile as readFile44 } from "node:fs/promises";
|
|
88886
89171
|
import { homedir as homedir43 } from "node:os";
|
|
88887
89172
|
import { dirname as dirname31, join as join80, normalize as normalize6, resolve as resolve37 } from "node:path";
|
|
88888
89173
|
async function checkPathRefsValid(projectDir) {
|
|
@@ -88901,7 +89186,7 @@ async function checkPathRefsValid(projectDir) {
|
|
|
88901
89186
|
};
|
|
88902
89187
|
}
|
|
88903
89188
|
try {
|
|
88904
|
-
const content = await
|
|
89189
|
+
const content = await readFile44(claudeMdPath, "utf-8");
|
|
88905
89190
|
const refPattern = /@([^\s\)]+)/g;
|
|
88906
89191
|
const refs = [...content.matchAll(refPattern)].map((m2) => m2[1]);
|
|
88907
89192
|
if (refs.length === 0) {
|
|
@@ -89919,7 +90204,7 @@ import { platform as platform9 } from "node:os";
|
|
|
89919
90204
|
// src/domains/health-checks/platform/environment-checker.ts
|
|
89920
90205
|
init_environment();
|
|
89921
90206
|
init_path_resolver();
|
|
89922
|
-
import { constants as constants3, access as access4, mkdir as mkdir21, readFile as
|
|
90207
|
+
import { constants as constants3, access as access4, mkdir as mkdir21, readFile as readFile46, unlink as unlink11, writeFile as writeFile23 } from "node:fs/promises";
|
|
89923
90208
|
import { arch as arch2, homedir as homedir44, platform as platform8 } from "node:os";
|
|
89924
90209
|
import { join as join85, normalize as normalize7 } from "node:path";
|
|
89925
90210
|
function shouldSkipExpensiveOperations4() {
|
|
@@ -90015,8 +90300,8 @@ async function checkGlobalDirAccess() {
|
|
|
90015
90300
|
const testFile = join85(globalDir, ".ck-doctor-access-test");
|
|
90016
90301
|
try {
|
|
90017
90302
|
await mkdir21(globalDir, { recursive: true });
|
|
90018
|
-
await
|
|
90019
|
-
const content = await
|
|
90303
|
+
await writeFile23(testFile, "test", "utf-8");
|
|
90304
|
+
const content = await readFile46(testFile, "utf-8");
|
|
90020
90305
|
await unlink11(testFile);
|
|
90021
90306
|
if (content !== "test")
|
|
90022
90307
|
throw new Error("Read mismatch");
|
|
@@ -90089,7 +90374,7 @@ async function checkWSLBoundary() {
|
|
|
90089
90374
|
|
|
90090
90375
|
// src/domains/health-checks/platform/windows-checker.ts
|
|
90091
90376
|
init_path_resolver();
|
|
90092
|
-
import { mkdir as mkdir22, symlink as symlink2, unlink as unlink12, writeFile as
|
|
90377
|
+
import { mkdir as mkdir22, symlink as symlink2, unlink as unlink12, writeFile as writeFile24 } from "node:fs/promises";
|
|
90093
90378
|
import { join as join86 } from "node:path";
|
|
90094
90379
|
async function checkLongPathSupport() {
|
|
90095
90380
|
if (shouldSkipExpensiveOperations4()) {
|
|
@@ -90146,7 +90431,7 @@ async function checkSymlinkSupport() {
|
|
|
90146
90431
|
const link = join86(testDir, ".ck-symlink-test-link");
|
|
90147
90432
|
try {
|
|
90148
90433
|
await mkdir22(testDir, { recursive: true });
|
|
90149
|
-
await
|
|
90434
|
+
await writeFile24(target, "test", "utf-8");
|
|
90150
90435
|
await symlink2(target, link);
|
|
90151
90436
|
await unlink12(link);
|
|
90152
90437
|
await unlink12(target);
|
|
@@ -91249,13 +91534,13 @@ init_hook_health_checker();
|
|
|
91249
91534
|
init_config_version_checker();
|
|
91250
91535
|
|
|
91251
91536
|
// src/domains/sync/sync-engine.ts
|
|
91252
|
-
import { lstat as lstat6, readFile as
|
|
91537
|
+
import { lstat as lstat6, readFile as readFile48, readlink as readlink2, realpath as realpath8, stat as stat14 } from "node:fs/promises";
|
|
91253
91538
|
import { isAbsolute as isAbsolute11, join as join88, normalize as normalize8, relative as relative18 } from "node:path";
|
|
91254
91539
|
|
|
91255
91540
|
// src/services/file-operations/ownership-checker.ts
|
|
91256
91541
|
init_metadata_migration();
|
|
91257
91542
|
import { createHash as createHash6 } from "node:crypto";
|
|
91258
|
-
import { readFile as
|
|
91543
|
+
import { readFile as readFile47, stat as stat13 } from "node:fs/promises";
|
|
91259
91544
|
import { relative as relative17 } from "node:path";
|
|
91260
91545
|
|
|
91261
91546
|
// src/shared/concurrent-file-ops.ts
|
|
@@ -91270,7 +91555,7 @@ async function mapWithLimit(items, fn, concurrency = DEFAULT_CONCURRENCY) {
|
|
|
91270
91555
|
class OwnershipChecker {
|
|
91271
91556
|
static async calculateChecksum(filePath) {
|
|
91272
91557
|
try {
|
|
91273
|
-
return createHash6("sha256").update(await
|
|
91558
|
+
return createHash6("sha256").update(await readFile47(filePath)).digest("hex");
|
|
91274
91559
|
} catch (err) {
|
|
91275
91560
|
const message = err instanceof Error ? err.message : String(err);
|
|
91276
91561
|
throw new Error(operationError("Checksum calculation", filePath, message));
|
|
@@ -92687,7 +92972,7 @@ class SyncEngine {
|
|
|
92687
92972
|
if (lstats.size > MAX_SYNC_FILE_SIZE) {
|
|
92688
92973
|
throw new Error(`File too large for sync (${Math.round(lstats.size / 1024 / 1024)}MB > ${MAX_SYNC_FILE_SIZE / 1024 / 1024}MB limit)`);
|
|
92689
92974
|
}
|
|
92690
|
-
const buffer = await
|
|
92975
|
+
const buffer = await readFile48(filePath);
|
|
92691
92976
|
if (buffer.includes(0)) {
|
|
92692
92977
|
return { content: "", isBinary: true };
|
|
92693
92978
|
}
|
|
@@ -102015,7 +102300,7 @@ import { join as join121 } from "node:path";
|
|
|
102015
102300
|
|
|
102016
102301
|
// src/domains/installation/deletion-handler.ts
|
|
102017
102302
|
import { existsSync as existsSync65, lstatSync as lstatSync3, readdirSync as readdirSync9, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync4 } from "node:fs";
|
|
102018
|
-
import { dirname as dirname37, join as join106, relative as relative21, resolve as resolve42, sep as
|
|
102303
|
+
import { dirname as dirname37, join as join106, relative as relative21, resolve as resolve42, sep as sep11 } from "node:path";
|
|
102019
102304
|
|
|
102020
102305
|
// src/services/file-operations/manifest/manifest-reader.ts
|
|
102021
102306
|
init_metadata_migration();
|
|
@@ -102262,7 +102547,7 @@ function cleanupEmptyDirectories(filePath, claudeDir3) {
|
|
|
102262
102547
|
function deletePath(fullPath, claudeDir3) {
|
|
102263
102548
|
const normalizedPath = resolve42(fullPath);
|
|
102264
102549
|
const normalizedClaudeDir = resolve42(claudeDir3);
|
|
102265
|
-
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${
|
|
102550
|
+
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep11}`) && normalizedPath !== normalizedClaudeDir) {
|
|
102266
102551
|
throw new Error(`Path traversal detected: ${fullPath}`);
|
|
102267
102552
|
}
|
|
102268
102553
|
try {
|
|
@@ -102336,7 +102621,7 @@ async function handleDeletions(sourceMetadata, claudeDir3, kitType) {
|
|
|
102336
102621
|
const fullPath = join106(claudeDir3, path16);
|
|
102337
102622
|
const normalizedPath = resolve42(fullPath);
|
|
102338
102623
|
const normalizedClaudeDir = resolve42(claudeDir3);
|
|
102339
|
-
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${
|
|
102624
|
+
if (!normalizedPath.startsWith(`${normalizedClaudeDir}${sep11}`)) {
|
|
102340
102625
|
logger.warning(`Skipping invalid path: ${path16}`);
|
|
102341
102626
|
result.errors.push(path16);
|
|
102342
102627
|
continue;
|
|
@@ -103434,8 +103719,8 @@ var path16 = {
|
|
|
103434
103719
|
win32: { sep: "\\" },
|
|
103435
103720
|
posix: { sep: "/" }
|
|
103436
103721
|
};
|
|
103437
|
-
var
|
|
103438
|
-
minimatch.sep =
|
|
103722
|
+
var sep12 = defaultPlatform === "win32" ? path16.win32.sep : path16.posix.sep;
|
|
103723
|
+
minimatch.sep = sep12;
|
|
103439
103724
|
var GLOBSTAR = Symbol("globstar **");
|
|
103440
103725
|
minimatch.GLOBSTAR = GLOBSTAR;
|
|
103441
103726
|
var qmark2 = "[^/]";
|
|
@@ -104124,7 +104409,7 @@ import { dirname as dirname40, join as join110 } from "node:path";
|
|
|
104124
104409
|
// src/domains/config/installed-settings-tracker.ts
|
|
104125
104410
|
init_shared();
|
|
104126
104411
|
import { existsSync as existsSync66 } from "node:fs";
|
|
104127
|
-
import { mkdir as mkdir31, readFile as
|
|
104412
|
+
import { mkdir as mkdir31, readFile as readFile52, writeFile as writeFile27 } from "node:fs/promises";
|
|
104128
104413
|
import { dirname as dirname39, join as join109 } from "node:path";
|
|
104129
104414
|
var CK_JSON_FILE = ".ck.json";
|
|
104130
104415
|
|
|
@@ -104149,7 +104434,7 @@ class InstalledSettingsTracker {
|
|
|
104149
104434
|
return { hooks: [], mcpServers: [] };
|
|
104150
104435
|
}
|
|
104151
104436
|
try {
|
|
104152
|
-
const content = await
|
|
104437
|
+
const content = await readFile52(ckJsonPath, "utf-8");
|
|
104153
104438
|
const data = parseJsonContent(content);
|
|
104154
104439
|
const installed = data.kits?.[this.kitName]?.installedSettings;
|
|
104155
104440
|
if (installed) {
|
|
@@ -104166,7 +104451,7 @@ class InstalledSettingsTracker {
|
|
|
104166
104451
|
try {
|
|
104167
104452
|
let data = {};
|
|
104168
104453
|
if (existsSync66(ckJsonPath)) {
|
|
104169
|
-
const content = await
|
|
104454
|
+
const content = await readFile52(ckJsonPath, "utf-8");
|
|
104170
104455
|
data = parseJsonContent(content);
|
|
104171
104456
|
}
|
|
104172
104457
|
if (!data.kits) {
|
|
@@ -104177,7 +104462,7 @@ class InstalledSettingsTracker {
|
|
|
104177
104462
|
}
|
|
104178
104463
|
data.kits[this.kitName].installedSettings = settings;
|
|
104179
104464
|
await mkdir31(dirname39(ckJsonPath), { recursive: true });
|
|
104180
|
-
await
|
|
104465
|
+
await writeFile27(ckJsonPath, JSON.stringify(data, null, 2), "utf-8");
|
|
104181
104466
|
logger.debug(`Saved installed settings to ${ckJsonPath}`);
|
|
104182
104467
|
} catch (error) {
|
|
104183
104468
|
logger.warning(`Failed to save installed settings: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
@@ -106074,7 +106359,7 @@ import { join as join118 } from "node:path";
|
|
|
106074
106359
|
|
|
106075
106360
|
// src/services/transformers/commands-prefix/content-transformer.ts
|
|
106076
106361
|
init_logger();
|
|
106077
|
-
import { readFile as
|
|
106362
|
+
import { readFile as readFile56, readdir as readdir30, writeFile as writeFile31 } from "node:fs/promises";
|
|
106078
106363
|
import { join as join117 } from "node:path";
|
|
106079
106364
|
var TRANSFORMABLE_EXTENSIONS = new Set([
|
|
106080
106365
|
".md",
|
|
@@ -106143,13 +106428,13 @@ async function transformCommandReferences(directory, options2 = {}) {
|
|
|
106143
106428
|
await processDirectory(fullPath);
|
|
106144
106429
|
} else if (entry.isFile() && shouldTransformFile(entry.name)) {
|
|
106145
106430
|
try {
|
|
106146
|
-
const content = await
|
|
106431
|
+
const content = await readFile56(fullPath, "utf-8");
|
|
106147
106432
|
const { transformed, changes } = transformCommandContent(content);
|
|
106148
106433
|
if (changes > 0) {
|
|
106149
106434
|
if (options2.dryRun) {
|
|
106150
106435
|
logger.debug(`[dry-run] Would transform ${changes} command ref(s) in ${fullPath}`);
|
|
106151
106436
|
} else {
|
|
106152
|
-
await
|
|
106437
|
+
await writeFile31(fullPath, transformed, "utf-8");
|
|
106153
106438
|
if (options2.verbose) {
|
|
106154
106439
|
logger.verbose(`Transformed ${changes} command ref(s) in ${fullPath}`);
|
|
106155
106440
|
}
|
|
@@ -106684,7 +106969,7 @@ init_skip_directories();
|
|
|
106684
106969
|
init_types3();
|
|
106685
106970
|
var import_fs_extra25 = __toESM(require_lib(), 1);
|
|
106686
106971
|
import { createHash as createHash7 } from "node:crypto";
|
|
106687
|
-
import { readFile as
|
|
106972
|
+
import { readFile as readFile58, readdir as readdir34, writeFile as writeFile32 } from "node:fs/promises";
|
|
106688
106973
|
import { join as join122, relative as relative27 } from "node:path";
|
|
106689
106974
|
|
|
106690
106975
|
class SkillsManifestManager {
|
|
@@ -106708,7 +106993,7 @@ class SkillsManifestManager {
|
|
|
106708
106993
|
}
|
|
106709
106994
|
static async writeManifest(skillsDir2, manifest) {
|
|
106710
106995
|
const manifestPath = join122(skillsDir2, SkillsManifestManager.MANIFEST_FILENAME);
|
|
106711
|
-
await
|
|
106996
|
+
await writeFile32(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
106712
106997
|
logger.debug(`Wrote manifest to: ${manifestPath}`);
|
|
106713
106998
|
}
|
|
106714
106999
|
static async readManifest(skillsDir2) {
|
|
@@ -106718,7 +107003,7 @@ class SkillsManifestManager {
|
|
|
106718
107003
|
return null;
|
|
106719
107004
|
}
|
|
106720
107005
|
try {
|
|
106721
|
-
const content = await
|
|
107006
|
+
const content = await readFile58(manifestPath, "utf-8");
|
|
106722
107007
|
const data = JSON.parse(content);
|
|
106723
107008
|
const manifest = SkillsManifestSchema.parse(data);
|
|
106724
107009
|
logger.debug(`Read manifest from: ${manifestPath}`);
|
|
@@ -106790,7 +107075,7 @@ class SkillsManifestManager {
|
|
|
106790
107075
|
files.sort();
|
|
106791
107076
|
for (const file of files) {
|
|
106792
107077
|
const relativePath = relative27(dirPath, file);
|
|
106793
|
-
const content = await
|
|
107078
|
+
const content = await readFile58(file);
|
|
106794
107079
|
hash.update(relativePath);
|
|
106795
107080
|
hash.update(content);
|
|
106796
107081
|
}
|
|
@@ -107530,7 +107815,7 @@ import { relative as relative29 } from "node:path";
|
|
|
107530
107815
|
init_skip_directories();
|
|
107531
107816
|
import { createHash as createHash8 } from "node:crypto";
|
|
107532
107817
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
107533
|
-
import { readFile as
|
|
107818
|
+
import { readFile as readFile59, readdir as readdir38 } from "node:fs/promises";
|
|
107534
107819
|
import { join as join126, relative as relative28 } from "node:path";
|
|
107535
107820
|
async function getAllFiles(dirPath) {
|
|
107536
107821
|
const files = [];
|
|
@@ -107569,7 +107854,7 @@ async function hashDirectory(dirPath) {
|
|
|
107569
107854
|
files.sort();
|
|
107570
107855
|
for (const file of files) {
|
|
107571
107856
|
const relativePath = relative28(dirPath, file);
|
|
107572
|
-
const content = await
|
|
107857
|
+
const content = await readFile59(file);
|
|
107573
107858
|
hash.update(relativePath);
|
|
107574
107859
|
hash.update(content);
|
|
107575
107860
|
}
|
|
@@ -107903,7 +108188,7 @@ import { join as join131 } from "node:path";
|
|
|
107903
108188
|
|
|
107904
108189
|
// src/services/transformers/opencode-path-transformer.ts
|
|
107905
108190
|
init_logger();
|
|
107906
|
-
import { readFile as
|
|
108191
|
+
import { readFile as readFile60, readdir as readdir40, writeFile as writeFile33 } from "node:fs/promises";
|
|
107907
108192
|
import { platform as platform15 } from "node:os";
|
|
107908
108193
|
import { extname as extname6, join as join130 } from "node:path";
|
|
107909
108194
|
var IS_WINDOWS2 = platform15() === "win32";
|
|
@@ -107974,10 +108259,10 @@ async function transformPathsForGlobalOpenCode(directory, options2 = {}) {
|
|
|
107974
108259
|
await processDirectory2(fullPath);
|
|
107975
108260
|
} else if (entry.isFile() && shouldTransformFile2(entry.name)) {
|
|
107976
108261
|
try {
|
|
107977
|
-
const content = await
|
|
108262
|
+
const content = await readFile60(fullPath, "utf-8");
|
|
107978
108263
|
const { transformed, changes } = transformOpenCodeContent(content);
|
|
107979
108264
|
if (changes > 0) {
|
|
107980
|
-
await
|
|
108265
|
+
await writeFile33(fullPath, transformed, "utf-8");
|
|
107981
108266
|
filesTransformed++;
|
|
107982
108267
|
totalChanges += changes;
|
|
107983
108268
|
if (options2.verbose) {
|
|
@@ -109136,7 +109421,7 @@ async function handleSelection(ctx) {
|
|
|
109136
109421
|
};
|
|
109137
109422
|
}
|
|
109138
109423
|
// src/commands/init/phases/sync-handler.ts
|
|
109139
|
-
import { copyFile as copyFile8, mkdir as mkdir37, open as open5, readFile as
|
|
109424
|
+
import { copyFile as copyFile8, mkdir as mkdir37, open as open5, readFile as readFile61, rename as rename12, stat as stat23, unlink as unlink13, writeFile as writeFile35 } from "node:fs/promises";
|
|
109140
109425
|
import { dirname as dirname44, join as join136, resolve as resolve47 } from "node:path";
|
|
109141
109426
|
init_logger();
|
|
109142
109427
|
init_path_resolver();
|
|
@@ -109305,7 +109590,7 @@ async function executeSyncMerge(ctx) {
|
|
|
109305
109590
|
try {
|
|
109306
109591
|
const sourceMetadataPath = join136(upstreamDir, "metadata.json");
|
|
109307
109592
|
if (await import_fs_extra38.pathExists(sourceMetadataPath)) {
|
|
109308
|
-
const content = await
|
|
109593
|
+
const content = await readFile61(sourceMetadataPath, "utf-8");
|
|
109309
109594
|
sourceMetadata = JSON.parse(content);
|
|
109310
109595
|
deletions = sourceMetadata.deletions || [];
|
|
109311
109596
|
}
|
|
@@ -109446,7 +109731,7 @@ async function executeSyncMerge(ctx) {
|
|
|
109446
109731
|
try {
|
|
109447
109732
|
const tempPath = `${currentPath}.tmp.${Date.now()}`;
|
|
109448
109733
|
try {
|
|
109449
|
-
await
|
|
109734
|
+
await writeFile35(tempPath, result.result, "utf-8");
|
|
109450
109735
|
await rename12(tempPath, currentPath);
|
|
109451
109736
|
} catch (atomicError) {
|
|
109452
109737
|
await unlink13(tempPath).catch(() => {});
|
|
@@ -109633,7 +109918,7 @@ async function renameFolders(dirsToRename, extractDir, options2) {
|
|
|
109633
109918
|
// src/services/transformers/folder-transform/path-replacer.ts
|
|
109634
109919
|
init_logger();
|
|
109635
109920
|
init_types3();
|
|
109636
|
-
import { readFile as
|
|
109921
|
+
import { readFile as readFile62, readdir as readdir43, writeFile as writeFile36 } from "node:fs/promises";
|
|
109637
109922
|
import { join as join138, relative as relative31 } from "node:path";
|
|
109638
109923
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
109639
109924
|
".md",
|
|
@@ -109700,7 +109985,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
109700
109985
|
if (!shouldTransform)
|
|
109701
109986
|
continue;
|
|
109702
109987
|
try {
|
|
109703
|
-
const content = await
|
|
109988
|
+
const content = await readFile62(fullPath, "utf-8");
|
|
109704
109989
|
let newContent = content;
|
|
109705
109990
|
let changeCount = 0;
|
|
109706
109991
|
for (const { regex: regex2, replacement } of compiledReplacements) {
|
|
@@ -109716,7 +110001,7 @@ async function transformFileContents(dir, compiledReplacements, options2) {
|
|
|
109716
110001
|
if (options2.dryRun) {
|
|
109717
110002
|
logger.debug(`[dry-run] Would update ${relative31(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
109718
110003
|
} else {
|
|
109719
|
-
await
|
|
110004
|
+
await writeFile36(fullPath, newContent, "utf-8");
|
|
109720
110005
|
logger.debug(`Updated ${relative31(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
109721
110006
|
}
|
|
109722
110007
|
filesChanged++;
|
|
@@ -109822,7 +110107,7 @@ async function transformFolderPaths(extractDir, folders, options2 = {}) {
|
|
|
109822
110107
|
|
|
109823
110108
|
// src/services/transformers/global-path-transformer.ts
|
|
109824
110109
|
init_logger();
|
|
109825
|
-
import { readFile as
|
|
110110
|
+
import { readFile as readFile63, readdir as readdir44, writeFile as writeFile37 } from "node:fs/promises";
|
|
109826
110111
|
import { homedir as homedir48, platform as platform16 } from "node:os";
|
|
109827
110112
|
import { extname as extname7, join as join139 } from "node:path";
|
|
109828
110113
|
var IS_WINDOWS3 = platform16() === "win32";
|
|
@@ -109973,12 +110258,12 @@ async function transformPathsForGlobalInstall(directory, options2 = {}) {
|
|
|
109973
110258
|
await processDirectory2(fullPath);
|
|
109974
110259
|
} else if (entry.isFile() && shouldTransformFile3(entry.name)) {
|
|
109975
110260
|
try {
|
|
109976
|
-
const content = await
|
|
110261
|
+
const content = await readFile63(fullPath, "utf-8");
|
|
109977
110262
|
const { transformed, changes } = transformContent(content, {
|
|
109978
110263
|
targetClaudeDir: options2.targetClaudeDir
|
|
109979
110264
|
});
|
|
109980
110265
|
if (changes > 0) {
|
|
109981
|
-
await
|
|
110266
|
+
await writeFile37(fullPath, transformed, "utf-8");
|
|
109982
110267
|
filesTransformed++;
|
|
109983
110268
|
totalChanges += changes;
|
|
109984
110269
|
if (options2.verbose) {
|
|
@@ -110265,7 +110550,7 @@ async function initCommand(options2) {
|
|
|
110265
110550
|
init_dist2();
|
|
110266
110551
|
var import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
110267
110552
|
import { existsSync as existsSync68 } from "node:fs";
|
|
110268
|
-
import { readFile as
|
|
110553
|
+
import { readFile as readFile67, rm as rm18, unlink as unlink14 } from "node:fs/promises";
|
|
110269
110554
|
import { homedir as homedir52 } from "node:os";
|
|
110270
110555
|
import { basename as basename30, join as join144, resolve as resolve48 } from "node:path";
|
|
110271
110556
|
init_logger();
|
|
@@ -110480,13 +110765,13 @@ init_model_taxonomy();
|
|
|
110480
110765
|
init_logger();
|
|
110481
110766
|
init_dist2();
|
|
110482
110767
|
init_model_taxonomy();
|
|
110483
|
-
import { mkdir as mkdir39, readFile as
|
|
110768
|
+
import { mkdir as mkdir39, readFile as readFile66, writeFile as writeFile39 } from "node:fs/promises";
|
|
110484
110769
|
import { homedir as homedir51 } from "node:os";
|
|
110485
110770
|
import { dirname as dirname45, join as join143 } from "node:path";
|
|
110486
110771
|
|
|
110487
110772
|
// src/commands/portable/models-dev-cache.ts
|
|
110488
110773
|
init_logger();
|
|
110489
|
-
import { mkdir as mkdir38, readFile as
|
|
110774
|
+
import { mkdir as mkdir38, readFile as readFile64, rename as rename14, writeFile as writeFile38 } from "node:fs/promises";
|
|
110490
110775
|
import { homedir as homedir49 } from "node:os";
|
|
110491
110776
|
import { join as join141 } from "node:path";
|
|
110492
110777
|
|
|
@@ -110511,7 +110796,7 @@ function tmpFilePath(cacheDir) {
|
|
|
110511
110796
|
async function readCacheEntry(cacheDir) {
|
|
110512
110797
|
const filePath = cacheFilePath(cacheDir);
|
|
110513
110798
|
try {
|
|
110514
|
-
const raw2 = await
|
|
110799
|
+
const raw2 = await readFile64(filePath, "utf-8");
|
|
110515
110800
|
const parsed = JSON.parse(raw2);
|
|
110516
110801
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && "fetchedAt" in parsed && typeof parsed.fetchedAt === "string" && "payload" in parsed && typeof parsed.payload === "object" && parsed.payload !== null) {
|
|
110517
110802
|
return parsed;
|
|
@@ -110529,7 +110814,7 @@ async function writeCacheEntry(cacheDir, entry) {
|
|
|
110529
110814
|
await mkdir38(cacheDir, { recursive: true });
|
|
110530
110815
|
const tmp = tmpFilePath(cacheDir);
|
|
110531
110816
|
const dest = cacheFilePath(cacheDir);
|
|
110532
|
-
await
|
|
110817
|
+
await writeFile38(tmp, JSON.stringify(entry), "utf-8");
|
|
110533
110818
|
await rename14(tmp, dest);
|
|
110534
110819
|
}
|
|
110535
110820
|
async function fetchCatalog(fetcher) {
|
|
@@ -110579,7 +110864,7 @@ async function getModelsDevCatalog(opts = {}) {
|
|
|
110579
110864
|
|
|
110580
110865
|
// src/commands/portable/opencode-model-discovery.ts
|
|
110581
110866
|
init_logger();
|
|
110582
|
-
import { readFile as
|
|
110867
|
+
import { readFile as readFile65 } from "node:fs/promises";
|
|
110583
110868
|
import { homedir as homedir50, platform as platform17 } from "node:os";
|
|
110584
110869
|
import { join as join142 } from "node:path";
|
|
110585
110870
|
function resolveOpenCodeAuthPath(homeDir) {
|
|
@@ -110593,7 +110878,7 @@ function resolveOpenCodeAuthPath(homeDir) {
|
|
|
110593
110878
|
async function readAuthedProviders(homeDir) {
|
|
110594
110879
|
const authPath = resolveOpenCodeAuthPath(homeDir);
|
|
110595
110880
|
try {
|
|
110596
|
-
const raw2 = await
|
|
110881
|
+
const raw2 = await readFile65(authPath, "utf-8");
|
|
110597
110882
|
const parsed = JSON.parse(raw2);
|
|
110598
110883
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
110599
110884
|
return Object.keys(parsed);
|
|
@@ -110795,7 +111080,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
110795
111080
|
const configPath = getOpenCodeConfigPath(options2);
|
|
110796
111081
|
let existing = null;
|
|
110797
111082
|
try {
|
|
110798
|
-
const raw2 = await
|
|
111083
|
+
const raw2 = await readFile66(configPath, "utf-8");
|
|
110799
111084
|
const parsed = JSON.parse(raw2);
|
|
110800
111085
|
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
110801
111086
|
existing = parsed;
|
|
@@ -110836,7 +111121,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
110836
111121
|
const chosenModel2 = response2.action === "custom" ? response2.value : suggestion2.model;
|
|
110837
111122
|
const next2 = { ...existing, model: chosenModel2 };
|
|
110838
111123
|
await mkdir39(dirname45(configPath), { recursive: true });
|
|
110839
|
-
await
|
|
111124
|
+
await writeFile39(configPath, `${JSON.stringify(next2, null, 2)}
|
|
110840
111125
|
`, "utf-8");
|
|
110841
111126
|
return { path: configPath, action: "added", model: chosenModel2, reason: suggestion2.reason };
|
|
110842
111127
|
}
|
|
@@ -110847,7 +111132,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
110847
111132
|
}
|
|
110848
111133
|
const next2 = { ...existing ?? {}, model: suggestion.model };
|
|
110849
111134
|
await mkdir39(dirname45(configPath), { recursive: true });
|
|
110850
|
-
await
|
|
111135
|
+
await writeFile39(configPath, `${JSON.stringify(next2, null, 2)}
|
|
110851
111136
|
`, "utf-8");
|
|
110852
111137
|
return {
|
|
110853
111138
|
path: configPath,
|
|
@@ -110869,7 +111154,7 @@ async function ensureOpenCodeModel(options2) {
|
|
|
110869
111154
|
const chosenModel = response.action === "custom" ? response.value : suggestion.ok ? suggestion.model : "";
|
|
110870
111155
|
const next = { ...existing ?? {}, model: chosenModel };
|
|
110871
111156
|
await mkdir39(dirname45(configPath), { recursive: true });
|
|
110872
|
-
await
|
|
111157
|
+
await writeFile39(configPath, `${JSON.stringify(next, null, 2)}
|
|
110873
111158
|
`, "utf-8");
|
|
110874
111159
|
return {
|
|
110875
111160
|
path: configPath,
|
|
@@ -111512,6 +111797,46 @@ function appendMigrationWarningMessages(target, warnings) {
|
|
|
111512
111797
|
}
|
|
111513
111798
|
}
|
|
111514
111799
|
}
|
|
111800
|
+
function appendFallbackSkillActionsToPlan(plan, skills, selectedProviders, installGlobally) {
|
|
111801
|
+
if (skills.length === 0)
|
|
111802
|
+
return plan;
|
|
111803
|
+
const existingSkillKeys = new Set(plan.actions.filter((action) => action.type === "skill").map((action) => `${action.provider}\x00${String(action.global)}\x00${action.item}`));
|
|
111804
|
+
const fallbackActions = [];
|
|
111805
|
+
for (const provider of selectedProviders.filter((entry) => getProvidersSupporting("skills").includes(entry))) {
|
|
111806
|
+
const global3 = resolvePortableTypeGlobal(provider, "skill", installGlobally);
|
|
111807
|
+
const basePath = getPortableBasePath(provider, "skills", { global: global3 });
|
|
111808
|
+
if (!basePath)
|
|
111809
|
+
continue;
|
|
111810
|
+
for (const skill of skills) {
|
|
111811
|
+
const key = `${provider}\x00${String(global3)}\x00${skill.name}`;
|
|
111812
|
+
if (existingSkillKeys.has(key))
|
|
111813
|
+
continue;
|
|
111814
|
+
existingSkillKeys.add(key);
|
|
111815
|
+
fallbackActions.push({
|
|
111816
|
+
action: "install",
|
|
111817
|
+
global: global3,
|
|
111818
|
+
isDirectoryItem: true,
|
|
111819
|
+
item: skill.name,
|
|
111820
|
+
provider,
|
|
111821
|
+
reason: "New item, not previously installed",
|
|
111822
|
+
reasonCode: "new-item",
|
|
111823
|
+
reasonCopy: "New - not previously installed",
|
|
111824
|
+
targetPath: join144(basePath, skill.name),
|
|
111825
|
+
type: "skill"
|
|
111826
|
+
});
|
|
111827
|
+
}
|
|
111828
|
+
}
|
|
111829
|
+
if (fallbackActions.length === 0)
|
|
111830
|
+
return plan;
|
|
111831
|
+
return {
|
|
111832
|
+
...plan,
|
|
111833
|
+
actions: [...plan.actions, ...fallbackActions],
|
|
111834
|
+
summary: {
|
|
111835
|
+
...plan.summary,
|
|
111836
|
+
install: plan.summary.install + fallbackActions.length
|
|
111837
|
+
}
|
|
111838
|
+
};
|
|
111839
|
+
}
|
|
111515
111840
|
async function runInstallMode(options2, discoveredItems, _selectedProviders, _installGlobally) {
|
|
111516
111841
|
const interactive = process.stdout.isTTY && !options2.yes;
|
|
111517
111842
|
if (!interactive) {
|
|
@@ -111681,6 +112006,39 @@ async function executeDeleteAction(action, options2) {
|
|
|
111681
112006
|
};
|
|
111682
112007
|
}
|
|
111683
112008
|
}
|
|
112009
|
+
function hasSuccessfulReplacementWrite(action, results) {
|
|
112010
|
+
return results.some((result) => result.success && !result.skipped && result.provider === action.provider && replacementTypeMatches(action.type, result.portableType) && replacementItemMatches(action, result) && result.path.length > 0 && resolve48(result.path) !== resolve48(action.targetPath));
|
|
112011
|
+
}
|
|
112012
|
+
function replacementTypeMatches(actionType, resultType) {
|
|
112013
|
+
return resultType === actionType || actionType === "command" && resultType === "skill";
|
|
112014
|
+
}
|
|
112015
|
+
function replacementItemMatches(action, result) {
|
|
112016
|
+
if (result.itemName === action.item || result.itemName === undefined)
|
|
112017
|
+
return true;
|
|
112018
|
+
const parts = result.path.replace(/\\/g, "/").split("/");
|
|
112019
|
+
const leaf = parts.at(-1) ?? "";
|
|
112020
|
+
const parent = parts.at(-2) ?? "";
|
|
112021
|
+
const leafName = leaf.replace(/\.[^.]+$/, "");
|
|
112022
|
+
return leafName === action.item || parent === action.item || action.type === "command" && parent === `source-command-${action.item}`;
|
|
112023
|
+
}
|
|
112024
|
+
function shouldRunDeleteAction(action, results) {
|
|
112025
|
+
if (action.reasonCode !== "path-migrated-cleanup")
|
|
112026
|
+
return true;
|
|
112027
|
+
return hasSuccessfulReplacementWrite(action, results);
|
|
112028
|
+
}
|
|
112029
|
+
function createSkippedPathMigrationCleanupResult2(action) {
|
|
112030
|
+
return {
|
|
112031
|
+
operation: "delete",
|
|
112032
|
+
portableType: action.type,
|
|
112033
|
+
itemName: action.item,
|
|
112034
|
+
provider: action.provider,
|
|
112035
|
+
providerDisplayName: providers[action.provider]?.displayName || action.provider,
|
|
112036
|
+
success: true,
|
|
112037
|
+
path: action.targetPath,
|
|
112038
|
+
skipped: true,
|
|
112039
|
+
skipReason: "Legacy path cleanup skipped because no successful replacement write was recorded"
|
|
112040
|
+
};
|
|
112041
|
+
}
|
|
111684
112042
|
async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
111685
112043
|
if (!skillSourcePath)
|
|
111686
112044
|
return;
|
|
@@ -111689,7 +112047,7 @@ async function processMetadataDeletions(skillSourcePath, installGlobally) {
|
|
|
111689
112047
|
return;
|
|
111690
112048
|
let sourceMetadata;
|
|
111691
112049
|
try {
|
|
111692
|
-
const content = await
|
|
112050
|
+
const content = await readFile67(sourceMetadataPath, "utf-8");
|
|
111693
112051
|
sourceMetadata = JSON.parse(content);
|
|
111694
112052
|
} catch (error) {
|
|
111695
112053
|
logger.debug(`[migrate] Failed to parse source metadata.json: ${error}`);
|
|
@@ -111969,7 +112327,7 @@ async function migrateCommand(options2) {
|
|
|
111969
112327
|
types: config.types?.filter((type) => type !== "skill")
|
|
111970
112328
|
})), portableTypes);
|
|
111971
112329
|
const reinstallEmptyDirs = options2.respectDeletions ? false : options2.reinstallEmptyDirs ?? true;
|
|
111972
|
-
const plan = reconcile({
|
|
112330
|
+
const plan = appendFallbackSkillActionsToPlan(reconcile({
|
|
111973
112331
|
sourceItems: sourceStates,
|
|
111974
112332
|
registry,
|
|
111975
112333
|
targetStates,
|
|
@@ -111977,13 +112335,13 @@ async function migrateCommand(options2) {
|
|
|
111977
112335
|
force: options2.force,
|
|
111978
112336
|
typeDirectoryStates,
|
|
111979
112337
|
respectDeletions: !reinstallEmptyDirs
|
|
111980
|
-
});
|
|
112338
|
+
}), effectiveSkills, selectedProviders, installGlobally);
|
|
111981
112339
|
reconcileSpinner.stop("Plan computed");
|
|
111982
112340
|
const useColor = process.stdout.isTTY && !process.env.NO_COLOR;
|
|
111983
112341
|
renderBanners(plan.banners);
|
|
111984
112342
|
displayReconcilePlan(plan, { color: useColor });
|
|
111985
112343
|
if (options2.dryRun) {
|
|
111986
|
-
displayMigrationSummary(plan,
|
|
112344
|
+
displayMigrationSummary(plan, [], { color: useColor, dryRun: true });
|
|
111987
112345
|
return;
|
|
111988
112346
|
}
|
|
111989
112347
|
if (plan.hasConflicts) {
|
|
@@ -111992,7 +112350,7 @@ async function migrateCommand(options2) {
|
|
|
111992
112350
|
for (const action of conflictActions) {
|
|
111993
112351
|
if (!action.diff && action.targetPath && existsSync68(action.targetPath)) {
|
|
111994
112352
|
try {
|
|
111995
|
-
const targetContent = await
|
|
112353
|
+
const targetContent = await readFile67(action.targetPath, "utf-8");
|
|
111996
112354
|
const sourceItem = effectiveAgents.find((a3) => a3.name === action.item) || effectiveCommands.find((c2) => c2.name === action.item) || (effectiveConfigItem?.name === action.item ? effectiveConfigItem : null) || effectiveRuleItems.find((r2) => r2.name === action.item) || effectiveHookItems.find((h2) => h2.name === action.item);
|
|
111997
112355
|
if (sourceItem) {
|
|
111998
112356
|
const providerConfig = providers[action.provider];
|
|
@@ -112086,20 +112444,6 @@ async function migrateCommand(options2) {
|
|
|
112086
112444
|
writeTasks.push({ item, provider, type: "hooks", global: action.global });
|
|
112087
112445
|
}
|
|
112088
112446
|
}
|
|
112089
|
-
const plannedSkillActions = plannedExecActions.filter((action) => action.type === "skill").length;
|
|
112090
|
-
if (effectiveSkills.length > 0 && plannedSkillActions === 0) {
|
|
112091
|
-
const skillProviders = selectedProviders.filter((pv) => getProvidersSupporting("skills").includes(pv));
|
|
112092
|
-
for (const provider of skillProviders) {
|
|
112093
|
-
for (const skill of effectiveSkills) {
|
|
112094
|
-
writeTasks.push({
|
|
112095
|
-
item: skill,
|
|
112096
|
-
provider,
|
|
112097
|
-
type: "skill",
|
|
112098
|
-
global: resolvePortableTypeGlobal(provider, "skill", installGlobally)
|
|
112099
|
-
});
|
|
112100
|
-
}
|
|
112101
|
-
}
|
|
112102
|
-
}
|
|
112103
112447
|
const progressSink = createMigrateProgressSink(writeTasks.length + plannedDeleteActions.length);
|
|
112104
112448
|
const writtenPaths = new Set;
|
|
112105
112449
|
const recordSuccessfulWrites = (task, taskResults) => {
|
|
@@ -112221,6 +112565,11 @@ async function migrateCommand(options2) {
|
|
|
112221
112565
|
}
|
|
112222
112566
|
await processMetadataDeletions(skillSource, installGlobally);
|
|
112223
112567
|
for (const deleteAction of plannedDeleteActions) {
|
|
112568
|
+
if (!shouldRunDeleteAction(deleteAction, allResults)) {
|
|
112569
|
+
allResults.push(createSkippedPathMigrationCleanupResult2(deleteAction));
|
|
112570
|
+
progressSink.tick("Cleanup");
|
|
112571
|
+
continue;
|
|
112572
|
+
}
|
|
112224
112573
|
allResults.push(await executeDeleteAction(deleteAction, {
|
|
112225
112574
|
preservePaths: writtenPaths
|
|
112226
112575
|
}));
|
|
@@ -112422,32 +112771,6 @@ function progressLabelForType(type) {
|
|
|
112422
112771
|
return "Migrating";
|
|
112423
112772
|
}
|
|
112424
112773
|
}
|
|
112425
|
-
function buildDryRunFallbackResults(skills, selectedProviders, installGlobally, plannedActions) {
|
|
112426
|
-
const plannedSkillActions = plannedActions.filter((action) => action.type === "skill").length;
|
|
112427
|
-
if (skills.length === 0 || plannedSkillActions > 0) {
|
|
112428
|
-
return [];
|
|
112429
|
-
}
|
|
112430
|
-
const results = [];
|
|
112431
|
-
for (const provider of selectedProviders.filter((entry) => getProvidersSupporting("skills").includes(entry))) {
|
|
112432
|
-
const basePath = getPortableBasePath(provider, "skills", {
|
|
112433
|
-
global: resolvePortableTypeGlobal(provider, "skill", installGlobally)
|
|
112434
|
-
});
|
|
112435
|
-
if (!basePath)
|
|
112436
|
-
continue;
|
|
112437
|
-
for (const skill of skills) {
|
|
112438
|
-
results.push({
|
|
112439
|
-
itemName: skill.name,
|
|
112440
|
-
operation: "apply",
|
|
112441
|
-
path: join144(basePath, skill.name),
|
|
112442
|
-
portableType: "skill",
|
|
112443
|
-
provider,
|
|
112444
|
-
providerDisplayName: providers[provider].displayName,
|
|
112445
|
-
success: true
|
|
112446
|
-
});
|
|
112447
|
-
}
|
|
112448
|
-
}
|
|
112449
|
-
return results;
|
|
112450
|
-
}
|
|
112451
112774
|
// src/commands/new/new-command.ts
|
|
112452
112775
|
init_logger();
|
|
112453
112776
|
init_safe_prompts();
|
|
@@ -114010,7 +114333,7 @@ init_logger();
|
|
|
114010
114333
|
init_agents();
|
|
114011
114334
|
var import_gray_matter12 = __toESM(require_gray_matter(), 1);
|
|
114012
114335
|
var import_picocolors37 = __toESM(require_picocolors(), 1);
|
|
114013
|
-
import { readFile as
|
|
114336
|
+
import { readFile as readFile68 } from "node:fs/promises";
|
|
114014
114337
|
import { join as join151 } from "node:path";
|
|
114015
114338
|
|
|
114016
114339
|
// src/commands/skills/installed-skills-inventory.ts
|
|
@@ -114066,6 +114389,7 @@ var AgentType = exports_external.enum([
|
|
|
114066
114389
|
"github-copilot",
|
|
114067
114390
|
"amp",
|
|
114068
114391
|
"kilo",
|
|
114392
|
+
"kiro",
|
|
114069
114393
|
"roo",
|
|
114070
114394
|
"windsurf",
|
|
114071
114395
|
"cline",
|
|
@@ -114189,7 +114513,7 @@ async function handleValidate2(sourcePath) {
|
|
|
114189
114513
|
for (const skill of skills) {
|
|
114190
114514
|
const skillMdPath = join151(skill.path, "SKILL.md");
|
|
114191
114515
|
try {
|
|
114192
|
-
const content = await
|
|
114516
|
+
const content = await readFile68(skillMdPath, "utf-8");
|
|
114193
114517
|
const { data } = import_gray_matter12.default(content, {
|
|
114194
114518
|
engines: { javascript: { parse: () => ({}) } }
|
|
114195
114519
|
});
|
|
@@ -114770,7 +115094,7 @@ async function detectInstallations() {
|
|
|
114770
115094
|
|
|
114771
115095
|
// src/commands/uninstall/removal-handler.ts
|
|
114772
115096
|
import { readdirSync as readdirSync12, rmSync as rmSync5 } from "node:fs";
|
|
114773
|
-
import { basename as basename33, join as join153, resolve as resolve56, sep as
|
|
115097
|
+
import { basename as basename33, join as join153, resolve as resolve56, sep as sep13 } from "node:path";
|
|
114774
115098
|
init_logger();
|
|
114775
115099
|
init_safe_prompts();
|
|
114776
115100
|
init_safe_spinner();
|
|
@@ -114956,7 +115280,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
|
|
|
114956
115280
|
try {
|
|
114957
115281
|
const resolvedPath = resolve56(filePath);
|
|
114958
115282
|
const resolvedBase = resolve56(baseDir);
|
|
114959
|
-
if (!resolvedPath.startsWith(resolvedBase +
|
|
115283
|
+
if (!resolvedPath.startsWith(resolvedBase + sep13) && resolvedPath !== resolvedBase) {
|
|
114960
115284
|
logger.debug(`Path outside installation directory: ${filePath}`);
|
|
114961
115285
|
return false;
|
|
114962
115286
|
}
|
|
@@ -114964,7 +115288,7 @@ async function isPathSafeToRemove(filePath, baseDir) {
|
|
|
114964
115288
|
if (stats.isSymbolicLink()) {
|
|
114965
115289
|
const realPath = await import_fs_extra43.realpath(filePath);
|
|
114966
115290
|
const resolvedReal = resolve56(realPath);
|
|
114967
|
-
if (!resolvedReal.startsWith(resolvedBase +
|
|
115291
|
+
if (!resolvedReal.startsWith(resolvedBase + sep13) && resolvedReal !== resolvedBase) {
|
|
114968
115292
|
logger.debug(`Symlink points outside installation directory: ${filePath} -> ${realPath}`);
|
|
114969
115293
|
return false;
|
|
114970
115294
|
}
|
|
@@ -115950,7 +116274,7 @@ function spawnAndCollect3(command, args) {
|
|
|
115950
116274
|
}
|
|
115951
116275
|
|
|
115952
116276
|
// src/commands/watch/phases/issue-processor.ts
|
|
115953
|
-
import { mkdir as mkdir40, writeFile as
|
|
116277
|
+
import { mkdir as mkdir40, writeFile as writeFile41 } from "node:fs/promises";
|
|
115954
116278
|
import { join as join156 } from "node:path";
|
|
115955
116279
|
|
|
115956
116280
|
// src/commands/watch/phases/approval-detector.ts
|
|
@@ -116585,7 +116909,7 @@ async function handlePlanGeneration(issue, state, config, setup, options2, watch
|
|
|
116585
116909
|
const planDir = join156(projectDir, "plans", "watch");
|
|
116586
116910
|
await mkdir40(planDir, { recursive: true });
|
|
116587
116911
|
const planFilePath = join156(planDir, `issue-${issue.number}-plan.md`);
|
|
116588
|
-
await
|
|
116912
|
+
await writeFile41(planFilePath, planResult.planText, "utf-8");
|
|
116589
116913
|
state.activeIssues[numStr].planPath = planFilePath;
|
|
116590
116914
|
watchLog.info(`Plan saved (fallback) to ${planFilePath}`);
|
|
116591
116915
|
} catch (err) {
|
|
@@ -116730,7 +117054,7 @@ init_ck_config_manager();
|
|
|
116730
117054
|
init_file_io();
|
|
116731
117055
|
init_logger();
|
|
116732
117056
|
import { existsSync as existsSync74 } from "node:fs";
|
|
116733
|
-
import { mkdir as mkdir41, readFile as
|
|
117057
|
+
import { mkdir as mkdir41, readFile as readFile70 } from "node:fs/promises";
|
|
116734
117058
|
import { dirname as dirname52 } from "node:path";
|
|
116735
117059
|
var PROCESSED_ISSUES_CAP = 500;
|
|
116736
117060
|
async function readCkJson(projectDir) {
|
|
@@ -116738,7 +117062,7 @@ async function readCkJson(projectDir) {
|
|
|
116738
117062
|
try {
|
|
116739
117063
|
if (!existsSync74(configPath))
|
|
116740
117064
|
return {};
|
|
116741
|
-
const content = await
|
|
117065
|
+
const content = await readFile70(configPath, "utf-8");
|
|
116742
117066
|
return JSON.parse(content);
|
|
116743
117067
|
} catch (error) {
|
|
116744
117068
|
logger.warning(`Failed to parse .ck.json: ${error instanceof Error ? error.message : "Unknown"}`);
|
|
@@ -117450,7 +117774,7 @@ init_types3();
|
|
|
117450
117774
|
init_logger();
|
|
117451
117775
|
init_path_resolver();
|
|
117452
117776
|
import { existsSync as existsSync89 } from "node:fs";
|
|
117453
|
-
import { mkdir as mkdir43, readFile as
|
|
117777
|
+
import { mkdir as mkdir43, readFile as readFile72, writeFile as writeFile44 } from "node:fs/promises";
|
|
117454
117778
|
import { join as join171 } from "node:path";
|
|
117455
117779
|
|
|
117456
117780
|
class VersionCacheManager {
|
|
@@ -117467,7 +117791,7 @@ class VersionCacheManager {
|
|
|
117467
117791
|
logger.debug("Version check cache not found");
|
|
117468
117792
|
return null;
|
|
117469
117793
|
}
|
|
117470
|
-
const content = await
|
|
117794
|
+
const content = await readFile72(cacheFile, "utf-8");
|
|
117471
117795
|
const cache5 = JSON.parse(content);
|
|
117472
117796
|
if (!cache5.lastCheck || !cache5.currentVersion || !cache5.latestVersion) {
|
|
117473
117797
|
logger.debug("Invalid cache structure, ignoring");
|
|
@@ -117487,7 +117811,7 @@ class VersionCacheManager {
|
|
|
117487
117811
|
if (!existsSync89(cacheDir)) {
|
|
117488
117812
|
await mkdir43(cacheDir, { recursive: true, mode: 448 });
|
|
117489
117813
|
}
|
|
117490
|
-
await
|
|
117814
|
+
await writeFile44(cacheFile, JSON.stringify(cache5, null, 2), "utf-8");
|
|
117491
117815
|
logger.debug(`Version check cache saved to ${cacheFile}`);
|
|
117492
117816
|
} catch (error) {
|
|
117493
117817
|
logger.debug(`Failed to save version check cache: ${error}`);
|