claudekit-cli 3.36.0-dev.16 → 3.36.0-dev.18

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.
Files changed (2) hide show
  1. package/dist/index.js +90 -44
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11183,13 +11183,11 @@ var init_provider_registry = __esm(() => {
11183
11183
  join(cwd, ".codex/config.toml"),
11184
11184
  join(cwd, ".codex/agents"),
11185
11185
  join(cwd, ".codex/prompts"),
11186
- join(cwd, ".agents/skills"),
11187
11186
  join(home, ".codex/config.toml"),
11188
11187
  join(home, ".codex/agents"),
11189
11188
  join(home, ".codex/AGENTS.md"),
11190
11189
  join(home, ".codex/instructions.md"),
11191
- join(home, ".codex/prompts"),
11192
- join(home, ".agents/skills")
11190
+ join(home, ".codex/prompts")
11193
11191
  ])
11194
11192
  },
11195
11193
  droid: {
@@ -11271,7 +11269,7 @@ var init_provider_registry = __esm(() => {
11271
11269
  },
11272
11270
  commands: null,
11273
11271
  skills: {
11274
- projectPath: ".cursor/skills",
11272
+ projectPath: ".agents/skills",
11275
11273
  globalPath: join(home, ".cursor/skills"),
11276
11274
  format: "direct-copy",
11277
11275
  writeStrategy: "per-file",
@@ -11295,7 +11293,6 @@ var init_provider_registry = __esm(() => {
11295
11293
  settingsJsonPath: null,
11296
11294
  detect: async () => hasAnyInstallSignal([
11297
11295
  join(cwd, ".cursor/rules"),
11298
- join(cwd, ".cursor/skills"),
11299
11296
  join(home, ".cursor/rules"),
11300
11297
  join(home, ".cursor/skills")
11301
11298
  ])
@@ -11409,8 +11406,8 @@ var init_provider_registry = __esm(() => {
11409
11406
  nestedCommands: false
11410
11407
  },
11411
11408
  skills: {
11412
- projectPath: ".windsurf/skills",
11413
- globalPath: join(home, ".codeium/windsurf/skills"),
11409
+ projectPath: ".agents/skills",
11410
+ globalPath: join(home, ".agents/skills"),
11414
11411
  format: "direct-copy",
11415
11412
  writeStrategy: "per-file",
11416
11413
  fileExtension: ".md"
@@ -11436,10 +11433,8 @@ var init_provider_registry = __esm(() => {
11436
11433
  settingsJsonPath: null,
11437
11434
  detect: async () => hasAnyInstallSignal([
11438
11435
  join(cwd, ".windsurf/rules"),
11439
- join(cwd, ".windsurf/skills"),
11440
11436
  join(cwd, ".windsurf/workflows"),
11441
11437
  join(home, ".codeium/windsurf/rules"),
11442
- join(home, ".codeium/windsurf/skills"),
11443
11438
  join(home, ".codeium/windsurf/workflows")
11444
11439
  ])
11445
11440
  },
@@ -11504,8 +11499,8 @@ var init_provider_registry = __esm(() => {
11504
11499
  fileExtension: ".toml"
11505
11500
  },
11506
11501
  skills: {
11507
- projectPath: ".gemini/skills",
11508
- globalPath: join(home, ".gemini/skills"),
11502
+ projectPath: ".agents/skills",
11503
+ globalPath: join(home, ".agents/skills"),
11509
11504
  format: "direct-copy",
11510
11505
  writeStrategy: "per-file",
11511
11506
  fileExtension: ".md"
@@ -11528,10 +11523,8 @@ var init_provider_registry = __esm(() => {
11528
11523
  settingsJsonPath: null,
11529
11524
  detect: async () => hasAnyInstallSignal([
11530
11525
  join(cwd, ".gemini/commands"),
11531
- join(cwd, ".gemini/skills"),
11532
11526
  join(cwd, "GEMINI.md"),
11533
11527
  join(home, ".gemini/commands"),
11534
- join(home, ".gemini/skills"),
11535
11528
  join(home, ".gemini/GEMINI.md")
11536
11529
  ])
11537
11530
  },
@@ -11572,11 +11565,9 @@ var init_provider_registry = __esm(() => {
11572
11565
  settingsJsonPath: null,
11573
11566
  detect: async () => hasAnyInstallSignal([
11574
11567
  join(cwd, ".amp/rules"),
11575
- join(cwd, ".agents/skills"),
11576
11568
  join(cwd, "AGENT.md"),
11577
- join(home, ".config/AGENT.md"),
11578
11569
  join(home, ".config/amp/rules"),
11579
- join(home, ".config/agents/skills")
11570
+ join(home, ".config/AGENT.md")
11580
11571
  ])
11581
11572
  },
11582
11573
  antigravity: {
@@ -12972,39 +12963,64 @@ async function cleanupStaleCodexConfigEntries(options2) {
12972
12963
  return [];
12973
12964
  try {
12974
12965
  return await withCodexTargetLock(configTomlPath, async () => {
12975
- const existing = await readFile3(configTomlPath, "utf-8");
12976
- const managedEntries = extractManagedAgentEntries(existing);
12977
- if (managedEntries.size === 0)
12978
- return [];
12979
- const staleSlugs = [];
12980
- const validEntries = new Map;
12981
- for (const [slug, entry] of managedEntries) {
12966
+ let content = await readFile3(configTomlPath, "utf-8");
12967
+ const allStaleSlugs = [];
12968
+ const managedEntries = extractManagedAgentEntries(content);
12969
+ if (managedEntries.size > 0) {
12970
+ const validEntries = new Map;
12971
+ for (const [slug, entry] of managedEntries) {
12972
+ const tomlPath = join3(agentsDir, `${slug}.toml`);
12973
+ if (existsSync3(tomlPath)) {
12974
+ validEntries.set(slug, entry);
12975
+ } else {
12976
+ allStaleSlugs.push(slug);
12977
+ }
12978
+ }
12979
+ if (allStaleSlugs.length > 0) {
12980
+ if (validEntries.size === 0) {
12981
+ const analysis2 = analyzeConfigToml(content);
12982
+ content = analysis2.unmanagedContent;
12983
+ } else {
12984
+ const sortedEntries = [...validEntries.entries()].sort(([a3], [b3]) => a3.localeCompare(b3)).map(([, entry]) => entry);
12985
+ const managedBlock = sortedEntries.join(`
12986
+
12987
+ `);
12988
+ const mergeResult = mergeConfigTomlWithDiagnostics(content, managedBlock);
12989
+ if (mergeResult.error) {
12990
+ logger.verbose(`[codex-cleanup] Phase 1 merge failed: ${mergeResult.error}`);
12991
+ } else {
12992
+ content = mergeResult.content;
12993
+ }
12994
+ }
12995
+ }
12996
+ }
12997
+ const analysis = analyzeConfigToml(content);
12998
+ const unmanagedSlugs = extractUnmanagedAgentSlugs(analysis.unmanagedContent);
12999
+ const legacyStaleSlugs = [];
13000
+ for (const slug of unmanagedSlugs) {
12982
13001
  const tomlPath = join3(agentsDir, `${slug}.toml`);
12983
- if (existsSync3(tomlPath)) {
12984
- validEntries.set(slug, entry);
12985
- } else {
12986
- staleSlugs.push(slug);
13002
+ if (!isPathWithinBoundary(tomlPath, agentsDir))
13003
+ continue;
13004
+ if (!existsSync3(tomlPath)) {
13005
+ legacyStaleSlugs.push(slug);
12987
13006
  }
12988
13007
  }
12989
- if (staleSlugs.length === 0)
12990
- return [];
12991
- if (validEntries.size === 0) {
12992
- const analysis = analyzeConfigToml(existing);
12993
- await writeFile2(configTomlPath, analysis.unmanagedContent, "utf-8");
12994
- } else {
12995
- const sortedEntries = [...validEntries.entries()].sort(([a3], [b3]) => a3.localeCompare(b3)).map(([, entry]) => entry);
12996
- const managedBlock = sortedEntries.join(`
13008
+ if (legacyStaleSlugs.length > 0) {
13009
+ for (const slug of legacyStaleSlugs) {
13010
+ const escapedSlug = slug.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
13011
+ const blockRegex = new RegExp(`\\n?^\\[agents\\.(?:"${escapedSlug}"|${escapedSlug})\\]\\s*\\r?\\n(?:(?!\\[)[^\\r\\n]*\\r?\\n?)*`, "gm");
13012
+ content = content.replace(blockRegex, "");
13013
+ }
13014
+ content = content.replace(/\n{3,}/g, `
12997
13015
 
12998
13016
  `);
12999
- const mergeResult = mergeConfigTomlWithDiagnostics(existing, managedBlock);
13000
- if (mergeResult.error) {
13001
- logger.verbose(`[codex-cleanup] Failed to merge config.toml: ${mergeResult.error}`);
13002
- return [];
13003
- }
13004
- await writeFile2(configTomlPath, mergeResult.content, "utf-8");
13017
+ allStaleSlugs.push(...legacyStaleSlugs);
13005
13018
  }
13006
- logger.verbose(`[codex-cleanup] Removed ${staleSlugs.length} stale config.toml entries: ${staleSlugs.join(", ")}`);
13007
- return staleSlugs;
13019
+ if (allStaleSlugs.length === 0)
13020
+ return [];
13021
+ await writeFile2(configTomlPath, content, "utf-8");
13022
+ logger.verbose(`[codex-cleanup] Removed ${allStaleSlugs.length} stale config.toml entries: ${allStaleSlugs.join(", ")}`);
13023
+ return allStaleSlugs;
13008
13024
  });
13009
13025
  } catch (error) {
13010
13026
  logger.verbose(`[codex-cleanup] Failed to clean up config.toml: ${error instanceof Error ? error.message : "Unknown"}`);
@@ -52161,6 +52177,35 @@ function registerMigrationRoutes(app) {
52161
52177
  deleteResult.itemName = deleteAction.item;
52162
52178
  allResults.push(deleteResult);
52163
52179
  }
52180
+ for (const provider of allPlanProviders) {
52181
+ if (providers[provider]?.agents?.writeStrategy !== "codex-toml")
52182
+ continue;
52183
+ const providerScopes = [
52184
+ ...new Set(plan.actions.filter((a3) => a3.provider === provider).map((a3) => a3.global).filter((g2) => g2 !== undefined))
52185
+ ];
52186
+ if (providerScopes.length === 0)
52187
+ providerScopes.push(false);
52188
+ for (const scope of providerScopes) {
52189
+ const staleSlugs = await cleanupStaleCodexConfigEntries({
52190
+ global: scope,
52191
+ provider
52192
+ });
52193
+ if (staleSlugs.length > 0) {
52194
+ const staleSlugSet = new Set(staleSlugs.map((s) => `${s}.toml`));
52195
+ await removeInstallationsByFilter((i) => i.type === "agent" && i.provider === provider && i.global === scope && staleSlugSet.has(basename7(i.path)));
52196
+ }
52197
+ }
52198
+ }
52199
+ try {
52200
+ const agentSrc = getAgentSourcePath();
52201
+ const cmdSrc = getCommandSourcePath();
52202
+ const skillSrc = getSkillSourcePath();
52203
+ const kitRoot = (agentSrc ? resolve8(agentSrc, "..") : null) ?? (cmdSrc ? resolve8(cmdSrc, "..") : null) ?? (skillSrc ? resolve8(skillSrc, "..") : null) ?? null;
52204
+ const manifest = kitRoot ? await loadPortableManifest(kitRoot) : null;
52205
+ if (manifest?.cliVersion) {
52206
+ await updateAppliedManifestVersion(manifest.cliVersion);
52207
+ }
52208
+ } catch {}
52164
52209
  const sortedResults2 = sortPortableInstallResults(allResults);
52165
52210
  const counts2 = toExecutionCounts(sortedResults2);
52166
52211
  const planScopes = [
@@ -52338,6 +52383,7 @@ var init_migration_routes = __esm(() => {
52338
52383
  init_commands_discovery();
52339
52384
  init_skill_directory_installer();
52340
52385
  init_checksum_utils();
52386
+ init_codex_toml_installer();
52341
52387
  init_config_discovery();
52342
52388
  init_hooks_settings_merger();
52343
52389
  init_portable_installer();
@@ -56087,7 +56133,7 @@ var package_default;
56087
56133
  var init_package = __esm(() => {
56088
56134
  package_default = {
56089
56135
  name: "claudekit-cli",
56090
- version: "3.36.0-dev.16",
56136
+ version: "3.36.0-dev.18",
56091
56137
  description: "CLI tool for bootstrapping and updating ClaudeKit projects",
56092
56138
  type: "module",
56093
56139
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudekit-cli",
3
- "version": "3.36.0-dev.16",
3
+ "version": "3.36.0-dev.18",
4
4
  "description": "CLI tool for bootstrapping and updating ClaudeKit projects",
5
5
  "type": "module",
6
6
  "repository": {