claudekit-cli 3.37.0-dev.2 → 3.37.0-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +251 -37
- package/dist/ui/assets/index-Dq4Gg9PL.js +243 -0
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-Bccw6yFF.js +0 -221
package/dist/index.js
CHANGED
|
@@ -42221,6 +42221,68 @@ var init_claudekit_data = __esm(() => {
|
|
|
42221
42221
|
});
|
|
42222
42222
|
|
|
42223
42223
|
// src/types/ck-config.ts
|
|
42224
|
+
function normalizeMigrateProviderToken(token) {
|
|
42225
|
+
const trimmed = token.trim();
|
|
42226
|
+
const unwrapped = trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'") ? trimmed.slice(1, -1) : trimmed;
|
|
42227
|
+
return unwrapped.trim().toLowerCase();
|
|
42228
|
+
}
|
|
42229
|
+
function parseMigrateProvidersString(value) {
|
|
42230
|
+
const trimmed = value.trim();
|
|
42231
|
+
if (!trimmed)
|
|
42232
|
+
return [];
|
|
42233
|
+
try {
|
|
42234
|
+
const parsed = JSON.parse(trimmed);
|
|
42235
|
+
if (typeof parsed === "string" || Array.isArray(parsed)) {
|
|
42236
|
+
return parsed;
|
|
42237
|
+
}
|
|
42238
|
+
} catch {}
|
|
42239
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
42240
|
+
return trimmed.slice(1, -1).split(",").map((part) => part.trim()).filter(Boolean);
|
|
42241
|
+
}
|
|
42242
|
+
return trimmed;
|
|
42243
|
+
}
|
|
42244
|
+
function normalizeMigrateProviderList(value) {
|
|
42245
|
+
const parts = value.map(normalizeMigrateProviderToken).filter(Boolean).filter((part, index, list) => list.indexOf(part) === index);
|
|
42246
|
+
if (parts.length === 0 || parts.length === 1 && parts[0] === "auto") {
|
|
42247
|
+
return "auto";
|
|
42248
|
+
}
|
|
42249
|
+
return parts.filter((part) => part !== "auto");
|
|
42250
|
+
}
|
|
42251
|
+
function normalizeMigrateProvidersValue(value) {
|
|
42252
|
+
if (typeof value === "string") {
|
|
42253
|
+
const parsed = parseMigrateProvidersString(value);
|
|
42254
|
+
const parts = Array.isArray(parsed) ? parsed : String(parsed).split(",");
|
|
42255
|
+
return normalizeMigrateProviderList(parts);
|
|
42256
|
+
}
|
|
42257
|
+
if (Array.isArray(value)) {
|
|
42258
|
+
return normalizeMigrateProviderList(value.filter((item) => typeof item === "string"));
|
|
42259
|
+
}
|
|
42260
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
42261
|
+
return normalizeMigrateProvidersValue(String(value));
|
|
42262
|
+
}
|
|
42263
|
+
return value;
|
|
42264
|
+
}
|
|
42265
|
+
function normalizeMigrateProvidersInput(value) {
|
|
42266
|
+
const normalized = normalizeMigrateProvidersValue(value);
|
|
42267
|
+
if (normalized === "auto" || Array.isArray(normalized)) {
|
|
42268
|
+
return normalized;
|
|
42269
|
+
}
|
|
42270
|
+
return normalizeMigrateProviderList(String(normalized).split(","));
|
|
42271
|
+
}
|
|
42272
|
+
function normalizeCkConfigInput(value) {
|
|
42273
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
42274
|
+
return value;
|
|
42275
|
+
}
|
|
42276
|
+
const normalized = structuredClone(value);
|
|
42277
|
+
const updatePipeline = normalized.updatePipeline;
|
|
42278
|
+
if (updatePipeline && typeof updatePipeline === "object" && !Array.isArray(updatePipeline)) {
|
|
42279
|
+
const pipeline = updatePipeline;
|
|
42280
|
+
if ("migrateProviders" in pipeline) {
|
|
42281
|
+
pipeline.migrateProviders = normalizeMigrateProvidersValue(pipeline.migrateProviders);
|
|
42282
|
+
}
|
|
42283
|
+
}
|
|
42284
|
+
return normalized;
|
|
42285
|
+
}
|
|
42224
42286
|
var PlanValidationModeSchema, PlanFocusAreaSchema, PlanResolutionOrderSchema, ProjectTypeSchema, PackageManagerSchema, FrameworkSchema, GeminiModelSchema, StatuslineModeSchema, CodingLevelSchema, PlanResolutionSchema, PlanValidationSchema, CkPlanConfigSchema, CkDocsConfigSchema, CkPathsConfigSchema, CkLocaleConfigSchema, CkTrustConfigSchema, CkProjectConfigSchema, CkGeminiConfigSchema, CkSkillsConfigSchema, UpdatePipelineSchema, ResolvedModelConfigSchema, ModelTierMapSchema, CkModelTaxonomySchema, CkAssertionSchema, CkHooksConfigSchema, CkConfigSchema, DEFAULT_CK_CONFIG, CK_HOOK_NAMES;
|
|
42225
42287
|
var init_ck_config = __esm(() => {
|
|
42226
42288
|
init_zod();
|
|
@@ -42447,6 +42509,8 @@ var init_ck_config = __esm(() => {
|
|
|
42447
42509
|
// src/types/index.ts
|
|
42448
42510
|
var exports_types = {};
|
|
42449
42511
|
__export(exports_types, {
|
|
42512
|
+
normalizeMigrateProvidersInput: () => normalizeMigrateProvidersInput,
|
|
42513
|
+
normalizeCkConfigInput: () => normalizeCkConfigInput,
|
|
42450
42514
|
isValidKitType: () => isValidKitType,
|
|
42451
42515
|
VidcapOptionsSchema: () => VidcapOptionsSchema,
|
|
42452
42516
|
VersionCommandOptionsSchema: () => VersionCommandOptionsSchema,
|
|
@@ -42809,7 +42873,7 @@ class CkConfigManager {
|
|
|
42809
42873
|
if (!existsSync12(configPath))
|
|
42810
42874
|
return null;
|
|
42811
42875
|
const content = await readFile8(configPath, "utf-8");
|
|
42812
|
-
const data = JSON.parse(content);
|
|
42876
|
+
const data = normalizeCkConfigInput(JSON.parse(content));
|
|
42813
42877
|
return CkConfigSchema.parse(data);
|
|
42814
42878
|
} catch (error) {
|
|
42815
42879
|
logger.warning(`Failed to load config from ${configPath}: ${error instanceof Error ? error.message : "Unknown"}`);
|
|
@@ -42863,7 +42927,7 @@ class CkConfigManager {
|
|
|
42863
42927
|
};
|
|
42864
42928
|
}
|
|
42865
42929
|
static async saveFull(config, scope, projectDir) {
|
|
42866
|
-
const validConfig = CkConfigSchema.parse(config);
|
|
42930
|
+
const validConfig = CkConfigSchema.parse(normalizeCkConfigInput(config));
|
|
42867
42931
|
const configPath = scope === "global" ? CkConfigManager.getGlobalConfigPath() : projectDir ? CkConfigManager.getProjectConfigPath(projectDir) : null;
|
|
42868
42932
|
if (!configPath) {
|
|
42869
42933
|
throw new Error("Project directory required for project scope");
|
|
@@ -48565,7 +48629,7 @@ function registerCkConfigRoutes(app) {
|
|
|
48565
48629
|
res.status(400).json({ error: "Invalid config payload" });
|
|
48566
48630
|
return;
|
|
48567
48631
|
}
|
|
48568
|
-
const parseResult = CkConfigSchema.safeParse(config);
|
|
48632
|
+
const parseResult = CkConfigSchema.safeParse(normalizeCkConfigInput(config));
|
|
48569
48633
|
if (!parseResult.success) {
|
|
48570
48634
|
res.status(400).json({
|
|
48571
48635
|
error: "Config validation failed",
|
|
@@ -49787,17 +49851,22 @@ var init_config_discovery = __esm(() => {
|
|
|
49787
49851
|
// src/commands/portable/hooks-settings-merger.ts
|
|
49788
49852
|
import { existsSync as existsSync22, mkdirSync, renameSync, rmSync, writeFileSync as writeFileSync2 } from "node:fs";
|
|
49789
49853
|
import { basename as basename8, dirname as dirname9, join as join32 } from "node:path";
|
|
49790
|
-
async function
|
|
49854
|
+
async function inspectHooksSettings(settingsPath) {
|
|
49791
49855
|
try {
|
|
49792
|
-
if (!existsSync22(settingsPath))
|
|
49793
|
-
return
|
|
49856
|
+
if (!existsSync22(settingsPath)) {
|
|
49857
|
+
return { status: "missing-file" };
|
|
49858
|
+
}
|
|
49794
49859
|
const raw = await Bun.file(settingsPath).text();
|
|
49795
49860
|
const parsed = JSON.parse(raw);
|
|
49796
|
-
if (!parsed.hooks || typeof parsed.hooks !== "object")
|
|
49797
|
-
return
|
|
49798
|
-
|
|
49799
|
-
|
|
49800
|
-
|
|
49861
|
+
if (!parsed.hooks || typeof parsed.hooks !== "object") {
|
|
49862
|
+
return { status: "missing-hooks" };
|
|
49863
|
+
}
|
|
49864
|
+
return { status: "ok", hooks: parsed.hooks };
|
|
49865
|
+
} catch (error) {
|
|
49866
|
+
return {
|
|
49867
|
+
status: "invalid-json",
|
|
49868
|
+
error: error instanceof Error ? error.message : String(error)
|
|
49869
|
+
};
|
|
49801
49870
|
}
|
|
49802
49871
|
}
|
|
49803
49872
|
function rewriteHookPaths(hooks, sourceHooksDir, targetHooksDir) {
|
|
@@ -49916,33 +49985,99 @@ function deduplicateMerge(existing, incoming) {
|
|
|
49916
49985
|
async function migrateHooksSettings(options2) {
|
|
49917
49986
|
const { sourceProvider, targetProvider, installedHookFiles, global: isGlobal } = options2;
|
|
49918
49987
|
if (installedHookFiles.length === 0) {
|
|
49919
|
-
return {
|
|
49988
|
+
return {
|
|
49989
|
+
status: "no-installed-files",
|
|
49990
|
+
success: true,
|
|
49991
|
+
backupPath: null,
|
|
49992
|
+
hooksRegistered: 0,
|
|
49993
|
+
sourceSettingsPath: null,
|
|
49994
|
+
targetSettingsPath: null
|
|
49995
|
+
};
|
|
49920
49996
|
}
|
|
49921
49997
|
const sourceConfig = providers[sourceProvider];
|
|
49922
49998
|
const targetConfig = providers[targetProvider];
|
|
49923
49999
|
if (!sourceConfig.settingsJsonPath) {
|
|
49924
50000
|
return {
|
|
50001
|
+
status: "unsupported-source",
|
|
49925
50002
|
success: true,
|
|
49926
50003
|
backupPath: null,
|
|
49927
50004
|
hooksRegistered: 0,
|
|
49928
|
-
message: `Hook settings migration from ${sourceProvider} not supported (no hooks configuration)
|
|
50005
|
+
message: `Hook settings migration from ${sourceProvider} not supported (no hooks configuration)`,
|
|
50006
|
+
sourceSettingsPath: null,
|
|
50007
|
+
targetSettingsPath: null
|
|
49929
50008
|
};
|
|
49930
50009
|
}
|
|
49931
50010
|
const sourceSettingsPath = isGlobal ? sourceConfig.settingsJsonPath?.globalPath : sourceConfig.settingsJsonPath?.projectPath;
|
|
49932
50011
|
const targetSettingsPath = isGlobal ? targetConfig.settingsJsonPath?.globalPath : targetConfig.settingsJsonPath?.projectPath;
|
|
49933
|
-
if (!sourceSettingsPath
|
|
50012
|
+
if (!sourceSettingsPath) {
|
|
50013
|
+
return {
|
|
50014
|
+
status: "unsupported-source",
|
|
50015
|
+
success: true,
|
|
50016
|
+
backupPath: null,
|
|
50017
|
+
hooksRegistered: 0,
|
|
50018
|
+
message: `Hook settings migration from ${sourceProvider} not supported for ${isGlobal ? "global" : "project"} scope`,
|
|
50019
|
+
sourceSettingsPath: null,
|
|
50020
|
+
targetSettingsPath: targetSettingsPath ?? null
|
|
50021
|
+
};
|
|
50022
|
+
}
|
|
50023
|
+
if (!targetSettingsPath) {
|
|
49934
50024
|
return {
|
|
50025
|
+
status: "unsupported-target",
|
|
49935
50026
|
success: false,
|
|
49936
50027
|
backupPath: null,
|
|
49937
50028
|
hooksRegistered: 0,
|
|
49938
|
-
error: `Provider ${
|
|
50029
|
+
error: `Provider ${targetProvider} does not support hook registration for ${isGlobal ? "global" : "project"} scope`,
|
|
50030
|
+
sourceSettingsPath,
|
|
50031
|
+
targetSettingsPath: null
|
|
49939
50032
|
};
|
|
49940
50033
|
}
|
|
49941
50034
|
const resolvedSourcePath = isGlobal ? sourceSettingsPath : join32(process.cwd(), sourceSettingsPath);
|
|
49942
50035
|
const resolvedTargetPath = isGlobal ? targetSettingsPath : join32(process.cwd(), targetSettingsPath);
|
|
49943
|
-
const
|
|
50036
|
+
const sourceHooksResult = await inspectHooksSettings(resolvedSourcePath);
|
|
50037
|
+
if (sourceHooksResult.status === "missing-file") {
|
|
50038
|
+
return {
|
|
50039
|
+
status: "source-settings-missing",
|
|
50040
|
+
success: true,
|
|
50041
|
+
backupPath: null,
|
|
50042
|
+
hooksRegistered: 0,
|
|
50043
|
+
message: `Hook files were copied, but source hook registrations were not found at ${resolvedSourcePath}; ${resolvedTargetPath} was not updated.`,
|
|
50044
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50045
|
+
targetSettingsPath: resolvedTargetPath
|
|
50046
|
+
};
|
|
50047
|
+
}
|
|
50048
|
+
if (sourceHooksResult.status === "missing-hooks") {
|
|
50049
|
+
return {
|
|
50050
|
+
status: "source-hooks-missing",
|
|
50051
|
+
success: true,
|
|
50052
|
+
backupPath: null,
|
|
50053
|
+
hooksRegistered: 0,
|
|
50054
|
+
message: `Hook files were copied, but ${resolvedSourcePath} does not define a hooks section; ${resolvedTargetPath} was not updated.`,
|
|
50055
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50056
|
+
targetSettingsPath: resolvedTargetPath
|
|
50057
|
+
};
|
|
50058
|
+
}
|
|
50059
|
+
if (sourceHooksResult.status === "invalid-json") {
|
|
50060
|
+
return {
|
|
50061
|
+
status: "source-settings-invalid",
|
|
50062
|
+
success: false,
|
|
50063
|
+
backupPath: null,
|
|
50064
|
+
hooksRegistered: 0,
|
|
50065
|
+
error: `Hook files were copied, but source hook registrations could not be read from ${resolvedSourcePath}: ${sourceHooksResult.error || "invalid JSON"}. ${resolvedTargetPath} was not updated.`,
|
|
50066
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50067
|
+
targetSettingsPath: resolvedTargetPath
|
|
50068
|
+
};
|
|
50069
|
+
}
|
|
50070
|
+
const sourceHooks = sourceHooksResult.hooks;
|
|
49944
50071
|
if (!sourceHooks) {
|
|
49945
|
-
return {
|
|
50072
|
+
return {
|
|
50073
|
+
status: "source-settings-invalid",
|
|
50074
|
+
success: false,
|
|
50075
|
+
backupPath: null,
|
|
50076
|
+
hooksRegistered: 0,
|
|
50077
|
+
error: `Hook files were copied, but source hook registrations could not be read from ${resolvedSourcePath}. ${resolvedTargetPath} was not updated.`,
|
|
50078
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50079
|
+
targetSettingsPath: resolvedTargetPath
|
|
50080
|
+
};
|
|
49946
50081
|
}
|
|
49947
50082
|
const sourceHooksDir = isGlobal ? sourceConfig.hooks?.globalPath ?? "" : sourceConfig.hooks?.projectPath ?? "";
|
|
49948
50083
|
const targetHooksDir = isGlobal ? targetConfig.hooks?.globalPath ?? "" : targetConfig.hooks?.projectPath ?? "";
|
|
@@ -49955,17 +50090,35 @@ async function migrateHooksSettings(options2) {
|
|
|
49955
50090
|
}
|
|
49956
50091
|
}
|
|
49957
50092
|
if (hooksRegistered === 0) {
|
|
49958
|
-
return {
|
|
50093
|
+
return {
|
|
50094
|
+
status: "no-matching-hooks",
|
|
50095
|
+
success: true,
|
|
50096
|
+
backupPath: null,
|
|
50097
|
+
hooksRegistered: 0,
|
|
50098
|
+
message: `Hook files were copied, but none of the installed hooks matched registrations from ${resolvedSourcePath}; ${resolvedTargetPath} was not updated.`,
|
|
50099
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50100
|
+
targetSettingsPath: resolvedTargetPath
|
|
50101
|
+
};
|
|
49959
50102
|
}
|
|
49960
50103
|
try {
|
|
49961
50104
|
const { backupPath } = await mergeHooksIntoSettings(resolvedTargetPath, rewritten);
|
|
49962
|
-
return {
|
|
50105
|
+
return {
|
|
50106
|
+
status: "registered",
|
|
50107
|
+
success: true,
|
|
50108
|
+
backupPath,
|
|
50109
|
+
hooksRegistered,
|
|
50110
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50111
|
+
targetSettingsPath: resolvedTargetPath
|
|
50112
|
+
};
|
|
49963
50113
|
} catch (err) {
|
|
49964
50114
|
return {
|
|
50115
|
+
status: "merge-failed",
|
|
49965
50116
|
success: false,
|
|
49966
50117
|
backupPath: null,
|
|
49967
50118
|
hooksRegistered: 0,
|
|
49968
|
-
error: `Failed to merge
|
|
50119
|
+
error: `Failed to merge hook registrations into ${resolvedTargetPath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
50120
|
+
sourceSettingsPath: resolvedSourcePath,
|
|
50121
|
+
targetSettingsPath: resolvedTargetPath
|
|
49969
50122
|
};
|
|
49970
50123
|
}
|
|
49971
50124
|
}
|
|
@@ -52913,6 +53066,46 @@ function tagResults(results, portableType, itemName) {
|
|
|
52913
53066
|
}
|
|
52914
53067
|
}
|
|
52915
53068
|
}
|
|
53069
|
+
function isHookRegistrationFailure(status) {
|
|
53070
|
+
return status === "source-settings-invalid" || status === "unsupported-target" || status === "merge-failed";
|
|
53071
|
+
}
|
|
53072
|
+
function createHookRegistrationFeedbackResult(provider, mergeResult) {
|
|
53073
|
+
if (mergeResult.status === "registered" || mergeResult.status === "no-installed-files") {
|
|
53074
|
+
return null;
|
|
53075
|
+
}
|
|
53076
|
+
const message = mergeResult.error || mergeResult.message;
|
|
53077
|
+
if (!message)
|
|
53078
|
+
return null;
|
|
53079
|
+
const failed = isHookRegistrationFailure(mergeResult.status);
|
|
53080
|
+
return {
|
|
53081
|
+
provider,
|
|
53082
|
+
providerDisplayName: providers[provider]?.displayName || provider,
|
|
53083
|
+
success: !failed,
|
|
53084
|
+
skipped: !failed,
|
|
53085
|
+
path: mergeResult.targetSettingsPath ?? "",
|
|
53086
|
+
error: failed ? message : undefined,
|
|
53087
|
+
skipReason: failed ? undefined : message,
|
|
53088
|
+
portableType: "hooks",
|
|
53089
|
+
itemName: "hook registration"
|
|
53090
|
+
};
|
|
53091
|
+
}
|
|
53092
|
+
function recordHookRegistrationOutcome(provider, mergeResult, warnings, feedbackResults) {
|
|
53093
|
+
if (mergeResult.success && mergeResult.hooksRegistered > 0) {
|
|
53094
|
+
console.info(`[migrate] Registered ${mergeResult.hooksRegistered} hook(s) in ${provider} settings.json`);
|
|
53095
|
+
return;
|
|
53096
|
+
}
|
|
53097
|
+
const message = mergeResult.error || mergeResult.message;
|
|
53098
|
+
if (message && !warnings.includes(message)) {
|
|
53099
|
+
warnings.push(message);
|
|
53100
|
+
}
|
|
53101
|
+
if (message) {
|
|
53102
|
+
console.warn(`[migrate] ${message}`);
|
|
53103
|
+
}
|
|
53104
|
+
const feedback = createHookRegistrationFeedbackResult(provider, mergeResult);
|
|
53105
|
+
if (feedback) {
|
|
53106
|
+
feedbackResults.push(feedback);
|
|
53107
|
+
}
|
|
53108
|
+
}
|
|
52916
53109
|
async function discoverMigrationItems(include, configSource) {
|
|
52917
53110
|
const agentsSource = include.agents ? getAgentSourcePath() : null;
|
|
52918
53111
|
const commandsSource = include.commands ? getCommandSourcePath() : null;
|
|
@@ -53292,7 +53485,9 @@ function registerMigrationRoutes(app) {
|
|
|
53292
53485
|
const ruleByName = new Map(discovered2.ruleItems.map((item) => [item.name, item]));
|
|
53293
53486
|
const hookByName = new Map(discovered2.hookItems.map((item) => [item.name, item]));
|
|
53294
53487
|
const allResults = [];
|
|
53295
|
-
const
|
|
53488
|
+
const warnings2 = [];
|
|
53489
|
+
const hookRegistrationResults2 = [];
|
|
53490
|
+
const successfulHookFiles2 = new Map;
|
|
53296
53491
|
for (const action of execActions) {
|
|
53297
53492
|
const provider = action.provider;
|
|
53298
53493
|
const installOpts = { global: action.global };
|
|
@@ -53356,16 +53551,16 @@ function registerMigrationRoutes(app) {
|
|
|
53356
53551
|
tagResults(batch, "hooks", action.item);
|
|
53357
53552
|
allResults.push(...batch);
|
|
53358
53553
|
for (const r2 of batch.filter((r3) => r3.success && !r3.skipped)) {
|
|
53359
|
-
const entry =
|
|
53554
|
+
const entry = successfulHookFiles2.get(provider) ?? {
|
|
53360
53555
|
files: [],
|
|
53361
53556
|
global: action.global
|
|
53362
53557
|
};
|
|
53363
53558
|
entry.files.push(basename9(r2.path));
|
|
53364
|
-
|
|
53559
|
+
successfulHookFiles2.set(provider, entry);
|
|
53365
53560
|
}
|
|
53366
53561
|
}
|
|
53367
53562
|
}
|
|
53368
|
-
for (const [hooksProvider, entry] of
|
|
53563
|
+
for (const [hooksProvider, entry] of successfulHookFiles2) {
|
|
53369
53564
|
if (entry.files.length === 0)
|
|
53370
53565
|
continue;
|
|
53371
53566
|
const mergeResult = await migrateHooksSettings({
|
|
@@ -53374,11 +53569,7 @@ function registerMigrationRoutes(app) {
|
|
|
53374
53569
|
installedHookFiles: entry.files,
|
|
53375
53570
|
global: entry.global
|
|
53376
53571
|
});
|
|
53377
|
-
|
|
53378
|
-
console.info(`[migrate] Registered ${mergeResult.hooksRegistered} hook(s) in ${hooksProvider} settings.json`);
|
|
53379
|
-
} else if (!mergeResult.success) {
|
|
53380
|
-
console.warn(`[migrate] Failed to register hooks in ${hooksProvider} settings.json: ${mergeResult.error}`);
|
|
53381
|
-
}
|
|
53572
|
+
recordHookRegistrationOutcome(hooksProvider, mergeResult, warnings2, hookRegistrationResults2);
|
|
53382
53573
|
}
|
|
53383
53574
|
const allPlanProviders = getProvidersFromPlan(plan);
|
|
53384
53575
|
const plannedSkillActions = execActions.filter((a3) => a3.type === "skill").length;
|
|
@@ -53435,7 +53626,8 @@ function registerMigrationRoutes(app) {
|
|
|
53435
53626
|
await updateAppliedManifestVersion(manifest.cliVersion);
|
|
53436
53627
|
}
|
|
53437
53628
|
} catch {}
|
|
53438
|
-
const
|
|
53629
|
+
const responseResults2 = [...allResults, ...hookRegistrationResults2];
|
|
53630
|
+
const sortedResults2 = sortPortableInstallResults(responseResults2);
|
|
53439
53631
|
const counts2 = toExecutionCounts(sortedResults2);
|
|
53440
53632
|
const planScopes = [
|
|
53441
53633
|
...new Set(plan.actions.map((a3) => a3.global).filter((s) => s !== undefined))
|
|
@@ -53444,9 +53636,9 @@ function registerMigrationRoutes(app) {
|
|
|
53444
53636
|
annotateResultsWithCollisions(sortedResults2, providerCollisions2);
|
|
53445
53637
|
res.status(200).json({
|
|
53446
53638
|
results: sortedResults2,
|
|
53447
|
-
warnings:
|
|
53639
|
+
warnings: warnings2,
|
|
53448
53640
|
counts: counts2,
|
|
53449
|
-
discovery: toDiscoveryCounts(
|
|
53641
|
+
discovery: toDiscoveryCounts(allResults),
|
|
53450
53642
|
providerCollisions: providerCollisions2
|
|
53451
53643
|
});
|
|
53452
53644
|
return;
|
|
@@ -53504,6 +53696,8 @@ function registerMigrationRoutes(app) {
|
|
|
53504
53696
|
}
|
|
53505
53697
|
const installOptions = { global: effectiveGlobal };
|
|
53506
53698
|
const results = [];
|
|
53699
|
+
const hookRegistrationResults = [];
|
|
53700
|
+
const successfulHookFiles = new Map;
|
|
53507
53701
|
const unsupportedByType = {
|
|
53508
53702
|
agents: include.agents ? selectedProviders.filter((provider) => !getProvidersSupporting("agents").includes(provider)) : [],
|
|
53509
53703
|
commands: include.commands ? selectedProviders.filter((provider) => !getProvidersSupporting("commands").includes(provider)) : [],
|
|
@@ -53578,6 +53772,11 @@ function registerMigrationRoutes(app) {
|
|
|
53578
53772
|
const batches = await Promise.all(discovered.hookItems.map(async (hook) => {
|
|
53579
53773
|
const batch = await installPortableItems([hook], providersForType, "hooks", installOptions);
|
|
53580
53774
|
tagResults(batch, "hooks", hook.name);
|
|
53775
|
+
for (const result of batch.filter((entry) => entry.success && !entry.skipped)) {
|
|
53776
|
+
const existing = successfulHookFiles.get(result.provider) ?? [];
|
|
53777
|
+
existing.push(basename9(result.path));
|
|
53778
|
+
successfulHookFiles.set(result.provider, existing);
|
|
53779
|
+
}
|
|
53581
53780
|
return batch;
|
|
53582
53781
|
}));
|
|
53583
53782
|
for (const batch of batches) {
|
|
@@ -53585,7 +53784,19 @@ function registerMigrationRoutes(app) {
|
|
|
53585
53784
|
}
|
|
53586
53785
|
}
|
|
53587
53786
|
}
|
|
53588
|
-
const
|
|
53787
|
+
for (const [provider, files] of successfulHookFiles) {
|
|
53788
|
+
if (files.length === 0)
|
|
53789
|
+
continue;
|
|
53790
|
+
const mergeResult = await migrateHooksSettings({
|
|
53791
|
+
sourceProvider: "claude-code",
|
|
53792
|
+
targetProvider: provider,
|
|
53793
|
+
installedHookFiles: files,
|
|
53794
|
+
global: effectiveGlobal
|
|
53795
|
+
});
|
|
53796
|
+
recordHookRegistrationOutcome(provider, mergeResult, warnings, hookRegistrationResults);
|
|
53797
|
+
}
|
|
53798
|
+
const responseResults = [...results, ...hookRegistrationResults];
|
|
53799
|
+
const sortedResults = sortPortableInstallResults(responseResults);
|
|
53589
53800
|
const counts = toExecutionCounts(sortedResults);
|
|
53590
53801
|
const providerCollisions = detectProviderPathCollisions(selectedProviders, installOptions);
|
|
53591
53802
|
annotateResultsWithCollisions(sortedResults, providerCollisions);
|
|
@@ -53594,7 +53805,7 @@ function registerMigrationRoutes(app) {
|
|
|
53594
53805
|
warnings,
|
|
53595
53806
|
effectiveGlobal,
|
|
53596
53807
|
counts,
|
|
53597
|
-
discovery: toDiscoveryCounts(
|
|
53808
|
+
discovery: toDiscoveryCounts(results),
|
|
53598
53809
|
unsupportedByType,
|
|
53599
53810
|
providerCollisions
|
|
53600
53811
|
});
|
|
@@ -56780,7 +56991,7 @@ var package_default;
|
|
|
56780
56991
|
var init_package = __esm(() => {
|
|
56781
56992
|
package_default = {
|
|
56782
56993
|
name: "claudekit-cli",
|
|
56783
|
-
version: "3.37.0-dev.
|
|
56994
|
+
version: "3.37.0-dev.4",
|
|
56784
56995
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
56785
56996
|
type: "module",
|
|
56786
56997
|
repository: {
|
|
@@ -98318,8 +98529,11 @@ async function migrateCommand(options2) {
|
|
|
98318
98529
|
});
|
|
98319
98530
|
if (mergeResult.success && mergeResult.hooksRegistered > 0) {
|
|
98320
98531
|
logger.verbose(`Registered ${mergeResult.hooksRegistered} hook(s) in ${hooksProvider} settings.json`);
|
|
98321
|
-
} else
|
|
98322
|
-
|
|
98532
|
+
} else {
|
|
98533
|
+
const feedbackMessage = mergeResult.error ?? mergeResult.message;
|
|
98534
|
+
if (feedbackMessage) {
|
|
98535
|
+
f2.warn(feedbackMessage);
|
|
98536
|
+
}
|
|
98323
98537
|
}
|
|
98324
98538
|
}
|
|
98325
98539
|
const plannedSkillActions = plannedExecActions.filter((action) => action.type === "skill").length;
|